I am using zxing-cpp/zxing-core to find and decode a QRCode in an image. In my case the position of the QRCode is known. So i am able to provide only the image part which contains the qrcode (just cropping is done). The seen QRCode itself is seen from different viewing angle. (it has perspective distortion) When I call the zxing-decode-function with the cropped image it will decode the QRCode sucessfully. But if I preprocess a perspective transformation to the croppped image the detection fails.
I would say that having the information where the qrcode lies in the image should speed up the detection. But currenttly its not working as I want. Do you know where I can pass this information correctly?
With regards
Peravene
The exact details are in Detector.cpp :
Ref<DetectorResult> Detector::detect(DecodeHints const& hints)
You could try to figure out what the sweet spots are.
Another simple trick is just to make a series of images with the same barcode and increase the whitespace around the barcode gradually.
Besides adding an appropriate whitespace, playing with the size of the image can also speed up the detection rate. High res images tend to take much more time to process than just a 800x600 image .
Bottomline is that if you can see the barcode clearly, Zxing will also probably be able to detect it. Adding more pixels only slows down the detection rate.
The method 'detect' returns the position of the 3 corner markers of the QRcode.
If you can exactly pinpoint those yourself then you could skip the whole detection stuff, but if the error margin is too high then again you might get poor recognition rates...