Skip to content

zacniewski/ComputerVisionLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComputerVisionLab

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.

📋 Table of Contents


✨ Features

  • 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.

🏗 Architecture

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
Loading

🛠 Technology Stack

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)

🚀 Installation

Prerequisites

  • Python 3.8+
  • pip

Steps

  1. Clone the repository:

    git clone https://github.com/your-username/ComputerVisionLab.git
    cd ComputerVisionLab
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run migrations:

    python manage.py migrate
  5. Start the development server:

    python manage.py runServer

    Open http://127.0.0.1:8000 in your browser.


💡 Usage

Local Image Processing

  1. Navigate to a specific algorithm (e.g., Face Detection).
  2. Upload a local image or paste an image URL.
  3. View the processed result with highlighted features.

Real-time Camera Detection

  1. Select "Camera Detection" from the menu.
  2. Grant camera permissions to the browser.
  3. The application will track faces or colors in real-time using your webcam.

🔬 Algorithms Implemented

1. Face Detection

Uses the Viola-Jones framework with Haar Cascades.

detector = cv2.CascadeClassifier(FACE_DETECTOR_PATH)
rects = detector.detectMultiScale(image, scaleFactor=1.1, minNeighbors=5)

2. Canny Edge Detection

A multi-stage algorithm to detect a wide range of edges in images.

edges = cv2.Canny(image, threshold1, threshold2)

3. ORB Keypoints

An efficient alternative to SIFT or SURF for keypoint detection and description.

orb = cv2.ORB_create()
keypoints = orb.detect(gray_image, None)

📸 Screenshots

Note: You can add actual screenshots of the application here to demonstrate the UI and output.

Algorithm Sample Result
Face Detection Face Detection
Canny Edges Canny Edges
Watershed Watershed

👥 Authors

  • Artur - Initial work

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Web-based platform built with Django and OpenCV that provides an interactive interface for various computer vision algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors