how to draw epipolar line
Hello all, I'm getting an error in drawing epipolar line from fundamental matrix. Snap of my code is:
cv::Mat fundamental = cv::findFundamentalMat(
cv::Mat(img_corners), // points in first image
cv::Mat(prevImg_corners), // points in second image
CV_FM_7POINT); // 7-point method
std::vector<cv::Vec3f> lines1;
cv::computeCorrespondEpilines(
img_corners, // image points
1, // in image 1 (can also be 2)
fundamental, // F matrix
lines1); // vector of epipolar lines
// for all epipolar lines
for (vector<cv::Vec3f>::const_iterator it= lines1.begin();
it!= lines1.end(); ++it) {
// draw the line between first and last column
cv::line(img,
cv::Point(0,(*it)[2]/(*it)[1]),
cv::Point(img.cols,((*it)[2] + (*it)[0]*img.cols)/(*it)[1]),
cv::Scalar(255,255,255));
}
cv::imshow("Right Image Epilines (FM_7POINT)", img);
And the error is program execution is stop working after first frame. Please suggest what I'm doing wrong. Thanks
did you see this tutorial
Thanks for your response....but still problem not resolve..can you check my code please...https://drive.google.com/dri... this is my code....i followed the link https://www.packtpub.com/books/conten... help if you can resolve proble...Thanks
your links are broken, I can't open either of them!