Skip to content

About

A structured, hands-on learning path for mastering Computer Vision with Python and OpenCV, covering image processing, filtering, thresholding, contours, feature detection, object detection, video processing, tracking, deep learning, OCR, segmentation, and AI-powered computer vision applications.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘οΈ Computer Vision Mastery with OpenCV

A comprehensive, hands-on roadmap to mastering Computer Vision using Python and OpenCV β€” from raw pixel manipulation to Deep Neural Networks.

Python OpenCV NumPy Jupyter Contributions Welcome

Curriculum Overview β€’ Module Directory β€’ Roadmap β€’ Quick Start β€’ Real-World Projects


🌟 Highlights of This Learning Path

  • πŸ“š 20 Core Hands-on Modules: Every module contains in-depth theory (readme.md), interactive Jupyter notebooks, sample code, and test datasets.
  • πŸ”¬ From Pixels to Deep Learning: Start with pixel coordinates and color representations, advance through spatial convolution, feature matching, and culminate in deep neural network inference (YOLO, SSD, MobileNet).
  • πŸ§ͺ Interactive Labs: Pre-configured Jupyter Notebooks allowing instant experimentation with image filters, thresholding, edge detectors, and contours.
  • 🎯 Practical Engineering Focus: Learn how to build real-world computer vision systems such as document scanners, motion-detecting surveillance cams, face detectors, and object trackers.

πŸ—ΊοΈ Learning Path Architecture

flowchart TD
    subgraph P1["Phase 1: Foundations & Image Manipulation"]
        M1["Module 01: CV Intro & I/O"] --> M2["Module 02: Image Basics & Pixels"]
        M2 --> M3["Module 03: Transformations & Crop"]
        M3 --> M4["Module 04: Drawing Shapes & Text"]
        M4 --> M5["Module 05: Color Spaces (HSV, LAB)"]
        M5 --> M6["Module 06: Arithmetic & Blending"]
    end

    subgraph P2["Phase 2: Filtering, Edges & Contours"]
        M6 --> M7["Module 07: Spatial Filtering & Blurring"]
        M7 --> M8["Module 08: Thresholding (Adaptive/Otsu)"]
        M8 --> M9["Module 09: Morphological Operations"]
        M9 --> M10["Module 10: Edge Detection (Canny)"]
        M10 --> M11["Module 11: Contours & Shapes"]
    end

    subgraph P3["Phase 3: Geometry, Features & Detection"]
        M11 --> M12["Module 12: Histograms & CLAHE"]
        M12 --> M13["Module 13: Affine & Perspective Warp"]
        M13 --> M14["Module 14: Feature Detectors (ORB/SIFT)"]
        M14 --> M15["Module 15: Image & Template Matching"]
        M15 --> M16["Module 16: Haar Cascades (Face/Eye)"]
    end

    subgraph P4["Phase 4: Video, Tracking & Deep Learning"]
        M16 --> M17["Module 17: Video Streams & Webcams"]
        M17 --> M18["Module 18: Motion Detection (MOG2)"]
        M18 --> M19["Module 19: Object Tracking (CSRT/KCF)"]
        M19 --> M20["Module 20: OpenCV Deep Learning (DNN/YOLO)"]
    end

    subgraph P5["Phase 5: Beyond & Capstone Projects"]
        M20 --> M21["Modules 21-25: OCR, Face Recog, Segmentation & AI"]
    end

    style P1 fill:#1e293b,stroke:#38bdf8,stroke-width:2px,color:#f8fafc
    style P2 fill:#1e293b,stroke:#818cf8,stroke-width:2px,color:#f8fafc
    style P3 fill:#1e293b,stroke:#a855f7,stroke-width:2px,color:#f8fafc
    style P4 fill:#1e293b,stroke:#ec4899,stroke-width:2px,color:#f8fafc
    style P5 fill:#1e293b,stroke:#22c55e,stroke-width:2px,color:#f8fafc
Loading

πŸ“‚ Module Directory & Quick Links

