This repository contains a collection of computer vision projects developed as part of the Foundations of Intelligent Systems Vision course at University of Cordoba. Each project demonstrates a key concept in image processing or computer vision, implemented in C++ using OpenCV. Below are detailed descriptions, usage instructions, and techniques used in each project.
Estimate the intrinsic and extrinsic parameters of a camera using chessboard images and apply image undistortion based on the results.
- Chessboard corner detection
cv::calibrateCamera()for calibrationcv::undistort()for rectifying images
-
Input: Multiple chessboard images (e.g.
calib1.png,calib2.png, ...) -
Output:
calibration.yml: Calibration parameters- Undistorted versions of images
./calibrate calib1.png calib2.png ... calibration.yml
./undistort calibration.yml input.png output.pngCreate stylized versions of images where the grayscale intensity controls the coloring effect.
- RGB to Grayscale conversion
- Channel manipulation
- Color masking based on intensity
./cbg_process input.png output.pngRemove a green screen background and replace it with a custom image.
- Convert to HSV color space
- Create masks for green background
- Composite two images using the mask
- Input: Green screen subject image and a background image
- Output: Composited image with background replaced
./chromakey subject.png background.jpg output.pngImprove image contrast using histogram equalization.
- Convert to grayscale
- Apply
cv::equalizeHist() - Visualize histogram before/after
- Input: Grayscale or color image
- Output: Contrast-enhanced image
./img_equalization input.jpg output_equalized.jpgTrain and evaluate a machine learning model to classify 15 types of pollen grains.
- [0,1] normalized grayscale features
- Mean-stddev normalization
- K-Nearest Neighbors (KNN)
- Support Vector Machines (SVM)
- Random Trees (RTrees)
- Confusion matrix computation
- Recognition rate per class
- Overall accuracy and mean recognition rate
- Images in
data/train/,data/test/,data/valid/ - Labels provided via corresponding
.csvfiles
# train a model
./train_clf data/train knn_model.xml knn 5
# test the model
./test_clf data/test knn_model.xml predictions_test.csvApply sharpening filters to enhance image details and edges.
- Laplacian kernel convolution
- Subtracting Laplacian result from original image
- Apply Gaussian blur
- Subtract blurred version from original
- Add weighted mask back to the original
- Input: Raw image
- Output: Sharpened and USM-enhanced versions
./sharpen input.jpg output_sharp.jpg
./usm_enhance input.jpg output_usm.jpg