Skip to content

Commit

Permalink
delete tracks outside of image
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelchang committed Oct 10, 2019
1 parent 35a62a3 commit 444a1c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/feature/lk_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ int LKTracker::DoTrack(std::vector<data::Landmark> &landmarks, data::Frame &cur_
}
}
}
Vector2d pixelCur;
pixelCur << results[i].x, results[i].y;
Vector3d tmp;
if (!cur_frame.GetCameraModel().UnprojectToBearing(pixelCur, tmp))
{
continue;
}
if (status[i] == 1 && err[i] <= errThresh_)
{
cv::KeyPoint kpt(results[i], origKpt[i].size);
Expand Down
5 changes: 4 additions & 1 deletion src/module/stereo_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ void StereoModule::Visualization::AddMatch(cv::Point2f pt1, cv::Point2f pt2, dou
cv::circle(curMask_, pt1, 3, cv::Scalar(255, 0, 0), -1);
cv::circle(curMask_, pt2 + cv::Point2f(curMask_.cols / 2., 0), 3, cv::Scalar(255, 0, 0), -1);
cv::line(curMask_, pt1, pt2 + cv::Point2f(curMask_.cols / 2., 0), cv::Scalar(255, 0, 0), 1);
cv::circle(curDepth_, pt1, 2, cv::Scalar((depth / maxDepth_ - err) * 255, (depth / maxDepth_ - err) * 255, depth / maxDepth_ * 255));
double depthColor = 1 - depth / maxDepth_;
depthColor *= 0.9 * depthColor;
depthColor += 0.1;
cv::circle(curDepth_, pt1, 2, cv::Scalar((depthColor - err) * 255, (depthColor - err) * 255, depthColor * 255));
}

void StereoModule::Visualization::Draw(cv::Mat &img, const cv::Mat &stereo_img)
Expand Down

0 comments on commit 444a1c6

Please sign in to comment.