# Module Core Topics Interactive Lab Level
01 Introduction to Computer Vision CV Pipeline, Image I/O (imread, imshow, imwrite), Formats Intro.ipynb Beginner
02 Image Basics Pixels, Resolution, Channels, RGB vs BGR, Grayscale, Alpha Example.ipynb Beginner
03 Image Manipulation Resizing, Cropping, Rotating, Flipping, Translation, Aspect Ratio Example.ipynb Beginner
04 Drawing on Images Geometric Primitives (Lines, Circles, Rectangles), Custom Text Example.ipynb Beginner
05 Color Spaces BGR, RGB, HSV, LAB, YCrCb conversions & Color Masking Example.ipynb Beginner
06 Image Arithmetic Pixel Addition, Subtraction, Bitwise Operations, Alpha Blending Example.ipynb Beginner
07 Image Filtering Box Blur, Gaussian Blur, Median Filtering, Bilateral Filtering Example.ipynb Intermediate
08 Thresholding Binary, Inverse, Adaptive Thresholding, Otsu's Bimodal Method Example.ipynb Intermediate
09 Morphological Operations Erosion, Dilation, Opening, Closing, Morphological Gradient, Top/Black Hat Example.ipynb Intermediate
10 Edge Detection Sobel Operators, Scharr, Laplacian, Multi-Stage Canny Detection Example.ipynb Intermediate
11 Contours Contour Extraction, Hierarchies, Area, Perimeter, Convex Hull, Moments Example.ipynb Intermediate
12 Histograms 1D & 2D Histograms, Histogram Equalization, CLAHE, Comparison Example.ipynb Intermediate
13 Geometric Transformations Affine Warping, 4-Point Perspective Transform, Homography Example.ipynb Intermediate
14 Feature Detection Harris Corners, Shi-Tomasi, FAST, ORB, SIFT, Descriptor Vectors Example.ipynb Advanced
15 Image Matching Template Matching, Brute-Force Matcher (BFMatcher), FLANN Exanple.ipynb Advanced
16 Object Detection Basics Haar Cascades, Integral Images, AdaBoost, Face & Smile Detectors Example.ipynb Advanced
17 Video Processing VideoCapture, VideoWriter, FPS Calculation, Real-time Webcams Theory & Code Advanced
18 Motion Detection Frame Differencing, Background Subtraction (MOG2, KNN), Optical Flow Theory & Code Advanced
19 Object Tracking OpenCV Trackers: CSRT, KCF, MOSSE, MedianFlow Benchmarking Theory & Code Advanced
20 Deep Learning with OpenCV OpenCV DNN Module, Loading Pre-trained YOLO, SSD, MobileNet Theory & Code Advanced

πŸ§ͺ Bonus Practical Experiments


πŸ“š Curriculum Breakdown by Phase

🟒 Phase 1: Foundations & Image Manipulation (Modules 01 - 06)

Module 01: Introduction to Computer Vision

  • Topics: What is CV?, Biological vs Machine Vision, OpenCV Pipeline, cv2.imread, cv2.imshow, cv2.imwrite, Image Formats.
  • Hands-on: Load, inspect, convert, and save multi-format image datasets.

Module 02: Image Basics

  • Topics: Pixels as NumPy ndarrays, coordinate grids $(x, y)$, resolution, BGR vs RGB channel order, grayscale intensity, alpha transparency.
  • Hands-on: Accessing pixel values, modifying sub-regions, inspecting shape, channels, and data types.

Module 03: Image Manipulation

  • Topics: Interpolation methods (INTER_LINEAR, INTER_CUBIC), cropping with slicing, affine rotation matrices, flipping, scaling with preserved aspect ratio.
  • Hands-on: Passport photo trimmer, thumbnail generator, custom image rotator.

Module 04: Drawing on Images

  • Topics: Vector annotations with cv2.line, cv2.rectangle, cv2.circle, cv2.ellipse, cv2.polylines, and typography with cv2.putText.
  • Hands-on: Bounding box visualizer, telemetry HUD overlay, coordinate grid renderer.

Module 05: Color Spaces

  • Topics: BGR, RGB, HSV (Hue-Saturation-Value), LAB, YCrCb, and Grayscale; selecting the optimal color space for segmentation.
  • Hands-on: Real-world color detection, green-screen chroma keying, HSV threshold sliders.

Module 06: Image Arithmetic

  • Topics: Saturated arithmetic vs modulo arithmetic, cv2.add, cv2.subtract, Bitwise operations (AND, OR, XOR, NOT), alpha blending (cv2.addWeighted).
  • Hands-on: Watermarking images, dynamic logo overlay with transparency masks.
πŸ”΅ Phase 2: Filtering, Edges & Contours (Modules 07 - 11)

Module 07: Image Filtering

  • Topics: Convolution matrices, Box Filter, Gaussian Blur, Median Blur (salt-and-pepper noise removal), Bilateral Filter (edge-preserving smoothing), Sharpening kernels.
  • Hands-on: De-noising camera captures, portrait skin smoothing, blur comparisons.

Module 08: Thresholding

  • Topics: Global thresholding, Inverse thresholding, Adaptive Mean & Gaussian Thresholding, Otsu's optimal bimodal thresholding.
  • Hands-on: Document scanning preprocessing, extracting dark text under varying shadow conditions.

Module 09: Morphological Operations

  • Topics: Structuring elements (cv2.getStructuringElement), Erosion, Dilation, Opening (noise removal), Closing (hole filling), Gradient, Top Hat, Black Hat.
  • Hands-on: Fingerprint gap closing, clean text separation, micro-particle counting.

