DIGITAL IMAGE PROCESSING
    PART I
1   Thuong Nguyen
CONTENT
 Digital image fundamentals
 Image transform

 Image enhancement

 Image restoration

 Image compression




                               2
I. DIGITAL FUNDAMENTAL
 Digital Image Processing System
 Sampling and Quantization

 Relationships between pixels




                                    3
DIP SYSTEM




             4
DIP SYSTEM




             5
DIP SYSTEM




             6
SAMPLING AND QUANTIZATION
 Quantization: limit of intensity resolution
 Sampling: Limit of spatial and temp resolution
       Uniform and non-uniform




                                                   7
PIXEL’S RELATIONSHIPS
   Two pixel are adjacent if
     Neighbors as 4, 8, and m-connectivity
     Gray levels satisfy a specified criterion

   Connectivity
       Existing a path between two pixels
   Path
       Path from p(x,y) to q(s,t) is
            (x0, y0), (x1, x2), …, (xn, yn)
    Where (x, y) = (x0, y0), (s, t) = (xn, yn)


                                                  8
II. IMAGE ENHANCEMENT IN FREQ DOMAIN
 Discrete Fourier Transform
 Other Image Transform

 Hotelling Transform




                                       9
THE DISCRETE FOURIER TRANSFORM
   The Fourier transform
     1-D
     2-D




   Properties




                                 10
THE DISCRETE FOURIER TRANSFORM
   Discrete Fourier transform pair
       One dimensional




       Two dimensional




                                      11
THE DISCRETE FOURIER TRANSFORM
   2D FFT and Image Processing




                                  12
THE DISCRETE FOURIER TRANSFORM





   Fast Fourier transform
        Efficient algorithm to compute DFT by reduce computation   13
         burden: O(N2) – O(NlogN)
OTHER SEPARABLE IMAGE TRANSFORM
   General relation ship

   Several condition
     Separable
     Symmetric

   Separable kernel can be compute in two step of 1D transf

   For separable and symmetric kernel


                                                               14
OTHER SEPARABLE IMAGE TRANSFORM
   Walsh Transform



   Hadamard transform



   Discrete cosine transform




                                  15
HOLTELLING TRANSFORM
                                Mean:
                                                    M
                                                1
      x1                        mx      E{x}              xk
      x2                                        M   k 1

x1     .   ,........,   x   M   Covariance:
                                                                   M
       .                                                  T    1                 T           T
      xn                        Cx   E{( x mx )( x mx ) }                xk xk       mk mk
                                                               M   k 1

     M data points




                                                                                                 16
III. IMAGINE ENHANCEMENT
 Basic intensity functions
 Histogram processing

 Spatial Filtering

 Enhancement in the Frequency domain

 Color image processing




                                        17
BASIC INTENSITY FUNCTIONS
   Spatial domain process

   Image negatives:
     intensity level in the range [0, L-1]
     s=L–1–r
   Log trans
       s = c log(1 + r)
   Power law (gramma) trans
       s=cr
   Piecewise-Linear Trans
     Contrast stretching
     Intensity level slicing                 18
     Bit plane slicing
HISTOGRAM PROCESSING
   Histogram
     Histogram equalization:
     Histogram matching
     Local histogram processing

 Image subtraction
 Image averaging




                                   19
SPATIAL FILTERING
   Fundamental: using spatial masks for Image Processing




   Smoothing Filter
       Lowpass spatial filtering
       Meadian filtering




                                                            20
SPATIAL FILTERING
   Sharpening filter
       Highpass spatial filtering
           Emphasize fine details
       High-boost filtering
         Enhance high freq while keeping the low freq
         Highboost = (A-1) original + Highpass

       Derivative filters
           First order: gradient




           Second order
                                                         21
ENHANCEMENT IN THE FREQUENCY DOMAIN
Spatial domain                             Frequency domain
   Definition                                Definition
     Chang pixel position  changes            Change in image position 
                                                 changes in spatial frequency
      in the scene
                                                Which image intensity values are
     Distance is real
                                                 changing in the spatial domain
                                                 image
   Processing                                Processing
       Directly process the input image        Transform the image to its
        pixel array                              frequency representation
                                                Perform image processing
                                                compute



                                                                                    22
