Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to calibrate camera with opencv circles grid pattern?

I'm trying to calibrate the camera according to openCV tutorial. First I was using chessboard pattern, it was recognized ok, when it was fully in image, but findChessboardCorners function was utterly freezing, when the pattern wasn't completely inside picture, I've found information, that the circles grid algorithm is better, generated target with opencv python script, but it is never found, neither for symmetric nor asymmetric pattern. I need some help, what am I doing wrong?

    cv::Size boardSize( 11, 8 );
    cv::Mat image = cv::imdecode( cv::Mat( 1, data->size(), CV_8UC1, data->data() ), cv::IMREAD_COLOR );
    std::vector< cv::Point2f > pointBuf;
    bool found;
//    int chessBoardFlags = cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_NORMALIZE_IMAGE | cv::CALIB_CB_FAST_CHECK;
    qDebug()<<"Looking for corners";
//    found = findChessboardCorners( image, boardSize, pointBuf, chessBoardFlags);
//    found = findChessboardCorners( image, boardSize, pointBuf, chessBoardFlags, cv::CALIB_CB_ASYMMETRIC_GRID);
    found = findCirclesGrid( image, boardSize, pointBuf );

image description

How to calibrate camera with opencv circles grid pattern?

I'm trying to calibrate the camera according to openCV tutorial. First I was using chessboard pattern, it was recognized ok, when it was fully in image, but findChessboardCorners function was utterly freezing, when the pattern wasn't completely inside picture, I've found information, that the circles grid algorithm is better, generated target with opencv python script, but it is never found, neither for symmetric nor asymmetric pattern. I need some help, what am I doing wrong?

    cv::Size boardSize( 11, 8 );
    cv::Mat image = cv::imdecode( cv::Mat( 1, data->size(), CV_8UC1, data->data() ), cv::IMREAD_COLOR );
); //data is just bytearray filled with jpeg contents from camera
    std::vector< cv::Point2f > pointBuf;
    bool found;
//    int chessBoardFlags = cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_NORMALIZE_IMAGE | cv::CALIB_CB_FAST_CHECK;
    qDebug()<<"Looking for corners";
//    found = findChessboardCorners( image, boardSize, pointBuf, chessBoardFlags);
//    found = findChessboardCorners( image, boardSize, pointBuf, chessBoardFlags, cv::CALIB_CB_ASYMMETRIC_GRID);
    found = findCirclesGrid( image, boardSize, pointBuf );

image description

How to calibrate camera with opencv circles grid pattern?

I'm trying to calibrate the camera according to openCV tutorial. First I was using chessboard pattern, it was recognized ok, when it was fully in image, but findChessboardCorners function was utterly freezing, when the pattern wasn't completely inside picture, I've found information, that the circles grid algorithm is better, generated target with opencv python script, but it is never found, neither for symmetric nor asymmetric pattern. I need some help, what am I doing wrong?

    cv::Size boardSize( 11, 8 );
    cv::Mat image = cv::imdecode( cv::Mat( 1, data->size(), CV_8UC1, data->data() ), cv::IMREAD_COLOR ); //data is just bytearray filled with jpeg contents from camera
    std::vector< cv::Point2f > pointBuf;
    bool found;
//    int chessBoardFlags = cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_NORMALIZE_IMAGE | cv::CALIB_CB_FAST_CHECK;
    qDebug()<<"Looking for corners";
//    found = findChessboardCorners( image, boardSize, pointBuf, chessBoardFlags);
//    found = findChessboardCorners( image, boardSize, pointBuf, chessBoardFlags, cv::CALIB_CB_ASYMMETRIC_GRID);
    found = findCirclesGrid( image, boardSize, pointBuf );

image description