Book Image

OpenCV Essentials

Book Image

OpenCV Essentials

Overview of this book

Table of Contents (15 chapters)
OpenCV Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Arithmetic and geometrical transforms


An arithmetic transform changes the value of an image pixel and it is applied point to point, whereas a geometrical transform changes the position of the image pixels. Thus, points in an image get a new position in the output image without changing their intensity values. Examples of arithmetic transforms may be addition, subtraction, and division between images. Examples of geometrical transforms are scaling, translation, and rotation of images. More complex transformations are to solve the barrel and cushion deformations of an image produced by an optical lens.

In OpenCV, there are several functions to perform arithmetic and geometrical transforms. Here we show two examples for image addition and perspective transformation by means of the functions addWeighted and warpPerspective respectively.

Arithmetic transform

The function addWeighted performs a linear combination of two images, that is, addition of two weighted images to carry out a linear blending...