getbouncer / cardscan-ios

A library for scanning credit and debit cards
MIT License
203 stars 67 forks source link

Cleaning up bounding box logic and surface them #286

Closed kingst-stripe closed 3 years ago

kingst-stripe commented 3 years ago

The new functionality in this PR is to expose bounding boxes for the captured completion loop. We'll use this immediately for redacting captured samples but could be useful later if we want to move to server inference for verify.

This PR also fixes a bug with the way that we used to expose bounding boxes where the new code will use the sorted and filtered boxes instead of the raw boxes from the OCR model.

There will be a companion PR for verify coming soon.

Note: this PR changes a public interface so we'll need to bump to 2.1.0 when we ship it. However, it's very unlikely that anyone other than us is using these interfaces -- the main Scan abstractions are unaffected.