EC2029Dip Unit Notes 2013

Embed Size (px)

Citation preview

  • 7/27/2019 EC2029Dip Unit Notes 2013

    1/311

    Unit 1

    DIGITAL IMAGE FUNDAMENTALS

    AND TRANSFORMS

  • 7/27/2019 EC2029Dip Unit Notes 2013

    2/311

    2

    Elements of Digital ImageProcessing

    Knowledge base

    ImageAcquisition

    Problem

    ImageEnhancement

    ImageRestoration

    Segmentation

    Representation &

    Description

    ObjectRecognition

  • 7/27/2019 EC2029Dip Unit Notes 2013

    3/311

    3

    Image Acquisition: Acquiring the image of interest in digital format viaimaging devices such as Charge-Coupled Devices (camera or scanner).

    Image Enhancement: Bringing out the details that are obscured orsimply highlighting certain features of interest in an image.

    Enhancement is a subjective process.

    Image Restoration: Improving the quality of a degraded image basedon the mathematical or probabilistic models of the degradation process.Restoration is an objective process.

    Image Segmentation: Partitioning an image into its constituent parts orobjects. Rugged segmentation procedures consume huge time to arriveat successful solutions to imaging problems whereas weak or erraticsegmentation procedures result in total failure.

    Elements of Digital ImageProcessing

  • 7/27/2019 EC2029Dip Unit Notes 2013

    4/311

    4

    Representation & Description: Representation - converting raw pixeldata from segmentation process, normally representing boundaries ofregions or all points in regions, to suitable form for computerprocessing. Description - extracting attributes that result in somequantitative information of interest or are basic for differentiating one

    class of objects from another.

    Recognition: Assigning a label (e.g., "vehicle") to an object based on itsdescriptors.

    Knowledge Base: Knowledge about a problem domain is coded into animage processing system in the form of a knowledge database. Thisknowledge may be simple e.g., details of regions of an image where theinformation of interest is known to be located, or may be quite complex,e.g., an interrelated list of all major possible defects in a materialsinspection problem.

    Elements of Digital ImageProcessing

  • 7/27/2019 EC2029Dip Unit Notes 2013

    5/311

    5

    Elements of visualperception

    Human Eye,a 3D view

  • 7/27/2019 EC2029Dip Unit Notes 2013

    6/311

    6

    Elements of visualperception

    Human Eye,

    a 2D view

  • 7/27/2019 EC2029Dip Unit Notes 2013

    7/311

    7

    1. A human eye, nearly a sphere with an average diameter ofapproximately 20 mm, is enclosed by three membranes: cornea andsclera, choroid and retina.

    2. The Cornea is a tough & transparent tissue, covering the anterior

    surface of the eye.

    3. The Sclera is an opaque membrane, enclosing the remainder of theeye globe.

    4. The Choroid contains blood vessels to supply nutrients to the eye.It is heavily pigmented stopping external light and is divided intociliary body and iris.

    Elements of visualperception

  • 7/27/2019 EC2029Dip Unit Notes 2013

    8/311

    8

    5. Center opening of iris, known as pupil, is about 2-8 mm in diameter.The front of iris is filled with visible pigments and its back withblack pigments.

    6. The lens, layers of fiberous cells, is having 60% to 70% H2O, 6%

    fat and rest protein. It is lightly yellowishly pigmented.

    7. The retina is rich with cones and rods which are light receptors.

    8. The cones, 6 to 7 millions in count are primarily located in the

    center of retina, known as fovea. They are responsible for photopic(bright light) vision-colour vision.

    Elements of visualperception

  • 7/27/2019 EC2029Dip Unit Notes 2013

    9/311

    9

    9. The rods, 75 to 150 millions in count, are distributed all over theretina. They are responsible for scotopic (dim light) vision-contrast.

    10. An individual cone is connected to an individual optical nerve andhence accounts for perception of finer details.

    11. Group of rods is connected to group of optical nerves and henceaccounts for overall perception.

    12. The blind spot in the eye is entirely deprived of the light

    receptors, rods and cones.

    Elements of visualperception

  • 7/27/2019 EC2029Dip Unit Notes 2013

    10/311

    10

    Image Formation in HumanEye

    H

    D F

    h

    The distance between the center of the lens and the retina, called thefocal length, varies from approximately 17 mm to about 14 mm.

    The height, h of an object of height, H perceived by an observer,having a focal length, F, from a distance, D is given by theprinciple of similar triangle.

    FD

    Hh

    F

    h

    D

    H

    ==

  • 7/27/2019 EC2029Dip Unit Notes 2013

    11/311

    11

    Brightness Adaptation ofHuman Eye

    Subjective brightness is a logarithmic function of incident lightintensity.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    12/311

    12

    Brightness Adaptation ofHuman Eye

    The brightness adaptation is a phenomenon which describes theability of the human eye in simultaneously discriminating distinctintensity levels.

    The brightness adaptation level is the current sensitivity level of the

    visual system for any given set of conditions.

    The simultaneous contrast is a phenomenon which describes that theperceived brightness of a region in an image is not a simplefunction of its intensity rather it depends on the intensities of

    neighboring regions.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    13/311

    13

    Brightness Adaptation ofHuman EyeThe match bands are the adjacently

    spaced rectangular stripes ofconstant intensities todemonstrate the phenomenon ofsimultaneous contrast.

    Examples of simultaneous contrast.All the inner squares have the sameintensity, but they appearprogressively darker as thebackground becomes lighter.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    14/311

    14

    Illusion of

    a whitesquare

    Illusion of a white

    circle Illusion of a whitecircle

  • 7/27/2019 EC2029Dip Unit Notes 2013

    15/311

    15

    Illusion of loss of parallelism & co-

    planarity

  • 7/27/2019 EC2029Dip Unit Notes 2013

    16/311

    16

    A color of a light is determined by its wavelength.

    Any object absorbs and reflects light energy at particularwavelengths.

    The perceived color of an object is determined by the wavelength ofthe light reflected from it.

    The object that absorbs the light energy at all wavelength looksblack to the perceiver while the object that reflects the light

    energy at all wavelengths looks white to the perceiver.

    Color Fundamentals

  • 7/27/2019 EC2029Dip Unit Notes 2013

    17/311

    17

    Achromatic light Black and White (and their shades, gray shades).

    Chromatic light Colors (and their shades).

    Three basic quantities are used to describe the quality of a chromatic

    light source: radiance, luminance, and brightness.

    Radiance is the total amount of energy that flows from the lightsource, and it is usually measured in watts (W).

    Luminance, measured in lumens (lm), gives a measure of the amount ofenergy an observer perceives from a light source.

    Brightness is a subjective descriptor that is practically impossible tomeasure.

    Color Fundamentals

  • 7/27/2019 EC2029Dip Unit Notes 2013

    18/311

    18

    Cones are the sensors in the eye responsible for color vision.Approximately 65% of all cones are sensitive to red light, 33% aresensitive to green light, and only about 2% are sensitive to blue. Dueto these absorption characteristics of the human eye, colors arcseen as variable combinations of the so-called primary colors red

    (R), green (G), and blue (B).

    The characteristics generally used to distinguish one color fromanother are brightness, hue, and saturation. Brightness embodiesthe chromatic notion of intensity. Hue is an attribute associated

    with the dominant wavelength in a mixture of light waves.Saturation refers to the relative purity or the amount of whitelight mixed with a hue.

    Hue and saturation taken together are called Chromaticity.

    Color Fundamentals

  • 7/27/2019 EC2029Dip Unit Notes 2013

    19/311

    19

    The amounts of red, green, and blue needed to form any particularcolor are called the tristimidus values and are denoted, X, Y, andZ, respectively.

    A color is then specified by its trichromatic coefficients, defined as

    Color Fundamentals

  • 7/27/2019 EC2029Dip Unit Notes 2013

    20/311

    20

    A color model (also called color space or color system) is a specificationof a coordinate system and a subspace within that system whereeach color is represented by a single point.

    The RGB color model: In the RGB model, each color appears in its

    primary spectral components of red, green, and blue. This model isbased on a Cartesian coordinate system. The color subspace is thecube in which RGB values are at three corners; cyan, magenta, and

    yellow are at three other corners; black is at the origin; and whiteis at the corner farthest from the origin.

    The gray scale (points of equal RGB values) extends from black towhite along the diagonal line joining these two points.The different colors are points on or inside the cube, and are defined

    by vectors extending from the origin.All values of R, G. and B are assumed to be in the range [0, 1].

    Color Models

  • 7/27/2019 EC2029Dip Unit Notes 2013

    21/311

    21

    Color Models

    The RGB color model

  • 7/27/2019 EC2029Dip Unit Notes 2013

    22/311

    22

    Merits of RGB color model: (i) Well suited for hardwareimplementations and (ii) Matches nicely with the fact that thehuman eye is strongly perceptive to red, green, and blue primarycolors.

    Demerits of RGB color model: Not well suited for describing colors interms that are practical for human interpretation.

    The HSI color model: A color perceived by a human eye is describedby its Hue, Saturation and Intensity. HSI (Hue, Saturation and

    Intensity) color model thus decouples the intensity componentfrom the color-carrying information (hue and saturation).

    Color Models

  • 7/27/2019 EC2029Dip Unit Notes 2013

    23/311

    23

    The HSI coordinate system andcorresponding color subspace isobtained as follows: The RGB colorcube rotated such that the cube isstanding on its black vertex with thewhite vertex directly above and thecyan, blue, green, red, yellow andmagenta vertices forming a hexagonas shown below.

    The dot is an arbitrary color point. Theangle from the red axis gives the hue,and the length of the vector is thesaturation. The intensity of all colorsin any of these planes is given by the

    position of the plane on the verticalintensity axis.

    Color Models

    Forming the HSI color model

    from the RGB color model

  • 7/27/2019 EC2029Dip Unit Notes 2013

    24/311

    24

    Color Models

    The HSI color model

  • 7/27/2019 EC2029Dip Unit Notes 2013

    25/311

    25

    Principle of Video Camera:Vidicon

    Vidicon Camera Tube Cross Sectional View

  • 7/27/2019 EC2029Dip Unit Notes 2013

    26/311

    26

    ConstructionThe Vidicon came into general use in the early 50s and gainedimmediate popularity because of its small size and ease ofoperation. It functions on the principle of photoconductivity,where the resistance of the target material shows a marked

    decrease when exposed to light.

    The target consists of a thin photo conductive layer of eitherselenium or anti-mony compounds. This is deposited on atransparent conducting film, coated on the inner surface of the

    face plate. This conductive coating is known as signal electrode orplate. Image side of the photolayer, which is in contact with thesignal electrode, is connected to DC supply through the loadresistance RL.

    Principle of Video Camera:Vidicon

  • 7/27/2019 EC2029Dip Unit Notes 2013

    27/311

    27

    The beam that emerges from the electron gun is focused on surfaceof the photo conductive layer by combined action of uniformmagnetic field of an external coil.

    The electrostatic field of grid No 3. Grid No. 4 provides a uniform

    decelerating field between itself, and the photo conductive layer,so that the electron beam approaches the layer with a low velocityto prevent any secondary emission.

    Deflection of the beam, for scanning the target, is obtained by

    vertical and horizontal deflecting coils, placed around the tube.

    Principle of Video Camera:Vidicon

  • 7/27/2019 EC2029Dip Unit Notes 2013

    28/311

    28

    Principle of Video Camera:Vidicon

    Circuit for output current for Vidicon

    Camera

  • 7/27/2019 EC2029Dip Unit Notes 2013

    29/311

    29

    Charge ImageThe photolayer has a thickness of about 0.0001 cm, and behaves like

    an insulator with a resistance of approximately 20 M when indark.

    When bright light falls on any area of the photoconductive coating,resistance across the thickness of that portion gets reduces toabout 2 M. Thus, with an image on the target, each point on thegun side of the photolayer assumes a certain potential with respectto the DC supply, depending on its resistance to the signal plate.

    A pattern of positive potentials appears, on the gun side of thephotolayer, producing a charge image, that corresponds to theincident optical image.

    Principle of Video Camera:Vidicon

  • 7/27/2019 EC2029Dip Unit Notes 2013

    30/311

    30

    Another way of explaining the development of charge image on thephotolayer is to consider it as an array of individual targetelements, each consisting of a capacitor paralleled with a lightdependent resistor. One end of these target elements is connectedto the signal electrode and the other end is unterminated facing

    the beam.

    Storage ActionEach element of the photocoating is scanned at intervals equal to the

    frame time. This results in storage action and the net change in

    resistance, at any point or element on the photoconductive layer,depends on the time, which elapses between two successivescannings and the intensity of incident light. Since storage time forall points on the target plate is same, the net change in resistanceof all elementary areas is proportional to light intensity variations

    in the scene being televised.

    Principle of Video Camera:Vidicon

  • 7/27/2019 EC2029Dip Unit Notes 2013

    31/311

    31

    Signal CurrentAs the beam scans the target plate, it encounters different positive

    potentials on the side of the photolayer that faces the gun.

    Sufficient number of electrons from the beam is then deposited on

    the photolayer surface to reduce the potential of each elementtowards the zero cathode potential. The remaining electrons, notdeposited on the target, return back and are not utilized in thevidicon.

    The sudden change in potential on each element while the beam scans,causes a current flow in the signal electrode circuit producing avarying voltage across the load resistance RL. The amplitude ofcurrent and the consequent output voltage across RL are directlyproportional to the light intensity variations on the scene.

    Principle of Video Camera:Vidicon

  • 7/27/2019 EC2029Dip Unit Notes 2013

    32/311

    32

    Principle of Still Camera:Charge Coupled Devices:

    A MOS capacitor as a light sensitive device

    1 2 3

    SiO2n-channel

    p-substrate

    PolysiliconGate

    PolysiliconGate

    PolysiliconGate

    Potential

    well madebydepletion

    layer

    Photons

    Photonically

    liberatedelectrons

  • 7/27/2019 EC2029Dip Unit Notes 2013

    33/311

    33

    Principle of Still Camera:Charge Coupled Devices:

    A MOS capacitor as a light sensitive device

    1 2 3 1 2 3 1 2 3

    p-substrate p-substrate

    SiO2

    n-channel

    PolysiliconGate

  • 7/27/2019 EC2029Dip Unit Notes 2013

    34/311

    34

    Charge Coupled Devices (CCD)The operation of solid state image scanners is based on the functioning

    of charge coupled devices (CCDs) which is a new concept in metal-oxide-semiconductor (MOS) circuitry. The CCD may be thought ofto be a shift register formed by a string of very closely spaced

    MOS capacitors. It can store and transfer analog charge signalseither electrons or holesthat may be introduced electrically oroptically.

    ConstructionThe chip consists of a p-type substrate, the one side of which is

    oxidized to form a film of silicon dioxide, which is an insulator. Thenby photolithographic processes, similar to those used in miniatureintegrated circuits an array of metal electrodes, known as gates,are deposited on the insulator film. This results in the creation of avery large number of tiny MOS capacitors on the entire surface of

    the chip.

    Principle of Still Camera:Charge Coupled Devices:

  • 7/27/2019 EC2029Dip Unit Notes 2013

    35/311

    35

    Principle of Operation

    The application of small positive potentials to the gate electrodesresults in the development of depletion regions just below them.These are called potential wells. The depth of each well (depletionregion) varies with the magnitude of the applied potential.

    The gate electrodes operate in groups of three, with every thirdelectrode connected to a common conductor. The spots under themserve as light sensitive elements.

    When any image is focused onto the silicon chip, electrons aregenerated within it, but very close to the surface. The number ofelectrons depends on the intensity of incident light. Once producedthey collect in the nearby potential wells. As a result the pattern ofcollected charges represents the optical image.

    Principle of Still Camera:Charge Coupled Devices:

  • 7/27/2019 EC2029Dip Unit Notes 2013

    36/311

    36

    Principle of Still Camera:Charge Coupled Devices:

    12

    3

    t0

    t1

    t2

    t3

    t4

    Direction of charge transfer

  • 7/27/2019 EC2029Dip Unit Notes 2013

    37/311

    37

    Principle of OperationCharge TransferThe charge of one element is transferred to another along the

    surface of the silicon chip by applying a more positive voltage tothe adjacent electrode or gate, while reducing the voltage on it.

    The manner in which the transition takes place from potential wells isillustrated in the figure. This is achieved with the influence ofcontinuing clock pulses.

    The clocking sequence continues and the charge finally reaches theend of the array where it is collected to form the signal current.

    Principle of Still Camera:Charge Coupled Devices:

  • 7/27/2019 EC2029Dip Unit Notes 2013

    38/311

    38

    Principle of Still Camera:Charge Coupled Devices:

    CCD Readout

  • 7/27/2019 EC2029Dip Unit Notes 2013

    39/311

    39

    Principle of OperationCCD ReadoutThe two-dimensional array of potential wells is generally referred to

    as parallel register.

    A one-dimensional CCD array acts as a serial register and plays animportant role during the CCD readout operation.

    A programmed sequence of changing gate potentials causes all chargepackets stored in the parallel register to be shifted in parallel one

    row toward the serial register. The charge stored in the top row isshifted from the parallel register to the serial register. Once inthe serial register, the charge packets are individually shiftedtoward the output amplifier.

    Principle of Still Camera:Charge Coupled Devices:

  • 7/27/2019 EC2029Dip Unit Notes 2013

    40/311

    40

    An (monochrome or black & white) image is a 2-D light-intensityfunction denoted as f(x,y).

    The value or amplitude, f of the function at any spatial coordinates(x,y) is the intensity of the image at that point.

    As light is energy, this value is non-zero and finite i.e.,0 < f <

    f(x,y) has two components: (i) i(x,y), the amount of light incident on

    the scene being viewed and (ii) r(x,y), the reflectance relating tothe amount of light reflected by the objects in the scene i.e.,f(x,y) = i(x,y) r(x,y) where 0 < i < & 0 r 1

    (Monochrome) Image model

  • 7/27/2019 EC2029Dip Unit Notes 2013

    41/311

    41

    For a monochrome image the intensity of the image, f at anycoordinates (x,y) is termed as gray level, l of the image at thatpoint, i.e.,

    Lmin < l < Lmax 0 < l < L,

    0 black & L white

    Intermediate values shades of gray or gray shades

    (Monochrome) Image model

  • 7/27/2019 EC2029Dip Unit Notes 2013

    42/311

    42

    To obtain a digital image, f(x,y) must be digitized both in space andamplitude.-digitization of spatial coordinates - image sampling-digitization of amplitude - gray-level quantization

    The image sampling is viewed as partitioning an image plane into a gridwith coordinates of center of each grid from an integer set ZZ.

    The (gray-level) quantization is viewed as assigning a value from areal number set R as gray level to each grid.

    Hence resulting digital image is a MN matrix in which each matrixelement represents a image element or picture element or pixeland its value represents the gray level of that pixel.

    Sampling and quantization

  • 7/27/2019 EC2029Dip Unit Notes 2013

    43/311

    43

    Sampling and quantization

    )1,1()2,1()1,1()0,1(

    )1,1()2,1()1,1()0,1(

    )1,0()2,0()1,0()0,0(

    NMfMfMfMf

    Nffff

    Nffff

  • 7/27/2019 EC2029Dip Unit Notes 2013

    44/311

    44

    The number of samples or pixels, MN required to approximate animage is known as spatial resolution of the image.

    The low or insufficient spatial resolution results in pixel replicationcausing a checkerboard effect.

    Sampling and quantization

    Effect of spatial resolution checkerboard effect

  • 7/27/2019 EC2029Dip Unit Notes 2013

    45/311

    45

    The number of discrete gray levels, G allowed for a pixel in a digitalimage is known as gray-level resolution of the image.

    The low or insufficient gray-level resolution results in ridge-likestructures in smooth areas causing false contouring.

    Sampling and quantization

  • 7/27/2019 EC2029Dip Unit Notes 2013

    46/311

    46

    Effect of gray-level resolution false contouring: Original8-bit image

  • 7/27/2019 EC2029Dip Unit Notes 2013

    47/311

    47

    Effect of gray-level resolution false contouring: Original4-bit image

  • 7/27/2019 EC2029Dip Unit Notes 2013

    48/311

    48

    Effect of gray-level resolution false contouring: Original2-bit image

  • 7/27/2019 EC2029Dip Unit Notes 2013

    49/311

    49

    Effect of gray-level resolution false contouring: Original1-bit image, binary image

  • 7/27/2019 EC2029Dip Unit Notes 2013

    50/311

    50

    If the quantities M, N and G are chosen to be integer powers of 2 i.e.,

    M=2p, N=2q and G=2r where p, q and r are any positive integers,then the size of the resulting digital image is b=MNr bits.

    Example: What is the (physical) size of an 8-bit (i.e, 256 gray-level) image of 1024720 is b=10247208=5898240 bits.Since 8 bits are 1 byte, b=(5898240/8)=737280 bytesSince 1024 bytes are 1 kilo byte (kB)=720 kB(and 1024 kilo bytes are 1 mega bytes (MB))

    Using different values of spatial resolution, i.e., coarse as well as finesampling and gray-level resolution for a given image is known asnon-uniform sampling and quantization.

    Sampling and quantization

  • 7/27/2019 EC2029Dip Unit Notes 2013

    51/311

    51

    Dithering is a technique to simulate the display of intensities/colors

    that are not available in the current grayscale/color palette ofthe display device.

    Generally a full set of intensities/colors is usually represented with areduced number of intensities/colors.

    This is accomplished by arranging adjacent pixels of differentintensities/colors into a pattern which simulates intensities/colorsthat are not available.

    Dithering becomes possible because human eyes only average over anarea, a property known as the spatial integration.

    Dithering methods: Thresholding, classical half-toning, Random Dither,

    Patterning, Ordered Dither and Error Diffusion.

    Dithering

  • 7/27/2019 EC2029Dip Unit Notes 2013

    52/311

    52

    Thresholding: The threshold is chosen to be in the middle of the gray

    scale of the source image. The pixels in the source image darkerthan this threshold value are replaced with black and thoselighter than it with white.

    Dithering Thresholding

    L10

    L1

    T(r)

    (r1,s1)

    (r2,s2)

    Dark Light

    Dark

    L

    ight

    Input gray level, r

    Outputgraylevel,s

    Thresholding: Function & Example

    Ditherin Classical Half

  • 7/27/2019 EC2029Dip Unit Notes 2013

    53/311

    53

    Classical Half-toning: Different intensities or gray levels are

    represented by dots of varying sizes and patterns. Half-toning isalso used for printing color pictures. The general idea is thesame, by varying the density of the four secondary printingcolors, cyan, magenta, yellow and black (abbreviation CMYK), anyparticular shade can be reproduced.

    Dithering Classical Half-toning

    Grayscale Half-toning Color Half-toning

  • 7/27/2019 EC2029Dip Unit Notes 2013

    54/311

    54

    Random dither: A random amount of noise is added to source image

    and threshold is applied.

    Patterning: For each possible pixel (or group of pixels) in sourceimage, a pattern of pixels that approximates that value iscreated and displayed. Remembering the concept of spatialintegration, if appropriate patterns are chosen the appearance ofvarious intensity levels can be simulated.

    Ordered dither: In ordered dither, patterning is achieved with one-

    to-one mapping between pixels in source image and pattern pixels.This eliminates spatial distortion due to spatial enlargement andsubsequent loss of spatial resolution in patterning technique.

    Dithering

  • 7/27/2019 EC2029Dip Unit Notes 2013

    55/311

    55

    Error diffusion: For each possible pixel in source image, a closest

    available intensity/color is identified and the differencebetween the source image pixel value and the closest availableintensity/color is calculated. This error is then distributed tosome neighbors of this pixel before their closest availableintensities/colors are identified.

    Dithering

    Original(8 bits)

    Randomdither

    (1 bit)

    Ordereddither

    (1 bit)

    Errordiffusion

    (1 bit)

    Threshold(1 bit)

  • 7/27/2019 EC2029Dip Unit Notes 2013

    56/311

    56

    Image Transforms 2D transforms:

    Generally a 2D forward transform is expressed as

    where g(m,n,u,v) is called the forward transform kerneland a 2D inverse transform is expressed as

    where h(m,n,u,v) is called the inverse transform kernel.

    =

    =

    =

    1

    0

    1

    0

    ),,,(),(1

    ),(M

    m

    N

    n

    vunmgnmfMN

    vuT

    =

    =

    =

    1

    0

    1

    0

    ),,,(),(),(M

    m

    N

    n

    vunmhvuFnmf

  • 7/27/2019 EC2029Dip Unit Notes 2013

    57/311

    57

    Image Transforms Separable transforms:

    A 2D transform is said to be separable if its forward andreverse kernels are expressed as product of two 1Dkernels, each operating independently on each dimensioni.e.,

    The principal advantage of separability is that the forwardor inverse 2D transform can be obtained in two steps bysuccessive applications of 1D transforms independentlyalong each dimension.

    ),(),(),,,( 21 vngumgvunmg =

    ),(),(),,,( 21 vnhumhvunmh =

  • 7/27/2019 EC2029Dip Unit Notes 2013

    58/311

    58

    Image Transforms 2D Discrete Fourier Transform (DFT):

    The 2D Discrete Fourier Transform (DFT), F(u,v) of animage, f(m,n) of size MN is defined as

    for u=0,1,2,,M-1 & v=0,1,2,,N-1.

    The corresponding 2D Inverse Discrete Fourier Transform

    (IDFT), is defined as

    =

    =

    +

    =

    1

    0

    1

    0

    2

    ),(1

    ),(M

    m

    N

    n

    N

    nv

    M

    muj

    enmf

    MN

    vuF

    =

    =

    +

    =

    1

    0

    1

    0

    2

    ),(),(M

    u

    N

    v

    N

    nv

    M

    muj

    evuFnmf

  • 7/27/2019 EC2029Dip Unit Notes 2013

    59/311

    59

    Image Transforms 2D DFT kernels:

    The forward kernel is

    The inverse kernel is

    This is for the case where M=N.

    +

    =

    =

    N

    nvj

    N

    muj

    N

    nvmuj

    eN

    eN

    eN

    vunmg 222 111

    ),,,(

    +

    =

    =

    N

    nvj

    N

    muj

    N

    nvmuj

    eN

    eN

    eN

    vunmh 222 111

    ),,,(

  • 7/27/2019 EC2029Dip Unit Notes 2013

    60/311

    60

    Image Transforms Fast Fourier Transform (FFT):

    Due to the property of separability of 2D DFT, the FFTalgorithm developed for 1D DFT is applied without anymodification for 2D DFT twice successively along eachdimension.

    N

    mujN

    m

    N

    nvjN

    n

    eenmfN

    vuF

    21

    0

    21

    0

    ),(1),(

    =

    =

    =

    N

    mujN

    m

    evmFvuF

    21

    0

    ),(),(

    =

    =

  • 7/27/2019 EC2029Dip Unit Notes 2013

    61/311

    61

    Image Transforms Fast Fourier Transform (FFT):

    f(m,n)

    Row Transform

    Multiplication byN

    F(m,v) Column Transform F(u,v)

  • 7/27/2019 EC2029Dip Unit Notes 2013

    62/311

    62

    Image Transforms Other separable 2D transforms:

    2D Discrete Cosine Transform (DCT): The 2D forward Discrete Cosine Transform (DCT) is

    defined as

    and the 2D inverse Discrete Cosine Transform (IDCT) isdefined as

    where

    =

    =

    =

    1

    0

    1

    02N

    v1)+(2n

    cos2N

    u1)+(2m

    cosn)f(m,),(

    N

    m

    N

    nvuF

    =

    =

    =

    1

    0

    1

    0

    2N

    v1)+(2ncos

    2N

    u1)+(2mcosv)F(u,),(

    N

    m

    N

    n

    nmf

    1,...,2,1,2&0,1===

    NvuforNvuforN

  • 7/27/2019 EC2029Dip Unit Notes 2013

    63/311

    63

    Image Transforms Other separable 2D transforms:

    Karhunen Lowe (Hotelling) transform (PrincipalComponent Analysis):

    Let x=[x1 x2 xn]T be a population of random vectors xi,i=1,2,n. Then

    Let mx be the mean vector of x, defined asmx=E{x}

    Let Cx be the covariance matrix of x, defined as

    Cx=E{(xm

    x) (xm

    x)T}

    Let A be a matrix whose first row is the eigenvectorcorresponding to the largest eignvalue of Cx and the lastrow is that corresponding to the smallest eignvalue of Cx.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    64/311

    64

    Image Transforms Other separable 2D transforms:

    Karhunen Lowe (Hotelling) transform (PrincipalComponent Analysis):

    Then the Karhunen Lowe (KL) or Hotelling transform of xis the matrix given by

    y=A(xmx) Mean of y is zero i.e., my=0.

    Covariance matrix Cy of y is a diagonal matrix given by

    =

    n

    yC

    L

    MMMM

    L

    L

    00

    00

    00

    2

    1

    where i, i=1,2,n are theeigenvalues of Cx.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    65/311

    65

    Image Transforms Other separable 2D transforms:

    Karhunen Lowe (Hotelling) transform (PrincipalComponent Analysis):

    Hence the components of y vectors are uncorrelated.

    i, i=1,2,n are the eigenvalues of Cy as well. Hence the

    eigenvectors of Cy are also same as those of Cx. Hence KL or Hotelling transform is useful for separating

    the principal components from a set of independentobservations (images) of an object or a scene.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    66/311

    66

    Image Transforms Other separable 2D transforms:

    Singular Value Decomposition (SVD): Any rectangular matrix, A of size, mn can be expressed

    as

    A=USVT

    where (1) U is an orthogonal square matrix of size, mmi.e., UUT=UTU=I. The columns of U are eigenvectors ofAAT. (2) V is an orthogonal square matrix of size, nn i.e.,VVT=VTV=I. The columns of V are eigenvectors of ATA. (3)

    S is a diagonal matrix of size, mn, i.e., sij=0 if ij, withthe diagonal elements equal, i.e., sij, i=j, to the square rootsof eigenvalues of AATor ATA.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    67/311

    67

    Image Transforms Some important features of image transforms studied:

    Energy Conservation & Rotation: Parsevals theorem:The unitary transforms preserves signal energy orequivalently the length of the signal. This means that theunitary transform simply rotates the signal vector in the

    N-dimensional space. Energy Compaction:

    Most unitary transforms has the tendency to pack a largefraction of the signal energy into a relatively few

    components of the transform coefficients. The followingtransforms are having energy compaction in the givenorder DCT, [DFT, Slant], Hadamard, KL, Haar.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    68/311

    68

    Image Transforms Some important features of image transforms studied:

    Decorrelation:When the input signal is highly correlated, the transformcoefficients tend to be uncorrelated. This means that theoff-diagonal elements of the covariance matrix of the

    signal are smaller than the diagonal elements.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    69/311

    Unit 2

    IMAGE ENHANCEMENTTECHNIQUES

    Principle Objective of

  • 7/27/2019 EC2029Dip Unit Notes 2013

    70/311

    2

    p jEnhancement

    Process an image so that the result will bemore suitable than the original image fora specific application.

    The suitableness is up to each application. A method which is quite useful for

    enhancing an image may not necessarily bethe best approach for enhancing anotherimage.

    Broad Classes of Image

  • 7/27/2019 EC2029Dip Unit Notes 2013

    71/311

    3

    gEnhancement Techniques

    Spatial Domain: (image plane) Techniques are based on direct manipulation of

    pixels in an image

    Frequency Domain: Techniques are based on modifying the Fourier

    transform of an image

    There are some enhancement techniques basedon various combinations of methods from thesetwo categories.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    72/311

    4

    Good images For human visual

    The visual evaluation of image quality is a highlysubjective process.

    It is hard to standardize the definition of a good

    image. A certain amount of trial and error usually is

    required before a particular imageenhancement approach is selected.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    73/311

    5

    Histogram Processing Histogram of a digital image with gray levels in

    the range [0,L-1] is a discrete function

    h(h(rrkk) =) = nnkk Where

    rk : the kth gray level

    nk : the number of pixels in the image having gray

    level rk h(rk) : histogram of a digital image with gray levelsrk

  • 7/27/2019 EC2029Dip Unit Notes 2013

    74/311

    6

    Normalized Histogram dividing each of histogram at gray level rrkk by

    the total number of pixels in the image,nn

    p(p(rrkk) =) = nnkk/ n/ n For k = 0,1,

    ,L-1 p(p(rrkk)) gives an estimate of the probability of

    occurrence of gray levelrrkk The sum of all components of a normalized

    histogram is equal to 1

  • 7/27/2019 EC2029Dip Unit Notes 2013

    75/311

    7

    Examples of Histogram

    Components of histogram are concentrated on the low side of thegray scale

  • 7/27/2019 EC2029Dip Unit Notes 2013

    76/311

    8

    Examples of Histogram

    Components of histogram are concentrated on the high side of thegray scale

  • 7/27/2019 EC2029Dip Unit Notes 2013

    77/311

    9

    Examples of Histogram

    Histogram is narrow and concentrated toward the middle of thegray scale

  • 7/27/2019 EC2029Dip Unit Notes 2013

    78/311

    10

    Examples of Histogram

    Histogram covers wide range of the gray scale and the distributionis nearly uniform over the entire gray scale except at few points

    near the dark region of the gray scale

  • 7/27/2019 EC2029Dip Unit Notes 2013

    79/311

    11

    Histogram Equalization Let r represent the input gray levels in the interval [0,1] where

    r=0 represents black and r=1 represents white. Thetransformation

    s=T(r)s=T(r)

    produces a gray level, s in the output image for every gray level,

    r in the original (input) image. This transformation is to satisfythe following conditions:

    a) T(r) is single-valued, monotonically increasing in the interval0r1

    b) (b) 0T(r)1 for 0r1Condition (a) preserves the order when r varies from black towhite and (b) guarantees a mapping that is consistent with theallowed range of pixel values.

  • 7/27/2019 EC2029Dip Unit Notes 2013

    80/311

    12

    Histogram Equalization Single-valued function, T(r) guarantees that there exists an

    inverse transformationr=Tr=T11(s)(s)

    that satisfies the same set of conditions (a) and (b).

    If pr(r) represents the probability density function (PDF) of the

    random variable, r and ps(s) represents the probability densityfunction (PDF) of the random variable, s, then from the basicprobability theory,

    )(|1

    )()(sTr

    rsdsdrrpsp

    =

    =

  • 7/27/2019 EC2029Dip Unit Notes 2013

    81/311

    13

    Histogram Equalization Histogram equalization is to control the PDF of gray levels of an

    image via a transformation function so that the resulting PDF isa uniform density. This is achieved by taking the cumulativedistribution function (CDF) of r as the required transformationfunction, T(r) i.e.,

    where w is the dummy variable of integration.

    ==r

    r dwwprTs0

    )()(

  • 7/27/2019 EC2029Dip Unit Notes 2013

    82/311

    14

    Histogram Equalization With this transformation function, the PDF, ps(s) of s becomes

    )r(p

    dw)w(pdrd

    dr

    )r(dT

    dr

    ds

    r

    r

    r

    =

    =

    =

    0

    10where1

    1

    =

    =

    =

    s

    )r(p)r(p

    dsdr)r(p)s(p

    r

    r

    rs

    Substitute and yield

    Histogram Equalization-

  • 7/27/2019 EC2029Dip Unit Notes 2013

    83/311

    15

    Discrete Form The probability of occurrence of gray

    level in an image is approximated by

    The discrete version of transformation

    =

    =

    ==

    ==

    k

    j

    j

    k

    j

    jrkk

    , ..., L-,where kn

    n

    )r(p)r(Ts

    0

    0

    110

    110 , ..., L-,where k

    n

    n)r(p kkr ==

    Histogram Equalization-

  • 7/27/2019 EC2029Dip Unit Notes 2013

    84/311

    16

    Discrete Form Thus, the histogram equalization or

    linearization is a method of obtaining auniform histogram for a given image.

    Histogram Equalization-

  • 7/27/2019 EC2029Dip Unit Notes 2013

    85/311

    17

    Example

    otherwiserrrpr

    ,010,22)( +=

    r

    p(r)

    0 1 2

    2

    1

    Histogram Equalization-

  • 7/27/2019 EC2029Dip Unit Notes 2013

    86/311

    18

    Example Hence, the required transformation function is

    Solving the above equation for r, we have

    Since r lies in the interval [0,1], only the function

    is valid.

    rrdwwdwwprTs

    r r

    r 2)22()()(2

    0 0

    +=+===

    ( )ssTr == 11)(1

    ( )ssTr == 11)(1

    Histogram Equalization-

    l

  • 7/27/2019 EC2029Dip Unit Notes 2013

    87/311

    19

    Example Hence,

    ( )

    ( )

    +=

    =

    ==

    sds

    dr

    ds

    drrpsp

    ssTr

    rs 11[)22()()(11)(1|

    ( )

    ( )

    =

    s

    s

    1

    1

    2

    1)12(

    10,1 = sfors

    Ps(s)

    0 1

    1

    H E l

  • 7/27/2019 EC2029Dip Unit Notes 2013

    88/311

    Histogram Equalization

    Hi ifi i

  • 7/27/2019 EC2029Dip Unit Notes 2013

    89/311

    21

    Histogram Specification Histogram specification is a method of

    obtaining a particular histogram shapecapable of highlighting certain gray level

    ranges in a given image.

    Hi S ifi i

  • 7/27/2019 EC2029Dip Unit Notes 2013

    90/311

    22

    Histogram Specification If pr(r) and ps(s) represent the original and desired probability

    density functions, respectively, then the histogram specificationis achieved as follows:

    1. Equalize the levels of the original image via thetransformation function

    2. Specify the desired probability density function, pz(z) andobtain the transformation function

    3. Apply the inverse transformation z=G1(s) to the levelsequalized in step 1.

    ==r

    r dwwprTs0

    )()(

    ==z

    z dwwpzGs0

    )()(

    Hi t S ifi ti

  • 7/27/2019 EC2029Dip Unit Notes 2013

    91/311

    23

    Histogram Specification The resulting image has the gray levels characterized

    by the specified probability density function, pz(z) i.e.,has the specified histogram.

    In practice, the inverse transformation from s to z isnot single-valued. This happens when there are unfilledlevels in the specified histogram. These unfilled levelsmake the cumulative distribution function to be

    constant over the unfilled intervals.

    Hi t S ifi ti

  • 7/27/2019 EC2029Dip Unit Notes 2013

    92/311

    24

    Histogram Specification

    Histogram Specification-

    E l

  • 7/27/2019 EC2029Dip Unit Notes 2013

    93/311

    25

    ExampleWe would like to apply the histogram specification withthe desired probability density function pz(z) as shown.

    0 1 2

    1

    2

    Pz(z)

    z

    =

    elsewhere;01z;02z)z(pz

    1

    0

    =z

    z dw)w(p

    St 1

  • 7/27/2019 EC2029Dip Unit Notes 2013

    94/311

    26

    Step 1

    26

    0 1

    1

    s=T(r)

    rrr

    ww

    dw)w(

    dw)w(p)r(Ts

    r

    r

    r

    r

    2

    2

    22

    2

    0

    2

    0

    0

    +=

    +=

    +=

    ==

    Obtain the transformation function T(r)

    One to one

    mappingfunction

    St 2

  • 7/27/2019 EC2029Dip Unit Notes 2013

    95/311

    27

    Step 2

    27

    2

    0

    2

    0

    2 zzdw)w()z(G

    zz

    ===

    Obtain the transformation function G(z)

    St p 3

  • 7/27/2019 EC2029Dip Unit Notes 2013

    96/311

    28

    Step 3

    28

    2

    22

    2

    2

    rrz

    rrz

    )(T)(G

    =

    +=

    =

    Obtain the inversed transformation function G-1

    We can guarantee that 0 z 1 when 0 r 1

    Noise Models

  • 7/27/2019 EC2029Dip Unit Notes 2013

    97/311

    29

    Noise Models Gaussian Noise: The Probability Density Function (PDF)

    of Gaussian noise is

    where z represents gray level, is the mean of averagevalue of z, and is its standard deviation. The standard

    deviation squared,2

    , is called the variance of z. Mathematically easily traceable in both spatial and

    frequency domains.

    2

    2

    2

    )(

    2

    1)(

    =

    z

    ezp

    Noise Models

  • 7/27/2019 EC2029Dip Unit Notes 2013

    98/311

    30

    Noise Models The distribution of Gaussian noise is shown in the following figure.

    z: Gray level value: Mean

    : Standard deviation

    Noise Models

  • 7/27/2019 EC2029Dip Unit Notes 2013

    99/311

    31

    Noise Models Rayleigh Noise: The Probability Density Function (PDF)

    of Rayleigh noise is

    where z represents gray level and the mean and varianceare given by