From 0e85bd849c3a50d621ceccc81d8292a0d460d2e2 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Mon, 16 Sep 2024 15:55:38 -0700 Subject: [PATCH] Improved image view scene rect size when no images are there. Added warning when transform cannot be computed because some data are missing. --- corelib/src/Memory.cpp | 9 +++++++++ guilib/src/DatabaseViewer.cpp | 19 +++++++++++++++++++ guilib/src/MainWindow.cpp | 4 ++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/corelib/src/Memory.cpp b/corelib/src/Memory.cpp index ef3a555525..0357fbba6b 100644 --- a/corelib/src/Memory.cpp +++ b/corelib/src/Memory.cpp @@ -3186,6 +3186,15 @@ Transform Memory::computeTransform( transform = transform.inverse(); } } + else + { + std::string msg = uFormat("Missing visual features or missing raw data to compute them. Transform cannot be estimated."); + if(info) + { + info->rejectedMsg = msg; + } + UWARN(msg.c_str()); + } return transform; } diff --git a/guilib/src/DatabaseViewer.cpp b/guilib/src/DatabaseViewer.cpp index cb182c26b5..5b79e92cb3 100644 --- a/guilib/src/DatabaseViewer.cpp +++ b/guilib/src/DatabaseViewer.cpp @@ -4762,6 +4762,25 @@ void DatabaseViewer::update(int value, { ULOGGER_DEBUG("Image depth is empty"); } + if(!rect.isValid()) + { + if(data.cameraModels().size()) + { + for(unsigned int i=0; isetSceneRect(rect); diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index 185ccc886a..d3974d8086 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -2328,7 +2328,7 @@ void MainWindow::processStats(const rtabmap::Statistics & stat) for(unsigned int i=0; i