ComputerVisionLab is a web-based platform built with Django and OpenCV that provides an interactive interface for various computer vision algorithms. It allows users to upload images or provide URLs to process them using techniques like face detection, edge detection, and image segmentation.
- Features
- Architecture
- Technology Stack
- Installation
- Usage
- Algorithms Implemented
- Detailed Algorithm Guide
- Authors
- Face Detection: Uses Haar Cascades to identify and locate faces in images.
- Edge Detection: Implements Canny edge detection with adjustable thresholds.
- Image Segmentation: Utilizes the Watershed algorithm for object separation.
- Keypoint Detection: Employs ORB (Oriented FAST and Rotated BRIEF) for finding interest points.
- Coin Counting: Automatically detects and counts coins in an image using contour analysis.
- Real-time Camera Processing: Browser-based face and color tracking using
tracking.js. - Thresholding: Interactive global and adaptive thresholding.
The project follows the standard Django Model-View-Template (MVT) architecture, integrated with OpenCV for backend image processing and tracking.js for frontend real-time tasks.
graph TD
User((User)) -->|Upload Image/URL| WebBrowser[Web Browser]
WebBrowser -->|HTTP Request| Django[Django Backend]
Django -->|Image Data| OpenCV[OpenCV Engine]
OpenCV -->|Processed Image/Data| Django
Django -->|Rendered Result| WebBrowser
WebBrowser -->|Real-time Tracking| TrackingJS[tracking.js]
TrackingJS -->|Camera Stream| WebBrowser
| Category | Tools/Technologies |
|---|---|
| Backend | Django 4.1, Python 3.x |
| CV Library | OpenCV (cv2) |
| Frontend | HTML5, CSS3, JavaScript, tracking.js |
| Data Science | NumPy, Pillow |
| Database | SQLite (Default) |
- Python 3.8+
- pip
-
Clone the repository:
git clone https://github.com/your-username/ComputerVisionLab.git cd ComputerVisionLab -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Start the development server:
python manage.py runServer
Open
http://127.0.0.1:8000in your browser.
- Navigate to a specific algorithm (e.g., Face Detection).
- Upload a local image or paste an image URL.
- View the processed result with highlighted features.
- Select "Camera Detection" from the menu.
- Grant camera permissions to the browser.
- The application will track faces or colors in real-time using your webcam.
Uses the Viola-Jones framework with Haar Cascades.
detector = cv2.CascadeClassifier(FACE_DETECTOR_PATH)
rects = detector.detectMultiScale(image, scaleFactor=1.1, minNeighbors=5)A multi-stage algorithm to detect a wide range of edges in images.
edges = cv2.Canny(image, threshold1, threshold2)An efficient alternative to SIFT or SURF for keypoint detection and description.
orb = cv2.ORB_create()
keypoints = orb.detect(gray_image, None)Note: You can add actual screenshots of the application here to demonstrate the UI and output.
| Algorithm | Sample Result |
|---|---|
| Face Detection | ![]() |
| Canny Edges | ![]() |
| Watershed | ![]() |
- Artur - Initial work
This project is licensed under the MIT License - see the LICENSE file for details.


