for contour in contours:
    approx = cv2.approxPolyDP(contour, 0.01 * cv2.arcLength(contour, True),
        True)
if len(approx) > 8:
    contour_bounding_rect = cv2.boundingRect(contour)
mid_point = contour_bounding_rect[0] + contour_bounding_rect[2
    ] / 2, contour_bounding_rect[1] + contour_bounding_rect[3] / 2
roll_num_digit = mid_point[1] / single_element_height
roll_num_digit = (roll_num_digit + 1) % 10
roll_number += str(roll_num_digit)
print('Roll Number: ', roll_number)
Detect OCR marker