Skip to content

11 OpenCV Tutorials and 13 Computer Vision Applications, ranging from simple tasks like "color detection" to more complex ones like "medical image analysis". It demonstrates the use of various AI tools and libraries to enable computers to view and interpret images, videos, live webcam.

Notifications You must be signed in to change notification settings

Kratugautam99/Computer-Vision-Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Computer Vision Practice

OpenCV Banner


πŸ“– Overview

A comprehensive repository containing 11 foundational OpenCV tutorials and 13 real-world computer vision applications, designed to take you from basic image processing to advanced AI-powered vision systems. This collection demonstrates the full spectrum of computer vision capabilities, enabling machines to perceive, interpret, and interact with visual data.


✨ Features

🧠 Foundational Learning: 11 step-by-step OpenCV tutorials covering core concepts


πŸš€ Real-World Applications: 13 production-ready computer vision projects


πŸ› οΈ Multi-Platform: Local processing, cloud services (AWS), and edge computing


πŸ“Š Diverse Domains: Medical imaging, gesture control, OCR, object tracking, and more


⚑ Performance Optimized: Efficient implementations with various AI frameworks



πŸ—οΈ Repository Structure

πŸ“ Computer-Vision-OpenCV-Mastery/
β”‚
β”œβ”€β”€ # 🎬 OPENCV TUTORIALS (11 Foundation Files)
β”œβ”€β”€ 1)_OpenCV_Image_Inp_Outp.py
β”œβ”€β”€ 2)_OpenCV_Video_Inp_Outp.py
β”œβ”€β”€ 3)_OpenCV_Webcam_Inp_Outp.py
β”œβ”€β”€ 4)_OpenCV_Resize_and_Crop.py
β”œβ”€β”€ 5)_OpenCV_ColorSpaces.py
β”œβ”€β”€ 6)_OpenCV_Blurs.py
β”œβ”€β”€ 7)_OpenCV_Global_Threshold.py
β”œβ”€β”€ 8)_OpenCV_Adaptive_Threshold.py
β”œβ”€β”€ 9)_OpenCV_Edge_Detection.py
β”œβ”€β”€ 10)_OpenCV_Drawing.py
└── 11)_OpenCV_Contours.py
β”‚
β”œβ”€β”€ πŸ“ # πŸš€ APPLICATIONAL PROJECTS (13 Real-World Applications)
β”‚   β”œβ”€β”€ 1)_Color_Detection_of_Objects/
β”‚   β”œβ”€β”€ 2)_Face_Anonymizer_Image_Video_Webcam/
β”‚   β”œβ”€β”€ 3)_Text_Detection_OCR/
β”‚   β”œβ”€β”€ 4)_Image_Classifier_Empty_or_Not_Parking_Lot/
β”‚   β”œβ”€β”€ 5)_Feature_Extraction_with_Inference/
β”‚   β”œβ”€β”€ 6)_Emotion_Recognition_with_Face_Mask/
β”‚   β”œβ”€β”€ 7)_Sign_Language_Detection_for_N_Alphabets/
β”‚   β”œβ”€β”€ 8)_Pneumonia_Classifier_XRayIMGs/
β”‚   β”œβ”€β”€ 9)_YoloV11Nano_Object_Tracking/
β”‚   β”œβ”€β”€ 10)_AWS_Rekognition_FullAccess_IAM/
β”‚   β”œβ”€β”€ 11)_Parking_Spot_Counter/
β”‚   β”œβ”€β”€ 12)_AWS_Lambda_and_API_Gateway/
β”‚   └── 13)_Hand_Gesture_Volume_Control/
|
β”œβ”€β”€ πŸ“ # πŸ–ΌοΈ DEMO IMAGES (Visual Results Gallery)
β”‚   β”‚
β”‚   β”œβ”€β”€ # Representative Image (1 Image)
β”‚   β”‚   └── Logo.png   β†’ Image for This Readme 
β”‚   β”‚
β”‚   β”œβ”€β”€ # OpenCV Tutorial Demos (11 Images)
β”‚   β”‚   β”œβ”€β”€ OpenCV1.png    β†’ Image Input/Output Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV2.png    β†’ Video Processing Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV3.png    β†’ Webcam Capture Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV4.png    β†’ Resize & Crop Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV5.png    β†’ Color Spaces Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV6.png    β†’ Blur Effects Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV7.png    β†’ Global Thresholding Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV8.png    β†’ Adaptive Thresholding Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV9.png    β†’ Edge Detection Demo
β”‚   β”‚   β”œβ”€β”€ OpenCV10.png   β†’ Drawing Functions Demo
β”‚   β”‚   └── OpenCV11.png   β†’ Contour Detection Demo
β”‚   β”‚
β”‚   └── # Applicational Project Demos (20 Images)
β”‚       β”œβ”€β”€ AppProj1.png      β†’ Color Detection Results
β”‚       β”œβ”€β”€ AppProj2.png      β†’ Face Anonymizer Output
β”‚       β”œβ”€β”€ AppProj3.png      β†’ Text Detection & OCR
β”‚       β”œβ”€β”€ AppProj4.png      β†’ Parking Lot Classification
β”‚       β”œβ”€β”€ AppProj5.png      β†’ Feature Extraction
β”‚       β”œβ”€β”€ AppProj6.1.png    β†’ Emotion Recognition - Happy
β”‚       β”œβ”€β”€ AppProj6.2.png    β†’ Emotion Recognition - Sad
β”‚       β”œβ”€β”€ AppProj6.3.png    β†’ Emotion Recognition - Angry
β”‚       β”œβ”€β”€ AppProj7.1.png    β†’ Sign Language - Letter A
β”‚       β”œβ”€β”€ AppProj7.2.png    β†’ Sign Language - Letter B
β”‚       β”œβ”€β”€ AppProj7.3.png    β†’ Sign Language - Letter C
β”‚       β”œβ”€β”€ AppProj8.1.png    β†’ Pneumonia X-Ray - Normal
β”‚       β”œβ”€β”€ AppProj8.2.png    β†’ Pneumonia X-Ray - Positive
β”‚       β”œβ”€β”€ AppProj8.3.png    β†’ Pneumonia X-Ray - Heatmap
β”‚       β”œβ”€β”€ AppProj9.png      β†’ YOLO Object Tracking
β”‚       β”œβ”€β”€ AppProj10.png     β†’ AWS Rekognition Dashboard
β”‚       β”œβ”€β”€ AppProj11.png     β†’ Parking Spot Counter UI
β”‚       β”œβ”€β”€ AppProj12.png     β†’ AWS Lambda API Response
β”‚       β”œβ”€β”€ AppProj13.1.png   β†’ Hand Gesture - Volume Up
β”‚       └── AppProj13.2.png   β†’ Hand Gesture - Volume Down
β”‚
β”œβ”€β”€ πŸ“ # πŸ“₯ INPUTS (8 Sample Input Files)
β”‚   β”œβ”€β”€ dragon.jpg              β†’ Colorful dragon for tutorials
β”‚   β”œβ”€β”€ sample_video.mp4        β†’ Sample video for processing
β”‚   β”œβ”€β”€ cow_salt_pepper.png     β†’ Noisy image for denoising
β”‚   β”œβ”€β”€ bear.jpg                β†’ Image for segmentation
β”‚   β”œβ”€β”€ handwritten_text.png    β†’ Handwritten notes for OCR
β”‚   β”œβ”€β”€ messi.jpg               β†’ Portrait for edge detection
β”‚   β”œβ”€β”€ whiteboard.png          β†’ Whiteboard for drawing demo
β”‚   └── birds.jpg              β†’ Multiple objects for contours
β”‚
β”œβ”€β”€ πŸ“ # πŸ“€ OUTPUTS (13 Generated Output Files)
β”‚   β”œβ”€β”€ dragon_bgr.jpg                    β†’ BGR color space
β”‚   β”œβ”€β”€ dragon_rgb.jpg                    β†’ RGB color space  
β”‚   β”œβ”€β”€ dragon_gray.jpg                   β†’ Grayscale conversion
β”‚   β”œβ”€β”€ dragon_hsv.jpg                    β†’ HSV color space
β”‚   β”œβ”€β”€ cleaned_cow_salt_pepper.png       β†’ Denoised image
β”‚   β”œβ”€β”€ bear_segmented.jpg                β†’ Segmented bear
β”‚   β”œβ”€β”€ handwritten_text_extracted_global.png β†’ Global threshold OCR
β”‚   β”œβ”€β”€ handwritten_text_extracted_adaptive.png β†’ Adaptive threshold OCR
β”‚   β”œβ”€β”€ messi_edge.jpg                    β†’ Canny edge detection
β”‚   β”œβ”€β”€ messi_edge_dilated.jpg            β†’ Dilated edges
β”‚   β”œβ”€β”€ messi_edge_eroded.jpg             β†’ Eroded edges
β”‚   β”œβ”€β”€ drawing_on_whiteboard.png         β†’ Annotations demo
β”‚   └── contoured_birds.jpg              β†’ Detected contours
β”‚
β”œβ”€β”€ .gitignore             β†’ Git ignore configuration
β”œβ”€β”€ environment.yml        β†’ Conda environment specification
β”œβ”€β”€ requirements.txt       β†’ Python package dependencies
└── README.md             β†’ This documentation file

