How can i change orientation without ruin camera settings?
Hi, I'm new with OpenCV and this is my problem:
I'm trying to change the default camera orientation, after search i found the solution.
I added this lines to the JavaCameraView.java file that including in the OpenCV 2.4.6 library:
setDisplayOrientation(mCamera, 90);
mCamera.setPreviewDisplay(getHolder());
while setDisplayOrientation implemented like this:
protected void setDisplayOrientation(Camera camera, int angle){
Method downPolymorphic;
try
{
downPolymorphic = camera.getClass().getMethod("setDisplayOrientation", new Class[] { int.class });
if (downPolymorphic != null)
downPolymorphic.invoke(camera, new Object[] { angle });
}
catch (Exception e1)
{
}
}
My problem now is that the call to "mCamera.setPreviewDisplay" method ruin all the other settings of the camera, so now i can't play with this settings (Like change the camera priview to gray, change size, distance etc...)
What can i do to fix this?
Thanks!
This solution works perfectly for me. Now the camera preview orientation is normal and full screen, but frame rate(fps) is decreased from 20-30fps to 10-12fps. in my application it is most important to get maximum frames, so it would be great if me fps is intact.