Project Name: Mini-Computer-Vision Pipeline with Streamlit
Description: A simple yet powerful image processing pipeline using OpenCV, NumPy, and Streamlit. It supports grayscale conversion, Gaussian blur, Sobel edge detection, Canny edge detection, and histogram visualization.
- Image Upload: Supports
.jpg
,.jpeg
, and.png
formats. - Grayscale Conversion: Converts uploaded images to grayscale.
- Gaussian Blur: Smooths the image using Gaussian blur.
- Edge Detection:
- Sobel Edge Detection
- Canny Edge Detection
- Histogram Visualization: Displays the intensity distribution of grayscale images.
- Interactive UI with Streamlit: Simple and intuitive interface for end-users.
To install the required dependencies, run:
pip install streamlit opencv-python numpy pillow
✅ Make sure you have Python 3.8+ installed.
To run the application:
streamlit run app.py
-
Run the Streamlit App:
streamlit run app.py
-
Upload an Image:
- Click on the
Choose an image...
button. - Select a
.jpg
,.jpeg
, or.png
file.
- Click on the
-
View the Results:
- Grayscale image, blurred image, Sobel edges, and Canny edges will be displayed.
- A histogram of the grayscale image will appear below.
Step | Description |
---|---|
1 | Original Image Loaded |
2 | Grayscale Converted |
3 | Gaussian Blur Applied |
4 | Sobel Edge Detection Output |
5 | Canny Edge Detection Output |
6 | Grayscale Histogram Displayed |
📷 Video of CV Pipeline Streamlit
cv-pipeline.mp4
Technique | Description | Metric |
---|---|---|
Grayscale Conversion | Converts RGB image to grayscale using OpenCV's cvtColor . |
Pixel intensity values (0-255) |
Gaussian Blur | Smooths the image by applying a Gaussian kernel. | Kernel size, sigma value |
Sobel Edge Detection | Detects edges using the Sobel operator. | Gradient magnitude, direction |
Canny Edge Detection | Multi-stage edge detection using hysteresis. | Two thresholds (low, high) |
Histogram | Shows the frequency of pixel intensities in grayscale. | Intensity range (0-255) |
Use Case: Detect edges in a scanned document for OCR processing.
Steps:
- Upload a scanned image of a document.
- Convert to grayscale and apply Gaussian blur to reduce noise.
- Use Canny edge detection to extract the document's edges.
- Process the image for further text recognition or segmentation.
Outcome: Clean, edge-detected document ready for OCR processing.
This project provides a complete image processing pipeline with interactive visualization using Streamlit. It is ideal for developers and researchers who need a simple, customizable image processing tool with support for edge detection, noise reduction, and histogram analysis.
This project is licensed under the MIT License - see the LICENSE file for details.