🎯 OpenCV Tutorials (1-11)

1. Image Input/Output

Learn to read, display, and save images in various formats using OpenCV's core functions.

Image I/O Demo

2. Video Input/Output

Process video files frame-by-frame with efficient streaming techniques.

Video Processing Demo

3. Webcam Processing

Real-time webcam capture and processing for interactive applications.

Webcam Demo

4. Image Manipulation

Resizing, cropping, and geometric transformations for image preprocessing.

Image Manipulation Demo

5. Color Space Conversions

BGR, RGB, HSV, Grayscale conversions and their practical applications.

Color Spaces Demo

6. Image Blurring Techniques

Gaussian, Median, and Bilateral filtering for noise reduction and smoothing.

Blur Effects Demo

7. Global Thresholding

Binary and Otsu's thresholding methods for image segmentation.

Global Thresholding Demo

8. Adaptive Thresholding

Local thresholding techniques for uneven lighting conditions.

Adaptive Thresholding Demo

9. Edge Detection

Canny, Sobel, and Laplacian edge detection algorithms.

Edge Detection Demo

10. Drawing Functions

Annotations, shapes, and text overlays on images and videos.

Drawing Functions Demo

11. Contour Detection

Finding and analyzing object boundaries in images.

Contour Detection Demo


πŸš€ Computer Vision Applications (1-13)

