mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Stereo: min and max disparity parameters are now float. ImageView: adjusted background color of info boxes.
This commit is contained in:
@@ -135,7 +135,7 @@ std::vector<cv::Point2f> StereoOpticalFlow::computeCorrespondences(
|
||||
if(status[i]!=0)
|
||||
{
|
||||
float disparity = leftCorners[i].x - rightCorners[i].x;
|
||||
if(disparity < float(this->minDisparity()) || disparity > float(this->maxDisparity()))
|
||||
if(disparity <= this->minDisparity() || disparity > this->maxDisparity())
|
||||
{
|
||||
status[i] = 0;
|
||||
++countDisparityRejected;
|
||||
|
||||
@@ -126,14 +126,14 @@ std::vector<cv::Point2f> calcStereoCorrespondences(
|
||||
cv::Size winSize,
|
||||
int maxLevel,
|
||||
int iterations,
|
||||
int minDisparity,
|
||||
int maxDisparity,
|
||||
float minDisparityF,
|
||||
float maxDisparityF,
|
||||
bool ssdApproach)
|
||||
{
|
||||
UDEBUG("winSize=(%d,%d)", winSize.width, winSize.height);
|
||||
UDEBUG("maxLevel=%d", maxLevel);
|
||||
UDEBUG("minDisparity=%d", minDisparity);
|
||||
UDEBUG("maxDisparity=%d", maxDisparity);
|
||||
UDEBUG("minDisparity=%f", minDisparityF);
|
||||
UDEBUG("maxDisparity=%f", maxDisparityF);
|
||||
UDEBUG("iterations=%d", iterations);
|
||||
UDEBUG("ssdApproach=%d", ssdApproach?1:0);
|
||||
|
||||
@@ -164,6 +164,8 @@ std::vector<cv::Point2f> calcStereoCorrespondences(
|
||||
int totalIterations = 0;
|
||||
int noSubPixel = 0;
|
||||
int added = 0;
|
||||
int minDisparity = std::floor(minDisparityF);
|
||||
int maxDisparity = std::floor(maxDisparityF);
|
||||
for(unsigned int i=0; i<leftCorners.size(); ++i)
|
||||
{
|
||||
int oi=0;
|
||||
@@ -316,7 +318,8 @@ std::vector<cv::Point2f> calcStereoCorrespondences(
|
||||
cache.insert(std::make_pair(previousXc, previousVc));
|
||||
}
|
||||
|
||||
if(xc < leftCorners[i].x+float(d)-1.0f || xc > leftCorners[i].x+float(d)+1.0f)
|
||||
if(/*xc < leftCorners[i].x+float(d)-1.0f || xc > leftCorners[i].x+float(d)+1.0f ||*/
|
||||
float(leftCorners[i].x - xc) <= minDisparityF)
|
||||
{
|
||||
reject = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user