Document Sample
enhancement Powered By Docstoc
					Image Enhancement

• Overview
• Gray Scale Modification
   – Mapping Equations
   – Histogram Modification
• Image Sharpening
• Image Smoothing
• Are employed to emphasize, sharpen & smooth
  image features for display and analysis
• Image enhancement is the process of applying
  these techniques to facilitate the development
  of a solution to a computer imaging problem
• Operate in the spatial domain, manipulating the
  pixel data, or in frequency domain, by modifying
  the spectral components (figure 8.1.2)
• Some used both
• Type of techniques :-
  1. Point operations – where each pixel is modified
     according to a particular equation that is not
     dependent on other pixel values
  2. Mask operations - where each pixel is modified
     according to the values in a small neighborhood
  3. Global operations – where all the pixel values in the
     image are taken into consideration
• Spatial domain processing include all three but
  freq domain use global operations
          Gray Scale Modification
• Also called gray level scaling or gray level
  transformation, is the process of taking the original
  gray level values and changing them to improve
• Relates to improving image contrast and brightness
• Image contrast is a measure of the distribution and
  range of gray levels – the difference between the
  brightest & darkest pixel values and how the
  intermediate values are arranged
• Image brightness refers to the overall average, or
  mean, pixel value in the image
            Mapping Equations
• One method to modify gray levels is a mapping
• mapping equation changes the pixel’s (gray level)
  values based on a mathematical function that
  uses brightness values as input
• The outputs of the equation are the enhanced
  pixel values
• Mapping is in the category of point operations
• Primary operations applied to gray scale image
  are to compress or stretch it
• Compress that are of little interest to us, and
  stretch where desire more information
• When the slope of the line is 0 – 1, gray level
• If the slope is greater than 1, gray level stretching
• See example 8.2.1
  Figure 8.2-2 Gray-level Stretching with Clipping at Both
Ends. a) The mapping equation, b) the original image, c) the
         modified image with the stretch gray levels




                                80                   180
                 I(r,c) – Original Gray Level Values

          Histogram Modification
• Use similar function which referred to as
  histogram modification
• Focus on histogram shape and range
  – Histogram with a small spread has low contrast,
  – histogram with a wide spread has high contrast
  – Histogram clustered at the high end corresponds to a
    bright image
• Examination of histogram is useful tools, as it
  contains information of gray level distribution that
  easy to see the modifications that may improve
Figure 8.2-10 Histogram Stretching with Clipping. a) Original image, b)
 histogram of original image, c) image after histogram stretching with
    out clipping, d) histogram of image (c), e) image after histogram
   stretching with clipping 1% of the values at the high and low ends

                                           b                        e


 Figure 8.2-11 Histogram Shrinking a) Original image, b)
    histogram of image (a), c) image after shrinking the
histogram to the range [75,175], d) histogram of image (c)




 Figure 8.2-12 Histogram Slide. The original image for these operations is the image
 from 8.2-11c that had undergone a histogram shrink process. a) the resultant image
    from sliding the histogram down up 50, b) the histogram of image (a) , c) the
resultant image from sliding the histogram down by 50, b) the histogram of image (c).

                                     a                                b

                                     c                                 d
• Histogram equalization is an effective techn
  for improving the appearance of a poor image
• The function is the same as histogram stretch
  but often provides more visually pleasing
  results across a wider range of images
• Involves probability theory which treat as the
  probability distribution of gray levels
• Histogram equalization process consists 4 steps:
  1. Find the running sum of the histogram values
  2. Normalize the values from step (1) by dividing by
     the total number of pixels
  3. Multiply the values from step (2) by the maximum
     gray level value and round
  4. Map the gray level values to the results
• See example 8.2.6
• Image sharpening deals with enhancing detail
  information in an image, typically edges and
• Detail information is typically in the high spatial
  frequency information, so these methods include
  some form of highpass filtering
• Many image sharpening algorithms consist 3:-
  1. Extract high frequency information
  2. Combine the high frequency image with original image
     to emphasize image detail
  3. maximizing image contrast via histogram manipulation
                           •Rapidly changing brightness values – high freq
High Frequency             •Slowly changing brightness values – low freq
                           •Constant brightness – zero frequency

• Using a high boost spatial filter             1  1  1
                                                1 x  1
                                                          
                                                1  1  1
                                                          
• This mask is convolved with the image & value
  x determines the amount of low frequency
  information retained in the resulting image
• Value 8 – highpass filter (output image will
  contain only the edges)
