Spaces:
Runtime error
Runtime error
Updates
Browse files
app.py
CHANGED
|
@@ -5,24 +5,24 @@ rng = range(1,225)
|
|
| 5 |
|
| 6 |
sobel_verticle = np.array([[-1,0,1],
|
| 7 |
[-1,0,1],
|
| 8 |
-
[-1,0,1]])
|
| 9 |
|
| 10 |
sobel_horizontal = np.array([[-1,-1,11],
|
| 11 |
[ 0, 0, 0],
|
| 12 |
-
[ 1, 1, 1]])
|
| 13 |
|
| 14 |
laplacian = np.array([[ 0,-1, 0],
|
| 15 |
[-1, 5,-1],
|
| 16 |
-
[ 0,-1, 0]])
|
| 17 |
|
| 18 |
average = np.array([[1/9,1/9, 1/9],
|
| 19 |
[1/9,1/9, 1/9],
|
| 20 |
-
[1/9,1/9, 1/9]])
|
| 21 |
|
| 22 |
|
| 23 |
weighted_average = np.array([[1/16,2/16, 1/16],
|
| 24 |
[2/16,4/16, 2/16],
|
| 25 |
-
[1/16,2/16, 1/16]])
|
| 26 |
|
| 27 |
|
| 28 |
def convolve(img, kernel):
|
|
|
|
| 5 |
|
| 6 |
sobel_verticle = np.array([[-1,0,1],
|
| 7 |
[-1,0,1],
|
| 8 |
+
[-1,0,1]])
|
| 9 |
|
| 10 |
sobel_horizontal = np.array([[-1,-1,11],
|
| 11 |
[ 0, 0, 0],
|
| 12 |
+
[ 1, 1, 1]])
|
| 13 |
|
| 14 |
laplacian = np.array([[ 0,-1, 0],
|
| 15 |
[-1, 5,-1],
|
| 16 |
+
[ 0,-1, 0]])
|
| 17 |
|
| 18 |
average = np.array([[1/9,1/9, 1/9],
|
| 19 |
[1/9,1/9, 1/9],
|
| 20 |
+
[1/9,1/9, 1/9]])
|
| 21 |
|
| 22 |
|
| 23 |
weighted_average = np.array([[1/16,2/16, 1/16],
|
| 24 |
[2/16,4/16, 2/16],
|
| 25 |
+
[1/16,2/16, 1/16]])
|
| 26 |
|
| 27 |
|
| 28 |
def convolve(img, kernel):
|