My raspberry pi with the library picamera is creating a lot of pictures and stores them as ByteIO objects.
Next step would be to decode those objects with this library pyzbar to get the qr code content.
Unfortunately the dimension is always wrong and I don't know how to fix that issue.
The pictures have the correct dimension and I guess the transformation/conversion is not correct?
Error mesage:
raise PyZbarError(pyzbar.pyzbar_error.PyZbarError: Inconsistent dimensions: image data of 4124 bytes is not divisible by (width x height = 90000)
I hope there is a solution for this problem. I assumed that pyzbar can handle this type of object, because 'raw bytes' are like ByteIO objects. A simple example on how to use this library pyzbar with raw bytes would be awesome!
Hello everyone!
My raspberry pi with the library picamera is creating a lot of pictures and stores them as ByteIO objects. Next step would be to decode those objects with this library pyzbar to get the qr code content. Unfortunately the dimension is always wrong and I don't know how to fix that issue. The pictures have the correct dimension and I guess the transformation/conversion is not correct?
My code:
`stream = BytesIO() camera = PiCamera() camera.resolution = (300, 300) camera.start_preview() camera.capture(stream, 'jpeg')
image = (stream.getbuffer(), 300, 300) barcodes = pyzbar.decode(image, symbols=[ZBarSymbol.QRCODE]) `
Error mesage: raise PyZbarError(pyzbar.pyzbar_error.PyZbarError: Inconsistent dimensions: image data of 4124 bytes is not divisible by (width x height = 90000)
I hope there is a solution for this problem. I assumed that pyzbar can handle this type of object, because 'raw bytes' are like ByteIO objects. A simple example on how to use this library pyzbar with raw bytes would be awesome!
Thanks for any advice or clarification!