Skip to content

BraulioV/Computer-Vision

Repository files navigation

Computer Vision

Computer vision exercise with Python and OpenCV.

This repo contains three differents Jupyter Notebooks, divided on different sections and problems of the Computer Vision subject of University of Granada, from applying filters to an image, to the estimation of fundamental matrix equation of the cameras. The code and the images are also available on the repo.


Filtering and subsetting

  • Gaussian filters: one of the exercises consists on create a gaussian filter to create a mask and convolves the images with this masks.
  • Hybrid images: the hybrid images are two differents images mixed on a new image that contain the low frequencies of one of the images, and the high frequencies of the other image, to create the "illusion" that if you look the image closer, you can see the image where we take the high frequencies, and if you look further, the image of the low frequencies appear.
  • Gaussian Pyramid: to make it easier to appreciate the effect of the hybrid images, you can create a gaussian pyramid where it appears the same image at different scales.

Keypoints, descriptors, homographies and panoramas

  • Harris points detection: these is my own implementation of Harris Points detector, that detect and compute this points at three different scales, and show 100 points (of the 1500 points in total) for every scale on an new image. The green points belongs to the original scale, the blue ones are belongs to the mid scale and the red ones to the last scale.
  • KAZE/AKAZE detectors: I use one of this detectors to detect and compute de keypoints of two images, and calculate the matches between two images with a brute force matcher and cross validation, using OpenCV funtions AKAZE_create or KAZE_create, detectAndCompute, BF_Matcher and match.
  • Panorama construction: to create a panorama, I use all of the previous point to find the homography between two images with findHomography. With this I can create a linear panorama using a white canvas to insert the images transformed by the homography.

Camera estimation and epipolar geometry

  • Camera estimation: camera estimation from points correspondences using the DLT algorithm and the Frobenius norm to calculate the error.
  • Camera calibration: camera calibration using chessboard images and the OpenCV functions findChessboardCorners, drawChessboardCorners to visualize the pattern and calibrateCamera to calibrate the camera. To correct the lens distortion I use getOptimalNewCameraMatrix and undistort.
  • Fundamental matrix estimation: equation estimation using BRISK/ORB detector to get points corresponences and 8-point algorithm with RANSAC. Also we can see the epilines on the images.
  • Essential matrix estimation, translation and rotation between two images: essential matrix estimation using points correspondences, and the 4 possible solutions to [R|T] matrix problem.

Requirements

  • Python 3.
  • NumPy.
  • OpenCV.