Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Camera preview is sideways

$
0
0
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?***

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>