Patent Publication Number: US-2009220151-A1

Title: Device for adjusting image color difference value and adjusting method thereof

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The invention relates in general to a device for adjusting image color difference value and an adjusting method thereof and more particularly to a device for adjusting image color difference value and an adjusting method thereof used for adjusting color difference value in different brightness (intensity) ranges. 
     2. Description of the Related Art 
     Image color is adjusted according to hue-saturation-intensity (HSI) in order to be in accordance with the general way of describing color. 
       FIG. 1A  illustrates conventional chromaticity space of an image before and after hue is adjusted. Please referring to  FIG. 1A , original chromaticity space H 1  is converted to chromaticity space H 2  by rotating with a hue rotating angle. However, the entire chromaticity space is adjusted by rotating the same hue rotating angle in this adjusting method. 
       FIG. 1B  illustrates conventional chromaticity space of an image before and after saturation is adjusted. Please referring to  FIG. 1B , original chromaticity space S 1  is converted to chromaticity space S 2  by multiplying a saturation gain. The same as the hue adjusting method, saturation of the entire chromaticity space is adjusted by multiplying a single saturation gain. Therefore, the saturation of the entire chromaticity space is adjusted in the same proportion. 
     As stated above, the conventional adjusting methods of hue and saturation only adjust the entire chromaticity space consistently. For those who need to adjust color precisely, such as artist, the conventional adjusting methods can not satisfy their need for color quality. 
     SUMMARY OF THE INVENTION 
     The invention is directed to a device for adjusting image color difference value and an adjusting method thereof. Hue and saturation are adjusted in different brightness ranges individually. Therefore, customized need for color adjustment function is produced. 
     According to the present invention, a three-dimensional color difference value adjusting method for adjusting a selected region of an image is provided. First, a plurality of color difference adjusting values corresponding to a plurality of reference brightness values are received. Next, target color difference adjusting value of each pixel corresponding to brightness value of each pixel within the selected region are estimated according to the color difference adjusting values. Then, color difference value of each pixel within the selected region is adjusted according to target color difference adjusting value of each pixel within the selected region. 
     According to the present invention, a three-dimensional color difference value adjusting device is provided for adjusting a selected region of an image. The device includes a computing unit and an adjusting unit. The computing unit is used for computing target color difference adjusting value of each pixel corresponding to the brightness value of each pixel within the selected region according to a plurality of received color difference adjusting values and a plurality of corresponding reference brightness values. The adjusting unit is coupled to the computing unit and used for adjusting color difference value of each pixel within the selected region according to the brightness value and the target color difference adjusting value determined by the computing unit. 
     According to the present invention, a three-dimensional color difference value adjusting method is provided for adjusting a selected region of an image. First, a whole brightness interval which encompasses all brightness values of all pixels of the selected region is determined. Next, the whole brightness interval is partitioned into a plurality of brightness subintervals, wherein the brightness values at two ends of each brightness subinterval respectively correspond to given color difference adjusting values. Then, target color difference adjusting value corresponding to brightness value of each pixel is estimated within the selected region according to the brightness subinterval in which the brightness value of each pixel within the selected region is positioned. Afterwards, color difference value of each pixel within the selected region is adjusted according to target color difference adjusting value of each pixel within the selected region. 
     The invention will become apparent from the following detailed description of the preferred but non-limiting embodiments. The following description is made with reference to the accompanying drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1A  (Prior Art) illustrates conventional chromaticity space of an image before and after hue is adjusted; 
         FIG. 1B  (Prior Art) illustrates conventional chromaticity space of an image before and after saturation is adjusted; 
         FIG. 2  is a functional block diagram of a device for adjusting image color difference value according to a preferred embodiment of the invention; 
         FIG. 3  shows a diagram of the relationship of brightness values and color difference adjusting values; 
         FIG. 4  shows the chromaticity space in  FIG. 1A  after hue angles are adjusted by the adjusting method of color difference value according to the preferred embodiment of the invention; 
         FIG. 5  shows the chromaticity space in  FIG. 1B  after saturation is adjusted by the adjusting method of color difference value according to the preferred embodiment of the invention; 
         FIG. 6  is a flow chart of the adjusting method of color difference value according to the preferred embodiment of the invention; and 
         FIG. 7  is a flow chart of another adjusting method of color difference value according to the preferred embodiment of the invention. 
     
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Please referring to  FIG. 2 , a functional block diagram of a device for adjusting image color difference value according to a preferred embodiment of the invention is shown. A device  100  is used for adjusting the image color difference value of a selected region of an image. Assuming the selected region includes m pixels, and the brightness values Y 1 -Y m  and the target color difference values P r1 -P rm  of the m pixels are defined. The device  100  includes a computing unit  110  and an adjusting unit  120 . The computing unit  110  is used for computing target color difference adjusting value corresponding to the brightness value of each pixel within the selected region according to a plurality of received color difference adjusting values and a plurality of corresponding reference brightness values. As shown in  FIG. 2 , the computing unit  110  receives n reference brightness values B 1 -B n  and corresponding color difference adjusting values P 1 -P n . The reference brightness values B 1 -B n  form n−1 brightness intervals (B 1 , B 2 ), (B 2 , B 3 ) . . . (B n−1 , B n ), and color difference adjusting values form n−1 color difference adjusting value intervals (P 1 , P 2 ), (P 2 , P 3 ) . . . (P n−1 , P n ). When the brightness value of one of the m pixels within the selected region is positioned in one of n−1 brightness intervals, the target color difference adjusting value of the pixel is positioned in the corresponding color difference adjusting value interval. 
     In the present embodiment, assuming in the same brightness interval, a first pixel and a second pixel respectively have different brightness values Y 1  and Y 2 , and different target color difference adjusting values Pr 1  and Pr 2 . Preferably, the brightness values and the target color difference adjusting values of the pixels within the selected region are set to be linearly related, thus the target color difference adjusting value corresponding to the brightness value of each pixel can be obtained by linear interpolation. 
     Referring to  FIG. 3 , a diagram shows the relationship of brightness values and color difference adjusting values. As shown in  FIG. 3 , brightness value Y 1  of the first pixel is assumed to be positioned in the brightness interval (B 1 , B 2 ). Because the color difference adjusting value interval (P 1 , P 2 ) corresponding to brightness interval (B 1 , B 2 ) is given, and the brightness value and the color difference adjusting value is linearly related, target color adjusting value Pr 1  of the first pixel can be computed by linear interpolation. 
     Likewise, brightness value Y 2  of the second pixel positioned in the brightness interval (B 2 , B 3 ) is given. Because corresponding color difference adjusting value interval (P 2 , P 3 ) is given, target color difference adjusting value Pr 2  of the second pixel can be computed by linear interpolation. 
     The adjusting unit  120  is coupled to the computing unit  110  and used for computing color difference adjusting value of each pixel within the selected region according to brightness value of each pixel within the selected region and target color difference adjusting value determined by the computing unit  110 . 
     For example, when the color difference adjusting value is a hue rotation angle, brightness value Y 1  of the first pixel is positioned between two brightness values B a  and B b , and target hue rotation angle θ r1  corresponding to brightness value Y 1  of the first pixel is positioned between two hue rotation angles θ a  and θ b , target hue rotation angle θ r1  can be computed by formula (1): 
     
       
         
           
             
               
                 
                   
                     
                       
                         θ 
                         b 
                       
                       - 
                       
                         θ 
                         a 
                       
                     
                     
                       
                         B 
                         b 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                   = 
                   
                     
                       
                         θ 
                         
                           r 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       - 
                       
                         θ 
                         a 
                       
                     
                     
                       
                         Y 
                         1 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
     Wherein θ a  and θ b  respectively correspond to brightness values B a  and B b . 
     Then, according to computed target hue rotation angle θ r1 , the adjusting unit  120  adjusts color difference value (C b1 , C r1 ) of the first pixel as: 
         C′   b1   =C   b1 ·sin θ r1   +C   r1 ·cos θ r1    
         C′   r1   =C   r1 ·sin θ r1   −C   b1 ·cos θ r1    (2) 
     Furthermore, when brightness value Y 2  of the second pixel is positioned between two brightness values B b  and B c , target hue rotation angle θ r2  corresponding to brightness value Y 2  of the second pixel is positioned between two hue rotation angles θ b  and θ c , target hue rotation angle θ r2  can be computed by formula (3): 
     
       
         
           
             
               
                 
                   
                     
                       
                         θ 
                         c 
                       
                       - 
                       
                         θ 
                         b 
                       
                     
                     
                       
                         B 
                         c 
                       
                       - 
                       
                         B 
                         b 
                       
                     
                   
                   = 
                   
                     
                       
                         θ 
                         
                           r 
                            
                           
                               
                           
                            
                           2 
                         
                       
                       - 
                       
                         θ 
                         b 
                       
                     
                     
                       
                         Y 
                         2 
                       
                       - 
                       
                         B 
                         b 
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
     Wherein θ b  and θ c  respectively correspond to brightness values B b  and B c , and the following expression is satisfied: 
     
       
         
           
             
               
                 
                   
                     
                       
                         θ 
                         c 
                       
                       - 
                       
                         θ 
                         b 
                       
                     
                     
                       
                         B 
                         c 
                       
                       - 
                       
                         B 
                         b 
                       
                     
                   
                   ≠ 
                   
                     
                       
                         θ 
                         b 
                       
                       - 
                       
                         θ 
                         a 
                       
                     
                     
                       
                         B 
                         b 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
     Then, according to computed target hue rotation angle θ r2 , the adjusting unit  120  adjusts color difference value (C b2 , C r2 ) corresponding to brightness value Y 2  as: 
         C′   b2   =C   b2  sin θ r2   +C   r2 ·cos θ r2    
         C′   r2   =C   r2  sin θ r2   −C   b2 ·cos θ r2    (5) 
     For example, assuming the brightness value ranges between 0 and 255. When brightness value B 1  is 64, hue rotation angle θ 1  is +5 degrees. When brightness value B 2  is 128, hue rotation angle θ 2  is +10 degrees. When brightness value B 3  is 192, hue rotation angle is +5 degrees. 
     Therefore, when brightness values B 1  and B 2  at two ends of the brightness interval to which brightness value Y 1  corresponds are 64 and 128 respectively, and corresponding hue rotation angles θ 1  and θ 2  are +5 degrees and +10 degrees respectively. Assuming Y 1  is equal to 80, target hue rotation angle θ r1  is computed by substituting the values into the formula (1): 
     
       
         
           
             
               
                 10 
                 - 
                 5 
               
               
                 128 
                 - 
                 64 
               
             
             = 
             
               
                 
                   θ 
                   
                     r 
                      
                     
                         
                     
                      
                     1 
                   
                 
                 - 
                 5 
               
               
                 80 
                 - 
                 64 
               
             
           
         
       
     
     The computed target hue rotation angle θ r1  is 6.25. Then, the computed hue rotation angle θ r1 , and original color difference value (C b1 , C r1 ) when the brightness value is equal to 80 are substituted into the formula (2) to obtain the adjusted color difference value (C′ b1 , C′ r1 ). Therefore, when brightness value of the first pixel ranges between brightness interval (64, 128), the adjusted color difference value (C′ b1 , C′ r1 ) of the first pixel is computed by the above steps. Similarly, when the brightness value of the second pixel ranges between brightness interval (128, 192), adjusted color difference value (C′ b2 , C′ r2 ) of the second pixel also can be computed by formula (3) and (5). 
       FIG. 4  shows the chromaticity space in  FIG. 1A  after hue angles are adjusted by the adjusting method of color difference value according to the preferred embodiment of the invention. When the brightness values are equal to 64, 128 and 192 respectively on Y-axis, the corresponding hue rotation angles θ 1 , θ 2  and θ 3  are +5, +10 and +5 degrees respectively. The corresponding hue rotation angles corresponding to the rest brightness values are computed by linear interpolation. Therefore, the adjusted chromaticity space H 3  is still smooth and continuous. 
     If color difference adjusting value is saturation gain value, and the brightness value Y 1  of the first pixel is between two brightness values B a  and B b , target saturation gain value g r1  corresponding to brightness value Y 1  of the first pixel is between two received saturation gain values g a  and g b . Target saturation gain value g r1  is computed by formula (6): 
     
       
         
           
             
               
                 
                   
                     
                       
                         g 
                         b 
                       
                       - 
                       
                         g 
                         a 
                       
                     
                     
                       
                         B 
                         b 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                   = 
                   
                     
                       
                         g 
                         
                           r 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       - 
                       
                         g 
                         a 
                       
                     
                     
                       
                         Y 
                         1 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
     Wherein g a  and g b  respectively correspond to brightness values B a  and B b . 
     Then, the adjusting unit  120  computes and outputs adjusted color difference value (C′ b1 , C′ r1 ) corresponding to brightness value Y 1  according to the computed target saturation gain value g r1  by: 
     
       
      
       C′ 
       b1 
       =C 
       b1 
       ·g 
       r1  
      
     
         C′   r1   =C   r1   ·t   r1    (7) 
     Besides, when target saturation gain value g r2  corresponding to the second pixel is between two received saturation gain values g b  and g c , target saturation gain value g r2  is computed by formula (8): 
     
       
         
           
             
               
                 
                   
                     
                       
                         g 
                         c 
                       
                       - 
                       
                         g 
                         b 
                       
                     
                     
                       
                         B 
                         c 
                       
                       - 
                       
                         B 
                         b 
                       
                     
                   
                   = 
                   
                     
                       
                         g 
                         
                           r 
                            
                           
                               
                           
                            
                           2 
                         
                       
                       - 
                       
                         g 
                         b 
                       
                     
                     
                       
                         Y 
                         2 
                       
                       - 
                       
                         B 
                         b 
                       
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
     Wherein g b  and g c  respectively correspond to brightness values B b  and B c , and the following expression is satisfied: 
     
       
         
           
             
               
                 
                   
                     
                       
                         g 
                         c 
                       
                       - 
                       
                         g 
                         b 
                       
                     
                     
                       
                         B 
                         c 
                       
                       - 
                       
                         B 
                         b 
                       
                     
                   
                   ≠ 
                   
                     
                       
                         g 
                         b 
                       
                       - 
                       
                         g 
                         a 
                       
                     
                     
                       
                         B 
                         b 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
     Then, the adjusting unit  120  computes and outputs adjusted color difference value (C′ b2 , C′ r2 ) corresponding to brightness value Y 2  according to the computed target saturation gain value g r2  by: 
     
       
      
       C′ 
       b2 
       =C 
       b2 
       ·g 
       r2  
      
     
         C′   r2   =C   r2   ·g   r2    (10) 
     For example, assuming brightness value ranges between 0 and 255. When brightness value B 1  is equal to 64, saturation gain value g 1  is 1.5. When brightness value B 2  is equal to 128, saturation gain value g 2  is 2.0. When brightness value B 3  is equal to 192, saturation gain value g 3  is 1.5. 
     Therefore, when the brightness values B a  and B b  at two ends of corresponding brightness interval are 64 and 128 respectively, the corresponding saturation gain values P a  and P b  are 1.5 and 2.0 respectively. When Y 1  is equal to 80, target saturation gain value g r1  is computed by formula (6): 
     
       
         
           
             
               
                 2.0 
                 - 
                 1.5 
               
               
                 128 
                 - 
                 64 
               
             
             = 
             
               
                 
                   g 
                   
                     r 
                      
                     
                         
                     
                      
                     1 
                   
                 
                 - 
                 1.5 
               
               
                 80 
                 - 
                 64 
               
             
           
         
       
     
     The computed target saturation gain value g r1  is 1.625. 
     Afterwards, the computed target saturation gain value g r1 , and the original color difference value (C b1 , C r1 ) when brightness value Y 1  is equal to 80 are substituted into the formula (7) to obtain adjusted color difference value (C′ b1 , C′ r1 ). Therefore, when brightness value ranges between brightness interval (64, 128), the corresponding adjusted color difference value is computed by the above steps. Similarly, when brightness value ranges between brightness interval (128, 192), the color difference value (C′ b2 , C′ r2 ) can be computed from original color difference value (C b2 , C r2 ) by formula (8) and (10). 
       FIG. 5  shows the chromaticity space in  FIG. 1B  after saturation is adjusted by the adjusting method of color difference value according to the preferred embodiment of the invention. When the brightness values are equal to 64, 128 and 192 respectively on Y-axis, the saturation gain values g 1 , g 2  and g 3  are 1.5, 2.0 and 1.5 respectively. Saturation gain values corresponding to the rest of brightness values are computed by linear interpolation. Therefore, the adjusted chromaticity space S 3  is still smooth and continuous. 
     According to the device  100 , the adjusting method of color difference value is shown as follow. Please referring to  FIG. 6 , a flow chart of the adjusting method of color difference value is illustrated. First, in step  601 , a plurality of color difference adjusting values P 1 -P n  corresponding to a plurality of reference brightness values B 1 -B n  are received. 
     Next, in a step  602 , target color difference adjusting value of each pixel corresponding to brightness value of each pixel within the selected region according to the color difference adjusting values P 1 -P n . When brightness value Y 1  of the first pixel is between B a  and B b , and target color difference adjusting value P r1  is between P a  and P b , brightness value Y 1  and target color difference adjusting value Pr 1  is linear related. Thus target color difference adjusting value Pr 1  can be computed by linear interpolation. When target color difference adjusting value Pr 1  is a target hue rotation angle θ r1 , P a  and P b  are θ a  and θ b  respectively, target hue rotation angle θ r1  can be computed by formula (1). When target color difference adjusting value Pr 1  is a target saturation gain value g r1 , P a  and P b  are g a  and g b  respectively, target saturation gain value g r1  can be computed by formula (6). Likewise, target hue rotation angle θ r2  and target saturation gain value g r2  can be computed by formula (3) and (8) respectively. 
     Then, in a step  603 , color difference value of each pixel within the selected region is adjusted according to target color difference adjusting value of each pixel within the selected region. When target color difference adjusting value Pr 1  is a target hue rotation angle θ r1 , (C′ b1 , C′ r1 ) can be computed by formula (2). When target color difference adjusting value Pr 1  is a target saturation gain value g r1 , (C′ b1 , C′ r1 ) can be computed by formula (7). Likewise, When target color difference adjusting value Pr 2  is a target hue rotation angle θ r2 , (C′ b2 , C′ r2 ) can be computed by formula (5). When target color difference adjusting value Pr 2  is a target saturation gain value g r2 , (C′ b2 , C′ r2 ) can be computed by formula (10). 
     Those who skilled in the art of the invention can understand the present invention is not limited herein. Referring to  FIG. 7 , a flow chart of another adjusting method of color difference value is illustrated. First, in a step  701 , a whole brightness interval which encompasses all brightness values of all pixels of the selected region is determined. For example, find out the minimum Y min  and maximum Y max  among the brightness values Y 1 -Y m  of the m pixels, and choose the brightness interval (Y min , Y max ) as the whole brightness interval of the selected region. 
     Next, in a step  702 , the whole brightness interval (Y min , Y max ) is partitioned into a plurality of brightness subintervals with even or uneven pitches, wherein the brightness values at two ends of each brightness subinterval respectively correspond to given color difference adjusting values. 
     Afterwards, in a step  703 , target color difference adjusting value Pr 1 -Pr m  corresponding to brightness value Y 1 -Y m  of the m pixels within the selected region according to the brightness subinterval in which the brightness value Y 1 -Y m  of the m pixels within the selected region is positioned. For example, assuming the brightness value and target color difference adjusting value of each pixel are linearly related, as a result of brightness values at two ends of each subinterval are given, target color difference adjusting values Pr 1 -Pr m  of m pixels are computed by linear interpolation. 
     For example, If target color difference adjusting value Pr of a pixel is a target hue rotation angle θ r , and target hue rotation angle θ r  of the pixel is between two hue rotation angles θ a  and θ b , target hue rotation angle θ r  is computed by formula (11): 
     
       
         
           
             
               
                 
                   
                     
                       
                         θ 
                         b 
                       
                       - 
                       
                         θ 
                         a 
                       
                     
                     
                       
                         B 
                         b 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                   = 
                   
                     
                       
                         θ 
                         r 
                       
                       - 
                       
                         θ 
                         a 
                       
                     
                     
                       Y 
                       - 
                       
                         B 
                         a 
                       
                     
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
     Wherein θ a  and θ b  correspond to brightness values B a  and B b  respectively. 
     For example, If target color difference adjusting value Pr of the pixel is a target saturation gain value g r , and target saturation gain value g r  of the pixel is between two saturation gain values g a  and g b , target saturation gain value g r  is computed by formula (12): 
     
       
         
           
             
               
                 
                   
                     
                       
                         g 
                         b 
                       
                       - 
                       
                         g 
                         a 
                       
                     
                     
                       
                         B 
                         b 
                       
                       - 
                       
                         B 
                         a 
                       
                     
                   
                   = 
                   
                     
                       
                         g 
                         r 
                       
                       - 
                       
                         g 
                         a 
                       
                     
                     
                       Y 
                       - 
                       
                         B 
                         a 
                       
                     
                   
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
     Wherein g a  and g b  correspond to brightness values B a  and B b  respectively. 
     Then, in a step  704 , color difference value of each pixel within the selected region is adjusted according to target color difference adjusting value Pr 1 -Pr m  of the m pixels within the selected region. 
     When target color difference adjusting value Pr of a pixel is a target hue rotation angle θ r , target color difference value (C b , C r ) of the pixel is adjusted as (C′ b , C′ r ) by formula (13): 
         C′   b   =C   b ·sin θ r   +C   r ·cos θ r    
         C′   r   =C   r·sin θ   r   −C   b ·cos θ r    (13) 
     When target color difference adjusting value Pr of the pixel is a target saturation gain value g r , color difference value (C b , C r ) of the pixel is adjusted as (C′ b , C′ r ) by formula (14): 
     
       
      
       C′ 
       b 
       =C 
       b 
       ·g 
       r  
      
     
         C′   r   =C   r   ·g   r    (14) 
     By the image color difference value adjusting device and the adjusting method thereof according to the preferred embodiment of the invention, hue or saturation can be adjusted respectively according to different brightness value ranges. When the hue rotation angle θ r  saturation gain value is computed according to different brightness value ranges by linear interpolation, the adjusted chromaticity space is still continuous and smooth. 
     While the invention has been described by way of example and in terms of a 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 and procedures, and the scope of the appended claims therefore should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements and procedures.