Image Processing
Image Processing
COMPUTER VISION
7. Sub – enabling Outcomes:
3.1.1Apply theoretical capabilities of computer vision on measuring quality
vision
i. Explain measurement of image quality
ii. Explain calorimetric approach
iii. Explain spatial vision approach
iv. Explain fundamental approach for digital photography
3.1.2Apply practical capabilities of computer vision on measuring quality
vision
v. Performance measurement of image vision
vi. Measure calorimetric of image vision
vii. Perform spatial vision approach
viii.Perform fundamental approach for digital photograph
3.1.3 Formulate solutions to problems in computer vision on measuring quality
vision
i. Solve problems in computer vision
ii. Match models to image data
iii.Perform simple implicit models
iv. Perform shading
3.2.1 Interpret image using computer vision and image using pixel units
v. Explain major capabilities requirements of visual systems
vi.Find and identify things in image and 3D interpretation
vii.Use applications for varying levels of complexity in image computer vision
viii.Explain robot vision in image computer
ix.Explain surveillance in image computer image vision.
3.2.2 Apply spatial vision approach to recognize man-made objects size
using computer image using spatial vision approach
i. Explain spatial vision in image processing
ii. Explain system approach in systems approach
iii. Explain internal scales of image quality
3.2.3 Explain the basic concept algorithmic tools of computer vision on
image
iv. Explain basic concepts tools of computer vision on image
v. Explain 3D technology
vi. Explain image sequencing
vii. Describe practical image compositing
3.3.1 Design algorithm of computer vision and image on visual systems
i. Explain mathematical morphology in computer vision and image on visual
system
ii. Apply mathematical morphology in computer vision and image on visual
system
iii. Explain recovering depth in computer image system
iv. Explain multiresolution approach in computer image system
3.3.2 Design algorithm if computer vision and image on 2D and 3D images or
sequences of images
v. Explain a dynamic 3d scene from 2D images
vi. Describe edge detection techniques
vii. Explain grey level segmentation
viii.Perform high performance computing for vision and image processing
3.3.3 Apply tools and algorithms of computer vision in identifying
expected things in images
i. Explain image restoration
ii. Apply software used in analysis manipulation
iii.Explain stereo image technologies
iv. Explain edge detection technique
v. Explain parameters which can be evaluated when measurement are
made in darkness
vi.Explain parameter which can be evaluated when measurement are
made in light
An analog image can be mathematically
represented as a continuous range of values
representing position and intensity.
An analog image is characterized by a physical
magnitude varying continuously in space.
For example, the image produced on the screen of a
CRT monitor is analog in nature
A digital image is the discrete representation of data
possessing both spatial (layout) and intensity (colour)
information.
An analog image can be mathematically
represented as a continuous range of values
representing position and intensity.
An analog image is characterized by a physical
magnitude varying continuously in space.
For example, the image produced on the screen of a
CRT monitor is analog in nature
A digital image is the discrete representation of data
possessing both spatial (layout) and intensity (colour)
information.
A digital image is composed of picture elements called
pixels.
Pixels are the smallest sample of an image.
Conversion of an analog image into a digital image involves two
important operations, namely, sampling and quantisation, which
are illustrated in Fig. 1.1.
4. Law enforcement
Fingerprint analysis,
sharpening or de-blurring of speed-camera images.
Iris recognition
Object recognition:
Robotics has developed tremendously in recent times and the automatic processing of images and recognition of objects is
essential to further progress.
Unmanned vehicles:
Unmanned vehicles are being used extensively by the military (many countries use pilotless drones). Unmanned civilian vehicles
may also soon be a reality if one goes by the progress of Google’s driverless car project.
Remote sensing.
Remote sensing satellites have been launched by many countries.
Remote sensing can be used for a variety of military and civilian applications.
It can be used for detecting and monitoring movement of vehicles and also for calculating areas under cultivation or covered by
forests.
Applications of image processing
Image processing in the field of entertainment and
electronic/ print media
Images are manipulated or entirely fabricated to
create the ‘special effects’ seen in movies.
Involve the creation of artificial images using computer graphics,
sometimes existing images are also ‘processed’ or manipulated to
create the desired effect.
Image formats
A SIMPLE IMAGE FORMATION MODEL
Consider images by two-dimensional functions of the
form f ( x,y ).
The value of f at spatial coordinates (x ,y ) is a scalar
quantity whose physical meaning is determined by the
source of the image, and whose values are proportional
to energy radiated by a physical source (e.g.,
electromagnetic waves).
An example of digital image
As a consequence, f (x,y ) must be nonnegative and
acquisition.
finite; that is,
(a)Illumination (energy) source.
(b)A scene.
(c)Imaging system.
(d) Projection of the scene onto the
image plane.
A SIMPLE IMAGE FORMATION MODEL
Function f x y ( , ) is characterized
by two components:
the amount of source
illumination incident on the
scene being viewed, and
the amount of illumination
reflected by the objects in the
scene.
These are called the illumination
and reflectance components,
and are denoted by i ( x,y ) and r (
x, y ), respectively.
A SIMPLE IMAGE FORMATION MODEL
These are called the illumination
and reflectance components,
and are denoted by i ( x,y ) and r (
x, y ), respectively.
The two functions combine as a
product
to form f ( x, y ): Thus, reflectance is
bounded by 0 (total
absorption) and 1 (total
reflectance).
The nature of i ( x, y ) is
determined by the
illumination source, and r
( x, y) is determined by the
A SIMPLE IMAGE FORMATION MODEL
EXAMPLE : Some typical values of illumination and reflectance.
The following numerical quantities illustrate some typical values of
illumination and reflectance for visible light. On a clear day, the sun may
produce in excess of 90 000 , lm/m2 of illumination on the surface of the
earth. This value decreases to less than 10 000 , lm/m2 on a cloudy day. On
a clear evening, a full moon yields about 0 1 . lm/m 2 of illumination. The
typical illumination level in a commercial office is about 1 000 , lm/m 2.
Similarly, the following are typical values of r (x, y): 0.01 for black velvet,
0.65 for stainless steel, 0.80 for flat-white wall paint, 0.90 for silver-plated
metal, and 0.93 for snow
IMAGE SAMPLING AND QUANTIZATION
BASIC CONCEPTS IN SAMPLING AND
QUANTIZATION
to generate digital
images from sensed data.
The output of most
sensors is a continuous
voltage waveform whose
amplitude and spatial
behavior are related to
the physical phenomenon
being sensed.
To create a digital image,
we need to convert the
continuous sensed data
into a digital format. This
requires two processes:
sampling and
quantization.
IMAGE SAMPLING AND QUANTIZATION
A continuous image f that we
want to convert to digital form.
An image may be continuous
with respect to the x- and y-
coordinates, and also in
amplitude.
To digitize it, sampling the
function is required in both
coordinates and in amplitude.
Digitizing the coordinate values
is called sampling.
Digitizing the amplitude values
is called quantization.
The Hue, Saturation and Value (HSV) colour space popular in
image analysis applications
Three parameters can be interpreted as follows:
H (hue) is the dominant wavelength of the colour, e.g. red, blue,
green.
S (saturation) is the ‘purity’ of colour (in the sense of the amount
of white light mixed with it)
V (value) is the brightness of the colour (also known as
luminance).
Image enhancement. This refers to processing an image so that
the result is more suitable for a particular application.
It occurs as result of taking the photography in hurry.
Insufficient lighting or the scene being lit from wrong direction.
Especially in wildlife photography it desirable to take photography at
night.
Question is it possible to process such image and enhance their
contrast?
Example include:
Sharpening or de-blurring an out of focus image,
Highlighting edges,
Improving image contrast, or brightening an image,
Removing noise.
Image restoration. This may be considered as reversing the
damage done to an image by a known cause,
Photographing an object which is in high speed with respect to
photographer can cause the image to be blurred.
This happens in sporting events and satellite photograph.
Blurring can occur due to atmospheric turbulence or improper
focusing
for example:
Removing of blur caused by linear motion,
Removal of optical distortions,
Removing periodic interference.
Image segmentation. This involves subdividing an image into
constituent parts, or isolating certain aspects of an image.
for example:
finding lines, circles, or particular shapes in an image,
in an aerial photograph, identifying cars, trees, buildings,
or roads.
Image compression.
Most of the image files (.*bmp) occupy a large space on the
hard disc and may take long time to transmit over the
internet.
Can we compress ? Without compromising the information they
convey? Is there any theoretical limits to the amount of
compression we can achieve?
Image recognition and classification
Can computer or robot recognize and classify millions of
image?
Image recognition is used extensively in unmanned vehicles.
Example the development of Google’s self driving car
Digital image
A simple 2-D image and the gray levels of each pixel, shown as a 2-D array.
Digital image
A simple 2-D image and the gray levels of each pixel, shown as a 2-D array.
Types of digital images
Binary. Each pixel is just black or white.
Greyscale.
Each pixel is a shade of grey, normally
from 0 (black) to 255(white).
This range means that each pixel can be A binary
represented by eight bits, or exactly one image
byte
Digital image
True colour, or RGB.
Each pixel has a particular colour; that colour
being described by the amount of red, green
and blue in it.
If each of these components has a range 0 –
255 , this gives a total of 2553 = 16,777,216
different possible colours in the image. This is
enough colours for any image.
Since the total number of bits required for each
pixel is 24 , such images are also called 24 -bit
colour images.
A true color image
Digital image
True colour, or RGB.
Such an image may be considered as consisting of
a “stack” of three matrices; representing the red,
green and blue values for each pixel.
This means that for every pixel there correspond
three values.
clc;
close all;
D=imread('onion.png'); %Read in 8-bit RGB
colour image
Dgray=rgb2gray(D); %Convert it to a grey-
scale image
subplot(2,1,1);
imshow(D);
axis image; %Display both side by side
Converting image
types
Matlab functions: imabsdiff,
rgb2hsv.
clc;
close all;
D=imread('onion.png'); %Read in 8-bit RGB colour
image.
Dred=D(:,:,1); %Extract red channel (first channel)
Dgreen=D(:,:,2); %Extract green channel (second
channel)
Dblue=D(:,:,3); %Extract blue channel (third channel)
subplot(2,2,1); imshow(D); axis image; %Display all in 2
2 plot
subplot(2,2,2); imshow(Dred); title('red'); %Display and
Exercise 1
Using the examples presented for displaying an image in Matlab together with
those for accessing pixel locations, investigate adding and subtracting a scalar
value from an individual location, i.e. I i, j I i, j 25 or I i, j I i, j 25
Start by using the
grey-scale ‘cell.tif’ example image and pixel location (100; 20).What is the
effect on the greyscale colour of adding and subtracting?
Expand your technique to RGB colour images by adding and subtracting to all
three of the colour channels in a suitable example image. Also try just adding to
one of the individual colour channels whilst leaving the others unchanged. What
is the effect on the pixel colour of each of these operations?
Image Enhancement in Spatial
Domain
Image enhancement is the process of editing an image
in order to make it ‘better’ for a human viewer for a
particular application.
This involves smoothing or sharpening image contents.
Spatial domain refers to the two-dimensional image
plane in terms of pixel intensities.
In spatial domain image enhancement methods, the
image is processed by operating on the pixel intensities
directly in the image plane itself.
The other category of image enhancement methods is
transform domain methods.
Transform domain methods operate on the Fourier
Image Enhancement in Spatial
Domain
Spatial domain transformations are of the
form:
g x, y T f x, y
where f(x,y) is the input image, T is transformation to be
applied on the image and g(x,y) is the transformed
image
Point Processing
Each pixel is operated independently.
Only the intensity of the pixel being processed is
considered.
The neighboring pixels are not considered in the
processing, i.e., the neighborhood size is 1x1, which is
smallest possible.
In point processing, every pixel with the same gray level
value in the input image maps to the same value in the
output image.
Point operations require very little memory.
Point processing.
Point Processing
a) Brightness Manipulation
b) Inverse Transformation
c) Contrast Manipulation
d) Log Transformations
e) Power-law Transformations
f) Piecewise-Linear Transformations
Intensity-level slicing
Thresholding
a)Brightness Manipulation
Point processing is very useful in the brightness manipulation of an image.
The brightness is associated with each pixel in an image. To increase or
decrease the brightness of an image, a constant value can be added or
subtracted from each and every pixel of the image.
To increase the brightness of an image f(x,y), the operation is:
g x, y f x, y c
To decrease the brightness of an image f(x,y), the operation is:
g x, y f x, y c
where c is a constant and represents the value to be added or subtracted to
change the brightness of an image.
a)Brightness
ThisManipulation
operation can be performed in MATLAB®, using functions similar to:
a = imread(‘filename’);
b = a + 30; (to increase the brightness by a factor of 30)
b = a – 30; (to decrease the brightness by a factor of 30)
figure,
imshow (b);
a)Inverse
Transformation
This transformation is also known as Image negative.
This transformation reverses the intensity levels of an
image at all pixels.
Dark is converted into bright and bright is converted
into dark.
This transformation is obtained by subtracting the value
at each pixel from the maximum pixel value and is
g x , y
represented as: max . pixel value f x , y
Inverse transformation is useful in those applications
where there is a need to highlight image details
embedded into dark regions of an image, in particular
In MATLAB, an image negative can be obtained
using a function sequence for a maximum
image intensity value of 256:
a = imread(‘filename’);
b = 256-a;
figure,
imshow (b);
Contrast Manipulation
Point processing operations can also be used to
manipulate the contrast information of an image.
In this process, the range of pixel luminance values is
changed.
Contrast manipulation of an image f(x,y) can be
g x, y f x, y c
represented as:
g x, y c log 1 f x, y
where c is the
This transformation increases the range of gray level
values in the output image.
The lower grey level values are spread out.
The input image, having a narrow range of low
intensity values, is converted into an image that has
a wider range of output
levels.
To achieve the opposite effect, an inverse log
Power-law
Power-law transformation is given by:
Transformations
g x, y
Power-law c f x, y
transformations are also known as gamma
transformation, due to exponent γ.
By changing the values of γ, a family of
transformations is obtained.
When the value of γ is less than 1, the image appears
to be dark and when it is greater than 1, the image
appears bright.
If c = γ = 1, the power-law transformation is converted
into an identity transformation.
Many devices, e.g., a monitor used for input and
Power-law
Transformations
The process used in order to reduce the effect of
power-law response
phenomena is called gamma correction.
For example, on some monitors, the image displayed
is darker than the actual input image.
In such cases, there is a need to correct this effect
before displaying the image.
Gamma correction changes the intensity of the
displayed image as well as the ratios of red to green to
blue in a color image.
Gamma correction is very important in the case of the
images used
Piecewise-linear
Piecewise-linear transformations are those non-linear
transformations
transformations which are applied to input image
pixels based on some criteria.
For the same image pixels, the transformation applied
can be different.
There are various piecewise linear image
transformations.
Some are:
Intensity-level slicing
Thresholding
Intensity-level slicing
To highlight a specific range of gray values, intensity level
slicing can be
used.
If in any application there is a need to emphasize on a set
of a particular
range of intensities, instead of the all values, then
intensity-level slicing is very useful.
Although intensity-level slicing can be applied in various
ways, the most frequently used ways are
(i) Highlighting the intensities in a defined range [A,B]
and reducing
all other intensities to a lower level
(ii) Highlighting the intensities in a defined range [A,B]
Thresholding
A thresholding transformation is used to extract a
part of an image based on an intensity value.
In this transformation a threshold value has to be
defined.
The pixels having intensity greater than the
defined threshold value are set to a particular
value and others are left unchanged, or vice-versa.
0 ;if f x,y >threshold value
g x, y
255 ;otherwise
where f(x,y) is the input image and g(x,y) is the
transformed image.
Mask Processing
If neighbors are also considered in processing the
value of the pixel, the processing is called Mask
Processing.
The pixels having intensity greater than the value
of the pixel, the processing is called Mask
Processing
Mask Processing
The pixel, being processed along with the neighbors
considered, defines a mask.
This mask is moved from pixel to pixel over the whole
image in order to generate the processed image.
This mask in spatial domain is also called window,
kernel or template.
In general, the mask is taken of size nxn, where n is an
odd number.
The center pixel of the mask, called the origin,
coincides with the pixel being operated at a particular
instance, while processing.
For a non-symmetric mask, any pixel of the mask can
Mask Processing
The processed value is calculated as follows:
Image subtraction
The difference in two images f(x, y) and g(x, y) can be found by
image subtraction, that can be performed as:
h(x, y) = f(x, y)–g(x, y)
Image Multiplication
Image multiplication is used to extract a region of interest from
an image.
If a user is interested in a specific part of an image, then it can be
isolated by multiplying the region of interest by 1 and the
remaining part by 0.
As a result, only the region of interest will contain image
information and the remaining part will become 0 or black
Logical Operations
Logical operations AND, OR and NOT can be applied on binary images.
AND and OR operations are binary operations, so two images are
required in order to perform these operations, while the NOT operation is
a unary operation and, hence, can be performed on a single image.
These logical operations are similar to set operations.
The AND operation corresponds to Intersection,
The OR operation corresponds to Union and
The NOT operation corresponds to Complement set operation
If A and B are two sets, then logical operations are defined as:
A AND B = set of all elements which are common to set A and set B
A OR B = set of all elements which are either in set A or in set B
NOT A = set of all elements which are not in A
Geometric Operations
There are a number of geometric transformations that can be applied to a digital
image.
These transformations are unary transformations, i.e., these transformations
are applied on a single image.
These transformations are:
Translation
Rotation
Cropping
Translation
Translation of an input image f (x, y) with respect to its Cartesian origin,
producing an output image g(x`, y`), is defined as:
g(x`, y` ) = f(x + ∆x, y + ∆y),
where ∆x and ∆y are displacements in x and y directions, respectively.
Translation is an affine transformation, i.e., it preserves straight lines and planes.
MATLAB uses the imtransform function for translation of an image.
Rotation
Rotation of an image is a spatial transformation in which an image is rotated at a
specified angle. Rotation is also an affine geometric transformation
Cropping
An image can be cropped to a specified angle, i.e., the part of an image can be cut.
In MATLAB, the imcrop tool facilitates cropping of an image to a specified
rectangle interactively.
Translation
Translation is used to improve visualization of an image, but
Applied as a preprocessor in applications where registration of two or more images
is required.
Rotation
Rotation is most commonly used to improve the visual appearance of an image,
Applied as a preprocessor in applications where directional operators are involved.