Camera detects motion, turns white LED and red LED on. Paper or screen with the QR code is now illuminated and humans can move up and down until the red Target appears in the center and in focus. Approximately a quarter of a second after that happens, you hear the beep noise indicating a successful read and decode
typically on these cameras the lens is mounted and focused by a screw thread. there is not usually an 'infinity stop' because the mount is very simple, so i would expect the lens may be mechanically positioned outside the useful focus range. a 110 degree FoV is a very wide lens, so the useful screw range may be quite mechanically narrow, but when positioned properly it will have a very deep in-focus field, capturing near objects and far objects clearly.
the datasheet doesn't say much about focus, but it looks like the rim of the lens is knurled for grip, so try rotating the lens. 'screw out' will bring focus nearer, 'screw in' will push focus farther. i would suggest indexing your start position with a paint pen for easy return, and then index the correct position if you find it.
if all else fails, you could place a small aperture in front of the lens. this will reduce light transmission but also improve the focus field, like squinting your eyes.
Alternatively (and what I would recommend), is grab a library that is dedicated to QR Code reading (I‘ve used Quirc, for example) and just read the code.
Typically you threshold an image to get a binary representation (1: black, 0: white). Then you detect the finder patterns by looking for 1-1-3-1-1 runs of black/white. Once you have a bunch of finder patterns localized, you form triplets and decode the binary matrix that they span.
http://blog.qartis.com/decoding-small-qr-codes-by-hand/
https://beck-thompson.github.io/QRcodewebsite/
Reading QR codes without a computer! https://qr.blinry.org/
And then there are a number of OSS implementations for Android (check fdroid.orgl, Debian/Ubuntu, etc. Maybe study the code?
What has thus far remained a mystery to me is going from a bag of noisy pixels with a blurry photo of a tattoo on a hairy arm surrounded by random desk clutter to array of booleans. I meant “by hand” as in “without libraries”, not “using a human”, as in the latter case the human’s visual cortex does the interesting part! And the open-source Android apps that I’ve looked at just wrap ZXing, which is huge (so a sibling commenter’s suggestion of looking at a different, QR-code-specific library is helpful).
Ah, OK. You can use software like ImageMagick to partition images into levels of gray or just black and white. I have some examples somewhere I played with some time ago, but not accessible online right now, sorry. If the contrast of the original image is high enough, just the qrcode would remain to be parsed.
magick input.jpg \
-colorspace Gray \
-adaptive-threshold 8x8+10% \
candidate.png
And then, cause there are some inverted colour QRs, flip and scan again.
But in general, you can divide the problem more or less like this (not necessarily in this order) 1. find the rough spatial region of the barcode. Crop that out and only focus on this 2. Correct ("rectify") for any rotation or perspective skew of the barcode, turn it into a frontoparallel version of the barcode 3. Binarize the image from RGB or grayscale into pure black and white 4. Normalize the size so that each pixel is the smallest spatial unit of the barcode.
As for implementation, Zxing-cpp [1] is still maintained, and pretty good as far as open source options go. At this point I'm not sure how related it is to the original zxing, as it has gone substantial development. It has python bindings which may be easier to use.
On mobile, Google MLkit and Apple vision also have barcode reading APIs, not open source but otherwise "free" as in beer.
https://forum.digikey.com/t/digikey-product-labels-decoding-...
I think a smartphone and custom app would be the worst case scenario in terms of cost, and that could be pretty cheap.
I could imagine maybe OCRing the results from a line-scan camera. That would read all the business signs and street names as you drive by them.
Some viofo dashcams even allow the connection of two secondary cams (those only FullHD) so you could scan to the left and right simultaneously to the front.
cristoperb•12h ago
https://en.wikipedia.org/wiki/CueCat
rootsudo•12h ago
marci•9h ago