Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

You're reading from  Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Product type Book
Published in Feb 2020
Publisher Packt
ISBN-13 9781789531619
Pages 372 pages
Edition 3rd Edition
Languages
Authors (2):
Joseph Howse Joseph Howse
Profile icon Joseph Howse
Joe Minichino Joe Minichino
Profile icon Joe Minichino
View More author details

Table of Contents (13) Chapters

Preface 1. Setting Up OpenCV 2. Handling Files, Cameras, and GUIs 3. Processing Images with OpenCV 4. Depth Estimation and Segmentation 5. Detecting and Recognizing Faces 6. Retrieving Images and Searching Using Image Descriptors 7. Building Custom Object Detectors 8. Tracking Objects 9. Camera Models and Augmented Reality 10. Introduction to Neural Networks with OpenCV 11. Other Book You May Enjoy Appendix A: Bending Color Space with the Curves Filter

Creating a mask from a disparity map

Let's assume that a user's face, or some other object of interest, occupies most of the depth camera's field of view. However, the image also contains some other content that is not of interest. By analyzing the disparity map, we can tell that some pixels within the rectangle are outliers—too near or too far to really be a part of the face or another object of interest. We can make a mask to exclude these outliers. However, we should only apply this test where the data is valid, as indicated by the valid depth mask.

Let's write a function to generate a mask whose values are 0 for the rejected regions of the image and 255 for the accepted regions. This function should take a disparity map, valid depth mask, and optionally a rectangle as arguments. If a rectangle is specified, we will make a mask that is just the size...

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}