mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Improved image view scene rect size when no images are there. Added warning when transform cannot be computed because some data are missing.
This commit is contained in:
@@ -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; i<data.cameraModels().size(); ++i)
|
||||
{
|
||||
rect.setWidth(rect.width()+data.cameraModels()[i].imageWidth());
|
||||
rect.setHeight(std::max((int)rect.height(), data.cameraModels()[i].imageHeight()));
|
||||
}
|
||||
}
|
||||
else if(data.stereoCameraModels().size())
|
||||
{
|
||||
for(unsigned int i=0; i<data.cameraModels().size(); ++i)
|
||||
{
|
||||
rect.setWidth(rect.width()+data.stereoCameraModels()[i].left().imageWidth());
|
||||
rect.setHeight(std::max((int)rect.height(), data.stereoCameraModels()[i].left().imageHeight()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rect.isValid())
|
||||
{
|
||||
view->setSceneRect(rect);
|
||||
|
||||
@@ -2328,7 +2328,7 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
for(unsigned int i=0; i<signature.sensorData().cameraModels().size(); ++i)
|
||||
{
|
||||
sceneRect.setWidth(sceneRect.width()+signature.sensorData().cameraModels()[i].imageWidth());
|
||||
sceneRect.setHeight(sceneRect.height()+signature.sensorData().cameraModels()[i].imageHeight());
|
||||
sceneRect.setHeight(std::max((int)sceneRect.height(), signature.sensorData().cameraModels()[i].imageHeight()));
|
||||
}
|
||||
}
|
||||
else if(signature.sensorData().stereoCameraModels().size())
|
||||
@@ -2336,7 +2336,7 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
for(unsigned int i=0; i<signature.sensorData().cameraModels().size(); ++i)
|
||||
{
|
||||
sceneRect.setWidth(sceneRect.width()+signature.sensorData().stereoCameraModels()[i].left().imageWidth());
|
||||
sceneRect.setHeight(sceneRect.height()+signature.sensorData().stereoCameraModels()[i].left().imageHeight());
|
||||
sceneRect.setHeight(std::max((int)sceneRect.height(), signature.sensorData().stereoCameraModels()[i].left().imageHeight()));
|
||||
}
|
||||
}
|
||||
if(sceneRect.isValid())
|
||||
|
||||
Reference in New Issue
Block a user