mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

[Document Scanner bug] Low document resolution on some Samsung devices (including A32)

Open MihaMarkic opened this issue 10 months ago • 7 comments

Describe the bug Taken document photo is in really low resolution (i.e. 976x1346) instead of something like (3000x4000) for some phones. This is happens probably because of the bug in CameraX library used by Document Scanner: https://issuetracker.google.com/issues/162121234?pli=1

Assuming this is it, a library dependency update should do the trick.

To Reproduce Acquire a document using Document scanner.

Expected behavior Document resolution should be way higher, something like 3000x4000.

SDK Info:

  • SDK ML Document Scanner 16.0.0-beta1

Smartphone:

  • Device/Simulator: Samsung A32

MihaMarkic avatar Feb 27 '25 15:02 MihaMarkic

Thanks for flagging.

Did you observe this issue, when the document was almost covering the full portion of the camera viewfinder?

mebjas avatar Feb 28 '25 21:02 mebjas

@mebjas Yes, sure. Attached are photos from a Pixel 6a and A32. Notice the difference in resolution and how bad the A32's one is. I'm pretty sure that's the issue I've mentioned.

Image Image

MihaMarkic avatar Mar 01 '25 11:03 MihaMarkic

What is the first and second image in this case?

mebjas avatar Mar 03 '25 04:03 mebjas

First is taken with Samsung A32 while the second (better one) is taken with a Pixel 6a. Same document was scanned and in both cases the document occupied most of the area of viewfinder.

MihaMarkic avatar Mar 03 '25 07:03 MihaMarkic

Also note that main camera on A32 is a 64 MP one.

MihaMarkic avatar Mar 03 '25 07:03 MihaMarkic

Same issue on different real devices, the package was working fine before but now I face the same issue

mohamedsalah83 avatar Mar 17 '25 18:03 mohamedsalah83

From our testing, it seems that on devices with several rear-facing cameras, ML-Kit is picking the wrong one in some cases. We can reproduce 100% on Samsung Galaxy Tab Active 3 and Active 5 devices. The result is we need to put the devices about 18 inches away to get the whole page, and the result is grainy and poor quality. Other document scanning SDKs perform much better on these devices, whereas on my Galaxy phone, we can come in much closer to the page and get excellent results. I have looked for a way to override the camera selection in ML-Kit but haven't found anything usable. Hoping for a fix from Google.

stechnique avatar Oct 15 '25 12:10 stechnique