1. Color Detection 🎨

Real-time object detection based on color ranges with adjustable HSV sliders.

Color Detection Results

2. Face Anonymizer 🎭

Privacy-preserving face blurring/masking for images, videos, and live streams.

Face Anonymizer Output

3. Text Detection & OCR πŸ“

Multi-engine OCR (Tesseract, EasyOCR) with text localization and extraction.

Text Detection & OCR

4. Parking Lot Classifier πŸ…ΏοΈ

Binary classification for parking space occupancy using custom CNN.

Parking Lot Classification

5. Feature Extraction πŸ”

Deep feature extraction with pre-trained models for image retrieval.

Feature Extraction

6. Emotion Recognition 😷

Facial emotion classification with mask detection using MediaPipe.

Happy Emotion Sad Emotion Surprised Emotion
Happy Emotion Sad Emotion Angry Emotion

7. Sign Language Detection 🀟

Real-time ASL alphabet recognition with custom dataset and CNN.

Letter K Letter R Letter A
Sign Language A Sign Language B Sign Language C

8. Pneumonia Classifier πŸ₯

Medical image analysis for pneumonia detection from chest X-rays.

Site Header Normal X-Ray Positive Case
Normal X-Ray Positive Case Heatmap Analysis

9. YOLOv11 Object Tracking 🎯

Real-time object detection and tracking with Ultralytics YOLO.

YOLO Object Tracking

10. AWS Rekognition Integration ☁️

Cloud-based face analysis and comparison using AWS services.

AWS Rekognition Dashboard

11. Parking Spot Counter πŸš—

Automated counting of available parking spaces with perspective correction.

Parking Spot Counter UI

12. Serverless CV API ⚑

AWS Lambda + API Gateway deployment for scalable computer vision.

AWS Lambda API Response

13. Gesture Volume Control πŸ”Š

Hand gesture recognition for system volume control using MediaPipe.

Volume Up Gesture Volume Down Gesture
Volume Up Volume Down

πŸ› οΈ Technologies Stack

OpenCV Python TensorFlow PyTorch AWS MediaPipe

Complete Stack: OpenCV, TensorFlow, PyTorch, AWS (Lambda, S3, Rekognition, IAM, API Gateway), Tesseract OCR, Easy OCR, Skimage OCR, MediaPipe, Streamlit, Detectron2, Ultralytics YOLO v11, Pillow, NumPy, Pandas, Matplotlib, Seaborn, Scikit-Learn


βš™οΈ Environment Setup

Option 1: Using Conda (Recommended)

# Create environment from YAML file
conda env create -f environment.yml

# Activate the environment
conda activate opencvenv

# Verify installation
python -c "import cv2; print(f'OpenCV Version: {cv2.__version__}')"

Option 2: Using Pip/Virtualenv

# Create virtual environment
python -m venv venv

# Activate (Windows)
venv\Scripts\activate

# Activate (Linux/Mac)
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Option 3: Docker (Advanced)

FROM python:3.9-slim
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . /app
WORKDIR /app
CMD ["python", "1)_OpenCV_Image_Inp_Outp.py"]

πŸš€ Getting Started

Running Tutorials

# Run any tutorial
python "1)_OpenCV_Image_Inp_Outp.py"
python "9)_OpenCV_Edge_Detection.py"

Running Applications

# Navigate to application directory
cd "Applicational_Projects/1)_Color_Detection_of_Objects"

# Run the application
python main.py  # or specific script name

πŸ”§ Customization

Each application is modular and can be easily customized:

# Example: Modify color detection ranges
LOWER_HSV = [20, 50, 50]  # Adjust for different colors
UPPER_HSV = [40, 255, 255]

# Example: Change model paths
MODEL_PATH = "custom_model.pth"
CONFIG_PATH = "custom_config.yaml"

πŸ“Š Expected Outputs

Each tutorial generates corresponding output files in the Outputs/ directory. The Demo_Images/ folder contains screenshots of expected results for all tutorials and applications.


🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ™ Acknowledgments

  • OpenCV Community for the incredible computer vision library
  • AWS for cloud infrastructure and AI services
  • Ultralytics for YOLO implementations
  • Google Research for MediaPipe and TensorFlow
  • All Contributors who have helped improve this repository

πŸ“„ License

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


⭐ Star this repo if you find it helpful!

"The eye sees only what the mind is prepared to comprehend." - Henri Bergson


About

11 OpenCV Tutorials and 13 Computer Vision Applications, ranging from simple tasks like "color detection" to more complex ones like "medical image analysis". It demonstrates the use of various AI tools and libraries to enable computers to view and interpret images, videos, live webcam.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published