- OpenCV 4 with Python Blueprints
- Dr. Menua Gevorgyan Arsen Mamikonyan Michael Beyeler
- 272字
- 2021-06-24 16:50:08
Understanding feature matching
Once we have extracted features and their descriptors from two (or more) images, we can start asking whether some of these features show up in both (or all) images. For example, if we have descriptors for both our object of interest (self.desc_train) and the current video frame (desc_query), we can try to find regions of the current frame that look like our object of interest.
This is done by the following method, which makes use of FLANN:
good_matches = self.match_features(desc_query)
The process of finding frame-to-frame correspondences can be formulated as the search for the nearest neighbor from one set of descriptors for every element of another set.
The first set of descriptors is usually called the train set, because, in machine learning, these descriptors are used to train a model, such as the model of the object that we want to detect. In our case, the train set corresponds to the descriptor of the template image (our object of interest). Hence, we call our template image the train image (self.img_train).
The second set is usually called the query set because we continually ask whether it contains our train image. In our case, the query set corresponds to the descriptor of each incoming frame. Hence, we call a frame the query image (img_query).
Features can be matched in any number of ways, for example, with the help of a brute-force matcher (cv2.BFMatcher) that looks for each descriptor in the first set and the closest descriptor in the second set by trying each one (an exhaustive search).
In the next section, we'll learn how to match features across images with FLANN.
- Python快樂編程:人工智能深度學習基礎
- Hands-On Image Processing with Python
- Java高手真經(高級編程卷):Java Web高級開發(fā)技術
- Mathematica Data Analysis
- Learning OpenStack Networking(Neutron)
- Vue.js 2 Web Development Projects
- 響應式Web設計:HTML5和CSS3實戰(zhàn)(第2版)
- 智能手機故障檢測與維修從入門到精通
- Java程序設計基礎(第6版)
- 玩轉.NET Micro Framework移植:基于STM32F10x處理器
- Access數(shù)據庫應用教程(2010版)
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐
- Java RESTful Web Service實戰(zhàn)
- Mastering JavaScript Promises
- Scratch超人漫游記:創(chuàng)意程序設計:STEAM創(chuàng)新教育指南