Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 73bad93

Browse files
authored
Update sobel-edge-detect.py
1 parent bbb3842 commit 73bad93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Image-Processing/Sobel-edge-detection/sobel-edge-detect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def convolute(img, kernel, height, width):
4747

4848
def sobel(img):
4949
height = img.shape[0]
50-
width= img.shape[1]
50+
width = img.shape[1]
5151

5252
#The image is blurred, so the noise is removed
5353
blur = convolute(img, kernelblur, height, width)
@@ -62,8 +62,8 @@ def sobel(img):
6262
#Every pixel in convoluted_X can be called gx, in convoluted_Y can be called gy,
6363
#The resultant will be sqrt(pow(gx**2) + pow(gy**2))
6464
resultant = []
65-
for i in range(height-1):
66-
for j in range(width-1):
65+
for i in range(height - 1):
66+
for j in range(width - 1):
6767
in_x = pow(convoluted_X[i, j], 2)
6868
in_y = pow(convoluted_Y[i, j], 2)
6969
gradient = sqrt(in_x + in_y)

0 commit comments

Comments
 (0)