22bit5c4 Dip
22bit5c4 Dip
OBJECTIVES:
1. Tobecomefamiliarwithdigitalimagefundamentals&getexposedtosimpleimage
enhancement techniques in Spatial and Frequency domain.
2. To learn concepts of degradation function and restoration techniques & study the image
segmentation and representation techniques.
3. Tobecomefamiliarwithimagecompressionandrecognitionmethods
UNITI-DIGITALIMAGEFUNDAMENTALS
Steps in Digital Image Processing – Components – Elements of Visual Perception – Image Sensing
and Acquisition – Image Sampling and Quantization – Relationships between pixels - Color image
fundamentals - RGB, HSI models, Two-dimensional mathematical preliminaries, 2D transforms -
DFT, DCT.
UNITIIIMAGEENHANCEMENT
Spatial Domain: Gray level transformations – Histogram processing – Basics of Spatial Filtering–
Smoothing and Sharpening Spatial Filtering, Frequency Domain: Introduction to FourierTransform–
Smoothing and Sharpening frequency domain filters – Ideal, Butterworth and Gaussian filters,
Homomorphic filtering, Color image enhancement.
UNITIIIIMAGERESTORATION
Image Restoration -degradation model, Properties,Noisemodels– Mean Filters– OrderStatistics–
Adaptivefilters–BandrejectFilters–BandpassFilters–NotchFilters–OptimumNotch Filtering – Inverse
Filtering – Wiener filtering.
UNITIVIMAGESEGMENTATION
Edge detection, Edge linking via Hough transform – Thresholding - Region based segmentation –
Region growing – Region splitting and merging – Morphological processing- erosion and dilation,
Segmentation by morphological watersheds – basic concepts – Dam construction – Watershed
segmentation algorithm.
UNITVIMAGECOMPRESSIONANDRECOGNITION
Need for data compression, Huffman, Run Length Encoding, Shift codes, Arithmetic coding, JPEG
standard, MPEG. Boundary representation, Boundary description, Fourier Descriptor, Regional
Descriptors – Topological feature, Texture - Patterns and Pattern classes - Recognition based on
matching.
OUTCOMES:Attheendofthecourse,thestudentsshouldbeable to:
1. Knowandunderstandthebasicsandfundamentalsofdigitalimageprocessing,suchas digitization,
sampling, quantization, and 2D-transforms.
2. Operate on images using the techniques of smoothing, sharpening and enhancement &understand
the restoration concepts and filtering techniques.
4. Learn the basics of segmentation, features extraction, compression and recognition methods
forcolor models.
TEXTBOOKS:
1. RafaelC.Gonzalez,RichardE.Woods,DigitalImageProcessing,Pearson,3Edition,2010.
2. AnilK.Jain,FundamentalsofDigitalImageProcessing,Pearson,2002.
REFERENCES
1. KennethR.Castleman,DigitalImageProcessing,Pearson,2006.
2. RafaelC.Gonzalez,etal,DigitalImageProcessingusingMATLAB,Pearson2011.
3. D,E.Dudgeonetal,MultidimensionalDigitalSignalProcessing,PrenticeHallProfessionalTechnical Reference,
1990.
4. WilliamK.Pratt,DigitalImageProcessing,JohnWiley,NewYork,2002
5. Milan Sonka et al,Image processing, analysis and machine vision, Brookes/Cole, Vikas Publishing House,
2nd edition, 1999
LECTURENOTES
UNITI-DIGITALIMAGEFUNDAMENTALS
Steps in Digital Image Processing – Components – Elements of Visual Perception – Image Sensing
and Acquisition – Image Sampling and Quantization – Relationships between pixels - Color image
fundamentals - RGB, HSI models, Two-dimensional mathematical preliminaries, 2D transforms -
DFT, DCT.
PART-A
1. Define Image
Image may be defined as two dimensional light intensity function f(x, y) where x
and y denote spatial co-ordinate and the amplitude or value of f at any point(x, y) is called
intensity or grayscale or brightness of the image at that point.
2. WhatisDynamicRange?
The range of values spanned by the gray scale is called dynamic range of an image.
Imagewillhavehighcontrast,ifthedynamicrangeishighandimagewillhavedullwashed out gray
look if the dynamic range is low.
3. Define Brightness
Brightness of an object is the perceived luminance of the surround. Two objects
with different surroundings would have identical luminance but different brightness.
4. WhatdoyoumeantbyGraylevel?
Graylevel refers to a scalar measure of intensity that ranges from black to grays and
finally to white.
5. DefineDigitalImage.
An image may be defined as a two dimensional function, f(x,y), where x and y are
spatial co-ordinates and f is the amplitude. When x,y and the amplitude values of f are all
finite, discrete quantities such type of image is called Digital Image.
6. WhatisDigitalImageprocessing?
The term Digital Image Processing generally refers to processing of a two
dimensional picture by a digital computer. i.e., processing of any two dimension data
7. DefineIntensity(or)graylevel.
An image may be defined as a two-dimensional function, f(x,y). the amplitude of fat
any pair off co-ordinates (x,y) is called the intensity (or) gray level off the image at that
point.
8. DefinePixel
A digital image is composed of a finite number of elements each of which has a
particular location value. The elements are referred to as pixels, picture elements, pels, and
image elements. Pixel is the term most widely used to denote the elements of a digitalimage.
9. WhatdoyoumeantbyColor model?
A Color model is a specification of 3D-coordinates system and a subspace within
that system where each color is represented by a single point.
10. Listthehardwareorientedcolormodels
1.RGBmodel,2.CMYmodel,3.YIQ model,4.HSImodel
49. Whatismeantbyilluminationandreflectance?
Illumination is the amount of source light incident on the scene. It is represented as
i(x, y).Reflectance is the amount of light reflected by the object in the scene. It is
represented by r(x, y).
50. Findthenumberofbitsrequiredtostorea 256X256imagewith32graylevels?
32graylevels =25=5bits, 256 * 256 * 5 =327680 bits.
51. Writetheexpressiontofindthenumberofbitstostoreadigitalimage
Thenumberofbitsrequiredtostoreadigitalimageis b=M
X N X k,
WhenM=N, thisequationbecomes
=N^2k
52. WhatdoyoumeantbyZoomingandshrinkingof digitalimages?
Zooming may be viewed as over sampling. It involves the creation of new pixel
locations and the assignment of gray levels to those new locations.
Shrinking may be viewed as under sampling. To shrink an image by one half, we
delete every row and column. To reduce possible aliasing effect, it is a good idea to blue an
image slightly before shrinking it.
53. Listoutthe propertiesof acosine transforms
a.Itisrealandorthogonal,b.isafasttransform
c.It is not the real part of the unitary DFT,d.ithas excellent energy compaction for
highly correlated data
MNx0y0
f(x,y)e-j2(ux/m+vy/N)
PowerSpectrum p(u,v)|F(u,v)|2
PART–B
1. Explainthefundamentalstepsindigitalimage processing
1. Image acquisition is the first process in the digital image processing. Note that
acquisition could be as simple as being given an image that is already in digital form.
Generally, the image acquisition stage involves pre-processing, such as scaling.
2. The next step is image enhancement, which is one among the simplest and most
appealing areas of digital image processing. Basically, the idea behind enhancement
techniques is to bring out detail that is obscured, or simply to highlight certain features of
interest in an image. A familiar example of enhancement is when we increase the contrastof
an image because “it looks better.” It is important to keep in mind that enhancement is a
very subjective area of image processing.
3. Image restoration is an area that also deals with improving the appearance of an image.
However, unlike enhancement, which is subjective, image restoration is objective, in the
sense that restoration techniques tend to be based on mathematical or probabilistic modelsof
image degradation. Enhancement, on the other hand, is based on human subjective
preferences regarding what constitutes a “good” enhancement result.i.e remove noise and
restores the original image
4. Color image processing is an area that has been gaining in importance because of the
significant increase in the use of digital images over the Internet. Color image processing
involves the study of fundamental concepts in color models and basic color processing in a
digital domain. Image color can be used as the basis for extracting features of interest in an
image.
5. Wavelets are the foundation for representing images in various degrees of resolution. In
particular, wavelets can be used for image data compression and for pyramidal
representation, in which images are subdivided successively into smaller regions.
6. Compression, as the name implies, deals with techniques for reducing the storage
required saving an image, or the bandwidth required transmitting it. Although storage
technology has improved significantly over the past decade, the same cannot be said for
transmission capacity. This is true particularly in uses of the Internet, which are
characterizedbysignificantpictorialcontent.Imagecompressionisfamiliar(perhaps
inadvertently) to most users of computers in the form of image file extensions, such as the
jpg file extension used in the JPEG (Joint Photographic Experts Group) image compression
standard.
7. Morphological processing deals with tools for extracting image components that are
useful in the representation and description of shape. The morphological image processingis
the beginning of transition from processes that output images to processes that output image
attributes.
8. Segmentation procedures partition an image into its constituent parts or objects. In
general, autonomous segmentation is one of the most difficult tasks in digital image
processing. A rugged segmentation procedure brings the process a long way toward
successful solution of imaging problems that require objects to be identified individually.On
the other hand, weak or erratic segmentation algorithms almost always guarantee eventual
failure. In general, themore accurate the segmentation, the morelikely recognition is to
succeed.
9. Representation and description almost always follow the output of a segmentation
stage, which usually is raw pixel data, constituting either the boundary of a region (i.e., the
set of pixels separating one image region from another) or all the points in the region itself.
10. Recognition is the process that assigns a label (e.g., “vehicle”) to an object based on its
descriptors. Recognition topic deals with the methods for recognition of individual objectsin
an image.
2. ExplaintheComponentsofanImageProcessingSystem
Figure shows the basic components comprising a typical general-purpose system
used for digital image processing. The function of each component is discussed in the
following paragraphs, starting with image sensing.
1. With reference to sensing, two elements are required to acquire digital images. The first
is a physical device that is sensitive to the energy radiated by the object we wish to image.
The second, called a digitizer, is a device for converting the output of the physical sensing
device into digital form. For instance, in a digital video camera, the sensors produce an
electrical output proportional to light intensity. The digitizer converts these outputs todigital
data.
2. Specialized image processing hardware usually consistsof the digitizer justmentioned,
plus hardware that performs other primitive operations, such as an arithmetic logic unit
(ALU) that performs arithmetic and logical operations in parallel on entire images. ALU is
used is in averaging images as quickly as they are digitized, for the purpose of noise
reduction. This unit performs functions that require fast data throughputs (e.g., digitizingand
averaging video images at 30 frames/s)
3. The computer in an image processing system is a general-purpose computer and can
range from a PC to a supercomputer. For dedicated applications,
4. Software for image processing consists of specialized modules that perform specific
tasks.
5. Mass storage capability is a must in image processing applications. An image of size
pixels, in which the intensity of each pixel is an 8-bit quantity, Digital storage for image
processing applications falls into three principal categories:
(1) Short-term storage for use during processing, (2) on-line storage for relatively fast recall,
and (3) archivalstorage, characterized by infrequentaccess. Storageis measured in
bytes(eightbits),Kbytes(onethousandbytes),Mbytes(onemillionbytes),Gbytes(meaning giga,
or one billion, bytes), and Tbytes (meaning tera, or one trillion, bytes).On-line storage
generallytakestheformofmagneticdisksoroptical-mediastorage.Thekeyfactor characterizing
on-line storage is frequent access to the stored data.
6. Image displays in use today are mainly color (preferably flat screen) TV monitors.
Monitors are driven by the outputs of image and graphics display cards that are an integral
part of the computer system.
7. Hardcopy devices for recording images include laser printers, film cameras, heat-
sensitive devices, inkjet units, and digital units, such as optical and CDROM disks. Film
provides the highest possible resolution,
8. Networking is almost a default function in any computer system in use today. Becauseof
the large amount of data inherent in image processing applications, the key consideration in
image transmission is bandwidth. Communications with remote sites via the Internet are not
always as efficient. Fortunately, this situation is improving quickly as a result of optical
fiber and other broadband technologies.
PurposeofImage processing:
Thepurpose ofimageprocessingisdividedinto5groups.Theyare:
1. Visualization-Observetheobjectsthatare notvisible.
2. Imagesharpeningand restoration- Tocreateabetter image.
3. Imageretrieval -Seekfortheimageof interest.
4. Measurementofpattern –Measuresvariousobjects inan image.
5. ImageRecognition–Distinguish theobjectsinanimage.
ImageProcessingTypes:
1. AnalogImage Processing:
Analog or visual techniques of image processing can be used for the hard
copies like printouts and photographs. Image analysts use various fundamentals of
interpretation while using these visual techniques. The image processing is not just
confined to area that has to be studied but on knowledge of analyst. Association is
another important tool in image processing through visual techniques. So analysts apply
a combination of personal knowledge and collateral data to image processing.
2. DigitalImage Processing:
Digital Processing techniques help in manipulation of the digital images by using
computers. As raw data from imaging sensors from satellite platform contains deficiencies.
To get over such flaws and to get originality of information, it has to undergo variousphases
of processing. The three general phases that all types of data have to undergo while using
digital technique are Pre- processing, enhancement and display, information extraction.
ApplicationsofImage Processing:
1. IntelligentTransportationSystems-
This technique can be used in Automatic number plate recognition and Traffic sign
recognition.
2. RemoteSensing-
For this application, sensors capture the pictures of the earth’s surface in remote
sensingsatellites ormulti– spectral scanner which ismounted onan aircraft. These pictures are
processed by transmitting it tothe Earth station.Techniques used tointerpret the objects and
regions are used in flood control, city planning, resource mobilization, agricultural
production monitoring, etc.
3. Movingobjecttracking-
This application enables to measure motion parameters and acquire visual record of
the moving object. The different types of approach to track an object are:
· Motionbasedtracking
· Recognitionbased tracking
4. Defensesurveillance–
Aerial surveillance methods are used to continuously keep an eye on the land and
oceans. Thisapplication isalsoused tolocatethetypes andformation ofnavalvesselsof the ocean
surface. The important duty is to divide the various objects present in the water body part of
the image. The different parameters such as length, breadth, area, perimeter, compactness are
set up to classify each of divided objects. It is important to recognize the distribution of these
objects in different directions that are east, west, north, south, northeast, northwest, southeast
andsouth west to explain allpossible formationsof the vessels.We can interpret the entire
oceanic scenario from the spatial distribution of these objects.
5. BiomedicalImagingtechniques-
For medical diagnosis, different types of imaging tools such as X- ray, Ultrasound,
computer aided tomography (CT) etc are used. The diagrams of X- ray, MRI, and computer
aided tomography (CT) are given below.
Raster formats
1. JPEG/JFIF
JPEG (JointPhotographicExpertsGroup)isacompressionmethod;JPEG-
compressedimagesareusuallystoredinthe JFIF (JPEGFileInterchangeFormat)file
format. JPEG compression is (in most cases) lossycompression .TheJPEG/JFIF filename
extension is JPG or JPEG.
2. JPEG2000
JPEG2000 is a compression standard enabling both lossless and lossy storage. The
compression methods used are different from theones instandard JFIF/JPEG;they improve
quality and compression ratios, but also require more computational power to process.JPEG
2000 also adds features that are missing in JPEG.
3. TIFF
The TIFF (Tagged Image File Format) format is a flexible format that normally
saves 8 bits or 16 bits per color (red, green, blue) for 24-bit and 48-bit totals, respectively,
usually using either the TIFF or TIF filename extension.TIFFs can be lossy and lossless;
4. GIF
GIF (Graphics Interchange Format) is limited to an 8-bit palette, or 256 colors. This
makes theGIF format suitablefor storinggraphics withrelatively few colors such as simple
diagrams, shapes, logos and cartoon style images.
5. BMP
The
BMPfileformat (Windowsbitmap)handlesgraphicsfileswithinthe
Microsoft Windows OS. Typically, BMP files are uncompressed, hence they are large; the
advantage is their simplicity and wide acceptance in Windows programs.
6. PNG
The PNG (Portable Network Graphics) file format was created as the free, open-
source successor to GIF. The PNG file format supports 8 bit paletted images (with optional
transparency for all palette colors) and 24 bit truecolor (16 million colors).
3. Explain the principle and working of Vidicon digital camera with neat diagram
(Image sensing and Acquisition)
A digital camera is used to convert the optical information into a corresponding
electrical signal, the amplitude which varies in accordance with the variations of brightness.
Photoelectric Effects
The two photoelectric effects used for converting variations of light
intensity into electrical variations are (i) photoemission and (ii) photoconductivity.
Photo emission: Certain metals emit electrons when light falls on their surface.
These emitted electrons are called photoelectrons and the emitting surface a photocathode.
Light consists of small bundles of energy called photons. When light is made incident on a
photocathode, the photons give away their energy to the outer valence electrons to allow
them to overcome the potential-energy barrier at the surface. The number of electronswhich
can overcome the potential barrier and get emitted depends on the light intensity. Alkali
metals are used as photocathode because they have very low work-function. Cesium- silver
or bismuth-silver-cesium oxides are preferred as photo emissive surfaces becausethey are
sensitive to incandescent light and have spectral response very close to the human eye.
Photo conductivity:-The second method of producing an electrical image is by
photoconduction, where the conductivity or resistivity of the photosensitive surface variesin
proportion to the intensity of light focused on it. In general the semiconductor metals
including selenium, tellurium and lead with their oxides have this property known as
photoconductivity. The variations in resistance at each point across the surface of the
material are utilized to develop a varying signal by scanning it uniformly with an electron
beam
Fig-Photoemission
Fig-Photoconductivity
Typesofcamera tubes: 1)orthicon 2)vidicon 3)Plumbicon.
Vidicondigitalcamera:-
The principle of operation is photoconductivity. The resistance of the target
decreases when exposed to light. The target consists of a thin photo conductive layer of
either selenium or antimony compounds. This is deposited on a transparent conducting film
coated on the inner surface of the face plate. This coating is called plate. Image side ofphoto
layer is connected with the signal electrode and is connected to DC supply through a load
resistance R. The beam that emerges from the electron gun is focused on the surface of the
photo conductive layer by the combined action of magnetic field of an external coil and
electrostatic field of grid 3.Grid 4 provides decelerating action so that the electrons hit the
photo conductive layer with very less speed to prevent secondary emission. Deflection ofthe
beam is done by the deflection coils placed around the tube.
Threesectionsofimageorthiconare
1.Imagesection2.Scanningsection3.electrongun multiplier.
1. Image section:-Inside of glass face plate at the front is coated with a silver antimony
coating added with cesium, which acts as photocathode. Light from the scene being
televised are focused on to photocathode surface and electrons are released from each point
on photocathode in proportion to incident light intensity coming from the image. The
distributionof electron generation depends on the brightness levels at different points of the
picture .The electron image of the scene gets formed on the target side of the photo coating
and extends towards the target. Target plate is very thin sheet of glass and can store the
received charges. Target plate is 400V more positive wrt photocathode, and this causes
acceleration of emitted electrons towards it.
The electron in motion has a tendency to repel each other, which may cause
distortion in picture. To avoid this magnetic field is applied using a long focus coil. The
magnetic coil focuses the emitted electrons on the target to get well defined electron image.
Theimage sideof thetarget has a small depositofcesium and has high secondary emission.
When electron image with high velocity hits the target secondary emission results. These
secondary electrons are collected by a wire mesh screen, which is in front of the target on
the image side and is maintained at a higher potential wrt target. Secondary emission leaves
behind a positive charge distribution on the target plate.
The target plate is made up of thin glass, this retards the positive charge
degradation and hence positive charge on the target plate build up. Due to high secondary
emission theintensity of positivecharge distribution is four to five times more, compared to
the charge liberated by the photocathode. Increase in charge density at target compared to
charge liberated at photocathode is known as image multiplication and increases the
sensitivity of image orthicon. Target plate should have high resistivity laterally for storage
action and low resistivity along its thickness for positive charge to conduct to other side
which is scanned. This is the reason why the target plate is thin. Whatever charge
distribution builds up on one side of target plate appears on the other side which is scanned.
2. Scanning section: Electron gun produces the beam focused using magnetic fields
applied to grid 2, 3, 4.Alignment coil provides magnetic field that can be varied to adjustthe
position of the scanning beam to correct location. Deflection is by scanning fields of
horizontal & vertical deflection coils mounted at yoke. These coils are connected to
deflection sweep circuits. Grid 4 voltage decelerates the electron beam this prevents
secondary emission from target. The electron beam strikes the target plate and the electrons
from beam gets divided into two sets.1) certain electrons neutralize the positive charged
areas of the target.2) certain electrons turns back and is called as signal current. Resultant
beamthatturnsbackaremaximumforblackareasandminimumforbrightareas.The
electrons hitting the screen may cause stray electron field &may grid tangentially whichmay
cause defocusing and loss resolution. The beam should strike at right angles with screen.
3. Electron gun multiplier. When the surface of a metal is bombarded by incident
electronshavinghigh velocitiessecondary emissionstakes place. Cameratubes makeuseof
secondary emissions toamplify small amount of photoelectric current that is later employed
to develop video signal. The electron multiplier is a collection of anode cathode electrodes
called dynodes. The electrons are accelerated by the positive potential of the dynode. The
number of electrons available is multiplied each time the secondary electron strikes the
emitting surface of the next positive dynode. The current amplification is noise free as it
does not have any active or passive components.
Fig-Dgitalcamera(VIDICON)
Fig-Digitalcamera(VIDICON)
Light from the scene is focused on a photosensitive surface known as the image
plate, and the optical image thus formed with a lens system represents light intensity
variations of the scene. The photoelectric properties of the image plate then convertdifferent
light intensities into corresponding electrical variations. In addition to this photoelectric
conversion whereby the optical information is transduced to electrical charge distribution on
the photosensitive image plate, it is necessary to pick-up this information as fast as possible
4. ExplaininDetailthestructure oftheHuman eyeandalsoexplaintheimage
formation in the eye. (OR) Explain the Elements of Visual Perception.
VisualPerception:Means howan image isperceivedbya humanobserver
TheShapeofthehumaneyeisnearlyaspherewithanAveragediameter=20mm.It has 3
membranes:
1. CorneaandSclera–outercover
2. Choroid
3. Retina-enclose theeye
Cornea:tough, transparenttissuecoverstheanteriorsurfaceoftheeye.
Sclera:Opaquemembrane,encloses theremainderof theoptic globe
Choroid: Lies below the sclera .It contains a lot of blood vessels providing nutrition to the
eye. The Choroid coat is heavily pigmented and hence helps to reduce the amount of
extraneous light entering the eye and the backscatter within the optical globe. At theanterior
part, the choroid is divided into Ciliary body and the Iris diaphragm.
StructureoftheHumanEye:
The Iris contracts or expands according to the amount of light that enters into the
eye. The central opening of the iris is called pupil, which varies from 2 mm to 8 mm in
diameter.
Lens is made of concentric layers of fibrous cells and is suspended by fibers that attach to
the Ciliary body. It contains 60-70% of water, 6 % fat and more protein. Lens is colored by
yellow pigment which increases with eye. Excessive clouding of lens can lead to poor or
loss of vision, which is referred as Cataracts.
Retina: Innermost membrane of the eye which lines inside of the wall’s entire posterior
portion.Whentheeye isproperly focused, light froman objectoutside theeye isimaged on the
retina. It consists of two photo receptors.
Receptors are dividedinto2classes:
1. Cones
2. Rods
1. Cones: These are 6-7 million in number, and are shorter and thicker. These are located
primarily in the central portion of the retina called the fovea. They are highly sensitive to
color.
Eachisconnectedtoitsownnerve endandthusthehumancanresolvefine details.
Conevisioniscalled photopicorbright-light vision.
2. Rods:These are75-150millioninnumberandare relatively longandthin.
These are distributed over the retina surface. Several rods are connected to a single nerve
end reduce the amount of detail discernible. Serve to give a general, overall picture of the
field of view.
These are Sensitivetolowlevels of illumination.Rodvisionis called scotopicor dim-light
vision.
Thefollowingshowsthedistributionofrodsandconesintheretina
Herealltheinnersquareshavethesameintensity,buttheyappearprogressively
brighter as the background becomes lighter
5. Writeshortnoteson(i)luminance,(ii)hueortint,and(iii)saturation,iv)Brightness
v)Contrast
Any color has three characteristics to specify its visual information. These are (i)
luminance,(ii) hue or tint, and (iii) saturation. These are defined as follows:
(i) Luminance
This is the amount of light intensity as perceived by the eye regardless of the color.
In black and white pictures, better lighted parts have more luminance than the dark areas.
Different colours also have shades of luminance in the sense that though equallyilluminated
appear more or less bright. Thus on a monochrome TV screen, dark red colour will appear
as black, yellow as white and a light blue colour as grey.
(ii) Hue
This is the predominant spectral colour of the received light. Thus the colour of any
object is distinguished by its hue or tint. The green leaves have green hue and red tomatoes
have red hue. Different hues result from different wavelengths of spectral radiation and are
perceived as such by the sets of cones in the retina.
(iii) Saturation
This is the spectral purity of the colour light. Since single hue colours occur rarely
alone, this indicates the amounts of other colours present. Thus saturation may be taken as
an indication of how little the colour is diluted by white. A fully saturated colour has no
white. vivid green is fully saturated and when diluted by white it becomes light green. The
hue and saturation of a colour put together is known as chrominance. Note that it does not
contain the brightness information. Chrominance is also called chroma.
(iv) Brightness:
Brightness is the overall or average intensity of illumination and it determines
backgroundlight level inthe reproduced picture. The brightnesscontrol can be varied toget
average illumination of the scene.
(ii) Contrast:
Contrast is the difference in light intensity between black and white parts of thepicture
and above the average brightness level. Too much contrast makes the picture hard white
little contrast gives the impression of a washed out picture.
6. ExplaintheColorimagefundamentals(models)withneatdiagram
According to the theory of the human eye, all colors are seen as variable combinations
of the three so-called primary colors red (R), green (G), and blue (B). The followingspecific
wavelength values to the primary colors:
Blue (B) =435.8nm
Green (G)= 546.1 nm
Red(R) =700.0 nm
Theprimarycolorscan beaddedtoproduce thesecondarycolors
Magenta (red +blue), cyan(green+blue), andyellow(red + green),see Figure
B
Blue(0,0,1) Cyan
Magenta
White
Black (0,1,0)
G
Green
(1,0,0)
Red Yellow
R
Figure-RGBcolor cube.
Mixing all the three primary colors results in white. Color television reception is based
on this three color system with the additive nature of light.
Thereareseveralusefulcolormodels:RGB,CMY,YUV, YIQ,and HSI.
1. RGBcolormodel
ThecolorsoftheRGBmodelcanbedescribedasatriple(R,G,B),sothat R, G, B .The RGB
color space can be considered as a three-dimensional unit cube, in which each axis
represents one of the primary colors, see Figure. Colors are points inside the cube defined
by its coordinates. The primary colors thus are red=(1,0,0), green=(0,1,0), and blue=(0,0,1).
The secondary colors of RGB are cyan=(0,1,1), magenta=(1,0,1) and yellow=(1,1,0).
The nature of the RGB color system is additive in the sense how adding colors
makes the image brighter. Black is at the origin, and white is at the corner where
R=G=B=1. The gray scale extends from black to white along the line joining these two
points. Thus a shade of gray can be described by (x,x,x) starting from black=(0,0,0) to
white=(1,1,1).
Thecolors areoften normalizedas giveninequation .Thisnormalizationguarantees that
r+g+b=1.
R
r g
RBG
G
RBG
B
b
RBG
2. CMYcolormodel
The CMY color model is closely related to the RGB model. Its primary colors are C
(cyan), M (magenta), and Y (yellow). I.e. the secondary colors of RGB are the primary
colors of CMY, and vice versa. The RGB to CMY conversion can be performed by
C1R
M1G
Y1B
The scale of C, M and Y also equals to unit: C, M, Y .The CMY color system is used in
offset printingin a subtractive way, contrary to theadditive nature of RGB. A pixel of color
Cyan,forexample,reflectsalltheRGBothercolorsbutred.Apixelwiththecolorof
magenta, on the other hand, reflects all other RGB colors but green. Now, if we mix cyan
and magenta, we get blue, rather than white like in the additive color system.
ADDITIVECOLOURMIXING:
In order to generate suitable colour signals it is necessary to know definite ratios in which
red, green and blue combine form new colours. Since R,G and B can be mixed to create any colour
including white, these are called primary colours.
R+G+B=Whitecolour R –
G – B = Black colour
TheprimarycoloursR,GandBcombinetoformnewcolours R + G
=Y
R + B = Magenta (purplish)
G+B=Cyan(greenishblue)
GRASSMAN’SLAW:
Our eye is not able to distinguish each of the colours that mix to form a new colour but
instead perceives only the resultant colour. Based on sensitivity of human eye to various colours,
reference white for colour TV has been chosen to be a mixture of colour light in the ratio
100%W=30%R+59%G+11%B
Similarly yellow can be produced by mixing 30% of red and 59% of green, magenta by
mixing 30%of red and 11% ofblue and cyan by mixing 59% of green to 11% of blue. Base on this it
is possible to obtain white light by mixing 89% of yellow with 11% of blue or 70% of cyan with
30% of red.
Thus the Eye perceives new colours based on the algebraic sum of red, green and blue light
fluxes. This forms the basic of colour signal generation and is known as GRASSMAN’S LAW.
3. YUVcolor model
The basic idea in the YUV color model is to separate the color information apart
from the brightness information. The components of YUV are:
Y0.3R0.6G0.1B
UBY
VRY
Yrepresentstheluminanceoftheimage,whileU,Vconsistsofthecolor
information, i.e. chrominance. The luminance component can be considered as a gray-scale
version of the RGB image, The advantages of YUV compared to RGB are:
1. Thebrightnessinformationisseparatedfromthecolor information
2. Thecorrelationsbetweenthecolor componentsare reduced.
3. Most of the information is collected to the Y component, while the information
content in the U and V is less. where the contrast of the Y component is much greater
than that of the U and V components.
The latter two properties are beneficial in image compression. This is because the
correlations between the different color components are reduced, thus each of the
components can be compressed separately. Besides that, more bits can be allocated to the Y
component than to U and V. The YUV color system is adopted in the JPEG image
compression standard.
3. YIQcolormodel
YIQ is a slightly different version of YUV. It is mainly used in North American
television systems. Here Y isthe luminance component, justas in YUV. I and Q correspond
to U and V of YUV color systems. The RGB to YIQ conversion can be calculated by
Y0.299R0.587G0.114B
I0.596R 0.275G 0.321B
Q0.212R0.523G 0.311B
TheYIQcolormodelcan alsobedescribed correspondingtoYUV:
Y0.3R0.6G0.1B
I 0.74V 0.27U
Q0.48V0.41U
4. HSIcolormodel
TheHSImodelconsistsofhue(H),saturation(S),andintensity(I).
Intensity correspondstotheluminancecomponent(Y)oftheYUVandYIQmodels.
Hueisanattributeassociatedwiththedominantwavelengthinamixtureoflight waves, i.e.
the dominant color as perceived by an observer.
Saturation refers to relative purity of the amount of white light mixed with hue. The
advantages of HSI are:
The intensity is separated from the color information (the same holds for the
YUVand YIQ models though).
Thehueandsaturationcomponentsareintimatelyrelatedtothewayinwhich human
beings perceive color.
TheRGBtoHSIconversioncanbe summarizedasfollows:
1 1RGRB
H cos
1 2 ,if BG
360∘
RG RB GB
2
1 1RGRB
H1 cos
1 2 ,otherwise
360∘
RG RBGB
2
3
S=1- minR,G,B
RGB
1
I RGB
3
Table-Summaryofimagetypes.
Imagetype Typicalbpp No.ofcolors Common file formats
Binaryimage 1 2 JBIG,PCX,GIF,TIFF
Gray-scale 8 256 JPEG,GIF,PNG,TIFF
Colorimage 24 16.6 10 6
JPEG,PNG,TIFF
Color palette 8 256 GIF,PNG
image
Video image 24 16.6 106 MPEG
7. Discuss the role of sampling and quantization in the context of image encoding
applications.
ImageSamplingandQuantization:
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 digital form.This involves two processes; sampling and
quantization.
BasicConcepts inSamplingandQuantization:
The basic idea behind sampling and quantization is illustrated in figure, figure (a)
shows continuous image,(x, y), 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 convert it to
digital form, we have to sample the function in both coordinates and in amplitude,Digitizing
the coordinate values is called sampling.Digitizing the amplitude values is called
quantization.
The one dimensional function shown in figure (b) is a plot of amplitude (gray level)
values of the continuous image along the line segment AB in figure (a).The random
variations are due to image noise.To sample this function, we take equally spaced samples
along line AB, as shown in figure (c).The location of each sample is given by a vertical tick
mark in the bottom part of the figure.The samples are shown as small white squares
superimposed on the function.The set of these discrete locations gives the sampled
function.However, the values of the samples still span (vertically) a continuous range of
gray-level values.In order to form a digital function, the gray-level values also must be
converted (quantized) into discrete quantities.The right side of figure (c) shows the gray-
level scale divided into eight discrete levels, ranging form black to white.The vertical tick
marks indicate the specific value assigned to each of the eight gray levels.The continuous
gray levels are quantized simply by assigning one of the eight discrete gray levels to each
sample.The assignment is made depending on the vertical proximity of a sample to a
vertical tick mark.The digital samples resulting from both sampling and quantization are
shown in figure (d).Starting at the top of the image and carrying out this procedure line by
line produces a two dimensional digital image.
Sampling in the manner just described assumes that we have a continuous image in
both coordinate directions as well as in amplitude.In practice, the method of sampling is
determined by the sensor arrangement used to generate the image.When an image is
generated by a single sensing element combined with mechanical motion, as in figure, the
output of the sensor is quantized in the manner described above.However, sampling is
accomplished by selecting the number of individual mechanical increments at which we
activate the sensor to collect data.Mechanical motion can be made very exact so, in
principle, there is almost no limit as to how fine we can sample and image.However,
practical limits are established by imperfections in the optics used to focus on the sensor an
illumination spot that is inconsistent with the fine resolution achievable with mechanical
displacements.
Figure: Generating a digital image. (a) Continuous image. (b) A scan line from A to B
inthecontinuousimage,usedtoillustratetheconceptsofsamplingandquantization.
(c)Samplingandquantization.(d)Digitalscan line.
When a sensing strip is used for image acquisition, the number of sensors in thestrip
establishes the sampling limitations in on image direction.Mechanical motion in the other
direction can be controlled more accurately, but it makes little sense to try to achieve
sampling density in one direction that exceeds the sampling limits established by thenumber
of sensors in the other.Quantization of the sensor outputs completes the process of
generating a digital image.
Quantization
Thisinvolvesrepresentingthesampleddatabyafinitenumberoflevelsbasedonsome criteria such
as minimization of the quantizer distortion, which must be meaningful.
Quantizer design includes input (decision) levels and output (reconstruction) levels as well
as number of levels. The decision can be enhanced by psychovisual or psychoacoustic
perception.
Quantizers can be classified as memory less (assumes each sample is quantized
independently or with memory (takes into account previous sample)
Alternative classification of quantisers is based on uniform or non- uniform quantization.
They are defined as follows.
Uniformquantizers Non-uniformquantizers
8. Explain2DSampling theory
Digitization
u(m,n) D/A
Computer Display
Fig1Image samplingandquantization /Analogimage display
Thecommonsamplinggridisuniformlyspaced,rectangulargrid.
Imagesampling=readfromtheoriginal,spatiallycontinuous,brightnessfunctionf(x,y), only
in the black dots positions (only where the grid allows):
Samplingconditionsfornoinformationloss–derivedbyexaminingthespectrumofthe image
by performing the Fourier analysis:
SaveethaEngineering College 29
Thespectrumof alimited bandwidthimageanditsspectralsupport
Since the sinc function has infinite extent => it is impossible to implement in practice the
ideal LPF it is impossible to reconstruct in practice an image from its samples without error
if we sample it at the Nyquist rates
9. ExplainUniformQuantizationandNon-UniformQuantization
1. Non-UniformQuantization:
Max Lloyd Quantizer
GiventherangeofinputuasfromaLtoa u ,andthenumberofoutputlevelsasL,
wedesignthe quantizersuchthatMSQEisminimum.
Lettk=decisionlevel(i/p level)andrk=reconstlevel (o/p level)
Iftk utk1 thenu'Qurk and𝑒엸uu'
MSQEE pudu1
2
2
tk
where pu=Probabilitydensityfunctionofrandomvariableu
Theerrorcan alsobewrittenas
Ltk1 2
urk pudu2
k1tk
randtarevariables.Tominimizeweset
0
rk tk
k k
Findt k:
u =tk, u’= rk
Ltk1 2 tk 2 tk1 2
tk k1
tk rk1 p(tk)dtk tk rk ptk dtk 4
tk t tk
2tk rk1 pt k tk rk ptk 0
2
tkrk1tkrk
Sincetkrk10andtkrk0solutionthatisvalidis
tkrk1tkrkortkrkrk1/25
i.e.inputlevelisaverage oftwoadjacentoutput levels.
Find rk
d
tk1
r4=224
Reconstructionlevels
r3=160
r2=96
r1=32
Sincequantizationerrorisdistributeduniformlyovereachstepsize(q)withzeromeani.e.
overq/2,q/2,thevarianceis,
e
q/2
2 e 2 p(e)de1
q/2
q/2
1 e 2 deq2/122
qq/2
e
2
u u2p(u)du3
2
A/2
1
A/2
Then A 2u
u2duA2/12 4
A/2
Ab-bitquantizercanrepresentLoutputlevelsas2bLquantizationstepsize
A
q .
2b
1
Hence2 e A2 /22b;5 12
SNRforuniformquantizerindB=10log( 2/2) 22b6bdB ------- 6
u e
PropertiesofoptimumMean squarequantizers:.
1. Thequantizeroutputisan unbiasedestimateof input i.e. Eu'Eu
SNRfor uniformquantizerincreasesby 6dB/bit
2. The quantizer error is orthogonal to the quantizer output i.e.,
Euu'u'0quantizationnoiseis uncorrelatedwithquantized output.
3. The variance of quantizero pis reduced by the factor1fBwhere fBdenotes
themeansquaredistortionoftheB-bitquantizerforunityvarianceinputs.
i.e.2'1f(B)2
u u
4. It is sufficient to design mean square quantizers for zero mean and unity variance
distributions.
10. Explainindetailthewaystorepresentthedigitalimage.
Assume that an image (x,y) is sampled so that the resulting digital image has M
rows and N columns.The values of the coordinates (x,y) now become discrete quantities.
For notational clarity and convenience, we shall use integer values for these discrete
coordinates.Thus, the values of the coordinates at the origin are (x,y) = (0,0).The next
coordinate values along the first row of the image are represented as (x,y) = (0,1 Figure
shows the coordinate convention used.
Figure:Coordinateconventionusedinthisbooktorepresentdigitalimages.
The notation introduced in the preceding paragraph allows us to write the complete
M X N digital image in the following compact matrix from:
f(0,0)
f(1,0) f(0,1) … f(0,N1)
f(1,1) f(1,N1)
f
(x,y) ⁝ ⁝
f(M1,0) f(M1,1) ⁝
f(M1,N1)
The right side of this equation is by definition a digital image.Each element of this
matrixarrayiscalledanimageelement,pictureelement,pixel.orpel.Thetermsimage
and pixel will be used throughout the rest of our discussions to denote a digital image
andits elements.
In some discussions, it is advantageous to use a more traditional matrix notation to denote a
digital image and its elements:
a ao,1 a0,N1
a 0,0
a a
A 1,0 1,1 1,N1
⁝ ⁝ ⁝
a a a
M1,0 M1,1 M1,N1
11. Write short notes on:(a) Neighbors of Pixels (b) Distance Measures c.
Connectivity d. Adjacency
1. Neighborsofapixels:
A pixel p at coordinates (x, y) has four horizontaland vertical neighbors whose coordinates
are given by (x + 1, y), (x -1, y), (x, y +1), (x, y -1)
This set of pixels, called the 4-neighbors of p, is denoted by N4(p). Each pixel is
aunitdistancefrom(x, y), and someoftheneighbors ofplieoutsidethedigital imageif(x,y) is on
the border of the image.
Thefour diagonalneighborsofphavecoordinates
2. DistanceMeasures;
For pixels p, q, and z, with coordinates (x, y), (s, t), and (, w), respectively, Dis a distance
function or metric if
(a) D(p,q)0 (D (p, q)= 0 iffp =q),
(b) D(p,q) =D(p,q),and
(c) D(p,z)D(p,q) +D( q, z).,
TheD4distance(alsocalledcity-blockdistance)between pandqisdefinedas
In this case, the pixels having a D4distance from (x, y) less than or equal to some
value r form a diamond centered at (x, y). For example, the pixels with D4distance 2from
(x, y) (the center point) form the following contours of constant distance:
2
2 1 2
2 1 0 1 2
2 1 2
2
TheD8distance(alsocalledchessboarddistance)betweenpandqisdefinedas
In this case, the pixels with D8distance from (x, y)less than or equal to some value r forma
square centered at (x, y). For example, the pixels with D, distance 2 from (x, y) (the center
point) form the following contours of constant distance.
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
3. Connectivity
0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 0 0 1
V{1}:ThesetVconsists ofpixelswithvalue1.
TwoimagesubsetsS1,S2areadjacentifatleastonepixelfrom S1andonepixelfrom S2are adjacent.
12. WriteshortnotesontwodimensionalOrthogonalandUnitarytransforms
Two dimensional unitary transforms play an important role in image processing.The
termimagetransformreferstoaclassofunitarymatricesusedforrepresentationof
images.
In analogy, with I-D signals that can be represented by an orthogonal series of basis
functions, we can similarly represent an image in terms of a discrete set of basis arrays
called “basis images”.These are generated by unitary matrices.
Alternativelyan (NN) imagecanberepresentedas (N21)vector. Animage
transformprovidesasetof coordinatesor basisvectorsforthevectorspace.
I-D-Transforms:
Foraonedimensional sequence u(n), n0,1 ....... N1 representinga
vectoruofsizeN ,aunitary transformis:v=Au
N1
v(k)= a(k,n)u(n),for 0KN1 (1)
n0
T*T
where A1= A* (unitary)
T
Thisimplies, u=A* v
N1
or, u(n) = v(k)a*(k,n) ,for 0nN1 (2) Equation
k0
(2)canbe viewedas aseriesrepresentationofsequenceu(n).The columnsof
→
T
A* i.ethevectors *ak a*(k,n), 0n N1T arecalled the“basisvectors”of
A.
Theseriescoefficientsv(k)givearepresentationoforiginalsequenceu(n)andareusefulin compression ,
filtering , feature extraction and other analysis.
TwodimensionalOrthogonalandUnitary transforms:
Asappliedtoimageprocessing, ageneralorthogonalseries expansionforan
NNimageis apairoftransformationsoftheform:
N1
v(k,l)= u(m,n)ak,l(m,n) ,0k,lN1 (3)
m,n0
u(m,n)= N1 v(k,l)a* (m,n), 0m,nN1 (4)
k,l
k,l0
whereak,l(m,n) iscalledan”image transform.”
Itisa setofcompleteorthogonaldiscretebasisfunctionssatisfying the properties:-
N1
1) Orthonormality: ak,l(m,n)a*// (m,n)
m,n0 k,l
=δ(kk,ll)
N1
2) Completeness: a (m,n)ak (m,n)
k,l k,l
k,l0
=δ(mm,nn)
Theelementsv (k,l)aretransformcoefficients andVv(k,l) isthetransformed
image.
Theorthonomalitypropertyassures
Q1 thatanytruncated seriesexpansionofthe form
*
U (m,n) P1 v(k,l)a (m,n) ,forPN,
P,Q k,l
k0 l0
QN
willminimizethesumofsquareserror 2
σ2 N1 u(m,n)U (m,n)
e P,Q
m,n0
wherecoefficientsv(k,l)are givenby(3).
Thecompletenesspropertyassuresthat thiserrorwill bezero for PQN
SeparableUnitary Transforms:
Thenumber ofmultiplicationsandadditionsrequiredtocomputetransformcoefficients
v(k,l)inequation(3)isO(N4).Thisistoolargeforpracticalsizeimages. If the
transform is restricted to be separable,
i.e ak,l(m,n)ak(m)bl(n)
a(k,m)b(l,n)
where ak (m),k0(1)n1,
and bl(n),l0(1N1 are1Dcomplete orthogonalsetsof basisvectors.
OnimpositionofcompletenessandorthonormalitypropertieswecanshowthatA
a(k,m),
and B b(l,n) areunitary matrices.
T T
i.e AA* =I= ATA*and BB* =I= BTB*
OftenonechoosesBsameasA
N1
v(k,l)= a(k,m)u(m,n)a(l,n)
m,n0
V=AUA T
(5)
N1 *
*
And u(m,n)= a (k,m)v(k,l)a (l,n)
k,l0
T
U= A* VA* (6)
Eqn(5)canbewrittenasV T =A(AU)T
Eqn(5)canbeperformedbyfirsttransformingeachcolumnof Uandthen
transforming each row of the result to obtain rows of V.
→ T
BasisImages:Let a* denote kth columnof A* .
k
→ T
Letusdefinethematrices A*k,
l akal
**
andmatrix innerproduct oftwoNN matrices
FandGas
N1
F,G= f(m,n)g*(m,n)
m,n0
Thenequ (6)and(5)giveaseriesrepresentation.
N1 *
U= v(k,l)A
k,l
k,l0
13. Explainthe2-DDFTtransformations
ThetwodimensionalDiscreteFourierTransform(2-DDFT)
Iff(x,y)isan MN array,suchasthatobtainedbysamplingacontinuousfunctionof
twodimensionsatdimensions MandN onarectangulargrid,thenitstwodimensional
DiscreteFouriertransform (DFT)isthearray givenby
1 M1 N1
j2(ux/Mvy/N)
F(u,v) f(x, y)e
MN x0 y0
u0,…,M1, v0,…,N1
andtheinverseDFT
M1N1 (IDFT)is
f(x,y) F(u,v)ej2(ux/Mvy/N)
u0v0
Whenimagesaresampledinasquarearray,
N1N1
MN and
F(u,v) 1 f(x,y)e j2(uxvy)/N
N x0y0
N1N1
f(x,y) 1 j2(uxvy)/N
F(u,v)e
Nu0v0
ItisstraightforwardtoprovethatthetwodimensionalDiscreteFourierTransformis separable,
symmetric and unitary.
14. ExplainindetailthediscreteCosineTransform(DCT)andalsoexplainits properties.
The NX Ncosine transform matrixC = {c (K, n)},also called thediscrete cosine transform
(DCT), is defined as
1
, k0,0nN1
N
C(k,n)=
2 cos(2n1)k, 1kN1,0 nN1
N 2N
Theone dimensionalDCTof asequence{u (n),0n N-1}isdefined as
N1
(2n1)k
(k)=(k)u(n)cos , 0kN1
2N
n0
Where
1 2
(0) , (k) for1kN1
N N
Theinversetransformationisgiven by
N1
(2n1)k
U(n) =(k)(k)cos , 0nN1
2N
k0
(N/2)1 (4n1)k
u(2n)cos 2N
(k) =(k) n0 (4n3)k
u(2n1)cos
(N/2)1
n0 2N
(N/2)1 (4n1)k
u(n)cos
2N
n0
(k) (N/2)1 (4n3)k
u(Nn1)cos
n0 2N
Changing theindex of summationin the second term to n’= N–n – 1 and combining terms,
we obtain
(k)(k) N1 (4n1)k
n0 u(n)cos 2N
Re j2kn/N
jk/2N N1 k/2
(K)e n0
Re (k)W
u(n)e 2N DFT{u(n)}N
Whichprovesthe previouslystatedresultForinversecosinetransformwewriteforeven data
points as
N1
u(2n)u‸ ( 2n) Re (k)(k)ej/2Nej2nk/N ,
k0
N
0n 1
2
Theodddata pointsare obtainedbynothing that
N
U(2n+1) =u‸[2(n– 1–n)], 0n - 1
2
Therefore, if we calculate the N-point inverse FFT of the sequence (k) (k) exp
(jk/2N), we can also obtain the inverse DCT in O (N log N) operations.Direct algorithms
that do not require FFT as an intermediate step, so that complex arithmetic is avoided, are
also possible [18].The computational complexity of the direct as well as the FFT based
methods is about the same.
4. The cosine transform has excellent energy compaction for highly correlated data.This is
due to the following properties.
5. The basis vectors of the cosine transform (that is, rows of C) are the eigenvectors of the
symmetric tridiagonal matrix Qc, defined as
1 0
Qc 1 1
0 1
6. The N X N cosine transform is very close to the KL transform of a first-order stationary
Markov sequence of length N whose covariance matrix is given by when the correlation
parameter iscloseto1.The reasonisthatR-1isasymmetric tridiagonal matrix,whichfor
ascalar2 (12)/(12)and /(12)satisfies the relation
1 0
R
2 1
1 1
0 1
Thisgivestheapproximation R QCfor1
2 -1
Hence the eigenvectors of R and the eigenvectors of Q c, that is, the cosine transform,
will be quite close.These aspects are considered in greater depth in Section on sinusoidal
transforms.
This property of the cosine transform together with the fact that it is a fast transform
has made it a useful substitute for the KL transform of highly correlated first order Markov
sequences.
UNITIIIMAGEENHANCEMENT
Spatial Domain: Gray level transformations – Histogram processing – Basics of Spatial Filtering–
Smoothing and Sharpening Spatial Filtering, Frequency Domain: Introduction to FourierTransform–
Smoothing and Sharpening frequency domain filters – Ideal, Butterworth and Gaussian filters,
Homomorphic filtering, Color image enhancement.
PARTA
1. DefineImage Enhancement.
Image enhancement is a process an image so that the result is more suitable than the
original image for specific application. Image enhancement is useful in feature extraction,
image analysis and visual information display.
2. Whatarethe twocategoriesofImageEnhancement?
ImageEnhancement approaches fallsintotwobroad categories:theyare
1. Spatialdomainapproaches
2. Frequencydomainapproaches
i) Spatial domain refers to image plane itself & approaches in this category are
based on direct manipulation of picture image.
ii) Frequencydomainmethodsbasedonmodifyingtheimage byFouriertransform.
3. WritethetransferfunctionforButterworthfilter. (May/June2009)
Thetransferfunctionfora ButterworthLowpass filteris,
1 2n
H(u,v)
D(u,v)
1
Do
ThetransferfunctionforaButterworthHigh passfilter is,
1
H (u ,v) 2n
Do
1
D (u,v)
Where,n=filterorder,Do=cutofffrequencyandD(u,v)=
2 2 1/2
(u +v ) = distance from point (u,v) to the origin
4. Specifytheobjectiveofimageenhancementtechnique.(Or)Whytheimage
enhancement is needed in image processing technique. (May / June 2009)
1. The objective of enhancement technique is to process an image so that the
result is more suitable than the original image for a particular application.
2. Image Enhancement process consists of a collection of technique that seek to
improve the visual appearance of an image. Thus the basic aim is to make the image look
better.
3. Image enhancement refers to accentuation or sharpening of image features suchas
edges, boundaries or contrast to make a graphic display more useful for display and
analysis.
4. Image enhancement includes gray level and contrast manipulation, noise
reduction, edge crispening & sharpening, filtering, interpolation & magnification, pseudo
coloring, so on…
5. Mentionthevariousimageenhancementtechniques.
a. Pointoperationsor basicgrayleveltransformations
a) Contrast stretching
b) Noise clipping
c) Windowslicing
d) Histogrammodeling
b. Spatialdomainmethods
a) Noise smoothing
b) Median filtering
c) LP,HP,BPfiltering
d) Zooming
e) Unsharpmasking
c. Frequencydomainmethods
a) Linear filtering
b) Homomorphicfiltering
c) Rootfiltering
d. Pseudo coloring
a) False coloring
b) Pseudocoloring
6. Whatiscontraststretching?(May/June 2009)
1. Contraststretchingreducesanimageofhighercontrastthantheoriginalby darkening
the levels below m and brightening the levels above m in the image.
2. Contrast stretching is used to increase the dynamic range of the gray levels in the
image being processed.
Low contrast images occur often due to poor / non-uniform lighting conditioning or
due to non-linearity or small dynamic range of the image sensor.
7. Whatismeantbyhistogramofadigitalimage?(May/June2006),(May/June 2009),
(May / June 2007)
1. Histogram of an image represents the relative frequency of occurrence of the
various gray levels in the image.
2. Histogram modeling techniques modify an image so that its histogram has a
desired shape. This is useful in stretching the low contrast levels of images with narrow
histograms.
3. Thus histogram is used to either increase or decrease, the intensity level of the
pixels by any kind of transformation.
The histogram of a digital image with gray levels in the image [0,L-1] is a discrete
function given as,
8. WhatisMedianFiltering?(May/June2009) (May/June2007)
1. The median filter replaces the value of a pixel by the median of the gray levelsin
the neighborhood of that pixel.
fˆ (x,y)mediang(s,t)
(s,t)Sxy
2. Median filters are useful for removing isolated lines or points (pixels) while
preserving spatial resolutions. They perform very well on images containing binary (salt
and pepper) noise but perform poorly when the noise is Gaussian.
9. WhatdoyoumeanbyPoint processing?
When enhancement is done with respect to a single pixel, the process is called point
processing.ie., enhancement at any point in an image depends only on the gray level at that
point.
10. WhatisImage Negatives?
Anegativeimagecanbeobtainedbyreversingtheintensitylevelsofanimage,according to the
transformation,
s=L –1 -r
,whenthegraylevelrangeis[0,L-1]
1. Digitalnegativesareusefulinthedisplayofmedicalimagesandtoproduce
negative prints of image.
2. Itisalsousedforenhancingwhiteorgraydetailsembeddedindarkregionofan image.
11. Writethestepsinvolvedinfrequencydomainfiltering.
1. Multiplytheinputimageby(-1)x+y tocenterthe transform.
2. ComputeF(u,v),theDFToftheimagefrom (1).
3. MultiplyF(u,v)bya filterfunctionH(u,v).
4. ComputetheinverseDFToftheresultin (3).
5. Obtainthereal partoftheresultin(4).
6. Multiplythe resultin(5)by(-1)x+y
12. WhatismeantbyLaplacian filter?
Itisalinearoperatorandisthesimplestisotropicderivativeoperator,whichis defined as,
2f (x,y) 2f (x,y)
f2 - ---------------- (1)
x2 y2
Where,
2f(x,y)
f(x1,y) f(x1,y)2f(x,y) -------------- (2)
x2
2f(x,y)
f(x,y1) f(x,y1)2f(x,y) --------------- (3)
y2
Sub(2) &(3)in(1),weget,
f2 f(x 1,y) f(x1,y) f(x,y1) f(x,y1)4f(x,y)
Theabovedigital laplacianequation isimplementedusingfilter mask,
0 1 0
1 -4 1
0 1 0
13. Differentiatelinearspatialfilterandnon-linearspatialfilter.
s.no. Linearspatial filter Non-linearspatialfilter
1. Responseisasumofproductsof the They do not explicitly use co-
filter co-efficient. efficientsinthesum-of-products.
R=w(-1,-1)f(x-1,y-1)+ R=w1z1+w2z2+…+w9z9 9
2. w(-1,0)f(x-1,y) +…+ =∑wizi i=1
w(0,0)f(x,y)+… +
w(1,0)f(x+1,y)+
w(1,1)f(x+1,y+1).
Wherecisconstant &u ≥ 0
17. Writetheapplicationofsharpening filters?
1. Electronicprintingandmedicalimagingtoindustrialapplication
2. Autonomoustargetdetectioninsmartweapons.
18. Defineclipping.
Aspecialcaseofcontrast stretchingwheretheslopevalues=r=0iscalledslipping.
Thisisusefulfornoisereduction.
19. Namethedifferenttypesof derivative filters?
1. Laplacianoperators
2. Prewittoperators
3. Robertscrossgradient operators
20. DefineSpatialDomainProcess.
The term spatial domain refers to the image plane itself and approaches in this category
are based on direct manipulation of pixels in an image.Spatial domain processes is denoted
by the expression.
G(x,y)=T[f(x,y)]
Where f(x,y) input image G(x,y)processedimage
T operator of f, defined over some neighborhood of (x,y)
21. DefineFrequencydomainprocess
The term frequency domain refers to the techniques that are based on modifying the
Fourier transform of an image.
22. Whatismeantbygray-level transformationfunction?
Thespatialdomainprocessisdenotedbytheexpression.
G(x,y)=T[f(x,y)]
From this expression the simplest form of T is when the neighborhood is of single
pixel and ‘g’ depends only on the value of f at(x,y) and T becomes a gray level
transformation function which is given by
rgreyleveloff(x,y)
Sgrey levelof g(x,y)
S=T(r)
23. Definecontraststretching.
The contrast stretching is a process of to increase the dynamic range of the gray
levels in the image being processed.
24. DefineThresholding.
Thresholding is a special case of clipping where a=b and output becomes binary.For
examples, a seemingly binary image, such as printed page, does not give binary output
when scanned because of sensor noise and background illumination variations.Thresholding
is used to make such an image binary.
25. What are the types of functions of gray level Transformations for Image
Enhancement?
Threebasictypes offunctionsusedfrequentlyforimageenhancementare
1. Linear(negativeandidentitytransformations
2. LogarithmicTransformations
3. Powerlaw Transformations.
26. GivetheexpressionofLog Transformations?
ThegeneralformofthelogTransformationisgiven
S=Clog (1+r).
Where C is a construct and it is assumed that r 0. this transformation enhances the small
magnitude pixels compared to those pixels with large magnitudes.
27. Writetheexpressionforpower-Law Transformations.
Power-lawtransformationshavethebasicform
S=Cr
Wherec and rare positiveconstants.
28. Whatismeant bygammaandgammacorrection?
Powerlawtransformationisgivenby
S=Cr
The exponentin the power-law equation is referred to as gamma. The process used to correct
the power law response phenomena is called gamma corrections.
29. Whatisthe advantage& disadvantagesofpiece-wiseLinear Transformations?
The principal advantage of piecewise Linear functions over the other types of
functions is that piece wise functions can be arbitrarily complex.
The main disadvantage of piece wise functions is that their specification requires
more user input.
30. Whatismeant bygray-levelslicing?
Gray-level slicing is used in areas where highlighting a specific range of gray levelin
a image. There are 2 basic approaches gray level slicing.
1. Highlightsrange{A,B] ofgraylevelsandreduces allothertoaconstantlevel.
2. Secondapproachisthathighlights range [A,B]butpreserves allother levels.
31. Whatismeant byBit-planeslicing?
Instead of high lighting grey-level ranges, highlighting the contributes made to total
image appearance by specific bits is called Bit-plane slicing.
useofbit-planeslicing:This transformation is useful in determining the visually significant
bits.
32. Whatishistogramandwriteits significance?
The histogram of an image represents the relative frequency of occurrence of the
various gray levels in the image. They are the basis for numerous spatial domain processing
techniques. Histogram manipulation can be used effectively for image enhancement.
33. Definehistogram Equalization.
Histogram Equalization refers to the transformation (or) mapping for which the
processed (output) image is obtained by mapping each pixel into the input image with the
corresponding pixel in the output image.
34. DefineHistogrammatching(or)histogram specification.
The method used to generate a processed image that has a specified histogram is
called histogram specification (or) matching.
35. WhatismeantbyImagesubtraction?
Thedifferencebetween twoimagesf(x,y)andh(x,y)expressedas
Y(x,y)=f(x,y)-h(x,y)
37. Definespatialfiltering.
Filtering operations that are performed directly on the pixels of an image is called as
spatial filtering.
38. Whataresmoothingfilters(spatial)?
Smoothing filters are used for blurring and for noise reduction. Blurring is used in
preprocessing steps.
The output of a smoothing linear spatial filter is simply the average of pixels
contained in the neighborhood of the filter mask.
39. WhysmoothingLinearfiltersalsocalledasaveragingfilters?
The output of a smoothing, linear spatial filter is simply the average of the pixels
contained in the neighborhood of the filter mask. For this reason these filters are called as
averaging filters. They are also called as low pass filters.
40. Whataresharpeningfilters? Giveanexample?
The principal objective of sharpening is to highlight fine detail in an image (or) to
enhance detail that has been blurred, either in error or as natural effect of a particularmethod
of image acquisition. Uses of image sharpening applications such as electronic printing,
medical imaging and autonomous guidance in military systems
41. Defineunsharp masking.
The process of subtracting a blurred version of an image from the image itself is
called as unsharp masking which is expressed as
fs(x,y)f(x,y)f(x,y)
42. Whatismeant byarithmetic filer?
Computetheaveragevalueofthecorruptedimageg(x,y)intheareadefined The
value of the restored imageat any point (x,y)
1
fˆ(x,y) g(s,t)
mn(s,t)S x,y
Note:Usingaconvolutionmaskinwhichallcoefficientshavevalue1/mn.Noiseisreduced as a
result of blurring.
43. Whatismeant bygeometricmeanfiler?
Geometricmeanfilterisgiven bythe expression
1
fˆ(x,y) g(s,t) mn
(s,t )S
xy
44. Whatismeant byharmonic meanfiler?
Theharmonic mean filteroperationisgivenbythe expression
fˆ(x,y)
mn
g(s,t)
1
(s,t)S xy
45. Whatismeant bycontraharmonicmeanfiler?
Thecontra harmonicmeanfilteroperationisgivenbythe expression
g(s,t)Q1
fˆ (x,y)
(s,t)Sxy
g(s,t)Q
(s,t)Sxy
Where Q is called the order of the filter. This filter is well suited for reducing or
virtuallyeliminating the effects of salt-and-pepper noise.
PART–B
IMAGEENHANCEMENT– Introduction
S=T(f(x,y)
Thecenterofthesubimageismovedfrompixeltopixelstarting,say,atthetopleft
corner. The operator T is appliedat each location(x, y) to yield the output, g, at that location.
The process utilizes only the pixels in the area of the image spanned by the neighborhood.
Wheref(x,y)istheinputimage,g(x,y)istheprocessedimage,andTisanoperator onf,
definedoversomeneighborhoodof (x,y). Inaddition,T canoperate onaset of
inputimages,suchasperforming thepixel-by-pixelsumofKimagesfornoise reduction
Digital negatives are useful in the display of medical images and to producenegative
prints of image.It is also used for enhancing white or gray details embedded indark region of
an image.
(b)LogTransformations:
The dynamic range of gray levels in an image can be very large and it can be
compressed. Hence, log transformations are used to compress the dynamic range of the
image data, using the equation,
s=clog10(1+│r│)
Wherecisconstant& r≥ 0
From the above diagram, it can be seen that this transformation maps narrowrangeof low
gray-level values in the input image into a wider rangeof output levels. The opposite is
true which is used to expandthe values of dark pixels in an image while compressing the
higher-level values. This doneby theinverselog transformation
(c)PowerLawTransformations:
Thepowerlawtransformationequationisgivenas,
Wherecandγaretheconstants The
s=crγ
b) To brighten the desired range of gray levels while preserving the background of
the image.
i.e.,withbackground,
s = L,A≤r≤B r,
else
(e)BitplaneslicingorBitextraction:
This transformation is used to determine the number of visually significant bits in an
image.It extracts the information of a single bit plane.
Consider each pixel in an image to be represented by 8 bits and imagine that the
image is made up of eight 1-bit plane , ranging from bit plane 0 for LSB to bit plane 7 for
MSB, as shown below
Where,kn=[in–2in-in=Int[u/2B-n]
Int[x] = Integer part of x , n = 1,2,…..,B, B = no.of bits used to represent r , as an
integer
BitRemoval:
ForMSBremovals=2rmodulo(L+1),0≤r≤L For
LSB removal,s = 2 Int [ r/2]
2.Explainbrieflyabouthistogrammodeling HISTOGRAM
Histogram of an image represents the relative frequency of occurrence of the
various gray levels in the image.
Histogram modeling techniques modify an image so that its histogram has a desired
shape. This is useful in stretching the low contrast levels of images with narrow histograms.
Thus histogram is used to either increase or decrease, the intensity level of the pixels by
any kind of transformation.
The histogram of a digital image with gray levels in the image [0,L-1] is a discrete function
given as,
h(rk)nk,whererk is thekth greylevel, k0,1,…,L1
nkis thenumberofpixelsin theimagewithgreylevelrk
Normalizedhistogramisgiven as,
nk
p(rk)
n
Where,n isthetotalnumberofpixelsin theimageandn≥nk
The Normalizedhistogram isthehistogram divided bythetotal number of pixelsin the
source image.
1. Thesumofallvaluesinthe normalizedhistogramis 1.
2. The value given by the normalized histogram for a certain gray value can be read as
theprobability of randomly picking a pixel having that gray value
3. Thehorizontalaxisofeachhistogramplotcorrespondstogreylevelvaluesrk inthe
nk
imageandtheverticalaxiscorrespondsto h(rk )nk orp(rk ) ,ifthevaluesare
n
normalized.
Histogramoffourbasicgraylevelcharacteristics:
Darkimage:(underexposedimage):Herecomponentsofthehistogramare concentrated
on the low or dark side of the gray scale.
Brightimage:(overexposedimage):Herecomponentsofthehistogramare
concentratedonthehighorbrightsideofthegrayscale.
3. WriteshortnotesonHistogramequalizationandHistogrammodification.(Nov/ Dec
2005) (May / June 2009) (May / June 2007)
Histogramequalization:Atechniquewhichisusedtoobtainuniformhistogramisknown as
histogram equalization or histogram linearization.
Let r represent the grey levels in the image to be enhanced. Assume r to be
normalizedin the interval [0, 1], with r = 0 representing black and r = 1 representing white.
Foranyvaluerintheinterval[0,1],theimage transformationisgivenas,
S=T(r),0≤r≤1
Thistransformationproducesalevelsfor every pixelvaluerinthe originalimage.
ThetransformationfunctionT(r)satisfiesthefollowing conditions,
(a) T(r) is single –valued and monotonically increases in the interval0 ≤ r ≤ 1 (ie.,
preserves the order from black to white in the output image) and
(b) 0 ≤ T(r)) ≤ 1 for 0 ≤ r ≤ 1 (ie., guarantees that the output gray levels will be
inthe same range as the input levels)
Thefollowingshowsthetransformationfunctionsatisfying theabovetwoconditions.
TheInversetransformationisgivenas,
r=T-1(s),0 ≤s ≤1
If the gray levels in an image can be viewed as random variables in the interval [0,1], then
Pr(r) and Ps(s) denote the pdfs of the random variables r and s.
IfPr(r)and T(r) areknownandT -1(s)satisfiesthecondition(a),then
Ps(s)= Pr(r) dr
---------- (1)
ds
r=T-1(s)
Thus , the pdf of the transformed variables is determined by the gray level pdf of the input
image and by the chosen transformation function.
ForContinuousgraylevel values:
Considerthetransformation,
r
sT(r) pr(w)dw (2)
0
where w is a dummy variable of integration and
r
p r (w)dwcummulativedistributionfunction[CDF]ofrandomvariable'r'con
0
dition(a)and(b)aresatisfiedbythistransformationasCDFincreases monotonically from 0 to 1 as
a function of r.
WhenT(r)isgiven,wecanfindP s(s)usingequation(1), We
know that,
sT(r)
ds dT(r) dr (w) dwp (r)
p r
dr dr dr0 r
dr 1
(3)
ds Pr(r)
Inhistogramequalization,thefunctionT(r)pr(rj), k0,1,…,L1
j0
Theabovefunctionperformsacompressionoftheinputvariable.
Other choices of T(r) that have similar behavior are,
T(r)=log(1+r) ,r ≥0
T(r)= r1/n, r ≥ 0,n =2,3…..
4. Writeshortnotesonhistogramspecification.(May/June2009)
Histogram Specification:
It is defined as a method which is used to generate a processed image that has a
specifiedhistogram.Thus,itisusedtospecify theshape of thehistogram, fortheprocessed
image & the shape is defined by the user.Also called histogram matching
ForContinuouscase:
Letrbe aninput image,Zbeanoutputimage
pr(r) istheoriginalprobabilitydensityfunction
pz(z) isthedesiredprobabilitydensityfunction
LetSbearandomvariableandifthehistogramequalizationisfirstappliedonthe
originalimager ,then
r
sT(r)pr(w)dw
0
Supposethatthedesiredimagezisavailableandhistogramequalizationisgivenas,
z
sG(z)p z (z)dz
0
WhereGisthetransformationofz=s. From
equation (1) and (2),
G(z)=s=T(r)
Theinverse process zG1(s)G1[T(r)]
Therefore,theprocessofhistogramspecificationcanbesummarisedinthe followingsteps.
i) ObtainthetransformationfunctionT(r)usingequation(1)
ii) ObtainthetransformationfunctionG(z)usingequation(2)
iii) ObtaintheInversetransformationfunctionG -1
iv) Obtaintheoutputimage byapplying usingequation(3)toallpixelsintheinputimage
Thisprocedureyieldsanimagewhosegray levelszhavethespecifiedpdf pz(z)
ForDiscretegray levelvalues:
Theprobabilityofoccurrence ofgray levelr kinanimage isgivenas,
n
p(r) k,k0,1, ............... L1
r k
n
Where,n =total no.of pixelsintheimage
nk=No.of pixels thathave graylevelrk
L=totalno.ofpossiblegraylevelsintheimage The
discrete form of the transformation function is ,
k kn
j
skT(rk)pr(rj) ,0rk 1, k0,1,…,L1
j0 n j0
Also,thediscreteformofthedesiredtransformationfunctionis,
k
skG(z k )p z (z i ),
i0
From (1)and(2), theinversetransformationisgivenas,
G(z k )skT(rk)
1
zG
k (s)Gk 1[T(r)] k
5. WriteshortnotesonthevariousNoisemodels(Noisedistribution)indetail.(Nov/ Dec
2005)
The principal noise sources in the digital image arise during image acquisition or
digitization or transmission. The performance of imaging sensors is affected by a variety of
factors such as environmental conditions during image acquisition and by the quality of the
sensing elements.
Assuming the noise is independent of spatial coordinates and it is uncorrelated with
respect to the image itself.
Thevarious Noiseprobabilitydensityfunctionsareasfollows,
1. GaussianNoise: Itoccursduetoelectroniccircuitnoise,sensornoiseduetopoor illumination
and/or high temperature
ThePDFofGaussianrandomvariable,z,isgivenby
1 /22
e (zz)
2
p(z)
2
where, zrepresentsintensity
zisthe mean (average) valueof z
isthestandarddeviation
ThePDFofGaussianrandomvariable,z, isgivenby
1
e(zz) /2
2 2
p(z)
2
Themeanandvarianceofthisdensityare givenby
zab/4
b(4)
2
4
3. Erlang(Gamma)Noise
It occurs duetolaser imaging
ThePDFofErlangnoiseisgivenby
Themeanandvarianceofthisdensityaregivenby ab az
forz0
zb/a b1p(z) (b1)!
z
e
2 2 0 forza
b/a
p(z)ae
az
forz0
0 forza
Themeanandvarianceofthisdensityaregivenby
z1/a
21/a2
5. UniformNoise
Itisa Leastdescriptiveandbasisfornumerousrandom number generators
ThePDFofuniformnoiseisgiven by
1
fora zb
p(z) ba
0 otherwise
Themeanandvarianceofthis densityaregivenby
z (ab)/2
2(ba)2/12
6. Impulse(Salt-and-Pepper)Noise
It occurs duetoquicktransients suchasfaultyswitching
ThePDFof(bipolar)impulsenoiseisgivenby
Pa forza
p(z) P forzb
b
0
otherwise
LinearSpatial Filter:
Linear filter means that the transfer function and the impulse or point spreadfunction
of a linear system are inverse Fourier transforms of each other.
For a linear spatial filtering, the response is given by a sum of products of the filter
coefficients and the corresponding image pixels in the area spanned by the filter mask.
Consider a 3 x 3 mask, the response R of linear spatial filtering with the filter mask at a
point (x,y) in the image is,
R=w(-1,-1_f(x-1,y+1)+w(-1,0)f(x,y+1)+……+w(1,1)f(x+1,y-1)
Thus the coefficients w(0,0) coincides with image value f(x,y), indicating that the mask is
centered at (x,y), when the computation of the sum of products takes place.
Hence the filter mask size is m x n, where m = 2a+1 and n = 2b+1 and a,b are no-
negative integers.In general, the linear filtering of an image f of size M x N with a filter
mask of size m x n is given as,
a b
(m 1) (n1)
g(x,y)w(s,t)f(xs,yt),where....a ,b
satb 2 2
Where,
x0,1,2,.....,M1
y0,1,2,.......,N1
From the general expression, it is seen that the linear spatial filtering is just
“convolvinga mask with an image”. Also thefilter mask is called as Convolution mask
or Convolution kernel.
Thefollowingshowsthe3x3spatialfiltermask,
Rw1z1w2z2........ wmnzmn
mn
wizi
i1
Where, w’s are mask coefficients, z’s are values of the image gray levels corresponding to
the mask coefficients and mn is the total number of coefficients in the mask.
Non-LinearSpatialfilter:
This filter is based directly on the values of the pixels in the neighborhood and they
don’t use the coefficients.These are used to reduce noise.
7. Explainthevarioussmoothingfiltersinthespatialdomain.
Smoothing Spatial Filters or Low pass spatial filtering:
1. Smoothingfiltersare usedforblurringandfornoise reduction
2. Blurring is used in preprocessing steps, such as removal of small details from an image
prior to object extraction and bridging of small gaps in lines or curves.It includes bothlinear
and non-linear filters
1. NeighborhoodAveraging:
1. The response of a smoothing linear spatial filter is simply the average of the pixels in the
neighborhood of the filter mask,i.e., each pixel is an image is replaced by the average of the
gray levels in the neighborhood defined by the filter mask. Hence this filter is called
Neighborhood Averaging or low pass filtering.
2. Thus, spatial averaging is used for noise smoothening, low pass filtering and subsampling
of images.
3. Thisprocessreducessharp transitioningraylevel
4. Thustheaveragingfiltersareusedtoreduceirrelevantdetailinanimage.
Considera 3 x 3 smoothing or averaging filter
1 1 1
1
1 1 1
9
1 1 1
TheresponsewillbethesumofgraylevelsofninepixelswhichcouldcauseR to be out
of the valid gray level range.
R w1z1 w2z2 ...... w9z9
Thusthesolutionis toscalethesumbydividing Rby 9.
Rw1z1w2z2 ...... w9z9
9
wizi
i1
1 9
9 i1 i
z, when ..wi 1
1/9 1/9 1/9
1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
2 1 1 1 1 1 4
1 1 1 1 1
Thusamxnmaskwillhaveanormalizingconstantequalto1/mn.Aspatialaveragefilter in which
all the coefficients are equal is called as a Box Filter.
2. WeightedAverageFilter:ForfilteringaMxNimagewithaweightedaveraging filter
of size m x m is given by,
a b
w(s,t)f(xs,yt)
g(x,y) satb
a b
w(s,t)
satb
Example:
1 1 1
1
1 1 1
9
1 1 1
4. Gaussian filtering
ThetwodimensionalGaussianmaskhasvaluesthatattemptstoapproximatethe
continuous function
x2 y22
1 e
G(x,y)
22
.Thefollowingshowsasuitableinteger-valuedconvolutionkernelthatapproximatesa Gaussian
with a of 1.0.
1 4 7 4 1
4 16 26 16 4
1
7 26 41 26 7
273
4 16 26 16 4
1 4 7 4 1
5. Medianfiltering(Nonlinearfilter)
Median filtering is the operation that replaces each pixel by the median of the grey
level in the neighborhood of that pixel.
ProcessisreplacesthevalueofapixelbythemedianofthegraylevelsinregionS xyof that
pixel:
fˆ(x,y)mediang(s,t)
(s,t)S xy
V(m,n)=median{y(m-k,n-l),(k,l)εw}
Wherewissuitablychosenwindow.Thewindow sizeNwischosentobeodd.
IfNwiseven,thenthemedianistakenastheaverageofthetwovaluesinthemiddle. Typical window
size s are 3x3,5x5,7x7 or 5 point window
Properties:
1. Unlikeaveragefiltering,medianfilteringdoesnotblurtoomuchimagedetails.
Example:Considertheexampleoffilteringthesequencebelowusinga 3-pt
median filter:16 14 15 12 2 13 15 52 51 50 49
Theoutput ofthemedianfilteris:15 14 1212 13 1551 51 50
2. Medianfiltersarenonlinear filtersbecausefor two sequencesx(n)andy(n)
medianx(n)y(n)medianx(n)mediany(n)
3. Medianfiltersareusefulforremovingisolatedlinesorpoints(pixels)while preserving
spatial resolutions.
4. It works very well on images containing binary (salt and pepper) noise but performs
poorly when the noise is Gaussian.
5. Theirperformanceisalsopoorwhenthenumberofnoisepixelsinthewindowis greater than
or half the number of pixels in the window
Isolated
point
0 0 0 0 0 0
Median filtering
0 1 0 0 0 0
0 0 0 0 0 0
6. Directionalsmoothing
Toprotecttheedgesfromblurringwhilesmoothing,adirectionalaveragingfilter
canbeuseful.Spatialaverages g(x,y:) arecalculatedinseveralselecteddirections(for
examplecouldbehorizontal,vertical,main diagonals)
1
g(x,y:) f (x k,y l)
N ( k,l ) W
andadirection isfoundsuchthat f(x,y)g(x,y:) isminimum.(Notethat
WistheneighbourhoodalongthedirectionandNisthenumberofpixelswithinthis
neighbourhood).Thenbyreplacingg(x,y:)withg(x,y:)wegetthedesiredresult.
\
0 0 0 0 0
0 0 0 0 0
W0
0 0 0 0 0
l
0 0 0 0 0
0 0 0 0 0
K
7. MaxFilter &MinFilter:
The100thpercentilefilteriscalledMaximumfilter,whichisusedtofindthe brightest
points in an image.
Rmax{zk,k1,2,3,....,9},for..3x3matrix
th
The0 percentilefilteriscalledMinimumfilter,whichisusedtofindthe darkest
points in an image.
Rmin{zk,k1,2,3,....,9}for ..........x3matrix
(i.e)Usingthe 100thpercentileresultsintheso-calledmaxfilter,given by
fˆ(x,y) maxg(s,t)
(s,t)Sxy
This filter is useful for finding the brightest points in an image. Since pepper noise has very
low values, it is reduced by this filter as a result of the max selection processing the sub
image area Sxy.
The0thpercentilefilterisminfilter:
fˆ(x,y) ming(s,t)
(s,t)Sxy
Thisfilterisusefulforfindingthedarkestpointsinanimage.Also,itreducessaltnoiseas a result
of the min operation
8. Mean Filters
Thisis thesimply methodsto reduce noiseinspatial domain.
1. Arithmeticmeanfilter
2.Geometricmean filter
3.Harmonic mean filter
4.Contraharmonicmeanfilter
LetSxyrepresent thesetofcoordinatesinarectangularsubimagewindowofsizemxn, centered at
point (x,y).
1. Arithmeticmean filter
Computetheaveragevalueofthecorruptedimageg(x,y)intheareadefinedby
Sx,y.The value of the restored image at any point (x,y)
g(s,t)
1
fˆ(x,y)fˆ
mn(s,t)S x,y
Note:Usingaconvolutionmaskinwhichallcoefficientshavevalue1/mn.Noiseis reduced as a
result of blurring.
2. Geometricmean filter
Geometricmeanfilterisgiven bythe expression
1
mn
fˆ(x,y) g(s,t)
(s,t)Sxy
3. Harmonicmean filter
Theharmonic mean filteroperationisgivenbythe expression
fˆ(x,y)
mn
1
(s,t)S xy
g(s,t)
4. Contraharmonicmean filter
Thecontra harmonicmeanfilteroperationisgivenbythe expression
g(s,t)Q1
fˆ(x,y)
(s,t)Sxy
g(s,t) Q
(s,t)Sxy
WhereQiscalledtheorderofthefilter.Thisfilteriswellsuitedforreducingorvirtually eliminating
the effects of salt-and-pepper noise.
8. Explainthevarioussharpeningfiltersinspatialdomain.(May/June2009)
sharpening filters in spatial domain:
Thisisusedtohighlightfinedetailsinanimage,toenhancedetailthathasbeen blurred and
to sharpen the edges of objects
Smootheningofanimageissimilartointegrationprocess,
Sharpening = 1 / smoothening
Sinceitisinverselyproportional,sharpening isdonebydifferentiationprocess.
DerivativeFilters:
1. Thederivatives ofadigitalfunctionaredefined intermsof differences.
2. It isused tohighlightfinedetailsof animage.
Propertiesof Derivative:
1. Forcontrastgray level,derivativeshouldbeequal to zero
2. It mustbe non-zero,atthe onsetof agraylevelstepor ramp
3. Itmustbe nonzeroalongaramp[constantlychanges]
st
I orderderivative:
Thefirstorder derivativeofone dimensionalfunctionf(x)isgivenas,
f
f(x1) f(x)
x
IIndorder derivative:
Thesecondorder derivativeofonedimensionalfunctionf(x)isgivenas,
2f
f(x 1) f(x 1) 2f(x)
x2
Conclusion:
I. Firstorderderivativesproducethickeredgesinanimage.
II. Second order derivatives have a stronger response to fine details , such as thin lines
and isolated points
III. Firstorderderivatives haveastronger responsetoagraylevelstep
IV. Secondorderderivatives produces adoubleresponseatstep changes ingraylevel
LaplacianOperator:
Itisalinearoperatorandisthesimplestisotropicderivativeoperator,whichis defined as,
(1)
Where,
(2)-
(3)
Sub(2) &(3)in(1),weget,
f2f(x1,y)f(x1,y)f(x,y1)f(x,y1)4f(x,y) - ------------- (4)
Theabovedigital laplacianequation isimplementedusingfilter mask,
0 1 0
1 -4 1
0 1 0
1 -8 1
1 1 1
Similarly,twootherimplementationsofthelaplacianare,
0 -1 0 -1 -1 -1
-1 4 -1 -1 -8 -1
0 -1 0 -1 -1 -1
0 -1 0
-1 5 -1
0 -1 0
Thisiscalledascompositelaplacianmask.
Substitute equation (5) in (6),
g(x,y) f(x,y)f(x1,y)f(x1,y)f(x,y1)f(x,y1)f(x1,y1)f(x1,y1)
f(x1,y1)f(x1,y1)8f(x,y)
f(x1,y)f(x1,y)f(x,y1)f(x,y1)f(x1,y1)f(x1,y1)
g(x,y)9f(x,y) f(x1,y1)f(x1,y1)
Theabovedigital laplacianequation isimplementedusingfilter mask,
-1 -1 -1
-1 -1 -1
-1 -8 -1
-1 A+8 -1
-1 -1 -1
-1 -1 -1
Thisiscalledthesecondcomposite mask.
Gradientoperator:
Forafunctionf(x,y),thegradientfatco-ordinate(x, y)isdefinedasthe2-dimesional column vector
∆f = Gx
Gy
= ∂f/∂x
∂f/∂y
∆f=mag(∆f)=[Gx2+Gy2]½={[(∂f/∂x)2+(∂f/∂y)2]}1/2
GxGy
1. Roberts operator
consider a33maskis thefollowing.
y
z1 z2 z3
z4 z5 z6
z7 z8 z9
x
Itcanbeapproximatedatpoint z5 inanumberofways.Thesimplestistousethe
difference(z 8 z5)inthexdirection and(z 6 z5 )intheydirection. Thisapproximation is known as
the Roberts operator, and is expressed mathematically as follows.
f(x,y)
Gx f(x1) f(x) z6z5
x
f(x,y)
Gy f(y1) f(y) z8z5
y
fGxGy
z6 z5 z8 z5
1 -1 1 0
0 0 -1 0
Roberts operator
AnotherapproachistouseRobertscrossdifferences Take
Z5 Z6
Z8 Z9
ThisapproximationisknownastheRobertscrossgradientoperator,andisexpressed mathematically as
follows
fz9z5 z8z6
TheaboveEquationcanbe
implementedusingthefollowingmask
-1 0 0 -1
.
0 1 1 0
Roberts operator
Theoriginalimageisconvolvedwithbothmasksseparatelyandtheabsolutevaluesofthe
twooutputsofthe convolutionsareadded.
2. Prewittoperator
consider a33maskis thefollowing.
y
z1 z2z z3
5
z4 z6
z8
z7 z9
f(x,y) rd x
Gx 3 row1strow(zzz) (z z2z3)
x
7 8 9 1
f(x,y)
Gy 3rdcol1stcol(z z6 z9 )(z1 z4 z7)
y
3
fGxGy(z 7 z8z9)(z1z2z3)(z3z6z9)(z1z4z7)
y
-1 0 1 -1 -1 -1
-1 0 1 0 0 0
-1 0 1 1 1 1
Prewittoperator
ThisapproximationisknownasthePrewitt xator.
oper
9. Explainthebasicstepsforfiltering(imageenhancement)inFrequency domain.
10. DiscussindetailthesignificanceofHomomorphicfilteringinimageenhancement.
(May / June 2009) (May / June 2007)
Features& Application:
1. Homomorphicfilterisusedforimageenhancement.
3. Itisalso usedtoremovemultiplicativenoise.
Images normally consist of light reflected from objects. The basic nature of the image f(x,y)
may be characterized by two components:
These portions of light are called the illumination and reflectance components, and are
denotedi(x,y) and r(x,y) respectively. Thefunctionsiand rcombinemultiplicatively togive the
image function F:
f(x,y)=i(x,y)r(x,y),
where 0 < i(x,y) < 1-----indicates perfect blackbody -----indicates perfect absorption ,
and 0 <r(x,y) < 1 -----indicates perfect white body ---- indicates perfect reflection.
Since i and r combine multiplicatively, they can be added by taking log of the image
intensity, so that they can be separated in the frequency domain.
Illumination variations can be thought as a multiplicative noise and can be reduced
by filtering in the log domain.To make the illuminations of an image more even, the HF
components are increased and the LF components are filtered, because the HF components
are assumed to represent the reflectance in the scene whereas the LF components are
assumed to represent the illumination in the scene.i.e., High pass filter is used to suppress
LF’s and amplify HF’s in the log intensity domain.
illumination component tends to vary slowly across the image and the reflectance
tends to vary rapidly. Therefore, by applying a frequency domain filter the intensity
variation across the image can be reduced while highlighting detail. This approach isshown
below.
BLOCKDIAGRAM:
EnhancedImage
g(x,y)
Analysis:
Takingnaturallogonbothsidesoftheaboveequation,weget, ln[f(x,y)] =
ln[i(x,y)] + ln[r(x,y)]
Letz=ln[f(x,y)]=ln[i(x,y)]+ ln[r(x,y)]
TakingDFTonbothsidesoftheaboveequation,weget, z(x,y)
DFT[z(x,y)]=DFT{ln[f(x,y)]}=DFT{ln[i(x,y)]+ln[r(x,y)]}
SinceDFT[f(x,y)]=F(u,v),equation(2)becomes,
Figure:Transferfunctionforhomomorphicfiltering.
Ifwenowapplyafilterwithatransferfunctionthatsuppresseslowfrequency components
and enhances high frequency components, then we can suppress the illumination
component and enhance the reflectance component.
i.e.,S(u,v)=H(u,v)Z(u,v) (4)
whereS(u,v)isthefouriertransformoftheoutputimage.
S(u,v)=H(u,v)[Fi(u,v)+Fr(u,v)]=H(u,v)Fi(u,v)+H(u,v)Fr(u,v)--(5) Applying
s(x,y)=i’(x,y)+r’(x,y) (6)
TheEnhancedimageisobtainedbytakingexponentialoftheIDFTs(x,y), i.e.,
where,io(x,y)=ei’(x,y),ro(x,y)=er’(x,y)aretheilluminationandreflectioncomponents of the
enhanced output image.
11. WriteshortnotesonColorimage enhancement
Colorimageenhancement:
Animageenhancementtechniquethatconsistsofchangingthecolorsofanimage or
assigning colors to various parts of an image.
Monochromeimage
enhancementalgorithm
Input
image Inverse
R
color
Color Output
Monochromeimage space
G space
enhancementalgorithm transform image
transform rendering
B
Monochromeimage
enhancementalgorithm
PART–A
1. DefineImage Restoration.
Imagerestorationreferstoremovalorminimizationofknowndegradationsinan image i.e.
Restoration attempts to reconstruct or recover an image that has been degraded.
2. CompareImageEnhancementwithimage restoration?
Noiseη(x,y)
Degradation Restoration
[BlurringFilter] [Deblurring/Deconvolutionfilter]
4. ClassifyImagerestoration techniques.
Imagerestorationsareclassifiedas following:
Image Restoration
8. Givethelimitationsforinversefilteringandpseudofiltering.
The main limitation of inverse and pseudo-inverse filtering is that these filter remain
very sensitive to noise.
9. Whatismeant byWeinerfilter?
Weinerfilterisa methodofrestoringimagesinthepresence ofbluraswellasnoise.
10. Whatisthe expressionforthe error measure forWeiner filter?
Theerrormeasureis given by
e2E (ff)2
WhereE{.}istheexpectedvalue off theargument.
‸ *H*(u,v)
F(u,v) G(u,v)
H(u,v)
2
S(u,v)/Sf(u,v)
n
The filter which consists of terms inside the brackets also is commonly referred
toas minimum mean square error filter (or) least square error filter.
13. Whatismeant geometric transformation?
Geometrictransformationsmodifythespatialrelationshipsbetweenpixelsinan image.
Geometric transformation often are called rubber-sheet transformations
14. Whatarethetwobasicoperationsofgeometric transformation?
Thetwobasicoperationsofgeometrictransformationare,
i) Aspecial transformationwhich defines therearrangementofpixelsontheimageplane.
ii) Gray level interpolation, which deals with the assignment of gray levels to pixels in the
spatially transformed image.
15. Whatismeant spatial transformation?
Animage“f”withpixelco=ordinates(x,y)undergoesgeometricdistortiontoproduce an
image “g” with co-ordinates (x’, y’). this transformation may be expressed as
x’=r(x,y)
and
y’=s(x,y)
wherer(x,y)&s(x,y)arethespatialtransformations.
16. WriteanequationforFredholmIntegraloffirstkindandalsodefinePSF
g(x,y) f(,)H[(x,y)]dd
ButtheimpulseresponseofHisgivenas,h(x,α,y,β)=H[δ(x-α,y-β)] Where
h(x,α,y,β) is called Ponit spread function (PSF).
Thereforeequation becomes,
Noise η(x,y)
PARTB
1. Explaintheimagedegradationmodelanditsproperties.(May/June2009)(or)
Explain the mathematical model of Image degradation process
Noiseη(x,y)
Degradation Restoration
The image f(x,y) is degraded with a function H and also a noise signal η(x,y) is added. The
restoration filter removes the degradation from the degraded image g(x,y) and restores the
original image f(x,y).
TheDegradationmodelisgivenas,
(x,y)istheexternalnoisewhichisassumedtobeimage-independent
^
f(x,y) istherestoredimage. R isanoperatorthatrepresentstherestoration
process
PropertiesoftheDegradation model:
Asimplifiedversionfortheimagedegradationmodelis
Degradation
Original g(x,y)
function +
image Degradedimage
f(x,y) H
Noiseη(x,y)
Considerthegeneraldegradationmodel
g(x,y) H[f(x,y)](x,y) -------------------------- (1)
a) Propertyof Linearity:
Iftheexternalnoise (x,y)isassumedtobezero,thenequation(1)becomes,
g(x,y)H[f(x,y)]
Hissaidtobe linearif
Haf1(x,y)bf2(x,y) aHf1(x,y) bHf2(x,y) ---------- (2)
Where,aandbarescalars,andf1(x,y)andf2(x,y)areanytwoinputimages.
Thelinear operatorpossesbothadditivityandhomogeneityproperty.
b) PropertyofAdditivity:
Ifa=b= 1,thenequation(2) becomes,
Hf1(x,y)f2 (x,y) Hf1(x,y) Hf2 (x,y)
Iscalledthepropertyofadditivity.Itstatesthat,ifHisalinearoperator,thentheresponse to a sum of
two inputs is equal to the sum of two responses.
c) Property of Homogeneity:
Iff2(x,y)=0,thenequation(2) becomes,
Haf1(x, y)aHf1(x, y)is called the property of homogeneity. It states that the
responsetoaconstantmultipleofanyinputisequaltotheresponseofthatinputmultiplied by the
same constant.
d) Property ofPositionorspace invariant:
Anoperatorhavingtheinput–outputrelationshipasg(x,y)H[f(x,y)]issaidtobe
positionor space invariantif
Hf(x,y)g(x,y)
Foranyf(x,y)andanyαandβ.Itstatesthattheresponseatanypointintheimage depends only on the
value of the input at that point and not on its position.
2. Explainthedegradationmodelforcontinuousfunctionandfordiscretefunction.
(May / June 2009)
a. degradationmodelforcontinuous function
Animage intermsof acontinuousimpulsefunctionisgivenas,
g(x,y)H[f(,)(x,y)dd]
SinceHisalinear operator,extendingtheadditive propertytointegrals,we get,
g(x,y)
H[f(,)(x,y)dd]
Sincef(α,β)isindependentof x&y,usinghomogeneityproperty,we get,
g(x,y)
f(,)H[(x,y)]dd----------------------------------------- (3)
ButtheimpulseresponseofHisgivenas,h(x,α,y,β)=H[δ(x-α,y-β)] Where
h(x,α,y,β) is called Ponit spread function (PSF).
Thereforeequation(3) becomes,
g(x,y)
f(,)h(x,,y,)dd ------------------------------------------- (4)
ThisequationiscalledasSuperpositionor FredholmIntegraloffirst kind.
ItstatesthatiftheresponseofHtoanimpulseisknown,thentheresponsetoanyinput f(α,β) can be
calculated using the above equation.
Thus,alinearsystemHiscompletelycharacterizedbyitsimpulseresponse. If H is
position or space invariant, that is,
H(x,y)h(x,y)
Thenequation (4) becomes,
g(x,y)f(,)h(x,,y,)dd(x,y)
Thisisthelineardegradationmodelexpressionforacontinuousimagefunction. If H is
position Invariant then,
g(x,y)f(,)h(x,y)dd(x,y)
b. degradationmodelfordiscretefunction
Lettwofunctionsf(x)andh(x)besampleduniformlytoformarraysofdimensionA and B.
x=0,1,…….,A-1,forf(x)
=0,1,…….,B-1,for h(x)
AssumingsampledfunctionsareperiodicwithperiodM,where chosen MAB1is
to avoid overlapping in the individual periods.
Let fe(x) and he(x)betheextendedfunctions,thenforatime invariantdegradation
processthediscreteconvolutionformulationisgivenas,
M1
g e (x) fe(m)he(xm)
m0
Inmatrixform
gHf,
wheregandhare Mdimensionalcolumnvectors
fe(0) ge(0)
f (1)
fe ,ge g (1) ,and His aM xM matrix givenas,
⁝ ⁝
ef (M1) eg (M1)
he(0) he(1) …he(M1)
h(1) h(0) …h(M2)
He e e
(MM) ⁝ ⁝ ⋱⁝
h(M1) h(M2)…h(0)
e e e
Assuminghe(x)isperiodic,thenhe(x)=he(Mx)andhence,
he(0) he(M1) …he(1)
h(1) h(0) …h(2)
He e e
(MM) ⁝
⁝ ⋱⁝
h(M1) h(M2)…h(0)
e e e
g e (x,y) fe(m,n)he(xm,yn)ne(x,y)
m0n0
Inmatrix form,
gHf
wheref,gandare MNdimensionalcolumnvectorsandHisMNxMNdimension.It
2
consistsofM partition,eachpartitionhavingdimensionofsizeMxNandordered accordingly and is given
as ,
H0 HM1 …H1
H H …H
2
H1 0
⁝ ⁝ ⋱⁝
H H …H
M1 M2 0
EachpartitionHjis constructed fromthejth rowoftheextended functionhe(x,y) is,
he(j,0) he(j,N1) …he(j,1)
h(j,1) h(j,0) …h(j,2)
Hj e e e
⁝ ⁝ ⋱⁝
h(j,N1) h(j,N2)…h(j,0)
e e e
3. Write notes on inverse filtering as applied to image restoration.(May / June 2009)
(or) Write short notes on Inverse filter (Nov / Dec 2005)
Inversefilter:
^
Thesimplestapproachtorestorationisdirectinversefiltering;anestimate F(u,v)of
thetransformoftheoriginalimageisobtainedsimplybydividingthetransformofthe
degradedimageG(u,v)bythe degradationfunction.
^
G(u,v)
F(u,v)
H(u,v)
Problemstatement:
Givenaknownimagefunctionf(x,y)andablurringfunctionh(x,y),weneedtorecover f(x,y) from
the convolution g(x,y) = f(x,y)*h(x,y)
Solutionbyinversefiltering:
a.Without Noise:
i.e.,G(u,v)F(u,v)H(u,v)
G(u,v)
F(u,v) - ------------------------- (1)
H(u,v)
Also,fromthemodel,
^ 1 G(u,v)
F(u,v)R(u,v)G(u,v)H (u,v)G(u,v)
- --------- (2)
H(u,v)
From (1)&(2),we get,
^
F(u,v)F(u,v)
Henceexactrecoveryoftheoriginalimageispossible.
b.WithNoise:
Noise η(x,y)
Therestoredimageisgivenas,
^
1
G(u,v)
F(u,v)R(u,v)G(u,v)H (u,v)G(u,v) (3)
H(u,v) --------------------
But, G(u,v)=F(u,v).H(u,v)+ η(u,v)---------------------------------------- (4)
Substititeequation(4) in(3),we get,
^
G(u,v) F(u,v)H(u,v)(u,v)
F(u,v)
H(u,v) H(u,v)
F(u,v)H(u,v) (u,v)
H(u,v) H(u,v)
^
(u,v)
F(u,v)F(u,v)
H(u,v) (5)
Here, along with the original image , noise is also added. Hence the restored image consists
of noise.
Drawbacks:
1. Doesnotperformwellwhen usedonnoisyimages
1 1=Infinite,
2. In the absence of noise, If H(u,v)=0,then R(u,v)H1(u,v)
H(u,v) 0
from equation (2)
3. Inthepresenceofnoise,whenH(u,v)issmall,thenthenoiseη(u,v)dominates(from
equation(5)
Pseudoinverse filtering.:Thesolutionistocarryouttherestorationprocessina limited
neighborhoodabouttheoriginwhere H(u,v) isnotverysmall.Thisprocedure is called
Pseudoinversefiltering.In thiscase,
1
H(u,v)
H(u,v)
2
F̂ (u,v)
0 H(u,v)
Thethresholdisdefinedbytheuser.Ingeneral,thenoisemaypossesslargecomponents
athigh frequencies (u,v) , while H(u,v) and G(u, v) normallywillbedominatedbylow
frequency components.
4. WriteshortnotesontheWiener filtercharacteristics.(Nov/Dec 2005)(or)
DerivetheWienerfilterequation.Underwhatconditionsdoesitbecomethepseudo inverse
filter?
OBJECTIVE:
Tofindanestimateoftheuncorruptedimagefsuchthatthemeansquareerror between them
is corrupted. This error measure is given as,
2
e2 Ef f
ASSUMPTION:
1. NoiseandImageareuncorrelated
2. Theneither noiseorimagehasazeromean
3. Graylevelsintheestimatearealinearfunctionofthelevelsinthedegraded image
Let, H(u,v) =Degradationfunction
H*(u,v)=Complex conjugate of H(u,v)
H(u,v)2H*(u,v).H(u,v)
S(u,v) N(u,v)2 Powerspectrumofthe noise
[BlurringFilter] [Deblurring/Deconvolutionfilter]
Noiseη(x,y)
Therestoredimageisgivenas,
^
1 G(u,v) -----------------------
F(u,v)W(u,v)G(u,v)H (u,v)G(u,v) (1)
H(u,v)
But, H*(u,v).Sf(u,v)
W(u,v) ------ ------------------ (2)
|H(u,v)|2S(u,v)S(u,v)
f
Where W (u,v) is the Wiener filter
Substituteequation(2)in(1),weget,
H*(u,v)S(u,v)
Weget, F(u,v) f
.G(u,v)
H(u,v)2S f (u,v)S (u,v)------------
------ (3)
But,
H(u,v)2 H*(u,v).H(u,v)------------------------------(4)
TofindanoptimalLinearfilterwithMeanSquareerrorasminimum,
H*(u,v)S(u,v)
F(u,v) .G(u,v)
f
H*(u,v)S(u,v) .G(u,v)
f
S(u,v)
S f (u,v)[H*(u,v).H(u,v) ]
S(u,v)
f
H*(u,v)
.G(u,v)
* S(u,v)
H (u,v).H(u,v)
Sf (u,v)
1 .G(u,v)
S(u,v)
H(u,v) xH*(u,v)
Sf(u,v)
Thuswhenthefilterconsistsofthetermsinsidethebracket,itiscalledastheminimum mean square
error filter or the least square error filter.
Case1:Ifthereisnonoise,Sη(u,v)=0,thentheWienerfilterreducestopseudoInverse filter.
Fromequation(2),
1
H*(u,v).Sf(u,v) H*(u,v) H(u,v)
W(u,v) *
|H(u,v)|2S(u,v)f 0 H (u,v)H(u,v) 0
,when H(u,v)≠0
,whenH(u,v)=0
H*(u,v).Sf(u,v)
W(u,v)
| H(u,v)|2S(u,v)S(u,v)
f
H*(u,v)
* S(u,v)
H (u,v).H(u,v)
S f(u,v)
1
S(u,v)
1
S f (u,v)
1
1K
Where
S(u,v)
K
Sf(u,v)
Thusthe WienerdenoisingFilterisgivenas,
1
W(u,v) Sf(u,v)
1K
S f (u,v)S (u,v)
and
Sf(u,v) (SNR)
W(u,v)
Sf(u,v)Sn(u,v) (SNR)1
(i) (SNR ) 1W (u,v)1
(ii) (SNR )1W(u,v)(SNR)
(SNR) ishighinlowspatialfrequenciesandlowinhighspatialfrequenciesso
W(u,v)canbeimplemented with a lowpass(smoothing) filter.
Wiener filter is more robust to noise and preserves high frequency details SNR is
low,Estimate is high
WithNoise:
[BlurringFilter] [Deblurring/Deconvolutionfilter]
Noiseη(x,y)
Theblurred imageisgivenas,
G(u,v)H(u,v)F(u,v)(u,v)
Inmatrixform,theabove equationisexpressedas,
g=Hf+η
η=g -Hf
-------- ---(1)
Problemstatement:
Tofindtheminimumofa criterionfunctionCdefinedas,
M 1 N
1
C 2f(x,y) ,
2
x0y0
Subjecttotheconstraint
2
gHf 2 -------------- (2)
2f isthelaplacianoperator
Solutiontothe Problem:
Thefrequencydomainsolutiontothisoptimizationproblemisgivenby,
^
H*(u,v)
F(u,v) ------------- (3)
2
H(u,v)2 P(u,v)
Whereγisaparameterthatmustbeadjustedsothatthe Following
constraint is satisfied,
gHf,
2
(4)
AndP(u,v)istheFouriertransformofthefunction,
0 1 0
p(x,y) 1 4 1
0 1 0
HerethenoiseisreplacedbyP(u,v)…i.e.,NoiseisapproximatedtoLaplacesuchthatmean
=0.Ifmeaniszero,theamountofDCcomponentiszero….i.e,overallbrightnessofimage
^
is zero.The value of γ is selected by iteration such that F(u,v) isagoodapproximationof
F(u,v).
OneApproachtofindthevalueofγ,
Aresidualvectorrisdefinedas, rgH f, ----------------- (5)
^
SinceF(u,v)is afunction ofγ,then γis alsoafunction ofr,
i.e., r2(),
r2
2 ^
fromequation(3) and (5),if ,thenf=f iaagoodestimation
Therefore, r22a,
Steps:
I. Specifyan initialvalueof“γ”
II. Compute r2,which isgivenasafunction ofγ,
i.e., r (),
2
r2 a,or
2
r a,issatisfied,elseincreaseγif
2 2
III. Checkwhether
x0y0
Thevariance ofthenoiseover theentire image isgivenbythesampleaveragemethod,
2
1M 1 N1
(x,y)m
MN x0y0
,2
1M1N1
Wheresample meanism
MN
(x,y),
x0y0
fx(x,y)gx(x,y)
fy (x,y) gy (x,y)
g(x, y) 0.
Findallsolutions(x1,y1,1), (x 2 ,y2,2), (x3,y 3 ,3),...
DiscardtheLagrangemultipliers 1,2,3,...
II. Evaluate f(x,y)ateachsolutionpointobtainedabove.
Thelargestvalueyieldsthemaximumandthesmallestvalueyieldsthe minimum
subject to constraint g( x, y ) = 0.
TheLagrangeMultiplier Method
i. Tofind theonly possiblesolutions oftheproblem
Maximizeorminimizeafunctionf(x,y)subject togx,y c
ii. 1.WritedowntheLagrangianfunction
Lx,yfx,ygx,yc
whereisaconstant.
2.DifferentiateLwithrespecttoxandy,andequate partialsto0.
3. Weshallgettwoequationstogetherwiththeconstraintgx,y c
Lxx,y fxx,y gxx,y Lyx,
yfyx,ygyx,y
4.Solvethemsimultaneouslyforx,yand
Theconditionsin3are calledfirst-order conditionsfor theproblemof maximizingor
minimizingafunctionf(x,y)subject togx,y c
Example:Solvethe problem:Maximize fx,y x2y2subjectto
gx,y x2xyy23
TheLagrangianis Lx,yx2y2x2xyy23
Lxx,y 2x2xy 0
Lyx,y2yx2y0 x2xy
y23 0
2x 2y
if2xy0
and if2yx0
2xy y2y
2x 2y
Combiningthemtogetherwe get and x2y2 orxyorxy
2xy y2y
SupposeyxFrom3 weget x 1,sox1
2
orx1andit givestwosolutions
x,y1,1and1,1with2
3
SupposeyxFrom3wegetx23, sox 3 orx 3 anditgivestwosolutions
x,y3,3and3,3with2
Two morecases2xy0and2yx0yieldno solutionssincetheyresult
inx0 ory0 whichcontradictstheconstraintx2xyy230.
Twosolutionsx,y1,1and1,1leadtof1,11,12whilethesolutions
x,y
3, 3 3,3 leadto
f 3,
3 f
3,3 6
Thefirsttwosolutionssolveminimizationproblemwhilethelasttwosolvemaximization
problem.
7. Explainunconstrainedrestorationandconstrainedrestoration
The original image signal f(x,y) is subjected to the linear degrading function h(x, y).
An arbitrarily noise signal (x, y) is then added to create the degraded image signal g(x, y).
LinearAlgebraicRestoration Techniques
These techniques utilize matrix algebra and discrete mathematics for solving the
problem of image restoration. To extract the discrete model for the restoration system, we
make the following assumptions:
1. The digitized original image f(x, y) and the restored image fr(x, y) are stored in the M2
×1column vectors f and fr, respectively.
2. Thedigitizeddegradingfunctionh(x,y)isstoredinasquare matrixH(M2×M2).
3. Thedegradedimageg(x,y)andnoise(x,y)isstoredintheM2×1columnvectorsg
and,respectively.
Wecanexpresstheobserved(degraded)imagevectorinthecompactform:
a. UnconstrainedReconstruction
If we know very little about the noise , then we try to find an estimate image fr,
such that Hfrapproximates g in a least-squares manner. This can be accomplished by
minimizing the norm of the noise . Squaring the norm of both sides of Eq. (6) after
substituting for f by the estimate vector frand moving Hfrto the other side of the equation,
we get
Where ||a||2 is the square of the norm of vector a and is given by ||a||2 = aa’, where a’ is the
transpose of the vector a.
Considertheerror functionE,where
Then our goal is to minimize E with respect to fr. This can be accomplished by taking
thederivative of E with respect to fr, and equating the result to zero, that is
Assumingthat H-1exists,thesolutionforthisequationisgiven as
b. ConstrainedReconstruction
To account for the noise term inEq. (6), we introduce the square matrix Q(M2× M2)
to represent some linear operator on f. By selecting different Q's, we are able to set the goal
of restoration as desired. Equation (8) is now modified to
Solvingforfr,weget
Where=1/is aconstantthatweadjusttosatisfytheconstraint.
9. Discuss about the concepts and uses of Geometric Transformations in the context of
image restoration.
Geometric Transformations
Geometric transformations modify the spatial relationships between pixels in an
image. Geometric transformation often are called rubber-sheet transformations, because
they may be viewed as the process of “printing” an image on a sheet of rubber and then
stretching this sheet according to some predefined set of rules.
In terms of digital image processing, a geometric transformation consists of two
basic operations: (1) a spatial transformation, which defines the “rearrangement” of pixels
on the image plane; and (2) gray-level interpolation, which deals with the assignment of
gray levels to pixels in the spatially transformed image.
SpatialTransformations:
Suppose that an image f with pixel coordinates (x, y) undergoes geometric distortionto
produce an image g with coordinates (x1, y1). This transformation may be expressed as
x1=r(x,y) ................ 1
and y1=s(x,y)................ 2
where r(x, y) and s(x, y) are the spatial transformations that produced the
geometrically distorted image g(x1, y1). For example, if r(x, y) = x /2 and s (x, y) = y/2, the
“distortion” is simply ashrinking of thesizeoff (x, y) by one half in both spatial directions. If
r(x, y) and s(x, Y) were known analytically, recovering f (x, y) from the distorted image
g(x1, y1) by applying the transformation in reverse might be possible theoretically. In
practice,however,formulatingasinglesetofanalyticalfunctionsr(x,y)ands(x,y)that
describe the geometric distortion process over the entire image plane generally is not
possible. The method used most frequently to overcome this difficulty is to formulate the
spatial relocation of pixels by the use of tiepoints, which are a subset of pixels whose
location in the input (distorted) and output (corrected) images is known precisely.
Figureshowsquadrilateralregionsin adistorted andcorrespondingcorrectedimage.
Theverticesof thequadrilateralsarecorrespondingtiepoints.
Figure:Correspondingtiepointsintwoimage segments.
Suppose that the geometric distortion process within the quadrilateral regions is
modeled by a pair of bilinear equations so that
Then,from Equations(1)and(2),
Sincethere are atotal ofeight known tiepoints,these equations can besolved for the
eight coefficients ci, I = 1,2,…….8. The coefficients constitute the geometric distortion
model used to transform all pixels within the quadrilateral region defined by the tiepoints
used to obtain the coefficients. In general, enough tiepoints are needed to generate a set of
quadrilaterals that cover the entire image, with each quadrilateral having its own set of
coefficients.
Once we have the coefficients, the procedure used to generate the corrected (i.e.,
restored) image is not difficult. If we want to find the value of the undistorted image at any
point (x0, y0), we simply need to know where in the distorted image f(x0, y0) was mapped.
This we find out by substituting (x0,y0) into Equations (5) and (60 to obtain the
geometricallydistortedcoordinates(x1,y01 ).Thevalueofthepointintheundistortedimage
0
thatwasmappedto(x1,y 1 )isg(x1,y 1 ).Soweobtaintherestoredimagevaluesimplyby
‸
0 0 0 0
1 1
‸
lettingf (x0,y0)=g(x,y).Forexample,togeneratef(0,0),wesubstitute(x,y)=(0,0)
0 0
intoEquations(5)and(6)toobtainapairofcoordinates(x1,y1)fromthoseequations.Then
welet f‸(0,0)=g(x1,y1),wherex1andy1arethecoordinatevaluesjustobtained.Next,we
substitute (x, y) = (0, 1) into Equations (5) and (6), obtain another pair of values (x 1, y1),and
let f(0, 1) = g(x1, y1) for those coordinate values. The procedure continues pixel bypixel and
row by row until an array whose size does not exceed the size of image g is obtained. A
column (rather than a row) scan would yield identical results. Also, a bookkeeping
procedure is needed to keep track of which quadrilaterals apply at a givenpixel location in
order to use the proper coefficients.
Tie points are established by a number of different techniques, depending on the
application. For instance, some image generation systems having physical artifacts (such as
metallic points) embedded on the imaging sensor itself. These produce a known set ofpoints
(called reseau marks) directly on the image as it is acquired. If the image is distorted later
by some other process (such as an image display or image reconstruction process),then the
image can be geometrically corrected using the technique just described.
Gray-LevelInterpolation
The method discussed in the preceding section steps through integer values of the
coordinates (x, y) to yield the restored image. However, depending on the values of the
coefficients CI, Equations (5) and (6) can yield no integer values
Figure:Gray-level interpolationbasedonthenearestneighborconcept.
for x1and y1. Because the distorted images g is digital, its pixel values are defined only at
integer coordinates. Thus using no integer values for x1and y1 causes a mapping into
locations of g for which no gray levels are defined. inferring what the gray-level values at
those locations should be, based only on the pixel values at integer coordinate locations,then
becomes necessary. The technique used to accomplish this is called gray-level interpolation.
PARTA
1. DefineImage Segmentation(May /June2009)
Segmentation is a process of subdividing an image in to its constituted regions or
objects or parts. The level to which the subdivision is carried depends on the problem being
solved, i.e., segmentation should be stopped when object of interest in an application have
been isolated.
Image segmentation techniques are used to isolate the desired object from the scene
so that measurements can be made on it subsequently.
Applicationsof segmentation.
*Detectionofisolated points.
*Detectionoflinesand edgesinanimage
2. Whatarethedifferentimagesegmentation techniques?
Imagesegmentationisclassifiedas follows:
Templatematching
Thresholding
Boundary detection
Clustering
Quad-trees
Texture matching
3. Whatarethe twopropertiesthatare followedinimage segmentation?
Imagesegmentationalgorithmsgenerallyarebasedononeofthebasicpropertiesof intensity
values
1. discontinuity
2. similarity
4. Explainthepropertyof discontinuity?
Theprincipalapproachofthispropertyistopartitionanimagebasedonabrupt changes in
intensity such as edges in an image.
5. Whatarethethreetypesof discontinuityindigitalimage?
Points,linesand edges.
6. Whatistheideabehindthesimilarityproperty?
The principal approach in the property is based on portioning an image into regions
that are similar according to a set of predefined criteria. Thresholding, region growing and
region splitting and merging are examples of this method.
7. Whatisedge?
An edge isset of connected pixels that lie on the boundarybetween two regions edges
are more closely modeled as having a ramp like profile. The slope of the ramp is inversely
proportional to the degree of blurring in the edge.
8. Whatisedge detection?Explain.(May /June 2009)
Edge direction is fundamental importance in image analysis. Edges characterizeobject
boundaries and are therefore useful for segmentation, registration an identification of
objects in scenes. Edge points can be thought of as pixel locations of abrupt gray- level
change.
Edge detection is used for detecting discontinuities in gray level. First and second
order digital derivatives are implemented to detect the edges in an image.
9. Definezerocrossingpropertyofedge detection.
An imaginary straight line joining the extreme positive and negative values of the
second derivative could cross zero near the midpoint of the edge. Zero crossing property is
useful for locating the centers of thick edges.
10. Whatismeant bygradientoperators?
First order derivatives in an image are computed using the gradient operators. The
gradient of an image f(x,y) at location (x,y) is defined as the vector.
Gx xf
f
Gy
f
y
Thef iscalledasthegradient. Magnitudeofthevector is
∆f=magf=[Gx2+Gy2]l/2
α(x,y)=tan-l(Gy/Gx),α(x,y)isthedirectionangleofvector∆f
11. DefineLaplacian.
TheLaplacianofa2Dfunctionf(x,y)isa secondorder derivativedefinedas
2f 2f
2f
x2 y
2
21. Whatismeantbyobjectpointandbackgroundpoint?
To execute the objects from the background is to select a threshold Tthat separate these
modes. Then any point (x,y) for which f(x,y)>T is called an object point. Otherwise the
point is called background point.
22. Whatisglobal,Localanddynamicoradaptivethreshold?
WhenThresholdTdependsonlyonf(x,y)thenthethresholdiscalledglobal. If T
depends both on f(x,y) and p(x,y) is called local.
IfTdependsonthespatialcoordinatesxandythethresholdiscalleddynamicoradaptive where
f(x,y) is the original image.
23. Whatismeant byregion–Based segmentation?
Theobjectiveofsegmentationistopartitionanimageintoregions.These segmentation techniques
are based on finding the regions directly.
24. Defineregiongrowing?
Region growing is a procedure that groups pixels or sub regions in to layer regions
based on predefined criteria. The basic approach is to start with a set of seed points andfrom
there grow regions by appending to each seed these neighboring pixels that have properties
similar to the seed.
25. Specifythestepsinvolvedinsplittingandmerging?
The region splitting and merging is to subdivide an image initially into a set of arbitrary,
disjointed regions and then merge and / or split the regions in attempts to satisfy the
conditions.
Split into 4 disjoint quadrants any region Ri for which P(Ri)=FALSE. Merge any
adjacent regions Rj and Rk for which P(RjURk)=TRUE. Stop when no further merging or
splitting is positive.
26. Whatisthe mainobjectiveofwatershedalgorithm?
The concept of watersheds is based on visualizing an image in three dimensions:two
spatial coordinates versus gray levels. In such a "topographic" interpretation, we consider
three types of points:
a. Points belonging to a regional minimum
b.Catchmentbasin/watershedofa regionalminimum
Pointsatwhicha dropofwaterwillcertainlyfalltoasingle minimum
c.Dividelines/Watershedlines
Points at which a drop of water will be equally likely to fall to more than one
minimum.
Gray-levelvalue Watershedcontour
Catchmentbasins
Localminima
a. Thesegmentationiscomplete:∪RiR
i1
b. Each regionisuniform.
c. Theregionsdonotoverlapeachother:Ri∩Rj ,ij
d. Thepixelsofa regionhave acommonproperty(same graylevel): PRiTRUE
e. Neighboring regions have different properties:
PRiP Rj ,Ri,Rjareneighbors.
2. Explain the various detection of discontinuities in detail.(or)Explain Edge detection
in detail
Detectionof discontinuities
Discontinuities such as isolated points, thin lines and edges in the image can be
detectedby usingsimilarmasks as inthelow- and high-pass filtering.The absolute value of the
weighted sum given by equation (2.7) indicates how strongly that particular pixel
corresponds to the property described by the mask; the greater the absolute value, the
stronger the response.
1. Pointdetection
The mask for detecting isolated points is given in the Figure. A point can be defined
tobeisolatediftheresponsebythemaskingexceedsapredefinedthreshold:
fxT
-1 -1 -1
-1 8 -1
-1 -1 -1
-1 -1 -1 -1 -1 2 -1 2 -1 2 -1 -1
2 2 2 -1 2 -1 -1 2 -1 -1 2 -1
-1 -1 -1 2 -1 -1 -1 2 -1 -1 -1 2
FigureMasksfor linedetection.
Horizontalmaskwillresultwithmaxresponsewhenalinepassedthroughthe middle row
of the mask with a constant background.
Thusasimilarideaisusedwithothermasks.
Thepreferreddirectionofeachmaskisweightedwithalargercoefficient(i.e.,2) than other
possible directions.
StepsforLinedetection:
Applyeverymasks ontheimage
let R1, R2, R3, R4 denotes the response of the horizontal, +45 degree, vertical and -
45 degree masks, respectively.
if,atacertainpointintheimage|Ri|>|Rj|,
for all ji, that point is said to be more likely associated with a line in the directionof
mask i.
Alternatively, to detect all lines in an image in thedirection defined by agiven mask,
just run the mask through the image and threshold the absolute value of the result.
The points that are left are the strongest responses, which, for lines one pixel thick,
correspond closest to the direction defined by the mask.
3. Edgedetection
Themostimportantoperationtodetectdiscontinuitiesisedgedetection.
Edge detection is used for detecting discontinuities in gray level. First and
second order digital derivatives are implemented to detect the edges in an
image.
Edge is defined as the boundary between two regions with relatively distinct gray-
level properties.
Anedge isa set ofconnectedpixelsthatlieontheboundarybetweentwo regions.
Approachesforimplementingedgedetection
first-order derivative (Gradient operator)
Second-orderderivative(Laplacianoperator)
Considerthefollowingdiagrams:
THICKEDGE:
Theslopeof theramp isinverselyproportionaltothedegreeof blurringintheedge.
Wenolonger have athin(onepixelthick)path.
Instead, anedgepoint now is any point containedin the ramp,and anedgewould then
be a set of such points that are connected.
Thethicknessisdeterminedbythelengthoftheramp.
The length is determined by the slope, which is in turn determined by the degree of
blurring.
Blurrededgestendtobethickandsharpedgestendtobethin
The first derivative of the gray level profile is positive at the trailing edge, zero inthe
constant gray level area, and negative at the leading edge of the transition
The magnitude of the first derivative is used to identify the presence of an edge in
the image
The second derivative is positive for the part of the transition which is associated
with the dark side of the edge. It is zero for pixel which lies exactly on the edge.
It is negative for the part of transition which is associated with the light side of the
edge
The sign of the second derivative is used to find that whether the edge pixel lies on
the light side or dark side.
The second derivative has a zero crossings at the midpoint of the transition in gray
level. The first and second derivative t any point in an image can be obtained by
using the magnitude of the gradient operators at that point and laplacian operators.
1. FIRST DERIVATE. This is done by calculating the gradient of the pixel relative to its
neighborhood. A good approximation of the first derivate is given by the two Sobel
operators as shown in the followingFigure , with the advantage of a smoothing effect.
Because derivatives enhance noise, the smoothing effect is a particularly attractive featureof
the Sobel operators.
Firstderivativesareimplementedusingthemagnitudeofthe gradient.
i. Gradientoperator:
For a function f (x, y), the gradient f at co-ordinate (x, y) is defined as the 2-
dimesional column vector
∆f= Gx
Gy
= ∂f/∂x
∂f/∂y
∆f=mag(∆f)=[Gx2+Gy2]½={[(∂f/∂x)2+(∂f/∂y)2 ]}1/2
GxGy
Let(x,y) represent thedirectionangleofthevectorfat(x,y)
(x,y)= tan-1(Gy/Gx)
Thedirectionofanedgeat(x,y)isperpendiculartothedirectionofthegradient vector at that
point
1 Gx
Thedirectionof thegradientis:tan
G
y
a) Roberts operator
consider a33maskis thefollowing.
y
z1 z2 z3
z4 z5 z6
z7 z8 z9
Itcanbeapproximatedatpoint z5 inanumberofways.Thesimplestistousethe
difference(z 8 z5)inthexdirection and(z 6 z5 )intheydirection. Thisapproximation is known as
the Roberts operator, and is expressed mathematically as follows.
f(x,y)
Gx f(x1) f(x) z6z5
x
f(x,y)
Gy f(y1) f(y) z8 z5
y
fGxGy
1 -1 1 0
0 0 -1 0
Roberts operator
AnotherapproachistouseRobertscrossdifferences Take
Z5 Z6
Z8 Z9
ThisapproximationisknownastheRobertscrossgradientoperator,andisexpressed mathematically as
follows
fz9 z5z8z6
-1 0 0 -1
0 1 1 0
Roberts operator
Theabove Equationcanbeimplementedusingthefollowingmask.
The original image is convolved with both masks separately and the absolute values of the
two outputs of the convolutions are added.
b) Prewittoperator
consider a33maskis thefollowing. y
z1 z2 z3
z4 z5 z6
z7 z8 z9
f(x,y) x
Gx 3rdrow 1st row(z7z8z9 )(z1 z2 z3)
x
f(x,y)
Gy 3rd col 1st col (z3z6 z9) (z1z4 z7)
y
fGxGy(z 7 z8z9)(z1z2z3)(z3z6z9)(z1z4z7)
y
-1 0 1 -1 -1 -1
-1 0 1 0 0 0
-1 0 1 1 1 1
Prewittoperator
x
ThisapproximationisknownasthePrewitt operator.
Theabove Equationcanbeimplementedbyusingthefollowing masks.
c) Sobeloperator.
Thegradients arecalculatedseparatelyforhorizontalandvertical directions:
Gxx72x8x9x12x2x3
Gyx32x 6 x9x12x 4 x7
Horizontaledge Verticaledge
-1 -2 -1 -1 0 1
0 0 0 -2 0 2
1 2 1 -1 0 1
FigureSobelmasksforedge detection
The following shows the a 3 x3 region of image and various masks used to compute
the gradient at point z5
ii. SECOND DERIVATE can be approximated by the Laplacian mask given in Figure .The
drawbacks of Laplacian are its sensitivity to noise and incapability to detect the direction of
the edge. On the other hand, because it is the second derivate it producesdouble peak
(positive and negative impulse). By Laplacian, we can detect whether the pixel lies in the
dark or bright side of the edge. This property can be used in image segmentation.
0 -1 0
-1 4 -1
0 -1 0
Figure:MaskforLaplacian(secondderivate).
a) LaplacianOperator:
Itisalinearoperatorandisthesimplestisotropicderivativeoperator,whichis defined as,
(1)
Where,
(2)-
(3)
Sub(2) &(3)in(1),weget,
f2f(x1,y)f(x1,y) f(x,y1) f(x,y1)4f(x,y) - ------------- (4)
Theabovedigital laplacianequation isimplementedusingfilter mask,
0 1 0
1 -4 1
0 1 0
1 1 1
1 -8 1
1 1 1
Similarly,twootherimplementationsofthelaplacianare,
-1 -1 -1
0 -1 0
-1 -8 -1
-1 4 -1
-1 -1 -
0 -1 0
3. ExplainEdgelinkingandboundarydetectionindetail
Edge linking
Edgedetectionalgorithmisfollowedbylinkingprocedurestoassembleedgepixelsinto meaningful edges.
Basic approaches
1. LocalProcessing
2. GlobalProcessingviatheHoughTransform
3. GlobalProcessingviaGraph-TheoreticTechniques
1. Localprocessing
Analyze the characteristics of pixels in a small neighborhood (say, 3x3, 5x5) about every
edge pixels (x,y) in an image.All points that are similar according to a set of predefined
criteria are linked, forming an edge of pixels that share those criteria
Criteria
1. Thestrengthoftheresponse ofthegradientoperatorusedtoproducethe edge pixel
an edge pixel with coordinates (x0,y0) in a predefined neighborhood of (x,y)
is similar in magnitude to the pixel at (x,y) if
|f(x,y)-f (x0,y0)|E
2. Thedirection ofthegradientvector
an edge pixel with coordinates (x0,y0) in a predefined neighborhood of (x,y)
is similar in angle to the pixel at (x,y) if
|(x,y) -(x0,y0) |<A
3. A Pointin the predefined neighborhood of(x,y) is linked to the pixel at (x,y) if both
magnitude and direction criteria are satified.
4. Theprocessisrepeatedatevery locationintheimage
5. Arecord mustbekept
6. Simplybyassigning adifferentgray leveltoeachsetoflinkededge pixels.
7. findrectangleswhose sizesmakes themsuitablecandidatesforlicense plates
8. UsehorizontalandverticalSobeloperators,eliminateisolatedshortsegments
• linkconditions:
gradientvalue>25
gradientdirectiondiffers<15
2. GlobalProcessingviatheHoughTransform
Suppose that we have an image consisting of several samples of a straight line, Hough
[1962] proposed a method (commonly referred as Hough transform) for finding the line (or
lines) among these samples (or edge pixels). Consider a point (xi, yi). There is an infinite
number of lines passing through this point, however, they all can be described by
yiaxib
Thismeansthatallthelinespassing(xi,yi)aredefinedbytwoparameters,aandb.The equationcan
be rewritten as
bxiayi
Now,ifweconsiderbasafunctionofa,wherexiandyiaretwoconstants,
theparameterscan berepresented byasingle lineintheab-plane. The Houghtransform isa
process where each pixel sample in the original xy-plane is transformed to a line in the ab-
plane. Consider two pixels (x1, y1) and (x2, y2). Suppose that we draw a line L across these
points. The transformed lines of (x1, y1) and (x2, y2) in the ab-plane intersect each other in
thepoint(a',b'),whichisthedescriptionofthelineL,seeFigure.Ingeneral,themore
linescrosspoint(a,b)thestrongerindicationthatisthatthereisalineyaxb inthe
image.
To implement the Hough transform a two-dimensional matrix isneeded, see Figure. In each
cell of the matrix there is a counter of how many lines cross that point. Each line in the ab-
plane increases the counter of the cells that are along its way. A problem in this
implementation is that both the slope (a) and intercept (b) approach infinity as the line
approaches the vertical. One way around this difficulty is to use the normal representationof
a line:
xcosysind
Here d represents the shortest distance between origin and the line.represents
the angle of the shortest path in respect to the x-axis. Their corresponding ranges are[0,2D],
and [-90, 90], where D is the distance between corners in the image.Although the focus has
been on straight lines, the Hough transform is applicable to any other shape. For example,
the points lying on the circle
y b
L b=-xa
2
+y 2
x,y
22
x11,y
b'
b=-x1a+y1
x a
a'
Figure:Hough transform:xy-plane(left);ab-plane(right).
b
bmax
...
0 ... ...
bmin
...
a
amin 0 amax
Figure:Quantizationoftheparameter plane foruse inHoughtransform.
y d
dmax
...
0 ... ...
d
x dmin
...
min 0 max
Figure:Normalrepresentationofaline(left);quantizationofthed-plane intocells.
HOUGHTRANSFORMSTEPS:
1. Computethe gradientof animage andthresholdittoobtainabinaryimage.
2. Specifysubdivisionsinthe-plane.
3. Examinethecountsof theaccumulatorcellsfor highpixelconcentrations.
4. Examinetherelationship (principallyforcontinuity)between pixelsinachosencell.
5. basedoncomputingthedistancebetweendisconnectedpixelsidentifiedduring traversal
of the set of pixels corresponding to a given accumulator cell.
6. agapatanypointissignificantifthedistancebetweenthatpointanditscloset neighbor
exceeds a certain threshold.
7. linkcriteria:
1). thepixelsbelongedtooneofthesetofpixelslinkedaccordingtothehighest count
2). nogapswerelongerthan5pixels
4. ExplainThresholdingindetail.
Thresholding
Suppose that the image consists of one or more objects and background, eachhaving
distinct gray-level values. The purpose of thresholding is to separate these areas
from each other by using the information given by the histogram of the image.
If the object and the background have clearly uniform gray-level values, the object
can easily be detected by splitting the histogram using a suitable threshold value.
Thethresholdisconsideredasafunctionof:
Tg i,j,xi,j,pi,j
where i and j are the coordinates of the pixel, xi,j is the intensity value of the pixel,
and p(i, j) is a function describing the neighborhood of the pixel (e.g. the average
value of the neighboring pixels).
Athresholdimageisdefinedas:
1 ifxi,jT
fx,y
0 ifx i,jT
Pixels labeled 1 corresponds to objects and Pixels labeled 0 corresponds
tobackground
Multilevelthresholdingclassifies apointf(x,y)belongingto
onlyf(x,y):onlyongray-levelvalues🢡Globalthreshold
both f(x,y) and p(x,y) :on gray-levelvaluesand itsneighbors🢡Local
threshold
the spatialcoordinatesxandy🢡dynamicorAdaptivethreshold
Anexampleofthresholdingandthecorrespondinghistograminshownbelow
T
T1 T2
Figure:Histogrampartitionedwithonethreshold(singlethreshold),andwithtwo thresholds
(multiple thresholds).
Thethresholdingcanbeclassifiedaccordingtotheparametersitdependson:
Thresholding: Effectiveparameters:
Global xi,j
Local xi,j,p(i, j)
Dynamic xi,j, p(i, j), i , j
Figure:Exampleofhistogramwithtwooverlappingpeaks.
1. BasicGlobalThresholding:
Thisisbasedonvisualinspectionofhistogram
Selectaninitialestimatefor T.
Segmentthe image usingT.Thiswillproduce twogroupsof pixels:G1consistingof all
pixels with gray level values > T and G2consisting of pixels with gray level values
T
Computetheaverage gray levelvalues 1and2forthepixelsinregionsG1andG2
Computea newthresholdvalue
T=0.5(1+ 2)
Repeat steps 2 through 4 until the difference in T in successive iterations is smaller
than a predefined parameter To.
2. BasicAdaptive Thresholding:
Subdivideoriginalimageintosmallareas.
Utilizeadifferentthresholdtosegmenteach subimages.
Since the threshold used for each pixel depends on the location of the pixel in terms
of the sub images, this type of thresholding is adaptive.
3. OptimalGlobalandAdaptiveThresholding
Considerthefollowingtwoprobabilitydensityfunctions
Assume the larger PDF to correspond to the back ground level and the smaller PDF
to gray levels of objects in the image. The overall gray-level variation in the image,
p(z)P1p1(z)P2p2(z)
P1P21
Where P1 is the pbb that the pixel is an object pixel, P2 is the pbb that the pixel is a
background pixel.
Theprobabilityoferrorclassifying abackgroundpointasan objectpointis,as
T
E1(T) p2(z)dz
Thisis theareaunderthecurve ofP2(z)tothe left ofthethreshold
Theprobabilityoferrorclassifying aobjectpointasan backgroundpointis,as
T
E2(T)p1(z)dz
ThisistheareaunderthecurveofP1(z)totherightofthethreshold
Thentheoverallprobabilityoferroris E(T)PE(T)PE (T)
21 12
IfthetwoPDFsareGaussian then,
p(z)P1p1(z)P2p2(z)
(z )2 (z2)2
1
P1 P2
e 221
e 222
21 22
where
1and12arethe meanandvarianceof theGaussiandensityof oneobject
2and 22are the mean and variance of the Gaussian density of the other object
Substitutingequation(2)in(1),thesolutionforthethresholdTisgivenas,
AT2BTC0
where A2 1 2 2
B2(22)
1 2 2 1
C22222222ln(P/P)
1 2 2 1 1 2 21 12
Sincethequadraticequationhastwopossiblesolutions,twothresholdvaluesare required
to obtain the optimal solution.
Ifthevariancesareequal, asinglethresholdissufficient given as,
2 P
T 1 2
ln2
2 1 2 P1
ThresholdselectionBasedonBoundary Characteristics:
Thethresholdvalue selectiondependsonthepeaksinthe histogram
The threshold selection is improved by considering the pixels lying on or
neartheboundary between the objects and background
Athreelevelimagecan be formedusingthegradient, whichisgivenas,
Lightobject ofdarkbackground
0 if fT
s(x,y) iffT and2f0
iffT and2f0
Thetransitionfromobjecttothebackgroundisrepresentedbytheoccurrenceof ‘+‘
followed by ‘-’
Thusahorizontalorverticalscanlinecontainingasectionofanobjecthasthe following
structure:(…)(-,+)(0 or +)(+,-)(…)
The growing continues until a stopping rule takes effect. The region growing has
severalpractical problems:
how to select the seed points
growingrule(oruniformcriterion)
stopping rule.
All of these parameters depend on the application. In the infra-red images inmilitary
applications the interesting parts are the areas which are hotter compared to their
surroundings, thus a natural choice for the seed points would be the brightest pixel(s) in the
image. In interactive applications the seed point(s) can be given by the user who gives (by
pointing with the mouse, for example) any pixels inside the object, and the computer then
finds the desired area by region growing algorithm.
The growing rule can be the differences of pixels. The value of the pixel in
consideration can be compared to the value of its nearest neighbor inside the region.
If the difference does not exceed a predefined threshold the pixel is attended to the
region. Another criterion is to examine the variance of the region, or gradient of the pixel.
Several growing criteria worth consideration are summarized in the following:
Global criteria:
Differencebetweenxi,jandtheaveragevalueoftheregion. The
variance 2 of the region if xi,j is attended to it.
Localcriteria:
Differencebetweenxi,jandthenearestpixelinsidethe region.
The variance of the local neighborhood of pixel xi,j. If thevariance is
low enough (meaning that the pixel belongs to a homogenous area) it will
be attended to the region.
Gradient of the pixel. If it is small enough (meaning that the pixel does not belong to an
edge) it will be attended to the region.
The growing will stop automatically when there are no more pixels that meet the
uniform criterion. The stopping can also take effect whenever the size of the region gets too
large (assuming a priori knowledge of the object's preferable size). The shape of the object
can also be used as a stopping rule, however, this requires some form of pattern recognition
and prior knowledge of the object's shape.
Splittingandmerging
Thequadtreesegmentationisasimplebutstillpowerfultoolforimage decomposition.
Inthistechnique,animageisdividedintovarioussubimagesofdisjointregions and
then merge the connected regions together.
Stepsinvolvedinsplittingandmerging
Splitinto4disjointquadrantsanyregionRifor whichP(Ri)=FALSE.
MergeanyadjacentregionsRj and RkforwhichP(RjURk)=TRUE.
Stopwhennofurthermergingorsplittingispossible.
Thefollowingshowsthepartitionedimage,
Correspondingquad tree
Anexampleof quadtree-basedsplitandmergeisshown below
Inthefirstphasetheimageisdecomposedintofoursubblocks(a), which are
then further divided, except the top leftmost block (b).
Atthethirdphasethe splittingphase iscompleted(c).
At the merging phase the neighboring blocks that are uniform and have
the same color are merged together.
The segmentation results to only two regions (d), which is ideal in
thisfavorable example.
Figure:Exampleofquadtreebasedsplittingandmerging.
6. ExplainindetailaboutSegmentationbyMorphologicalWatersheds
The aim of Segmentation is to separate regions wrt brightness, color, reflectivity,
texture,etc.Segmentationbasedonthreeprincipalconcepts:(a)detectionofdiscontinuities,
(b) thresholding,and(c)region processing.
1. BasicConcepts
The concept of watersheds is based on visualizing an image in three dimensions:two
spatial coordinates versus gray levels. In such a "topographic" interpretation, we consider
three types of points:
a. Points belonging to a regional minimum
b.Catchmentbasin/watershedofa regionalminimum
Pointsatwhicha dropofwaterwillcertainlyfalltoasingle minimum
c.Dividelines/Watershedlines
Points at which a drop of water will be equally likely to fall to more than one
minimum. Crest lines on the topographic surface
Thistechnique istoidentifyallthethirdtype ofpointsforsegmentation
1. PiercingholesineachregionalminimumofI
2. The3Dtopographyisfloodedfrombelow gradually
3. When the rising water in distinct catchment basins is about to merge, a dam is built
to prevent the merging
4. Thedamboundariescorrespondtothewatershedlinestobeextractedbya
Watershed segmentation algorithm
Gray-levelvalue Watershedcontour
Catchmentbasins
Localminima
Watershed lines
These ideas can be explained further with the aid of Fig.. Figure (a) shows a simple
gray-scale image and Fig. (b) is a topographic view, in which the height of
the"'mountains’’is proportional to gray-level values in the input image. For ease of
interpretation, the backsides of structures are shaded. This is not to be confused with gray-
level values; only the general topography of the three-dimensional representation is of
interest. In order to prevent the rising water from spilling out through the edges of the
structure, we imagine the perimeter of the entire topography (image) being enclosed by
dams of height greater thanthe highest possible mountain, whose value is determined by the
highest possible gray-level value in the input image.
Suppose that a hole is punched in each regional minimum [shown as dark areas in
Fig. (b)] and that the entire topography is flooded from below by letting water rise through
the holes at a uniform rate. Figure (c) shows the first stage of flooding, where the “water”
shown in light gray, has covered only areas that correspond to the very dark background in
the image. In Figs. (d) and (e) we see that the water now has risen into the first and second
catchmentbasins,respectively.Asthewatercontinuestorise,itwilleventuallyoverflow
from one catchment basin into another. The first indication of this is shown in (f). Here,
water from the left basin actually overflowed into the basin on the right and a short
"dam”(consisting of single pixels) was built to prevent water from merging at that level
offlooding (the details of dam building are discussed in the following section), The effect is
more pronounced as water continues to rise, as shown in Fig. (g).This figure shows a longer
dam between the two catchment basins and another dam in the top part of the right basin.
The latter dam was built to prevent merging of water from that basin with water from areas
corresponding lo the background. This process is continued until the maximum level of
flooding (corresponding to the highest gray-level value in the image) is reached. The final
dams correspond to the watershed lines, which are the desired segmentation result. The
result for this example is shown in Fig. (h) as a dark, one-pixel-thick path superimposed on
the original image. Note the important property that the watershed lines form a connected
path, thus giving continuous boundaries between regions.
One of the principal applications of watershed segmentation is in the extraction of
nearly uniform (blob like) objects from the background. Regions characterized by small
variations in gray levels have small gradient values. Thus, in practice, we often see
watershed segmentation applied to the gradient of an image, rather than to the image itself.
In this formulation, the regional minima of catchment basins correlate nicely with the small
value of the gradient corresponding to the objects of interest.
2. Dam Construction
Dam construction is based on binary images, which are members of 2-D integer
space Z2. The simplest way to construct dams separating sets of binary points is to use
morphological dilation.
The basics of how to construct dams using dilation are illustrated in Fig. Figure (a)
shows portions of two catchment basins at flooding step n - 1 and Fig. (b) shows the resultat
the next flooding step, n. The water has spilled from one basin to theother and, therefore, a
dam must be built to keep this from happening. In order to be consistent with notation to be
introduced shortly,
let M1and M2denote the sets of coordinates of points in two regional minima. Then
let the set of coordinates of points in the catchment basin associated with these two minima
at stage n - 1 of flooding be denoted by and respectively.
These are the two black regions shown in Fig. (a). Suppose that each of the
connected components in Fig.(a) is dilated by the structuring element shown in Fig. (c),
subject to two conditions:
(1) The dilation has to be constrained to q (this means that the center of the structuring
element can be located only at points in q during dilation), and
(2) The dilation cannot be performed on points that would cause the sets being dilated to
merge (become a single connected component).
Figure (d) shows that a first dilation pass (in light gray) expanded the boundary of each
original connected component. Note that condition (1) was satisfied by every point during
dilation, and condition (2) did not apply to any point during the dilation process; thus the
boundary of each region was expanded uniformly.
Let the union of these two sets be denoted by C[n - 1], There are two connected
components in Fig. (a) and only one connected component in Fig. (b),This connected
component encompasses the earlier two components, shown dashed. The fact that two
connected components have become a single component indicates that water between the
two catchment basins has merged at flooding step n. Let this connected component be
denoted q. Note that the two components from step n - 1 can be extracted from q by
performing the simple AND operation .Wenotealsothatallpointsbelongingtoan
individual catchment basin form a single connected component.
In the second dilation (shown in medium gray), several points failed condition (1)
while meeting condition (2), resulting in the broken perimeter shown in the figure. It also is
evident that the only points in q that satisfy the two conditions under consideration describe
the one-pixel-thick connected path shown crossed-hatched in Fig. (d). This path constitutes
the desired separating dam at stage n of flooding. Construction of the dam at this level of
flooding is completed by setting all the points in the path just determined to a value greater
than the maximum gray-level value of the image. The height of all dams is generally set
at1plus themaximumallowed value inthe image. Thiswillpreventwater from crossing over
the part of the completed dam as the level of flooding is increased. It is important to note
that dams built by this procedure, which are the desired segmentation boundaries, are
connected components. In other words, this method eliminates the problems of broken
segmentation lines,
Although the procedure just described is based on a simple example, the method
used for more complex situations is exactly the same, including the use of the 3 X 3
symmetric structuring elements shown in Fig. (c).
7. ExplainWatershedSegmentationAlgorithmindetail
Watershed Transform
1. Denote Cn(Mi) as the set of coordinates of points in the catchment basin associated with
minimum Miat flooding stage n.
– Cn(Mi)=C(Mi) T[n]
– Cn(Mi)=T[n]
2. DenoteC[n]astheunionofthefloodedcatchmentbasinportionsatstagen:
– Initialization
– Let C[min+1]=T[min+1]
3. At each step n,assume C[n-1] has been constructed. The goal is to obtainC[n] from C[n-
1]
DenoteQ[n]asthesetofconnectedcomponentsin T[n].
4. Foreach qQ[n],therearethreepossibilities
1. qC[n-1]isempty (q1)
• Anew minimumis encountered
• qisincorporatedintoC[n-1] toformC[n]
2. qC[n-1]containsone connectedcomponentof C[n-1](q2)
• qisincorporatedintoC[n-1] toformC[n]
3. qC[n-1]containsmore thanoneconnectedcomponentsofC[n-1] (q3)
• Aridgeseparatingtwoormorecatchmentbasinshasbeen encountered
• Adamhastobebuiltwithinqtopreventoverflowbetweenthe catchment
basins
4. Repeattheprocedureuntiln=max+1
WATERSHEDSEGMENTATIONALGORITHM
1. LetM1, M2, M3….Mnbe the sets of coordinatesof points in the regional minima of
theimage g(x,y)
2. C(Mi)bethecoordinatesofpointsofthecatchmentbasinassociatedwithregional minima Mi
T[n]={(s,t)|g(s,t) <n }
T[n] = Set of points in g(x,y) which are lying below theplaneg(x,y)=n n
= Stage of flooding, varies from min+1 to max+1
min = minimum gray level value
max =maximumgraylevelvalue
3. Let Cn(M1)be theset ofpoints in thecatchment basin associated with M1that are flooded at
stage n.
7. Condition (a) occurs when a new minima is encountered, in this case q is added to set
C[n-1] to form C[n].
8. Condition (b) occurs when q lies within a catchment basin of some regional minima, in
that case
9. Condition (c) occurs when ridge between two catchment basins is hit and further
flooding will cause the waters from two basins will merge, soa dam must be built within q.
Consider the image and its gradient, shown in Figs. (a) and (b), respectively. Application of
the watershed algorithm just described yielded the watershed lines (white paths} of the
gradient image shown in Fig. (c).These segmentation boundaries are shown superimposed
on the original image in Fig. (d). As noted at the beginning of this section, (thesegmentation
boundaries have the important property of being connected paths).
Amorphologicalregiongrowingapproach.
Seed points:
– localminimapoints
Growing method:
– Dilation
Predicates
– Similargradientvalues
Sub-regionboundary
– Dambuilding
To avoid over-segmentation
– Use markers
Disadv:Conceptisdifficulttounderstand
8. ExplainMorphologicalImageProcessingindetails
Morphological Image Processing is an important tool in the Digital Image processing, since
that science can rigorously quantify many aspects of the geometrical structure of the way
that agrees with the human intuition and perception.
Morphologic image processing technology is based on geometry. It emphasizeson
studying geometry structure of image. We can find relationship between each part of image.
When processing image with morphological theory. Accordingly we cancomprehend the
structural character of image in the morphological approach an image is analyzed in terms
of some predetermined geometric shape known as structuring element.
Morphological processing is capable of removing noise and clutter as well as the
abilitytoedit animage based onthesizeandshape of theobjects ofinterest. Morphological
Image Processingis used in the place of a Linear Image Processing, because it sometimes
distort the underlying geometric form of an image, but in Morphological image Processing,
the information of the image is not lost.
In the Morphological Image Processing the original image can be reconstructed
by using Dilation, Erosion, Opening and Closing operations for a finite no of times. The
major objective of this paper is to reconstruct the class of such finite length Morphological
Image Processing tool in a suitable mathematical structure using Java language.
BinaryImage:-
TheimagedataofBinaryImageisBlackandWhite.Eachpixeliseither‘0’or‘1’.
AdigitalImage iscalled BinaryImageifthegrey levelsrange from0and1.
Ex:A Binary Imageshown belowis,
1 1 1 1 0
1 1 1 1 0
0 1 1 1 0
0 1 1 1 0
(A4*5Binary Image)
DILATION:-
Dilation - growimageregions
Repeat for all pixel co-ordinates. Dilation creates new image showing all the
location of a structuring
element origin at which that structuring element HITS the Input Image. In this it adds alayer
of pixel to an object, there by enlarging it.Pixels are added to both the inner andouter
boundaries of regions, so Dilation will shrink the holes enclosed by a single regionand make
the gaps between different regions smaller. Dilation will also tend to fill in any small
intrusions into a region’s boundaries.
The results of Dilation are influenced not just by the size of the structuring
element but by its shape also.
Dilation is a Morphological operation; it can be performed on both Binary and Grey Tone
Images. It helps in extracting the outer boundaries of the given images.
ForBinaryImage:-
Dilationoperationisdefinedasfollows,
D(A, B)=AB
Where,
Ais theimage
Bisthestructuringelement oftheorder3* 3.
Manystructuringelementsarerequested forDilatingtheentireimage.
EROSION:-
Erosion -shrinkimageregions
Erosion causes objects to shrink. The amount of the way that they shrink depend
uponthechoiceofthestructuringelement.Erosionmakesanobjectsmallerbyremovingor Eroding
away the pixels on its edges [3].
The Erosion of an image ‘A’ by a structuring element ‘B’ is denoted asA Θ B.
Tocomputethe Erosion,weposition ‘B’suchthatits originisatimagepixelco-ordinate (x , y) and
apply the rule.
1if‘B’Fits ‘A’,
g(x,y)=
0 otherwise
Repeat for all x and y or pixel co-ordinates. Erosion creates new image that marks all the
locations of a Structuring elements origin at which that Structuring Element Fits the input
image. The Erosion operation seems to strip away a layer of pixels from an object,shrinking
it in the process. Pixels are eroded from both the inner and outer boundaries of regions. So,
Erosion will
enlarge the holes enclosed by a single region as well as making the gap between different
regionslarger.Erosionwillalsotendtoeliminatesmallextrusionsonaregionsboundaries.
Theresultoferosion depends onStructuringelement sizewithlarger Structuring
elements having a more pronounced effect & the result of Erosion with a large Structuring
element is similar to the result obtained by iterated Erosion using a smaller structuring
element of the same shape.
Erosion is the Morphological operation, it can be performed on Binary andGrey
images.It helps in extracting the inner boundaries of a given image.
ForBinaryImages:-
Erosionoperationisdefined asfollows,
E(A, B)=AΘ B
Where,Aistheimage
Bisthestructuringelement oftheorder3* 3.
Manystructuringelements arerequired forerodingtheentireimage.
OPENING:-
FUTURESCOPE:-
TheMorphologicalImageProcessingcanbefurtherappliedtoawidespectrum of
problems including:
Medicalimageanalysis:Tumordetection,measurementofsizeandshapeof internal
organs, Regurgitation, etc.
Robotics: Recognition and interpretation of objects in a scene, motion control
andexecution through visual feedback
Radarimaging:Targetdetection and identification.
UNITVIMAGECOMPRESSIONANDRECOGNITION
Need for data compression, Huffman, Run Length Encoding, Shift codes, Arithmetic coding, JPEG
standard, MPEG. Boundary representation, Boundary description, Fourier Descriptor, Regional
Descriptors – Topological feature, Texture - Patterns and Pattern classes - Recognition based on
matching.
PART–A
1. Whatisimage compression?
Image compression refers to the process of redundancy amount of data required to
represent the given quantityof information for digital image. The basis of reduction process
is removal of redundant data.
2. DefineDataCompression.
The term data compression refers to the process of reducing the amount of data
required to represent a given quantity of information.
3. WhataretwomaintypesofDatacompression?
1. Lossless compression can recover the exact original data after compression. It is used
mainly for compressing database records, spreadsheets or word processing files.
2. Lossy compression will result in a certain loss of accuracy in exchange for asubstantial
increase in compression. Lossy compressionis more effective when used to compress
graphic images and digitized voicewhere losses outside visual perception canbe tolerated.
4. Whatistheneed forCompression?
1. In termsofstorage, thecapacityofastoragedevicecanbeeffectivelyincreased with
methods that compress a body of data on its way to a storage device and decompress it
when it is retrieved.
2. In terms of communications, the bandwidth of a digital communication link can be
effectively increased by compressing data at the sending end and decompressing data at
the receiving end.
3. At any given time, the ability of the Internet to transfer data is fixed. Thus, if data can
effectively be compressed wherever possible, significant improvements of datathroughput
can be achieved. Many files can be combined into one compressed document making
sending easier.
5. Showthe blockdiagramofageneral compressionsystem model.
Encoder Decoder
6. DefineRelativedataredundancy.
TherelativedataredundancyRDofthefirstdatasetcanbedefinedas
1
RD1
CR
n1
WhereCR,commonlycalledthe compressionratio, is CR
n2
7. Whatarethe threebasicdataredundanciescanbeidentifiedandexploited?
Thethreebasicdataredundanciesthatcanbeidentifiedandexploitedare,
i) Codingredundancy
ii) Interpixelredundancy
iii) Phychovisualredundancy
8. Defineiscodingredundancy?
If the gray level of an image is coded in a way that uses more code words than
necessaryto represent each graylevel, then theresulting image is said to contain coding
redundancy.
9. Defineinterpixelredundancy?
The value of any given pixel can be predicted from the values of its neighbors. The
information carried by is small. Therefore the visual contribution of a single pixel to an
image is redundant. Otherwise called as spatial redundant geometric redundant or interpixel
redundant.
Eg:Runlengthcoding
10. Definepsychovisualredundancy?
In normal visual processing certain information has less importance than other
information. So this information is said to be psycho visual redundant.
11. Define encoder
Sourceencoderisresponsibleforremovingthecodingandinterpixelredundancy and
psycho visual redundancy.
Encoderhas2componentstheyare1.sourceencoder2.channelencoder
12. Definesource encoder
Sourceencoderperformsthreeoperations
1) Mapper -this transforms the input data into non-visual format. It reduces the
interpixel redundancy.
2) Quantizer - It reduces the psycho visual redundancyof the input images .This
step is omitted if the system is error free.
3) Symbol encoder- This reduces the coding redundancy.This is the final stage of
encoding process.
13. Definechannelencoder
The channel encoder reduces the impact of the channel noise by inserting redundant
bits into the source encoded data.
Eg:Hammingcode
14. Whatarethetypes ofdecoder?
1. Source decoder-hastwocomponents
a) Symboldecoder-Thisperformsinverseoperationofsymbol encoder.
b) Inversemapping-Thisperformsinverseoperationofmapper.
2. Channeldecoder-thisisomittedifthesystemiserror free.
15. Whatarethe basicimage datacompressiontechniques?
Imagedatacompressiontechniques
21. Definecompressionratio&bitrate
sizeofthecompressedfile C
Bitrate= (bitsperpixel)
pixelsintheimage N
sizeoftheoriginalfile Nk
Compressionratio =
sizeofthecompressedfile C
23. WhatisVariableLengthCoding?
Variable Length Coding is the simplest approach to error free compression. It
reduces only the coding redundancy. It assigns the shortest possible codeword to the most
probable gray levels.
24. DefineHuffman coding
1. Huffmancodingisapopulartechnique forremovingcodingredundancy.
2. WhencodingthesymbolsofaninformationsourcetheHuffmancode yieldsthe
smallest possible number of code words, code symbols per source symbol.
25. DefineBlockcodeandinstantaneouscode
Eachsourcesymbolismappedintofixedsequenceofcodesymbolsorcodewords.
Soitiscalledasblockcode.
A code word that is not a prefix of any other code word is called instantaneous or
prefix codeword.
26. Defineuniquelydecodablecode andB2code
A code word that is not a combination of any other codeword is said to be uniquely
decodable code.
Each code word is made up of continuation bit c and information bit which are
binary numbers. This is called B2 code or B code. This is called B2 code because two
information bits are used for continuation bits
27. Definearithmeticcoding
In arithmetic codingone to one corresponds between source symbols and code word
doesn’t exist where as the single arithmetic code word assigned for a sequence of source
symbols. A code word defines an interval of number between 0 and 1.
28. WhatisbitplaneDecomposition?
An effective technique for reducing an image’s interpixel redundancies is to process
the image’s bit plane individually. This technique is based on the concept of decomposing
multilevelimagesinto aseriesof binaryimages and compressingeachbinaryimage viaone of
several well-known binary compression methods.
29. DefineBit-plane Coding.
Oneof theeffective techniques for reducing an image’s interpixel redundancies is to
process the image’s bit plane individually. This techniques is called bit-plane coding is
based on the concept of decomposing a multilevel image into a series of binary image and
compressing each binary image.
30. DefineTransformcoding.
Compression techniques that are based on modifying the transform an image. In
transform coding, a reversible, linear transform is used to map the image into a set of
transform coefficients which are then quantized and coded.
31. Showthe blockdiagramofencoder& decoderoftransform coding.
Input Construct
Forward Symbol Compressed
MXn sub Quantizer
transform encoder Image
Image image
A. Theblockdiagramofencoder& decoderofLosslesscompression
Input
Source Symbol
Image encoder encoder Compressed
Image
Compressed
Symbol Source Decompressed
decoder decoder
Image Image
1. Sourceencoderisresponsibleforremovingthecodingandinterpixelredundancyand
psycho visual redundancy.
2. Symbolencoder-Thisreducesthecodingredundancy.Thisisthefinalstageof
encoding process.
Sourcedecoder-hastwocomponents
a) Symboldecoder-Thisperformsinverseoperationofsymbol encoder.
b) Inversemapping-Thisperformsinverseoperationofmapper.
LosslessCompression technique
Varaiblelengthcoding(Huffmann,arithmetic), LZW coding,Bit Planecoding,Lossless Predictive
coding
142
B. Theblockdiagramof encoder& decoderofLossycompression
Input
Mapper Quantizer Symbol Compressed
Image encoder Image
Compressed
Symbol Inverse Decompressed
decoder Dequantizer transform Image
Image
Lossycompressionwillresultinacertainlossofaccuracyinexchangefora
Substantialincreaseincompression.Lossycompressionismoreeffectivewhenusedto compressgraphic
images
1. Informationlossistolerable
2. Many-to-1mappingincompression eg.quantization
3. Applications:commercialdistribution(DVD)andrateconstrainedenvironmentwherelossless
methods can not provide enough compression ratio
1) Mapper-thistransformstheinputdataintonon-visualformat.Itreducesthe
interpixel redundancy.
2) Quantizer-Itreducesthepsychovisualredundancyoftheinputimages.Thisstepis omitted
if the system is error free.
3) Symbolencoder-Thisreducesthecodingredundancy.Thisisthefinalstageof
encoding process.
Sourcedecoder-hastwocomponents
a) Symboldecoder-Thisperformsinverseoperationofsymbolencoder.b)
Inverse mapping- This performs inverse operation of mapper.
Channeldecoder-thisisomittedifthesystemiserror free.
LossyCompression technique
Lossypredictvecoding(DPCM,Deltamodulation),Transformcoding,Wavelet coding.
2. ExplainindetailtheHuffmancodingprocedurewithanexample.(May/June2009), (May /
June 2006) (Variable length coding)
Huffman coding is based on the frequency of occurrence of a data item (pixel in images). The
principle is to use a lower number of bits to encode the data that occurs more frequently. Codes
are stored in a Code Book which may be constructed for each image or a set of images. In all
cases the code book plus encoded data must be transmitted to enable decoding.
143
Abottom-up approach
1. Initialization:PutallnodesinanOPENlist,keepitsortedatalltimes(e.g.,ABCDE).
2. RepeatuntiltheOPENlisthasonlyone nodeleft:
(a) FromOPENpicktwonodeshavingthelowestfrequencies/probabilities,createaparentnode of
them.
A 15 1.38 0 15
B 7 2.48 100 21
C 6 2.70 101 18
D 6 2.70 110 18
E 5 2.96 111 15
TOTAL(# ofbits):87
a) Huffmanncoding:
i) Orderthegivensymbols inthedecreasingprobability
ii) Combinethebottomtwoortheleastprobabilitysymbolsintoasinglesymbolthat
replaces in the next source reduction
iii) Repeattheabovetwostepsuntilthesourcereductionisleftwithtwosymbolsper
probability
iv) Assign‘0’tothefirstsymboland‘1’ tothe secondsymbol
144
v) Codeeachreducedsourcestartingwiththesmallestsourceandworkingbackto the
original source.
1. AverageInformationperSymbolor Entropy:
n n
H(S)piI(si)pilog2pi Bits/symbol
i1 i1
N
H(s)
3. Efficiencyisgivenas L
avg
th
Pi=probabilityofoccurrenceofthei symbol, Li =
length of the ithcode word,
N=numberofsymbols tobeencoded
Problem:ADMSxhasfiveequallylikelysymbolsP(x1)=p(x2)=P(X3)=p(x4)=P(x5)=0.2 construct the
Huffman code cu calculate the efficiency.
145
Xi p(xi) 0.4(m4+m5) 0.4(m2+m3)
X3 0.2m3 0.2m3 m1
0
X4 0.2m4
1
X5 0.2m5
0.60(m1+m4+m5)
0.41(m2+m3)
Xi code Length
x1 00 2
x2 10 2
x3 11 2
x4 000 3
x5 001 3
H(x)=-Σ(5,i=1)p(xi)log(2)p(xi)
=-[(0.2log2(0.2)X5] H(x)
= 2.32
L=Σ(5,i=1) p(xi)ni
=(0.2)(2+2+2+3+3)
L=2.4
Therefore%q=H(x)/Llog2(M) =2.32/2.4log2(2) = 96.7%
PropertiesofHuffman coding:
146
1. Optimumcode fora givendata setrequirestwopasses.
2. CodeconstructioncomplexityO(N logN).
3. Fast lookuptablebasedimplementation.
4. Requiresatleastonebitper symbol.
5. Averagecodewordlengthiswithinonebitofzero-orderentropy(Tighterboundsare
known): H R H+1 bit
6. Susceptibletobit errors.
b) TheShannon-FanoAlgorithm
Algorithm:
1. Listthesource symbols inorder ofdecreasingprobability.
2. partition the set in to two sets that are close to equiprobables as possible and assign O to
theupper set, 1 to the loser set.
3. continue this process, each time partitioning the sets with as nearly equal probabilities as
possible until further portioning is not possible.
ExampleA DMS x has four symbols x1,x2,x3 cu x4 with P(x1) = 1/2 , P(x2) = ¼ and P(x3) =
P(x4) = 1/8 construct the Shannon-fano code for x./show that his code has the optimumproperty
that ni=I(xi) cu the code efficiency is 100 percent.
Xi p(xi) code
X1 0.5 0 1
X2 0.25 1 0 2
X3 0.125 11 0 3
X4 0.125 11 1 3
H(x)=Σ(4,i=1) p(xi)log(2)1/p(xi)
=-[0.5log(2)0.5+ 0.25log(2)0.25+0.125log(2)0.125+0.125log(2)0.125]
=-[-1.75]=1.75 bits/symbol.
147
L=Σ(4,i=1) p(xi)ni
=0.5(1)+0.25(2)+0.125(3)+0.125(3)
L=1.75
Q=H(x)/Llog(2)m= 1.75/1.75log(2)2=1
Thereforeq=100%
Symbol A B C D E
Count 15 7 6 6 5
EncodingfortheShannon-Fano Algorithm:
Atop-downapproach
1. Sortsymbolsaccordingtotheirfrequencies/probabilities,e.g., ABCDE.
2. Recursivelydivideintotwoparts,eachwithapprox.samenumberofcounts.
3. Describearithmeticcodingofimageswithanexample.(May/June2006)
Arithmetic Coding:
Basicidea:Mapinputsequenceof symbolsintoonesinglecodeword
Codeword is determined and updated incrementally with each new symbol (symbol-by-
symbolcoding)
Atanytime,thedetermined codeworduniquelyrepresentsallthepastoccurringsymbols.
148
Codeword is represented by a half-open subinterval [Lc,H]=[0,1].The half-open subintervalgives
the set of all codewords that can be used to encode the input symbol sequence, which consists of
all past input symbols. Any real number within the subinterval [Lc,Hc] can be assigned as the
codeword representing the past occurring symbols.
Algorithm:
Let
S={s0,…,s(N-1)}–sourcealphabet
pk= P(sk) – probability of symbol sk, 0 ≤ k ≤ ( N – 1 )
[Lc,Hc]-Intervalassignedtosymbolsk,where pk=Hsk-Lsk
Thesubinterval limitscan becomputedas:
EncodingProcedure:
1. Codingbeginsbydividinginterval[0,1]intoNnon-overlappingintervalswith
lengths equal to symbol probabilities pk
2. Lc = 0; Hc=1
3. Calculatecodesubintervallength:length=Hc–Lc
4. Getnextinputsymbolsk
5. Updatethecodesubinterval
Lc= Lc+ length·Lsk
Hc=Lc+length·Hsk
6. RepeatfromStep3untilalltheinputsequence hasbeenencoded
Decodingprocedure:
1. Lc = 0; Hc=1
2. Calculatecodesubintervallength:length=Hc–Lc
3. Findsymbolsubinterval,0≤ k≤(N–1 )suchthat
4. Outputsymbol sk
5. Updatethecode subinterval
Lc= Lc+ length·Lsk
Hc=Lc+length·Hsk
6. RepeatfromStep2untillastsymbolisdecoded.
In order todetermine whentostopthe decoding:
"A specialend-of-sequence symbolcan beaddedtothesourcealphabet.
" If fixed-length block of symbols are encoded, the decoder can simply keep a count of
the number of decoded symbols
Example:
149
1.Constructcodewords usingarithmeticcodingforthesequences0,s1,s2,s3withprobabilities
{0.1,0.3,0.4,0.2}
Answer:
4. ExplainthelosslessBitplanecodingorshiftcoding Bit-
Plane Coding:
The concept of decomposing a multilevel image into a series of binary images and
compressing each binary image via one of the several well known binary compression methodsis
called as Bit plane coding.
Bit Plane Decomposition: An m-bit gray scale image can be converted into m binary images by
bit-plane slicing. These individual images are then encoded using run-length coding.Code the bit
planes separately, using RLE (flatten each plane row-wise into a 1D array), Golomb coding, or
any other lossless compression technique.
• LetIbeanimagewhere every pixelvalueisn-bitlong
• Expresseverypixelin binaryusingn bits
150
• Form n binary matrices (called bitplanes), where the i-th matrix consists of the i-th bits of
the pixels of I.
Example:LetIbe thefollowing2x2image wherethepixelsare3bits long
101110
111011
Thecorresponding3bitplanesare:
1 1 0 1 1 0
1 0 1 1 1 1
However, a small difference in the gray level of adjacent pixels can cause a disruption of the run
of zeroes or ones.
Eg: Let us say onepixel has agray level of 127 andthenextpixel has a gray level of128. In
binary: 127 = 01111111 & 128 = 10000000 .Here the MSB’s of the two binary codes for 127 and
128 are different, bit plane 7 will contain a zero-valued pixel next to a pixel of value 1, creating a
0 to 1 or 1 to 0 transitions at that point.
Thereforeasmallchange ingraylevelhasdecreasedtherun-lengthsinallthebit-planes.
GRAYCODE APPROACH
1. Graycodedimagesarefreeofthisproblemwhichaffectsimageswhichareinbinary format.
2. Ingraycodetherepresentationofadjacentgraylevelswilldifferonlyinonebit(unlike binary
format where all the bits can change).
3. Thuswhengraylevels127and128areadjacent,onlythe7thbitplanewillcontaina0to 1
transition, because the gray codes that correspond to 127 and 128 are as follows,
4. Ingraycode:
127 =01000000
128 =11000000
5. Thus,smallchangesingraylevelsare lesslikelytoaffectallmbitplanes.
6. Letgm-1…….g1g0representthegraycoderepresentationofabinarynumber.
7. Then:
giaiai1gm 0im2
1am1
Example:
151
Dec Gray Binary
0 000 000
1 001 001
2 011 010
3 010 011
4 110 100
5 111 101
6 101 110
7 100 111
Decodingagraycodedimage:
TheMSBisretainedas such,i.e.,
aig i ai1am 0im2
gm1
1
5. ExplaintheRun-lengthCoding
Run-length Coding:
1. Run-lengthEncoding,orRLEisatechniqueusedtoreducethesizeofarepeatingstring of
characters.
2. Thisrepeatingstringiscalledarun,typicallyRLEencodesarunofsymbolsintotwo bytes , a
count and a symbol.
3. RLEcancompressany typeofdata
4. RLEcannotachievehigh compressionratioscomparedtoothercompression methods
5. It iseasytoimplementandisquicktoexecute.
6. Run-lengthencodingissupportedbymostbitmapfileformatssuchasTIFF,BMPand PCX
7. The most common approaches for determining the value of a run are (a) to specify the
valueofthefirstrunofeachrow,or(b)toassumethateachrowbeginswithawhiterun, whose run
length may in fact be zero.
8. Similarly,intermsofentropy,theapproximationrun–lengthentropy oftheimageis,
H H
H RL 0 1
L 0 L1
Where,L0andL1denotestheaveragevaluesofblackandwhiterunlengths,H0isthe entropy
of black runs, and H1 is the entropy of white runs.
9. Theaboveexpressionprovidesanestimateoftheaveragenumberofbitsperpixel
required to code the run lengths in a binary image using a variable-length code.
Example:
i.WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWW
WWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
RLEcoding:12W1B12W3B24W1B14W
152
ii) 1111100011111100000–RLEcoding-5W3B6W5B– 5365
iii) 0000011100–RLEcoding–5B3BW2B–532–0532(first‘0’indicatesstarting with
black)
6. ExplainTransformcoding.(May/June2009),(May/June2009)
Transform Coding
Herethecompressiontechniqueisbased onmodifyingthetransformofanimage.
Theblockdiagramofencoder& decoderoftransform coding.
Input Construct
Forward Symbol Compressed
MXn sub Quantizer
transform encoder Image
Image image
Explanation:
1. The NxN output image is subdivided into sub images of size nxn, which are then transformed
to generate (N/n)2sub image transformarrays each of size n x m.
2. Transformationisdonetodecorrelatethepixelsofeachsubimageortopackasmuch information as
possible into the smallest number of transform coefficients.
Thefollowingtransformsareusedintheencoder blockdiagram
a. KLT
b. DCT
c. WHT
d. DFT
MostlyusedisDCTorDFT
3. Quantizationis done to eliminate the coefficients which carry least information. These omitted
coefficients will have small impacts on the quality of the reconstructed sub images.
4. Finally,thequantizedcoefficientsareencoded.
5. The decoder is used to extract the code words, which are applied to the dequantizer, which is
used to reconstruct the set of quantized transform coefficients.
6. Then the set oftransform coefficientsthat representsthe image isproduced fromthe quantized
coefficients.
7. These coefficients are inverse transformed and give the lossy version of the image. Here
thecompression ratio is low.
STEPS:
i. Subimagesizeselection:
Normally4x4,8,x,8and16x16imagesizesare selected
ii. TransformSelection:
Consideranimagef(x,y)ofsizeNxN,then thetransformedimageisgivenas,
153
Transformedimage=inputimagexTransformation function
N1N1
i.e.,
T(u,v) f(x,y)g(x,y,u,v)
x0y0
where,g(x,y,u,v)=transform function
Theoriginalsignalatthe decoderisgivenas,
N1N1
f(x,y) T(u,v)h(x,y,u,v)
u0v0
-1
Whereh(x,y,u,v)=g (x,y,u,v)
a. IncaseofDFT:
uxvy
1 j2
g(x, y,u,v) e N
N2 uxvy
j2
N
h(x,y,u,v)e
b. IncaseofWHT:
m1
1 [bi(x)pi(u)bi(y)pi(v)]
g(x,y,u,v)h(x,y,u,v) N (1)i0
m th
WhereN=2 , bk (z)isthe k bitfromrighttoleftinthebinary representationof z.
c. In caseofKL transform:
T
v *u
Where,u =input image
Φk=KthcolumnofEigenvectors V
= transformed image
d. IncaseofDiscreteCosineTransform(DCT)
2x1u 2y1v
gx,y,u,vh(x,y,u,v)uvcos cos
2N 2N
where, 1
foru0
u N
2
N
foru1,2,...,N1
1
forv0
v N
2
N forv1,2,...,N1
iii. BitAlloca tion:
Theoverallprocessoftruncating,quantizing,andcodingthecoefficientsofatransformedsub image
is commonly called bit allocation
a. Zonal coding
The process in which the retained coefficients are selected on the basis of maximum variance is
called zonal coding.
154
LetNtbethenumberoftransmittedsamplesandthezonalmaskisdefinedasanarraywhich takes the unity
value in the zone of largest Nt variances of the transformed samples.
i.e., 1,(k,l)It
m(k,l)
0,else,
Here the pixel with maximum variance is replaced by 1 and a 0 in all other locations. Thus the
shape of the mask depends on where the maximum variances pixels are located. It can be of any
shape.
Thresholdcoding
Theprocessinwhichtheretainedcoefficientsareselectedonthebasisofmaximummagnitude is called
threshold coding.
1. Hereweencode theNtcoefficientsof largest amplitudes.
2. Theamplitudeofthe pixelsare takenandcomparedwiththethresholdvalue
3. Ifitisgreater thanthethresholdη,replaceitby1else by0.
Thresholdmaskmηisgivenby,
1,(k,l) It
'
m(k,l)
where,I' 0,elsewhere
t(k,l);V(k,l)
4. Thenthesamplesretainedarequantizedbyasuitableuniformquantizerfollowedbyan
entropy coder.
Therearethreebasicwaystothresholdatransformedsubimage.
a.Asingleglobalthresholdcanbeappliedtoallsubimages–herethelevelofcompression differs from
image to image depending on the number of coefficients.
b. Adifferentthresholdcanbeusedforeachsubimage–Thesamenumberofcoefficientsis
discarded for each sub image.
Thethresholdcanbevariedasafunctionofthelocationofeachcoefficientswithinthesub image.
Here, T(u,v)
T(u,v) round
Z(u,v)
Z(0,0) Z0,1...
Z0,n1
Z(1,0) ... ...
...
Z
.... ... ... ...
Z(n1,0) ... ... Z(n1,n1)
Where, T(u,v)isathresholdandquantizedapproximationofT(u,v)andZ(u,v)isan
elementofthetransformnormalizationarray.
Thedenormalized arrayisgiven as,
T'(u,v)T(u,v)z(u,v)
Thedecompressed subimageisgivenas,
1
'
T (u,v)
155
And assumesinteger vaue kifandonlyif,
c c
T(u,v) kc T(u,v)kc
2 2
IfZ(u,v)>2T(u,v),then T(u,v) =0andthetransformcoefficient iscompletelytruncatedor
discarded.
7. DescribeontheWaveletcodingofimages.(May/June2009)orExplainthelossy
compression wavelet coding.
ENCODER
Input Construct
Wavelet Symbol Compressed
MXn sub Quantizer
transform encoder Image
Image image
DECODER
Explanation:
1. Input image is applied to wavelet transform, which is used to convert the original input image
into horizontal, vertical and diagonal decomposition coefficients with zero mean and laplacian
like distribution.
2. These wavelets pack most of the information into a small number of coefficientsand the
remaining coefficients can be quantized or truncated to zero so that the coding redundancy is
minimized.
3. Runlength,huffmann, arithmetic,bitplanecodingareusedforsymbolencoding
4. Decoderdoes theinverseoperationof encoding
The difference between wavelet and transform coding is that the sub image processing is
not needed here.Wavelettransforms are computationally efficient and inherently local.
Waveletselection:
ThefourDiscretewavelertransformsare,
1. Haar wavelets – simplest
2.Daubechieswavelets–mostpopular
3. Symletwavelet
4. Bioorthogonal wavelet
156
Wavelets
Wavelets aremathematicalfunctions that cut up data into different
frequencycomponents,andthen study each component with a resolution matched to its scale.
Thesebasisfunctionsorbabywaveletsareobtainedfromasingleprototypewaveletcalledthe mother
wavelet, by dilations or contractions (scaling) and translations (shifts).
wavelet Transform
WaveletTransformisatypeofsignalrepresentationthatcangivethefrequencycontentofthe signal at
a particular instant of time.
1. Wavelettransformdecomposesasignalintoasetofbasisfunctions.
2. Thesebasisfunctionsarecalled wavelets
3. Waveletsareobtainedfromasingleprototypewavelety(t)calledmotherwaveletbydilations and
shifting:
1 tb
(t) ( )
a,b
a a
whereaisthescalingparameterandbistheshiftingparameter The 1-
D wavelet transform is given by :
Theinverse1-Dwavelettransformisgivenby:
WaveletanalysishasadvantagesovertraditionalFouriermethodsinanalyzingphysical
situations where the signal contains discontinuities and sharp spikes
Typesofwavelettransform
1. Thediscretewavelettransform
2. Thecontinuouswavelet transform
157
LL: Horizontal Lowpass& Vertical Lowpass , LH: Horizontal Lowpass& Vertical Highpass
HL:HorizontalHighpass&VerticalLowpass,HH:HorizontalHighpass&VerticalHighpass
Quantizer Design:
Thelargestfactoreffectingwaveletcodingcompressionandreconstructionerroriscoefficient quantization.
Theeffectivenessofthequantizationcanbeimprovedby,(i)introducinganenlarged
quantizationinterval aroundzero,called adeadzoneand(ii)adaptingthesizeofthe
quantization interval from scale to scale.
8. WritenotesonJPEGstandardwithneatdiagram.(May/June2009),(May /June 2006)
1. JPEG:Itdefinesthreedifferentcodingsystems:
1.Alossybaseline codingsystem, adequatefor mostcompressionapplications
2. Anextendedcodingsystemforgreatercompression,higherprecisionorprogressive
reconstruction applications
3. Alosslessindependent codingsystem forreversible compression
DetailsofJPEGcompressionAlgorithm
1) Level shifttheoriginalimage
2) Dividetheinputimageinto8x8 blocks
3) ComputeDCTforeachblock(matrix) (8x8)
4) Sortelementsofthe 8x8 matrix
5) Processoneblockatatimetogettheoutputvectorwithtrailingzeros
Truncated
158
Thequantizedcoefficient isdefinedas
F(u,v)
F(u,v)Quantizationround andthereverse theprocess
Q(u,v)
can beachievedby
F(u,v)deQF(u,v)QuantizationQ(u,v)
6) DeleteunusedportionoftheoutputvectorandencodeitusingHuffman
Coding.
7) Storethesize,numberofblocksforuse inthedecoder
JPEGEncoderBlockDiagram
DetailsofJPEGDecompression Algorithm
1) Computethereverseorderfortheoutput vector
2) PerformHuffmandecodingnext.
3) Restore theorder ofthematrix
4) DenormalizetheDCTandperformblockprocessingtoreconstructthe
Original image.
5) Levelshiftback thereconstructedimage
JPEGDecoderBlockDiagram
159
2. JPEG2000
JPEG2000Encoder Algorithm:
a. ThefirststepoftheencodingprocessistoDClevelshiftthepixelsoftheimage by
subtracting 2m-1, where 2mis the number of gray levels of the image
b. Iftheinputimageisacolorimage,thenRGBvalueisconvertedintoYUVandthese
components are level shifted individually.
c. Aftertheimage hasbeenlevel shifted,itscomponents are dividedintotiles.
d. Tilesare rectangular arrays ofpixelsthatcontainthe samerelative portionofallthe
components.Tilecomponentisthebasicunitoftheoriginalorreconstructedimage.
e. Awavelettransformisappliedoneachtile.Thetileisdecomposedintodifferent
resolution levels.
f. The decomposition levels are made up of sub bands of coefficients that describe the
frequencycharacteristicsoflocalareasofthetilecomponents,ratherthanacrossthe entire
image component.
g. Thus1D-DWToftherowsandcolumnsof eachtilecomponent isthencomputed.
COMPRESSEDIMA
IMAGE( ENTROPY GE
8X8BLO FDWT ENCODER
QUANTIZER
CK)
TABLESPECIFICATION
Mainstructure ofJPEG2000encoder.
h. Thisinvolvessixsequential liftingandscalingoperations.
Y(2n1)X(2n1)[X(2n)X(2n2)],io32n1i13
Y(2n)X(2n)[Y(2n1)Y(2n1)],io22ni12
Y(2n1)Y(2n1)[Y(2n)Y(2n2)],io12n1i1 1
Y(2n)Y(2n)[Y(2n1)Y(2n1)],io2ni1Y(2n1)
(k).Y(2n1),io 2n1i1
Y(2n)Y(2n)/K,io2ni1
X=input tilecomponent
Y=resultingtramnsformcoefficients
ioandi1=represent the positionofthetilescomponentwithinacomponent.
LiftingParameter:
160
Scalingparameter:
K=1.230174105
i. After the completion of scaling and lifting operations, the even indexed value Y(2n)
representstheFWTLPfilteredoutputandoddindexedvaluesofY(2n+1)correspondto the
FWT HP filtered output.
j. Thesubbandsofcoefficientsarequantizedandcollectedintorectangulararrays of“code
blocks..Thus after transformation, all coefficients are quantized.
k. Quantizationistheprocessbywhichthecoefficientsarereducedinprecision.Eachof the
transform coefficients ab(u,v) of the sub band b is quantized to the value qb(u,v)
according to the formula,
Where,Δb=quantizationstep size=
2Rbb[1 b]
211
Rb=nominaldynamicrange ofsubbandb
εb,μb=numberofbitsallocatedtotheexponentandmantissaofthesubband’s coefficients.
l. EncodethequantizedcoefficientsusingHuffmann orarithmetic coding.
JPEG2000DecoderAlgorithm:
a. Decodethebitmodeledorarithmeticallybitstreams
b. Dequantizethecoefficients using,
(q(u,v)2 MN(u,v)
b b
). b, q(u,v)0
b b
qb b
R(u,v)(q(u,v)2 MN(u,v)
b b
). b, q(u,v)0
b
0, q(u,v)0
161 b
Where , Rqb(u,v) =dequantizedtransformcoefficients
TABLESPECIFICATION
MainstructureofJPEG2000decoder.
c. The dequantized coefficients are then inverse transformed by column and by row using
inverse forward wavelet transform filter bank or using the following lifting based
operations
X(2n)k.Y(2n),io32nio122n1i
X(2n1)(1/k).Y(2n1),i 3 12
X(2n)X(2n)[X(2n1)X(2n1)],io32ni13
X(2n1)X(2n1)[X(2n)X(2n2)],io22n1i12
X(2n)X(2n)[X(2n1)X(2n1)],io12ni11
X(2n1)X(2n1)[X(2n)X(2n2)],io2n1i1
d. PerformDClevel shiftingbyadding2 m-1
9. .BrieflydiscusstheMPEGcompressionstandard.(May/June2009)orExplainthe Video
compression standards.
VideoCompressionstandards:
Videocompressionisused forcompression ofmovingpicture frames.
Basedontheapplications, videocompressionstandards aregroupedintotwocategories,
(1) Videoteleconferencingstandards
(2) Multimediastandards
a. Videoteleconferencingstandards:
162
TheInternationalTelecommunicationUnion(ITU)hasanumberofvideoconferencing compression
standards such as, H.261, H.262, H.263 and H.320
1.H.261isusedtosupportfull motionvideotransmissionoverT1lines
2.H.263isdesignedfor very lowbitrate video intherange of10to30 Kbits/sec
3.H.320isusedforISND
b. MultimediaStandards
These are used for video on demand, digital HDTV broadcasting and image/video database
services.TheprincipalmultimediacompressionstandardsareMPEG-1,MPEG-2andMEPG-4
1. MEPG-1 is an entertainment quality coding standard for the storage and retrieval of video on
digital media such as CDROMs.It supports a bit rate of 1.5 Mbit/s.Thus it is used forcompression
of low resolution.
2. MPEG-2 is used for cable TV distribution and narrow channel satellite broadcasting with a bit
rate of 2 to 10 Mbit/s. Thus is used for higher resolution standards, mainly for studio quality
audio and video compression.
3. MPEG-4provides5and 64Kbit/sformobileand PSTNand upto4Mbit/sforTVandfilm
applications.
4. MPEG-4provides(a)improvedvideocompressionefficiency; (b)Contentbasedinteractivity and
(c) universal access including increased robustness.
MPEG Algorithm:
MPEG standard consists of both video and audio compression. The MPEG algorithm relies
ontwo basic techniques
Blockbasedmotioncompensation
DCT based compression
1. The video signal is sequence of still picture frames. From the picture, slices are formed in the
raster scan order as shown below,
2. For each slice the macro blocks are obtained. The macro block consists of four blocks of 8 x 8
pixels. Thus the micro block has a size of 16 x 16 pixels. If the macro block is in RGB format,
then it is converted into YCrCb format, where Cr and Cb represent chrominance signals. Oncethe
sequence of macro blocks is formed, coding can take place.
3. Themotion isestimated by predicting thecurrent frame on the basis ofcertain previous and/or
forwardframe. Theinformationsenttothedecoder consistsof thecompressed DCTcoefficients
oftheresidual blocktogetherwiththemotionvector.Thereare threetypesofpicturesinMPEG:
Intra-frames (I)
Predictedframes(P)
Bidirectionallypredictedframes(B)
Figuredemonstratesthepositionofthedifferenttypesofpictures.EveryNthframeinthevideo
sequenceis an I-picture, and every Mth frame aP-picture. Here N=12 andM=4. The rest of the
frames are B-pictures.
163
Forward Forward
prediction prediction
I B B B P B B B P B B B I
Bidirectional
prediction
Figure:InterframecodinginMPEG.
Compressionofthepicturetypes:
1. Intra frame (I –frame) are coded as still images by DCT algorithm. They provide access
points for random access, but only with moderate compression. It is used as the reference point
for the motion estimation.
2. Predicted frame (P-frame) are coded with reference to a past picture. The current frame is
predicted on the basis of the previous I- or P-picture. The residual (difference between the
prediction and the original picture) is then compressed by DCT.
3. Bidirectional frame (B-frame)is the compressed difference between the current frame and a
prediction of it based on the previous I- or P- frame and next P-frame. Thus the decoder must
have access to both he past and future reference frames. The encode frames are thereforerecorded
before transmission and the decoder reconstructs and displays them in the proper sequence.
Bidirectional pictures are never used as reference.
1. After the pictures are divided into 1616 macro blocks, each consisting of four 88 elementary
blocks, the DCT of the macro block is calculated whose coefficients are quantized.
Thechoice of thepredictionmethodischosenfor eachmacroblockseparately.
2. Theintra-codedblocks are quantizeddifferently fromthepredictedblocks:
Intra-coded blocks containinformation in all frequenciesand are quantizeddifferently fromthe
predicted blocks .The predicted blocks, contain mostly high frequencies and can be quantized
with more coarse quantization tables.
Motionestimationandcompensation:
1. Thepredictionblockinthereferenceframeisnotnecessarilyinthesamecoordinatesthanthe block in
the current frame.
2. Becauseofmotionintheimagesequence,themostsuitablepredictorforthecurrentblockmay exist
anywhere in the reference frame.
3. Themotionestimationspecifies wherethe bestprediction (bestmatch)isfound.
4. Motioncompensationconsistsofcalculatingthedifferencebetweenthereferenceandthe
current block.
5. FinallythequantizedDCTcoefficeintsarethenrun–lengthencodedinazig-zagorderand then
huffmann coded to compress the data.
164
6. Alsotheencoderisdesignedtogenerateabitstreamthatmatchesthecapacityoftheintended video
channel.This is done by using a rate controller which adjusts the quantization parameters as a
function of the occupancy of the output buffer.
7. Asthebufferbecomesfullerthequantizationismadecoarser,sothatfewerbitsstreaminto buffer.
Threebasictypesofencodedoutputframes:
Rate
controller
Difference
+ Block Variable
DCT Quantizer Buffer
- lengthcoding
Encoded
Block
Inverse
Quantizer
Inverse
DCT
+ Encoded
Variable Motion
length
coding Vector
Motion estimator
and
compensator
W/framedelay
I- frames provide the highest degree of random access, ease of editing, and greatest
resistance to the propagation of transmission error. As a result, all standards require their
periodic insertion into the compressed code stream.
165
2. Predictive frame (P-frame). A P-frame is the compressed difference between thecurrent
frame and a prediction of itsbased on the previous I-or P-frame. The difference is formed
in the leftmost summer of fig. The prediction is motion compensated andtypically
involves sliding the decoded block in the lower part of fig. around its immediate
neighborhood in the current frame and computing a measure of correlation (such as the
sum of the square of the pixel-by-pixel differences). In fact, the process is often carried
out in subpixel increments (such as sliding the subimage ¼ pixels at a time), which
necessitates interpolating pixel values prior to computing the correlation measure. The
computedmotionvector isvariable length coded andtransmitted asan integral part ofthe
encoded data stream. Motion estimation is carried out on the macro block level.
3. Bidirectional frame (B- frame). A B- frame is the compressed difference between the
current frame and a prediction of it based on the previous I- or P- frame and next- P-
frame. Accordingly, the decoder must have access to both past and future reference
frames. The encoded frames are therefore reordered before transmission; the decoder
reconstructs and displays them in the proper sequence.
10. ExplaintheBasicsofVectorQuantizationindetail.
Definition:
Mapping of accurate data’s into inaccurate data’s is known as Quantization. If this procedure
isextended for vector data , then the procedure is called as Vector Quantization.
Vector Quantizationis a process which can map n-dimensional vectors inthe vector space R into a
finite set of vectors Y in the vector space R.
Y{yi,i1,2,3, ........ ,n}
Setof allcode wordsiscalledascode book
VectorQuantizationTransmitter:
1. Here,originalimageisdecomposedintondimensionalimagevectors,vectorscanbeblockof pixel
values or a 3-dimensional vector formed from the RGB color components.
166
2. Eachvectoriscomparedwithacollection ofrepresentativecode vectors,
Xi,i 1,2,3, ..... ,N c takenfromapreviouslygenerated codebook.
3. Bestmatchcode vectorischosenusingaminimumdistortion rule
-ChooseXksuchthatd(X,Xk)d(X,Xj),for..all..j1,2,3, ...................... ,Nc
denotesthedistortionincurred inreplacing theoriginalvectorXwiththecode vectorX
4. DistancemeasureisdoneusingsquareoftheEuclidean distance betweentwovectors
1n
2
d(X,X ) (x i xi)
n i1
xi=ithcomponentofthecodeword.
x=ith component oftheinput vector.
Voronoiregion isthenearestneighborregionassociatedwitheachcodewordYi.
Aftertheminimumdistortioncodevectorhasbeenfound,theindexkistransmittedusing log2Nc bits.
VectorQuantizationReceiver:
1. VQ decoder uses a duplicate codebook and a table lookup to reproduce the image
2.Compressionisobtainedbyusingacodebookwithrelativelyfewcodevectorscomparedtothe original
image vectors
167
Linde-Buzo-Gray(LBG)Algorithmisoneofthesuboptimalcodebookdesignprocedure Start
with:
1.asetof training vectors
2. initialcodebook
3. distortionmeasured
4. fractionaldistortionchangethreshold
Initialize:
1. iterationcounter lto1
2. averagedistortionover alltrainingvectors,D(0) toaverylargenumber
Based on the minimum euclidean distance, the input vector is attached to the code word and
averagedistortioniscomputed.Thenrevisethecodewordsbycomputingtheaverageofeach cluster.
Drawbacks:
Thesizeofthecodebookincreasesfor highercompressionratio’sand
thesearchtimerequiredtofind theminimaldistortioncode also increases.
Codebook Design:
Consideran8bitimage-Compressedto1bitperpixel,Ifn=4(2x2blocks),codebookshould contain
only 16 vectors,16 vectors will represent 2564 possible image vectors.
Ifblocksizeisincreasedto4x4,thecodebookis216codevectors,Thetotalnumberofvectorsis 25616
Resultingmean-squarequantizationerrorbecomessmallerastheblock size increases.
ThustheNumber ofcodebookvectorsincrease
In sub band coding, the spectrum of the input is decomposed into a set of bandlimitted
components, which is called sub bands. Ideally, the sub bands can be assembled back to
reconstruct the original spectrum without any error. Fig. shows the block diagram of two-band
filter bank and the decomposed spectrum. At first, the input signal will be filtered into low pass
and high pass components through analysis filters. After filtering, the data amount of the lowpass
and high pass components will become twice that of the original signal; therefore, the low pass
and high pass components must be down sampled to reduce the data quantity. At the
receiver,thereceiveddatamustbeupsampledtoapproximatetheoriginalsignal.Finally,theup
168
sampled signal passes the synthesis filters and is added to form the reconstructed approximation
signal.
After sub band coding, the amount of data does not reduce in reality. However, the human
perception system has different sensitivity to different frequency band. For example, the human
eyes are less sensitive to high frequency-band color components, while the human ears is less
sensitive to the low-frequency band less than 0.01 Hz and high-frequency band larger than 20
KHz. We can take advantage of such characteristics to reduce the amount of data. Once the less
sensitive components are reduced, we can achieve the objective of data compression.
FigTwo-bandfilter bankforone-dimensionsubbandcodinganddecoding
NowbacktothediscussionontheDWT.Intwodimensionalwavelettransform,atwo-
dimensionalscalingfunction,(x,y),andthreetwo-dimensionalwaveletfunctionH(x,y),
V(x,y)andD(x,y),arerequired.Eachistheproductofaone-dimensionalscalingfunction
(x)andcorrespondingwaveletfunction(x).
(x,y)(x)(y) H(x,y)(x)(y)
V(x,y)(y)(x)D(x,y)(x)(y)
where Hmeasures variations along columns (like horizontal edges), Vresponds to variations
along rows (like vertical edges), andDcorresponds to variations along diagonals.
Similar to the one-dimensional discrete wavelet transform, the two-dimensional DWT can be
implemented using digital filters and samplers. With separable two-dimensional scaling and
wavelet functions, we simply take the one-dimensional DWT of the rows of f (x, y), followed by
the one-dimensional DWT of the resulting columns. Fig. shows the block diagram of two-
dimensional DWT
.
Fig.Theanalysisfilterbank ofthetwo-dimensionalDWT
169
Asintheone-dimensionalcase,imagef(x,y)isusedasthefirstscaleinput,andoutputfour
quarter-sizesub-imagesW, WH , WV,and WD asshowninthemiddleofFig.The
approximationoutputWH(j,m,n)
ofthefilterbanksinFig.canbetiedtootherinputanalysis
filterbanktoobtainmoresubimages,producingthetwo-scaledecompositionasshowninthe left of Fig.
Fig. shows the synthesis filter bank that reverses the process described above.
Fig.Two-scaleoftwo-dimensional decomposition
Thesynthesisfilterbankofthetwo-dimensionalDWT
170
12. Explain the following terms 1.Bounary descriptors2. Regional
descriptors3.Texturedescriptors
I. SimpleDescriptors
Thefollowingarefewmeasuresusedassimpledescriptorsinboundary descriptors,
Lengthof a boundary
Diameterofaboundary
Majorandminoraxis
Eccentricity and
Curvature
Length of a boundary is defined as the number of pixels along aboundary.Eg.for
a chain coded curve with unit spacing in both directions the number of vertical
and horizontal components plus √2 times the number of diagonalcomponents
gives its exact length
ThediameterofaboundaryBisdefined as
Diam(B)=max[D(pi,pj)]
D-distancemeasure
pi,pj-pointsonthe boundary
The line segment connecting the two extreme points that comprise the diameter is
called the major axis of the boundary
The minor axis of a boundary is defined as the line perpendicular to the
majoraxis
Eccentricityoftheboundaryisdefinedastheratioofthemajortotheminor axis
Curvatureistherateofchange of slope.
II. Shapenumber
Shapenumberisdefinedasthefirstdifferenceofsmallest magnitude.
Theorder nofashape numberis thenumberofdigitsinits representation.
171
III. FourierDescriptors
Consider the following digital boundary and its representation as a complex sequence in
the xy plane
TheDiscreteFourier transformofS(k)isgivenas,
1K1
a(u) s(k)ej2uk/K,u0,1,2, .......... K1
Kk0
Thesecomplexcoefficientsa(u)arecalledtheFourierdescriptorsofthe boundary.
TheInverseFouriertransformofthesecoefficientsrestores s(k)givenas,
172
K1
s(k) a(u)ej2uk/K,k0,1,2, ........ K1
u0
InsteadofusingalltheFouriercoefficients,onlythefirstPcoefficientsareused. (i.e.,)
a(u) = 0, for u > P-1
Hencetheresultingapproximationisgivenas,
P1
Thus,whenPistoolow,thenthereconstructedboundaryshapeisdeviatedfromthe original..
Advantage:Itreducesa2Dto a1Dproblem.
The followingshows the reconstructionof the objectusingFourier descriptors.Asthe value
of P increases, the boundary reconstructed is same as the original.
Basicproperties ofFourierdescriptors
IV. Statisticalmoments
173
It is used to describe the shape of the boundary segments, such as the mean,
and higher order moments
Considerthefollowingboundary segmentanditsrepresentationasa 1D function
Let v be a discrete random variable denoting the amplitude of g and let p(vi)be
the corresponding histogram, Where i = 0,1,2,…,A-1 and A = the number of
discrete amplitude increments in which we divide the amplitude scale, then the
nth moment of v about the mean is ,
A1
n(v)(v i m)np(v),i0,1,2,
i ............... A1
i0
m v p(v )
i i
i0
Another approach is to normalize g(r) to unit area and consider it as a histogram,
i.e.,g(r) istheprobabilityofoccurrenceof valuer iandthemomentsare given as,
(v)(rm)ng(r),i0,1,2,.... K1
K1
n i
ii0
Where,
K1
m r g(r )
i0
i i
174
Perimeter
Compactness
Meanandmedianofgraylevels
Minimumandmaximumofgraylevels
Numberofpixelswithvaluesaboveandbelowmean
TheAreaofaregionisdefinedasthenumberofpixelsintheregion.
ThePerimeterofaregionisdefinedasthelengthofitsboundary
Compactnessofaregionisdefinedas(perimeter)2/area.Itisadimensionless quantity
and is insensitive to uniform scale changes.
b) TopologicalDescriptors
Topologicalpropertiesareusedforglobaldescriptionsofregionsintheimage plane.
Topology is defined as the study of properties of a figure that are unaffected
by any deformation, as long as there is no tearing or joining of the figure.
Thefollowingarethetopologicalproperties
Numberf holes
Numberofconnected components
Euler number
EulernumberisdefinedasE=C– H,
Where,Cisconnectedcomponents H
is the number of holes
TheEulernumbercanbeappliedtostraightlinesegmentssuchaspolygonal networks
Polygonal networks can be described by the number of vertices V, the number of
edges A and the number of faces F as,
E =V– A+ F
Considerthefollowingregionwithtwoholes
HereconnectedcomponentC=1
Number of holes H = 2
EulernumberE= C– H= 1– 2= -1
ConsiderthefollowingletterBwithtwoholes
175
HereconnectedcomponentC=1
Number of holes H = 2
EulernumberE= C– H= 1– 2= -1
ConsiderthefollowingletterA withonehole
HereconnectedcomponentC=1
Number of holes H = 1
EulernumberE= C– H =1 –1 = 0
c) Texture
Texturerefersto repetitionofbasictextureelementsknownastexelsor texture
primitives or texture elements
Textureisoneoftheregionaldescriptors.
Itprovidesmeasures ofpropertiessuchassmoothness,coarsenessand regularity.
Thereare3approachesusedtodescribethetextureofaregion. They
are:
• Statistical
• Structural
• Spectral
i. statistical approach
Statistical approaches describe smooth, coarse, grainy characteristics of
texture. This is the simplest one compared to others. It describes texture
usingstatisticalmomentsofthegray-levelhistogramofanimageorregion.
The followingare few measuresused as statisticalapproach in Regional
descriptors
Letzbearandomvariabledenotinggraylevelsandletp(zi)bethe corresponding
histogram,
WhereI=0,1,2,…,L-1andL=thenumberofdistinctgraylevels,then the nth
moment of z about the mean is ,
176
L1
n(z) (z
i0
i
m)np(z),i0,1,2,
i ........ L1
Wheremisthemeanvalueof
zanditdefinestheaveragegraylevelofeachregion,isgivenas,
L1
m z p(z )
i0
i i
3(z)(zi m)3p(z) i
i0
Themeasure ofuniformityisgivenas,
L1
Up(z)2 i
i0
Anaverageentropymeasureisgivenas,
L1
i)log2p(zi)
ep(z
i0
Entropyisameasure of variabilityandiszeroforconstantimage.
The above measure of texture are computed only using histogram and have
limitation that they carry no information regarding the relative position of
pixels with respect to each other.
In another approach, not only the distribution of intensities is considered but
also the position of pixels with equal or nearly equal intensity values are
considered.
Let P be a position operator and let A be a k x k matrix whose element aijis the
number of times with gray level zioccur relative to points with gray level zi,
with 1≤i,j≤k.
Let n be the total number of point pairs in the image that satisfy P.If a matrix
C is formed by dividing every element of A by n , then Cijis an estimate ofthe
joint probability that a pair of points satisfying P will have values (zi,zj).The
matrix C is called the gray-levelco-occurrence matrix.
ii. Structuralapproach
Structuralapproachdealswiththearrangementofimageprimitives
such as description oftexture based on regularly spaced parallel
lines.
177
This techniqueuses thestructure andinter relationshipamong components in
a pattern.
Theblockdiagram ofstructuralapproachisshownbelow,
The input is divided into simple subpatterns and given to the primitive
extraction block. Good primitives are used as basic elements to provide
compact description of patterns
Grammar construction block is used to generate a useful pattern
description language
Ifarepresentsacircle,thenaaa..meanscirclestotheright,sotheruleaS
allowsthegenerationofpictureasgivenbelow,
……………
iii. Spectralapproaches
Spectral approach is based on theproperties of theFourier spectrum and is
primarily to detect global periodicity in an image by identifying high
energy, narrow peaks in spectrum.
There are 3 features of Fourier spectrum that are useful for texture
description. They are:
Prominentpeaksinspectrumgivestheprincipaldirectionof texture
patterns.
Thelocationofpeaksinfrequencyplanegivesfundamental spatial
period of patterns.
Eliminatinganyperiodiccomponentsbyourfilteringleaves
178
non-periodicimage elements
The spectruminpolarcoordinatesaredentoedasS(r,θ),whereSis the spectrum
function and r andare the variables in this coordinate system
Foreachdirectionθ,S(r,θ)maybeconsideredasa1DfunctionSθ(r,θ)
definedas
By varying above co-ordinates we can generate two 1D functions, S(r) and S(θ) , that
gives the spectral – energy description of texture for an entire image or region .
179
180
181
182
QUESTIONBANK
UNITI-DIGITALIMAGEFUNDAMENTALS
PartA
1. Whatismachbandeffect?(Nov/Dec2005),(May/June 2007)
2. Whatisabandlimitedfunction?(Nov/Dec 2005)
3. Whichtypeoflight receptorisresponsiblefor(a)photopic(b) scotopicvision?(May
/June2006)
4. Whatarethestagesofdigitalimageprocessingsystem? (May /June 2009)
5. Whatarethe applicationsof digitalimage processing?
6. WhatisWeber ratio?(May/June2009),(May/June 2007)
7. Defineintensityratiosandlogratios.(Nov/Dec 2005)
8. Whatisdigitalimage?
9. Explainthetermsilluminationandreflectanceforan image model?
10. Whatistheroleofpointspreadfunctioninimageprocessing?(May /June 2006)
11. Writethesignificanceofimagesamplingandquantization.(May/June 2009)
12. Whatarethepracticallimitationsinsamplingandreconstruction?(May/June 2006)
13. Statthecircular convolutiontheorem ofDFT.(May/June 2009)
183
14. Whataretheproperties ofunitary transform? (May/June 2009)
15. State2Dsampling theory.
16. Whatistheneedforquantization?
17. Stateandexplainthe convolutionpropertyofFourier transform?
18. Explainthetermsaliasingandfoldover frequencies?
19. Whatiscirculantmatrix?Giveanexample.
20. ExplainthedecorrelationpropertyofKLtransform.(May/June2006)
21. CompareSVDandKLtransform.(May/June 2009)
22. WriteNxNdiscretecosinetransform.(May/June2009)
23. DefinetheSVDtransform of images.
24. Whatis cosinetransform?
25. Whatisthespecialfeatureof KLtransform?
26. Defineunitary transform
27. Nametheworkingprincipleofdigitalcamera
28. Definedither
29. Namethecolormodels
30. Differentiatebrightnessand contrast
31. Differentiatehue andsaturation
32. GivetheHSImodel
Part-B
1. Explain about the element of digital image processing(May / June 2009) (May/
June 2007)
2. Explainthedifferentelementsofvisualperceptionindetail.(May /June 2009)
3. Illustratetheconcept ofBrightnessadaptation.(May/June2007)
4. Explainluminanceand brightness andcontrastwithrespecttohumanvision?
5. WriteshortnotesonNonuniformsamplingandQuantization.(May/June 2007)
6. DiscussindetailtheprocessofuniformsamplingandQuantization.(May/June 2007)
7. Statethepropertiesofoptimummeansquarequantizer.(Nov /Dec2005)
8. Describethepropertiesof2DFouriertransformanditsapplicationinimage processing.
(May/June 2009)
9. Discusstheeffectsofnonuniformsamplingandquantization.(May/June 2009)
10. Stateandprove 2Dsamplingtheorem.(May/June 2009)
11. DerivetheexpressionforthesignaltonoiseratioofLloydmaxquantizer. (May/June 2009)
12. State the condition for a matrix to be (1) unitary (2) orthogonal. Give an example of
a matrix which is both orthogonal and unitary. (May / June 2006)
13. Explainhowamatrixwhichisrepresentedusingsingularvaluedecomposition. (May /
June 2006)
14. Explaintheprincipleofvectorquantizationofimages.(May /June 2006)
15. ExplainWeber’s Law andLateral inhibitionwith reference to human visual system.
(May / June 2006)
16. DescribeLloydmaxquantizerforimagegiventheprobabilitydensityfunction? (May /
June 2006)
17. Explainanyfourproperties ofDFT.(Nov/Dec2005)
184
18. Explainthepropertiesof DCT.(Nov/Dec 2005)
19. Explainthe salientfeaturesofDCT.(May /June 2007)
20. FindtheDFT forthesetofvalues {1,0,1,2,0,0,1} (May /June2009)
21. Listthepropertiesof2D-DFT.(May /June2009) (May/June 2007)
22. Explain how the basis vector of KL transform of a N x 1 random vector is obtained.
(May / June 2006)
23. Explainaboutthestepsindigitalimageprocessing
24. Explaintheworkingprincipleofdigitalcamera(VIDICON)
25. WriteshortnotesonColorimagefundamentals
26. Explainaboutdither
UNITII-IMAGEENHANCEMENT
PartA
1. Whatismeantbyhistogramofadigitalimage?(May/June2006),(May/June 2009), (May /
June 2007)
2. ListtheuseofLPF,HPF andBPF spatialfilters. (May/June 2009)
3. Explainanyonetechniqueforzooming ofanimage.(May/June2006)
4. Whatisimageaveraging?
5. WritethetransferfunctionforButterworthfilter. (May/June2009)
6. Whatismeanbycontraststretching?(May/June 2009)
7. WhatisMedianFiltering?(May/June2009) (May/June2007)
8. Why the image enhancement is needed in image processing technique. (May / June
2009)
9. Ify(m) =(2,3,8,4,2)andN=(-1,0,1).Findthemedialfilter output.(Nov /Dec 2005)
10. Whatismeantbyhistogramspecification?
11. Whatare thesourcesof degradationinimage?
12. Whatispseudoinversefilter?
13. Explaintheimportance ofwiener filter?
14. Explaintheneedforsmoothingandsharpeningfiltering?
15. Definetheceptrumofa signal
16. Whatispseudoinverseoperator?
17. WhatisGeometricmeanfilter?
18. WhatisHarmonic meanfilter?
19. WhatisaContra harmonicmeanfilter?
20. WhatisColorimage enhancement?
Part-B
2. Explain how image subtraction and image averaging is used to enhance the
image.(May / June 2009)
3. Explainthevarioussharpeningfilters inspatialdomain.(May /June2009)
4. Discuss in detail the significance of Homomorphic filtering in image
enhancement.(May / June 2009) (May / June 2007)
5. Write short notes on Point operations, Transform operations and Pseudo
coloringwith respect to image enhancement. (May / June 2009) (May / June 2006)
6. Explainanytwospatialoperations.(May/June 2006)
185
7. WriteshortnotesonContraststretchingandGrey levelslicing.(May/June2009)
8. ExplainindetailaboutSharpeningfilter,EdgeDetection,Smoothingfilterand Noise
removal. (May / June 2009)
9. Whatishistogramofanimage?Howdoesitmodifyanimageinequalizationand
specification techniques? (May / June 2009)
10. ExplainEnhancementusingpointoperations.(Nov /Dec 2005)(May/June 2006)
11. WriteshortnotesonHistogramequalizationandHistogrammodification.(Nov/ Dec
2005) (May / June 2009) (May / June 2007)
12. Write short notes onDirectional Smoothing and color imageenhancement. (Nov /Dec
2005) (May / June 2006)
13. Explainhowahighpassfilteredimagecanbegeneratedusingalowpassfilter. (May / June
2006)
14. How is the digital negative of an image generated? Where is this used? (May / June
2006)
15. Discusstheroleofnonlinearfiltersinimage enhancement.(May/June 2007)
16. Explainanyonemethodofpseudocolorimageprocessing.(May/June2007)
UNITIII-IMAGERESTORATION
PartA
1. Whatispseudoinverse?
2. WhatisBlindImageRestoration?(May/June 2009)
3. WhatisConstrainedRestoration?(May/June 2009)
4. Whatisspecklenoise?
5. Writethetransferfunctionofpseudoinverse filter.(May/June 2006)
6. Explainanytworeasonsforimage degradation.(May/June2006)
7. Whatarethe factorsthatinfluenceimagedegradation?(May /June 2009)
8. Distinguishbetweenimageenhancementandimagerestoration.(May/June2007)
9. Whatisinversefiltering?
10. Whatisthebasic equationusedfor constrainedrestoration?
11. DefineGeometric transformations
12. Whatare thespatialtransformations?
13. Differentiateunconstrained restorationandconstrainedrestoration
14. WhatismeantbyLagrangemultiplier?
15. ClassifyImagerestoration techniques.
16. Whatistheexpressionfor theerror measure forWeinerfilter?
17. Givetheexpressionfor WeinerfilteringandgiveitsothernamesforWeiner filter.
18. WhatisthePDFofGaussianNoise?
Part-B
186
2. Writenotesoninversefilteringasappliedtoimage restoration.(May/June 2009)
3. Givethedegradationmodel forcontinuousfunction.(May /June 2009)
4. With theaid of block diagram , describe thedigital imagerestoration
systemandexplain the image observation models
5. Explainindetailthe functionofWienerfilter.(May /June2009)
6. WriteshortnotesonInversefilterandPseudoinversefilter.(Nov /Dec 2005)
7. Write short notes on Wiener filter characteristics and Geometric mean filter. (Nov /
Dec 2005)
8. Derive the Weiner filter equation. Under what conditions does it become the pseudo
inverse filter? (May / June 2006)
9. Explain the image degradation model and various approaches of image restoration
technique. (May / June 2009)
10. ExplainConstrainedandUnconstrainedRestorationindetail.(May /June2009)
11. Describetheprincipleofwienerfiltering inimage Restoration.
12. Explainthemethodofremovalofblurcausedbyuniformlinear motion?
13. DiscussthedifferencesbetweenGeometrictransformationsandspatialtransformations
techniques?
UNITIV-IMAGESEGMENTATION
PartA
Part-B
187
2. Explainedge detection.
3. ExplainEdgelinkingandboundarydetection indetail
4. ExplainThresholdingindetail.
5. WriteshortnotesonRegiongrowingsegmentation.OrExplainRegionsplittingand Merging
(May / June 2009)
6. Explainsegmentationbymorphologicaloperationindetail
7. Explainwatersegmentation algorithmindetail
UNITV-IMAGECOMPRESSION
PartA
1. Whatisneedforimage datacompression? (May/June2009)
2. Listthetypesofcodinginimageprocessing.(May/June2009)
3. Listthebasictypesofdataredundancy.(May/June 2009)
4. Givethelosslesspredictivemodel.(May /June2009)
5. Give an example of a variable length encoder. What is its advantage? (May /
June2006)
6. What are the standards used for compressionof still images andimages with motion?
(May / June 2006)
7. Whatarethe advantagesofimagedatacompression?(May/June2009)
8. Mentionsomeimagedatacompressiontechniques.(May/June 2009)
9. What is the average length of code if the probability of symbols is given as {0.4, 0.3,
0.1, 0.1, 0.06, 0.04}? (Nov / Dec 2005)
10. Whatisknownasbitplanecoding? (May/June2007)
11. MentionthesignificantfeaturesofWavelettransform.(May /June 2007)
12. Defineentropy coding
13. Drawthegeneralblockdiagram foranimagecompression model
14. Whatis zonal coding?
15. StateHuffmancodingalgorithm
16. Whatisthebasic principleofimage compressioninspatialdomain?
17. Mentionanytwoimagecompression standards used?
18. Mentionthelimitationsofbitplanecoding.
19. Comparejpegandjpeg2000
20. ComparetheHuffmanandarithmetic coding
21. DefineShiftcodes
Part-B
188
8. Write notes on JPEG standard (jpeg and jpeg 2000)with neat diagram. (May / June
2009), (May / June 2006)
9. Apply Huffman coding procedure to the following message ensemble and determine
average length of encoded message and coding efficiency. The symbols
(x1,x2,x3,x4,x5,x6,x7,x8) are emitted with probabilities of
(0.22,0.2,0.18,0.15,0.08,0.05,0.02). (May / June 2009)
10. Explaintherunlengthcodingscheme.(May /June 2006)
11. Explaintheimagecompressionstandards
12. Whatare thebuildingblocksofanimageencoder? Statetheir function?
13. ExplainTransform coding.(May /June2009),(May/June 2009)
14. ExplainVectorQuantizationwithneat diagram
15. ComputetheHuffman’scodeandIBcodefollowinggrayleveldistribution.
levels(r)WW2W3W4W5W6
189