% run load_lib_ch0.py
Image Processing is the use of algorithms to perform operations on a digital image in order to achieve a particular result such as noise removal or feature extraction. In this notebook, various Digital Image Processing (DIP) techniques will be discussed and demonstrated. The topics covered will be explained as simply as possible and more references will be provided for those who want to learn in more details. Many concepts will be shown using Python. The code can used in each chapter can be seen by clicking on the link in the chapter description, such as the one here.
Play around with the codes to better understand the topics!
Also make sure you check out this awesome book on Computer Vision: Algorithms and Applications by Richard Szeliski!
A digital image is a two dimensional array of pixels represented as a function of the x- and y-axes, $f(x,y)$. The function $f(x,y)$ returns the value of the pixel intensity at coordinates x and y. Notice that the $(0,0)$ coordinates of the image below are in the top-left corner rather than bottom left as in typical Cartesian coordinates.
A pixel is the smallest element of an image. The snippet can be used to show the pixel value at different coordinates. Each pixels is either a signle value or a vector of values depending on the used colour model. A colour image is essentially just multiple grayscale layers, such as the rgb-image function $f(x,y)=[r(x,y),g(x,y),y(x,y)]$
x = 10 y = 12
'The pixel at these coordinates (10, 12) is R: 113 G: 51 B: 38'
A colour model is the mathematical representation of colours as groups of number values.The various modules have different benefits and drawbacks that can be used for specific purposes.
Single channel models are unable to describe colour, and contain a single channel that describes the luminosity:
Most common colour models consist of three channels. Each channel contains different information:
There are some four channel models:
Individually each channel can be represented as a grayscale image, but when combined following their model a colour image can be generated.
RGB is an additive colour model, and as such it is shaped as a cube. The whitest colour is a combination of maximum intensity R,G and B.
HSV is not additive because the colour information is stored within the Hue layer only. Hue depends on the angle relative to the x/y axes, increase in intensity is shown as the distance from the origin point to the colour. Saturation is the distance from the centre pole (z-axis).
The whitest colour is one with maximum value and minimum saturation, independent of hue.