Closed simon-staal closed 1 year ago
Could you please save one of the images that don't work as a png and add it here?
Here's the image for the payload 32
Thanks for providing the image. The problem is, the image is in fact not "perfect" and that is due to the resizing to 88x88. Is there a specific reason why you did this?
There are a number of ways to make it work:
1) set the is_pure
parameter to true
2) set the binarizer
parameter to Binarizer.FixedThreshold
3) resize your image to a multiple of 21 (like 84x84 instead of 88x88)
I might push a fix that works for this image, probably others as well but not necessarily for all your samples.
To provide a bit more context on my use-case, I'm developing an intelligent scrabble board which is using embedded cameras with QR codes under the tiles to detect the position and values of the tiles playerd. The reason why I resize the images to 88x88 is that this system, after preprocessing, returns 88x88 binarized images of each board square, which is then passed into the QR code detector.
These will obviously be noisier than the "perfect" QR codes which I'm testing on, which is why I'm expecting the performance on this initial testbench to provide an upper bound. What are the significance of these parameters you've mentioned above / where can I find the documentation for these? I'm assuming the binarizer
parameter can always be set to Binarizer.FixedThreshold
given then I'll only be using black and white images, but I'm not sure when the use of is_pure
would be appropriate.
As a bit of an update, I've tested all codes in the $[0, 10^6]$ range - currently obtaining 11420 failures.
Thanks for the background info. In that case Binarizer.GlobalHistogram
would likely be the best option. The FixedThreshold
binarizer makes a simple cut at 128. the is_pure
mode is not suitable for your real-world image data. It is meant for situations where you scan "perfect" input like this, where you have generated images with no noise, white background and no rotation/skew/etc.
I suggest two things to move forward in your case: 1) maybe switch to DataMatrix, which has an even higher density and is not as sensitive in low-res situations as the MircoQR detector 2) actually get some real images from your hardware and see where that fails. the issues you have here don't let you predict what you'll get with your actual input at the end.
Thanks for the advice! I have just tried using Binarizer.GlobalHistogram
and this seems to completely solve the issue for the generated images, it's now able to detect all of themI'll definitely try out some more testing with real images, and if necessary try switching to DataMatrix.
I'm using the python wrapper of this library to test microQR code detection capabilities. I'm generating version M4 micro-QR codes specifically using the
segno
package as follows:Of the 1000 codes tested by this loop, the following 84 cannot be detected:
I've tested these codes with BoofCV's micro-QR code detector, which is able to detect these correctly.
My venv is as follows - note that not all packages are needed, I've been testing many qr code detection libraries: