Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void drawEpipolarLines(cv::Mat& image_out, // output image
- cv::Mat& image1, // image 1
- cv::Mat& image2, // image 2
- std::vector<cv::Vec3f> lines1,
- std::vector<cv::Point2f>& points1, // keypoints 1
- std::vector<cv::Point2f>& points2) // keypoints 2)
- {
- // for all epipolar lines
- for (std::vector<cv::Vec3f>::const_iterator it = lines1.begin(); it != lines1.end(); ++it)
- {
- // Draw the line between first and last column
- cv::line(image_out,
- cv::Point(0, -(*it)[2] / (*it)[1]),
- cv::Point(image2.cols, -((*it)[2] +
- (*it)[0] * image2.cols) / (*it)[1]),
- cv::Scalar(randomFrom(0, 255), randomFrom(0, 255), randomFrom(0, 255)));
- }
- for (std::vector<cv::Point2f>::const_iterator it = points1.begin(); it != points1.end(); it++)
- {
- cv::circle(image1, (*it), 5, cv::Scalar(randomFrom(0, 255), randomFrom(0, 255), randomFrom(0, 255)), -1, 8, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement