28 #ifndef RTABMAP_CALIBRATIONDIALOG_H_ 29 #define RTABMAP_CALIBRATIONDIALOG_H_ 35 #include <opencv2/opencv.hpp> 42 class Ui_calibrationDialog;
51 CalibrationDialog(
bool stereo =
false,
const QString & savingDirectory =
".",
bool switchImages =
false, QWidget * parent = 0);
54 bool isCalibrated()
const {
return models_[0].isValidForProjection() && (stereo_?models_[1].isValidForProjection():
true);}
60 int boardWidth()
const;
61 int boardHeight()
const;
62 double squareSize()
const;
64 void saveSettings(QSettings & settings,
const QString & group =
"")
const;
65 void loadSettings(QSettings & settings,
const QString & group =
"");
68 void setCameraName(
const QString &
name);
69 void setProgressVisibility(
bool visible);
70 void setSwitchedImages(
bool switched);
71 void setFisheyeImages(
bool enabled);
72 void setStereoMode(
bool stereo,
const QString & leftSuffix =
"left",
const QString & rightSuffix =
"right");
78 void setBoardWidth(
int width);
79 void setBoardHeight(
int height);
80 void setSquareSize(
double size);
81 void setExpectedStereoBaseline(
double length);
82 void setMaxScale(
int scale);
84 void processImages(
const cv::Mat & imageLeft,
const cv::Mat & imageRight,
const QString & cameraName);
93 virtual void closeEvent(QCloseEvent* event);
94 virtual bool handleEvent(
UEvent * event);
97 float getArea(
const std::vector<cv::Point2f> & corners,
const cv::Size & boardSize);
98 float getSkew(
const std::vector<cv::Point2f> & corners,
const cv::Size & boardSize);
104 void getParams(
const std::vector<cv::Point2f> & corners,
const cv::Size & boardSize,
const cv::Size & imageSize,
105 float &
x,
float & y,
float & size,
float & skew);
127 Ui_calibrationDialog *
ui_;
std::vector< std::vector< std::vector< cv::Point2f > > > stereoImagePoints_
std::vector< unsigned short > minIrs_
std::vector< unsigned short > maxIrs_
const rtabmap::CameraModel & getRightCameraModel() const
int getStereoPairs() const
void setSavingDirectory(const QString &savingDirectory)
rtabmap::StereoCameraModel stereoModel_
std::vector< std::vector< std::vector< cv::Point2f > > > imagePoints_
std::vector< rtabmap::CameraModel > models_
const rtabmap::CameraModel & getLeftCameraModel() const
DiscreteDepthDistortionModel RTABMAP_EXP calibrate(const std::map< int, rtabmap::SensorData > &sequence, const std::map< int, rtabmap::Transform > &trajectory, const pcl::PointCloud< pcl::PointXYZ >::Ptr &map, double coneRadius=0.02, double coneStdevThresh=0.03)
const rtabmap::StereoCameraModel & getStereoCameraModel() const
std::vector< cv::Size > imageSize_
std::vector< std::vector< std::vector< float > > > imageParams_
Ui_calibrationDialog * ui_
bool isProcessing() const
GLM_FUNC_DECL genType::value_type length(genType const &x)
bool isCalibrated() const