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. ";
166 def->defineOptionalProperty<std::string>(
"ImageProviderAdapterName",
168 "Ice Adapter name of the image provider");
169 def->defineOptionalProperty<
int>(
170 "NumberOfImages", 20,
"Number of images used for the calibration");
171 def->defineOptionalProperty<
int>(
172 "WaitingIntervalBetweenImages", 500,
"Waiting time between captured images, in ms");
173 def->defineOptionalProperty<
int>(
"NumberOfRows",
175 "Number of corner rows on the calibration pattern "
176 "(height; chessboard squares - 1)");
177 def->defineOptionalProperty<
int>(
"NumberOfColumns",
179 "Number of corner columns on the calibration pattern "
180 "(width; chessboard squares - 1)");
181 def->defineOptionalProperty<
double>(
182 "PatternSquareSize", 30.0,
"Size of the squares on the calibration pattern");
183 def->defineOptionalProperty<std::string>(
184 "OutputFileName",
"cameras.txt",
"Path to the file for saving the calibration");
185 def->defineOptionalProperty<
bool>(
186 "UseAdditionalParams",
false,
"Also use K3-K6 parameters");
187 def->defineOptionalProperty<
bool>(
188 "EnableFixAspectRatio",
false,
"Fix/Calibrate focal length aspect ratio");
189 def->defineOptionalProperty<std::string>(
190 "ImageToUse",
"left",
"Use left or rigth image for calibration")
192 .map(
"right",
"right");
203 int m_mode = CAPTURING;
207 std::vector<std::vector<cv::Point2f>> imagePoints;
208 cv::Mat cameraMatrix, distCoeffs;
211 std::string providerName;
212 ImageProviderInterfacePrx imageProviderPrx;
219 CByteImage** cameraImages;
221 std::string m_outputFileName;
223 IceUtil::Time waitingTimeBetweenCaptures;
224 IceUtil::Time timeOfLastCapture;
225 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.
static std::string GetDefaultName()
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.