ENHANCEMENT IN THE FREQUENCY DOMAIN
   Lowpass filter
       Ideal

       Butterword


   Highpass filter
       Ideal

       Butterworth


   Homomorphic
                                      23
COLOR IMAGE PROCESSING
   Background
     Human can perceive thousands of colors
     Two major area: full color and pseudo color
     Color quantization: 8-bit or 24bit
   Color fundamental
     Result of light in the rentina: 400-700nm
     Characterization of light: monochromatic and gray level
           Radiance: total amount of energy emitted by light source
           Brightness: intensity
           Luminance: amount of energy perceived by obervers, in lumens
   Color characters
     Hue
     Saturation
     Birghtness                                                           24
IV. IMAGE RESTORATION
 Degradation Model
 Diagonalization of Circulant & Block-Circulant Matrices

 Algebraic Approach

 Inverse Filtering

 Weiner Filter

 Constrained LS Restoration

 Interactive Restoration

 Restoration at Spatial Domain

 Geometric transform

                                                            25
DEGRADATION MODEL
   Noise models
     Spatial and frequency properties
     Noise PDF: Gaussian, Rayleigh, Erlang, Exponential, Uniform,
      Impulse ..
     Estimate noise parameters:
         Spectrum inspection: periodic noise
         Test image: mean, variance and histogram shape, if imaging system is
          available
   De-noising
       Spatial filtering ( for additive noise)
         Mean filters
         Order-statistics filters

         Adaptive filters:
                                                                                 26
       Frequency domain filtering (for periodic noise)
V. IMAGE COMPRESSION
 Fundamentals
 Image Compression Models

 Elements of Information Theory

 Error-Free Compression

 Lossy Compression

 Image Compression standard




                                   27
VI. IMAGE SEGMENTATION
 Detection of Discontiuties
 Edge Linking and Boundary Detection

 Thresholding

 Region-Oriented Segmentation

 Motion in Segmentation




                                        28
VII. REPRESENTATION AND DESCRIPTION
 Representation Scheme
 Boundary Descriptors

 Regional Descriptors

 Morphology

 Relational Descriptors




                                      29
VIII. RECOGNITION AND INTERPRETATION
 Elements of Image Analysis
 Patterns and Pattern Classes

 Decision-Theoretic Methods

 Structural Methods

 Interpretation




                                       30

