Ask Your Question
0

findchessboardCorners result

asked 2013-09-09 04:49:03 -0500

engine gravatar image

Hi!

I have a chessboard where its height equal to its width, and I need to know how to change for example a recognized chessboard let's say a 3 rows to 3 columns, here a an example of a code a the result it may help you understanding my question :

int main () {
    cv::Mat frame;
    cv::Size board(3,3);
    cv::vector<cv::Point2f> imageCorners;
    cv::VideoCapture cap (0);
    int key =0;

    while(key != 27){
        cap >> frame;
        if(cv::findChessboardCorners(frame,board,imageCorners,CV_CALIB_CB_FILTER_QUADS)){
            cv::drawChessboardCorners(frame,board,imageCorners,true);
            cv::imwrite("stack.jpg",frame);
        }
        cv::imshow("frame",frame);
        key = cv::waitKey(10);
    }

    return 0 ;
}

columns vector

rows vector

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-09-09 06:37:06 -0500

efanucar gravatar image

updated 2013-09-09 06:38:26 -0500

I don't know if I understand your question correctly...but: The size "board" you set as the parameter for findChessboardCorners does not correspond to the squares but to the inner corner points. So if you want to cover 3 x 3 squares you need to set the size to (4,4) - you will then find 4 inner corner points made up by 5 squares.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-09-09 04:49:03 -0500

Seen: 441 times

Last updated: Sep 09 '13