In this homework assignment, we will focus on putting to practice the code we have seen in lecture for feature detection and matching. This assignment will have two parts. The first part of the assignment will involve us capturing five different images, and the second part will involve us trying to do feature detection between the template and the remaining four images. We would like to stress that we want you to capture these images with your camera, do not take them from the web.
You should read both the "ORB (Oriented FAST and Rotated BRIEF)" and "Feature Matching" tutorials in the OpenCV Documentation on Feature Detection and Matching.
Before we get started, download the assignment files under Files > Homework zip file that contains the files you will be working with.
Once you have extracted the file above, you are ready to get started.
In the zipped file you can see the sample images which are provided for you in the images/source/sample directory. Every time you run the code, it will look inside each folder under images/source/, and attempt to find a folder that has images with filenames that contain '_1' and '_2'. Once it finds a folder that contains two images with those characters in the name, it will apply a feature detection and matching procedure to them, and save the output to images/output/.
As with previous assignments, running assignment5_test.py directly will apply a unit test to your code and print out helpful feedback. It will now also output the image result if your code is working. You can use this to debug your functions.
First, find a subject. A stuffed animal, or small object (things with more texture will work better) that you wish to use. Take a picture of the object, and crop it so it is just the object.
Note: You'll probably take multiple pictures for each of the above categories to find the image that gives you the best results for feature detection, continue reading the entire assignment before you start this part.
Take a look at the images/source/ folder. I have included the above images for testing, each in their own folder. You should replace them with your own images since you will need to output your results for the PDF.
For this assignment you will complete one function. We strongly suggest that you look at the lectures for feature detection and matching in order to tackle the code as the implementation is fairly straightforward to what we have done in lecture.
The code documentation in assignment5.py further elaborates on what you have to do.
We also include some code that is commented out to quickly output your result. You may run this or simply run the code that is available as part of assignment5_test.py which we heavily recommend you use to test your function.
Note: We do not expect your feature detection to work perfectly, it should have some matches that line up correctly (if they all do, awesome!) and some matches that are erroneous.
This is what we want you to do for the PDF.
Then, for each of the four images (sample, lighting, scale, rotation), explain the following: