问题
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!!
回答1:
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();
containssteadyphoto
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 inParameters.set(key, value);
. For the Samsung Galaxy Camera you should useparameters.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.
回答2:
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
来源:https://stackoverflow.com/questions/23946467/how-can-i-set-the-camera-function-that-anti-shakeimage-stabilizer-at-android