FindChessboardCorners cannot detect chessboard on very large images by long focal length lens

喜夏-厌秋 提交于 2019-11-27 13:18:35

A few points.

  1. Down-sizing, as you noticed, helps the detector. That is because the corner-detection filters used in OpenCV to find the corners have fixed size, and that size of convolution mask may be too small to detect your corners - the full-size image may actually look "smooth" at that scale, particularly where it is slightly blurry. However, by downscaling you throw away some corner location accuracy.
  2. For the same reason, sharpening helps too. However, it also goes against accuracy, because it adds bias to the subpixel positions of the corners - even in the ideal case with no noise. To convince yourself that this is the case, consider the 1D analogue: the intensity of the image around a corner (in 1D, a sharp black-white transition) looks ideally like a sigmoid curve (a ramp with smooth corners), and you want to find the location of its inflection point. Sharpening makes the curve steeper, which in general will move that point's location. Things get worse when you take into account that sharpening generally amplifies noise.
  3. The likely correct way to proceed is to start at a lower resolution (i.e. downsizing), then scale up the positions of the corners thus found, and use them as the initial estimates for a run of cvFindCornersSubpix at full resolution.

If you have access to the OpenCV source and can rebuild it, then maybe you can debug the behavior of cvFindChessboardCorners.

You have to #define DEBUG_CHESSBOARD and then you will have some helps in understanding the algorithm.

I think OpenCV 2.4 has this capability (see for example https://github.com/Itseez/opencv/blob/2.4/modules/calib3d/src/calibinit.cpp).

Furthermore, even if it doesn't seem to apply to your case, OpenCV doc gives a requirement for the calibration target:

Note: The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#findchessboardcorners

The chessboard in the question has an even number of inner corner both for rows (6 corners) and columns (8 corners) while a reference OpenCV chessboard

has an even/odd number of corners, i.e. it is 9x6, I do not know wether this can be a problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!