I am trying to identify a set of lines in my figure, but I am having trouble trying to figure out what appropriate parameters I should choose for the hough transform.
img = 255 - cv2.imread('isolate.png', 0)
blank = np.zeros(img.shape) + 255
dilation = cv2.dilate(img, np.ones((2,2)), iterations = 1)
processed = cv2.bitwise_not(dilation)
cv2.imwrite('lol.png', processed)
# cv2.imwrite('process.png',dilation)
lines = cv2.HoughLinesP(processed,rho = 1,theta = 1*np.pi/180,threshold = 100,minLineLength = 180,maxLineGap = 1)
for line in lines:
# import pdb; pdb.set_trace()
x1, y1, x2, y2 = line[0]
cv2.line(processed, (x1, y1), (x2, y2), (255, 0, 0), 1)
cv2.imwrite("result.png", processed)
The image that is passed into HoughLinesP looks like this -
The image that I get after drawing is this - 