QRcode_img = img[int(p1_temp[1]):int(p3_temp[1]), int(p1_temp[0]):int(p3_temp[0])] cv2.imshow('QRcode_img', QRcode_img) cv2.waitKey(0)
contours = cv2.QRCodeDetector().detect(QRcode_img)
if np.all(contours[1] != None):
box = contours[1].reshape(4, 2).astype(np.int64)
code_img = cv2.drawContours(QRcode_img, [box], -1, (0, 0, 255), 2)
cv2.imshow('xx', code_img)
cv2.waitKey(0)
cv2.imshow('xxxxxxxxxxxxxx', img)