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 );
A comment about the calibration process.
Calibration board must be completely flat. Glue your calibration sheet on a flat surface, do not hand it like this! You will have bad results.
use acircles_pattern.png
@Eduardo I'll try, but is such deformation enough for the target to be completely unrecognizable?
@sturkmen I've tried it at first, with cv::CALIB_CB_ASYMMETRIC_GRID flag, but no result
use acircles_pattern.png
try
@sturkmen@Eduardo I tried with acircles_pattern.png, with boardSize( 4, 11) it is only found on heavy downscaled image (around 1MPix instead of base 16MPix for camera). How should it be done? Downscale, find coordinates, multiply them by downscale coefficient, run findCornersSubPix?
Perform calibration on downscaled images and scale the intrinsics matrix.