Ec2029 - Digital Image Processing
Ec2029 - Digital Image Processing
Ec2029 - Digital Image Processing
COURSE MATERIAL
--------------------------------------------------------------------
-----
SCRIPTED AND COMPILED BY
Mrs.S.Chandravadhana
ASSISTANT PROFESSOR
DEPARTMENT OF ECE
1 SUBJECT SYLLABUS 3
2 LECTURE NOTES 4
3 QUESTIONS BANK 123
4 ASSIGNMENT QUESTIONS 143
DIGITAL IMAGE PROCESSING E C 2029 L T P C3 0 0 3
TOTAL= 45 PERIODS
TEXTBOOKS:
1. Rafael C. Gonzalez, Richard E. Woods, , Digital Image Processing', Pearson ,
Second Edition, 2004.
2. Anil K. Jain, , Fundamentals of Digital Image Processing', Pearson 2002.
EC2029 DIGITAL IMAGE PROCESSING
Elements of digital image processing systems, Vidicon and Digital Camera working principles, Elements of visual perception,
brightness, contrast, hue, saturation, mach band effect, Color image fundamentals - RGB, HSI models, Image sampling, Quantization,
dither, Two-dimensional mathematical preliminaries, 2D transforms -DFT,DCT, KLT, SVD.
A digital image is an image f(x,y) that has been discretized both in spatial coordinates and brightness. A digital image is
composed of picture elements, of ones and zeros.
Density expresses details of darkness as well as Converting an image into digital format can be
transmittance values. These values can be done with a digital camera, a scanner, or by
measured and examined with a help of a converting a moving image on a video tape into
densitometer. digital format.
With the help of density values, the color Digital image files can be processed in many
reproduction ability of the surface and press ways on a computer screen.
process can be measured.
the color (or gray level for black and white photos) at a single point in the image, so a pixel is like a tiny dot of a particular color.
By measuring the color of an image at a large number of points, we can create a digital approximation of the image from which a copy
of the original can be reconstructed. Pixels are a little like grain particles in a conventional photographic image, but arranged in a
regular pattern of rows and columns and store information somewhat differently. A digital image is a
Each pixel is just black or white. Since there are only two possible values for each pixel, we only need one bit per pixel. Such images
can therefore be very efficient in terms of storage. Images for which a binary representation may be suitable include text (printed or
handwriting), fingerprints, or architectural plans.
Grayscale is a range of shades of gray without apparent color. The darkest possible shade is black, which is the total absence of
transmitted or reflected light. The lightest possible shade is white, the total transmission or reflection of light at all visible wavelength
s.
Intermediate shades of gray are represented by equal brightness levels of the three primary colors (red, green and blue). the brightness
levels of the red (R), green (G) and blue (B) components are each represented as a number from decimal 0 to 255, or binary 00000000
to 11111111.
Color Images
A color image is made up of pixels each of which holds three numbers corresponding to the red, green, and blue levels of the image at
a particular location. Red, green, and blue (sometimes referred to as RGB) are the primary colors for mixing light—these so-called
additive primary colors are different from the subtractive primary colors used for mixing paints (cyan, magenta, and yellow). The
specific color that a pixel describes is some blend of three components of the color spectrum - RGB.
Some color images are created using a limited palette of colors, typically 256 different colors. These images are referred to as indexed
color images because the data for each pixel consists of a palette index indicating which of the colors in the palette applies to that
pixel.
1.1.3 Resolution
The more points at which we sample the image by measuring its color, the more detail we can capture. The density of pixels in an
image is referred to as its resolution. The higher the resolution, the more information the image contains.
For example, a 15-inch VGA (see display modes) monitor has a resolution of 640 pixels along a 12-inch horizontal line or about 53
pixels per inch. A smaller VGA display would have more pixels per inch.
1.1.4 What Is Digital Image Processing?
The field of digital image processing refers to processing digital images by means of a digital computer. Digital image processing
encompasses processes whose inputs and outputs are images
and in addition, encompasses processes that extract attributes from images, up to and including the recognition of individual objects.
Fig. 1 EM Spectrum
Gamma rays imaging: used in nuclear medicine and astronomical applications. Examples are bone scan, positron
emission tomography (PET) image etc.
X-ray Imaging: used in medical diagnostics and in industries. Examples are Chest X-ray, head CT, X-ray image of an
electronic circuit board –to examine circuit boards etc.
Images in the Ultraviolet band; includes lithography, industrial inspection, microscopy, lasers, biological imaging.
Examples are florescence microscopic image of normal corn, a corn affected by smut (a disease) etc.
Images in the visible and infrared bands: uses microscope to obtain images. Examples are microscopic images, remote
sensing, whether observation and prediction (satellite images), infrared satellite images, imaging in the visual
spectrum such as identification of missing items and missing pills etc, thumb print etc.
Imaging in the microwave band: Used in radar. An imaging radar works like a fash camera in that it provides its own
illumination (microwave pulses) to illuminates an area on the ground and take a snapshot image. Examples are image
covering rugged mountainous area.
Imaging in the radio band: used in medicine and astronomy. This technique places a patient in a powerful magnet and
passes radiowaves through the body in short pulses. Examples are MRI images of human knee and spine.
Electron microscopy- uses focused beam of electron instead of light. A transmission electron microscope
(TEM) passes psses electrons through a specimen. A scanning electron microscope (SEM) scans the electron beam
and records.
Synthetic (computer generated) imaging – Fractals are striking examples of computer generated images.
Operational details
There is an electron gun, placed in a cylindrical pipe, which creates a small electron beam. To focus and deviate an electron beam in a
vidicon, electrostatic or magnet fields are used. One of the most significant parts of vidicon is a photoconductor target, containing a
transparent metallic film with a photoconductive layer from the side of an electron-optical system. Under the effect of light a vidicon
target accumulates electric charges, changing resistance of separate parts of the target and irregularly dispatching current potential in
the same manner as of dispatching brightness of separate parts of the picture. An electron beam, formed and deviated with magnet and
electrostatic fields, picks up these charges.
There are a lot of various constructions of vidicon targets: some targets have two or three layers, some have a mosaic
structure or smooth and spongeous layers. photoconductive and photodiode are also the popular targets. photoconductive targets,
discharging depends on characteristics of a photoconductive layer and photoeffect. Depending on a target, vidicons are divided into
silicon vidicons, plumbicons, chalnicons, saticons and so on.
Light is the predominant energy source for images; simply because it is the energy source which human beings can observe directly.
We are all familiar with photographs, which are a pictorial record of a visual scene. Many digital images are captured using visible
light as the energy source; this has the advantage of being safe, cheap, easily detected and readily processed with suitable hardware.
Two very popular methods of producing a digital image are with a digital camera or a flat-bed scanner.
Working principle of a digital camera
Digital camera uses an array of optical sensors that converts light intensity into electrical signals. Examples of sensors are CCD or
CMOS sensors. Digital camera has built in digital image processing chip to covert the raw data from the image sensor into a color‐
corrected image in a standard image file format.
Common types of CMOS camera are CCD camera, EMCCD (Electron multiplying CCD) camera and ICCD (Image intensified CCD)
camera.
CCD are fundamentally silicon based arrays of MOS diodes which has ability to store and transfer information through several charge
packets.
A silicon diode photo‐sensor (A) that receives photons of various intensity. If the incident photons have sufficient energy to agitate
an electron motion away from the silicon layer, which generates a charge.
(A) A silicon diode photo‐sensor (a Pixel) that receives photons of various intensity. (B) The charge moves to a down‐stream
charge storage region, generating an analogous signal.
(C)The quantity of the accumulated charge, the sum of 0 or 1 (depending on the incident light intensity), is then amplified and
transmitted through a clock signal.
• An image is projected by a lense on the diode photo-sensor, causing each pixel to accumulate an electric charge proportional to the
light intensity at that location.
• Once the array has been exposed to the image, a control circuit causes each pixel to transfer its charges to its neighbor. The last
capacitor in the storage section sends its charge into a charge amplifier, which converts the charge into a voltage.
• By repeating this process y p g p (scanning across the photo-sensor), the control signal converts the charge information of the entire
pixel array (in (A)) to a sequence of voltages (output from (C)), which it samples, digitizes and stores in some memory format.
• The algorithms for voltage conversion results in digital images/videos of different formats. These stored images can then be
transferred to a printer, digital storage device or video display.
1.4 Elements of visual perception
When the eye is properly focused, light from an object outside the eye is imaged on the retina. Patten vision is afforded by the
distribution of discrete light receptors over the surface of the retina. When light enters the eye, it first passes through the cornea, then
the aqueous humor, lens and vitreous humor. Ultimately it reaches the retina, which is the light-sensing structure of the eye.
The retina contains two types of cells, called rods and cones. Rods handle vision in low light, and cones handle color vision and detail.
When light contacts these two types of cells, a series of complex chemical reactions occurs. The chemical that is formed (activated
rhodopsin) creates electrical impulses in the optic nerve. Generally, the outer segment of rods are long and thin, whereas the outer
segment of cones are more, well, cone shaped. Below is an example of a rod and a cone:
The cones in each eye number between 6 and 7 million. They are located primarily in the center portion of the retina called the fovea
and or highly sensitive color. Humans resolve fine detail with these cones largely because each one is connected to its own nerve end.
Muscles controlling the eye rotate the eye ball until the image of an object of interest falls on the fovea. Cone vision is called photopic
or bright light vision.
Fig. 5 Distribution of rods and coness
The number of rods is mush larger: some 75 to 150 million are distributed over the retinal surface. They are not involved in color
vision and sensitive to low level of illumination. For ex, objects tht apperat brightly in day light when seen bye moon light appears as
color less forms because only the rods are simulated. This phenomenon is known as scotopic or dim light vision.
The area where there is a absence of the receptors is called blind spot. Center portion of the retina is called fovea. Receptors density is
measured in degrees from the fovea
Scotopic vision is the vision of the eye under low light conditions. Photopic vision is the vision of the eye under well-lit conditions.
The transition from scotopic to photpic vision Is approximately ranges from 0.001 to 0.1. milli Lambarat (mL) (-3to -1mL in log
scale). The Subjective brightness is a log function of the light intensity incident on the eye. For a given set of conditions, the current
sensitivity level of the visual system is called The brightness adaptation. The short intersecting curve represents the range of subjective
brightness that eye can perceive when adapted to the level
Vision concept
When light enters the eye, it comes in contact with the photosensitive chemical rhodopsin (also called visual purple). Rhodopsin is a
mixture of a protein called scotopsin and 11-cis-retinal -- the latter is derived from vitamin A (which is why a lack of vitamin A causes
vision problems). Rhodopsin decomposes when it is exposed to light because light causes a physical change in the 11-cis-retinal
portion of the rhodopsin, changing it to all-trans retinal. This first reaction takes only a few trillionths of a second. The 11-cis-retinal
is an angulated molecule, while all-trans retinal is a straight molecule. This makes the chemical unstable. Rhodopsin breaks down
into several intermediate compounds, but eventually (in less than a second) forms metarhodopsin II (activated rhodopsin). This
chemical causes electrical impulses that are transmitted to the brain and interpreted as light. Here is a diagram of the chemical
reaction we just discussed:
1. The cell membrane (outer layer) of a rod cell has an electric charge. When light activates rhodopsin, it causes a reduction in
cyclic GMP, which causes this electric charge to increase. This produces an electric current along the cell. When more light is
detected, more rhodopsin is activated and more electric current is produced.
2. This electric impulse eventually reaches a ganglion cell, and then the optic nerve.
3. The nerves reach the optic chasm, where the nerve fibers from the inside half of each retina cross to the other side of the
brain, but the nerve fibers from the outside half of the retina stay on the same side of the brain.
4. These fibers eventually reach the back of the brain (occipital lobe). This is where vision is interpreted and is called the
primary visual cortex. Some of the visual fibers go to other parts of the brain to help to control eye movements, response of
the pupils and iris, and behavior.
Eventually, rhodopsin needs to be re-formed so that the process can recur. The all-trans retinal is converted to 11-cis-
retinal, which then recombines with scotopsin to form rhodopsin to begin the process again when exposed to light.
Color Vision
The color-responsive chemicals in the cones are called cone pigments and are very similar to the chemicals in the rods. The retinal
portion of the chemical is the same, however the scotopsin is replaced with photopsins. Therefore, the color-responsive pigments are
made of retinal and photopsins. There are three kinds of color-sensitive pigments:
Red-sensitive pigment
Green-sensitive pigment
Blue-sensitive pigment
Each cone cell has one of these pigments so that it is sensitive to that color. The human eye can sense almost any gradation of color
when red, green and blue are mixed.
In the diagram above, the wavelengths of the three types of cones (red, green and blue) are shown. The peak absorbancy of blue-
sensitive pigment is 445 nanometers, for green-sensitive pigment it is 535 nanometers, and for red-sensitive pigment it is 570
nanometers.
Mach band
The visual appearance is that each stripe is darker at the right side that at its left. This is called Mach band effect. Although the
intensity of the stripes is constant, we actually perceive a
brightness pattern that is strongly scalloped near the boundaries. Mach band patterns appear in images Presented for interpretation or
analysis such as in chest X rays near the edges of the lungs or aerial surveillance images.
Simultaneous contrast
All the center square have exactly the same intensity. But they appear to the eye to become darker as the background gets lighter. This
concept is called simultaneous contrast.
1. Radiance
2. Luminance
3. Brightness
Radiance – is the total amount of energy that flows from the light source, measured in watts
Luminance – measured in lumens (lm), gives a measure of the amount of energy an observer perceives from a light source
Brightness- Brightness is an attribute of visual perception in which a source appears to be radiating or reflecting light. [1] In other
words, brightness is the perception elicited by the luminance of a visual target. This is a subjective attribute/property of an object being
observed.
Hue represents the dominant color as perceived by an observer (red, yellow, blue . . .).
Saturation is the amount of white added to a hue (purity of the color). The saturation of a color identifies how pure or intense the
color is. A fully saturated color is deep and brilliant—as the saturation decreases, the color gets paler and more washed out until it
eventually fades to neutral.
Contrast is the difference in visual properties that makes an object (or its representation in an image) distinguishable from other
objects and the background. In visual perception of the real world, contrast is determined by the difference in the color and brightness
of the object and other objects within the same field of view.
X
x=
X +Y + Z ------ (1)
Y
y=
X +Y + Z ----------(2)
Z
z=
X +Y + Z -------- (3)
Let x =red, y = green and z= blue
It is useful for color mixing. The white point in the middle is called the point of equal energy has equal fractions of the
three primary colors
The point marked as “green” has approximately 62 % green and 25 % red. Therefore, it has about 13 % of blue. The
positions of different colors (from violet at 380 nm to red at 700 nm) are indicated by the wavelengths around the boundary
of the chromaticity diagram. Therefore they (boundary) are the Pure colors. Any point not on the boundary represents some
mixture of spectrum colors.
A straight line joining any two points in the diagram defines all the different color variations that can be obtained by
combining these two colors additively. A line drawn from the point of
equal energy to any point on the boundary defines all the shades of that particular color. Range of colors can be obtained
from any three given colors in the chromaticity diagram by connecting all the three colors by a triangle (color
gamut)shown. The irregular region inside the triangle represents the color gamut of the high-quality color printers. The
region is irregular since color printing involves a combination of additive and subtractive color mixing
In the model, each color appears in its primary spectral components of red green and blue. This model is based on
Cartesian coordinate system. Used generally in color monitors and color video cameras. Different colors in the Model are
defined by vectors extending from the origin. The number of bits used to represent each pixel in RGB space is called pixel
depth. If a pixel’s RGB has 8 bits each, then the pixel is said to have a depth of 24 bits. The term full color image is used
often to denote a 24 bit color image. The total number of colors in a 24 bit RGB image is (28)3 =16777216. Color planes
can be generated by varying two colors while keeping other color fixed.
216 safe RGB colors: These 216 colors, known as web safe colors, are recognized by all web browsers and operating
systems, which mean these colors, will look about the same within any browser. As 40 colors displayed differently between
PCs and MACs, they were eliminated. Each of them is formed from three RGB limited to [0, 51, 102, 153, 204, 255] or [00
33 66 99 CC FF]
Cyan, magenta, and yellow are the secondary colors of light (or the primary colors of pigments). Mixing together the three
secondary colors of light, black (no light) can be produced. But this printing will produce, muddy looking black. So,
to produce true black (predominant color in printing), a fourth color black is added (CMYK). used for color printing and to
produce full-color photographs and designs.
Most color printing devices use CMY model. The conversion from RGB is done by
The above equation demonstrates that Light reflected from a surface coated with pure cyan
does not contain red i.e., C=1-R. Similarly, RGB values can be obtained from a set of CMY values by subtracting the
individual CMY values from 1.
All color models used today are oriented either hardware oriented or application oriented.
Color models used in color monitors and for color printing and to produce full-color photographs and designs are generally
referred as hardware oriented models. RGB and CMY/CMYK color models are the examples of hardware oriented
models.
Color models used in the creation of color graphics for animation or in general for color manipulation are called
application oriented models. HSI /HSV color model is an example of application oriented model.
HSI color model includes components of Hue, saturation and intensity. Hue is a color attribute that describes a pure color.
Saturation gives a measure of the degree to which pure color is diluted by white light. Intensity (gray level) is a most useful
descriptor of monochromatic images. Unlike brightness, intensity is measurable and interpretable. The HSI model
decouples the intensity component from color carrying information (hue and saturation) in a color image. HSI is an ideal
tool for developing image processing algorithm based on color description that are natural and intuitive to humans.
RGB can be viewed as a three monochromatic intensity images e.g., black(0,0,0) and white (1,1,1). Thus we will be able to
extract intensity from RGB image. Fig (a) shows the black and white as vertex and intensity is shown as dotted line
(referred as intensity axis) connecting these two (vertical).
The intersection of the plane with the intensity as would give us a point with intensity value in the range (0,1). The
saturation of a color increases as a function of distance from the intensity axis. Saturation on the intensity axis is zero as all
the points along the axis are gray. Fig (b) shows a plane defined by three points (black, white and cyan). As black and
white points are contained in the plane, the intensity axis is also included in the plane.
All the points in the plane are defined by the intensity axis and the boundaries of the cube have the same hue (cyan in this
case). Thus H, S and I values required to form the HSI can be obtained from the RGB color cube. By using the geometrical
formulas (given in next slide) any RGB point can be converted into Corresponding point in HSI color model.
If the given value of H is in this sector we first subtract 120° from it.
Where, f(x, y) ,(x, y) and r(x, y) are non zero value and finite, i.e.,
Converting gray values in to discrete component is called quantization. The quality of the image is determined to a large degree by
the number of samples and gray levels used in sampling and quantization.
The result of sampling and quantization is a matrix of real numbers. f(x, y) is sampled so that the resulting digital image has M rows
and N columns.
Gray level resolution refers to the smallest discernible change in gray level. The measurement of discernible changes in gray level is a
highly subjective process. For. e.g.,
reducing gray-level, constant spatial resolution (452 X 374) from 8-bit (256 levels) to 1-bit (2 levels).
1.8 Connectivity
Used in establishing boundaries of objects and components of regions in an image. To establish connectivity, it must be determined if
they are adjacent in some sense and if their gray levels satisfy a specified criterion of similarity. Let V be the set of gray-level values
used to define connectivity, for example, in a boundary image, V={1} for the connectivity of the pixels with value 1.
• 4-connectivity: Two pixels p and q with values from V are 4-connected if q is in the set N 4(p)
• 8-Connectivity: Two pixels p and q with values from V are 8-connected if q is in the set N 8(p)
• M-connectivity(mixed connectivity): Two pixels p and q with values from V are m-connected if (i) q is in N 4(p) or
(ii) q is in ND(p) and the set N4(p)Ω N4(q) is empty
1.9 Trnsforms
1.9.1 Discrete Fourier Transform (DFT)
1.9.2 Discrete Cosine Transform (DCT)
1.9.3 Karhunen-Loeve Transform (KLT)
1.9.4 Singular Value Decomposition (SVD)
Appendix
Brightness
Brightness is an attribute of visual perception in which a source appears to be radiating or reflecting light.[1] In other words, brightness
is the perception elicited by the luminance of a visual target. This is a subjective attribute/property of an object being observed.
The brightness of a color identifies how light or dark the color is. Any color whose brightness is zero is black, regardless of its hue or
saturation.
There are different schemes for specifying a color's brightness and depending on which one is used, the results of lightening a color
can vary considerably.
Contrast
Contrast is the difference in visual properties that makes an object (or its representation in an image) distinguishable from other objects
and the background. In visual perception of the real world, contrast is determined by the difference in the color and brightness of the
object and other objects within the same field of view. Because the human visual system is more sensitive to contrast than absolute
luminance, we can perceive the world similarly regardless of the huge changes in illumination over the day or from place to place.
Contrast
Contrast generally refers to the difference in luminance or grey level values in an image and is an important characteristic.
It can be defined as the ratio of the maximum intensity to the minimum intensity over an image.
Contrast ratio has a strong bearing on the resolving power and delectability of an image.
Contrast enhancement techniques expand the range of brightness values in an image so that the image can be efficiently displayed in a
manner desired by the analyst.
Histogram equalization and specification techniques, Noise distributions, Spatial averaging, Directional Smoothing, Median,
Geometric mean, Harmonic mean, Contraharmonic mean filters, Homomorphic filtering, Color image enhancement
1.10 Introduction
Image enhancement refers to the accentuation of sharpening of image features such as edges, boundaries, or contrast to make a
graphic display more useful for display and analysis.
to increase the dynamic range of the chosen features so that they can be detected easily
to effectively display the data for subsequent visual interpretation. (e.g., satellite pictures)
to improve the quality of an image as perceived by a human.
to give output which is more suitable than the original image for a specific applications.
The term spatial domain refers to the image plane itself and techniques used in this category are based on direct manipulation of
pixels in an image. Frequency domain techniques are based on modifying the Fourier transform of an image
Spatial domain methods operate directly on these pixels. Spatial domain processes will be denoted by the expression.
g( x , y )=T [ f ( x , y ) ]
Where
f(x, y) is the input image, g(x, y) is the processed image and T is an operator on f defined
As enhancement at any point in an image depends only on the gray level at that point, techniques in this category often are referred to
as point processing. Point processing methods are based only on the intensity of single pixels.
In fig(a) the effect of gray level transformation would be to produce an image of higher contrast than the original by darkening the
levels below m (compressing the value– towards
Black) and brightening the levels above m (expanding towards white) in the original image
Process of fig (a) is called contrast stretching. Process of fig (b) is called thresholding
Function.
1. Contrast stretching
2. Gray-level slicing
3. Bit-plane slicing
Contrast stretching
The basic concept of contrast switching is to increase the dynamic range of the gray Levels in the image being processed. The
factors which causes the low contrast are poor illumination, lack of dynamic range in the imaging sensor, wrong setting of a lens
aperture during image acquisition
The locations of points (r1, s1) and (r2,s2) Control the shape of the transformation function.
Case(i) If r1 = s1 r2 =s2 ---- The transformation is a linear function that produces no change in gray levels.
Case (ii) If r1 = r2 = 0 and s1 = s2 = L-1 --- The transformation becomes a thresholding function that creates a binary image.
Case (iii)Intermediate values of (r1, s1) and (r2,s2) produce various degrees of spread in the gray levels of the output image, thus
affecting its contrast. In general, r1≤r2 and s1≤s2 is assumed so that the function is single valued and monotonically increasing.
Gray level slicing: highlights the specific range of gray levels in an image.
(1) Display a high value for all gray levels in the range of interest and low value for all other gray values.
(1) Brightens the desired range of gray levels but preserves the back ground and gray level tonalities in the image.
Bit-plane slicing Greyscale images can be transformed into a sequence of binary images by breaking them up into their bit-planes.
Here each pixel of an 8-bit image is represented as an 8-bit binary word. Let each pixel in an image is represented by 8 bits
narrow histograms.
The histogram of a digital image with gray levels in the range [0, L-1] is a discrete function.
nk
p( r k )=
n
Let r=0 representing black and r=1 representing white. For any r in the interval [0, 1] , the transformation is
This produces a level s for every pixel value r in original image. The transformation function satisfies the conditions
0≤r≤1
b) 0 ≤ T(r) ≤ 1 for 0 ≤ r ≤ 1
Figure illustrated a transformation Function satisfying these conditions. The inverse transformation from s back to r is denoted
By probability theory,
dr
p s ( s ) pr ( r )
ds r T 1 ( s )
-------- (3)
This technique is based on modifying the appearance of an image by controlling the pdf of its gray level via the transfer function T(r)
r
s=T (r )=∫ pr (w )dw
0
o ≤ r ≤ 1 --------- (4)
Equation (4) also satisfies the condition (a) and (b), Differentiating equation (4) with respect to r, we get
ds
= pr (r ) ps(s)
dr ------------ (5)
1
Substituting (5) in (3) we get
[
1
p s (s)= pr (r )
pr (r ) r =T−1 ( s) ] 0 1 s
=1 0≤s≤1 ---------- (6 )
Hence, any pdf can be converted into uniform distribution.
Above discussion was made with the assumption that pixel values are continuous quantities and lie in the interval (0, 1) with r=0
represents black and R=1 represents white.
level rk
L = number of level
A plot of p(rk) versus rk is called a histogram and the technique used for obtaining uniform histogram is known as histogram
equalization or histogram linearization. The transformation function of the discrete form is given by
k
nj
sk =T (r k )= ∑
j=0 n
k
= ∑ pr (r) 0≤r k≤1 and k=0,1, ... , L-1 ---(8)
j=0
Where both T(rk) and T⁻1(sk) are assumed to satisfy the condition (a) and (b). From equation (8) the transformation T(rk) may be
computed directly from the image.
Example 1: for the figure shown, find ps(s) and show that it is of udf
2 Pr(r)
1 r
Example 2: Consider 64x64 image, 8 gray level. the normalized gray level and pixels available t this gray Level are given in table.
Find the transformations.
Follow class notes for the Method of continuous gray values and Method of discrete gray values.
it reduces image quality and is especially significant when the objects being imaged are small and have relatively low
contrast. Factors which causes noise in digital images are
• Environmental conditions
• Quality of the image sensing elements
• Interference in the transmission channel
The presence of noise gives an image a mottled, grainy, textured, or snowy appearance. Nuclear images are generally the noisiest.
Noise is also significant in MRI, CT, and ultrasound imaging. radiography produces images with the least noise.
Frequency properties of noise – The frequency content of the noise defines the frequency properties. To find these properties, the
noise will be transformed into the Frequency domain using the Fourier transform.
White noise – If all the frequencies of a function are in equal proportions, its Fourier spectrum is said be constant. Thus if the Fourier
spectrum of a noise is constant, it is called white noise
And the noise component values in an image. this implies that the noise is uncorrelated with the image. Therefore the noise is
independent of the spatial coordinates.
1.16.1 Noise models
Noise models is a random variable with a probability density function (PDF) that describes its shape and distribution. The actual
distribution of noise in a specific image is the histogram of the noise. Noise can be modeled with Gaussian (“normal”), uniform, salt-
and-pepper (“impulse”), or Rayleigh distribution
Noise probability density functions (PDFs): The statistical behavior of the gray level values in the noise component is considered as
random variable. Therefore they are characterized by PDF
Some of the important noise PDF in image processing are defined for
1 −( z−u)2/2 σ 2
p( z)= e
√ 2 Πσ
When z is described by the above equation approximately 70% of its values will be in the range
[(m-2s), (m+2s)]
2
{
p(z)=¿ (z−a)e
b
−(z−a)2 /b
for z≥a ¿ ¿¿¿
μ=a+ √ πb/ 4
b (4−π )
and σ 2=
4
A plot of Rayleigh density is shown. Note the displacement from the origin and the fact that the basic shape of this Intensity is skewed
to the right. The Rayleigh density can be quite useful
p(z)=¿
{
ab zb−1 −az
(b−1)!
e for z≥0¿¿¿¿
It is offten referred to as the gamma density when the denominator is the gamma function G(b). Otherwise it Is called Erlang density.
1.16.7 Impulse (Salt and Pepper noise or shot noise or binary noise)
Impulse noise is also known as short noise or spike noise. This kind of noise is found in places where quick transients such as Faulty
switching take place during imaging. This degradation can be caused by sharp, sudden disturbances in the image signal. its appearance
is randomly scattered white or black (or both) pixels over the image.
Case (i) b>a. Here the gray level b will appear as a light dot
in the image and the gray level a appear like a dark dot in
the image.
the image
Where f(m, n) is the input image, g(x, y) is the processed image and T is an operator on f defined over some neighborhood of m, n
The principle approach of neighborhood is to use a square or rectangular sub image area centered at (m, n) as shown. The use of
spatial masking for image processing is usually called spatial filtering
1
v (m ,n )= ∑ ∑ y (m−k , n−l)
N w ( k , l) εw
1
wherea(k , l)= and Nw is the number os pixels in the window w
Nw
Spatial averaging is suitable for Gaussian and uniform distribution of noise. Not useful for impulse noise. Spatial averaging is used for
noise smoothing, low pass filtering and sub
sampling of images.
1
v (m, n ,;θ )= ∑ ∑ y (m−k , n−l)
N θ ( k , l)∈ϖ
x x x x x x
θ
x x x x x x
¿
And a direction θ is found such that x x x x x x
¿
|y(m ,n)−v(m ,n;θ )| w
x x x x x x
is minimum l
x x x x x x
Then k
V (m ,n)−v(m ,n;θ ¿ )
gives the
desired result.
Exponential
Filtering Inverse
LOG DFT
H(u,v) DFT
Input Enhanced
image image
f(x, y) g(x, y)
UNIT III
1.0 Introduction
Restoration process attempts to reconstruct or recover an imge that has been degraded by using some priori
knowledge of the degradation phenomenon. Restoration techniques are oriented toward modeling the degradation
and applying the inverse process in order to recover the original image. The aim of restoration process is to improve
the appearance of an image.
Definition
Image restoration concerns the removal or reduction of degradations which have occurred during the
acquisition of the image. Such degradations may include a) noise, which are errors in the pixel values b) optical
effects such as out of focus blurring c) blurring due to camera motion / misfocus d) random atmospheric turbulence
enhancement techniques are more image restoration techniques depends only on the
dependent class or ensemble properties of a data set
g ( x, y ) h( x, y ) f ( x, y ) ( x, y ) convolution
Where h(x, y) is the spatial representation of the degradation
As convolution in the spatial domain is equal to multiplication in frequency domain, a model in frequency domain representation is
Terms in capital letters are the Fourier transforms of the corresponding terms in spatial equation
3.0 Linear and position invariant processes/ Degradation model for continuous function
Many types of degradations can be approximated by linear, position invariant processes.
+∞
f ( x, y)=∫ ∫ f (α , β)δ (x−α , y−β )dα .dβ ---- (1)
−∞
g ( x, y ) H f ( , ) ( x , y )d .d
f ( , ) H [ ( x , y )]d .d
+∞
g( x,y )=∫ ∫ f (α , β)h[( x ,α ; y ,β )]dα .dβ ---- (3)
−∞
where h(x ,α ; y , β)=H [ α ( x−α , y−β ) ---- ( 4)
equation (3) is called the superposition (or fredholm ) integral of the first kind
equation ( 4) is called the impulse response of H
h(x, a, y, b) is the response of H to an impulse of strength 1 at coordinates (a, b). It is also commonly referred to as point
spread Function (PSF).
Equation (3) states that if the response of H to an impulse is known, the response to any input f(a, b) can be calculated. If H is
position is position invariant, equation (3) is written as
+∞
g( x,y )=∫ ∫ f (α , β)h[( x−α , y−β)]dα .dβ ---- (5)
−∞
Additive property
Equation (2) defines the additive property (ie., sum of the two inputs is equal to the sum of the two responses.
Homogeneity property
H [ k 1 f 1 ( x , y )=k 1 H (f 1 ( x , y ))−−−−(3)
An operator having the I/O relationship g(x, y)=H[f(x, y)] is said to be position (or) space invariant if
+∞
g( x,y )=∫ ∫ f (α , β)h[( x−α , y−β)]dα .dβ +η( x,y) ---- (6)
−∞
4.0 Unconstrained Restoration
The objective of image restoration is to estimate an original image f from a degraded image g for which some knowledge or
assumptions about the degradation function H and noise n are needed.
g( x , y )=h (x , y )∗f ( x , y )+η( x , y )
In matrix form this can be written as
g=Hf +η
η=g−H f^
where ^f is estimate or approximate image
^f ^
When the noise function is unknown, should be found in such a way that the square of the difference between g and H f is
minimum. This implies that the noise is approximated to zero.
d
(‖g−H ^f‖2
df^ )
=0
Degraded
image
Input image
There are three principle ways to estimate the degradation function in image restoration if true degradation function is not
By observation information can be gathered from the image.For e.g., in a blurred image, a small section of the image
containing simple structure’s like part of an object and background (referred as strong signal area) can be noticed. The degraded
function in frequency domain is known as
^f =( x , y )
s
G (u , v )
H s (u , v )= s
F^ (u , v )
s
From the characteristics of the above function, we then deduce the complete function H(u,v).
This method uses equipment similar to the one used to acquire the degraded image. The degraded image can be acquired with
various system settings until the acquired and the given image are as close as possible.
The idea is to obtain the impulse response of the degradation by imaging an impulse (small dot of light) using the same system
settings. An impulse is simulated by a bright spot of light as bright as possible to reduce the effect of noise
G(u, v) is a Fourier transform of the observed image and A is constant describing the strength of the impulse.
1. Degradation model that take into the environmental condition such as Turbulence.
Degradation model proposed by Hufnagel and stanley based on the physical characteristics
of the turbulence.
−k ( u2 +v2 ) 5/6
H (u , v )=e
Where k is a constant that depends on the nature of the turbulence. Except the exponent 5/6, the
2. Degradation model for the uniform linear motion which causes blur
Suppose that an image f(x, y) undergoes a planar motion.Let xo(t) and yo(t) are the time varying components of motion in x
and y direction respectively. The total exposure at any point of the recording medium is obtained by the instantaneous exposure
over the time interval during which the imaging system shutter is open
T
g( x , y )=∫ f [ x−x o (t ), y− y 0 (t )]dt --- (1 )
0
where g (x,y ) is the blurred image . By FT,
∞ ∞
G(u , v )= ∫ ∫ g ( x , y )e− j2 π (ux+ vy ) dxdy
−∞ −∞
substituting (1) in the above equation,we get
[ ]
∞ ∞ T
=∫ ∫ ∫ f [ x− x o(t ), y− y 0 (t )]dt − j2 π (ux+ vy )
e dxdy ---(2 )
−∞ −∞ 0
[ ∫ ∫ f [ x−x (t ), y − y (t )]e ]
T ∞ ∞
G(u , v )=∫ o 0
− j 2 π (ux+vy )
dxdy dt ---(3)
0 −∞ −∞
By FT pairs
¿
f [x−x o , y−y 0 ]⇔F(u,v)ealignl¿ −j 2π(ux 0 /M +vy0 / N ) ¿ ¿
T
− j2 π [ux o (t )+vy o ( t) ]
=∫ F (u , v)e dt
0
T
− j2 π [ux o (t )+vy o ( t) ]
=F (u , v )∫ e dt --- (4 )
0
From (4)
T
G(u , v ) − j2 π [ux o (t )+vy o ( t) ]
H (u , v )= =∫ e dt --- (5 )
F (u , v) 0
and G(u , v )=H (u , v) F (u , v) --- (6 )
If the motion variables xo(t) and yo(t) are known, the transfer function H(u, v) can be obtained directly from (5)
For illustration, suppose the image undergoes a uniform linear motion In x direction only at a rate given by
at
x o (t )=
T
Where t=T, the image has been displaced by a total distance ‘a’
T
− j 2 π ux o (t )
H (u , v )=∫ e
0
T
=∫ e− j2 π uat /T dt
0
T
= sin( π ua)e− jπ ua --- (7 )
πua
If y component also varies, with the motion yo(t) =bt/T, the degradation becomes
T
H (u , v )= sin (π (ua+vb ))e− jπ ( uv+vb) --- (8 )
π (ua+vb )
6.0 Inverse filtering
^f (u , v )
By inverse filtering, the estimate is computed by dividing the transform of the degraded image by the degraded
function Thus , v )
.G(u H (u , v )
G(u , v )
F^ (u , v )= --- (1 )
H (u , v )
Limitations
1. As the noise is random in nature, the Fourier transform of the noise N(u, v) is unknown. Thus it is difficult to recover the
ungraded image, even thoug degradation function is known.
2. If the degradation function H(u, v) is zero or small, then the ratio N(u,v)/H(u,v) could easily dominate the estimate this is
referred as zero or small value problem.
The zero or small value problem can be overcome by limiting the filter frequencies to only the values around the origin. The average
value of Fourier transform f(x, y)around the origin is given by
M −1 N −1
1
F (0 , 0)=
MN
∑ ∑ f ( x, y)
x=0 y=0
M−1 N−1
1
H (0 ,0 )=
MN
∑ ∑ h( x, y )
x=0 y=0
Thus, analyzing only the frequencies near the origin will reduce the probability of zero value degradation function
occurrence.
A very important application of inverse filtering is the removal of blur caused by uniform linear motion.
7.0 Removal of blur caused by uniform linear motion using inverse filtering
Suppose that an image f(x, y) undergoes a planar motion.Let xo(t) and yo(t) are the time varying components of motion in x and y
direction respectively. the degraded image, g(x,y) is given by
T
g( x , y )=∫ f [ x−x o (t ), y− y 0 (t )]dt --- (1)
0
where g(x,y ) is the blurred image . By FT,
G(u,v )= ∫ ∫ g( x, y )e− j2 π (ux+ vy ) dxdy --- (2)
−∞ −∞
The degraded function is expressed as (derived in estimation of degraded function by mathematical modeling of section 6.0)
T
G(u , v ) − j2 π [ux o (t )+vy o ( t) ]
H (u ,v )= =∫ e dt ---(3)
F (u , v) 0
and G(u , v )=H (u ,v) F (u , v) --- (4 )
If the motion variables xo(t) and yo(t) are known, the transfer function H(u, v) can be obtained directly from (3).
The reconstruction of f(x, y) from the blurred image is as follows. Let the linear motion is in x- direction only. Equation (1) is
rewritten as
T
g( x , y )=∫ f ( x−x o (t ))dt ---(5)
0
suppose the image undergoes a uniform linear motion In x direction only at a rate given by
at
x o (t )= --- (6 )
T
'
f ( z+ ma)=g ( z +ma)+ f ( z+( m−1) a ) --- ( 7 )
When m=0,
'
f ( z)=g ( z)+f ( z−a )
'
=g ( z)+φ ( z) --- (8 )
φ ( z)=f ( z−a )
When m=1 and from (8)
' '
f ( z+ a)=g ( z + a)+ g ( z )+φ ( z ) --- ( 9 )
When m=2
' ' '
f ( z+ 2a )=g ( z +2 a )+ g ( z +a )+ g ( z )+φ( z ) --- ( 10)
k =0
m
x=z +ma⇒ f ( x )= ∑ g ( x−ma )+ φ( x−ma ) ---(11 )
'
k =0
Here, g(x) is known, but φ(x) is unknown
To find φ(x-ma)
'
φ ( x−ma)=f ( x )−f ( x ) --- (11)
Solving these equations for ka≤x <( k +1)a , where k=0,1…K-1 results in
K−1 K−1
1 1
φ ( x )=
k
∑ f ( x +ka )−
k
∑ f^ ( x +ka )
k =0 k =0
K−1
1
Let
k
∑ f ( x +ka )= A --- a constant
k =0
K−1
1
φ ( x−ma)= A−
k
∑ f^ ( x +ka) 0≤x< L
k =0
∞
substituting, ^f ( x )= ∑ g' ( x− ja)
j=0
K−1 ∞
1
φ ( x−ma)= A−
k
∑ ∑ g' ( x−ma+(k− j)a ) ---(12)
k =0 j=0
From (11)
K−1 ∞ ∞
1
f ( x )= A− ∑ ∑ [ g ( x−ma+(k − j )a)]+ ∑ g' ( x− ja)
'
--0≤x≤L --- (13 )
k k=0 j=0 j=0
K −1
∞ m
1
f ( x , y )=A− ∑ ∑ g ( x−ma+(k − j)a , y )]+ ∑ g ( x− ja , y ) -- 0≤x , y≤L --- (14 )
' '
k k =0 j=0 j=0
Equation (14) gives the reconstructed imge when the uniform liner motion is in the x direction only.
The following equation gives the reconstructed image when the uniform linear motion in the y direction only
K −1
∞ m
1
f ( x , y )=A− ∑ ∑ g ' [ x , y −ma+(k − j )a ]+ ∑ g' ( x , y − ja) --0≤x , y≤L ---(14 )
k k =0 j=0 j=0
Thus, the images that are blurred due to uniform linear motion can be reconstructed.
The approximate image or estimate of f in the frequency domain which satisfies the minimum error function based on the above
condition is given by
F^ (u , v )=
[ H∗(u , v )S f (u , v )
S f (u , v )|H (u , v )|2 +S η (u , v ) ] G(u , v )
=
[ H∗(u , v )
|H (u , v )|2 +S η (u , v )/S f (u , v ) ] G(u , v ) --- (2)
=
1
[ |H (u , v )|2
H (u , v ) |H (u , v )|2 +Sη (u , v )/S f (u , v )
G(u , v )
]
Hint- H (u,v )H∗(u,v )=|H (u,v )2|
Where
The restored image ^f (u , vin) the spatial domain is given by the inverse
ˆ
Fourier transform of the frequency domain estimate F (u , v)
Note: If the noise is zero, then the noise power spectrum vanishes and the wiener filter reduces to the inverse filter. .
If the power spectrum of the undegraded i.e., Sf(u, v) is unknown or can not be estimated and
When we deal with the white noise whose spectrum is constant, wiener filter equation can be approximated as
F^ (u , v)=
[ 1 |H (u , v )|2
H (u , v) |H (u ,v)|2 +K ]
G(u , v)
Advantages
1. Wiener filter has no ‘small are zero value problem’ until both H(u, v) and Sh(u, v) is zero.
2. The results obtained are more closer to the original image than the inverse filtering.
Disadvantages
1. It requires power spectrum of the undegraded image and noise to be unknown which makes
the implementation more difficult.
2. Wiener filter is based on minimizing a statistical criterion. Therefore, the results are optimal
only in an average sense.
(1) Spatial transformation – defines the rearrangement of pixels on the image plane
(2) Gray level interpolation – deals with the assignment of gray levels to pixels in the spatially transformed image
Let f is an image with pixel coordinates (x, y) which under goes geometric ransformations
r(x, y) and y΄= s(x, y) are the spatial transformations that produce g((x΄, y΄)
e.g., If r(x, y) =x/2 and s(x, y) = x/2 , the distortion is simply shrinking of the size of
If r(x, y) and s(x, y) = x/2 , known f(x, y) can be recovered. But, practically formulating a single set of analytical functions r(x, y) and
s(x, y) that describes the geometric distortion process over the entire image plane is not possible.
Most frequently used method to formulate the spatial relocation of the pixels is the use of tie points
Tie points are subset of pixels whose location in the input (distorted) and Output (corrected) is known precisely.
Vertices called as
tie points
Distorted
image Corrected
g(x΄, y΄) image f̂(x, y)
The coefficients constitute the geometric distortion model. From theCoefficients, an image cab be restored. In general, enough tie
points are needed to generate a quadrilateral that cover entire image.
This implies that the pixel (x΄, y΄) in the geometrically distorted image is equivalent to the pixel (0, 0) in the corrected image.
The procedure should continue pixel by pixel. A column by column rather than row by row would yield identical results. Tie
points are established in original image by different ways
e.g., reseau marks --- In image generation system, a physical artifacts is embedded on the
image sensor itself. This produces known tie points
If the image is distorted later by some other process, then the image can be geometrically corrected.
The spatial transformation steps through integer values of the coordinates (x, y) to yield the restored image. However, depending on
the coefficients x΄ and y΄ (from the bilinear equations) may be a non-integer.
As the gray values of non-integer values are not defined, assigning gray values in is difficult one. The technique used to
inferring the gray values at the non-integer locations is called gray-level interpolation.
c) Bilinear interpolation
This method assigns the gray level of the nearest neighbor to the pixel Located at (x, y).
This result in a spatial offset error by as much as 1/√2 pixel units.
Drawback – produces undesirable artifacts such as distortion of straight edges in images of high resolution.
This method uses a large number of neighbors which smoothens the surface.
The cubic convolution interpolation function can be expressed in the following general form:
This method uses a large number of neighbors which smoothens the surface.
The cubic convolution interpolation function can be expressed in the following general form:
Edge detection, Edge linking via Hough transform – Thresholding - Region based
segmentation – Region growing – Region splitting and Merging – Segmentation by
morphological watersheds – basic concepts – Dam construction – Watershed
segmentation algorithm.
Image Segmentation
4.1:Introduction- Segmentation subdivides an image into its
constituent regions or objects that have similar features
according to a set of predefined criteria.
features?
intensity
histogram
mean, variance
energy
texture
….
segmentation
enhancement Image
Preprocessing feature extraction,
restoration, etc Analysis
etc
Spatial filter(mask)
ex) R = w1 z1+ w2 z2+…+ w9 z9
w1 w2 w3
w4 w5 w6
w7 w8 w9
mask
4.2.1-Point Detection
-1 -1 -1
-1 8 -1
-1 -1 -1
Point Detection
X-ray image of a jet-engine turbine blade with a porosity
in the upper, right quadrant of the image
The threshold T is set to 90% of the highest absolute
pixel value of the image in Fig. 10.2(c)
4.2.2-Line Detection
These filter masks would respond more strongly to lines .Note that
the coefficients in each mask sum to zero, indicating a zero response
from the masks in areas of constant gray level.
Line Detection
A binary image of a wire-bond
mask for an electronic circuit
We are interested in finding all
the lines that are one pixel thick
and are oriented at -45°
The line in the top, left quadrant
is not detected because it is not
one pixel thick
4.2.3-Edge Detection
Edge
An edge is a set of connected pixels that lie on the boundary between two
regions
An edge is a “local” concept whereas a region boundary is a more global idea
An ideal edge has the properties of the model shown in Fig. 10.5(a)
Edge Detection
In practice, optics, sampling, and other image acquisition imperfections yield edges
that are blurred.
As a result, edges are more closely modeled as a “ramp”-like profile. The degree of
blurring is determined by factors such as the quality of the image acquisition system,
the sampling rate, and illumination conditions.
An edge point is any point contained in the ramp, and an edge would be a set of such
points that are connected.
The “thickness” of the edge is determined by the length of the ramp Blurred edges
tend to be thick and sharp edges tend to be thin.
Edge Detection
The magnitude of the first derivative can be used to detect the presence of an edge.
The sign of the second derivative can be used to determine whether an edge pixel lies
on the dark or light side of an edge.
An imaginary straight line joining the extreme positive and negative values of the
second derivative would cross zero near the midpoint of the edge (zero-crossing
property).
Edge Detection
Derivative is very
sensitive to noise
Image smoothing is
needed
Edge Detection
We define a point in an image as being an edge point if its two-
dimensional first-order derivative is greater than a specified threshold.
The term edge segment generally is used if the edge is short in relation
to the dimensions of the image.
4.3-Gradient Operators
The Gradient
Robert cross-gradient operators
G x = ( z 9 − z 5 ) and G y = ( z 8 − z 6 )
[
∇f = ( z 9 − z 5 ) 2 + ( z 8 − z 6 ) 2 ] 1/ 2
∇f ≈ z 9 − z 5 + z8 − z 6
Sobel Operator
Gradient Operator
⎡G x ⎤ ⎡( z 6 − z 5 ) ⎤
z1 z2 z3
∇f = ⎢ ⎥ ≅ ⎢
z4 z5 z6 G y ⎦ ⎣ ( z8 − z 5 ) ⎥⎦⎣
z7 z8 z9
[
∇ f ≅ ( z 6 − z 5 ) 2+ ( z8 − z 5 ) ]
2 1/ 2
≅ | z 6 − z 5 | + | z8 − z 5 |
Gradient Operator
Roberts cross-gradient
⎡G x ⎤ ⎡( z 9 − z 5 ) ⎤
z1 z2 z3 ∇f = ⎢ ⎥ ≅ ⎢
G y ⎦ ⎣ ( z8 − z 6 ) ⎥⎦⎣
z4 z5 z6
[
∇ f ≅ ( z 9 − z 5 ) 2+ ( z8 − z 6 ) ]
2 1/ 2
z7 z8 z9
≅ | z 9 − z 5 | + | z8 − z 6 |
Gradient Operator
Robert cross-gradient filter masks
-1 0 ⎡G x ⎤ ⎡( z 9 − z 5 ) ⎤
∇f = ⎢ ⎥ ≅ ⎢
0 1 G y ⎦ ⎣ ( z8 − z 6 ) ⎥⎦⎣
[
∇ f ≅ ( z 9 − z 5 ) 2+ ( z8 − z 6 ) ]
2 1/ 2
0 -1
≅ | z 9 − z 5 | + | z8 − z 6 |
1 0
4.3.1-Prewitt Operator
z1 z2 z3 -1 0 1 -1 -1 -1
z4 z5 z6 -1 0 1 0 0 0
z7 z8 z9 -1 0 1 1 1 1
Gx Gy
⎡Gx ⎤ ⎡( z3 + z6 + z9 ) − ( z1 + z 4 + z7 )⎤
∇f = ⎢ ⎥ ≅ ⎢
G y ⎦ ⎣( z7 + z8 + z9 ) − ( z1 + z 2 + z3 ) ⎥⎦⎣
∇f ≅ | G x | + | G y |
4.3.2-Sobel Operator
z1 z2 z3 -1 0 1 -1 -2 -1
z4 z 5 z 6 -2 0 2 0 0 0
z7 z 8 z 9 -1 0 1 1 2 1
Gx Gy
⎡Gx ⎤ ⎡( z3 + 2 z6 + z9 ) − ( z1 + 2 z 4 + z7 )⎤
∇f = ⎢ ⎥ ≅ ⎢
G y ⎦ ⎣( z7 + 2 z8 + z9 ) − ( z1 + 2 z 2 + z3 ) ⎥⎦⎣
∇f ≅ | G x | + | G y |
Examples
Diagonal Edge
4.4-Laplacian
∇ 2 f = 4 z 5 − ( z 2 + z 4 + z 6 + z8 )
∇ 2 f = 8 z5 − ( z1 + z 2 + z3 + z 4 + z6 + z7 + z8 + z9 )
0 -1 0 -1 -1 -1
-1 4 -1 -1 8 -1
0 -1 0 -1 -1 -1
Laplacian
The Laplacian generally is not used in its original
form for edge detection for several reasons
It is unacceptably sensitive to noise
The magnitude of the Laplacian produces double
edges
It is unable to detect edge direction
Laplacian of Gaussian
Gaussian function with a
standard deviation of five pixels
27x27 spatial smoothing
Mask.
The mask was obtained by
sampling the Gaussian function
at equal intervals.
After smoothing we apply the
Laplacian mask.
Comparison
The edges in the zero-crossing
image are thinner than the
gradient edges
The edges determined by zero
crossings form numerous closed
loops (spaghetti effect:
drawback)
The computation of zero
crossings presents a challenge
4.5-Edge Linking
Edge Linking
Given n points in an image, suppose that we want to find subsets of
these points that lie on straight lines.
One possible solution is to first find all lines determined by every pair
of points,
Then find all subsets of points that are close to particular lines.
Hough transform
The Hough transform subdivides the parameter space into so-called accumulator
cells.
These cells are set to zero.
For every point (xk, yk) , we let the parameter a equal each of the allowed subdivision
values on the a-axis and solve for the corresponding b.
The resulting b’s are then rounded off to the nearest allowed value in the b-axis.
At the end, a value of Q in A(i,j) corresponds to Q points in the xy- plane lying on the
line y=aix+bj
b j = − xk ai + yk
4.5.1-Hough Transform[1962]
Hough transform
The Hough transform subdivides the parameter space into so-called accumulator
cells.
These cells are set to zero.
For every point (xk, yk) , we let the parameter a equal each of the allowed subdivision
values on the a-axis and solve for the corresponding b.
The resulting b’s are then rounded off to the nearest allowed value in the b-axis.
At the end, a value of Q in A(i,j) corresponds to Q points in the xy- plane lying on the
line y=aix+bj
b j = − xk ai + yk
Hough transform
If there are K increments in the a axis, K computation is
needed for every pointnK computation for n image
points (linear)
There is a problem when the slope approaches infinity
(vertical line)
Hough transform
One solution: to use the following representation
x cosθ + y sin θ = ρ
The loci are sinusoidal curves in the ρθ -plane
Q collinear points lying on a line x cos θ j + y sin θ j = ρ i
they belongs to one of the three accumulator cells with highest count
No gaps were longer than five pixels
4.6-Thresholding
Global Thresholding
Apply the same threshold to the whole image
Local Thresholding
The threshold depends on local property such as local average
Dynamic(adaptive) thresholding
The threshold depends on the spatial coordinates
The problem is how to select the threshold automatically!
4.6.1-Global Thresholding
Global Thresholding
Automatic threshold selection
1. Select an initial estimate for T
2. Segment the image using T,
which produce two groups, G1, G2
3. Compute the average gray level
values μ1 and μ 2 for the pixels in
regions G1 and G2
4. Compute a new threshold value:
1
T=
( μ1 + μ 2 )
2
5. Repeat step 2 through 4 until the
difference in T in successive
iterations is smaller than a
predefined parameter T0
4.6.2-Basic Adaptive Thresholding
Similarly,
∞
E2 (T ) = ∫ Tp1 ( z )dz
One approach for improving the shape of histograms is to consider only those pixels
that lie on or near the edges between objects and the background.
Separate an object and the background around a boundary using gradient and
Laplacian.
Labeling
0 1 0
Laplacian:
∂2 f ∂2 f
∇2 f = 2 + 2
∂x∂y
Segmentation by local thresholding
4.9-Region-Based Segmentation
Region growing is a procedure that groups pixels or subregions into larger regions
based on predefined criteria.
The basic approach is to start with a set of ‘Seed’ points and from these grow
regions by appending to each seed those neighboring pixels that have properties
similar to the seed Selections of ‘Seed’ point and similarity criteria are the primary
Problem.
0 0 5 6 7 a a b b b a a a a a
1 1 5 8 7 a a b b b a a a a a
0 1 6 7 7 a a b b b a a a a a
2 0 7 6 6 a a b b b a a a a a
0 1 5 6 5 a a b b b a a a a a
Region Growing
4.9.2-Region Splitting and Merging
Algorithm
(1) We start with the entire region R
(2) If P(Ri)=FALSE, split into four disjoint quadrants
(3) Merge any adjacent regions Rj , Rk for which P(Rj U Rk)=TRUE
(4) Stop when no further merging or splitting is possible
0
100
80 100
60 80
40 60
40
20 20
0 0
Basic Definitions
• DI: Domain of I
• Instead of working on an image itself, this technique is often applied on its gradient
image.
• Points at which a drop of water will be equally likely to fall to more than
one minimum
• This technique is to identify all the third type of points for segmentation
Basic Steps
3. When the rising water in distinct catchment basins is about to merge, a dam is built to
prevent the merging
The dam boundaries correspond to the watershed lines to be extracted by a
watershed segmentation algorithm
• At each step of the algorithm, the binary image in obtained in the following manner
1. Initially, the set of pixels with minimum gray level are 1, others 0.
2. In each subsequent step, we flood the 3D topography from below and the
pixels covered by the rising water are 1s and others 0s.
Notations
• M1, M2:
• Cn-1(M1), Cn-1(M2)
• C[n-1]
– This indicates that the water between the two catchment basins has merged at
flooding step n
• Steps
– The dam is constructed by the points on which the dilation would cause the sets
being dilated to merge.
– Setting the gray level at each point in the resultant path to a value greater than the
maximum gray value of the image. Usually max+1
–
Watershed Transform
• Denote M1, M2, …, MR as the sets of the coordinates of the points in the regional minima of an
(gradient) image g(x,y)
• Denote C(Mi) as the coordinates of the points in the catchment basin associated with regional
minimum Mi.
• Denote the minimum and maximum gray levels of g(x,y) as min and max
• Denote T[n] as the set of coordinates (s,t) for which g(s,t) < n
• Denote Cn(Mi) as the set of coordinates of points in the catchment basin associated with
minimum Mi at flooding stage n.
– Cn(Mi)=T[n]
• Denote C[n] as the union of the flooded catchment basin portions at stage n:
– Initialization
– Let C[min+1]=T[min+1]
• At each step n, assume C[n-1] has been constructed. The goal is to obtain C[n] from C[n-1]
• Denote Q[n] as the set of connected components in T[n].
A dam has to be built within q to prevent overflow between the catchment basins
The Use of Markers
• Internal markers are used to limit the number of regions by specifying the objects of interest
yy
Model Question -1
Part – B (5 X 16 =80)
(or)
(b) Explain briefly the elements & fundamental steps of image processing system (16)
12 (a) Explain RGB & HSI colour image models (16)
(or)
(b) Explain various noise models with probability density functions (16)
13 (a) Explain Geometric transformation with neat diagrams. (16)
(or)
(b) Explain Blind Image Restoration (16)
14 (a) Write short notes on Hough Transform for edge linking (16)
(or)
(b) Explain Watershed algorithm Dam Construction in Watershed segmentation (16)
15 (a) Explain the following
(i) Run length coding (8)
(ii) Shift codes (8)
(or)
(b) Explain Transform coding with an example (16)
Model Question -2
9. What are the two types of error criteria for compression algorithms?
10. What is the difference between Huffman coding and arithmetic coding?
Part – B (5 X 16 =80)
13 (a) Explain constrained restoration in detail and also explain inverse filtering (16)
(or)
(b) Derive the expression of unconstrained restoration and explain (16)
14 (a) Explain Edge detection in detail (16)
(or)
(b) Explain different concepts in Thresholding (16)
15 (a) (i) Explain arithmetic coding technique with example (8)
(ii) Briefly discuss the JPEG compression standard (8)
(or)
(b) (i) Give the basics of vector quantization (8)
(ii) With a neat diagram explain the concept of transform coding (8)
Model Question -3
2.
Differentiate the functions of rods and cons in human visual system.
3. What is blind deconvolution?
4.
Define region growing?
5.
Specify the steps involved in splitting and merging?
6. What is psycho visual redundancy?
Part – B (5 X 16 =80)
11 (a) Explain the elements of visual perception (16)
(or)
(b) Write elaborate notes on KL Transform (16)
12 (a) Explain Histogram equalization & specification with neat diagrams (16)
(or)
(b) (i) Write short notes on SVD Transform (8)
(ii) Write short notes on colour image enhancement (8)
13 (a) Write short notes on Wiener Filtering (16)
(or)
(b) Explain the model of Image degradation and Restoration process (16)
14 (a) Explain the concept of region growing with neat diagrams (16)
(or)
(b) Explain the following (i) Region growing, splitting and merging (16)
15 (a) Explain the following
(i) (i) Huffman coding (ii) Arithmetic coding (8+8)
(or)
Part – B (5 X 16 =80)
(or)
(b) Explain briefly the elements & fundamental steps of image processing system (16)
12 (a) Explain RGB & HSI colour image models (16)
(or)
(b) Explain various noise models with probability density functions (16)
13 (a) Explain Geometric transformation with neat diagrams. (16)
(or)
(b) Explain Blind Image Restoration (16)
14 (b) Write short notes on Hough Transform for edge linking (16)
(or)
(b) Explain Watershed algorithm Dam Construction in Watershed segmentation (16)
15 (c) Explain the following
(iii) Run length coding
(8)
(iv) Shift codes
(8)
(or)
(d) Explain Transform coding with an example (16)
Model Question -2
9. What are the two types of error criteria for compression algorithms?
10. What is the difference between Huffman coding and arithmetic coding?
Part – B (5 X 16 =80)
13 (a) Explain constrained restoration in detail and also explain inverse filtering (16)
(or)
(b) Derive the expression of unconstrained restoration and explain (16)
14 (a) Explain Edge detection in detail (16)
(or)
(b) Explain different concepts in Thresholding (16)
15 (c) (i) Explain arithmetic coding technique with example (8)
(iii) Briefly discuss the JPEG compression standard (8)
(or)
(d) (i) Give the basics of vector quantization (8)
(iii) With a neat diagram explain the concept of transform coding (8)
Model Question -3
2.
Differentiate the functions of rods and cons in human visual system.
3. What is blind deconvolution?
4.
Define region growing?
5.
Specify the steps involved in splitting and merging?
6. What is psycho visual redundancy?
Part – B (5 X 16 =80)
11 (a) Explain the elements of visual perception (16)
(or)
(b) Write elaborate notes on KL Transform (16)
12 (a) Explain Histogram equalization & specification with neat diagrams (16)
(or)
(b) (i) Write short notes on SVD Transform (8)
(ii) Write short notes on colour image enhancement (8)
13 (a) Write short notes on Wiener Filtering (16)
(or)
(b) Explain the model of Image degradation and Restoration process (16)
14 (a) Explain the concept of region growing with neat diagrams (16)
(or)
(b) Explain the following (i) Region growing, splitting and merging (16)
15 (c) Explain the following
(ii) (i) Huffman coding (ii) Arithmetic coding (8+8)
(or)
UNIT – I
Part A
1. Define image.
2. What is pixel and other name of pixels?
3. What are fundamental steps in image processing?
4. What are elements of digital image processing?
5. What are types of storage?
6. List the membrane in human eye.
7. What is pupil?
8. What is fovea?
9. What is photopic or bright light vision?
10. What is illumination and reflectance?
11. Define four neighbours, diagonal neighbours and eight neighbours.
12. Define digital image processing.
13. What are two aspects of human visual system?
14. Define scotopic vision.
15. What is meant by brightness adaption?
16. What is meant by gray level?
17. What is meant by sampling and quantization? Where is it used?
18. Resolution of an image.
19. Define checker board effect.
20. What are the steps involved in DIP?
21. Specify the elements of DIP system.
22. Define 4-connectivity, 8-connectivity, m-connectivity.
23. Define adjacency.
24. Define Weber ratio.
25. What is use of masking?
26. What is subjective brightness?
27. What is simultaneous contrast?
28. What is Mach band effect?
29. What is spatial and gray level resolution?
30. Define translation, scaling and rotation.
31. What is concalenated transformation?
32. What is pixel replication?
33. What is bilinear interpolation?
34. Define connected component and connect set.
35. What are conditions for distance function D?
36. What is Euclidean distance?
37. Define city block distance and chess board distance.
38. What is false contouring?
39. Write short notes on band limited functions.
40. Define Moire pattern.
41. What are steps in zooming?
42. What is nearest neighbour interpolation?
43. Write short notes on seperable image transforms.
44. What is 2D circular convolution property of 2-DFT?
45. What is 1D DFF expression?
46. What is circulant operation?
47. Compute haar transformation matrix of size 4 X 4.
48. What are the applications of DIP?
49. Define Haar transform.
50. What are the basic types of functions used frequently for image enhancement?
51. Write down the transformation expression of image enhancement functions.
52. Differentiate photopic and scotopic vision.
53. How cones and rods are distributed in retina?
54. Define sampling and quantization.
55. What do you meant by Zooming of digital images?
56. What do you meant by shrinking of digital images?
57. What is meant by path?
58. What is geometric transformation?
59. Give the formula for calculating D4 and D8 distance.
60. What is the need for transform?
61. What are the applications of transform?
62. What are the Properties of Slant transform?
Part B
1. Explain the function of human eye and also explain brightness adaption and discrimination.
2. What is meant by image sampling and quantization and explain it.
3. Write short notes on
i) Neighbour of pixel
ii) Connectivity
i) Transitive closure
ii) Rotation
6. Explain in detain the various properties of the two dimensional fourier transform.
7. Prove that the number of complex multiplications and additions required to implement the FFT
algorithms are proportional to Nlog2N.
8. Explain in detail about Walsh transform.
9. Explain in detail about Hadamard transform
10. Explain in detail about Haar transforms
11. Write short notes on Discrete cosine transforms
12. Write short notes on Slant transforms
13. Write short notes on KL transforms
14. Explain in detail the properties of 2D fourier transform and its application in image processing.
15. Discuss the effects of non uniform sampling and quantization.
16. Write Haar transform. Generate Haar matrix for N = 8.
17. With reference to the two dimensional fourier transform prove the properties pertaining to
rotation, linearity and scaling.
18. Describe the elements of visual perception.
19. Explain the steps involved in digital image processing.
20. Describe image formation in the eye with brightness adaptation and discrimination.
21. Explain the basic relationships between pixels?
UNIT – II
Part A
1. Define enhancement.
2. Write the equation for spatial domain approach in image enhancement.
3. Write the equation for frequency domain approach in image enhancement.
4. Define point operations.
5. What are applications of point operations?
6. What is image negative?
7. What is contrast stretching?
8. What is intensity level slicing/gray level slicing?
9. What is bit plane slicing?
10. What is image subtracting?
11. What is image averaging?
12. Define histogram.
13. What is histogram equalization or histogram linearization?
14. What is the difference b/w linear and non-linear filters?
15. What is use of smoothing spatial filter?
16. What is median filter and its properties?
17. What is min. and max. filter?
18. What is sharpening?
19. What is spatial filter?
20. What is histogram specification?
21. What are the applications of image subtraction?
22. Define high boost filter.
23. Define gradient operators.
24. Write the prewitt and sobel operator mask.
25. Define Laplacian.
26. What is homomorphic filtering?
27. What is advantage of homomorphic filter?
28. Write transfer function of butteworth filter.
29. What is image averaging?
30. Define contrast ratio and inverse contrast ratio.
31. Specify the objective of image enhancement technique.
32. Explain the 2 categories of image enhancement.
33. What is meant by masking?
34. Give the formula for negative and log transformation.
35. Write the steps involved in frequency domain filtering.
36. What do you mean by Point processing?
37. What is a Median filter?
38. Write the application of sharpening filters?
39. Name the different types of derivative filters?
40. Define Derivative filter.
41. Give the mask used for high boost filtering.
42. Give the formula for transform function of a Butterworth low pass filter.
Part B
UNIT – III
Part A
1. Define image restoration.
2. Draw the diagram for model of image degradation.
3. List the properties of degradation model.
4. What is meant by homogeneity property in linear operator?
5. Define position invariant.
6. What is meant by circulant matrix?
7. Write the equation for discrete degradation model.
8. Write the equation for continuous degradation model.
9. What are the types of image noise modes?
10. What is inverse filtering?
11. Define Weiner filter.
12. What is blind image restoration?
13. Mention the types of blind image restoration.
14. What is meant by undetermined or overdetermined?
15. Define pseudo inverse matrix.
16. Define black mode restoration process.
17. Define Perturbation error.
18. What is image restoration?
19. What is geometric model and photometric model?
20. What is neighborhood process?
21. What is point spread function?
22. What are the forms of degradation?
23. Give the relation for degradation model.
24. List the properties involved in degradation model.
25. Give the relation for degradation model for continuous function.
26. Give the relation for 2-D discrete degradation model.
27. List the algebraic approach in image restoration.
28. What is inverse filtering and its limitations.
29. Mention Image restoration techniques.
30. Difference b/w image enhancement and restoration.
31. Give the noise probability density function.
32. Define pseudo inverse filter.
33. What are the assumptions in Wiener filter?
34. Give the transfer function of Wiener filter.
35. Difficulties in Wiener filter.
36. Steps in CLSR.
37. What is SVD transform?
38. What is Speckle noise?
39. What are the two properties in Linear Operator?
40. Explain additivity property in Linear Operator.
41. How a degradation process is modeled?
42. What are the types of noise models?
43. What are the two methods of algebraic approach?
44. Define Gray-level interpolation?
45. Why the restoration is called as unconstrained restoration?
46. What are the three methods of estimating the degradation function?
47. Give the relation for Gaussian noise.
48. Give the relation for rayleigh noise.
49. Give the relation for impulse noise.
50. Give the relation for uniform noise.
51. Give the relation for exponential noise.
52. Give the relation for Gamma noise.
53. What is meant by least mean square filter?
54. Give the equation for singular value decomposition of an image?
55. Write the properties of Singular value Decomposition(SVD)?
56. Give the difference between Enhancement and Restoration?
Part B
UNIT – IV
Part B
Unit-V
Part A
directly.
Write matlab programs and give the simulation results in the form of ppt and hard copy.
Reference: http://seminarprojects.com/Thread-digital-image-processing-
projects#ixzz1xKqbT4SS