Reverted change of cloudFromStereoImages() decimation, should be done after StereoBM to avoid backward compatibility problems

This commit is contained in:
matlabbe
2017-04-24 15:26:12 -04:00
parent 4e3216a75d
commit 6e1dbbcf4f
2 changed files with 4 additions and 17 deletions

View File

@@ -129,7 +129,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP cloudFromStereoImages(
const cv::Mat & imageLeft,
const cv::Mat & imageRight,
const StereoCameraModel & model,
float decimation = 1.0f,
int decimation = 1,
float maxDepth = 0.0f,
float minDepth = 0.0f,
std::vector<int> * validIndices = 0,

View File

@@ -759,7 +759,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
const cv::Mat & imageLeft,
const cv::Mat & imageRight,
const StereoCameraModel & model,
float decimation,
int decimation,
float maxDepth,
float minDepth,
std::vector<int> * validIndices,
@@ -775,19 +775,6 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
cv::Mat leftColor = imageLeft;
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;
if(leftColor.channels() == 3)
{
@@ -801,8 +788,8 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
return cloudFromDisparityRGB(
leftColor,
util2d::disparityFromStereoImages(leftMono, rightMono, parameters),
modelDecimation,
1,
model,
decimation,
maxDepth,
minDepth,
validIndices);