Goal
In this tutorial you will learn how to:
- Access pixel values
- Initialize a matrix with zeros
- Learn what cv::saturate_cast does and why it is useful
- Get some cool info about pixel transformations
Theory
Image Processing
- A general image processing operator is a function that takes one or more input images and produces an output image.
- Image transforms can be seen as:
- Point operators (pixel transforms)
- Neighborhood (area-based) operators
Pixel Transforms
- In this kind of image processing transform, each output pixel's value depends on only the corresponding input pixel value (plus, potentially, some globally collected information or parameters).
- Examples of such operators include brightness and contrast adjustments as well as color correction and transformations.
Brightness and contrast adjustments
- Two commonly used point processes are multiplication and addition with a constant:
g(x)=αf(x)+β - The parameters
α>0 andβ are often called the gain and bias parameters; sometimes these parameters are said to control contrast and brightness respectively. - You can think of
f(x) as the source image pixels andg(x) as the output image pixels. Then, more conveniently we can write the expression as:g(i,j)=α⋅f(i,j)+β
wherei andj indicates that the pixel is located in the i-th row and j-th column.
