mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Calibration: added max scale parameter
This commit is contained in:
@@ -69,6 +69,7 @@ public slots:
|
|||||||
void setBoardWidth(int width);
|
void setBoardWidth(int width);
|
||||||
void setBoardHeight(int height);
|
void setBoardHeight(int height);
|
||||||
void setSquareSize(double size);
|
void setSquareSize(double size);
|
||||||
|
void setMaxScale(int scale);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void processImages(const cv::Mat & imageLeft, const cv::Mat & imageRight, const QString & cameraName);
|
void processImages(const cv::Mat & imageLeft, const cv::Mat & imageRight, const QString & cameraName);
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ CalibrationDialog::CalibrationDialog(bool stereo, const QString & savingDirector
|
|||||||
connect(ui_->spinBox_boardWidth, SIGNAL(valueChanged(int)), this, SLOT(setBoardWidth(int)));
|
connect(ui_->spinBox_boardWidth, SIGNAL(valueChanged(int)), this, SLOT(setBoardWidth(int)));
|
||||||
connect(ui_->spinBox_boardHeight, SIGNAL(valueChanged(int)), this, SLOT(setBoardHeight(int)));
|
connect(ui_->spinBox_boardHeight, SIGNAL(valueChanged(int)), this, SLOT(setBoardHeight(int)));
|
||||||
connect(ui_->doubleSpinBox_squareSize, SIGNAL(valueChanged(double)), this, SLOT(setSquareSize(double)));
|
connect(ui_->doubleSpinBox_squareSize, SIGNAL(valueChanged(double)), this, SLOT(setSquareSize(double)));
|
||||||
|
connect(ui_->spinBox_maxScale, SIGNAL(valueChanged(int)), this, SLOT(setMaxScale(int)));
|
||||||
|
|
||||||
connect(ui_->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
connect(ui_->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||||
|
|
||||||
@@ -112,6 +113,7 @@ void CalibrationDialog::saveSettings(QSettings & settings, const QString & group
|
|||||||
settings.setValue("board_width", ui_->spinBox_boardWidth->value());
|
settings.setValue("board_width", ui_->spinBox_boardWidth->value());
|
||||||
settings.setValue("board_height", ui_->spinBox_boardHeight->value());
|
settings.setValue("board_height", ui_->spinBox_boardHeight->value());
|
||||||
settings.setValue("board_square_size", ui_->doubleSpinBox_squareSize->value());
|
settings.setValue("board_square_size", ui_->doubleSpinBox_squareSize->value());
|
||||||
|
settings.setValue("max_scale", ui_->spinBox_maxScale->value());
|
||||||
settings.setValue("geometry", this->saveGeometry());
|
settings.setValue("geometry", this->saveGeometry());
|
||||||
if(!group.isEmpty())
|
if(!group.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -128,6 +130,7 @@ void CalibrationDialog::loadSettings(QSettings & settings, const QString & group
|
|||||||
this->setBoardWidth(settings.value("board_width", ui_->spinBox_boardWidth->value()).toInt());
|
this->setBoardWidth(settings.value("board_width", ui_->spinBox_boardWidth->value()).toInt());
|
||||||
this->setBoardHeight(settings.value("board_height", ui_->spinBox_boardHeight->value()).toInt());
|
this->setBoardHeight(settings.value("board_height", ui_->spinBox_boardHeight->value()).toInt());
|
||||||
this->setSquareSize(settings.value("board_square_size", ui_->doubleSpinBox_squareSize->value()).toDouble());
|
this->setSquareSize(settings.value("board_square_size", ui_->doubleSpinBox_squareSize->value()).toDouble());
|
||||||
|
this->setMaxScale(settings.value("max_scale", ui_->spinBox_maxScale->value()).toDouble());
|
||||||
QByteArray bytes = settings.value("geometry", QByteArray()).toByteArray();
|
QByteArray bytes = settings.value("geometry", QByteArray()).toByteArray();
|
||||||
if(!bytes.isEmpty())
|
if(!bytes.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -205,6 +208,14 @@ void CalibrationDialog::setSquareSize(double size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationDialog::setMaxScale(int scale)
|
||||||
|
{
|
||||||
|
if(scale != ui_->spinBox_maxScale->value())
|
||||||
|
{
|
||||||
|
ui_->spinBox_maxScale->setValue(scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CalibrationDialog::closeEvent(QCloseEvent* event)
|
void CalibrationDialog::closeEvent(QCloseEvent* event)
|
||||||
{
|
{
|
||||||
if(!savedCalibration_ && models_[0].isValidForRectification() &&
|
if(!savedCalibration_ && models_[0].isValidForRectification() &&
|
||||||
@@ -360,7 +371,7 @@ void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat &
|
|||||||
|
|
||||||
if(!viewGray.empty())
|
if(!viewGray.empty())
|
||||||
{
|
{
|
||||||
int maxScale = viewGray.cols < 640?2:1;
|
int maxScale = ui_->spinBox_maxScale->value();
|
||||||
for( int scale = 1; scale <= maxScale; scale++ )
|
for( int scale = 1; scale <= maxScale; scale++ )
|
||||||
{
|
{
|
||||||
cv::Mat timg;
|
cv::Mat timg;
|
||||||
|
|||||||
@@ -232,6 +232,29 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QSpinBox" name="spinBox_maxScale">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_22">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Number of inner squares on the board</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Max scale</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user