android camera continuous focus (on demand) - android

i am using samsung galaxy s2,i ve noticed that in video recording mode when i press record button the camera continuously focus on the object.but in preview mode it does n't.i want to use continuous auto focus in my application.it doesn't support this type of parameter.
question on auto focus
the auto focus call back hold focus for some amount of time and after that it looses.
and again most of the proposed solutions are not reliable.proposed solutions.
can u suggest me a perfect solution which will act as inbuilt camera application.(in video recording.)
thank you!have a nice day!!

Did you try the continuous autofocus mode FOCUS_MODE_CONTINUOUS_VIDEO (starting from API level 9)? In this mode, focus is automatically adjusted permanently (it worked well for me)
See the documentation at http://developer.android.com:
Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO
Camera.Parameters.html#setFocusMode(java.lang.String)

Related

How to keep focus of android camera2?

I am trying to take 6 photos by rotating my phone for each 60 degree using camera2 api.
First time I need to take first photo using autofocus when focus area is the center of my screen.
And I have to keep this focus for the next 5 photos, it should not try to get new focus.
I have been trying to make it for a week. But the results are not as expected. I tried many ways and I faced few problems: images are blurry, the camera tries to find new focus for each photos, and so on.
It would be great if someone shows me direction :)
i don't know exact answer of your question..but i will try to tell you something's about your Question.
How to use flash without stopping camera feed?
above is link of my Answer.check that
i think ,in your App you have to put some condition for that.
Set your Flash mode regarding Rotation or whatever as you want..Like whenever Your Rotation is this, then Your Flash will this.
Like [On,Auto,Flash].
Hope this will help you...(:

Android focus and exposure stops working with FOCUS_MODE_CONTINUOUS_PICTURE

I'm making a small camera app, and I'm having a little problem with capturing several pictures.
First I found that after every mCamera.takePicture() we need to call mCamera.startPreview() on onPictureTaken() callback to keep seeing the preview after the first shot.
So, after this discovery, I've added a code to set the camera focus mode to FOCUS_MODE_CONTINUOUS_PICTURE in initialization, because it was not getting focus automatically.
What happens is that Auto Exposure and Auto Focus stop to work after the first shot.
I found that the Auto Exposure and Auto Focus works for a brief time after the shots and blocks.
Is there any function I need to call to restart this features after a shot?
Thank you.
This answer will probably work for you:
I fixed the issue by calling camera.cancelAutoFocus(). This caused continuous autofocus to kick in again.
After you take the shot, call camera.cancelAutoFocus()

Controlling the camera flash on the Galaxy Nexus and Note from within a service

I'm wanting to control the camera led on the Galaxy Nexus and Note.
I've managed to control it using the open source app search-light here: http://code.google.com/p/search-light/
My only issue is that I'm wanting to control flashing the LED from a service and not from within an activity and it seems the way they get it working is by using SurfaceView and rendering one visible dot onto the screen.
I don't mind starting an activity if needed as long as there's some way to stop it from interfeering with what's currently active on the screen.
Any suggestions?
Thanks

Is there an efficient way to do "continuous" auto-focus?

I'm working on an android app using the camera, and the only means of focusing the image I've found requires the use of the built-in auto-focus. Its functionality is great when you're looking to take a picture, but when you're working with video it's a whole other story.
Is there a way to repeatedly adjust the focus without having to completely re-set the current focus?
See this.
edit
Not that I believe the site will go away anytime soon, but just in case:
public static final String FOCUS_MODE_CONTINUOUS_VIDEO
Continuous auto focus mode intended for video recording. The camera continuously tries to focus. This is ideal for shooting video. Applications still can call takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback) in this mode but the subject may not be in focus. Auto focus starts when the parameter is set. Applications should not call autoFocus(AutoFocusCallback) in this mode. To stop continuous focus, applications should change the focus mode to other modes. Constant Value: "continuous-video"

Video camera auto focus

I developed a small video camera application. It all works fine except focus.
I understand I need to call camera.autofocus, but I don't really know where is the right place to put the call it.
Anyone ever succeeded in autofocusing a video camera on android?
Thank
Eli
It's probably a matter of preference based on how you think users will use your app.
I think a common convention is to do an auto-focus when the user touches the scene in the preview. Most OEM camera apps seem to do this.
Doing auto-focus after zooming is also a common thing.
Finally, you might want to have a look at the zxing project (bar code scanner app) which has a nifty continuous auto focus approach that might be of use, though since youre capturing video, it might not be ideal as the focus transitions might be too noticeable.
http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/camera/AutoFocusCallback.java?r=1698

Categories

Resources