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
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Computer Vision Projects with OpenCV 4 and C++

You're reading from   Building Computer Vision Projects with OpenCV 4 and C++ Implement complex computer vision algorithms and explore deep learning and face detection

Arrow left icon
Product type Course
Published in Mar 2019
Publisher
ISBN-13 9781838644673
Length 538 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Roy Shilkrot Roy Shilkrot
Author Profile Icon Roy Shilkrot
Roy Shilkrot
David Millán Escrivá David Millán Escrivá
Author Profile Icon David Millán Escrivá
David Millán Escrivá
Vinícius G. Mendonça Vinícius G. Mendonça
Author Profile Icon Vinícius G. Mendonça
Vinícius G. Mendonça
Prateek Joshi Prateek Joshi
Author Profile Icon Prateek Joshi
Prateek Joshi
Arrow right icon
View More author details
Toc

Table of Contents (28) Chapters Close

Title Page
Copyright and Credits
About Packt
Contributors
Preface
1. Getting Started with OpenCV FREE CHAPTER 2. An Introduction to the Basics of OpenCV 3. Learning Graphical User Interfaces 4. Delving into Histogram and Filters 5. Automated Optical Inspection, Object Segmentation, and Detection 6. Learning Object Classification 7. Detecting Face Parts and Overlaying Masks 8. Video Surveillance, Background Modeling, and Morphological Operations 9. Learning Object Tracking 10. Developing Segmentation Algorithms for Text Recognition 11. Text Recognition with Tesseract 12. Deep Learning with OpenCV 13. Cartoonifier and Skin Color Analysis on the RaspberryPi 14. Explore Structure from Motion with the SfM Module 15. Face Landmark and Pose with the Face Module 16. Number Plate Recognition with Deep Convolutional Networks 17. Face Detection and Recognition with the DNN Module 18. Android Camera Calibration and AR Using the ArUco Module 19. iOS Panoramas with the Stitching Module 20. Finding the Best OpenCV Algorithm for the Job 21. Avoiding Common Pitfalls in OpenCV 1. Other Books You May Enjoy Index

Reading videos and cameras


This section introduces you to video and camera reading using this simple example. Before explaining how to read videos or camera input, we want to introduce a new, very useful class that helps us to manage the input command-line parameters. This new class was introduced in OpenCV version 3.0, and is the CommandLineParser class:

// OpenCV command line parser functions 
// Keys accepted by command line parser 
const char* keys = 
{ 
   "{help h usage ? | | print this message}" 
    "{@video | | Video file, if not defined try to use webcamera}" 
}; 

The first thing that we have to do for CommandLineParser is define what parameters we need or allow in a constant char vector; each line has the following pattern:

"{name_param | default_value | description}"

name_param can be preceded with @, which defines this parameter as a default input. We can use more than one name_param:

CommandLineParser parser(argc, argv, keys);

The constructor will get the inputs of the main function...

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 $19.99/month. Cancel anytime
Banner background image