0
votes

I have found this post OpenCV findChessboardCorners very slow, but it does not answer my question fully.

I am running a camera calibration tool on a raspberry pi and it takes a huge amount of time to detect chessboard corners in full resolution images. I currently rescale them, but the computed parameters cannot be used for a full-sized image.

One thing I was thinking was to detect corner in an images 4 times smaller and then multiply the corner coordinates by 4, but I don't quite the same results.

Do you think is there a way to speed up or plug another corner detection?

I am using python implementation (cv2)

Thanks

1
Just by curiosity.. Why you're running the calibration on a pi?Ja_cpp
Because I need to find the camera parameters of that camera. I know that I can easily get images and compute the parameters on my own laptop, many cameras to do and calibration can be repeated over time during our experiments. I need to make the process easy to dotuttoweb
You can still run the calibration on a pi with full resolution and enough images even if it takes more time because you gonna calibrate the camera one time and then you won't need to do it.Ja_cpp

1 Answers

6
votes

Most of the time is spent in checkerboard extraction, which consists (roughly speaking) of three steps: detecting checkerboard corners in the images, refining them to subpixel resolution, and matching them to the nominal checkerboard.

Of the three, the first step is the most expensive, because it involves processing the entire image. So you can gain some time by detecting corners and matching checkerboard at lower resolution (using cv2.findChessboardCorners). You can then rescale their coordinates to full resolution and subpixel-refine them (cv2.find4QuadCornersSubpix) for greater accuracy. The refinement routine works on small regions around the detected corners, so it needs much less memory - which is helpful when working on CPU's with limited cache size.

This procedure is helpful also for other reasons, see this other answer.