Using functions in the OpenCV library, this program extracts key points from four input images to find out which of them the webcam is filming.
Image key points are specific points of an image that can be identified easily, even if an object’s shape, size, position or lighting of the place or camera’s point of view changes. Usually, corner points of an object satisfy these characteristics and are used as key points.
Key points
OpenCV provides various algorithms that can detect key points from an image. In this program, I used ORB(Oriented and Rotated BRIEF) algorithm.
Descriptor matcher is the kind of algorithm that compares two sets of key points (or descriptors) and match similar key points. I used BFMatcher which uses the Brute-force method.
Following is the main algorithm of this program:
- Using [ORB algorithm], extract key points of the four input images beforehand.
- Extract key points of each frame of the webcam.
- Compare the frame image’s key points with four images’ key points using [BFMatcher] and select the image that has the most matching points.
- Display the selected image on the right side of the webcam image.
- Draw a line between each pair of webcam frame image key points and the selected image key points with each colored differently.
- Repeat the process of (2) ~ (5) using the while loop.
Following is the demonstration video.
By making this program, I could practice many concepts that I learned from the computer vision study camp. I could especially get used to the different functions and algorithms of the Opencv library which was essential for my future development and projects.