jhoogstraat / fast_barcode_scanner

A flutter plugin that allows your users to scan any type of barcode on iOS and Android
40 stars 64 forks source link

support OCR scanning #67

Open dustin-graham opened 2 years ago

dustin-graham commented 2 years ago

@jhoogstraat , As a shipping and logistics company, my company's app relies on barcode scanning heavily. All of our packages have scannable codes. However, in the real world, printing errors and damaged labels can sometimes make it impossible to scan a code. In most cases though, there's enough information on the shipping label itself to verify that the driver has the correct package. the barcode is often printed with its value directly below it. We have the recipient's name, address, and other identifying information. I recognize that it may seem a bit out of scope for a package titled "fast_barcode_scanner" to also scan text, but performing the OCR using ML Kit and Vision API's in the native code is the ideal place to do it.

What I'm proposing here is that I add a text recognition option to the ML platform implementations. The user can request text recognition in addition to machine-readable codes. For both Vision and MLKit, the implementation of text recognition is very similar to barcodes and I think it would be a clean implementation. What are your thoughts of putting that here?

dustin-graham commented 2 years ago

There are lots of other options besides doing that here. However, those other options require me to initialize new camera controller instances, dependencies on MLKit, etc. In short, I have to re-implement much of what is already done here. It would be really nice to add this capability.

jhoogstraat commented 2 years ago

There were other comments about opening up the plugin to all possible use cases in Vision and MLKit.

I think this might be a great idea long term, if this plugin can provide significant value compared to other solutions.

As for your specific idea: I think everything that allows scanning barcodes faster, with less information or in difficult environments better falls under the current scope of this plugin. Thus in opinion this is a great idea!

Thinking long term, maybe your implementation of OCR can path the way into a generic MLKit/Vision-Plugin by architecturing it with this goal in mind. This does not mean that this plugin will definitely expand beyond barcodes, aber would certainly allow for a rather easy expansion afterwards.