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 3 Application Development

You're reading from  Learning OpenCV 3 Application Development

Product type Book
Published in Dec 2016
Publisher Packt
ISBN-13 9781784391454
Pages 310 pages
Edition 1st Edition
Languages
Author (1):
Samyak Datta Samyak Datta
Profile icon Samyak Datta

Table of Contents (16) Chapters

Learning OpenCV 3 Application Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Laying the Foundation 2. Image Filtering 3. Image Thresholding 4. Image Histograms 5. Image Derivatives and Edge Detection 6. Face Detection Using OpenCV 7. Affine Transformations and Face Alignment 8. Feature Descriptors in OpenCV 9. Machine Learning with OpenCV Command-line Arguments in C++

Putting it all together - the main() function


Over the course of this chapter, we have implemented for different components of our LBP feature extraction system:

  1. Computing the LBP code for each pixel.

  2. Checking whether a given LBP code corresponds to a uniform pattern code.

  3. Computing the spatially enhanced LBP histogram.

The code that we share in this section brings everything together and assembles it under the umbrella of a main() function:

#include <iostream> 
 
#include "opencv2/highgui/highgui.hpp"  
#include "opencv2/core/core.hpp" 
 
using namespace std; 
using namespace cv; 
 
int main(int argc, char** argv) 
{ 

This is to remind users that a command-line argument is expected:

    if(argc != 2) 
    { 
        cout << "USAGE: ./lbp_image [IMAGE]\n"; 
        return 1; 
    } 
    const string imagepath = argv[1]; 
    Mat src = imread(imagepath, CV_LOAD_IMAGE_GRAYSCALE); 
     

The next...

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}