A comprehensive collection of Computer Vision laboratory implementations developed in MATLAB, covering fundamental to advanced topics in image processing, feature detection, stereo vision, and motion analysis.
This repository contains practical implementations of core Computer Vision algorithms developed as part of university laboratory coursework. Each lab focuses on specific concepts and techniques, progressing from basic image filtering to complex motion analysis.
- MATLAB R2019b or later
- Image Processing Toolbox
- Computer Vision Toolbox (for some advanced features)
Topics Covered:
- Noise generation and analysis (Gaussian and Salt & Pepper)
- Image filtering techniques
- Moving average filters (3×3, 7×7)
- Low-pass Gaussian filtering
- Image sharpening using frequency domain techniques
- Fourier Transform analysis
Key Functions:
gaussianNoise.m- Adds Gaussian noise to imagessaltPepperDistribution.m- Generates salt & pepper noisemovingAvarage.m- Implements moving average filterlpGaussianFilter.m- Low-pass Gaussian filteringsharperedImg.m- Image sharpening filtertransforedMagnitude.m- FFT magnitude visualization
Main Script: MainLab2.m
Topics Covered:
- Scale-space analysis
- Laplacian of Gaussian (LoG) filters
- Multi-scale blob detection using Lindeberg method (1998)
- Non-maxima suppression in scale-space
Key Functions:
blobs_detection.m- Main blob detection algorithmshow_all_circles.m- Visualization of detected blobs
Implementation Details:
- Scale-normalized LoG filtering
- Automatic radius estimation for detected blobs
- Threshold-based blob selection
Topics Covered:
- Template matching for object tracking
- Harris corner detection
- Feature extraction and analysis
- Real-time object detection in image sequences
Key Functions:
RectDetection.m- Template matching implementationmain.m- Complete pipeline including:- Car tracking in traffic sequences
- Harris corner detector implementation
- Edge, corner, and flat region classification
- Centroid computation using region properties
Features:
- Multi-scale template matching analysis
- Performance timing comparison
- Region classification (corners, edges, flat regions)
- Centroid detection for corner features
Topics Covered:
- 8-point algorithm for fundamental matrix estimation
- Point normalization techniques
- RANSAC for robust estimation
- Epipolar geometry visualization
- Stereo image matching
Key Functions:
EightPointsAlgorithm.m- Basic 8-point algorithmEightPointsAlgorithmN.m- Normalized 8-point algorithmnormalise2dpts.m- Point normalizationransacF.m- RANSAC implementation for F-matrixvisualizeEpipolarLines.m- Epipolar line visualizationfindMatches.m- Feature matching between image pairssimilarity.m- Similarity measurement
Datasets:
- Mire image pairs with ground truth points
- Rubik's cube stereo pairs
Implementation Notes:
- Both Andrea and Fabio folders contain independent implementations
- SVD-based matrix decomposition
- Rank-2 constraint enforcement
- Epipole computation from null spaces
Topics Covered:
- Lucas-Kanade optical flow estimation
- Change detection using running average
- Background modeling
- Motion analysis comparison
Key Functions:
LucasKanade.m- Core optical flow algorithmTwoFramesLK.m- Two-frame optical flow wrapperchange_detection.m- Running average background subtractionMotionAlgoComparison.m- Comparison script for optical flow vs. change detection
Video Sequences:
sphere/- Synthetic rotating spherestatua/- Moving camera around statuevideosurveillance/- Surveillance footagesflowg/- Additional test sequences
Features:
- Spatial and temporal derivative computation
- Neighborhood-based flow estimation
- Binary change detection maps
- Side-by-side algorithm comparison
CVision/
├── Lab2/ # Image processing fundamentals
│ ├── MainLab2.m # Main execution script
│ ├── Immagini/ # Output images
│ └── [filtering functions]
├── Lab4/ # Blob detection
│ ├── blobs_detection.m
│ └── ImmCar/ # Car images dataset
├── Lab5/ # Template matching & corners
│ ├── Andrea/ # Andrea's implementation
│ └── Fabio/ # Fabio's implementation
├── Lab6/ # Epipolar geometry
│ ├── Andrea/ # Andrea's implementation
│ │ ├── Mire/ # Dataset 1
│ │ └── Rubik/ # Dataset 2
│ └── Fabio/ # Fabio's implementation
│ ├── Mire/
│ └── Rubik/
└── Lab7/ # Optical flow & change detection
├── Code/
│ ├── ChangeDetection/
│ ├── MotionComparison/
│ └── OpticalFlow/
└── Video/ # Test video sequences
Lab 2 - Image Filtering:
cd Lab2
MainLab2Lab 4 - Blob Detection:
cd Lab4
blobs_detection('your_image.png', 2, 5) % sigma=2, 5 scalesLab 5 - Template Matching:
cd Lab5/Fabio
mainLab 6 - Fundamental Matrix:
cd Lab6/Fabio
% Load point correspondences
load('Mire/Mire1.points')
load('Mire/Mire2.points')
% Run 8-point algorithm
F = EightPointsAlgorithmN(P1, P2)Lab 7 - Optical Flow:
cd Lab7/Code/OpticalFlow
OpticalFlow % Processes video sequencesMost functions accept parameters for customization:
- Filter sizes: 3×3, 7×7, or custom dimensions
- Noise levels: Adjustable variance for Gaussian noise
- Thresholds: Detection sensitivity in blob and corner detection
- Neighborhood size: Window size for optical flow estimation
This project was developed collaboratively by:
- Andrea Chiappe - Collaborative implementations across all labs
- Fabio Guelfi - Collaborative implementations across all labs
Multiple implementations (Andrea/Fabio folders) demonstrate different approaches to solving the same problems.
This project is part of academic coursework. Please check with the course instructors regarding usage and distribution.
- Lindeberg, T. (1998). Feature detection with automatic scale selection.
- Harris, C., & Stephens, M. (1988). A combined corner and edge detector.
- Lucas, B. D., & Kanade, T. (1981). An iterative image registration technique.
- Hartley, R., & Zisserman, A. (2003). Multiple View Geometry in Computer Vision.
- Each lab includes detailed README files with specific instructions
- Test images and datasets are provided within respective lab folders
- Code includes both
.mscripts and.mlxMATLAB Live Scripts for interactive execution - Some functions generate visualizations automatically - check output folders
Last Updated: October 2025
Repository: CVision - Computer Vision Laboratory Projects