• Larger values will retain more of ori image
• Less than 8 – negative of ori
High Boost Spatial Filtering a)
       Original image
 b) results of performing a highboost
spatial filter with a 3x3 mask and x = 6
c) histogram stretched version of (b) ,
 note the image is a negative of the
 d) results of performing a highboost
spatial filter with a 3x3 mask and x = 8
e) histogram stretched version of (d),
    note the image contains edge
           information only
   , f) results of performing a
highboost spatial filter with a 3x3
          mask and x = 12
g) histogram stretched version of (f)
• high boost mask can be extended with -1’s and a
  corresponding increase in the value x
• Larger masks will emphasize the edges more
  (make them wider), and help to mitigate the
  effects of any noise in original image
• If we create NxN mask, value x is NxN-1,
                                       1  1  1  1  1
  5x5-1=24                                               
                                          1    1  1  1  1
                                          1    1 x  1  1
                                                              
                                          1    1  1  1  1
                                          1
                                                1  1  1  1
      Directional Difference Filters
• Similar to high boost filter but emphasize the
  edges in a specific direction
• This filters also called emboss filters, due to the
  effect they create on the output image

    0  1 0  1 0 0   0 0 0   0 0  1
    0 0 0  0 0 0   1 0  1  0 0 0 
                                     
    0  1 0  0 0  1  0 0 0   1 0 0 
                                     
  Directional Difference Filters. a) Original image, b)
image sharpened by adding the difference filter result
to the original image, followed by a histogram stretch,
 c) 3x3 filter result with the +1 and -1 in the horizontal
 direction which emphasizes vertical lines, d) 3x3 filter
result with the +1 and -1 in the vertical direction which
                emphasizes horizontal lines,
 e) 7x7 filter result with the +1 and -1 in the horizontal
 direction which emphasizes vertical lines, d) 7x7 filter
result with the +1 and -1 in the vertical direction which
                emphasizes horizontal lines
         Homomorphic Filtering
• Digital images are created from optical images
• Optical images consist of 3 primary components,
  lighting & reflectance component
• Lighting component results from lighting
  conditions present when image is captured, & can
  change as the lighting conditions change
• reflectance component results from the way
  objects in the image reflect light & are
  determined by properties of object
• Many applications it is useful to enhance
  reflectance component, while reducing the
  contribution from the lighting component
• Homomorphic filtering is a freq domain filtering
  process that compresses the brightness (from
  the lighting conditions), while enhancing the
  contrast (from the reflectance)
• Image model is as follows:
       I(r,c) = L(r,c) R(r,c)
       where L(r,c) represents the contribution of lighting
  conditions, & R(r,c) represents the contribution of
  reflectance properties of      objects
• Assumes that L(r,c) consists of primarily slow spatial
  changes (low spatial frequencies), & is responsible for
  overall range of brightness
• Assumptions for R(r,c), consists primarily of high spatial
  frequency information
• Consists of 5 steps:
  1.   A natural log transform (base e)
  2.   the Fourier transform
  3.   Filtering
  4.   the inverse Fourier transform, and
  5.   the inverse log function – the exponential
1. Decouple the L(r,c)
   & R(r,c)
2. Puts the image into
   freq domain
3. Perform filtering
4. Inverse transforms
   (step 2)
5. Inverse step 1
              Unsharp Masking
• Used by photographers to enhance image
• It sharpens image by subtracting a blurred (lowpass)
  version of original image
• This was accomplished during film development by
  superimposing a blurred negative onto corresponding
  film to produce a sharper result
• The process is similar to adding a detail enhanced
  (highpass) version to original
• To improve image contrast, include histogram
  modification as part of unsharp masking enhancement
• Original image is lowpass
  filtered, followed by
  histogram shrink
• Resultant image is
  subtracted from original
• Histogram stretch to
  restore image contrast
ranges of
            Image Smoothing
• Used to give image softer or special effect, or
  to mitigate noise effects
• For spatial domain is by considering a pixel
  and its neighbors and eliminating any extreme
  values with median or mean filters
• In freq domain, is accomplished by some form
  of lowpass filtering
• Equivalent convolution mask can be approximated with
• Some form of average (mean) filters
• The coefficients are all positive, unlike highpass filters
• Some common spatial convolution masks, where first 2
  are standard arithmetic mean filters & last 2 are
  approximations to Gaussian filters
           1 1 1 1 1 1 2 1 2 1 2 1
           1 1 1 1 2 1 1 4 1 2 4 2
                                  
           1 1 1 1 1 1 2 1 2 1 2 1
                                  

Shared By: