Skip to content

Commit 1193f67

Browse files
committed
Fix
1 parent 7414096 commit 1193f67

File tree

1 file changed

+6
-4
lines changed
  • digital_image_processing/edge_detection

1 file changed

+6
-4
lines changed

Diff for: digital_image_processing/edge_detection/canny.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,18 @@ def suppress_non_maximum(image_row, image_col, gradient_direction, sobel_grad):
4949
if sobel_grad[row, col] >= sw and sobel_grad[row, col] >= ne:
5050
dst[row, col] = sobel_grad[row, col]
5151

52-
elif (3 * PI / 8 <= direction < 5 * PI / 8) or (
53-
11 * PI / 8 <= direction < 13 * PI / 8
52+
elif (
53+
3 * PI / 8 <= direction < 5 * PI / 8
54+
or 11 * PI / 8 <= direction < 13 * PI / 8
5455
):
5556
n = sobel_grad[row - 1, col]
5657
s = sobel_grad[row + 1, col]
5758
if sobel_grad[row, col] >= n and sobel_grad[row, col] >= s:
5859
dst[row, col] = sobel_grad[row, col]
5960

60-
elif (5 * PI / 8 <= direction < 7 * PI / 8) or (
61-
13 * PI / 8 <= direction < 15 * PI / 8
61+
elif (
62+
5 * PI / 8 <= direction < 7 * PI / 8
63+
or 13 * PI / 8 <= direction < 15 * PI / 8
6264
):
6365
nw = sobel_grad[row - 1, col - 1]
6466
se = sobel_grad[row + 1, col + 1]

0 commit comments

Comments
 (0)