Digital Image Processing Fundamental

  • 1.
    DIGITAL IMAGE PROCESSING PART I 1 Thuong Nguyen
  • 2.
    CONTENT  Digital imagefundamentals  Image transform  Image enhancement  Image restoration  Image compression 2
  • 3.
    I. DIGITAL FUNDAMENTAL Digital Image Processing System  Sampling and Quantization  Relationships between pixels 3
  • 4.
  • 5.
  • 6.
  • 7.
    SAMPLING AND QUANTIZATION Quantization: limit of intensity resolution  Sampling: Limit of spatial and temp resolution  Uniform and non-uniform 7
  • 8.
    PIXEL’S RELATIONSHIPS  Two pixel are adjacent if  Neighbors as 4, 8, and m-connectivity  Gray levels satisfy a specified criterion  Connectivity  Existing a path between two pixels  Path  Path from p(x,y) to q(s,t) is (x0, y0), (x1, x2), …, (xn, yn) Where (x, y) = (x0, y0), (s, t) = (xn, yn) 8
  • 9.
    II. IMAGE ENHANCEMENTIN FREQ DOMAIN  Discrete Fourier Transform  Other Image Transform  Hotelling Transform 9
  • 10.
    THE DISCRETE FOURIERTRANSFORM  The Fourier transform  1-D  2-D  Properties 10
  • 11.
    THE DISCRETE FOURIERTRANSFORM  Discrete Fourier transform pair  One dimensional  Two dimensional 11
  • 12.
    THE DISCRETE FOURIERTRANSFORM  2D FFT and Image Processing 12
  • 13.
    THE DISCRETE FOURIERTRANSFORM   Fast Fourier transform  Efficient algorithm to compute DFT by reduce computation 13 burden: O(N2) – O(NlogN)
  • 14.
    OTHER SEPARABLE IMAGETRANSFORM  General relation ship  Several condition  Separable  Symmetric  Separable kernel can be compute in two step of 1D transf  For separable and symmetric kernel 14
  • 15.
    OTHER SEPARABLE IMAGETRANSFORM  Walsh Transform  Hadamard transform  Discrete cosine transform 15
  • 16.
    HOLTELLING TRANSFORM Mean: M 1 x1 mx E{x} xk x2 M k 1 x1 . ,........, x M Covariance: M . T 1 T T xn Cx E{( x mx )( x mx ) } xk xk mk mk M k 1 M data points 16
  • 17.
    III. IMAGINE ENHANCEMENT Basic intensity functions  Histogram processing  Spatial Filtering  Enhancement in the Frequency domain  Color image processing 17
  • 18.
    BASIC INTENSITY FUNCTIONS  Spatial domain process  Image negatives:  intensity level in the range [0, L-1]  s=L–1–r  Log trans  s = c log(1 + r)  Power law (gramma) trans  s=cr  Piecewise-Linear Trans  Contrast stretching  Intensity level slicing 18  Bit plane slicing
  • 19.
    HISTOGRAM PROCESSING  Histogram  Histogram equalization:  Histogram matching  Local histogram processing  Image subtraction  Image averaging 19
  • 20.
    SPATIAL FILTERING  Fundamental: using spatial masks for Image Processing  Smoothing Filter  Lowpass spatial filtering  Meadian filtering 20
  • 21.
    SPATIAL FILTERING  Sharpening filter  Highpass spatial filtering  Emphasize fine details  High-boost filtering  Enhance high freq while keeping the low freq  Highboost = (A-1) original + Highpass  Derivative filters  First order: gradient  Second order 21
  • 22.
    ENHANCEMENT IN THEFREQUENCY DOMAIN Spatial domain Frequency domain  Definition  Definition  Chang pixel position  changes  Change in image position  changes in spatial frequency in the scene  Which image intensity values are  Distance is real changing in the spatial domain image  Processing  Processing  Directly process the input image  Transform the image to its pixel array frequency representation  Perform image processing  compute 22
  • 23.
    ENHANCEMENT IN THEFREQUENCY DOMAIN  Lowpass filter  Ideal  Butterword  Highpass filter  Ideal  Butterworth  Homomorphic 23
  • 24.
    COLOR IMAGE PROCESSING  Background  Human can perceive thousands of colors  Two major area: full color and pseudo color  Color quantization: 8-bit or 24bit  Color fundamental  Result of light in the rentina: 400-700nm  Characterization of light: monochromatic and gray level  Radiance: total amount of energy emitted by light source  Brightness: intensity  Luminance: amount of energy perceived by obervers, in lumens  Color characters  Hue  Saturation  Birghtness 24
  • 25.
    IV. IMAGE RESTORATION Degradation Model  Diagonalization of Circulant & Block-Circulant Matrices  Algebraic Approach  Inverse Filtering  Weiner Filter  Constrained LS Restoration  Interactive Restoration  Restoration at Spatial Domain  Geometric transform 25
  • 26.
    DEGRADATION MODEL  Noise models  Spatial and frequency properties  Noise PDF: Gaussian, Rayleigh, Erlang, Exponential, Uniform, Impulse ..  Estimate noise parameters:  Spectrum inspection: periodic noise  Test image: mean, variance and histogram shape, if imaging system is available  De-noising  Spatial filtering ( for additive noise)  Mean filters  Order-statistics filters  Adaptive filters: 26  Frequency domain filtering (for periodic noise)
  • 27.
    V. IMAGE COMPRESSION Fundamentals  Image Compression Models  Elements of Information Theory  Error-Free Compression  Lossy Compression  Image Compression standard 27
  • 28.
    VI. IMAGE SEGMENTATION Detection of Discontiuties  Edge Linking and Boundary Detection  Thresholding  Region-Oriented Segmentation  Motion in Segmentation 28
  • 29.
    VII. REPRESENTATION ANDDESCRIPTION  Representation Scheme  Boundary Descriptors  Regional Descriptors  Morphology  Relational Descriptors 29
  • 30.
    VIII. RECOGNITION ANDINTERPRETATION  Elements of Image Analysis  Patterns and Pattern Classes  Decision-Theoretic Methods  Structural Methods  Interpretation 30

