As in title. How to make ZSL still picture with Camera 2 API? Should I only use TEMPLATE_ZERO_SHUTTER_LAG? Should I also add CONTROL_ENABLE_ZSL in CaptureRequest? Should I do precapture sequence before taking still? Currently I do not have any particular code, just thinking how do it.
There is IMHO good example of using Camera 2 API by Android Open Source Project:
https://android.googlesource.com/platform/packages/apps/Camera2/+/9c94ab3/src/com/android/camera/one/v2/OneCameraZslImpl.java
It uses TEMPLATE_ZERO_SHUTTER_LAG but does not use CONTROL_ENABLE_ZSL.
Related
I do not know much about Camera API, though i need to use frames from a capturing video with more then 30fps with a good quality camera(S9).
Can anybody suggest code for the same.
I tried to find fit code for this but i am failed.
Thanks in Advance
Mohit
You are lucky, since not so long ago a component of android JetPack was released, called CameraX. Sadly it is still in alpha stage, meaning that you should avoid using it in production since it might have breaking changes in the future. This component was built on top of Camera 2 API, witch is a low level API for working with camera.
If you plan to use your app in production I highly recommend to use Camera 2 API, it is low level, however you have the full control over the camera.
Here is an example to get you started.
I'm planning to make a camera app that you can take a photo with a background image.
I guess there will be a need to use a Surfaceview? But the main problem is since the Camera is deprecated
there might be a need to use camera2 for android. I want to make a camera app in portrait mode but are there any
samples or tip? I googled but wasn't able to find a decent one. I would love to hear from you.
If you want to start with Camera2 API, this link will help you understand basics.
android-Camera2Basic(Github)
It is not necessary to use SurfaceView as you will see from code
that TextureView can also fulfill your requirement
The HdrViewfinder sample app uses SurfaceView with camera2, though it doesn't lock itself into portrait mode. But that's a relatively simple change.
Of course, camera2 was only added in Android 5.0, so if you need to support 4.0, you need to use the old camera API.
I tried few codes from here :
How to capture an image in background without using the camera application
and this
Android Camera API Tutorial.
This question may seem duplicated, but I really want to know that can this be done over API level 21?
Thanks in advance.
According to android.developer.com, no.
https://developer.android.com/reference/android/hardware/Camera.html
"Important: Call startPreview() to start updating the preview surface. Preview must be started before you can take a picture."
I am to start working on an Android Custom Camera App. I just want to know is there any way to add the following features to my app:
Beauty Level
Red Eye Removal
Acne Removal
I just want to know that if it is possible, can someone suggest or give me any idea how can code it into my app.
Though I am familiar with Android Camera API functions, and worked on several simple custom camera apps.
Thanks in advance
For beginning, you can use FaceDetector to detect faces in the picture.For example , you can remove Red eyes by searching for Red pixels in the picture and try to decrease red level of them.And also , you can use OpenCV for detecting eyes.I found a sample for eye detection in Here
Is it possible to control autofocus feature of Android camera, using OpenCV's libnative_camera*.so ?
Or maybe it's possible to manually set focus distance?
Is there alternative approach (May be, it's better to use Android API to control camera and then grab frame in onPreview events and pass it to native code)?
If your intention is to control the camera on your own, then Android Camera APIs suck. As such Android APIs suck when it comes to offering your hardware camera device number to JavaCV native camera library. Without a native device number, JavaCV would be clueless to connect to the appropriate camera (Front or Back).
If your intention is only to perform object detection and stuff, well Android Camera APIs coupled with JavaCV should work. Setup a callbackBuffer of sufficient size, setPreviewCallbackWithBuffer, setup sufficient preview frame-rate, and once you start getting preview-frames in ImageFormat.NV21 format (mind you!!, this is the only format supported for preview-frames even in ICS), pass them off to JavaCV for performing object detection.
AutoFocus on Android Camera APIs suck big time. I have been researching for over a month for feasible solutions.