CSCI437 Labs

Project’s GitHub Repo

About

This repo showcases all the coding projects (labs) Mehmet and Jean worked on while enrolled in CSCI437 during the Fall 2020 semester at the Colorado School of Mines, covering the period from August 28, 2020, to December 14, 2020. These labs, which provided a comprehensive platform for learning Python, OpenCV, and basic computer vision concepts.

About The Class

I took Introduction To Computer Vision (CSCI437) during the Fall 2020 semester. During this time, Dr. William Hoff and Dr. Tom Williams taught the class. CSCI437. Here is the official class description for CSCI437:

(I) Computer vision is the process of using computers to acquire images, transform images, and extract symbolic descriptions from images. This course provides an introduction to this field, covering topics in image formation, feature extraction, location estimation, and object recognition. Design ability and hands-on projects will be emphasized, using popular software tools. The course will be of interest both to those who want to learn more about the subject and to those who just want to use computer imaging techniques. Must be Senior level standing. 3 hours lecture; 3 semester hours. Prerequisite: (MATH201 or MATH334 or EENG311),and,MATH332,and,(CSCI200 or CSCI261).

Credits

There are Python scripts and/or segments of code that was provided by the CSCI437 class during lecture, in slides, or though Canvas. The CSCI437 class is provided at the Colorado School of Mines.

These labs were done with the following partners:

  • Jean Duong
  • Mehmet Yilmaz

Lab Descriptions

Lab 1

Lab 1 focuses on the basics of using OpenCV with Python. Participants are expected to write a Python program that reads a video file, projects four points forming a square onto each frame of the video, and simulates the square receding into the distance by incrementally adjusting the Z coordinate of each point. Additionally, the frame number is to be displayed on each frame, and the final video with graphic overlays is to be uploaded for assessment.

Lab 2

Lab 2 deals with image transformations, specifically focusing on rotations around the X, Y, and Z axes using the “XYZ fixed angles” convention. Students are tasked with calculating rotation matrices, computing homogeneous transformation matrices for camera poses, creating a calibration matrix, and projecting points onto an image to form a familiar object using OpenCV’s line function. The lab emphasizes understanding of camera geometry and transformation matrices in computer vision.

Lab 3

Lab 3 is about template matching, where students are tasked with tracking a template sub-image through each frame of a movie file using normalized cross correlation. The assignment involves allowing the user to pick a template from the first image of the movie, tracking this template across subsequent images, drawing rectangles to indicate the template’s location on each image, and creating an output movie file to show these locations. Students are encouraged to experiment with different templates to understand which allows for the best tracking and why, and to discuss the correlation scores observed when matches are correctly identified.

Lab 4

Lab 4 focuses on color segmentation using the HSV color space, a technique discussed in lectures for its effectiveness in handling color images. Students are tasked with applying threshold operations to segment out stop sign pixels from provided images, using a Python/OpenCV program. The assignment requires finding threshold values that best detect stop sign pixels, performing morphological operations to clean up the result, and submitting the segmented images along with the Python program and the used threshold and morphological operation parameters.

Lab 5

Lab 5 involves the task of inserting a new image texture into a specific area of an existing image in a way that the projection looks correct. This process, known as plane replacement, requires students to use projective transform (homography) techniques to map a new image onto a planar area of an existing image. The lab emphasizes the practical application of homography to modify image content while maintaining perspective correctness. Students are expected to submit the original image, the image with the replacement texture, the combined image, and their Python program as part of their lab submission.

Lab 6

Lab 6 instructs students to detect and compute the pose of a target composed of five contrasting concentric circles (CCCs) in an image. The task involves using OpenCV to detect CCC targets, ordering them correctly, computing the pose with OpenCV’s solvePnP() function, and drawing the coordinate axes and pose onto the image. The lab emphasizes the application of concepts like target detection, pose estimation, and visual output formatting in computer vision.

Lab 7

Lab 7 is centered around the detection and matching of SIFT features between images. The objective is to identify correct matches of SIFT features from one image to another and analyze the accuracy of these matches. The lab involves using given Python code and images from a dataset, adjusting algorithm parameters to optimize match detection, and calculating precision and recall metrics to evaluate the performance of the feature matching process. Students are required to submit their Python program and the calculated precision and recall values for different parameter settings.

Lab 8

Lab 8 focuses on object detection using feature matching and affine transformation fitting to detect and overlay objects from a training image onto a query image. The lab involves detecting the object in different scenarios, adjusting the number of inlier matches threshold to reduce false positives, and calculating precision, recall, and accuracy metrics to evaluate the object detection system’s performance. Students are expected to modify and run provided Python code, analyze the system’s performance under different conditions, and submit their findings and modified code.

Lab 9

Lab 9 involves placing annotation points on an object within a training image and automatically showing those points correctly on the object in subsequent query images. This lab emphasizes feature extraction, matching using the ratio test to eliminate ambiguous matches, fitting a 2D affine transformation using RANSAC to eliminate outliers, and applying the transformation to map annotation points from the training to query images. The critical task is to adjust the threshold number of inlier matches to balance between false positives and negatives, aiming for the highest accuracy in classifying images correctly.

Lab 10

Lab 10 is dedicated to using the Hough transform to find line segments and identify sets of parallel lines within an image. It utilizes the probabilistic Hough Transform via OpenCV’s cv2.HoughLinesP() function to detect line segments represented by their endpoints. The lab also involves identifying vanishing points by analyzing the direction vectors of these line segments, aiming to understand the orientation of parallel lines in 3D space as they appear in the 2D image plane. Students are tasked with processing test images to find parallel line segments, experimenting with parameters to optimize detection, and submitting their results along with a Python program.

Notes

  • You will need the following 3rd party python packages to run these scripts/labs: cv2 & numpy.
  • Some of these labs might require you to use a specific version of cv2. Sadly, the requirements were not documented, so you will have to figure this out on your own. If you do figure it out or you are stuck, please report it to the issues form.