The Canny edge detector uses a multi-stage algorithm to detect edges in images. It was developed by John F. Canny in 1986. Canny also produced a computational theory of edge detection explaining how the technique works.
- Apply Gaussian filter to smooth out the image
- Find intensity gradients from the given image
- Apply non-maximum suppression to remove spurious response to edge detection
- Apply double threshold to determine potential edges
- Track edge by hysteresis: finalize the detection of edges by suppressing all the other edges that are weak and not connected to strong edges (not done)
John Canny's paper on "A Computational Approach to Edge Detection".
This program depends on the following packages:
- Matplotlib
- Skimage
- NumPy
- mpl_toolkits
- argparse
Clone this repository with:
git clone https://github.com/adl1995/edge-detectors.git
Execute the script with:
python canny-edge.py --input <input image path> --output <output image path> --sigma <optional> --th1 <optional> --th2 <optional>
The Marr-Hildreth algorithm finds edges in digital images where there are strong and rapid variations in the image brightness. The Marr–Hildreth edge detection method operates by convolving the image with the Laplacian of the Gaussian function, or, as a fast approximation by Difference of Gaussians (DoG). Then, zero crossings are detected in the filtered result to obtain the edges.
- Apply Gaussian filter to smooth out the image
- Find zero crossings
Hildreth's paper on "Theory of edge detection".
This program requires Python 3.6+ and depends on the following packages:
- Matplotlib
- Skimage
- NumPy
- argparse
- mpl_toolkits
Execute the script with:
python marr-hildreth-edge.py --input <input image path> --output <output image path> --sigma <optional>