I am a newbie in both python and opencv and I am facing a problem in detecting lines in the following image, which has strips of black lines laid on the ground:
I used the following code:
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray,50,150,apertureSize = 3)
print img.shape[1]
print img.shape
minLineLength = img.shape[1]-1
maxLineGap = 10
lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap)
for x1,y1,x2,y2 in lines[0]:
cv2.line(img,(x1,y1),(x2,y2),(0,255,0),2)
but it is unable to detect the lines accurately and only draws a green line on the first black strip from the bottom which does not even cover the entire line,
also,
please suggest a way of obtaining the y cordinates of each line.
