Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering OpenCV Android Application Programming

You're reading from   Mastering OpenCV Android Application Programming Master the art of implementing computer vision algorithms on Android platforms to build robust and efficient applications

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781783988204
Length 216 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Salil Kapur Salil Kapur
Author Profile Icon Salil Kapur
Salil Kapur
Nisarg Thakkar Nisarg Thakkar
Author Profile Icon Nisarg Thakkar
Nisarg Thakkar
Arrow right icon
View More author details
Toc

Matching features and detecting objects

Once we have detected features in two or more objects, and have their descriptors, we can match the features to check whether the images have any similarities. For example, suppose we want to search for a particular book in a heap of many books. OpenCV provides us with two feature matching algorithms:

  • Brute-force matcher
  • FLANN based matcher

We will see how the two work in the following sections.

For matching, we first need to declare some variables:

DescriptorMatcher descriptorMatcher;
MatOfDMatch matches = new MatOfDMatch();

Brute-force matcher

It takes the descriptor of one feature in the first set and matches it with all other features in the second set, using distance calculations, and the closest one is returned.

The BF matcher takes two optional parameters. The first one is the distance measurement type, normType. We should use NORM_L2 for descriptors such as SIFT and SURF. For descriptors that are based on a binary string, such as ORB and BRISK, we...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering OpenCV Android Application Programming
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime
Modal Close icon
Modal Close icon