Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can i change orientation without ruin camera settings?

Hi, I'm new with OpenCV and my problem is this:

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!

How can i change orientation without ruin camera settings?

Hi, I'm new with OpenCV and this is my problem is this: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!

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!