Distorted analyses image in unfolded mode

59 views
Skip to first unread message

Anton Ivanov

unread,
Oct 30, 2025, 5:05:25 PM (6 days ago) Oct 30
to Android CameraX Discussion Group
Good time of day,
On Samsung Galazy Z Fold4 analysis images are distorted(shrunk along x axis, see attachment) when the device is used in unfolded mode. Folded mode works fine. 
My configuration is Preview, Analysis, Video(also tried Preview, Analysis).
It seems like a device specific bug. Could you advice on workaround? Should I report a bug?
Screenshot 2025-10-30 at 20.58.27.png

Eino-Ville Talvala

unread,
Oct 30, 2025, 8:47:23 PM (6 days ago) Oct 30
to Anton Ivanov, Android CameraX Discussion Group
Hi Anton -

When you say analysis images are stretched, do you mean the screenshot you include is not the preview output, but you taking images from the analysis callbacks and drawing them yourself? Or just that when you add an analysis stream, preview becomes incorrect?  And that without analysis, preview is correct?



CONFIDENTIAL

This  e-mail  and  any  attachments  are  confidential  and  intended  solely  for  the  addressee  and  may  also  be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this e-mail in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this e-mail or its attachments. Internet communications are not guaranteed to be secure or virus-free. Revolut does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this e-mail may be monitored by Revolut for operational or business reasons. Any  opinion  or  other  information  in  this  e-mail  or  its  attachments  that  does  not  relate  to  the  business  of Revolut is personal to the sender and is not given or endorsed by Revolut. Registered  Office: 30 South Colonnade, London E14 5HX, United Kingdom. Main Office: 30 South Colonnade, London E14 5HX, United  Kingdom. Revolut  Ltd  is  authorised  and regulated by the Financial Conduct Authority under the Electronic Money Regulations 2011, Firm Reference 900562.

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/9b9a95a6-1151-4d1b-8bad-62f176caa109n%40android.com.

Anton Ivanov

unread,
Oct 31, 2025, 8:16:14 AM (5 days ago) Oct 31
to Android CameraX Discussion Group, etal...@google.com, Android CameraX Discussion Group, Anton Ivanov
Hi,
"do you mean the screenshot you include is not the preview output," - that's correct. It's an output of ImageAnalysis usecase. 
"but you taking images from the analysis callbacks and drawing them yourself" - that is correct. The screenshot above is just a bmp rendered in Android Studio using built in functionality.

Charcoal Chen

unread,
Nov 2, 2025, 10:16:04 PM (2 days ago) Nov 2
to Anton Ivanov, Android CameraX Discussion Group, etal...@google.com
Hi,

Mostly, this issue is a device specific issue and can only be completely resolved from the OEM.
Could you try the following approaches to see whether any one can workaround the issue?

1. Upgrade the device OS to the latest one if possible
2. Use ResolutionSelector to select a resolution different from the currently selected one for the ImageAnalysis.
    - maybe a smaller or larger size with the same aspect ratio
    - or, a size of different aspect ratio
3. Try to set ResolutionSelectors to the other UseCases to select sizes of different aspect ratio. (sometimes, this kind of problem occurs with specific streams + output sizes combinations)

If you can find the issue only occurs on specific ImageAnalysis output sizes, please kindly share the info to us. So that we can make our quirks to exclude these problematic output sizes from being used on the device.
Thanks.


Anton Ivanov

unread,
Nov 3, 2025, 9:13:04 AM (2 days ago) Nov 3
to Android CameraX Discussion Group, charco...@google.com, Android CameraX Discussion Group, etal...@google.com, Anton Ivanov
Hey,
I guess I found the problem.
ResolutionSelector
.Builder()
.setResolutionStrategy(
ResolutionStrategy(
resolution.toVideoSize(),
ResolutionStrategy.FALLBACK_RULE_CLOSEST_HIGHER_THEN_LOWER
)
)
.setAspectRatioStrategy(AspectRatioStrategy.RATIO_16_9_FALLBACK_AUTO_STRATEGY)
.build()
if .setAspectRatioStrategy(AspectRatioStrategy.RATIO_16_9_FALLBACK_AUTO_STRATEGY) removed from the builder the image is correct.
So the problematic case is - unfolded device with setAspectRatioStrategy(AspectRatioStrategy.RATIO_16_9_FALLBACK_AUTO_STRATEGY) set to ImageAnalysis.

Charcoal Chen

unread,
4:40 AM (5 hours ago) 4:40 AM
to Android CameraX Discussion Group, anton....@revolut.com, Charcoal Chen, Android CameraX Discussion Group, Eino-Ville Talvala
Thanks for providing the info.

We do not have the Samsung Galaxy Z Fold4 device.
Can you help to use CameraFilter to select each available output sizes for ImageAnalysis and let me know which output sizes can cause the problem?
If we can get the information, I can add some workaround in CameraX side to make those problematic output sizes not be used.
Thanks.

Reply all
Reply to author
Forward
0 new messages