@@ -49,15 +49,6 @@ image_np = np.array(input_image)
49
49
# Using formula:
50
50
# Y' = 0.299 R + 0.587 G + 0.114 B
51
51
image_GrayScale = image_np[:, :, 0 ] * 0.299 + image_np[:, :, 1 ] * 0.587 + image_np[:, :, 2 ] * 0.114
52
- # Checking the type of the array
53
- print (type (image_GrayScale)) # <class 'numpy.ndarray'>
54
- # Checking the shape of the array
55
- print (image_GrayScale.shape) # (270, 480)
56
- # Giving the name to the window with figure
57
- plt.figure(' GrayScale image from RGB' )
58
- # Showing the image by using obtained array
59
- plt.imshow(image_GrayScale, cmap = plt.get_cmap(' gray' ))
60
- plt.show()
61
52
```
62
53
63
54
Setting Hyperparameters and applying Pad frame for input image.
@@ -85,13 +76,10 @@ Declaring filters for **Edge Detection**.
85
76
<br />Consider following part of the code:
86
77
87
78
``` py
88
- # Declaring standard filters (kernel ) with size 3x3 for edge detection
79
+ # Declaring standard filters (kernels ) with size 3x3 for edge detection
89
80
filter_1 = np.array([[1 , 0 , - 1 ], [0 , 0 , 0 ], [- 1 , 0 , 1 ]])
90
81
filter_2 = np.array([[0 , 1 , 0 ], [1 , - 4 , 1 ], [0 , 1 , 0 ]])
91
82
filter_3 = np.array([[- 1 , - 1 , - 1 ], [- 1 , 8 , - 1 ], [- 1 , - 1 , - 1 ]])
92
- # Checking the shape
93
- print (filter_1.shape, filter_2.shape, filter_3.shape)
94
- # ((3, 3) (3, 3) (3, 3)
95
83
```
96
84
97
85
Creating function to delete negative values from resulted image.
0 commit comments