O'Reilly logo

Learning Image Processing with OpenCV by Gloria Bueno García, Oscar Deniz Suarez, José Luis Espinosa Aranda, Jesus Salido Tercero, Ismael Serrano Gracia, Noelia Vállez Enano

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Establishing Image Processing Tools

This chapter describes the main data structures and basic procedures that will be used in subsequent chapters:

  • Image types
  • Pixel access
  • Basic operations with images
  • Histograms

These are some of the most frequent operations that we will have to perform on images. Most of the functionality covered here is in the core module of the library.

Basic data types

The fundamental data type in OpenCV is Mat, as it is used to store images. Basically, an image is stored as a header plus a memory zone containing the pixel data. Images have a number of channels. Grayscale images have a single channel, while color images typically have three for the red, green, and blue components (although OpenCV stores them in a reverse ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required