Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 50

Digital Image Processing

Lecture slides
By
Abhishek Bansal
Image
• An Image is two-dimensional function that
represents a measure of some characteristic
such as brightness or color of a viewed scene.
• An image is a projection of a 3D scene into a
2D projection plane.
Digital Image
• A digital image is composed of picture
element called pixels.
• Pixels are smallest sample of an image.
• A pixel represents the brightness at one point.
• Conversion of analog image into a digital
image involves two important operations i.e.
sampling and quantisation.
Analog Digital
Sampling Quantisation
Image Image
The sampling rate determines the spatial resolution of the digitized image, while
the quantization level determines the number of grey levels in the digitized image.
Digital Image Process
• Sampling is the process of measuring the
brightness information only at a discrete
spatial location.
• Quantization involves representing the
sampled data by a finite number of levels
based on some criteria such as minimization
of quantisers.
Digital Image Processing
• The processing of an image by means of a
computer is generally termed digital image
processing.

• The advantages-
1. Flexibility and Adaptability
2. Data Storage and Transmission
Elements
Elements of
of Visual
Visual Perception
Perception

Control
Cornea
Sclera
Choroid
Retina
Iris
Lens
Macula lutea
Fovea
Blind spot
Rod
Cone
Human Visual System
• The human visual system consists of an eye that
transforms light into neural signals, and the related
parts of the brain that process the neural signals
and extract necessary information.
• The human eye serves to project and covert light
into neural activity.
• Light enter the cornea, passes through the aqueous
humor, then through the lens into the vitreous
humor and finally onto the photoreceptors located
at the back of retina.
Human visual System
• The ciliary muscles are responsible for
accommodating the lens so as to focus the
light rays onto the fovea, the region of the
retina containing the greatest density of
cones, and thus the high acuity for spatial and
color vision.
Human Eye System
• The human eye is a slightly asymmetrical sphere
with an approximate sagittal diameter or length of
24 to 25mm and a traverse diameter of 24 mm. It
has a volume of 6.5 cc.
• A black looking aperture, the pupil allows the light
to enter the eys.
• The pupil of the eye contracts when exposed to
bright light.
• The pupil can control the amount of light entering
by about a factor of 30.
Human Eye System
• A colored circular muscle, the iris, which is beautifully pigmented,
gives us our eye color.
• This circular muscle controls the size of pupil so that more or less
light, depending on conditions, is allowed to enter the eyes.
• A transparent external surface, the cornea, covers both the pupil and
the iris.
• This is the first and most powerful lens of the optical system of the
eye and allows, together with the crystalline lens the production of a
sharp image at the retinal photoreceptor level.
• The cornea and lens acts together like a camera lens to focus an
image on the retina at the back of the eye, which acts like the film.
• The ‘white of the eye’, the sclera, forms part of the supporting wall of
the eyeball.
Human view System
• The cross-sectional view of the eye shows
three different layers. They are
i) The external layer formed by the sclera and
cornea
ii) The intermediate layer, divided two parts-
anterior(iris and ciliary body) and posterior
choroids
iii) The internal layer or the sensory part of the
eye, the retina.
Structure of the Human Eye
• Pattern vision is afforded by the distribution of discrete light
receptors over the surface of the retina.
• There are two classes of receptors: cones and rods.
– The number of cones in each eye: 6 to 7 millions
– The number of rods in each eye: 75 to 150 millions
– The cones is concentrated in the central portion of the retina (fovea).
– The rods are distributed over the retinal surface.
• Photopic (bright-light) vision: vision with cones
– color receptors, high resolution in the fovea, less sensitive to light
• Scotopic (dim-light) vision: vision with rods
– color blind, much more sensitive to light (night vision), lower
resolution
Image
Image Formation
Formation in
in the
the Eye
Eye

• Focal length of the eye: 17 to 14 mm


• Let h be the height in mm of that object in the retinal image,
then
15/100 = h / 17 , h = 2.55mm
• The retinal image is reflected primarily in the area of the
fovea.
Brightness
Brightness Adaptation
Adaptation and
and Discrimination
Discrimination
Examples
Examples for
for Human
Human Perception
Perception Phenomena
Phenomena
Light
Light and
and the
the Electromagnetic
Electromagnetic Spectrum
Spectrum
Zooming and Shrinking Digital Images

