Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering OpenCV 4 with Python

You're reading from  Mastering OpenCV 4 with Python

Product type Book
Published in Mar 2019
Publisher Packt
ISBN-13 9781789344912
Pages 532 pages
Edition 1st Edition
Languages
Author (1):
Alberto Fernández Villán Alberto Fernández Villán
Profile icon Alberto Fernández Villán

Table of Contents (20) Chapters

Preface Section 1: Introduction to OpenCV 4 and Python
Setting Up OpenCV Image Basics in OpenCV Handling Files and Images Constructing Basic Shapes in OpenCV Section 2: Image Processing in OpenCV
Image Processing Techniques Constructing and Building Histograms Thresholding Techniques Contour Detection, Filtering, and Drawing Augmented Reality Section 3: Machine Learning and Deep Learning in OpenCV
Machine Learning with OpenCV Face Detection, Tracking, and Recognition Introduction to Deep Learning Section 4: Mobile and Web Computer Vision
Mobile and Web Computer Vision with Python and OpenCV Assessments Other Books You May Enjoy

Chapter 9

  1. Keypoints and compute descriptors in the loaded image, image, with ORB are as follows:
orb = cv2.ORB()
keypoints = orb.detect(image, None)
keypoints, descriptors = orb.compute(image, keypoints)

  1. Previously detected keypoints, keypoints, are as follows:
image_keypoints = cv2.drawKeypoints(image, keypoints, None, color=(255, 0, 255), flags=0)

To draw detected keypoints, the cv2.drawKeypoints() function is used.

  1. The BFMatcher object and matching of the descriptors, descriptors_1 and descriptors_2, which have been previously calculated, is created as follows:
bf_matcher = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
bf_matches = bf_matcher.match(descriptors_1, descriptors_2)
  1. The first 20 matches of the matches that were sorted before is as follows:
bf_matches = sorted(bf_matches, key=lambda x: x.distance)
result = cv2.drawMatches(image_query, keypoints_1, image_scene...
lock icon The rest of the chapter is locked
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 $15.99/month. Cancel anytime}