googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.45k stars 2.9k forks source link

[Bug report] Scanned document is roatated by 180° #843

Open ymaskin opened 1 week ago

ymaskin commented 1 week ago

Describe the bug In about 50-70% of the time, the document I scan is rotated by 180 degrees and I need to rotate it manually. It's a really bad UX.

To Reproduce Example Steps to reproduce the behavior in the sample app:

  1. Scan a document
  2. Look at the result
  3. It will be scanned upside down (If it's correctly showing. retry 2-3 times)

Expected behavior The default rotation should be most of the time in the same way as the actual scanned document

SDK Info:

Smartphone:

ai-plays commented 1 week ago

Could you share more info about what type of document you are scanning, if possible, some images would be helpful.

There is an auto-rotation functionality in the scanner: when there is text detected, it will try to keep the text upwards.

Also when you do the scanning, is your phone kept mostly in parallel to the ground? In such case, the original image captured could be upside. Auto-rotation is designed to deal with that. However, if it is not triggered, e.g. due to no text, the original wrong orientation would be kept.

mebjas commented 1 week ago

Can you also share some image samples where this is easy to reproduce. This is an area we are actively working on to bring improvements.