We are going to use a number of OpenCV algorithms that detect the inner points of a chessboard and compute the camera calibration; to do this, perform the following steps to calibrate the camera:
- You simply provide an image and the size of the chessboard used (that is, the number of horizontal and vertical inner corner points). The function will return the position of these chessboard corners on the image. If the function fails to find the pattern, then it simply returns false:
// output vectors of image points std::vector<cv::Point2f> imageCorners; // number of inner corners on the chessboard cv::Size boardSize(6,4); // Get the chessboard corners bool found = cv::findChessboardCorners(image, boardSize, imageCorners); ...