Module 10: Edge Detection

  • Topics: Image gradients, Sobel $X$ and $Y$ operators, Scharr filter, Laplacian of Gaussian, Canny Edge Detection (Gaussian blur, gradient magnitude, Non-Maximum Suppression, Hysteresis).
  • Hands-on: Edge-based pencil sketch effect, object boundary delineation.

Module 11: Contours

  • Topics: Contour finding algorithms, hierarchy tree (RETR_TREE, RETR_EXTERNAL), contour area, perimeter, moments, centroid computation, bounding box, minimum enclosing circle, Convex Hull.
  • Hands-on: Automatic coin counter, geometric shape classifier.
🟣 Phase 3: Geometry, Features & Classic Detection (Modules 12 - 16)
  • Topics: Calculating intensity histograms (cv2.calcHist), CDF curves, Global Histogram Equalization, CLAHE (Contrast Limited Adaptive Histogram Equalization), Histogram comparison metrics.
  • Hands-on: Low-contrast x-ray enhancement, image similarity scoring based on color distribution.
  • Topics: Affine transformations (3-point mapping), Perspective transformations (4-point projective mapping), Homography computation (cv2.findHomography, cv2.warpPerspective).
  • Hands-on: CamScanner-style mobile document deskewing, aerial bird's-eye perspective rectification.
  • Topics: Corner & interest point detection: Harris Corner, Shi-Tomasi (goodFeaturesToTrack), FAST keypoints, ORB (Oriented FAST and Rotated BRIEF), SIFT, SURF, BRISK.
  • Hands-on: Keypoint visualization, scale- and rotation-invariant feature extraction.
  • Topics: Template Matching (cv2.matchTemplate), Normalized Correlation, Multi-scale template matching, Feature Matchers: BFMatcher (Brute-Force), FLANN (Fast Library for Approximate Nearest Neighbors), Lowe's ratio test.
  • Hands-on: Brand logo locator, matching rotated and scaled objects in cluttered scenes.
  • Topics: Viola-Jones object detection framework, Haar-like features, Integral Images, AdaBoost weak-classifier cascading, pre-trained XML classifiers for faces, eyes, and smiles.
  • Hands-on: Real-time multi-face detector, smile detector, attendee counter.
πŸ”΄ Phase 4: Video, Tracking & Deep Learning (Modules 17 - 20)
  • Topics: Video frame streaming (cv2.VideoCapture), capturing webcam feeds, encoding and saving video (cv2.VideoWriter, FourCC codecs), FPS metrics and latency benchmarks.
  • Hands-on: High-speed webcam recorder, interactive video player with pause/forward controls.
  • Topics: Frame Differencing, Background Subtraction models (createBackgroundSubtractorMOG2, createBackgroundSubtractorKNN), shadow detection, dense vs sparse Optical Flow (Lucas-Kanade).
  • Hands-on: Home security motion alarm, burglar detection pipeline with bounding boxes.
  • Topics: Object detection vs continuous tracking, Single-object trackers: CSRT (accurate), KCF (fast), MOSSE (ultra-high FPS), MedianFlow.
  • Hands-on: Continuous sports ball tracker, drone vehicle trajectory follower.
  • Topics: OpenCV DNN module (cv2.dnn.readNet), input blob creation (blobFromImage), pre-trained model inference: YOLOv3/v4/v8, SSD-MobileNet, TensorFlow/Caffe models, Non-Maximum Suppression (NMS).
  • Hands-on: 80-class real-time COCO object detection, pedestrians and vehicle counting.
πŸš€ Phase 5: Future Horizons (Modules 21 - 25)
  • Module 21: Face Recognition: Deep face embeddings, face verification, and automatic attendance systems.
  • Module 22: OCR (Optical Character Recognition): Tesseract OCR integration, text box localization, invoice and ID data extraction.
  • Module 23: Image Segmentation: Watershed algorithm, GrabCut foreground extraction, semantic & instance masks.
  • Module 24: 3D Vision Basics: Stereo vision disparity maps, depth estimation, camera matrix calibration.
  • Module 25: AI-Based Computer Vision: Custom CNN architectures, PyTorch/TensorFlow transfer learning, and Ultralytics YOLO training.

⚑ Quick Start & Setup

1. Clone the Repository

git clone https://github.com/swapnil3104/Computer-Vision-Learning-Path-using-OpenCV.git
cd Computer-Vision-Learning-Path-using-OpenCV

2. Create a Virtual Environment (Recommended)

# Windows
python -m venv venv
venv\Scripts\activate

# Linux / macOS
python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install opencv-python opencv-contrib-python numpy matplotlib pillow imutils jupyter

4. Verify Installation

import cv2
import numpy as np

print(f"OpenCV Version : {cv2.__version__}")
print(f"NumPy Version  : {np.__version__}")

5. Launch Interactive Notebooks