Editor's Notes

  • #5 Image acquisition: acquire digital image by using sampling and quantization (lossy-compress)Preprocessing: enhancing contrast, remove noise…Segmentation: partition an image to its objectsRep & Des: Representation of image for suitable processing and select the interest of features.Recog & Interp: assign a label to an object and meaning to an ensemble of recognized objectKnowledge: knowledge of problem domain is coded into an DIP
  • #6 Image acquisition: acquire digital image by using sampling and quantization (lossy-compress)Preprocessing: no-longer called, but use Image enhancement instead. The simplest technique of DIP Bring out the detail(which is obscured), highlight the certain features of interest subjective area (chuquan), Image restoration: improve the appearance of an image, unlike enhancement, it restoration based on image degradationColor image processing: every application now require color image: print, advertising, computer displays… Wavelets and multi-resolution processing: recent trans for easier compress, transmit and alyzeCompression: reduce storage required to save an image.Morphological processing: extracting image componentSegmentation: partition an image into its constituent parts or Rep & Des: Representation of image for suitable processing and select the interest of features.Knowledge: knowledge of problem domain is coded into an DIP
  • #8 - Aliasing: under-sampling, poor reconstruction (spatial aliasing, temporal aliasing)Gray level: 2^n, n is a positive integer
  • #9 To establish boundaries, components4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p).8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p).m-adjacency: Two pixels p and q with values from V are m-adjacent if,q is in N4(P).q is in ND(p) and the set of { N4(p) giaovoi N4(q)} is emplty.Connectivity: To determine whether the pixels are adjacent in some sense. (N4, N8… )
  • #11 With finite area under the curve can be expressed as the integral of sines and/pr cosines multiplied by a weight functionRequirementF(x) is piecewise continuous on every finite intervalFx is integrable
  • #12 Sincewearedealingwithimages,wewillbemoreinterestedinthediscreteFourierTransform(DFT)
  • #14 H(u,v) is transfer functionApplication:Noise removalPattern or texture recognition
  • #15 T is the transform of f and g is the forward trans kernelH is the inverse transformation kernelSeparable kernel can be computed in two steps, each requiring 1D transformParameters:F^ is apprxomatedimgae, B is inverse transformation matrixA is NxN transformation matrixF is NxN image matrixFor exampleCalculation of Fourier transform of 2 pixel by 2 pixel 2 D
  • #16 Wash transform Hadamard transform was used because of its simplicity of implementation and faster than fft. For measuring randomess of a finite sequenceTesting number sequencesSolving first order partial differential equation, and integral equationsAstronomical image processing, coding and filtering operationDiscrete Cosine Transform: widely use in image compression, use in JPEC< MPECG< H261… Notice that the DCT is a real transform.The DCT has excellent energy compaction properties.There are fast algorithms to compute the DCT similar to the FFT.
  • #17 The rows of matrix A are the eigen vectors of the covarience matrixarranged in descending order (The first row corresponds to the eigen vector corresponding to the largest eigen value of C, ...)
  • #19 - f(x, y) denotes the input image and g(x,y) presents the processed image. T is an operator on f which defined over some neighborhood of (x,y).NegativeReversing the intensity level of an imageExpand value of dark pixels, compressing higer level valuePower law: the Same as log transPiece wise: advantage – arbitrarily complex, disadvantage – require more user input.Contrast stretching: spans the range of intensity levels in an image to full intensity range. HOW – just scale with upper and lower limitIntensity level slicing: highlighting a specific range of intensities in an image. Bit plane slicing: high order bit give almost information
  • #20 Histogram: rk is the kth gray level and nk is number of pixels wich have the nk gray levelHistogram Equalization: map from r to s, from poor dynamic rang to wider, but give only one resultHistogram Matching: specify a particular histogram shape. Equalize levels of original image, then specify desired density fucntion to get G(z), and finally applu inverse trans to find zLocal histogram: devise trans functions based on gray-level of distribution by using previous techniques and define a square or rectangular locationThe two properties call intensity mean and variance are frequently used --- Image Subtraction: the difference between the two imageImage averaging : by consider the average of a set of image
  • #21 The word “filtering” has been borrowed from the frequency domain,defined by: (1) A neighborhood and (2)An operation that is performed on the pixels inside the neighborhoodA filtered image is generated as the center of the mask moves to every pixel in the input image  Handling Pixels Close to Boundaries byzero padding or some other methodMaskmxn, where m and. n is an odd positive integer. And the gray level in (x,y) pixel are replicated by RSmoothing filter: for blur and noise reduction, because of always got “snow” on the imageLowpass filter: averages out rapid changes in intensitySimplest low-pass: calculate the average of a pixel and all of its 8 immediate neighbors then replace the original pixelReplete for every pixel in the image. ( about the pixel in the edge?)Meadian filterProcessing: sort differential value of one pixel and its nearest 8 pixels by ascending order.Pickup the middle value from sorted 9 values and replace value on the middle with the new value.d
  • #22 Sharpening filter: Enhance the edges of objects and adjust the contrast and the shade characteristics. Being detectors with threshold, sensitive to shut noiseHighpass filter: make image appear sharper, emphasize fine details in the image but amplifies noise. Positive coefficients near its center, and negative in other which satisfy the sum of the coefficients is zero.- constant intensityResults may negative need scale or cuttingDon’t take the absolute value of the responseNot overdoing this, make degrade image quality, look grainy and unnatural, get a dark donuts around every points. High-boot filteringallows some of the low-frequencies back in  result looks more like the original with accents on the highpassDerivative filters:enhance contrast, detect edges and boundaries and also measure feature orientation. Can be taken by using the gradientFirst order: require the sum of the coefficient is equal zeroSecond order:Center pixel coefficient be positiveOutercoefficient be negativeSum of coefficients be zero
  • #23 Frequencies means:High frequency - pixel values that change rapidly across the image (e.g: text, texture, leaves…)Strong low frequency  large scale feature in the image( e.g: single object that dominates the image)Any spatial or temporal signal has an equivalent frequency representation
  • #24 Low-pass filtering smooths a signal or image: low freq– gradual transitions and high freq = rapid transitionSmoothing helps remove noiseHigh pass filter only the brightest parts of the image – where SNR is highest
  • #25 Color fundamentalRadiance: including spectral power distributionBrightness: visual sensation, which area appers to meit more or less light and cannot be meased quantitativelyLumiance: more tractable of brightness, mangniture of luminance propotional to physical power, bColor charactersHue: Dominant color as perceived by an observer (red, orange, or yellow)Saturation: Relative purity of color; pure spectrum colors are fully saturated, inversely proportional to amount of lightBrightness: Achromatic notion of intensity
  • #26 Application:Scientific exploration, investigation, film making, image and video code/decodingConsumer photography
  • #27 Image enhancement: “improve” an image subjectively and Image restoration: remove distortion from image, to go back to the “original” -- objective process,  degradation is the degrade of image quality by some affect of noise.NoiseSpatial and freq properties: define spatial characteristics of noise, There are several noise like: Periodic noise: made by electrical or electromechanical interference during the acquisition time.Reduced significantly via frequency domain filtering.Estimate noise: by fourier spectrumSpectrum inspection Test imageDenoisingMean filters: arithmetic, geometricOrder statistics filter: based on the ranking ò the pixels