Ask Your Question
0

How turn off autofocus with CameraBridgeViewBase

asked 2013-09-26 00:41:17 -0600

JenniferDR gravatar image

I'm developing an app for Android 4.2.2, and I want to turn off the autofocus. There is a way to do it if i'm using CameraBridgeViewBase ?

The version of the opencv library is 2.4.5. The specific device in wich that i want the app to work fine is Samsung Galaxy s3

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-09-26 01:22:16 -0600

Moster gravatar image

I dont think you can directly do that with camerabridgeviewbase, but you can use one of the 2 camera classes opencv provides (they inherit from camerabridgeviewbase). I provided 2 full projects for this here: http://answers.opencv.org/question/19796/android-use-autofocus-with-camerabridgeviewbase/#19813

edit flag offensive delete link more
0

answered 2013-09-26 01:38:34 -0600

CameraBridgeViewBase is base class for the two camera view implementations: NativeCameraView and JavaCameraView. If you want to change camera initialization, you need create your view class inherited from NativeCameraView or JavaCameraView and overload some initialization methods you want. In your case I recommend you to use JavaCameraView as a base class, overload initializeCamera method, copy its body from JavaCameraView and remove or re-implement focusing code. Do not forget to replace View class name in layout.xml from JavaCameraView on your own with full package name. See tutorial-3-CameraControl as an example of View class inheritance.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-26 00:41:17 -0600

Seen: 3,477 times

Last updated: Sep 26 '13