Chapter 2. Manipulating Pixels

In this chapter, we will cover the following recipes:

  • Accessing pixel values
  • Scanning an image with pointers
  • Scanning an image with iterators
  • Writing efficient image-scanning loops
  • Scanning an image with neighbor access
  • Performing simple image arithmetic
  • Remapping an image

Introduction

In order to build computer vision applications, you need to be able to access the image content and eventually modify or create images. This chapter will teach you how to manipulate the picture elements (also known as pixels). You will learn how to scan an image and process each of its pixels. You will also learn how to do this efficiently, since even images of modest dimensions can contain hundreds of thousands of pixels.

Fundamentally, an ...

Get OpenCV 3 Computer Vision Application Programming Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.