thegrizzlylabs / geniusscan-sdk-demo

Demo apps for Genius Scan SDK
30 stars 38 forks source link

Xamarin & ScanFlow: Is it possible to require a minimum document size for successful scan? #68

Open MihaMarkic opened 1 year ago

MihaMarkic commented 1 year ago

By default document is fine as long as it is recognized, no matter it's relative size to camera size. i.e. if user takes a photo from a distance it will still produce a valid result, regardless of documents size in pixels. I'd like to enforce a minimum ratio (or area) that document has to fill to product an image with enough pixels. Basically I'd pass a percentage factor and UI would refuse to scan smaller documents (perhaps with a feedback of different color). Is it possible with ScanFlow? If not, with custom UI?

MihaMarkic commented 1 year ago

By checking Android demo-custom I've found out that I could detect document size within onBorderDetectionResult and act accordingly. However I'd prefer to check invalid sizes during border detection, not only after it is detected. And I'd prefer ScanFlow if possible.

guillaume-tgl commented 1 year ago

That's not possible with the ScanFlow (even though it's in our plans to support a similar feature). However, you're right, if you have your custom UI, you can filter out documents that don't have the minimum required size and ask the user to move closer to the document for example.

MihaMarkic commented 1 year ago

Hi, got it. But it'd be even better if I could show to user feedback in real time, i.e. by using a different overlay color. That way user doesn't have to wait for document detection and can adjust position immediately. Do you have any timeline for ScanFlow implementation?

guillaume-tgl commented 1 year ago

You're right, that's not ideal. We'll try to to either provide this in the ScanFlow or make it possible in the Core module. What's your need exactly? You'd like each scan to be at least a certain resolution?

MihaMarkic commented 1 year ago

What's your need exactly? You'd like each scan to be at least a certain resolution?

Exactly. Because of OCR.