I have images of receipts and some of them have QR codes. I want to reliably detect QR codes in these images. It's not important the location of the QR code, just whether it is present in an image of a receipt or not.
My current progress:
import cv2
uri = 'dummy-uri'
qrCodeDetector = cv2.QRCodeDetector()
image = io.imread(uri)
decodedText, points, _ = self.qrCodeDetector.detectAndDecode(image)
NoneType = type(None)
if type(points) is not NoneType:
print('There is QR code in the image')
else:
print('There is not QR code in the image')
Basically, point is None
if there is no QR code - there are no points of the edges. But the cv2
QrCodeDetector
does not perform really well. I could imagine that training an object detector (Yolo
, for example) would give way higher accuracy. Right now, most of the images I have of receipts are identified as ones without QR codes, although they have one. Any ideas of how to detect QR codes more reliably (with higher accuracy) ?