Shape detection using opencv and java
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
// get the camera frame as gray scale image
Mat gray = null;
if (DETECT_RED_OBJECTS_ONLY)
{
gray = inputFrame.rgba();
}
else
{
gray = inputFrame.gray();
}
// the image to output on the screen in the end
// -> get the unchanged color image
Mat dst = inputFrame.rgba();
Here code is used ----org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame; But i want to do something like this.I want to convert this android code to opencv java
public static Mat onCameraFrame(Mat inputFrame) {
Mat gray = null;
if (DETECT_RED_OBJECTS_ONLY) {
gray = inputFrame.rgba();
} else {
gray = inputFrame.gray();
}
// the image to output on the screen in the end
// -> get the unchanged color image
Mat dst = inputFrame.rgba();
now there is no such a thing rgba()
& gray()
.
Please anyone help me to solve this
Hey buddy. I can guarantee you you'll have a hard time getting someone to actually help you with the current status of your question. You literally just dumped all of your code here and said, here guys fix this. 1: Look at your own code and extract the part that deals with your problem. 2: Provide more details to your question. e.g. What is the current output of your program? What is your desired output? Does it fail? If yes, where? My point is, you need to do work and make it easier for us to help you. Dumping entire programs and expecting us to not only answer your question but also do the heavy lifting as well, normally leads to closed questions. Consider reading this as well to have a better grasp of how to ask questions
And what exactly do you mean by Could anyone please help me to build this code. Don't you have a compiler?
@eshirima OK understood. Now I have edited my question.