Open michaeltrollan opened 5 years ago
i'm no expert on image processing and vision, and such, but i'm noticing that if i take the image with the reflection and do a simple conversion to grayscale, that i can certainly understand why it's difficult to pick out the barcode completely from the rest of it. i know that doesn't point into any particularly good direction to go to, but some sort of adjustments to improve the contrast between the real area of the barcode, and the reflection on the black area above it seems like it could help there.
Thanks for the ideas @ericblade! Here's the grayscale conversion. Is there something about this that stands out to you as being harder than the color version?
I do see that the brightness of the blacks goes from about 25% to the left of the reflection to about 50% in the reflection. Maybe the algorithm has a certain threshold for brightness change and this exceeds it?
I'm also no expert on image processing, nor the how the algorithm looks for barcodes. Hopefully some possible ideas will come to light (pun not intended).
yeah my guess is that it's possibly calculating all of that brighter area as "not part of the barcode" .. what the actual mechanism of that is, though, i don't know. i have literally never even looked at the reader code, only the interfaces to it. I wonder if either cutting out just the barcode and passing it in, or turning off autolocate and feeding a specific area would improve the detection ability.
I've been playing with locate: false and it does seem to be quite a bit faster at scanning at much less battery consumption. I haven't noticed a significant increase in accuracy of it, or ability to read things that it couldn't read with locate: true, though, after a few hours of using it to scan books and things like that. I have noticed as I spent quite a bit of time scanning in weird lighting today, that significant differences in brightness across a barcode will fail to register, much like this. So it's not just the VIN reader, seems to probably be a problem with determining overall what is in the barcode.
I have the ability for users to upload a photo image of the VIN barcode. I notice that if there's any sort of reflection at all, the scanner cannot find the barcode. Does anyone have ideas to improve performance in that area?
Here is what I'm using currently:
You can see the issue in action by trying the attached images at this link: https://serratus.github.io/quaggaJS/examples/file_input.html
Doesn't work:![reflection vin](https://user-images.githubusercontent.com/1988590/51924895-e76c4600-23bb-11e9-9402-da1c41574bbd.jpg)
Works:![flat vin](https://user-images.githubusercontent.com/1988590/51924894-e76c4600-23bb-11e9-9eb1-83f4868a70ca.jpg)