Thursday, March 10, 2011

Image Processing: Getting Some Information From An Image (Part 2)

Digital Image Processing (3rd Edition)       Pixel operation is operation of an image where each pixel's intensity value is modified. The modification/transformation depends solely on its previous value, regardless of its position and other pixels value. Some image operation in this category is brightness modification, contrast enhancement, color inversion (negation), and thresholding operation.
       Pixel operation is done by transforming each pixel value to new value according to a transformation function, known as gray-scale transformation (GST) function. This function maps the gray-level input (Ki) to a new gray-level output (Ko). In general, a GST function can be expressed as:
Ko=f(Ki)
      The mapping of typical GST function can presented as transformation curve, as shown in above figure. The function can be linear or non-linear. In a true color image, GST function is applied to each RGB elements. Each function for each color element can take the same form or different depends on the application.

RGB to Grayscale conversion
      Intensity of an image is the average of the three color elements, so the gray scale image that represent the original color image can be computed as:

I0=(Ri+Gi+Bi)/3

       Io is the output intensity, Ri, Gi, and Bi are the red, green, and the blue element intensity. The formula for more realistic result is by adding different weight for each R,G, and B element. We normally percept green color brighter that red color, and red color brighter than blue color. That's why we usually set the weight higher for red and higher for green.

Io=(0.299Ri + 0.587Gi + 0.144Bi)/3

      Actually there is no absolute reference for each weight values because it depends on the display technology that might change in the future. The above formula is standardized by NTSC (National Television System Committee), and its usage is common in computer imaging.
Color Inversion
       Color inversion in digital image processing is done by inverting all color elements. For monochrome image, the dark pixel in the original image will be the bright pixel in the inversed image. The effect show horizontal mirroring in the histogram.
        The GST function is simple, the Intensity of the output Io=Imax-Ii, where Imax is the maximum Intensity value, and Ii is the input pixel's intensity. The maximum intensity value is 255 for 8bit monochrome or 24bit true color. For 24 bit true color, each RGB elements is operated independently.

Contrast Enhancement
         Contrast in an image is the difference between pixels values. Without contrast we can't see anything because everything will be white or black, or just gray. If an image has a low contrast, it means that different objects in the image have low luminosity difference, and it'll be difficult to separate them in our perception. Contrast enhancement will be helpful in increasing the visibility of an image. Figure below show two images with different contrast and their histogram.
       Contrast enhancement can be done using various gray scale transformation (GST) formulas. The following is one of contrast enhancement GST formula:

Po=G(Pi-C)+C

Which G is contrast gain, and C is the center for contrasting reference. At point C the pixel value is not modified, at above C point the pixels values is increased, and below C they're decreased.
 

No comments:

Post a Comment

New Feeds

Contact Form

Name

Email *

Message *