Unexpected cropping when capturing images using ZERO_SHUTTER_LAG on Pixel 8 Pro

66 views
Skip to first unread message

SVP

unread,
Jan 20, 2024, 5:56:13 PMJan 20
to Android CameraX Discussion Group
When using ZERO_SHUTTER_LAG on a Pixel 8 Pro some unexpected cropping occurs when capturing images.

The issue is not encountered using the same implementation on a Samsung S20 5G.

Important to note is that the Pixel does not support ZSL (i.e. isZslSupported() returns false) while it is on the Samsung.

However when using either CAPTURE_MODE_MINIMIZE_LATENCY (which should be the fallback mode when ZERO_SHUTTER_LAG is not supported) or  CAPTURE_MODE_MAXIMIZE_QUALITY, cropping does not occur on the Pixel.

I managed to replicate the issue using the the CameraXBasic sample on Github (with some modifications, mainly in the form of updating dependencies to allow using ZSL). Happy to share a version of that if needed but below is probably the most relevant part of the code:

// Preview
preview = Preview.Builder()
.build()

// ImageCapture
imageCapture = ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_ZERO_SHUTTER_LAG)
.setTargetRotation(rotation)
.setFlashMode(ImageCapture.FLASH_MODE_OFF)
.build()

// ImageAnalysis
imageAnalyzer = ImageAnalysis.Builder()
.setTargetRotation(rotation)
.build()
// The analyzer can then be assigned to the instance
.also {
it.setAnalyzer(cameraExecutor, LuminosityAnalyzer { luma ->
// Values returned from our analyzer are passed to the attached listener
// We log image analysis results here - you should do something useful
// instead!
Log.d(TAG, "Average luminosity: $luma")
})
}

A quick fix on my end would be to query whether ZSL is supported and change capture mode accordingly rather than rely on the fallback but the behavior I described above makes me wonder if there's anything I'm missing? 

Thanks!
minimize_latency.jpg
maximize_quality.jpg
zero_shutter_lag.jpg

Kailiang Chen

unread,
Jan 21, 2024, 1:24:55 PMJan 21
to Android CameraX Discussion Group, SVP
Hi Victor, 

Thanks for reporting this issue.
I've created a ticket for tracking: https://buganizer.corp.google.com/issues/321544895

I'll look into it. There might be some different parameter settings affecting FoV by OEMs, if you force to set ZSL mode.
I'll dumpsys the camera settings to compare.

Glad to know you could guard this issue via the device capability check.

SVP

unread,
Jan 21, 2024, 5:15:04 PMJan 21
to Android CameraX Discussion Group, kail...@google.com, SVP
> There might be some different parameter settings affecting FoV by OEMs, if you force to set ZSL mode.

Interesting! Thanks for sharing this information. I will definitely be monitoring the issue.
Reply all
Reply to author
Forward
0 new messages