Method and apparatus for adjusting contrast of image

Information

  • Patent Application
  • 20070216972
  • Publication Number
    20070216972
  • Date Filed
    November 10, 2006
    18 years ago
  • Date Published
    September 20, 2007
    17 years ago
Abstract
An apparatus for processing an input image including M image units is provided. Each of the M image units respectively includes N pixels. Each of the pixels respectively has an original gray scale. The apparatus includes a converting module, a gain generating module, and a contrast enhancing module. The converting module is used for generating M luminances. Based on the original gray scales of the N pixels in the ith image unit among the M image units, the converting module generates the ith luminance among the M luminances. A maximum luminance and a minimum luminance are generated based on the M luminances. The gain generating module generates a contrast gain and a minimum gray scale based on the maximum luminance and the minimum luminance. Based on the contrast gain and the minimum gray scale, the contrast enhancing module adjusts the original gray scales of the pixels in the input image.
Description

BRIEF DESCRIPTION OF THE APPENDED DRAWINGS


FIG. 1 shows the block diagram of the image contrast stretching apparatus in prior arts.



FIG. 2 shows an example of a histogram.



FIG. 3 shows an example of an image before/after image contrast stretching.



FIG. 4 shows the block diagram of the image processing apparatus of the first preferred embodiment according to the invention.



FIG. 5 shows a plurality of possible embodiments of the converting module and the gain generating module.



FIG. 6 shows the flow chart of the image processing method of the second preferred embodiment according to the invention.



FIG. 7 shows the experimental result of the invention.


