Ask Your Question

Revision history [back]

HoughLinesP not detecting all lines

Hi, I am attempting to detect all straight lines in an image using HoughLinesP. I believe I am not detecting all lines because Canny in not returning the lines as straight lines but rather wiggly version of them so HoughLinesP is failing to detect them. Here is my current implementation.

// myMat is 576 x 384
cv::cvtColor(myMat, myMat, CV_BGR2GRAY);
cv::equalizeHist(myMat, myMat);
cv::GaussianBlur(myMat, myMat, cv::Size(3, 3), 10);
float cannyAmount = 30;
cv::Canny(myMat, myMat, cannyAmount, 2 * cannyAmount, 3);
std::vector<cv::Vec4i> lines;
HoughLinesP(inputMat, lines, 1, CV_PI/180, 30, 10, 10 );

If anyone could give me some guidance on how to detect all straight lines in would be highly appreciated.

Thank you