Camera calibration with ArUco

To perform camera calibration as we discussed earlier, we must obtain corresponding 2D-3D point pairings. With ArUco marker detection, this task is made simple. ArUco provides a tool to create a calibration board, a grid of squares and AR markers, in which all the parameters are known: number, size, and position of markers. We can print such a board with our home or office printer, with the image for printing supplied by the ArUco API: 

Ptr<aruco::Dictionary> dict = aruco::Dictionary::get(aruco::DICT_ARUCO_ORIGINAL);Ptr<aruco::GridBoard> board = aruco::GridBoard::create(    10     /* N markers x */,     7      /* M markers y */,     14.0f  /* marker width (mm) */,     9.2f   /* marker separation (mm) */,     dict);Mat boardImage;board->draw({1000, ...

Get Building Computer Vision Projects with OpenCV 4 and C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.