Abstract:
A method for controlling the contrast of an image is provided. The method comprising the steps of: providing display data of the frame, wherein the display data of the frame corresponds to a plurality of pixels; obtaining a gray-level value of at least one pixel according to the display data of the frame; calculating a probability function of at least one gray-level value in a predetermined range; and determining adjustment of the at least one gray-level value in the predetermined range according to the probability function.

Description:
BACKGROUND  
       [0001]     The invention relates to methods and devices for controlling image contrast, and in particular to methods and devices for dynamically adjusting image contrast.  
         [0002]     In display devices, image contrast can be adjusted to change the relative degree of image color. According to general contrast adjustment methods, each gray-level value GL of one image is transferred through a transfer curve, whose slope is 0 to 2, to a corresponding new gray-level value GL′. Based on a transfer curve whose slope is 1, a conventional transformation of the gray-level values has three conditions.  FIG. 1  shows a transfer curve whose slope is 1. As shown in  FIG. 1 , the transfer curve TC represents the relationship between gray-level values GL and corresponding new gray-level values GL′. According to the transfer curve TC of  FIG. 1 , each gray-level value GL is equal to the corresponding gray-level value GL′, that is, the contrast of the image is invariable, and the entire brightness thereof is also constant.  
         [0003]      FIG. 2  shows a transfer curve whose slope is larger than 1. Since the slope of the transfer curve TC is larger than 1, each gray-level value GL is increased to the corresponding gray-level value GL′. Thus, the contrast of the image is raised, and the entire brightness thereof increased. The image however is not displayed correctly due to excessively increased brightness.  FIG. 3  shows a transfer curve whose slope is smaller than 1. Since the slope of the transfer curve TC is smaller than 1, a gray-level value GL is decreased to the corresponding gray-level value GL′. Thus, the contrast of the image is lowered, and the overall brightness thereof is reduced. The image however is not displayed correctly due to excessively reduced brightness.  
         [0004]     According to conventional contrast adjustment methods, the histogram distribution of gray-level values of an image is not considered, and all gray-level values are transferred through a fixed transfer curve. Although the contrast of the image can be adjusted, the overall brightness thereof is changed undesirably. Thus, during continuous image display, brightness of the image is unstable, resulting in flicker.  
       SUMMARY  
       [0005]     Methods for controlling frame contrast are provided. An exemplary embodiment of a method comprises the steps of: providing display data of the frame, wherein the display data of the frame corresponds to a plurality of pixels; obtaining a gray-level value of at least one pixel according to the display data of the frame; calculating a probability function of at least one gray-level value in a predetermined range; and determining adjustment of the at least one gray-level value in the predetermined range according to the probability function.  
         [0006]     Devices for controlling the contrast of a frame are provided. An exemplary embodiment of a device comprises a calculation and analysis unit and an adjustment unit. The calculation and analysis unit receives display data of the frame. The display data of the frame corresponds to a plurality of pixels. The calculation and analysis unit calculates the number of pixels belonging to at least one gray-level value according to the display data of the frame and determines a predetermined range between first and second gray-level values. The adjustment unit is coupled to the calculation and analysis unit and calculates a probability function of the at least one gray-level value. The adjustment unit determines adjustment of the at least one gray-level value in the predetermined range according to the probability function in the predetermined range. 
     
    
     DESCRIPTION OF THE DRAWINGS  
       [0007]     Methods and devices for controlling the contrast of an image will become more fully understood from the detailed description given hereinbelow and the accompanying drawings, given by way of illustration only and thus not intended to be limitative of the invention.  
         [0008]      FIG. 1  shows a transfer curve with a slope equal to 1.  
         [0009]      FIG. 2  shows a transfer curve with a slope larger than 1.  
         [0010]      FIG. 3  shows a transfer curve with a slope smaller than 1.  
         [0011]      FIG. 4  shows an embodiment of a device for controlling the contrast of an image.  
         [0012]      FIG. 5  is a histogram of the number of pixels belonging to each gray-level value.  
         [0013]      FIG. 6  is a histogram of the number of pixels belonging to each gray-level value, calculated by logarithmic transformation.  
         [0014]      FIG. 7  shows an embodiment of a transfer curve.  
         [0015]      FIG. 8  is a follow chart of an embodiment of a method for controlling the contrast of an image. 
     
    
     DETAILED DESCRIPTION  
       [0016]     Devices for controlling the contrast of an image are provided. In some embodiments, as shown in  FIG. 4 , the device  4  is applied in a display device and comprises a calculation and analysis unit  40 , an adjustment unit  42 , and a storage unit  44 . The calculation and analysis unit  40  receives display data of a frame F n  of an image. The display data of a frame F n  corresponds to a predetermined number of pixels. According to the display data of the frame F n , the calculation and analysis unit  40  detects an original gray-level value of each pixel and calculates the number of pixels belonging to each original gray-level value. Referring to  FIG. 5 , the x-coordinate represents the original gray-level values (GL) “0” to “255”, the y-coordinate represents the number (N) of pixels belonging to each original gray-level value. According to  FIG. 5 , the distribution of the original gray-level values of the frame F n  can be determined.  
         [0017]     The calculation and analysis unit  40  determines gray-level values min and max, gray-level values min and avg, or gray-level values min, avg and max of the frame F n , according to the number of pixels belonging to each original gray-level value. Referring to  FIG. 5 , the gray-level value min is defined by the corresponding gray-level value that the accumulative number of pixels belonging to the original gray-level values “0” to “the corresponding gray-level value” is equal to 1 percent of the predetermined number. The gray-level value max is defined by the corresponding gray-level value that the accumulative number of pixels belonging to the original gray-level values “0” to “the corresponding gray-level value” is equal to 99 percent of the predetermined number. The gray-level value avg is an average of the original gray-level value corresponding to all pixels, as following equation:  
       a   =         Σ   ⁢   N     ×   GL     S         
        wherein, α represents the gray-level value avg, N represents the number of pixels belonging to each original gray-level value, GL represents each original gray-level value, and S represents the predetermined number.        
 
         [0019]     The adjustment unit  42  is coupled to the calculation and analysis unit  40 , receives the number of pixels belonging to each original gray-level value from the calculation and analysis unit  40  and implements a numerical transformation to the number of pixels belonging to each original gray-level value, such as log 2 N, as shown in  FIG. 6 . It is assumed that the calculation and analysis unit  40  determines gray-level values min and max. The adjustment unit  42  calculates the probability function of each original gray-level value and then calculates the probability function of each original gray-level value between the gray-level values min and max, according to the logarithm of the number of pixels. The adjustment unit  42  adjusts a transfer curve between the gray-level values min and max according to the probability function. Transfer curve of the original gray-level values, being lower than the gray-level value min and higher than the gray-level value max, has slope equal to 1. Further, the adjustment unit  42  adjusts the transfer curve between the gray-level values min and max according to the following equation: 
 
