Ask Your Question

Revision history [back]

cv::findChessBoardCorners behaves differently in different opencv versions

there's a fisheye chessboard distorted image from which its needed to remove the distortion. I wrote the program that do that successfully on opencv 3.2.0 where this piece of code works perfectly fine on linux with the above mentioned cv version (the sizes are 8 and 5 for which it detects the corners)

bool patternFound = false;
std::vector<cv::Point2f> corners;
for (int i = 7; i <= 30; ++i)
{
    int w = i;
    int h = i-3;
    patternFound = cv::findChessboardCorners(image, cv::Size(w, h), corners,
                                      cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_NORMALIZE_IMAGE);
 }

but on Mac with opencv 3.1.0.2 it does not find the corners and this

cv::findChessboardCorners(image, cv::Size(w, h), corners,
                                      cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_NORMALIZE_IMAGE);

always returns false

Why is that happening ?

is this a bug and how to fix it ?

please check the comments where I added a link to image because (karma is not enough to paste a link in a question)