Claims
  • 1. An apparatus for processing an objective video frame in a video stream, the objective video frame comprising M image units, each of the M image units respectively comprising N original pixels, M and N being positive integers, each of the original pixels respectively having an original gray scale, said apparatus comprising: a converting module for generating M luminances, based on the original gray scales of the N original pixels in the ith image unit among the M image units, the converting module generating the ith luminance among the M luminances, i being an integer index ranging from 1 to M, the converting module generating a maximum luminance (Ymax) and a minimum luminance (Ymin) based on the M luminances;a gain generating module for generating a contrast gain (k) and a minimum input gray scale (Min) based on the maximum luminance (Ymax) and the minimum luminance (Ymin); anda contrast enhancing module, based on the contrast gain (k) and the minimum input gray scale (Min), the contrast enhancing module adjusting the original gray scales of the original pixels in the objective video frame to generate an output video frame.
  • 2. The apparatus of claim 1, wherein each of the original pixels in the objective video frame is selectively a red pixel, a green pixel, or a blue pixel.
  • 3. The apparatus of claim 2, wherein the N original pixels in the ith image unit comprise a red pixel, a green pixel, and a blue pixel; the red pixel has a first gray scale (Ri), the green pixel has a second gray scale (Gi), and the blue pixel has a third gray scale (Bi).
  • 4. The apparatus of claim 3, wherein the converting module generates the ith luminance (Yi) according the following equation: Yi=a*Ri+b*Gi+c*Bi,wherein a, b, c are gain coefficients.
  • 5. The apparatus of claim 4, wherein a is 0.299, b is 0.587, and c is 0.114.
  • 6. The apparatus of claim 1, wherein the converting module comprises: a converting unit for generating the ith luminance among the M luminances based on the original gray scales of the N original pixels in the ith image unit among the M image units; anda statistic unit for finding out the maximum luminance (Ymax) and the minimum luminance (Ymin) from the M luminances by statistics.
  • 7. The apparatus of claim 1, wherein the converting module comprises: a smoothing unit for performing a smoothing calculation on the original gray scales of the N original pixels in the ith image unit to generate N smoothed gray scales for the ith image unit;a converting unit for generating the ith luminance among the M luminances based on the N smoothed gray scales corresponding to the ith image unit; anda statistic unit for finding out the maximum luminance (Ymax) and the minimum luminance (Ymin) from the M luminances by statistics.
  • 8. The apparatus of claim 1, wherein the objective video frame is adjacent to P adjacent video frames in the video stream; P is a positive integer, and the gain generating module comprises: a generating unit for generating a preliminary gain and a preliminary minimum input gray scale based on the maximum luminance (Ymax) and the minimum luminance (Ymin); andan averaging unit for generating said contrast gain (k) by averaging the preliminary gain with P adjacent gains relative to the P adjacent video frames, and the averaging unit generating the minimum input gray scale (Min) by averaging the preliminary minimum input gray scale with P adjacent minimum gray scales relative to the P adjacent video frames.
  • 9. An apparatus for processing an input image comprising M image units, each of the M image units respectively comprising N original pixels, M and N being positive integers, each of the original pixels respectively having an original gray scale, said apparatus comprising: a converting module for generating M luminances, based on the original gray scales of the N original pixels in the ith image unit among the M image units, the converting module generating the ith luminance among the M luminances, i being an integer index ranging from 1 to M, the converting module generating a maximum luminance (Ymax) and a minimum luminance (Ymin) based on the M luminances;a gain generating module for generating a contrast gain (k) and a minimum input gray scale (Min) based on the maximum luminance (Ymax) and the minimum luminance (Ymin); anda contrast enhancing module, based on the contrast gain (k) and the minimum input gray scale (Min), the contrast enhancing module adjusting the original gray scales of the original pixels in the input image to generate an output image.
  • 10. A method for processing an objective video frame in a video stream, the objective video frame comprising M image units, each of the M image units respectively comprising N original pixels, M and N being positive integers, each of the original pixels respectively having an original gray scale, said method comprising the steps of: (a) generating M luminances, based on the original gray scales of the N original pixels in the ith image unit among the M image units, the ith luminance among the M luminances being generated, i being an integer index ranging from 1 to M;(b) generating a maximum luminance (Ymax) and a minimum luminance (Ymin) based on the M luminances;(c) generating a contrast gain (k) and a minimum input gray scale (Min) based on the maximum luminance (Ymax) and the minimum luminance (Ymin); and(d) based on the contrast gain (k) and the minimum input gray scale (Min), adjusting the original gray scales of the original pixels in the objective video frame to generate an output video frame.
  • 11. The method of claim 10, wherein each of the original pixels in the objective video frame is selectively a red pixel, a green pixel, or a blue pixel.
  • 12. The method of claim 11, wherein the N original pixels in the ith image unit comprises a red pixel, a green pixel, and a blue pixel; the red pixel has a first gray scale (Ri), the green pixel has a second gray scale (Gi), and the blue pixel has a third gray scale (Bi).
  • 13. The method of claim 12, wherein in step (a), the ith luminance (Yi) is generated according the following equation: Yi=a*Ri+b*Gi+c*Bi,
  • 14. The method of claim 13, wherein a is 0.299, b is 0.587, and c is 0.114.
  • 15. The method of claim 10, wherein step (a) comprises the sub-steps of: (a1) performing a smoothing calculation on the original gray scales of the N original pixels in the ith image unit to generate N smoothed gray scales; and(a2) generating the ith luminance for the ith image unit based on the N smoothed gray scales.
  • 16. The method of claim 10, wherein in step (b), the maximum luminance (Ymax) and the minimum luminance (Ymin) are found out from the M luminances by statistics.
  • 17. The method of claim 10, wherein the objective video frame is adjacent to P adjacent video frames in the video stream, P is a positive integer, and step (c) comprises the sub-steps of: (c1) generating a preliminary gain and a preliminary minimum input gray scale based on the maximum luminance (Ymax) and the minimum luminance (Ymin); and(c2) generating said contrast gain (k) by averaging the preliminary gain with P adjacent gains relative to the P adjacent video frames, and generating the minimum input gray scale (Min) by averaging the preliminary minimum input gray scale with P adjacent minimum gray scales relative to the P adjacent video frames.
  • 18. A method for processing an input image comprising M image units, each of the M image units respectively comprising N original pixels, M and N being positive integers, each of original pixels respectively having an original gray scale, said method comprising the steps of: (a) generating M luminances, based on the original gray scales of the N original pixels in the ith image unit among the M image units, the ith luminance among the M luminances being generated, i being an integer index ranging from 1 to M;(b) generating a maximum luminance (Ymax) and a minimum luminance (Ymin) based on the M luminances;(c) generating a contrast gain (k) and a minimum input gray scale (Min) based on the maximum luminance (Ymax) and the minimum luminance (Ymin); and(d) based on the contrast gain (k) and the minimum input gray scale (Min), adjusting the original gray scales of the original pixels in the input image to generate an output image.
Priority Claims (1)
Number Date Country Kind
095108875 Mar 2006 TW national