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;
218 IceUtil::Time waitingTimeBetweenCaptures;
219 IceUtil::Time timeOfLastCapture;
220 unsigned int imageID;
Default component property definition container.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
static const std::string default_name
void onConnectImageProcessor() override
Implement this method in the ImageProcessor in order execute parts when the component is fully initia...
void onExitImageProcessor() override
Exit the ImapeProcessor component.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
void onInitImageProcessor() override
Setup the vision component.
void onDisconnectImageProcessor() override
Implement this method in the ImageProcessor in order execute parts when the component looses network ...
std::string getDefaultName() const override
Retrieve default name of component.
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
Pattern calibrationPattern
@ ASYMMETRIC_CIRCLES_GRID
std::string outputFileName
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.