Hi all,
I've got an inspection project that I'm working on. Here's what I'd like to do. (maybe there's a better way to do this, feel free to let me know)
- acquire the image from a camera. (Done)
- Inspect the image for for a PASS/FAIL condition. (Done)
- Create a QR Code containing Image date, filename, and inspection result. (Done)
- Add the QR Code in the upper left of the image acquired by the camera... (Can't figure that one out)
I'm using the Python qrcode module to create the qr code. I can save the qrcode to .png and then imread it with Opencv and do it that way, but I'd like to avoid unnecessarily writing to disk.
Any suggestions?
import cv2
import qrcode
import numpy
import scipy.misc
image = cv2.imread('0000001.bmp' ) # This is where I would be acquiring image from camera
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
# These strings will be written by the inspection process
i_result = 'Failed'
i_timestamp = 'This time yall'
i_filename = '00001.bmp'
# Add the strings to the QR Code
qr.add_data(i_result)
qr.add_data(i_timestamp)
qr.add_data(i_filename)
# Make the QR Code
qrcode = qr.make_image(fill_color="black", back_color="white")
# How to make the QR code an OpenCV object???