How it works...

OpenCV supports a lot of different matching types. All of them are implemented using the cv2.DescriptorMatcher interface, so any type of matcher supports the same methods and the same scenarios of use. There are two types of matcher usage: detecting mode and tracking mode. Technically, there is not a big difference between these two modes because in both cases, we need to have two sets of descriptors to match them. The question is whether we upload the first set once and compare it with another one, or each time pass two descriptor sets to the match function. To upload the descriptor set, you need to use the cv2.DescriptorMatcher.add function, which just accepts a list of your descriptors. After you've finished adding the ...

Get OpenCV 3 Computer Vision with Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.