I am currently trying to detect horizontal lines in an image using the HoughLinesP function in opencv using the following parameters:
HoughLinesP(linMat[i], lines, 1, CV_PI/180, 80, linMat[i].cols*(0.3), 3);
where linMat[i]is the input image. The result is this:
http://postimg.org/image/49b8wzlgz/
So far so good, I want the lines to be in the horizontal direction, as shown by the yellow line in this image (the line is drawn by hand)
http://postimg.org/image/rh9wlueo7/
I tried changing the parameter CV_PI/180to a lower value (for example, CV_PI/45), and also trying to use different values for other parameters, but a horizontal line could not be generated.
What values should be used in the parameters to create such a yellow line using the HoughLinesP function in opencv?
Thank!
Update
Following the advice (thanks everyone!), I tried even very extreme values, for example
HoughLinesP(linMat[i], lines, 1, CV_PI/360, 80, 1, 1);
however, the lines shown are tilted in an almost vertical direction, since this is: postimg.org/image/y5w6vm7lx/(copy- paste the link ...). I do not use an edge detection filter, for example, canny, since it could not detect thicker lines, the edges were usually discontinued.
Update 2
For clarity only, the resulting strings are generated as follows (after HoughLinesP)
for all lines
{
line( linMat[i], Point(lines[j][0], lines[j][1]), Point(lines[j][2], lines[j][3]), Scalar(0,0,255), 1, 8 );
}