Skip to content
Snippets Groups Projects
Commit 76f937ad authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

rectification visualization fix

parent 81c91514
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28574 failed
......@@ -246,7 +246,7 @@ void IntrinsicCalibration::run() {
state_->flags, term);
state_->calib = CalibrationData::Intrinsic(K, distCoeffs, size);
state_->calib.sensorSize = ssize; // TODO: save somewhere else
state_->calib.sensorSize = ssize;
state_->calibrated = true;
}
catch (std::exception &e) {
......
......@@ -165,6 +165,7 @@ private:
nanogui::Button* bsave_;
nanogui::Button* bupload_;
nanogui::Button* bapply_;
nanogui::Button* bcalibrate_;
nanogui::Button* bpause_;
nanogui::Button* bresults_;
......@@ -204,6 +205,16 @@ ExtrinsicCalibrationView::ControlWindow::ControlWindow(nanogui::Widget* parent,
bupload_->setTextColor(nanogui::Color(32, 192, 32, 255));
});
bapply_ = new nanogui::Button(buttons, "");
bapply_->setFixedWidth(40);
bapply_->setTooltip("Rectify stereo images");
bapply_->setFlags(nanogui::Button::Flags::ToggleButton);
bapply_->setPushed(view_->rectify());
bapply_->setChangeCallback([button = bapply_, view = view_](bool v){
view->setRectify(v);
});
bresults_ = new nanogui::Button(buttons, "Show Calibration");
//bresults_->setEnabled(ctrl_->calib().calibrated());
bresults_->setCallback([view = view_, button = bresults_]{
......@@ -224,8 +235,15 @@ ExtrinsicCalibrationView::ControlWindow::ControlWindow(nanogui::Widget* parent,
}
void ExtrinsicCalibrationView::ControlWindow::draw(NVGcontext* ctx) {
if (ctrl_->capturing()) { bpause_->setCaption("Pause"); }
else { bpause_->setCaption("Continue"); }
if (ctrl_->capturing()) {
bpause_->setCaption("Pause");
view_->setRectify(false);
}
else {
bpause_->setCaption("Continue");
}
bapply_->setIcon(view_->rectify() ? ENTYPO_ICON_EYE : ENTYPO_ICON_EYE_WITH_LINE);
bapply_->setPushed(view_->rectify());
//bcalibrate_->setEnabled(ctrl_->calib().nFrames() > 0);
//bresults_->setEnabled(ctrl_->calib().calibrated());
FixedWindow::draw(ctx);
......@@ -430,7 +448,7 @@ ExtrinsicCalibrationView::ExtrinsicCalibrationView(Screen* widget, ExtrinsicCali
frames_ = new nanogui::Widget(this);
draw_number_ = false;
rectify_ = true;
rectify_ = false;
frames_->setLayout(new nanogui::BoxLayout
(nanogui::Orientation::Horizontal, nanogui::Alignment::Maximum, 0, 0));
......
......@@ -65,6 +65,8 @@ public:
virtual void draw(NVGcontext *ctx) override;
virtual void performLayout(NVGcontext *ctx) override;
bool rectify() { return rectify_; };
void setRectify(bool v) { rectify_ = v; };
void setMode(Mode m);
protected:
......
......@@ -356,7 +356,7 @@ void IntrinsicCalibrationView::ControlWindow::draw(NVGcontext* ctx) {
bresults_->setEnabled(ctrl_->calibrated());
bsave_->setEnabled(ctrl_->calibrated());
bapply_->setEnabled(ctrl_->calibrated());
bapply_->setIcon(view_->undistort() ? ENTYPO_ICON_EYE : ENTYPO_ICON_EYE);
bapply_->setIcon(view_->undistort() ? ENTYPO_ICON_EYE : ENTYPO_ICON_EYE_WITH_LINE);
bapply_->setPushed(view_->undistort());
updateCount();
FixedWindow::draw(ctx);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment