Ask Your Question

EMGRobotics's profile - activity

2016-07-04 16:14:19 -0600 received badge  Notable Question (source)
2015-03-31 22:24:47 -0600 received badge  Popular Question (source)
2013-02-06 16:18:08 -0600 commented answer OpenCV4Android - Changing Camera Focus Mode

I noticed in OpenCV 2.4,3,2 file SampleJavaCameraView.java there are methods for getEffect(), setEffect(), getResolution() and setResolution()

I do not see anything concerning focus. I thought maybe focus could be set using the setEffect() method but that does appear to be possible.

Are you saying I should add a getFocus() and setFocus() method? If so, I will using the resolution and effect as a model and will submit the change to the OpenCV team.

2013-02-06 03:01:32 -0600 asked a question OpenCV4Android - Changing Camera Focus Mode

JavaCameraView sets the camera focus mode to FOCUS_MODE_CONTINUOUS_VIDEO.

For my application I would like to set the camera to FOCUS_MODE_INFINITY.

Obviously, I can simply change the library and rebuild, but that would require that I release my product as a static build ( something I would like to avoid ).

To be clear, I am not trying to change the camera focus mode after the camera is instantiated.
I just need to set the camera focus mode at init.

My questions - Is there currently a method to set the Android camera focus to infinity? Is there a current effort to add camera focus mode changing support?

thanx

JavaCameraView.java (OpenCV 2.4.3.2)

               params.setPreviewFormat(ImageFormat.NV21);
                Log.d(TAG, "Set preview size to " + Integer.valueOf((int)frameSize.width) + "x" + Integer.valueOf((int)frameSize.height));
                params.setPreviewSize((int)frameSize.width, (int)frameSize.height);

                List<String> FocusModes = params.getSupportedFocusModes();
                if (FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
                {
                    params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
                }

                mCamera.setParameters(params);
                params = mCamera.getParameters();