Skip to content

Commit df97646

Browse files
committed
Improve documentation. Add larger squares pattern.
1 parent 0cdb423 commit df97646

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

Calibration.hpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,92 @@ class Calibration
5858
static std::map<CalibrationPatternType, cv::Size> CalibrationPatternSizes;
5959
static std::map<CalibrationPatternType, float> CalibrationPatternSpacings;
6060

61+
/*!
62+
@brief Create a new calibration session.
63+
@param patternType The calibration pattern that will be used.
64+
@param calibImageCountMax The maximum number of images of the calibration pattern to capture.
65+
@param patternSize The size of the calibration pattern. For the chessboard, this is the number
66+
of rows minus 1 x the number of columns minus 1. For the assymetric circles grid, this is
67+
the number of circles in each row x (the number of non-offset rows + the number of offset rows).
68+
@param chessboardSquareWidth The pattern spacing. For the chessboard, this is the width of each square.
69+
For the assymetric circles grid, this is the spacing between centres of adjacent columsn divided
70+
by 2.
71+
@param videoWidth The width of video frames that will be passed to the frame() method.
72+
@param videoHeight The height of video frames that will be passed to the frame() method.
73+
*/
6174
Calibration(const CalibrationPatternType patternType, const int calibImageCountMax, const cv::Size patternSize, const int chessboardSquareWidth, const int videoWidth, const int videoHeight);
75+
76+
/*!
77+
@brief Get the number of calibration patterns captured so far.
78+
*/
6279
int calibImageCount() const {return (int)m_corners.size(); }
80+
81+
/*!
82+
@brief Get the number of calibration patterns to be captured.
83+
*/
6384
int calibImageCountMax() const {return m_calibImageCountMax; }
85+
86+
/*!
87+
@brief Pass a video frame for possible processing.
88+
@details The first step in processing is searching the video frame for the calibration pattern
89+
corners ("corner finding"). This process can take anywhere from milliseconds to several seconds
90+
per frame, and runs in a separate thread. If the corner finder is waiting for a frame, this
91+
function will copy the source frame, and begin corner finding.
92+
@param vs ARVideoSource from which to grab the frame.
93+
@result true if the frame was processed OK, false in the case of error.
94+
*/
6495
bool frame(ARVideoSource *vs);
96+
97+
/*!
98+
@brief Access the results of the most recent corner finding processing step, with lock.
99+
@details This function gives access to the results of the most recent corner finding processing
100+
allowing, for example, visual feedback to the user of corner locations.
101+
This call locks the results from further updates until cornerFinderResultsUnlock() is called,
102+
so the user should copy the results if long-term access is required.
103+
@param cornerFoundAllFlag If non-NULL, the int pointed to will be set to 1 if all corners
104+
were found, or 0 if some or no corners were found.
105+
@param corners Corner locations, in screen coordinates.
106+
@param videoFrame Pointer, which will be set to point to the raw video frame in which the corners
107+
were found.
108+
@result true if the corners were found in the most recent processing step, false otherwise.
109+
*/
65110
bool cornerFinderResultsLockAndFetch(int *cornerFoundAllFlag, std::vector<cv::Point2f>& corners, ARUint8** videoFrame);
111+
112+
/*!
113+
@brief Unlock the results of the most recent corner finding processing step.
114+
@details Must be called after calling cornerFinderResultsLockAndFetch to allow further corner
115+
finding to proceed.
116+
@result true if the results were unlocked OK, false in the case of error.
117+
*/
66118
bool cornerFinderResultsUnlock(void);
119+
120+
/*!
121+
@brief Capture the most recent corner finder results as a calibration input.
122+
*/
67123
bool capture();
124+
125+
/*!
126+
@brief Undo the capture of the most recent corner finder results.
127+
*/
68128
bool uncapture();
129+
130+
/*!
131+
@brief Discard all captured corner finder results.
132+
*/
69133
bool uncaptureAll();
134+
135+
/*!
136+
@brief Perform a calibration calculation on the currently captured results, and return as an ARParam.
137+
@param param_out Pointer to an ARParam which will be filled with the calibration result.
138+
@param err_min_out Pointer to an ARdouble which will be filled with the minimum reprojection error in the set of captured calibration patterns.
139+
@param err_avg_out Pointer to an ARdouble which will be filled with the average reprojection error in the set of captured calibration patterns.
140+
@param err_max_out Pointer to an ARdouble which will be filled with the maximum reprojection error in the set of captured calibration patterns.
141+
*/
70142
void calib(ARParam *param_out, ARdouble *err_min_out, ARdouble *err_avg_out, ARdouble *err_max_out);
143+
144+
/*!
145+
@brief Terminate calibration and cleanup.
146+
*/
71147
~Calibration();
72148

73149
private:
771 Bytes
Binary file not shown.
1.06 KB
Binary file not shown.
919 KB
Binary file not shown.
916 KB
Binary file not shown.

0 commit comments

Comments
 (0)