mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Reverted change of cloudFromStereoImages() decimation, should be done after StereoBM to avoid backward compatibility problems
This commit is contained in:
@@ -129,7 +129,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP cloudFromStereoImages(
|
|||||||
const cv::Mat & imageLeft,
|
const cv::Mat & imageLeft,
|
||||||
const cv::Mat & imageRight,
|
const cv::Mat & imageRight,
|
||||||
const StereoCameraModel & model,
|
const StereoCameraModel & model,
|
||||||
float decimation = 1.0f,
|
int decimation = 1,
|
||||||
float maxDepth = 0.0f,
|
float maxDepth = 0.0f,
|
||||||
float minDepth = 0.0f,
|
float minDepth = 0.0f,
|
||||||
std::vector<int> * validIndices = 0,
|
std::vector<int> * validIndices = 0,
|
||||||
|
|||||||
+3
-16
@@ -759,7 +759,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
|
|||||||
const cv::Mat & imageLeft,
|
const cv::Mat & imageLeft,
|
||||||
const cv::Mat & imageRight,
|
const cv::Mat & imageRight,
|
||||||
const StereoCameraModel & model,
|
const StereoCameraModel & model,
|
||||||
float decimation,
|
int decimation,
|
||||||
float maxDepth,
|
float maxDepth,
|
||||||
float minDepth,
|
float minDepth,
|
||||||
std::vector<int> * validIndices,
|
std::vector<int> * validIndices,
|
||||||
@@ -775,19 +775,6 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
|
|||||||
cv::Mat leftColor = imageLeft;
|
cv::Mat leftColor = imageLeft;
|
||||||
cv::Mat rightMono = imageRight;
|
cv::Mat rightMono = imageRight;
|
||||||
|
|
||||||
StereoCameraModel modelDecimation = model;
|
|
||||||
|
|
||||||
if(decimation>1.0f)
|
|
||||||
{
|
|
||||||
cv::Mat resized;
|
|
||||||
cv::resize(leftColor, resized, cv::Size(), 1.0f/decimation, 1.0f/decimation, cv::INTER_AREA);
|
|
||||||
leftColor = resized;
|
|
||||||
resized = cv::Mat();
|
|
||||||
cv::resize(rightMono, resized, cv::Size(), 1.0f/decimation, 1.0f/decimation, cv::INTER_AREA);
|
|
||||||
rightMono = resized;
|
|
||||||
modelDecimation.scale(1/float(decimation));
|
|
||||||
}
|
|
||||||
|
|
||||||
cv::Mat leftMono;
|
cv::Mat leftMono;
|
||||||
if(leftColor.channels() == 3)
|
if(leftColor.channels() == 3)
|
||||||
{
|
{
|
||||||
@@ -801,8 +788,8 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
|
|||||||
return cloudFromDisparityRGB(
|
return cloudFromDisparityRGB(
|
||||||
leftColor,
|
leftColor,
|
||||||
util2d::disparityFromStereoImages(leftMono, rightMono, parameters),
|
util2d::disparityFromStereoImages(leftMono, rightMono, parameters),
|
||||||
modelDecimation,
|
model,
|
||||||
1,
|
decimation,
|
||||||
maxDepth,
|
maxDepth,
|
||||||
minDepth,
|
minDepth,
|
||||||
validIndices);
|
validIndices);
|
||||||
|
|||||||
Reference in New Issue
Block a user