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

Commit 1fc225f

Browse files
Readme for canny edge detection ready.
Readme for canny edge detection fully updated and ready for merge.
1 parent b9d9c95 commit 1fc225f

File tree

1 file changed

+41
-14
lines changed
  • Image-Processing/Canny Edge Detection

1 file changed

+41
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
2+
13
# Canny Edge detection using OpenCV and python
24

5+
<div align="center">
6+
<img src="https://miro.medium.com/max/700/0*eZT8V5qNeSiXiXBn.png" height=500 width="1000">
7+
</div>
8+
39
## What is Canny Edge Detection?
410

5-
Canny Edge Detection
6-
It is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images.
7-
It was developed by John F. Canny ,an Australian computer scientist, back in 1986.
11+
> It is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images.
12+
It was developed by John F. Canny ,an Australian computer scientist, back in 1986.
13+
14+
815

916
### _The Canny edge detection algorithm is composed of 5 steps_:
1017
+ Noise reduction;
@@ -15,34 +22,54 @@ It was developed by John F. Canny ,an Australian computer scientist, back in 198
1522

1623
## Lets see how it's done.
1724

18-
1. #### Input image:
25+
<div align="center">
26+
<img src="Images/pic1.JPG" >
27+
</div>
28+
29+
1. ### Input image:
1930
Input in RGB format.
31+
<div align="center">
32+
<img src="Images/input image.JPG" width="400">
33+
</div>
2034

21-
2. #### Converting the image to grayscale:
35+
2. ### Converting the image to grayscale:
2236
For easier calculations.
37+
<div align="center">
38+
<img src="Images/tograyscale.JPG" width="400">
39+
</div>
2340

24-
3. #### Smoothing the image:
41+
42+
3. ### Smoothing the image:
2543
Smoothing of image for noise reduction. Gradient is the first order derivatives of image for each direction.
2644
It is cause of edges that seems more and the edges look thick.
45+
<div align="center">
46+
<img src="Images/res1pic1.JPG" width="400">
47+
</div>
2748
28-
4. #### Image gradient:
29-
Gradient is the function of the partial derivatives. I applied to the image convolution process with Sobel filters to obtain this partial derivative.
49+
4. ### Image gradient:
50+
Gradient is the function of the partial derivatives. I applied to the image convolution process with Sobel filters to obtain this partial derivative.
51+
<div align="center">
52+
<img src="Images/res3sudoku.JPG" width="400">
53+
</div>
3054

31-
5. #### Non-maximum suppression:
55+
5. ### Non-maximum suppression:
3256
In this step the pixel is compared with its two neighbors of the pixel, if the compared pixel is larger than neighbor we do not change the pixel,
3357
otherwise, this pixel is not maximum value hence, we set the zero to that pixel.
3458

35-
6. #### Tracking the edge by hysteresis:
59+
6. ### Tracking the edge by hysteresis:
3660
In this step we choose two type of threshold, high and low threshold value. Afterward, each pixel of image is compared with two different threshold value.
3761
If the pixel is larger than the high threshold, this pixel mark with 255 in the final image.
3862
If the pixel between high threshold and low threshold. If the pixel is smaller than low-threshold image, mark as black with 0 (black) value in the resulting image.
3963

40-
7. #### Final Results:
64+
7. ### Final Results:
4165
After passing all of the mentioned steps, we will give the final result from the method.
4266

4367
# Output Results:
4468

45-
For more detail on learning Canny Edge Detection and maths behind , see my article [here](https://medium.com/simply-dev/what-is-canny-edge-detection-cfefa272a8d0)
46-
69+
<div align="center">
70+
<img src="Images/glimpse all result.JPG" >
71+
</div>
72+
4773

48-
74+
## Endnote:
75+
*For more detail on learning Canny Edge Detection and maths behind, see my article* [here](https://medium.com/simply-dev/what-is-canny-edge-detection-cfefa272a8d0)

0 commit comments

Comments
 (0)