DIP-L2
Image Acquisition and Enhancement
Image Acquisition
• Image Sensing and representation
– Before we discuss image acquisition recall that a
digital image is composed of M rows and N
columns of pixels each storing a value
–Pixel values are most often grey levels in the range
0-255(black-white)
–We will see later on that images can easily be
represented as matrices.
….cont
• Image representation
Image Acquisition
• Images are typically generated by illuminating
a scene and absorbing the energy reflected by
the objects in that scene
– Typical notions of
illumination and
scene can be way off:
• X-rays of a skeleton
• Ultrasound of an
unborn baby
• Electro-microscopic
images of molecules
Image Sensing
• Incoming energy lands on a sensor material
responsive to that type of energy and this
generates a voltage
• Collections of sensors are arranged to capture
images
Imaging Sensor
Line of Image Sensors
Array of Image Sensors
Image Sampling and Quantization
• An image may be continuous in x- and y-
coordinates and also in amplitude.
• A digital sensor can only measure a limited
number of samples at a discrete set of energy
levels.
• Digitizing the coordinate values is called
Sampling.
• Digitizing the amplitude values is called
Quantization.
Image Sampling and Quantization
process.
….cont
….conti
Quantization
…..conti
• Remember that a digital image is always only
an approximation of a real world scene
Image representation methods…
Spatial Resolution
• The spatial resolution of an image is determined by
how sampling was carried out
• Spatial resolution simply refers to the smallest
discernible detail in an image
• Measured in dots per inch or lines per unit distance .
• Vision specialists will
often talk about pixel
size
• Graphic designers will
talk about dots per
inch (DPI)
……cont
……cont
…..conti
Intensity level Resolution
• Intensity level resolution refers to the number
of intensity levels used to represent the image
– The more intensity levels used, the finer the level of detail
discernable in an image
– Intensity level resolution is usually given in terms of the
number of bits used to store each intensity level
Number of bits Number of intesity examples
levels
1 2 0,1
2 4 00,01,10,11
4 16 0000,0101,1111
8 256 00110011,01010101
16 65536 1010101010101010
….cont
256 grey levels (8 bits per pixel) 128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp)
16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
Resolution: how much is enough?
•The big question with resolution is always how
much is enough?
– This all depends on what is in the image and what
you would like to do with it
– Key questions include
• Does the image look content pleasing?
• Can you see what you need to see within the image?
The picture on the right is fine for counting the number of cars, but not for
reading the number plate
Intensity level Resolution
Low Detail Medium Detail High Detail
Assignment
• Write short notes on image interpolation as
used in zooming, rotating and shrinking.
Include formulae and examples of different
techniques.
Image Enhancement
Image enhancement is the process of making
images more useful
The reasons for doing this include:
– Highlighting interesting detail in images
– Removing noise from images
– Making images more visually appealing
Image Enhancement Examples
…..conti
Spatial and Frequency Domains
There are two broad categories of image
enhancement techniques
– Spatial domain techniques
• Direct manipulation of image pixels
– Frequency domain techniques
• Manipulation of Fourier transform or wavelet transform
of an image
Image histograms
The histogram of an image shows us the
distribution of grey levels in the image
Massively useful in image processing, especially
in segmentation
Frequencies
Grey Levels
Image histograms…….(cont)
• Digital image histogram with intensity levels in the
range [0, L-1] is a discrete function h(rk) = nk, where
rk is the kth intensity value and nk is the number of
pixels in the image with intensity rk.
• It is a common practice to normalize a histogram by
dividing each of its components by the total number
of pixels in the image, denoted as a product of rows
and columns dimensions of an image.
• Thus a normalized histogram is given by p(rk)=nk/MN
, for k= 0,1,2,….,L-1.
Histogram examples
A selection of images and
their histograms
Notice the relationships
between the images and
their histograms
Note that the high contrast
image has the most
evenly spaced histogram
Contrast Stretching
• We can fix images that have poor contrast by
applying a pretty simple contrast specification.
• Low contrast images can result from poor
illumination, lack of dynamic range in imaging sensor,
or even the wrong setting of a lens aperture during
image acquisition.
• Contrast stretching is a process that expands the
range of intensity levels in an image so that it spans
the full intensity range of the recording medium or
display device.
Histogram Equalisation
• Spreading out the frequencies in an image (or
equalising the image) is a simple way to improve
dark or washed out images
The formula for histogram Sk= T(rk)
equalisation is given where
– rk: input intensity =(L-1) ∑kj=0pr(rj)
– sk: processed intensity k
=(L-1) ∑ j=0 nj⁄NM
– k: the intensity range
(e.g 0.0 – 1.0) =(L-1) k
⁄NM∑ j=0 nj
– nj: the frequency of intensity j
– n: the sum of all frequencies
Equalisation Transformation
Function
Equalisation examples
…..cont
• Ex: Suppose that a 3-bit image (L=8) of size 64*64
pixels (MN=4096) has the intensity distribution
shown in table below, where the intensity levels are
integers in the range [0, L-1]= [0,7].
rk nk Pr(rk)= nk/MN
0 790 0.19
1 1023 0.25
2 850 0.21
3 656 0.16
4 329 0.08
5 245 0.06
6 122 0.03
7 81 0.02
Advantages of histogram
Equalisation
• The transformation function discussed before has a
tendency of spreading the histogram of the input
image so that the intensity levels of the equalized
image span a wider range of the intesity scale, the
net result being Contrast Enhancement.
• It is also fully automatic since it based on
implementing the transformation formular of which
the input values can be extracted from the image
without the need for further parameter specification.
END
Assignment
• Write a histogram equalization algorithm.
• Write its corresponding program in any
language.
• Perform histogram processing using Matlab.