From 8838fd77057af4e72c87c372c402c13f833ec9d6 Mon Sep 17 00:00:00 2001 From: ld3812s <luke.dressen@alumni.fh-aachen.de> Date: Wed, 9 Nov 2022 10:10:31 +0100 Subject: [PATCH 1/3] set unused parameters to zero --- src/control.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/control.cpp b/src/control.cpp index 41c4fbfc7..fd9efcaeb 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -2826,14 +2826,23 @@ void Control::on_extModelCheckBox_stateChanged(int i) else if(i == Qt::Unchecked) { mUi->k4->setDisabled(true); + mUi->k4->setValue(0.); mUi->k5->setDisabled(true); + mUi->k5->setValue(0.); mUi->k6->setDisabled(true); + mUi->k6->setValue(0.); mUi->s1->setDisabled(true); + mUi->s1->setValue(0.); mUi->s2->setDisabled(true); + mUi->s2->setValue(0.); mUi->s3->setDisabled(true); + mUi->s3->setValue(0.); mUi->s4->setDisabled(true); + mUi->s4->setValue(0.); mUi->taux->setDisabled(true); + mUi->taux->setValue(0.); mUi->tauy->setDisabled(true); + mUi->tauy->setValue(0.); } mUi->intrError->setText(QString("invalid")); } -- GitLab From 5893db4ec40c5ce3bef65179f745e30a6f5802ba Mon Sep 17 00:00:00 2001 From: ld3812s <luke.dressen@alumni.fh-aachen.de> Date: Thu, 1 Dec 2022 13:02:22 +0100 Subject: [PATCH 2/3] set all parameters to zero when changing models --- src/control.cpp | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/control.cpp b/src/control.cpp index fd9efcaeb..408b39f43 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -2822,26 +2822,51 @@ void Control::on_extModelCheckBox_stateChanged(int i) mUi->s4->setEnabled(true); mUi->taux->setEnabled(true); mUi->tauy->setEnabled(true); + + mUi->fx->setValue(0.); + mUi->fy->setValue(0.); + mUi->cx->setValue(0.); + mUi->cy->setValue(0.); + mUi->r2->setValue(0.); + mUi->r4->setValue(0.); + mUi->r6->setValue(0.); + mUi->k4->setValue(0.); + mUi->k5->setValue(0.); + mUi->k6->setValue(0.); + mUi->s1->setValue(0.); + mUi->s2->setValue(0.); + mUi->s3->setValue(0.); + mUi->s4->setValue(0.); + mUi->taux->setValue(0.); + mUi->tauy->setValue(0.); } else if(i == Qt::Unchecked) { mUi->k4->setDisabled(true); - mUi->k4->setValue(0.); mUi->k5->setDisabled(true); - mUi->k5->setValue(0.); mUi->k6->setDisabled(true); - mUi->k6->setValue(0.); mUi->s1->setDisabled(true); - mUi->s1->setValue(0.); mUi->s2->setDisabled(true); - mUi->s2->setValue(0.); mUi->s3->setDisabled(true); - mUi->s3->setValue(0.); mUi->s4->setDisabled(true); - mUi->s4->setValue(0.); mUi->taux->setDisabled(true); - mUi->taux->setValue(0.); mUi->tauy->setDisabled(true); + + mUi->fx->setValue(0.); + mUi->fy->setValue(0.); + mUi->cx->setValue(0.); + mUi->cy->setValue(0.); + mUi->r2->setValue(0.); + mUi->r4->setValue(0.); + mUi->r6->setValue(0.); + mUi->k4->setValue(0.); + mUi->k5->setValue(0.); + mUi->k6->setValue(0.); + mUi->s1->setValue(0.); + mUi->s2->setValue(0.); + mUi->s3->setValue(0.); + mUi->s4->setValue(0.); + mUi->taux->setValue(0.); mUi->tauy->setValue(0.); } mUi->intrError->setText(QString("invalid")); -- GitLab From b21157a075befa07c2e2b14be1171a39def06b08 Mon Sep 17 00:00:00 2001 From: ld3812s <luke.dressen@alumni.fh-aachen.de> Date: Wed, 7 Dec 2022 11:22:29 +0100 Subject: [PATCH 3/3] test new calibParams struct --- include/calibFilter.h | 41 ++++++---- src/calibFilter.cpp | 186 ++++++++++++++++++++++-------------------- src/control.cpp | 140 +++++++++++++++---------------- 3 files changed, 195 insertions(+), 172 deletions(-) diff --git a/include/calibFilter.h b/include/calibFilter.h index 95ff20832..e1a3fedb5 100644 --- a/include/calibFilter.h +++ b/include/calibFilter.h @@ -23,16 +23,10 @@ #include "filter.h" -/** - * @brief Undistortion filter - * - * This class is a filter which undistorts the image using the camera matrix from intrinsic calibration. - * It caches the mapping from distorted to undistorted image. - */ -class CalibFilter : public Filter -{ +struct CalibParams{ private: Parameter mFx; + Parameter mFy; Parameter mCx; Parameter mCy; @@ -51,14 +45,9 @@ private: Parameter mTAUX; Parameter mTAUY; double mReprojectionError; - cv::Mat map1; - cv::Mat map2; public: - CalibFilter(); - - cv::Mat act(cv::Mat &img, cv::Mat &res); - + CalibParams(); Parameter *getFx(); Parameter *getFy(); Parameter *getCx(); @@ -78,7 +67,29 @@ public: Parameter *getTAUX(); Parameter *getTAUY(); double getReprojectionError() const; - void setReprojectionError(double d); + void setFilter(Filter *filter); +}; + +/** + * @brief Undistortion filter + * + * This class is a filter which undistorts the image using the camera matrix from intrinsic calibration. + * It caches the mapping from distorted to undistorted image. + */ +class CalibFilter : public Filter +{ +private: + + cv::Mat map1; + cv::Mat map2; + CalibParams *calibParamsExtModel; + CalibParams *calibParamsOldModel; + +public: + CalibFilter(); + + cv::Mat act(cv::Mat &img, cv::Mat &res); + CalibParams *getCp(); }; #endif diff --git a/src/calibFilter.cpp b/src/calibFilter.cpp index 587db61f2..d824a4180 100644 --- a/src/calibFilter.cpp +++ b/src/calibFilter.cpp @@ -22,227 +22,239 @@ #include "helper.h" - -CalibFilter::CalibFilter() : Filter() -{ +CalibParams::CalibParams(){ getFx()->setMinimum(500.); getFx()->setMaximum(5000.); getFx()->setValue(881.); - getFx()->setFilter(this); getFy()->setMinimum(500.); getFy()->setMaximum(5000.); getFy()->setValue(881.); - getFy()->setFilter(this); getCx()->setMinimum(0.); getCx()->setMaximum(4096 /*1023.*/); getCx()->setValue(511.5); - getCx()->setFilter(this); getCy()->setMinimum(0.); getCy()->setMaximum(2160 /*767.*/); getCy()->setValue(383.5); - getCy()->setFilter(this); getR2()->setMinimum(-5.); getR2()->setMaximum(5.); getR2()->setValue(0.); - getR2()->setFilter(this); getR4()->setMinimum(-5.); getR4()->setMaximum(5.); getR4()->setValue(0.); - getR4()->setFilter(this); getTx()->setMinimum(-5.); getTx()->setMaximum(5.); getTx()->setValue(0.); - getTx()->setFilter(this); getTy()->setMinimum(-5.); getTy()->setMaximum(5.); getTy()->setValue(0.); - getTy()->setFilter(this); getR6()->setMinimum(-5.); getR6()->setMaximum(5.); getR6()->setValue(0.); - getR6()->setFilter(this); getK4()->setMinimum(-5.); getK4()->setMaximum(5.); getK4()->setValue(0.); - getK4()->setFilter(this); getK5()->setMinimum(-5.); getK5()->setMaximum(5.); getK5()->setValue(0.); - getK5()->setFilter(this); getK6()->setMinimum(-5.); getK6()->setMaximum(5.); getK6()->setValue(0.); - getK6()->setFilter(this); getS1()->setMinimum(-5.); getS1()->setMaximum(5.); getS1()->setValue(0.); - getS1()->setFilter(this); getS2()->setMinimum(-5.); getS2()->setMaximum(5.); getS2()->setValue(0.); - getS2()->setFilter(this); getS3()->setMinimum(-5.); getS3()->setMaximum(5.); getS3()->setValue(0.); - getS3()->setFilter(this); getS4()->setMinimum(-5.); getS4()->setMaximum(5.); getS4()->setValue(0.); - getS4()->setFilter(this); getTAUX()->setMinimum(-5.); getTAUX()->setMaximum(5.); getTAUX()->setValue(0.); - getTAUX()->setFilter(this); getTAUY()->setMinimum(-5.); getTAUY()->setMaximum(5.); getTAUY()->setValue(0.); - getTAUY()->setFilter(this); mReprojectionError = std::numeric_limits<double>::quiet_NaN(); + } -/** - * @brief Undistorts the image. - * - * This method calculates and caches the mapping for undistortion. - * The mapping is applied to the input image. - * - * @param img[in] - * @param res[out] - * @return undistorted image - */ -cv::Mat CalibFilter::act(cv::Mat &img, cv::Mat &res) +CalibFilter::CalibFilter() : Filter() { - if(this->changed() || map1.size() != img.size()) - { - cv::Mat camera = - (cv::Mat_<float>(3, 3) << getFx()->getValue(), - 0, - getCx()->getValue(), - 0, - getFy()->getValue(), - getCy()->getValue(), - 0, - 0, - 1); - cv::Mat dist = - (cv::Mat_<float>(1, 14) << getR2()->getValue(), - getR4()->getValue(), - getTx()->getValue(), - getTy()->getValue(), - getR6()->getValue(), - getK4()->getValue(), - getK5()->getValue(), - getK6()->getValue(), - getS1()->getValue(), - getS2()->getValue(), - getS3()->getValue(), - getS4()->getValue(), - getTAUX()->getValue(), - getTAUY()->getValue()); + calibParamsExtModel = new CalibParams(); + calibParamsOldModel = new CalibParams(); - - initUndistortRectifyMap(camera, dist, cv::Mat_<double>::eye(3, 3), camera, img.size(), CV_16SC2, map1, map2); - } - - cv::remap(img, res, map1, map2, cv::INTER_LINEAR, cv::BORDER_CONSTANT); - return res; + calibParamsExtModel->setFilter(this); } - -Parameter *CalibFilter::getFx() +Parameter *CalibParams::getFx() { return &mFx; } -Parameter *CalibFilter::getFy() +Parameter *CalibParams::getFy() { return &mFy; } -Parameter *CalibFilter::getCx() +Parameter *CalibParams::getCx() { return &mCx; } -Parameter *CalibFilter::getCy() +Parameter *CalibParams::getCy() { return &mCy; } -Parameter *CalibFilter::getR2() +Parameter *CalibParams::getR2() { return &mR2; } -Parameter *CalibFilter::getR4() +Parameter *CalibParams::getR4() { return &mR4; } -Parameter *CalibFilter::getTx() +Parameter *CalibParams::getTx() { return &mTx; } -Parameter *CalibFilter::getTy() +Parameter *CalibParams::getTy() { return &mTy; } -Parameter *CalibFilter::getR6() +Parameter *CalibParams::getR6() { return &mR6; } -Parameter *CalibFilter::getK4() +Parameter *CalibParams::getK4() { return &mK4; } -Parameter *CalibFilter::getK5() +Parameter *CalibParams::getK5() { return &mK5; } -Parameter *CalibFilter::getK6() +Parameter *CalibParams::getK6() { return &mK6; } -Parameter *CalibFilter::getS1() +Parameter *CalibParams::getS1() { return &mS1; } -Parameter *CalibFilter::getS2() +Parameter *CalibParams::getS2() { return &mS2; } -Parameter *CalibFilter::getS3() +Parameter *CalibParams::getS3() { return &mS3; } -Parameter *CalibFilter::getS4() +Parameter *CalibParams::getS4() { return &mS4; } -Parameter *CalibFilter::getTAUX() +Parameter *CalibParams::getTAUX() { return &mTAUX; } -Parameter *CalibFilter::getTAUY() +Parameter *CalibParams::getTAUY() { return &mTAUY; } -double CalibFilter::getReprojectionError() const +double CalibParams::getReprojectionError() const { return mReprojectionError; } -void CalibFilter::setReprojectionError(double d) +void CalibParams::setFilter(Filter *filter){ + getFx()->setFilter(filter); + getFy()->setFilter(filter); + getCx()->setFilter(filter); + getCy()->setFilter(filter); + getR2()->setFilter(filter); + getR4()->setFilter(filter); + getR6()->setFilter(filter); + getTx()->setFilter(filter); + getTy()->setFilter(filter); + getK4()->setFilter(filter); + getK5()->setFilter(filter); + getK6()->setFilter(filter); + getS1()->setFilter(filter); + getS2()->setFilter(filter); + getS3()->setFilter(filter); + getS4()->setFilter(filter); + getTAUX()->setFilter(filter); + getTAUY()->setFilter(filter); +} + +/** + * @brief Undistorts the image. + * + * This method calculates and caches the mapping for undistortion. + * The mapping is applied to the input image. + * + * @param img[in] + * @param res[out] + * @return undistorted image + */ +cv::Mat CalibFilter::act(cv::Mat &img, cv::Mat &res) { - mReprojectionError = d; + if(this->changed() || map1.size() != img.size()) + { + cv::Mat camera = + (cv::Mat_<float>(3, 3) << getCp()->getFx()->getValue(), + 0, + getCp()->getCx()->getValue(), + 0, + getCp()->getFy()->getValue(), + getCp()->getCy()->getValue(), + 0, + 0, + 1); + debout << camera << std::endl; + cv::Mat dist = + (cv::Mat_<float>(1, 14) << getCp()->getR2()->getValue(), + getCp()->getR4()->getValue(), + getCp()->getTx()->getValue(), + getCp()->getTy()->getValue(), + getCp()->getR6()->getValue(), + getCp()->getK4()->getValue(), + getCp()->getK5()->getValue(), + getCp()->getK6()->getValue(), + getCp()->getS1()->getValue(), + getCp()->getS2()->getValue(), + getCp()->getS3()->getValue(), + getCp()->getS4()->getValue(), + getCp()->getTAUX()->getValue(), + getCp()->getTAUY()->getValue()); + + + initUndistortRectifyMap(camera, dist, cv::Mat_<double>::eye(3, 3), camera, img.size(), CV_16SC2, map1, map2); + } + + cv::remap(img, res, map1, map2, cv::INTER_LINEAR, cv::BORDER_CONSTANT); + return res; +} + + +CalibParams *CalibFilter::getCp() +{ + return calibParamsExtModel; } + diff --git a/src/control.cpp b/src/control.cpp index 408b39f43..bab194724 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -104,74 +104,74 @@ Control::Control( setFilterBorderSizeMin(mMainWindow->getBorderFilter()->getBorderSize()->getMinimum()); setFilterBorderSizeMax(mMainWindow->getBorderFilter()->getBorderSize()->getMaximum()); - setCalibFxMin(mMainWindow->getCalibFilter()->getFx()->getMinimum()); - setCalibFxMax(mMainWindow->getCalibFilter()->getFx()->getMaximum()); - setCalibFx(mMainWindow->getCalibFilter()->getFx()->getValue()); + setCalibFxMin(mMainWindow->getCalibFilter()->getCp()->getFx()->getMinimum()); + setCalibFxMax(mMainWindow->getCalibFilter()->getCp()->getFx()->getMaximum()); + setCalibFx(mMainWindow->getCalibFilter()->getCp()->getFx()->getValue()); - setCalibFyMin(mMainWindow->getCalibFilter()->getFy()->getMinimum()); - setCalibFyMax(mMainWindow->getCalibFilter()->getFy()->getMaximum()); - setCalibFy(mMainWindow->getCalibFilter()->getFy()->getValue()); + setCalibFyMin(mMainWindow->getCalibFilter()->getCp()->getFy()->getMinimum()); + setCalibFyMax(mMainWindow->getCalibFilter()->getCp()->getFy()->getMaximum()); + setCalibFy(mMainWindow->getCalibFilter()->getCp()->getFy()->getValue()); - setCalibCx(mMainWindow->getCalibFilter()->getCx()->getValue()); + setCalibCx(mMainWindow->getCalibFilter()->getCp()->getCx()->getValue()); - setCalibCy(mMainWindow->getCalibFilter()->getCy()->getValue()); + setCalibCy(mMainWindow->getCalibFilter()->getCp()->getCy()->getValue()); - setCalibR2Min(mMainWindow->getCalibFilter()->getR2()->getMinimum()); - setCalibR2Max(mMainWindow->getCalibFilter()->getR2()->getMaximum()); - setCalibR2(mMainWindow->getCalibFilter()->getR2()->getValue()); + setCalibR2Min(mMainWindow->getCalibFilter()->getCp()->getR2()->getMinimum()); + setCalibR2Max(mMainWindow->getCalibFilter()->getCp()->getR2()->getMaximum()); + setCalibR2(mMainWindow->getCalibFilter()->getCp()->getR2()->getValue()); - setCalibR4Min(mMainWindow->getCalibFilter()->getR4()->getMinimum()); - setCalibR4Max(mMainWindow->getCalibFilter()->getR4()->getMaximum()); - setCalibR4(mMainWindow->getCalibFilter()->getR4()->getValue()); + setCalibR4Min(mMainWindow->getCalibFilter()->getCp()->getR4()->getMinimum()); + setCalibR4Max(mMainWindow->getCalibFilter()->getCp()->getR4()->getMaximum()); + setCalibR4(mMainWindow->getCalibFilter()->getCp()->getR4()->getValue()); - setCalibR6Min(mMainWindow->getCalibFilter()->getR6()->getMinimum()); - setCalibR6Max(mMainWindow->getCalibFilter()->getR6()->getMaximum()); - setCalibR6(mMainWindow->getCalibFilter()->getR6()->getValue()); + setCalibR6Min(mMainWindow->getCalibFilter()->getCp()->getR6()->getMinimum()); + setCalibR6Max(mMainWindow->getCalibFilter()->getCp()->getR6()->getMaximum()); + setCalibR6(mMainWindow->getCalibFilter()->getCp()->getR6()->getValue()); - setCalibTxMin(mMainWindow->getCalibFilter()->getTx()->getMinimum()); - setCalibTxMax(mMainWindow->getCalibFilter()->getTx()->getMaximum()); - setCalibTx(mMainWindow->getCalibFilter()->getTx()->getValue()); + setCalibTxMin(mMainWindow->getCalibFilter()->getCp()->getTx()->getMinimum()); + setCalibTxMax(mMainWindow->getCalibFilter()->getCp()->getTx()->getMaximum()); + setCalibTx(mMainWindow->getCalibFilter()->getCp()->getTx()->getValue()); - setCalibTyMin(mMainWindow->getCalibFilter()->getTy()->getMinimum()); - setCalibTyMax(mMainWindow->getCalibFilter()->getTy()->getMaximum()); - setCalibTy(mMainWindow->getCalibFilter()->getTy()->getValue()); + setCalibTyMin(mMainWindow->getCalibFilter()->getCp()->getTy()->getMinimum()); + setCalibTyMax(mMainWindow->getCalibFilter()->getCp()->getTy()->getMaximum()); + setCalibTy(mMainWindow->getCalibFilter()->getCp()->getTy()->getValue()); - setCalibK4Min(mMainWindow->getCalibFilter()->getK4()->getMinimum()); - setCalibK4Max(mMainWindow->getCalibFilter()->getK4()->getMaximum()); - setCalibK4(mMainWindow->getCalibFilter()->getK4()->getValue()); + setCalibK4Min(mMainWindow->getCalibFilter()->getCp()->getK4()->getMinimum()); + setCalibK4Max(mMainWindow->getCalibFilter()->getCp()->getK4()->getMaximum()); + setCalibK4(mMainWindow->getCalibFilter()->getCp()->getK4()->getValue()); - setCalibK5Min(mMainWindow->getCalibFilter()->getK5()->getMinimum()); - setCalibK5Max(mMainWindow->getCalibFilter()->getK5()->getMaximum()); - setCalibK5(mMainWindow->getCalibFilter()->getK5()->getValue()); + setCalibK5Min(mMainWindow->getCalibFilter()->getCp()->getK5()->getMinimum()); + setCalibK5Max(mMainWindow->getCalibFilter()->getCp()->getK5()->getMaximum()); + setCalibK5(mMainWindow->getCalibFilter()->getCp()->getK5()->getValue()); - setCalibK6Min(mMainWindow->getCalibFilter()->getK6()->getMinimum()); - setCalibK6Max(mMainWindow->getCalibFilter()->getK6()->getMaximum()); - setCalibK6(mMainWindow->getCalibFilter()->getK6()->getValue()); + setCalibK6Min(mMainWindow->getCalibFilter()->getCp()->getK6()->getMinimum()); + setCalibK6Max(mMainWindow->getCalibFilter()->getCp()->getK6()->getMaximum()); + setCalibK6(mMainWindow->getCalibFilter()->getCp()->getK6()->getValue()); - setCalibS1Min(mMainWindow->getCalibFilter()->getS1()->getMinimum()); - setCalibS1Max(mMainWindow->getCalibFilter()->getS1()->getMaximum()); - setCalibS1(mMainWindow->getCalibFilter()->getS1()->getValue()); + setCalibS1Min(mMainWindow->getCalibFilter()->getCp()->getS1()->getMinimum()); + setCalibS1Max(mMainWindow->getCalibFilter()->getCp()->getS1()->getMaximum()); + setCalibS1(mMainWindow->getCalibFilter()->getCp()->getS1()->getValue()); - setCalibS2Min(mMainWindow->getCalibFilter()->getS2()->getMinimum()); - setCalibS2Max(mMainWindow->getCalibFilter()->getS2()->getMaximum()); - setCalibS2(mMainWindow->getCalibFilter()->getS2()->getValue()); + setCalibS2Min(mMainWindow->getCalibFilter()->getCp()->getS2()->getMinimum()); + setCalibS2Max(mMainWindow->getCalibFilter()->getCp()->getS2()->getMaximum()); + setCalibS2(mMainWindow->getCalibFilter()->getCp()->getS2()->getValue()); - setCalibS3Min(mMainWindow->getCalibFilter()->getS3()->getMinimum()); - setCalibS3Max(mMainWindow->getCalibFilter()->getS3()->getMaximum()); - setCalibS3(mMainWindow->getCalibFilter()->getS3()->getValue()); + setCalibS3Min(mMainWindow->getCalibFilter()->getCp()->getS3()->getMinimum()); + setCalibS3Max(mMainWindow->getCalibFilter()->getCp()->getS3()->getMaximum()); + setCalibS3(mMainWindow->getCalibFilter()->getCp()->getS3()->getValue()); - setCalibS4Min(mMainWindow->getCalibFilter()->getS4()->getMinimum()); - setCalibS4Max(mMainWindow->getCalibFilter()->getS4()->getMaximum()); - setCalibS4(mMainWindow->getCalibFilter()->getS4()->getValue()); + setCalibS4Min(mMainWindow->getCalibFilter()->getCp()->getS4()->getMinimum()); + setCalibS4Max(mMainWindow->getCalibFilter()->getCp()->getS4()->getMaximum()); + setCalibS4(mMainWindow->getCalibFilter()->getCp()->getS4()->getValue()); - setCalibTAUXMin(mMainWindow->getCalibFilter()->getTAUX()->getMinimum()); - setCalibTAUXMax(mMainWindow->getCalibFilter()->getTAUX()->getMaximum()); - setCalibTAUX(mMainWindow->getCalibFilter()->getTAUX()->getValue()); + setCalibTAUXMin(mMainWindow->getCalibFilter()->getCp()->getTAUX()->getMinimum()); + setCalibTAUXMax(mMainWindow->getCalibFilter()->getCp()->getTAUX()->getMaximum()); + setCalibTAUX(mMainWindow->getCalibFilter()->getCp()->getTAUX()->getValue()); - setCalibTAUYMin(mMainWindow->getCalibFilter()->getTAUY()->getMinimum()); - setCalibTAUYMax(mMainWindow->getCalibFilter()->getTAUY()->getMaximum()); - setCalibTAUY(mMainWindow->getCalibFilter()->getTAUY()->getValue()); - setCalibReprError(mMainWindow->getCalibFilter()->getReprojectionError()); + setCalibTAUYMin(mMainWindow->getCalibFilter()->getCp()->getTAUY()->getMinimum()); + setCalibTAUYMax(mMainWindow->getCalibFilter()->getCp()->getTAUY()->getMaximum()); + setCalibTAUY(mMainWindow->getCalibFilter()->getCp()->getTAUY()->getValue()); + setCalibReprError(mMainWindow->getCalibFilter()->getCp()->getReprojectionError()); // statt folgender Zeile kann zB on_cx_valueChanged einfach kodiert werden (su) @@ -2559,7 +2559,7 @@ void Control::on_apply_stateChanged(int i) void Control::on_fx_valueChanged(double d) { mIntrinsicCameraParams.cameraMatrix.at<double>(0, 0) = d; - mMainWindow->getCalibFilter()->getFx()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getFx()->setValue(d); if(mUi->quadAspectRatio->isChecked()) { mUi->fy->setValue(d); @@ -2575,7 +2575,7 @@ void Control::on_fx_valueChanged(double d) void Control::on_fy_valueChanged(double d) { mIntrinsicCameraParams.cameraMatrix.at<double>(1, 1) = d; - mMainWindow->getCalibFilter()->getFy()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getFy()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2588,7 +2588,7 @@ void Control::on_cx_valueChanged(double d) { mIntrinsicCameraParams.cameraMatrix.at<double>(0, 2) = d; mMainWindow->setStatusPosReal(); - mMainWindow->getCalibFilter()->getCx()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getCx()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateCoord(); @@ -2600,7 +2600,7 @@ void Control::on_cy_valueChanged(double d) { mIntrinsicCameraParams.cameraMatrix.at<double>(1, 2) = d; mMainWindow->setStatusPosReal(); - mMainWindow->getCalibFilter()->getCy()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getCy()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateCoord(); @@ -2610,7 +2610,7 @@ void Control::on_cy_valueChanged(double d) void Control::on_r2_valueChanged(double d) { - mMainWindow->getCalibFilter()->getR2()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getR2()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2620,7 +2620,7 @@ void Control::on_r2_valueChanged(double d) void Control::on_r4_valueChanged(double d) { - mMainWindow->getCalibFilter()->getR4()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getR4()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2630,7 +2630,7 @@ void Control::on_r4_valueChanged(double d) void Control::on_r6_valueChanged(double d) { - mMainWindow->getCalibFilter()->getR6()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getR6()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2639,7 +2639,7 @@ void Control::on_r6_valueChanged(double d) } void Control::on_s1_valueChanged(double d) { - mMainWindow->getCalibFilter()->getS1()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getS1()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2648,7 +2648,7 @@ void Control::on_s1_valueChanged(double d) } void Control::on_s2_valueChanged(double d) { - mMainWindow->getCalibFilter()->getS2()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getS2()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2657,7 +2657,7 @@ void Control::on_s2_valueChanged(double d) } void Control::on_s3_valueChanged(double d) { - mMainWindow->getCalibFilter()->getS3()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getS3()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2666,7 +2666,7 @@ void Control::on_s3_valueChanged(double d) } void Control::on_s4_valueChanged(double d) { - mMainWindow->getCalibFilter()->getS4()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getS4()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2675,7 +2675,7 @@ void Control::on_s4_valueChanged(double d) } void Control::on_taux_valueChanged(double d) { - mMainWindow->getCalibFilter()->getTAUX()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getTAUX()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2684,7 +2684,7 @@ void Control::on_taux_valueChanged(double d) } void Control::on_tauy_valueChanged(double d) { - mMainWindow->getCalibFilter()->getTAUY()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getTAUY()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2695,7 +2695,7 @@ void Control::on_tauy_valueChanged(double d) void Control::on_tx_valueChanged(double d) { - mMainWindow->getCalibFilter()->getTx()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getTx()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2705,7 +2705,7 @@ void Control::on_tx_valueChanged(double d) void Control::on_ty_valueChanged(double d) { - mMainWindow->getCalibFilter()->getTy()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getTy()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2714,7 +2714,7 @@ void Control::on_ty_valueChanged(double d) } void Control::on_k4_valueChanged(double d) { - mMainWindow->getCalibFilter()->getK4()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getK4()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2723,7 +2723,7 @@ void Control::on_k4_valueChanged(double d) } void Control::on_k5_valueChanged(double d) { - mMainWindow->getCalibFilter()->getK5()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getK5()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -2732,7 +2732,7 @@ void Control::on_k5_valueChanged(double d) } void Control::on_k6_valueChanged(double d) { - mMainWindow->getCalibFilter()->getK6()->setValue(d); + mMainWindow->getCalibFilter()->getCp()->getK6()->setValue(d); if(!mMainWindow->isLoading()) { mMainWindow->updateImage(); @@ -3402,7 +3402,7 @@ void Control::setXml(QDomElement &elem) subSubElem.setAttribute("S4", mUi->s4->value()); subSubElem.setAttribute("TAUX", mUi->taux->value()); subSubElem.setAttribute("TAUY", mUi->tauy->value()); - subSubElem.setAttribute("ReprError", mMainWindow->getCalibFilter()->getReprojectionError()); + subSubElem.setAttribute("ReprError", mMainWindow->getCalibFilter()->getCp()->getReprojectionError()); subSubElem.setAttribute("QUAD_ASPECT_RATIO", mUi->quadAspectRatio->isChecked()); subSubElem.setAttribute("FIX_CENTER", mUi->fixCenter->isChecked()); -- GitLab