mobile_scanner
mobile_scanner copied to clipboard
feat: read inverted datamatrix
Here's a quick stab at adding support for reading inverted data matrixes that the MLKit does not support. The iOS implementation is a bit clumsy (I'm not an iOS coder), but Android one is quite straight forward. Tested and works in Android & iOS. Feel free to modify, include or leave be as you will.
Future idea: add "tryInverted" which duplicates each frame and tries normal and inverted both.
Interesting. Did you manage to do some performance profiling on this? Inverting each frame might be expensive to do (I think). A bit sad we have to pull in opencv for this to work
Interesting. Did you manage to do some performance profiling on this? Inverting each frame might be expensive to do (I think). A bit sad we have to pull in
opencvfor this to work
No I didn't. We need it so short time, that it really makes no difference, and it didn't feel slow on phones tested. I agree, it really is a bummer that the opencv is needed. There has to be better way to do it on both systems, but I just needed something that works with minimum effort and those came up on stackoverflow 😁 .
I remember doing this for a client of mine, on a native solution, I had to use opencv too.
After creating #1214 to enhance your PR, on Android I've seen that the inverted image is shrink, I'm working on fixing it on my branch and I will create a PR on yours as well @petri-lipponen-movesense
Thank you for your work, and my apologies for my late reply. I think we will be going forward with #1215 due to no external package being necessary there.