Weird image using samsung s10e with camera api2

98 Views Asked by At

Phone: samsung s10e

Android 11

API Level 30

I made an app for android samsung s10e which takes an image using the camera api 2 in android. https://developer.android.com/reference/android/hardware/camera2/package-summary

I was able to take and save images. But sometimes the camera makes some weird looking images like the one below:

Bad Image

but it should look like this

Good Image

I tried to deactivate some properties of the camera request like:

set(CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE, CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE_OFF)
set(CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE, CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE_OFF)
set(CaptureRequest.DISTORTION_CORRECTION_MODE, CaptureRequest.DISTORTION_CORRECTION_MODE_OFF)
set(CaptureRequest.EDGE_MODE, CaptureRequest.EDGE_MODE_OFF)
set(CaptureRequest.JPEG_QUALITY, 100.toByte())

But it didn't help.

Am I doing something wrong here? I would appreiciate any help!. Thanks!

Mouhammad

1

There are 1 best solutions below

1
Eddy Talvala On

Are you setting off any vibrations (from notifications or similar) during your testing? The bad images look like the vibrator activated during it.

Otherwise, it looks like optical image stabilization could be malfunctioning. Turning it off may not help, since the OIS magnets have to be activated no matter whether OIS is actively adjusting the lens, since otherwise the lens will just bounce around loosely.