remove_unnecessary_marks(image_path, output_path):
 _, thresholded = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY_INV)
 kernel = np.ones((3, 3), np.uint8)
    opened = cv2.morphologyEx(thresholded, cv2.MORPH_OPEN, kernel, iterations=2)

contours, _ = cv2.findContours(opened, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

remove_unnecessary_marks('input_image.jpg', 'cleaned_image.jpg')