jupyter notebook
Module No. Main Title Status Link
Module 1 Introduction to Computer Vision βœ… Completed πŸ‘‰
Module 2 Image Basics βœ… Completed πŸ‘‰
Module 3 Image Manipulation βœ… Completed πŸ‘‰
Module 4 Drawing on Images βœ… Completed πŸ‘‰
Module 5 Color Spaces βœ… Completed πŸ‘‰
Module 6 Image Arithmetic βœ… Completed πŸ‘‰
Module 7 Image Filtering βœ… Completed πŸ‘‰
Module 8 Thresholding βœ… Completed πŸ‘‰
Module 9 Morphological Operations βœ… Completed πŸ‘‰
Module 10 Edge Detection βœ… Completed πŸ‘‰
Module 11 Contours βœ… Completed πŸ‘‰
Module 12 Histograms βœ… Completed πŸ‘‰
Module 13 Geometric Transformations βœ… Completed πŸ‘‰
Module 14 Feature Detection βœ… Completed πŸ‘‰
Module 15 Image Matching βœ… Completed πŸ‘‰
Module 16 Object Detection Basics βœ… Completed πŸ‘‰
Module 17 Video Processing 🚧 In Progress πŸ‘‰
Module 18 Motion Detection ⏳ Coming Soon πŸ‘‰
Module 19 Object Tracking ⏳ Coming Soon πŸ‘‰
Module 20 Deep Learning with OpenCV ⏳ Coming Soon πŸ‘‰
Module 21 Face Recognition ⏳ Coming Soon πŸ‘‰
Module 22 OCR ⏳ Coming Soon πŸ‘‰
Module 23 Image Segmentation ⏳ Coming Soon πŸ‘‰
Module 24 3D Vision Basics ⏳ Coming Soon πŸ‘‰
Module 25 AI-Based Computer Vision ⏳ Coming Soon πŸ‘‰
Project Project Files ⏳ Coming Soon πŸ‘‰

Status Legend

  • βœ… Completed
  • 🚧 In Progress
  • ⏳ Coming Soon

πŸš€ Real-World Projects Matrix

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                             PROJECT PORTFOLIO                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 🟒 Beginner        β”‚ πŸ”΅ Intermediate    β”‚ 🟣 Advanced & AI               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Photo Filter App β”‚ β€’ Document Scanner β”‚ β€’ Real-Time Face Recognition   β”‚
β”‚ β€’ Color Picker HUD β”‚ β€’ Motion Alarm     β”‚ β€’ Smart Surveillance (MOG2)    β”‚
β”‚ β€’ Watermark Tool   β”‚ β€’ Coin Counter     β”‚ β€’ Multi-Class YOLO Detector    β”‚
β”‚ β€’ Geometric Drawer β”‚ β€’ QR/Barcode Read  β”‚ β€’ Autonomous Lane Detector     β”‚
β”‚ β€’ Aspect Resizer   β”‚ β€’ Sketch Effect    β”‚ β€’ Optical Character Reader     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Recommended Toolbox

Library Badge Primary Purpose
OpenCV opencv-python Real-time computer vision, filtering, geometry, DNN inference
NumPy numpy Ultra-fast multidimensional array operations & mathematical computing
Matplotlib matplotlib Visualizing RGB/Grayscale images, charts, and histograms
Imutils imutils OpenCV convenience shortcuts for rotation, resizing, and webcam fps
Pillow pillow Complementary PIL image file handling and format conversion
Ultralytics ultralytics State-of-the-art YOLO object detection, segmentation, and pose tracking
MediaPipe mediapipe Real-time cross-platform face mesh, hand landmarks, and pose estimation

🎯 Learning Path Outcomes

Upon completing this structured journey, you will possess:

  1. 🧠 Solid Mathematical Intuition: A clear grasp of matrices, spatial convolution, gradient vectors, color representations, and transformation mathematics.
  2. πŸ’» Hands-On OpenCV Mastery: Fluency in over 100+ OpenCV API functions across image processing, contour manipulation, video feeds, and tracking.
  3. πŸ› οΈ Practical Engineering Skills: The ability to build complete vision pipelines from camera frame capture to processed output display.
  4. πŸ€– AI Model Inference Skills: Confidence deploying pre-trained deep learning detectors (YOLO, SSD) into real-time applications.

🀝 Contributing

Contributions, feedback, and issues are always welcome!

  • πŸ› Found a bug or typo? Open an Issue.
  • πŸ’‘ Have a cool sample or experiment to add? Submit a Pull Request.

⭐ If you find this repository helpful, don't forget to give it a star! ⭐

Made with ❀️ for the Computer Vision Community

About

A structured, hands-on learning path for mastering Computer Vision with Python and OpenCV, covering image processing, filtering, thresholding, contours, feature detection, object detection, video processing, tracking, deep learning, OCR, segmentation, and AI-powered computer vision applications.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages