Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why "findChessboardCorners" function is returning false

Dear Developers, I am using Opencv "findChessboardCorners" function to find corners of chess board, but I am getting false as a returned value from findChessboardCorners function.

Can you please explain me why ?

Following is my code and I have also attached Chess board picture I am using.

  int main(int argc, char* argv[])
   {
    vector<vector<Point2f>> imagePoints;    
    Mat view;
    bool found; 
    vector<Point2f> pointBuf;
    Size boardSize;            // The size of the board -> Number of items by width and height  
    boardSize.width = 75;
    boardSize.height = 49;

    view = cv::imread("FraunhoferChessBoard.jpeg"); 
    namedWindow("Original Image", WINDOW_NORMAL);// Create a window for display.
    imshow("Original Image", view);

    found = findChessboardCorners(view, boardSize, pointBuf,
             CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE);

    if (found)
    {
        cout << "Corners of chess board detected";
    }
    else
    {
        cout << "Corners of chess board not detected";
    }
    waitKey(0);
    return 0;
}

many thanks :)image description

Why "findChessboardCorners" function is returning false

Dear Developers, I am using Opencv "findChessboardCorners" function to find corners of chess board, but I am getting false as a returned value from findChessboardCorners function.

Can you please explain me why ?

Following is my code and I have also attached Chess board picture I am using.

  int main(int argc, char* argv[])
   {
    vector<vector<Point2f>> imagePoints;    
    Mat view;
    bool found; 
    vector<Point2f> pointBuf;
    Size boardSize;            // The size of the board -> Number of items by width and height  
    boardSize.width = 75;
    boardSize.height = 49;

    view = cv::imread("FraunhoferChessBoard.jpeg"); 
    namedWindow("Original Image", WINDOW_NORMAL);// Create a window for display.
    imshow("Original Image", view);

    found = findChessboardCorners(view, boardSize, pointBuf,
             CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE);

    if (found)
    {
        cout << "Corners of chess board detected";
    }
    else
    {
        cout << "Corners of chess board not detected";
    }
    waitKey(0);
    return 0;
}

many thanks :)image description image description

click to hide/show revision 3
retagged

updated 2019-10-23 09:31:50 -0600

berak gravatar image

Why "findChessboardCorners" function is returning false

Dear Developers, I am using Opencv "findChessboardCorners" function to find corners of chess board, but I am getting false as a returned value from findChessboardCorners function.

Can you please explain me why ?

Following is my code and I have also attached Chess board picture I am using.

  int main(int argc, char* argv[])
   {
    vector<vector<Point2f>> imagePoints;    
    Mat view;
    bool found; 
    vector<Point2f> pointBuf;
    Size boardSize;            // The size of the board -> Number of items by width and height  
    boardSize.width = 75;
    boardSize.height = 49;

    view = cv::imread("FraunhoferChessBoard.jpeg"); 
    namedWindow("Original Image", WINDOW_NORMAL);// Create a window for display.
    imshow("Original Image", view);

    found = findChessboardCorners(view, boardSize, pointBuf,
             CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE);

    if (found)
    {
        cout << "Corners of chess board detected";
    }
    else
    {
        cout << "Corners of chess board not detected";
    }
    waitKey(0);
    return 0;
}

many thanks :)image description image description