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) ...@@ -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 // 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"; QString fileName = gCfgDir + "/" + id + "Calibration.xml";
QMetaObject::invokeMethod(cameraCalibration, "store", Qt::QueuedConnection, Q_ARG(QString, fileName)); QMetaObject::invokeMethod(cameraCalibration, "store", Qt::QueuedConnection, Q_ARG(QString, fileName));
QMetaObject::invokeMethod(imageProcessor, "updateConfig", Qt::QueuedConnection);
} }
void CameraWidget::drawROI(QPainter &painter) void CameraWidget::drawROI(QPainter &painter)
......
...@@ -213,7 +213,7 @@ public: ...@@ -213,7 +213,7 @@ public:
QComboBox *pupilDetectionComboBox; QComboBox *pupilDetectionComboBox;
signals: signals:
void updateConfig(); void updateConfig();
public slots: public slots:
void showOptions(QPoint pos) void showOptions(QPoint pos)
...@@ -243,7 +243,7 @@ public slots: ...@@ -243,7 +243,7 @@ public slots:
cfg.pupilDetectionMethod = pupilDetectionComboBox->currentData().toString(); cfg.pupilDetectionMethod = pupilDetectionComboBox->currentData().toString();
cfg.save(settings); cfg.save(settings);
emit updateConfig(); emit updateConfig();
} }
private: private:
QPushButton *applyButton; QPushButton *applyButton;
...@@ -267,8 +267,8 @@ signals: ...@@ -267,8 +267,8 @@ signals:
public slots: public slots:
void process(Timestamp t, const cv::Mat &frame); void process(Timestamp t, const cv::Mat &frame);
void updateConfig(); void updateConfig();
void newROI(QPointF sROI, QPointF eROI); void newROI(QPointF sROI, QPointF eROI);
private: private:
QString id; QString id;
......
...@@ -158,9 +158,7 @@ void FieldImageProcessor::sanitizeCameraParameters(Size size) ...@@ -158,9 +158,7 @@ void FieldImageProcessor::sanitizeCameraParameters(Size size)
* 1) Move camera parameters logic to the Camera instead so it's * 1) Move camera parameters logic to the Camera instead so it's
* considered for the eye cameras as well. * considered for the eye cameras as well.
* *
* 2) Force update after a camera calibration has been performed. * 2) Drop the logic for resizing the intrinsic parameters since it's not
*
* 3) Drop the logic for resizing the intrinsic parameters since it's not
* throughly tested. * throughly tested.
* *
*/ */
......
...@@ -40,10 +40,12 @@ void ImageProcessor::create() ...@@ -40,10 +40,12 @@ void ImageProcessor::create()
connect(this, SIGNAL(process(Timestamp,const cv::Mat&)), connect(this, SIGNAL(process(Timestamp,const cv::Mat&)),
eyeProcessor, SLOT(process(Timestamp,const cv::Mat&)) ); eyeProcessor, SLOT(process(Timestamp,const cv::Mat&)) );
connect(this, SIGNAL(newROI(QPointF,QPointF)), 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)), connect(eyeProcessor, SIGNAL(newData(EyeData)),
this, SIGNAL(newData(EyeData)) ); this, SIGNAL(newData(EyeData)) );
// GUI // GUI
connect(this, SIGNAL(showOptions(QPoint)), connect(this, SIGNAL(showOptions(QPoint)),
...@@ -55,7 +57,7 @@ void ImageProcessor::create() ...@@ -55,7 +57,7 @@ void ImageProcessor::create()
eyeProcessorUI->pupilDetectionComboBox->addItem(name, name); eyeProcessorUI->pupilDetectionComboBox->addItem(name, name);
} }
connect(eyeProcessorUI, SIGNAL(updateConfig()), connect(eyeProcessorUI, SIGNAL(updateConfig()),
eyeProcessor, SLOT(updateConfig()) ); eyeProcessor, SLOT(updateConfig()) );
break; break;
case Field: case Field:
fieldProcessor = new FieldImageProcessor(id); fieldProcessor = new FieldImageProcessor(id);
...@@ -63,6 +65,8 @@ void ImageProcessor::create() ...@@ -63,6 +65,8 @@ void ImageProcessor::create()
fieldProcessor, SLOT(process(Timestamp,const cv::Mat&)) ); fieldProcessor, SLOT(process(Timestamp,const cv::Mat&)) );
connect(this, SIGNAL(newROI(QPointF,QPointF)), connect(this, SIGNAL(newROI(QPointF,QPointF)),
fieldProcessor, SLOT(newROI(QPointF,QPointF)) ); fieldProcessor, SLOT(newROI(QPointF,QPointF)) );
connect(this, SIGNAL(updateConfig()),
fieldProcessor, SLOT(updateConfig()) );
connect(fieldProcessor, SIGNAL(newData(FieldData)), connect(fieldProcessor, SIGNAL(newData(FieldData)),
this, SIGNAL(newData(FieldData)) ); this, SIGNAL(newData(FieldData)) );
......
...@@ -25,6 +25,7 @@ signals: ...@@ -25,6 +25,7 @@ signals:
void newROI(QPointF sROI, QPointF eROI); void newROI(QPointF sROI, QPointF eROI);
void newData(EyeData data); void newData(EyeData data);
void newData(FieldData data); void newData(FieldData data);
void updateConfig();
public slots: public slots:
void create(); 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