33 #include <opencv2/calib3d.hpp>
34 #include <opencv2/core.hpp>
35 #include <opencv2/core/utility.hpp>
36 #include <opencv2/highgui.hpp>
37 #include <opencv2/imgcodecs.hpp>
38 #include <opencv2/imgproc.hpp>
39 #include <opencv2/videoio.hpp>
41 #include <Math/Math2d.h>
42 #include <Math/Math3d.h>
90 flag |= cv::CALIB_RATIONAL_MODEL;
94 flag |= cv::CALIB_FIX_K3;
95 flag |= cv::CALIB_FIX_K4;
96 flag |= cv::CALIB_FIX_K5;
97 flag |= cv::CALIB_FIX_K6;
104 flag |= cv::CALIB_FIX_ASPECT_RATIO;
111 ARMARX_ERROR <<
" Camera calibration mode does not exist. ";
161 def->defineOptionalProperty<std::string>(
"ImageProviderAdapterName",
163 "Ice Adapter name of the image provider");
164 def->defineOptionalProperty<
int>(
165 "NumberOfImages", 20,
"Number of images used for the calibration");
166 def->defineOptionalProperty<
int>(
167 "WaitingIntervalBetweenImages", 500,
"Waiting time between captured images, in ms");
168 def->defineOptionalProperty<
int>(
"NumberOfRows",
170 "Number of corner rows on the calibration pattern "
171 "(height; chessboard squares - 1)");
172 def->defineOptionalProperty<
int>(
"NumberOfColumns",
174 "Number of corner columns on the calibration pattern "
175 "(width; chessboard squares - 1)");
176 def->defineOptionalProperty<
double>(
177 "PatternSquareSize", 30.0,
"Size of the squares on the calibration pattern");
178 def->defineOptionalProperty<std::string>(
179 "OutputFileName",
"cameras.txt",
"Path to the file for saving the calibration");
180 def->defineOptionalProperty<
bool>(
181 "UseAdditionalParams",
false,
"Also use K3-K6 parameters");
182 def->defineOptionalProperty<
bool>(
183 "EnableFixAspectRatio",
false,
"Fix/Calibrate focal length aspect ratio");
184 def->defineOptionalProperty<std::string>(
185 "ImageToUse",
"left",
"Use left or rigth image for calibration")
187 .map(
"right",
"right");
198 int m_mode = CAPTURING;
202 std::vector<std::vector<cv::Point2f>> imagePoints;
203 cv::Mat cameraMatrix, distCoeffs;
206 std::string providerName;
207 ImageProviderInterfacePrx imageProviderPrx;
214 CByteImage** cameraImages;
216 std::string m_outputFileName;
220 unsigned int imageID;