I'm writing a python script to perform camera calibration with OpenCV.
I found that the cv2.findChessboardCorners
function may take very long to run on certain images.
I would therefore like to be able to stop the function after a certain period of time has passed, and move on to the next image.
How do I do that?
for fname in images:
img = cv2.imread(fname)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, corners = cv2.findChessboardCorners(gray, (20, 17), None)