mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
fixed not uncompressed depth2D when restarting rtabmap with a prebuilt map for icp constraints
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@2053 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -140,7 +140,8 @@ public:
|
|||||||
|
|
||||||
SensorData toSensorData();
|
SensorData toSensorData();
|
||||||
void uncompressData();
|
void uncompressData();
|
||||||
void uncompressData(cv::Mat * imageRaw, cv::Mat * depthRaw, cv::Mat * depth2DRaw) const;
|
void uncompressData(cv::Mat * imageRaw, cv::Mat * depthRaw, cv::Mat * depth2DRaw);
|
||||||
|
void uncompressDataConst(cv::Mat * imageRaw, cv::Mat * depthRaw, cv::Mat * depth2DRaw) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _id;
|
int _id;
|
||||||
|
|||||||
@@ -247,7 +247,24 @@ void Signature::uncompressData()
|
|||||||
uncompressData(&_imageRaw, &_depthRaw, &_depth2DRaw);
|
uncompressData(&_imageRaw, &_depthRaw, &_depth2DRaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Signature::uncompressData(cv::Mat * imageRaw, cv::Mat * depthRaw, cv::Mat * depth2DRaw) const
|
void Signature::uncompressData(cv::Mat * imageRaw, cv::Mat * depthRaw, cv::Mat * depth2DRaw)
|
||||||
|
{
|
||||||
|
uncompressDataConst(imageRaw, depthRaw, depth2DRaw);
|
||||||
|
if(imageRaw && !imageRaw->empty() && _imageRaw.empty())
|
||||||
|
{
|
||||||
|
_imageRaw = *imageRaw;
|
||||||
|
}
|
||||||
|
if(depthRaw && !depthRaw->empty() && _depthRaw.empty())
|
||||||
|
{
|
||||||
|
_depthRaw = *depthRaw;
|
||||||
|
}
|
||||||
|
if(depth2DRaw && !depth2DRaw->empty() && _depth2DRaw.empty())
|
||||||
|
{
|
||||||
|
_depth2DRaw = *depth2DRaw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Signature::uncompressDataConst(cv::Mat * imageRaw, cv::Mat * depthRaw, cv::Mat * depth2DRaw) const
|
||||||
{
|
{
|
||||||
if(imageRaw)
|
if(imageRaw)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4294,7 +4294,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr MainWindow::getAssembledCloud(
|
|||||||
{
|
{
|
||||||
const Signature & s = _cachedSignatures.find(iter->first).value();
|
const Signature & s = _cachedSignatures.find(iter->first).value();
|
||||||
cv::Mat image, depth;
|
cv::Mat image, depth;
|
||||||
s.uncompressData(&image, &depth, 0);
|
s.uncompressDataConst(&image, &depth, 0);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
||||||
if(regenerateClouds)
|
if(regenerateClouds)
|
||||||
{
|
{
|
||||||
@@ -4380,7 +4380,7 @@ std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr > MainWindow::getClouds(
|
|||||||
{
|
{
|
||||||
const Signature & s = _cachedSignatures.find(iter->first).value();
|
const Signature & s = _cachedSignatures.find(iter->first).value();
|
||||||
cv::Mat image, depth;
|
cv::Mat image, depth;
|
||||||
s.uncompressData(&image, &depth, 0);
|
s.uncompressDataConst(&image, &depth, 0);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
||||||
if(regenerateClouds)
|
if(regenerateClouds)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,11 +73,14 @@ void PdfPlotItem::showDescription(bool shown)
|
|||||||
if(iter != _signaturesRef->constEnd() && !iter.value().getImageCompressed().empty())
|
if(iter != _signaturesRef->constEnd() && !iter.value().getImageCompressed().empty())
|
||||||
{
|
{
|
||||||
cv::Mat image;
|
cv::Mat image;
|
||||||
iter.value().uncompressData(&image, 0, 0);
|
iter.value().uncompressDataConst(&image, 0, 0);
|
||||||
img = uCvMat2QImage(iter.value().getImageRaw());
|
if(!image.empty())
|
||||||
QPixmap scaled = QPixmap::fromImage(img).scaledToWidth(128);
|
{
|
||||||
_img = new QGraphicsPixmapItem(scaled, this);
|
img = uCvMat2QImage(image);
|
||||||
_img->setVisible(false);
|
QPixmap scaled = QPixmap::fromImage(img).scaledToWidth(128);
|
||||||
|
_img = new QGraphicsPixmapItem(scaled, this);
|
||||||
|
_img->setVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user