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
OpenCV By Example

You're reading from  OpenCV By Example

Product type Book
Published in Jan 2016
Publisher Packt
ISBN-13 9781785280948
Pages 296 pages
Edition 1st Edition
Languages
Authors (3):
Prateek Joshi Prateek Joshi
Profile icon Prateek Joshi
David Millán Escrivá David Millán Escrivá
Profile icon David Millán Escrivá
Vinícius G. Mendonça Vinícius G. Mendonça
Profile icon Vinícius G. Mendonça
View More author details

Table of Contents (18) Chapters

OpenCV By Example
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with OpenCV 2. An Introduction to the Basics of OpenCV 3. Learning the Graphical User Interface and Basic Filtering 4. Delving into Histograms 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 Index

Basic matrix operations


In this section, we will learn some basic and important matrix operations that we can apply to images or any matrix data.

We learned how to load an image and store it in a Mat variable, but we can manually create a Mat variable. The most common constructor that provides the matrix size and type is as follows:

Mat a= Mat(Size(5,5), CV_32F);

Note

You can create a new Matrix link with a stored buffer from third-party libraries, without copying the data, using the following constructor:

Mat(size, type, pointer_to_buffer)

The supported types depend on the type of the number you want to store and the number of channels. The most common types are as follows:

CV_8UC1
CV_8UC3
CV_8UC4
CV_32FC1
CV_32FC3
CV_32FC4

Note

You can create any type of a matrix using CV_number_typeC(n), where number_type is 8U (8 bits unsigned) to 64F (64 float) and (n) is the number of channels. The number of channels allowed is from 1 to CV_CN_MAX.

This initialization does not set up the data values and you...

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}