OpenCV 4 with Python Blueprints
上QQ阅读APP看书,第一时间看更新

Planning the app

The final app will consist of a Python class for detecting, matching, and tracking image features, as well as a script that accesses the webcam and displays each processed frame.

The project will contain the following modules and scripts:

  • feature_matching: This module contains an algorithm for feature extraction, feature matching, and feature tracking. We separate this algorithm from the rest of the application so that it can be used as a standalone module.
  • feature_matching.FeatureMatching: This class implements the entire feature-matching process flow. It accepts a Blue, Green, Red (BGR) camera frame and tries to locate an object of interest in it.
  • chapter3: This is the main script for the chapter.
  • chapter3.main: This is the main function routine for starting the application, accessing the camera, sending each frame for processing to an instance of the FeatureMatching class, and for displaying results.

Let's set up the application before going into the details of the feature-matching algorithm.