This is a Streamlit-based web application that allows users to upload an image and apply edge detection using the Canny algorithm. Users can adjust parameters such as blur radius, threshold value, and edge strength to customize the edge detection process.
- Image Upload: Users can upload images in JPG, JPEG, and PNG formats.
- Custom Edge Detection: Adjust the blur radius, threshold value, and edge strength to fine-tune the edge detection results.
- Real-time Preview: The application displays both the original and edge-detected images side by side.
- Reset Functionality: Users can reset the image upload and parameters to start fresh.
To run this application, you need the following:
- Python 3.6 or higher
- Streamlit
- OpenCV (cv2)
- NumPy
-
Clone the Repository
git clone https://github.com/yourusername/edge-detection-app.git cd edge-detection-app
-
Install Dependencies
Create a virtual environment and install the required packages:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` pip install streamlit opencv-python-headless numpy
-
Run the Application
streamlit run app.py
The application will be available at
http://localhost:8501
in your web browser.
- Upload an Image: Click on the "Upload an image" button and select an image file.
- Adjust Parameters: Use the sliders to adjust the blur radius, threshold value, and edge strength.
- View Results: The application will display the original image alongside the edge-detected version in real-time.
- Reset: Click the "Reset" button to clear the current image and parameters.
Contributions are welcome! Please follow these guidelines:
- Fork the repository.
- Create a new branch for your changes:
git checkout -b feature/new-feature
. - Commit your changes:
git commit -am 'Add new feature'
. - Push to the branch:
git push origin feature/new-feature
. - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.