Fixed cloudFromDepth() method when depth image is not the same size as the calibration file. That fixes projection map created from Tango databases (where depth size != rgb size)

This commit is contained in:
matlabbe
2016-07-08 12:47:23 -04:00
parent c8cd2545d3
commit 4cd8705710
8 changed files with 239 additions and 178 deletions
+17 -10
View File
@@ -2328,7 +2328,10 @@ void DatabaseViewer::update(int value,
{
depth = util2d::fillDepthHoles(depth, ui_->spinBox_mesh_fillDepthHoles->value(), float(ui_->spinBox_mesh_depthError->value())/100.0f);
}
cloud = util3d::cloudFromDepthRGB(data.imageRaw(), depth, data.cameraModels()[0].cx(), data.cameraModels()[0].cy(), data.cameraModels()[0].fx(), data.cameraModels()[0].fy());
cloud = util3d::cloudFromDepthRGB(
data.imageRaw(),
depth,
data.cameraModels()[0]);
}
else
{
@@ -2388,15 +2391,6 @@ void DatabaseViewer::update(int value,
}
}
if(!imgDepth.isNull())
{
view->setImageDepth(imgDepth);
rect = imgDepth.rect();
}
else
{
ULOGGER_DEBUG("Image depth is empty");
}
if(!img.isNull())
{
view->setImage(img);
@@ -2407,6 +2401,19 @@ void DatabaseViewer::update(int value,
ULOGGER_DEBUG("Image is empty");
}
if(!imgDepth.isNull())
{
view->setImageDepth(imgDepth);
if(!img.isNull())
{
rect = imgDepth.rect();
}
}
else
{
ULOGGER_DEBUG("Image depth is empty");
}
// loops
std::map<int, rtabmap::Link> links;
dbDriver_->loadLinks(id, links);