Hi guys!
I’m trying doing something like this OpenCV (Java) : Draw a rectangle region on Camera View is the same work but for me it does not work. I’m using opencv for android version 3.4.10 I also tested it using opencv 3.4.7 but does not work. Here is my code:
@Override
public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
if(mRgba!=null){
mRgba.release();
}
mRgba = inputFrame.rgba();
int w = mRgba.width();
int h = mRgba.height();
Imgproc.rectangle(mRgba, new Point(w * 1 / 3, h * 1 / 3), new Point(
w * 2 / 3, h * 2 / 3 ), new Scalar( 255, 0, 0 ), 5);
return mRgba;
}
The application only is showing the normal image without any rectangle.
However I can see the letters of the fps in blue color.
I don’t know really why it does not work, please guys if you have any idea about how fix it I will appreciate it. Thanks in advance.
PD: I’m using CameraBridgeViewBase… this is an small code from my onCreate() method in my MainActivity.java
cameraBridgeViewBase =(JavaCameraView)findViewById(R.id.java_camera_view);
cameraBridgeViewBase.setVisibility(SurfaceView.VISIBLE);
cameraBridgeViewBase.setCvCameraViewListener(this);