min+ pf 1( GL )×(max−min) 
        wherein, pf1(GL) represents the probability function of each original gray-level value between the gray-level values min and max.        
 
         [0021]     Accordingly, the adjustment unit  42  obtains a transfer curve TC n  of the frame F n , as shown in  FIG. 7 . In  FIG. 7 , the x-coordinate represents the original gray-level values GL of the frame F n , the y-coordinate represents the transferred gray-level values GL′. According to the transfer curve TC n , the original gray-level values between “0” and min and between max to “255” are both transferred through a transfer curve whose slopeis  1 . The original gray-level values between min and max are transferred through a transfer curve with a slope that is not a constant.  
         [0022]     It is assumed that the calculation and analysis unit  40  determines gray-level values min, avg, and max. The adjustment unit  42  calculates the probability function of each original gray-level value between the gray-level values min and avg, and between the gray-level values avg and max, according to the logarithm of the number of pixels. The adjustment unit  42  transfers the original gray-level values between “0” and min and between max and “255” through a transfer curve whose slopeis  1 . The adjustment unit  42  adjusts the transfer curve between the gray-level values min and avg according to the following equation: 
 
min+ pf 2( GL )×(avg−min) 
        wherein, pf2(GL) represents the probability function of each original gray-level value between the gray-level values min and avg.        
 
         [0024]     The adjustment unit  42  adjusts the transfer curve between the gray-level values avg and max according to the following equation: 
 
