Hi,
I have integrated opencv4android face detection sample. I want to show `Camera` in `Portrait` mode, the thing is the default `JavaCameraView` is rotated 90 degree to the left. I apply some rotation on CameraBridgeView and JavaCameraView but after that `I am unable to detect the faces.`
**CameraBridgeViewBase.java**
deliveAndDrawFrame() {
Matrix matrix = new Matrix();
matrix.preTranslate((canvas.getWidth() - mCacheBitmap.getWidth()) / 2,(canvas.getHeight() - mCacheBitmap.getHeight()) / 2);
if(cameraId == Camera.CameraInfo.CAMERA_FACING_FRONT) {
matrix.postRotate(-degrees,(canvas.getWidth()) / 2,(canvas.getHeight()) / 2);
} else {
matrix.postRotate(degrees,(canvas.getWidth()) / 2,(canvas.getHeight()) / 2);
}
canvas.drawBitmap(mCacheBitmap, matrix, new Paint());
}
The above function has shown the preview right to my requiremnt in Portrait mode. I also adjusted the Camera orientation as
**JavaCameraView**
initializeCamera() {
....
int degrees = getCameraDisplayOrientation();
mCamera.setDisplayOrientation(degrees);
......
}
***Can anyone please let me know what can be the issue? Why after this I am unable to detect the faces?***
↧