There is a school test form, which must be recognized and output the result in the database. They offered the option to use the comparison with the standard.
The code where the output is compared and outputs an image with a marked cross:
import cv2 img1 = cv2.imread("img.jpg") img2 = cv2.imread("orig.jpg") diff = cv2.absdiff(img1, img2) mask = cv2.cvtColor(diff, cv2.COLOR_BGR2GRAY) th = 1 imask = mask>th canvas = np.zeros_like(img2, np.uint8) canvas[imask] = img2[imask] cv2.imwrite("result.jpg", canvas) But how exactly is the marked response written to the database, i.e. if the student marked the first option, write xlsx to the base as 1, etc.?
Is it possible, by knowing the coordinates of the centers of the cells with the answers, to be compared with the standard and compared with the numbers of the options in the database?