avg+ pf 3( GL )×(max−avg) 
        wherein, pf3(GL) represents the probability function of each original gray-level value between the gray-level values avg and max.        
 
         [0026]     Thus, the adjustment unit  42  obtains a transfer curve TC n  of the frame F n  according to the probability functions and thus transfers the original gray-level values GL.  
         [0027]     In some embodiments, the contrast of the former frame can be considered in order to decrease brightness difference between two continuous frames. Referring to  FIG. 4 , the storage unit  44  stores a transfer curve TC′ n−1  of a former frame F n−1 . After obtaining the transfer curve TC n  of the frame F n , the adjustment unit  42  calculates a transfer curve TC′ n  by weighting the transfer curves TC′ n−1  and TC n  with a constant proportion, as shown in following equation: 
 
 TC′   n   =P×TC   n +(1− P )× TC′   n−1 , 0≦P≦1 
 
         [0028]     The adjustment unit  42  transfers the original gray-level values GL to new gray-level values GL′ through the transfer curve TC′ n . The display device displays the frame F n  according to the transferred gray-level values GL′.  
         [0029]     An exemplary embodiment of a method for controlling the contrast of an image is shown in  FIG. 8 . The method is implemented for an image of a display device. Referring to  FIGS. 4 and 8 , display data of a frame F n  of an image is provided to a calculation and analysis unit  40  (step S 80 ), wherein the display data of the image F n  corresponds to a predetermined number of pixels. The calculation and analysis unit  40  detects an original gray-level value of each pixel and calculates the number of pixels belonging to each original gray-level value (step S 81 ). The calculation and analysis unit  40  determines gray-level values min and max, gray-level values min and avg, or gray-level values min, avg and max of the frame F n  according to the number of pixels belonging to each original gray-level value (step S 82 ). In this embodiment, the calculation and analysis unit  40  determines the gray-level values min and max.  
         [0030]     The adjustment unit  42  implements a numerical transformation of the number of pixels belonging to each original gray-level value (step S 83 ), such as log 2 N. The adjustment unit  42  calculates the probability function of each original gray-level value and then calculates the probability function of each original gray-level value between the gray-level values min and max, according to the logarithm of the number of pixels (step S 84 ). The adjustment unit  42  adjusts a transfer curve between the gray-level values min and max according to the probability function to obtain a transfer curve TC n  of the frame F n  (step S 85 ). After obtaining the transfer curve TC n  of the former frame F n , the adjustment unit  42  weights a transfer curve TC′ n−1  of a former frame F n−1  and the transfer curve TC n  of the frame F n  with a constant proportion to obtain a new transfer curve TC′ n  of the frame F n  (step  86 ). The adjustment unit  42  transfers the original gray-level values GL to new gray-level values GL′ through the transfer curve TC′ n  (step S 87 ). The display device displays the frame F n  according to the transferred gray-level values GL′.  
         [0031]     In some embodiments, methods for controlling the contrast of an image further comprise a storage unit  44  storing the transfer curve TC′ n  of the frame F n .  
         [0032]     In some embodiments of devices and methods for controlling the contrast of an image, the distribution of the gray-level values is analyzed first, and then the degree of adjustment of each gray-level value is determined. Thus, the contrast of the image can be increased dynamically, preventing continuous frames of the image from flicker.  
         [0033]     In some embodiments of devices and methods for controlling image contrast, the gray-level values min and max are determined without limitation according to system requirements. For example, when the accumulative number of pixels for the gray-level value min is equal to 0 percent of the predetermined number, the accumulative number of pixels for the gray-level value max is equal to 95 percent of the predetermined number. When the accumulative number of pixels for the gray-level value min is equal to 5 percent of the predetermined number, the accumulative number of pixels for the gray-level value max is equal to 100 percent of the predetermined number.  
         [0034]     In some embodiments of devices and methods for controlling image contrast, the number of pixels belonging to each original gray-level value may be calculated by logarithm with other base, such as log 3 N or ln(N). In some embodiments, the number of pixels belonging to each original gray-level value is calculated in numerical transformation by offset, such as log2N+S, wherein, S represents positive or negative offset. In some embodiments, the number of pixels belonging to each original gray-level value is calculated in numerical transformation with mth power, such as N m , wherein m is preferably a positive lower than 1. The numerical transformation of the number of pixels belonging to each original gray-level value is determined according to system requirements, without limitation.  
         [0035]     In some embodiments, the adjustment unit  42  can only calculate the probability function of each original gray-level value between the gray-level values min and max and omits calculation of the probability function of each original gray-level value.  
         [0036]     In some embodiments, the adjustment unit  42  can calculate the probability function of each original gray-level value between the gray-level values min and max directly according to the number of pixels. That is, the adjustment unit  42  omits to implement a numerical transformation of the number of pixels.  
         [0037]     In some embodiments, the calculation and analysis unit  40  can implement numerical transformation to the number of pixels first and then determine the gray-level values min and max, the gray-level values min and avg, or the gray-level values min, avg and max according to the transferred number of pixels. The gray-level value avg can be calculated by following equation:  
       a   =           Σlog   2     ⁡     (   N   )       ×   GL         log   2     ⁢   S           
        wherein, α represents the gray-level value avg, N represents the number of pixels belonging to each original gray-level value, GL represents each original gray-level value, and S represents the predetermined number.        
 
         [0039]     In some embodiments, the storage unit  44  further stores the transfer curve TC n . The adjustment unit  42  weights the transfer curve TC n  of the frame F n  and the transfer curve TC n+1  of the next frame F n+1  with a constant proportion to obtain a new transfer curve TC′ n+1  of a next frame F n+1 , as represented by following equation: 
 
 TC′   n+1   =Q×TC   n+1 +(1− Q )× TC   n , 0≦Q≦1 
 
         [0040]     Note that some embodiments of devices and methods for controlling image contrast can be applied in a single static image for enhancing the quality thereof.  
         [0041]     While the invention has been described in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. On the contrary, it is intended to cover various modifications and similar arrangements as would be apparent to those skilled in the art. Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.