rebase: feat: use line-mapping logic
This commit is contained in:
parent
ffb10876f5
commit
ebdf3cefbf
@ -178,17 +178,21 @@ def detect_endpoints(
|
|||||||
|
|
||||||
return (dist_a < 15) and (dist_b < 15) and overlap
|
return (dist_a < 15) and (dist_b < 15) and overlap
|
||||||
|
|
||||||
points = cv2.HoughLinesP(
|
|
||||||
image, # Input edge image
|
|
||||||
1, # Distance resolution in pixels
|
|
||||||
np.pi / 180, # Angle resolution in radians
|
|
||||||
threshold=100, # Min number of votes for valid line
|
|
||||||
minLineLength=200, # Min allowed length of line
|
|
||||||
maxLineGap=10, # Max allowed gap between line for joining them
|
|
||||||
)
|
|
||||||
points = points if points is not None else []
|
|
||||||
|
|
||||||
lines = list(map(lambda x: tuple(x[0]), points))
|
lines = list(
|
||||||
|
map(
|
||||||
|
lambda x: tuple(x[0]),
|
||||||
|
cv2.HoughLinesP(
|
||||||
|
image, # Input edge image
|
||||||
|
1, # Distance resolution in pixels
|
||||||
|
np.pi / 180, # Angle resolution in radians
|
||||||
|
threshold=100, # Min number of votes for valid line
|
||||||
|
minLineLength=200, # Min allowed length of line
|
||||||
|
maxLineGap=10, # Max allowed gap between line for joining them
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not lines:
|
if not lines:
|
||||||
return lines
|
return lines
|
||||||
index = int(is_horizontal)
|
index = int(is_horizontal)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user