I know the problem now. The issue arises because in the threading setup: threading.Thread(video_capture_thread, daemon=True).start()
, the OCR function is running within the thread. While the frame updates quickly, the OCR process is slow. Each time the frame updates, it is sent to the OCR function (check_detection_region
), which causes the OCR function to break. As a result, some regions are not detected.