• Zooming: increasing the number of pixels in an


image so that the image appears larger
– Nearest neighbor interpolation
• For example: pixel replication--to repeat rows and
columns of an image
– Bilinear interpolation
• Smoother
– Higher order interpolation

• Image shrinking: subsampling


Zooming
Zooming and
and Shrinking
Shrinking Digital
Digital Images
Images

Nearest neighbor
Interpolation
(Pixel replication)

Bilinear
interpolation
Some
Some Basic
Basic Relationships
Relationships Between
Between Pixels
Pixels

• Neighbors of a pixel
– There are three kinds of neighbors of a pixel:
• N4(p) 4-neighbors: the set of horizontal and vertical neighbors
• ND(p) diagonal neighbors: the set of 4 diagonal neighbors
• N8(p) 8-neighbors: union of 4-neighbors and diagonal neighbors

O O O O O O
O X O X O X O
O O O O O O
Some
Some Basic
Basic Relationships
Relationships Between
Between Pixels
Pixels

• Adjacency:
– Two pixels that are neighbors and have the same grey-
level (or some other specified similarity criterion) are
adjacent
– Pixels can be 4-adjacent, diagonally adjacent, 8-adjacent,
or m-adjacent.
• m-adjacency (mixed adjacency):
– Two pixels p and q of the same value (or specified
similarity) are m-adjacent if either
• (i) q and p are 4-adjacent, or
• (ii) p and q are diagonally adjacent and do not have any common
4-adjacent neighbors.
• They cannot be both (i) and (ii).
Some
Some Basic
Basic Relationships
Relationships Between
Between Pixels
Pixels

• An example of adjacency:
Some
Some Basic
Basic Relationships
Relationships Between
Between Pixels
Pixels

• Path:
– The length of the path
– Closed path
• Connectivity in a subset S of an image
– Two pixels are connected if there is a path between them that lies
completely within S.
• Connected component of S:
– The set of all pixels in S that are connected to a given pixel in S.
• Region of an image
• Boundary, border or contour of a region
• Edge: a path of one or more pixels that separate two regions
of significantly different gray levels.
Some
Some Basic
Basic Relationships
Relationships Between
Between Pixels
Pixels

• Distance measures
– Distance function: a function of two points, p and q, in
space that satisfies three criteria
( a ) D ( p, q )  0
(b) D( p, q )  D(q, p ), and
(c ) D ( p , z )  D ( p , q )  D ( q , z )
– The Euclidean distance De(p, q)
De ( p, q )  ( x  s ) 2  ( y  t ) 2
– The city-block (Manhattan) distance D4(p, q)
D4 ( p, q ) | x  s |  | y  t |
– The chessboard distance D8(p, q)
D8 ( p, q )  max(| x  s |, | y  t |)
clear;
% To open folder contain image
Cd c:\image

% To read an image
I= imread(‘lena.bmp’)

% To show an Image
figure(1);colormap(gray);
subplot(2,2,1);imshow(‘lena.bmp’)
% Code for Quantization Process example
% Threshold level parameter alfa:
alfa=0.1;% less than 1/3

[x,map]=gifread('lena.gif');
ix=ind2gray(x,map);
I_max=max(max(ix));
I_min=min(min(ix));
level1=alfa*(I_max-I_min)+I_min;
level2=2*level1;
level3=3*level1;
thix1=max(ix,level1.*ones(size(ix)));
thix2=max(ix,level2.*ones(size(ix)));
thix3=max(ix,level3.*ones(size(ix)));
figure(1);colormap(gray);
subplot(2,2,1);imagesc(ix);title('lena');
subplot(2,2,2);imagesc(thix1);title('threshold
one alfa');
subplot(2,2,3);imagesc(thix2);title('threshold
two alfa');
subplot(2,2,4);imagesc(thix3);title('threshold
three alfa');

You might also like