How many devices in percent doesn't support face detection feature? - android

In my application, I use OpenCV for face detection throw ImageReader and jni.
It works ok, but performance of that solution isn't so good as I wanted, also I want to reduce size of my app.
I read some information about face detection in camera 2 API, and I have some questions about it.
1) Why the function below can return STATISTICS_FACE_DETECT_MODE_OFF?
Not all devices support face detection feature? What type of devices doesn't support it and why? Do you know any examples of unsupported devices? In my project, I use only front facing camera, does it matter to me?
characteristics.get(CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES);
2) What about performance? Is there any performance difference between STATISTICS_FACE_DETECT_MODE_FULL and STATISTICS_FACE_DETECT_MODE_SIMPLE?

Related

Capturing a photo from only one lens, in dual-camera phones?

Dual-camera smartphones are relatively new in the market, but I was wondering if a camera app could explicitly choose to use only one lens, or to manually retrieve separate input from each lens.
I couldn't find any Android API documentation that is specifically designed for dual-lens phones, so I guess this is a hardware/OS-level implementation that would be difficult to override or bypass.
Android's Camera HAL documentation page doesn't mention dual-lens devices as well, but it does seem to strengthen that assumption.
I don't have much experience with iOS, but I guess it wouldn't be easier.
So the question is - how, if at all, would such task be possible on either Android or iOS?
Edit: seems that in iOS it is possible, as explained here (thanks to the4kman for pointing this out in the comments). So I guess the question remains for Android only.
Different vendors provide dual cameras for their Android devices in hope to improve the photo quality for average user, more often than not, specifically tuned for special conditions like challenging illumination or distortions of selfie mode. Each vendor uses proprietary technologies to handle dual cameras, and they are not interested to disclose the implementation details. The only public interface they support is a virtual single camera which is more or less compliant with Google specs.
This does not mean that you cannot be lucky chance be able to unlock the camera for some specific device. Playing with photo modes, or scenes, or other parameters, may accidentally give you a picture that only passed one lens of the dual setup.
In some rare cases some documentation is actually present. E.g. HTC let you control stereo vs. mono setting for the circa'2011 Evo 3D device.
Another example: this review implies that for Huawei P9 and P10, you will actually get one-camera result if you choose monochrome mode.
A recent article gives some perspective how different are approaches to dual camera among different manufacturers.

how can i set the camera function that anti-shake(image Stabilizer) at android

I've made a Camera App.
I want to add the functionality of anti-shake.
But I could not find the setting for anti-shake(image Stabilizer).
Plz Help me!!
Usually Image Stabilizer is a built-in camera feature, while OIS (Optical-Image-Stabilization) is a built-in hardware feature; by now really few devices support them.
If device hasn't a built-in feature, i think you cannot do anything.
Android doesn't provide a direct API to manage image stabilization, but you may try:
if android.hardware.Camera.getParameters().getSupportedSceneModes(); contains steadyphoto keyword (see here), your device supports a kind of stabilization (usually it shots when accelerometer data indicates a "stable" situation)
check android.hardware.Camera.getParameters().flatten(); for a "OIS" or "image-stabilizer" keyword/values or similar to use in Parameters.set(key, value);. For the Samsung Galaxy Camera you should use parameters.set("image-stabilizer", "ois");//can be "ois" or "off"
if you are really boring you may try reading the accelerometer data and decide to shot when the device looks steady.
Good luck.
If you want to develop software image stabilizer, OpenCV is helpful library for you. Following is the one of the way to stabilize the image using Feature.
At first, you should extract feature from image using feature extractor like SIFT, SURF algorithm. In my case, FAST+ORB algorithm is best. If you want more information, See this paper
After you get the features in images, you should find matching features with images.there are several matcher but Bruteforce matcher is not bad. If Bruteforce is slow in your system, you should use a algorithm like KD-Tree.
Last, you should get geometric transformation matrix which is minimize error of transformed points. You can use RANSAC algorithm in this process.
You can develop all this process using OpenCV and I already developed it in mobile devices. See this repository

What is Best? JavaCV(OpenCV) or FaceDetector in android?

I'm going to implement face recognition in my android application. Which one is best to use, JavaCV or FaceDetector? Please suggest one to me.
FaceDetector may be using a C++ implementation which would be faster. I would suggest using FaceDetector for that reason as well as limiting your application size. Including the JavaCV Jar will increase application size which will make people less likely to download it and more likely to uninstall it to free up space on the phone.
If FaceDetector doesn't work as well as you want it to, use JavaCV. FaceDetector uses eyes only to detect faces so it will not detect profiles, or faces that do not have both eyes visible.
FaceDetector Note: The width of the image must be even.

OpenCV for Android: Autofocus native camera

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.

Android Face detection support

So I know that android Ice Cream Sandwich supports face detection. So i recently upgraded my asus transformer to a tablet that has face detection unlock enabled and that works great. Now when i go to write a program using face detection, when i try to find the max number of faces supported I always get 0 and my app always crashes when i try to begin tracking faces. Why is this if my tablet clearly supports face detection? Am i doing something wrong? The code I'm using to check if face detection is supported is posted below:
Camera.Parameters params = mCamera.getParameters();
System.out.println("Max num faces is!!!! :" + params.getMaxNumDetectedFaces());
And the full code I'm using can be found here:
https://docs.google.com/file/d/0B2Nu5U2Cz81qZExGQ25sWVdRd21IOExUUTZsZzFoZw/edit
Face detection is not face recognition. Face detection is done via something like Haar cascade and determines presence of faces in picture. This feature can be contained in android camera application, but must not - API is there but it says that it supports max 0 faces ( means, nothing, go away, we just satisfied inteface)
Face unlock works differently - it does not need to locate face, so it can use some pattern matching techniques to recognize it.
Here is reading pointer for face detection:
http://www.richardnichols.net/2011/01/java-facial-recognition-haar-cascade-with-jjil-guide/
And you can implement it yourself via camera preview feature even if you camera software sdoes not support this

Categories

Resources