This repository contains Python code for performing edge detection on images using OpenCV, specifically implementing the Canny and Marr-Hildreth (LoG filter) edge detection techniques. It also demonstrates how to enhance the edges in the original image by adding the detected edges back to it.
Before using this code, ensure you have the following prerequisites installed on your system:
- Python 3
- OpenCV (
opencv-python
) - NumPy
- Matplotlib
You can install the required packages using the following command:
pip install opencv-python numpy matplotlib
-
Clone the repository to your local machine:
git clone https://github.com/khush1709/Edge-detection-algo.git
-
Change the current directory to the project folder:
cd Edge-detection-algo
- Place the image you want to process in the project folder and name it img.jpg.
- Run the jupyter notebook to perform edge detection and display the results: The notebook will generate and display the original image, Canny edge detection result, Marr-Hildreth edge detection result, and the enhanced output images for both methods.
The results of the edge detection techniques, along with the enhanced images, will be displayed using Matplotlib. You can see the following images:
- Original Image
- Generated Canny Edge Detection
- Output Image (Canny)
- Generated Marr-Hildreth Edge Detection
- Output Image (Marr-Hildreth)
If you'd like to contribute to this project, feel free to open issues, create pull requests, or suggest improvements. We welcome your contributions!