Commit 874e7056 authored by Thiago Santini's avatar Thiago Santini

Reloads config after calibration

parent cd6ca352
......@@ -436,6 +436,7 @@ void CameraWidget::onCameraCalibrationFinished(bool success)
// TODO: at some point we might consider storing this with a unique camera ID instead of this generic one
QString fileName = gCfgDir + "/" + id + "Calibration.xml";
QMetaObject::invokeMethod(cameraCalibration, "store", Qt::QueuedConnection, Q_ARG(QString, fileName));
QMetaObject::invokeMethod(imageProcessor, "updateConfig", Qt::QueuedConnection);
}
void CameraWidget::drawROI(QPainter &painter)
......
......@@ -213,7 +213,7 @@ public:
QComboBox *pupilDetectionComboBox;
signals:
void updateConfig();
void updateConfig();
public slots:
void showOptions(QPoint pos)
......@@ -243,7 +243,7 @@ public slots:
cfg.pupilDetectionMethod = pupilDetectionComboBox->currentData().toString();
cfg.save(settings);
emit updateConfig();
}
}
private:
QPushButton *applyButton;
......@@ -267,8 +267,8 @@ signals:
public slots:
void process(Timestamp t, const cv::Mat &frame);
void updateConfig();
void newROI(QPointF sROI, QPointF eROI);
void updateConfig();
void newROI(QPointF sROI, QPointF eROI);
private:
QString id;
......
......@@ -158,9 +158,7 @@ void FieldImageProcessor::sanitizeCameraParameters(Size size)
* 1) Move camera parameters logic to the Camera instead so it's
* considered for the eye cameras as well.
*
* 2) Force update after a camera calibration has been performed.
*
* 3) Drop the logic for resizing the intrinsic parameters since it's not
* 2) Drop the logic for resizing the intrinsic parameters since it's not
* throughly tested.
*
*/
......
......@@ -40,10 +40,12 @@ void ImageProcessor::create()
connect(this, SIGNAL(process(Timestamp,const cv::Mat&)),
eyeProcessor, SLOT(process(Timestamp,const cv::Mat&)) );
connect(this, SIGNAL(newROI(QPointF,QPointF)),
eyeProcessor, SLOT(newROI(QPointF,QPointF)) );
eyeProcessor, SLOT(newROI(QPointF,QPointF)) );
connect(this, SIGNAL(updateConfig()),
eyeProcessor, SLOT(updateConfig()) );
connect(eyeProcessor, SIGNAL(newData(EyeData)),
this, SIGNAL(newData(EyeData)) );
this, SIGNAL(newData(EyeData)) );
// GUI
connect(this, SIGNAL(showOptions(QPoint)),
......@@ -55,7 +57,7 @@ void ImageProcessor::create()
eyeProcessorUI->pupilDetectionComboBox->addItem(name, name);
}
connect(eyeProcessorUI, SIGNAL(updateConfig()),
eyeProcessor, SLOT(updateConfig()) );
eyeProcessor, SLOT(updateConfig()) );
break;
case Field:
fieldProcessor = new FieldImageProcessor(id);
......@@ -63,6 +65,8 @@ void ImageProcessor::create()
fieldProcessor, SLOT(process(Timestamp,const cv::Mat&)) );
connect(this, SIGNAL(newROI(QPointF,QPointF)),
fieldProcessor, SLOT(newROI(QPointF,QPointF)) );
connect(this, SIGNAL(updateConfig()),
fieldProcessor, SLOT(updateConfig()) );
connect(fieldProcessor, SIGNAL(newData(FieldData)),
this, SIGNAL(newData(FieldData)) );
......
......@@ -25,6 +25,7 @@ signals:
void newROI(QPointF sROI, QPointF eROI);
void newData(EyeData data);
void newData(FieldData data);
void updateConfig();
public slots:
void create();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment