Ask Your Question
2

[Android - Native Camera] Setting ISO (and other camera parameters)

asked 2012-08-20 07:00:40 -0600

Meehow gravatar image

updated 2012-08-20 07:08:32 -0600

sammy gravatar image

Is it possible to set camera parameters, such as the ISO, when using Android OpenCV's Native Camera?

When using the regular Android Camera, I can set the ISO using something like this:

mCamera = Camera.open();
String[] supportedISOs = mCamera.getParameters().get("iso-values").split(",");

Then later

Parameters params = mCamera.getParameters();
// "choice" reflects the user's choice (ie. menu selection)
params.set("iso", supportedISOs[choice]);  
mCamera.setParameters(params);

Though it is a bit of a hack - the ISO isn't exposed in the Android API like for example the WB, but it is still in the camera parameters on most phones. However, when using OpenCV's Native Camera, I don't know of a way to do something similar.

Is it possible? Are there plans to give access to the ISO and other parameters in the Native Camera (like the exposure time / shutter speed)?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
3

answered 2012-08-20 12:39:35 -0600

Rui Marques gravatar image

As far as I know it is currently not possible to do that with Native Camera. I read once someone suggesting a patch to access more camera parameters. Here it is:

http://code.opencv.org/issues/1789

According to this, since version 2.4.0, more parameters can be accessed, but by inspecting the code of the patch, ISO it is not one of them.

I think this is the latest information on your problem, maybe you have to submit a feature request or do a patch yourself. If you are thinking about doing a patch, check the link above, it has the code for the patch that you can learn from.

edit flag offensive delete link more
0

answered 2012-09-03 16:14:52 -0600

Marc J gravatar image

updated 2012-09-03 16:16:03 -0600

I have to test this further, but I'd say the patch is implemented in 2.4.2 even though JavaDoc says for the method VideoCapture.set:

"propId Property identifier. It can be one of the following: * CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream. * CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream. value Value of the property."

This made me think at first, only those two values are valid. But it seems you can use all the constants from Highgui e.g.

mCamera.set(Highgui.CV_CAP_PROP_ANDROID_WHITE_BALANCE,Highgui.CV_CAP_ANDROID_WHITE_BALANCE_SHADE); or mCamera.set(Highgui.CV_CAP_PROP_ANDROID_FOCUS_MODE,Highgui.CV_CAP_ANDROID_FOCUS_MODE_INFINITY);

edit flag offensive delete link more

Comments

Yes it is possible that the javadocs have not been updated.

Rui Marques gravatar imageRui Marques ( 2012-09-04 03:23:01 -0600 )edit
0

answered 2013-07-10 00:07:28 -0600

AnthonyKeane gravatar image

You can get access as you describe, I did an Override of

JavaCameraView.java

, then in the

initializeCamera

I added my desired settings

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-20 07:00:40 -0600

Seen: 7,114 times

Last updated: Jul 10 '13