mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-12 04:29:49 +08:00
Fixed warning cloudFromDepth not using CameraModel interface
This commit is contained in:
@@ -214,12 +214,15 @@ private:
|
|||||||
model.fromCameraInfo(*cameraInfo);
|
model.fromCameraInfo(*cameraInfo);
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr pclCloud;
|
pcl::PointCloud<pcl::PointXYZ>::Ptr pclCloud;
|
||||||
pclCloud = rtabmap::util3d::cloudFromDepth(
|
rtabmap::CameraModel m(
|
||||||
cv::Mat(imageDepthPtr->image, roi),
|
|
||||||
model.cx()-roiRatios_[0]*double(imageDepthPtr->image.cols),
|
|
||||||
model.cy()-roiRatios_[2]*double(imageDepthPtr->image.rows),
|
|
||||||
model.fx(),
|
model.fx(),
|
||||||
model.fy(),
|
model.fy(),
|
||||||
|
model.cx()-roiRatios_[0]*double(imageDepthPtr->image.cols),
|
||||||
|
model.cy()-roiRatios_[2]*double(imageDepthPtr->image.rows));
|
||||||
|
|
||||||
|
pclCloud = rtabmap::util3d::cloudFromDepth(
|
||||||
|
cv::Mat(imageDepthPtr->image, roi),
|
||||||
|
m,
|
||||||
decimation_);
|
decimation_);
|
||||||
processAndPublish(pclCloud, depth->header);
|
processAndPublish(pclCloud, depth->header);
|
||||||
|
|
||||||
|
|||||||
@@ -240,13 +240,16 @@ private:
|
|||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pclCloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pclCloud;
|
||||||
cv::Rect roi = rtabmap::Feature2D::computeRoi(imageDepthPtr->image, roiRatios_);
|
cv::Rect roi = rtabmap::Feature2D::computeRoi(imageDepthPtr->image, roiRatios_);
|
||||||
|
|
||||||
|
rtabmap::CameraModel m(
|
||||||
|
model.fx(),
|
||||||
|
model.fy(),
|
||||||
|
model.cx()-roiRatios_[0]*double(imageDepthPtr->image.cols),
|
||||||
|
model.cy()-roiRatios_[2]*double(imageDepthPtr->image.rows));
|
||||||
pclCloud = rtabmap::util3d::cloudFromDepthRGB(
|
pclCloud = rtabmap::util3d::cloudFromDepthRGB(
|
||||||
cv::Mat(imagePtr->image, roi),
|
cv::Mat(imagePtr->image, roi),
|
||||||
cv::Mat(imageDepthPtr->image, roi),
|
cv::Mat(imageDepthPtr->image, roi),
|
||||||
model.cx()-roiRatios_[0]*double(imageDepthPtr->image.cols),
|
m,
|
||||||
model.cy()-roiRatios_[2]*double(imageDepthPtr->image.rows),
|
|
||||||
model.fx(),
|
|
||||||
model.fy(),
|
|
||||||
decimation_);
|
decimation_);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user