|
|
@@ -136,6 +136,9 @@ cv2.imshow('houghLinesImage', houghLinesImage) |
|
|
|
thresh_min = min(dst.shape) |
|
|
|
lines = cv2.HoughLinesP(dst, 1, np.pi / 180, 200, minLineLength=int(dst.shape[0] * 0.45), maxLineGap=int(thresh_min * 0.5)) |
|
|
|
|
|
|
|
# 过滤斜率 |
|
|
|
lines = list(filter(lambda line: True if abs(line[0][0] - line[0][2]) < 280 or abs(line[0][1] - line[0][3]) < 280 else False, lines)) |
|
|
|
|
|
|
|
houghLinesImage = img.copy() |
|
|
|
for line in lines: |
|
|
|
x1,y1,x2,y2 = line[0] |
|
|
|