PATENT ABSTRACT
A method for color correction of a pair of colorful stereo microscope images is provided, which transmits the color information of the foreground areas and the background area of the reference image to the aberrated image separately for avoiding transmission error of the color information of the varied areas of the pair of the images, thus sufficiently improves the accuracy of the color correction, reduces the difference between the color of the reference image and the color of the aberrated image, and well prepares for the stereo matching of the pair of colorful stereo microscope images as well as for the three-dimensional reconstruction and three-dimensional measurement; on the other hand, during the correction, the correcting procedure is provided automatically without manual work.

PATENT DESCRIPTION
BACKGROUND OF THE PRESENT INVENTION 
       [0001]    1. Field of Invention 
         [0002]    The present invention relates to a technology for processing a microscope image, and more particularly to a method for color correction of a pair of colorful stereo microscope images. 
         [0003]    2. Description of Related Arts 
         [0004]    In an image acquisition procedure of a stereo microscope, since there are some differences between sensors of a left channel and a right channel of CMOS (Complementary Metal Oxide Semiconductor), a pair of colorful stereo microscope images acquired may have a great color difference. The color difference between the pair of colorful stereo microscope images will affect accuracy of stereo matching. If the color difference is obvious, disparity information of the pair of colorful stereo microscope images can not be obtained accurately, and without the accurate disparity information, a three-dimensional reconstruction can not be successfully completed, and then a three-dimensional measurement is directly affected. Therefore, in order to eliminate the color difference between the pair of colorful stereo microscope images, it is necessary to add intelligent image processing after machine imaging for correcting the color of aberrated images. 
         [0005]    A core of eliminating the color difference is how to transmit color information of a reference image to the aberrated images in such a manner that the colors of the two images basically agree with each other. 
         [0006]    At present, the method based on color transfer for correcting the colors is mainly based on globally linear color transfer, comprising steps of: transforming color space, wherein RGB color space with strong correlation is transformed into lαβ color space with weak correlation; correcting the colors of the aberrated images in the lαβ color space by utilizing variances of the reference image and the aberrated image, wherein color values of a 1 color channel, an α color channel and a β color channel of each pixel of the corrected image are denoted respectively as l″, α″ and β″, wherein 
         [0000]    
       
         
           
             
               
                 l 
                 ″ 
               
               = 
               
                 
                   
                     δ 
                     t 
                     
                       l 
                       ′ 
                     
                   
                   
                     δ 
                     s 
                     
                       l 
                       ′ 
                     
                   
                 
                  
                 
                   l 
                   * 
                 
               
             
             , 
             
               
 
             
              
             
               
                 α 
                 ″ 
               
               = 
               
                 
                   
                     δ 
                     t 
                     
                       α 
                       ′ 
                     
                   
                   
                     δ 
                     s 
                     
                       α 
                       ′ 
                     
                   
                 
                  
                 
                   α 
                   * 
                 
               
             
             , 
             
               
 
             
              
             
               
                 β 
                 ″ 
               
               = 
               
                 
                   
                     δ 
                     t 
                     
                       β 
                       ′ 
                     
                   
                   
                     δ 
                     s 
                     
                       β 
                       ′ 
                     
                   
                 
                  
                 
                   β 
                   * 
                 
               
             
             , 
           
         
       
     
         [0000]    wherein l*=l′−  l ′, α*=α′−  α ′ and β*=β′−  β ′, the color values of the l color channel, the α color channel and the β color channel of each pixel of the aberrated image are denoted respectively as l′, α′ and β′, average color values of the l color channel, the α color channel and the β color channel of each pixel of the aberrated image are denoted respectively as  l ′,  α ′ and  β ′, the variances of the color values of the l color channel, the α color channel and the β color channel of each pixel of the aberrated image are denoted respectively as δ t   l′ , δ t   α′  and δ t   β′ , the variances of the color values of the l color channel, the α color channel and the β color channel of each pixel of the reference image are denoted respectively as δ s   l′ , δ s   α′  and δ s   β′ . The method for color correction has two main problems that: on one hand, the method is based on globally linear color transfer for color correction, wherein it is not considered that an object area can be separated out from a background area, and the color information of the whole image is evenly transmitted, which may lead to a transmission error of the color information of the object area and the background area in such a manner that accuracy of color correction is decreased; on the other hand, the method is designed for the images and video sequences of natural scenes, and the microscope images are greatly different from the images of the natural scenes, wherein the microscope images need higher accuracy in processing, and the method for color correction can not adapt to a high accuracy requirement of the microscope images. 
       SUMMARY OF THE PRESENT INVENTION 
       [0007]    An object of the present invention is to provide a method for color correction of a colorful stereo microscope image, wherein accuracy of color correction is high enough for correcting colors of the microscope image. 
         [0008]    Accordingly, in order to accomplish the above objects, the present invention provides the method for color correction of a pair of colorful stereo microscope images comprising steps of: 
         [0009]    a) taking a first image of a pair of the colorful stereo microscope images in the RGB color space as a reference image I ref , and taking a second image of the pair of the colorful stereo microscope images in the RGB color space as an uncorrected image I sou ; 
         [0010]    b) obtaining a first saliency map of the reference image I ref  and a second saliency map of the uncorrected image I sou , wherein the first saliency map is marked as SaliencyMap ref  and the second saliency map is marked as SaliencyMap sou ; obtaining a first segmentation map of the reference image I ref  and a second segmentation map of the uncorrected image I sou  with the first saliency map of the reference image I ref  and the second saliency map of the uncorrected image I sou  respectively, wherein the first segmentation map is marked as BMap ref  and the second segmentation map is marked as BMap sou , wherein the BMap ref  and the BMap sou  all comprise a plurality of foreground areas, the i′th foreground area of the BMap ref  is marked as BMap i′   ref ′, and the i′th foreground area of the BMap sou  is marked as BMap i′   sou ′, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap ref  or the BMap sou ; 
         [0011]    c) calculating histograms, normalized histograms and cumulative histograms of a luminance component Y, a first chroma component Cb and a second chroma component Cr for each the foreground area of the BMap ref  in the YCbCr color space, and calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr for each the foreground area of the BMap sou  in the YCbCr color space; 
         [0012]    d) calculating color histograms for each the foreground area of the BMap ref  and the BMap sou  in the RGB color space; 
         [0013]    e) for each the foreground area of the BMap ref , calculating a similarity value of the color histogram of the foreground area of the BMap ref  and the color histogram of the corresponding foreground area of the BMap sou , and judging whether the foreground area of the BMap ref  is marching with the corresponding foreground area of the BMap sou  or not from the similarity value of the color histograms of the two marching foreground areas; 
         [0014]    f) for each pair of the foreground area of the BMap ref  and the marched foreground area of the BMap sou , calculating transfer functions with respect to a luminance component Y, a first chroma component Cb and a second chroma component Cr of the pair, and correcting the luminance component Y, the first chroma component Cb and the second chroma component Cr of the area of the uncorrected image I sou  corresponding to the marched foreground area of the BMap sou  according to the transfer functions with respect to the luminance component, the first chroma component and the second chroma component of the foreground area of the BMap ref  and the marched foreground area of the BMap sou ; 
         [0015]    g) calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap ref  in the YCbCr color space, and calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap sou  in the YCbCr color space; 
         [0016]    h) calculating transfer functions with respect to the luminance component, the first chroma component and the second chroma component of the background area of the BMap ref  and the background area of the BMap sou , and correcting the luminance component Y, the first chroma component Cb and the second chroma component Cr of the area of the uncorrected image I sou  corresponding to the background area of the BMap sou  according to the transfer functions with respect to the luminance component, the first chroma component and the second chroma component of the background areas of the BMap ref  and the BMap sou ; and 
         [0017]    i) combining the luminance component, the first chroma component and the second chroma component of each corrected area of the uncorrected image for obtaining an corrected image. 
         [0018]    For obtaining the first saliency map of the reference image I ref  and the second saliency map of the uncorrected image I sou , the step b) specifically comprises steps of: 
         [0019]    b-a1) respectively re-quantifying color values of a R, a G and a B channel of the reference image I ref  into M levels for obtaining an initial quantified image corresponding to the reference image I ref , wherein the initial quantified image has M 3  kinds of color; 
         [0020]    b-a2) calculating an occurrence probability of each the color of the initial quantified image for obtaining the color histogram thereof, marking the occurrence probability of the ith color C i  as P i , wherein, 1≦i≦M 3 ; 
         [0021]    b-a3) replacing the color whose the occurrence probability is lower than a constant threshold T with the next color in the color histogram of the initial quantified image for obtaining a final quantified image corresponding to the reference image I ref , wherein the final quantified image has L kinds of color, wherein for the ith color C i  in the initial quantified image, judging whether P i &lt;T or not, if yes, replacing the ith color C i  in the initial quantified image with the i+1th color C i+1  or the i−1th color C i− 1 next to the C i  in the color histogram, if no, keeping the ith color C i  in the initial quantified image, wherein L≦M 3 ; 
         [0022]    b-a4) calculating a saliency value of each the color of the final quantified image for obtaining the first saliency map of the reference image I ref , marking the first saliency map as SaliencyMap ref , the values of which are the saliency value, and marking the saliency value of the kth color C k ′ of the final quantified image as Sal(C k ′), 
         [0000]    
       
         
           
             
               
                 Sal 
                  
                 
                   ( 
                   
                     C 
                     k 
                     ′ 
                   
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       C 
                       j 
                       ′ 
                     
                     ∈ 
                     
                       I 
                       q 
                     
                   
                 
                  
                 
                   
                     f 
                      
                     
                       ( 
                       
                         C 
                         j 
                         ′ 
                       
                       ) 
                     
                   
                   × 
                   
                     D 
                      
                     
                       ( 
                       
                         
                           C 
                           k 
                           ′ 
                         
                         , 
                         
                           C 
                           j 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein 1≦k≦L, 1≦j≦L, C j ′ is the jth color of the final quantified image, I q  is all the colors of the final quantified image, f(C j ′) is the occurrence probability of the C j ′ in the final quantified image, D(C k ′,C j ′) is a distance between the C k ′ and the C j ′ in the lαβ color space after the C k ′ and the C j ′ are transformed to the lαβ color space; and
       b-a5) obtaining the SaliencyMap sou  of the uncorrected image I sou  by the same method as recited in the step b-a1) to the step b-a4) for obtaining the SaliencyMap ref  of the reference image I ref ;       
 
         [0024]    wherein in the step b-a1), M=12, the constant threshold T in the step b-a3) is 0.05 times of the number of the pixels of the reference image I ref  or the uncorrected image I sou . 
         [0025]    For obtaining the first segmentation map of the reference image I ref  and the second segmentation map of the uncorrected image I sou , the step b) specifically comprises steps of: 
         [0026]    b-c1) defining a constant threshold T f , and thresholding the SaliencyMap ref  of the reference image I ref  by utilizing the constant threshold T f  for obtaining a binary image thereof, wherein the binary image is marked as B ref , wherein T f ε[0,255], and the value 255 of the B ref  marks the foreground area, and the value 0 of the B ref  marks the background area; 
         [0027]    b-c2) obtaining a plurality of initial foreground areas and initial background areas of the reference image I ref  by utilizing a pixel value of each the pixel in the B ref , wherein each the pixel in the initial foreground areas of the reference image I ref  is corresponding to the pixel with the pixel value of 255 in the B ref , each the pixel in the initial background areas of the reference image I ref  is corresponding to the pixel with the pixel value of 0 in the B ref ; 
         [0028]    b-c3) taking the ith initial foreground area of the I ref  under treating as a present foreground area Trimap i , wherein, 1≦i≦I, I is the number of the initial foreground areas of the reference image I ref ; 
         [0029]    b-c4) denoting an area of B ref  corresponding to the Trimap i  as B i   ref , marking a min X axis position, a max X axis position, a min Y axis position and a max Y axis position of the pixels in the area B i   ref  as miX i , maX i , miY i  and maY i ; 
         [0030]    b-c5) enlarging the B i   ref  to a rectangle area, marking the rectangle area as B i   ref ′, and marking the min X axis position, the max X axis position, the min Y axis position and the max Y axis position of the pixels in the B i   ref ′ as miX i ′, maX i ′, miY i ′, and maY i ′, wherein 
         [0000]    
       
         
           
             
               miX 
               i 
               ′ 
             
             = 
             
               { 
               
                 
                   
                     
                       
                         
                           
                             
                               miX 
                               i 
                             
                             - 
                             
                               0.5 
                               × 
                               
                                 ( 
                                 
                                   
                                     maX 
                                     i 
                                   
                                   - 
                                   
                                     miX 
                                     i 
                                   
                                 
                                 ) 
                               
                             
                           
                           , 
                         
                       
                       
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 miX 
                                 i 
                               
                             
                             - 
                             
                               0.5 
                               × 
                               
                                 ( 
                                 
                                   
                                     maX 
                                     i 
                                   
                                   - 
                                   
                                     miX 
                                     i 
                                   
                                 
                                 ) 
                               
                             
                           
                           ≥ 
                           0 
                         
                       
                     
                     
                       
                         
                           0 
                           , 
                         
                       
                       
                         
                           
                             
                               
                                 if 
                                  
                                 
                                     
                                 
                                  
                                 
                                   miX 
                                   i 
                                 
                               
                               - 
                               
                                 0.5 
                                 × 
                                 
                                   ( 
                                   
                                     
                                       maX 
                                       i 
                                     
                                     - 
                                     
                                       miX 
                                       i 
                                     
                                   
                                   ) 
                                 
                               
                             
                             &lt; 
                             0 
                           
                           , 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     maX 
                     i 
                     ′ 
                   
                 
                 = 
                 
                   { 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   maX 
                                   i 
                                 
                                 + 
                                 
                                   0.5 
                                   × 
                                   
                                     ( 
                                     
                                       
                                         maX 
                                         i 
                                       
                                       - 
                                       
                                         miX 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   
                                     maX 
                                     i 
                                   
                                 
                                 + 
                                 
                                   0.5 
                                   × 
                                   
                                     ( 
                                     
                                       
                                         maX 
                                         i 
                                       
                                       - 
                                       
                                         miX 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               &lt; 
                               W 
                             
                           
                         
                         
                           
                             
                               
                                 W 
                                 - 
                                 1 
                               
                               , 
                             
                           
                           
                             
                               
                                 
                                   
                                     if 
                                      
                                     
                                         
                                     
                                      
                                     
                                       maX 
                                       i 
                                     
                                   
                                   + 
                                   
                                     0.5 
                                     × 
                                     
                                       ( 
                                       
                                         
                                           maX 
                                           i 
                                         
                                         - 
                                         
                                           miX 
                                           i 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                                 ≥ 
                                 W 
                               
                               , 
                             
                           
                         
                       
                        
                       
                         
 
                       
                        
                       
                         miY 
                         i 
                         ′ 
                       
                     
                     = 
                     
                       { 
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       miY 
                                       i 
                                     
                                     - 
                                     
                                       0.5 
                                       × 
                                       
                                         ( 
                                         
                                           
                                             maY 
                                             i 
                                           
                                           - 
                                           
                                             miY 
                                             i 
                                           
                                         
                                         ) 
                                       
                                     
                                   
                                   , 
                                 
                               
                               
                                 
                                   
                                     
                                       if 
                                        
                                       
                                           
                                       
                                        
                                       
                                         miY 
                                         i 
                                       
                                     
                                     - 
                                     
                                       0.5 
                                       × 
                                       
                                         ( 
                                         
                                           
                                             maY 
                                             i 
                                           
                                           - 
                                           
                                             miY 
                                             i 
                                           
                                         
                                         ) 
                                       
                                     
                                   
                                   ≥ 
                                   0 
                                 
                               
                             
                             
                               
                                 
                                   0 
                                   , 
                                 
                               
                               
                                 
                                   
                                     
                                       
                                         if 
                                          
                                         
                                             
                                         
                                          
                                         
                                           miY 
                                           i 
                                         
                                       
                                       - 
                                       
                                         0.5 
                                         × 
                                         
                                           ( 
                                           
                                             
                                               maY 
                                               i 
                                             
                                             - 
                                             
                                               miY 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     &lt; 
                                     0 
                                   
                                   , 
                                 
                               
                             
                           
                            
                           
                             
 
                           
                            
                           
                             maY 
                             i 
                             ′ 
                           
                         
                         = 
                         
                           { 
                           
                             
                               
                                 
                                   
                                     
                                       maY 
                                       i 
                                     
                                     + 
                                     
                                       0.5 
                                       × 
                                       
                                         ( 
                                         
                                           
                                             maY 
                                             i 
                                           
                                           - 
                                           
                                             miY 
                                             i 
                                           
                                         
                                         ) 
                                       
                                     
                                   
                                   , 
                                 
                               
                               
                                 
                                   
                                     
                                       if 
                                        
                                       
                                           
                                       
                                        
                                       
                                         maY 
                                         i 
                                       
                                     
                                     + 
                                     
                                       0.5 
                                       × 
                                       
                                         ( 
                                         
                                           
                                             maY 
                                             i 
                                           
                                           - 
                                           
                                             miY 
                                             i 
                                           
                                         
                                         ) 
                                       
                                     
                                   
                                   &lt; 
                                   H 
                                 
                               
                             
                             
                               
                                 
                                   
                                     H 
                                     - 
                                     1 
                                   
                                   , 
                                 
                               
                               
                                 
                                   
                                     
                                       
                                         if 
                                          
                                         
                                             
                                         
                                          
                                         
                                           maY 
                                           i 
                                         
                                       
                                       + 
                                       
                                         0.5 
                                         × 
                                         
                                           ( 
                                           
                                             
                                               maY 
                                               i 
                                             
                                             - 
                                             
                                               miY 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     ≥ 
                                     H 
                                   
                                   , 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    wherein the W is a width of the B ref , the H is a height of the B ref ; 
         [0031]    b-c6) enlarging the present foreground area Trimap i  to the rectangle area with the same position as the B i   ref ′, wherein the area is marked as Trimap i ′; for each the pixel in the Trimap i ′, judging whether the pixel in the Trimap i ′ belongs to the foreground area or the background area according to the pixel value of the corresponding pixel in the B i   ref ′, wherein for the pixel having the position of (x,y) in the Trimap i ′, judging whether the pixel value of the pixel having the position of (x,y) in the B i   ref ′ is 255 or not, if yes, the pixel having the position of (x,y) in the Trimap i ′ belongs to the foreground area, if no, the pixel having the position of (x,y) in the Trimap i ′ belongs to the background area, wherein, 0≦x≦W i , 0≦y≦H i , the W i  is a width of the B i   ref ′ and the Trimap i ′, W i =maX i ′−miX i ′, the H i  is a height of the B i   ref ′ and the Trimap i ′, H i =maY i ′−miY i ′; 
         [0032]    b-c7) letting miX i =miX i ′, maX i =maX i ′, miY z =miY i ′ and maY z =maY i ′, and taking the B i   ref ′ as the new untreated rectangle area B i   ref , taking the Trimap i ′ as the new present foreground area Trimap i , repeating the step b-c5) to the step b-c7) again and circularly, judging whether the number of the pixels in the foreground area of the Trimap i ′ after repeating K times is equal to the number of the pixels in the foreground of the Trimap i ′ after repeating K−1 times, if yes, segmenting the Trimap i ′ with a GrabCut method for obtaining a final foreground area and a final background area of the Trimap i ′, if no, repeating the step b-c5) to the step b-c7) again, wherein the “=” is an assignment symbol, an initial value of the K is 1; 
         [0033]    b-c8) letting i=i+1, wherein the “=” is the assignment symbol, taking the next untreated initial foreground area of the reference image I ref  as the present foreground area Trimap i , repeating the step b-c4) to the step b-c8) again and circularly until all the initial foreground areas of the reference image I ref  are treated for obtaining the first segmentation map BMap ref  of the reference image I ref , marking the i′th foreground area of the BMap ref  as BMap i′   ref ′, 1≦i′≦I′, wherein the I′ is the number of the foreground areas of the BMap ref ; and 
         [0034]    b-c9) obtaining the BMap sou  of the uncorrected image I sou  by the same method as recited in the step b-c1) to the step b-c8) for obtaining the BMap ref  of the reference image I ref , marking the i′th foreground area of the BMap sou  as BMap i′   sou ′, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap sou . 
         [0035]    Wherein when obtaining the first segmentation map BMap ref  of the reference image I ref , the constant threshold T f  in the step b-c1) is 2 times of the average pixel value of all the pixels of the SaliencyMap ref  of the reference image I ref , when obtaining the second segmentation map BMap sou  of the uncorrected image I sou , the constant threshold T f  in the step corresponding to step b-c1) is 2 times of the average pixel value of all the pixels of the SaliencyMap sou  of the uncorrected image I sou ; in the step b-c7), K=4. 
         [0036]    The step c) specifically comprises steps of: 
         [0037]    c-1) taking the i′th foreground area BMap i′   ref ′ under treating of the BMap ref  as the present foreground area, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap ref ; 
         [0038]    c-2) calculating the histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the BMap i   ref ′: denoting the histogram of the luminance component Y of the BMap i′   ref ′ as H i′   Y     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Y 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                       BMap 
                       
                         i 
                         ′ 
                       
                       
                         ref 
                         ′ 
                       
                     
                   
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         Y 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Y(x′,y′) is the value of the luminance component of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     Y 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         Y 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         ≠ 
                         
                           Y 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    denoting the histogram of the first chroma component Cb of the BMap i′   ref ′ as H i′   cb     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Cb 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                       BMap 
                       
                         i 
                         ′ 
                       
                       
                         ref 
                         ′ 
                       
                     
                   
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         Cb 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cb(x′,y′) is the value of the first chroma component of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     Cb 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         Cb 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         ≠ 
                         
                           Cb 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    denoting the histogram of the second chroma component Cr of the BMap i′   ref ′ as H i′   Cr     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Cr 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                       BMap 
                       
                         i 
                         ′ 
                       
                       
                         ref 
                         ′ 
                       
                     
                   
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         Cr 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cb(x′,y′) is the value of the second chroma component of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     Cr 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         Cr 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         ≠ 
                         
                           Cr 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    wherein uε[0,255]; 
         [0039]    c-3) calculating the normalized histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the BMap i′   ref ′: denoting the normalized histogram of the luminance component Y of the BMap i′   ref ′ as H i′   Y     —     Norm     —     ref (u), H i′   Y     —     Norm     —     ref (u)=H i′   Y     —     ref (u)/PixelCount i′ , denoting the normalized histogram of the first chroma component Cb of the BMap i′   ref ′ as H i′   Cb     —     Norm     —     ref (u), H i′   Cb     —     Norm     —hu ref   (u)=H i′   Cb     —     ref (u)/PixelCount i′ , denoting the normalized histogram of the second chroma component Cr of the BMap i′   ref ′ as H i′   Cr     —     Norm     —     ref (u), H i′   Cr     —     Norm     —     ref (u)=H i′   Cr     —     ref (u)/PixelCount i′ , wherein uε[0,255], and the PixelCount i′  is the number of the pixels in the present foreground area BMap i′   ref ′; 
         [0040]    c-4) calculating the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the BMap i′   ref ′: denoting the cumulative histogram of the luminance component Y of the BMap i′   ref ′ as H i′   Y     —     Cum     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Y 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     Cum 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       i 
                       ′ 
                     
                     
                       Y 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       Norm 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       ref 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the first chroma component Cb of the BMap i′   ref ′ as H i′   Cb     —     Cum     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Cb 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     Cum 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       i 
                       ′ 
                     
                     
                       Cb 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       Norm 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       ref 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the second chroma component Cr of the BMap i′   ref ′ as H i′   Cr     —     Cum     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Cr 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     Cum 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       i 
                       ′ 
                     
                     
                       Cr 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       Norm 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       ref 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein uε[0,255]; 
         [0041]    c-5) letting i′=i′+1, taking the next untreated foreground area of the BMap ref  as the present foreground area, repeating the step c-2) to the step c-5) again and circularly until all the foreground areas of the BMap ref  are treated, wherein the “=” is the assignment symbol; and 
         [0042]    c-6) calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of each the foreground area of the BMap sou  by the same method as recited in the step c-1) to the step c-5). 
         [0043]    The step d) specifically comprises steps of: 
         [0044]    d-a1) taking the i′th foreground area BMap i′   ref ′ under treating of the BMap ref  as the present foreground area, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap ref ; 
         [0045]    d-a2) calculating the color histogram of the present foreground area BMap i′   ref ′: denoting the color histogram as H i′   RGB     —     ref (c), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     RGB 
                      
                     
                         
                     
                      
                     _ 
                      
                     
                         
                     
                      
                     ref 
                   
                 
                  
                 
                   ( 
                   c 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                       BMap 
                       
                         i 
                         ′ 
                       
                       
                         ref 
                         ′ 
                       
                     
                   
                 
                  
                 
                   
                     δ 
                      
                     
                       [ 
                       
                         c 
                         , 
                         
                           C 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                   / 
                   
                     PixelCount 
                     
                       i 
                       ′ 
                     
                     
                       RGB 
                        
                       
                           
                       
                        
                       _ 
                        
                       
                           
                       
                        
                       ref 
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein C=256×R+16×G+B, the R is the value of a red component of the pixel in the BMap i′   ref ′, the G is the value of a green component of the pixel in the BMap i′   ref ′, the B is the value of a blue component of the pixel in the BMap i′   ref ′, wherein C(x′,y′) is the value of the C of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   c 
                   , 
                   
                     C 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         c 
                       
                       = 
                       
                         C 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           c 
                         
                         ≠ 
                         
                           C 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    PixelCount i′   RGB     —     ref  is the number of the pixels in the present foreground area BMap i′   ref ′; 
         [0046]    d-a3) letting i′=i′+1, taking the next untreated foreground area of the BMap ref  as the present foreground area, repeating the step d-a2) to the step d-a3) again and circularly until all the foreground areas of the BMap ref  are treated, wherein the “=” is the assignment symbol; and 
         [0047]    d-a4) calculating the color histogram H i′   RGB     —     sou (c) of each the foreground area of the BMap sou  by the same method as recited in the step d-a1) to the step d-a3). 
         [0048]    The step e) specifically comprises steps of: 
         [0049]    e-1) taking the pth foreground area BMap p   ref ′ under treating of the BMap ref  as the first present foreground area, taking the qth foreground area BMap q   sou ′ under treating of the BMap sou  as the second present foreground area, wherein, 1≦p≦P, 1≦q≦Q, the P is the number of the foreground areas of the BMap ref , the Q is the number of the foreground areas of the BMap sou ; 
         [0050]    e-2) calculating the similarity value of the color histogram H p   RGB     —     ref (c) of the first foreground area BMap p   ref ′ and the color histogram H q   RGB     —     sou (c) of the second foreground area BMap q   sou ′, marking the similarity value as Sim(H p   RGB     —     ref , H q   RGB     —     sou ), 0≦Sim(H p   RGB     —     ref , H q   RGB     —     sou )≦1, wherein the larger the value of Sim(H p   RGB     —     ref , H q   RGB     —     sou ) is, the more similar the two color histograms are, and the value 1 of Sim(H P   RGB     —     ref , H q   RGB     —     sou ) means that the two color histograms are same with each other; 
         [0051]    e-3) judging whether Sim(H p   RGB     —     ref , H q   RGB     —     sou ) is larger than a threshold T s  or not, if yes, the first foreground area BMap p   ref ′ is marching with the second foreground area BMap q   sou ′, if no, the first foreground area BMap p   ref ′ is not marching with the second foreground area BMap q   sou ′; and 
         [0052]    e-4) letting p=p+1, q=q+1, wherein the “=” is the assignment symbol, taking the next untreated foreground area of the BMap ref  as the first present foreground area, taking the next untreated foreground area of the BMap sou  as the second present foreground area, repeating the step e-2) to the step e-4) again and circularly until all the foreground areas of the BMap ref  or the foreground areas of the BMap sou  are treated. 
         [0053]    The step f) specifically comprises steps of: 
         [0054]    f-1) taking the matched foreground areas under treating of the BMap ref  and the BMap sou  respectively as the first present foreground area and the second present foreground area, supposing that the first present foreground area is the p′th matched foreground area BMap p   ref ′ under treating of the BMap ref , supposing that the second present foreground area is the q′th matched foreground area BMap q′   sou ′ under treating of the BMap sou , wherein, 1≦p′≦S, 1≦q′≦S, the S is the number of the pairs of the matched foreground areas of the BMap ref  and the BMap sou ; 
         [0055]    f-2) judging whether the values u′ and u′+1 of the luminance component Y of the first present foreground area BMap p   ref ′ and the value v′ of the luminance component Y of the second present foreground area BMap q′   sou ′ satisfy a following inequality: H p′   Y     —     Cum     —     ref (u′)≦H q′   Y     —     Cum     —     sou (v′)&lt;H p′   Y     —     Cum     —     ref (u′+1) if yes, the value u′ of the luminance component Y of the first present foreground area BMap p   ref ′ is marching with the value v′ of the luminance component Y of the second present foreground area BMap q′   sou ′, calculating a color transfer function of the value v′ of the luminance component Y of the second present foreground area BMap q′   sou ′, marking the color transfer function as M q′   Y (v′), wherein M q′   Y (v′)=u′ and then providing a step f-4), if no, providing a step f-3), wherein H p′   Y     —     Cum     —     ref  is the cumulative histogram of the luminance component Y of the first present foreground area BMap p   ref ′, H q′   Y     —     Cum     —     sou  is the cumulative histogram of the luminance component Y of the second present foreground area BMap q′   sou ′; 
         [0056]    f-3) letting u′=u′+1, repeating the step f-2) for judging the value of the luminance component Y of the first present foreground area BMap p   ref ′ by the inequality, wherein the “=” is the assignment symbol; 
         [0057]    f-4) judging whether the values u′ and u′+1 of the first chroma component Cb of the first present foreground area BMap p   ref ′ and the value v′ of the first chroma component Cb of the second present foreground area BMap q′   sou ′ satisfy the following inequality: H p′   Cb     —     Cum     —     ref (u′)≦H q′   Cb     —     Cum     —     sou (v′)&lt;H p′   Cb     —     Cum     —     ref (u′+1), if yes, the value u′ of the first chroma component Cb of the first present foreground area BMap p′   ref ′ is marching with the value v′ of the first chroma component Cb of the second present foreground area BMap q   sou ′, calculating the color transfer function of the value v′ of the first chroma component Cb of the second present foreground area BMap q   sou ′, marking the color transfer function as M q′   Cb (v′), wherein M q′   Cb (v′)=u′, and then providing a step f-6), if no, providing a step f-5), wherein H p′   Cb     —     Cum     —     ref  is the cumulative histogram of the first chroma component Cb of the first present foreground area BMap p′   ref ′, H q′   Cb     —     Cum     —     sou  is the cumulative histogram of the first chroma component Cb of the second present foreground area BMap q′   sou ′; 
         [0058]    f-5) letting u′=u′+1, repeating the step f-4) for judging the value of the first chroma component Cb of the first present foreground area BMap p   ref ′ by the inequality, wherein the “=” is the assignment symbol; 
         [0059]    f-6) judging whether the values u′ and u′+1 of the second chroma component Cr of the first present foreground area BMap p′   ref ′ and the value v′ of the second chroma component Cr of the second present foreground area BMap q   sou ′ satisfy the following inequality: H p′   Cr     —     Cum     —     ref (u′)≦H q′   Cr     —     Cum     —     sou (v′)&lt;H p′   Cr     —     Cum     —     ref (u′+1), if yes, the value u′ of the second chroma component Cr of the first present foreground area BMap p′   ref ′ is marching with the value v′ of the second chroma component Cr of the second present foreground area BMap q   sou ′, calculating the color transfer function of the value v′ of the second chroma component Cr of the second present foreground area BMap q′   sou ′, marking the color transfer function as M q′   Cr (v′), wherein M q′   Cr (v′)=u′, and then providing a step f-8), if no, providing a step f-7), wherein H p′   Cr     —     Cum     —     ref  is the cumulative histogram of the second chroma component Cr of the first present foreground area BMap p′   ref ′, H q′   Cr     —     Crum     —     sou  is the cumulative histogram of the second chroma component Cr of the second present foreground area BMap q′   sou ′; 
         [0060]    f-7) letting u′=u′+1, repeating the step f-6) for judging the value of the second chroma component Cr of the first present foreground area BMap p′   ref ′ by the inequality, wherein the “=” is the assignment symbol; 
         [0061]    f-8) correcting the color of the corresponding area of the uncorrected image I sou  by utilizing the M q′   Y (v′), M q′   Cb (v′) and M q′   Cr (v′) for obtaining the corrected area, marking the luminance component, the first chroma component and the second chroma component of the pixel at the position of (x,y) in the corrected area as Correct Y (x,y), Correct Cb (x,y) and Correct Cr (x,y), wherein Correct Y (x,y)=M q′   Y (Y sou (x,y)), Correct Cb (x,y)=M q′   Cb (Cb sou (x,y)), Correct Cr (x,y)=M q′   Cr (Cr sou (x,y)), wherein the (x,y) is the coordinate of the pixel in the first present foreground area, the second present foreground area or the corrected area, Y sou (x,y) is the value of the luminance component of the pixel at the position of (x,y) in the second present foreground area, Cb sou (x,y) is the value of the first chroma component of the pixel at the position of (x,y) in the second present foreground area, Cr sou (x,y) is the value of the second chroma component of the pixel at the position of (x,y) in the second present foreground area, M q′   y (Y sou (x,y)) is the value of the Y sou (x,y) after being corrected, M q′   Cb (Cb sou (x,y)) is the value of the Cb sou (x,y) after being corrected, M q′   Cr (Cr sou (x,y)) is the value of the Cr sou (x,y) after being corrected; and 
         [0062]    f-9) letting p′=p′+1, q′=q′+1, taking the next untreated foreground area from the marched foreground areas of the BMap ref  as the first present foreground area, taking the next untreated foreground area from the marched foreground areas of the BMap sou  as the second present foreground area, repeating the step f-2) to the step f-9) again and circularly until all the marched foreground areas of the BMap ref  and the BMap sou  are treated, wherein the “=” in the equation p′=p′+1 or q′=q′+1 is the assignment symbol. 
         [0063]    The step g) specifically comprises steps of: 
         [0064]    g-1) taking the area comprising all the pixels of the BMap ref  with the pixel value of 0 as the background area, calculating the histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap ref : denoting the histogram of the luminance component Y of the background area as H Y     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Y_ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     background 
                   
                 
                  
                 
                     
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         
                           Y 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Y back (x′,y′) is the value of the luminance component of the pixel at the position of (x′,y′) in the background area, δ[u, 
         [0000]    
       
         
           
             
               
                 
                   Y 
                   back 
                 
                  
                 
                   ( 
                   
                     
                       x 
                       ′ 
                     
                     , 
                     
                       y 
                       ′ 
                     
                   
                   ) 
                 
               
               ] 
             
             = 
             
               { 
               
                 
                   
                     
                       
                         1 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         = 
                         
                           
                             Y 
                             back 
                           
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       otherwise 
                     
                   
                 
                 , 
               
             
           
         
       
     
         [0000]    denoting the histogram of the first chroma component Cb of the background area as H Cb     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Cb_ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     background 
                   
                   
                       
                   
                 
                  
                 
                     
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         
                           Cb 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cb back (x′,y′) is the value of the first chroma component of the pixel at the position of (x′,y′) in the background area, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     
                       Cb 
                       back 
                     
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         1 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         = 
                         
                           
                             Cb 
                             back 
                           
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       otherwise 
                     
                   
                 
                 , 
               
             
           
         
       
     
         [0000]    denoting the histogram of the second chroma component Cr of the background area as H Cr     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Cr_ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     background 
                   
                   
                       
                   
                 
                  
                 
                     
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         
                           Cr 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cr back (x′,y′) is the value of the second chroma component of the pixel at the position of (x′,y′) in the background area, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     
                       Cr 
                       back 
                     
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         1 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         = 
                         
                           
                             Cr 
                             back 
                           
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       otherwise 
                     
                   
                 
                 , 
               
             
           
         
       
     
         [0000]    wherein uε[0,255]; 
         [0065]    g-2) calculating the normalized histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area: denoting the normalized histogram of the luminance component Y of the background area as H Y     —     Norm     —     ref     —     back (u), H Y     —     Norm     —     ref     —     back (u)=H Y     —     ref     —     back (u)/PixelCount back , denoting the normalized histogram of the first chroma component Cb of the background area as H Cb     —     Norm     —     ref     —     back (u), H Cb     —     Norm     —     ref     —     back (u)=H Cb     —     ref     —     back (u)/PixelCount back , denoting the normalized histogram of the second chroma component Cr of the background area as H Cr     —     Norm     —     ref     —     back (u), H Cr     —     Norm     —     ref     —     back (u)=H Cr     —     ref     —     back (u)/PixelCount back , wherein uε[0,255], and the PixelCount back  is the number of all the pixels in the background area; 
         [0066]    g-3) calculating the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area: denoting the cumulative histogram of the luminance component Y of the background area as H Y     —     Cum     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Y_Cum 
                      
                     _ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                     
                 
                  
                 
                   
                     H 
                     
                       Y_Norm 
                        
                       _ref 
                        
                       _back 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the first chroma component Cb of the background area as H Cb     —     Cum     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Cb_Cum 
                      
                     _ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                     
                 
                  
                 
                   
                     H 
                     
                       Cb_Norm 
                        
                       _ref 
                        
                       _back 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the second chroma component Cr of the background area as H Cr     —     Cum     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Cr_Cum 
                      
                     _ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                     
                 
                  
                 
                   
                     H 
                     
                       Cr_Norm 
                        
                       _ref 
                        
                       _back 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein uε[0,255]; and 
         [0067]    g-4) calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap sou  by the same method as recited in step g-1) to step g-3). 
         [0068]    The step h) specifically comprises steps of: 
         [0069]    h-1) judging whether the values u′ and u′+1 of the luminance component Y of the background area of the BMap ref  and the value v′ of the luminance component Y of the background area of the BMap sou  satisfy the following inequality: H Y     —     Cum     —     ref     —     back (u′)≦H Y     —     Cum     —     sou     —     back (v′)&lt;H Y     —     Cum     —     ref     —     back (u′+1), if yes, the value u′ of the luminance component Y of the background area of the BMap ref  is marching with the value v′ of the luminance component Y of the background area of the BMap sou , calculating the color transfer function of the value v′ of the luminance component Y of the background area of the BMap sou , marking the color transfer function as M Y     —     back (v′) wherein M Y     —     back (v′)=u′, and then providing a step h-3), if no, providing a step h-2), wherein H Y     —     Cum     —     ref     —     back  is the cumulative histogram of the luminance component Y of the background area of the BMap ref , H Y     —     Cum     —     sou     —     back  is the cumulative histogram of the luminance component Y of the background area of the BMap sou ; 
         [0070]    h-2) letting u′=u′+1, repeating the step h-1) for judging the value of the luminance component Y of the background area of the BMap ref  by the inequality, wherein the “=” is the assignment symbol; 
         [0071]    h-3) judging whether the values u′ and u′+1 of the first chroma component Cb of the background area of the BMap ref  and the value v′ of the first chroma component Cb of the background area of the BMap sou  satisfy the following inequality: H Cb     —     Cum     —     ref     —     back (u′)&lt;H Cb     —     Cum     —     sou     —     back (v′)&lt;H Cb     —     Cum     —     ref     —     back  (u′+1), if yes, the value u′ of the first chroma component Cb of the background area of the BMap ref  is marching with the value v′ of the first chroma component Cb of the background area of the BMap sou , calculating the color transfer function of the value v′ of the first chroma component Cb of the background area of the BMap sou , marking the color transfer function as M Cb     —     back (v′) wherein M Cb     —     back (v′)=u′, and then providing a step h-5), if no, providing a step h-4), wherein H Cb     —     Cum     —     ref     —     back  is the cumulative histogram of the first chroma component Cb of the background area of the BMap ref , H Cb     —     Cum     —     sou     —     back  is the cumulative histogram of the first chroma component Cb of the background area of the BMap sou ; 
         [0072]    h-4) letting u′=u′+1, repeating the step h-3) for judging the value of the first chroma component Cb of the background area of the BMap ref  by the inequality, wherein the “=” is the assignment symbol; 
         [0073]    h-5) judging whether the values u′ and u′+1 of the second chroma component Cr of the background area of the BMap ref  and the value v′ of the second chroma component Cr of the background area of the BMap sou  satisfy the following inequality: H Cr     —     Cum     —     ref     —     back (u′)≦H Cr     —     Cum     —     sou     —     back (v′)&lt;H Cr     —     Cum     —     ref     —     back (u′+1) if yes, the value u′ of the second chroma component Cr of the background area of the BMap ref  is marching with the value v′ of the second chroma component Cr of the background area of the BMap sou  calculating the color transfer function of the value v′ of the second chroma component Cr of the background area of the BMap sou , marking the color transfer function as M Cr     —     back (v′) wherein M Cr     —     back (v′)=u′, and then providing a step h-7), if no, providing a step h-6), wherein H Cr     —     Cum     —     ref     —     back  is the cumulative histogram of the second chroma component Cr of the background area of the BMap ref , H Cr     —     Cum     —     sou     —     back  is the cumulative histogram of the second chroma component Cr of the background area of the BMap sou ; 
         [0074]    h-6) letting u′=u′+1, repeating the step h-5) for judging the value of the second chroma component Cr of the background area of the BMap ref  by the inequality, wherein the “=” is the assignment symbol; and 
         [0075]    h-7) correcting the color of the corresponding area of the uncorrected image I sou  by utilizing the M Y     —     back (v′), M Cb     —     back (v′) and M Cr     —     back (v′) for obtaining the corrected background area, marking the luminance component, the first chroma component and the second chroma component of the pixel at the position of (x,y) in the corrected background area as Correct Y     —     back (x,y), Correct Cb     —     back (x,y) and Correct Cr     —     back (x,y), wherein, Correct Y     —     back (x,y)=M Y     —     back  (Y sou     —     back (x,y)), Correct Cb     —     back (x,y)=M Cb     —     back (Cb sou     —     back (x,y), Correct Cr     —     back (x,y)=M Cr     —     back (Cr sou     —     back (x,y)) wherein the (x,y) is the coordinate of the pixel in the background area of the BMap ref , the background area of the BMap sou  or the corrected background area, Y sou     —     back (x,y) is the value of the luminance component of the pixel at the position of (x,y) in the background area of the BMap sou , Cb sou     —     back (x,y) is the value of the first chroma component of the pixel at the position of (x,y) in the background area of the BMap sou , Cr sou     —     back (x,y) is the value of the second chroma component of the pixel at the position of (x,y) in the background area of the BMap sou , M Y     —     back (Y sou     —     back (x,y)) is the value of the Y sou     —     back (x,y) after being corrected, M Cb     —     back (Cb sou     —     back (x,y)) is the value of the Cb sou     —     back (x,y) after being corrected, M Cr     —     back (Cr sou     —     back (x,y)) is the value of the Cr sou     —     back (x,y) after being corrected. 
         [0076]    Therefore, compared with the conventional technology, the present invention has advantages as follows: avoiding transmission error of the color information of the varied areas of the pair of the images by transmitting the color information of the foreground areas and the background area of the reference image to the aberrated image separately, thus sufficiently improves the accuracy of the color correction, reduces the difference between the color of the reference image and the color of the aberrated image, and well prepares for the stereo matching of the pair of colorful stereo microscope images as well as for the three-dimensional reconstruction and three-dimensional measurement; on the other hand, during the correction, the correcting procedure is provided automatically without manual work. 
         [0077]    These and other objectives, features, and advantages of the present invention will become apparent from the following detailed description, the accompanying drawings, and the appended claims. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0078]      FIG. 1A  is an uncorrected image of a first pair of testing images according to a preferred embodiment of the present invention. 
           [0079]      FIG. 1B  is a reference image of the first pair of testing images according to the preferred embodiment of the present invention. 
           [0080]      FIG. 1C  is a second saliency map of the  FIG. 1A  according to the preferred embodiment of the present invention. 
           [0081]      FIG. 1D  is a first saliency map of the  FIG. 1B  according to the preferred embodiment of the present invention. 
           [0082]      FIG. 1E  shows segmented result of the  FIG. 1A  according to the preferred embodiment of the present invention. 
           [0083]      FIG. 1F  shows segmented result of the  FIG. 1B  according to the preferred embodiment of the present invention. 
           [0084]      FIG. 2A  is the uncorrected image of a second pair of testing images according to the preferred embodiment of the present invention. 
           [0085]      FIG. 2B  is the reference image of the second pair of testing images according to the preferred embodiment of the present invention. 
           [0086]      FIG. 2C  is the second saliency map of the  FIG. 2A  according to the preferred embodiment of the present invention. 
           [0087]      FIG. 2D  is the first saliency map of the  FIG. 2B  according to the preferred embodiment of the present invention. 
           [0088]      FIG. 2E  shows segmented result of the  FIG. 2A  according to the preferred embodiment of the present invention. 
           [0089]      FIG. 2F  shows segmented result of the  FIG. 2B  according to the preferred embodiment of the present invention. 
           [0090]      FIG. 3  is an corrected image of the  FIG. 1A  corrected by the method recited in the present invention according to the preferred embodiment of the present invention. 
           [0091]      FIG. 4  is the corrected image of the  FIG. 2A  corrected by the method recited in the present invention according to the preferred embodiment of the present invention. 
           [0092]      FIG. 5  shows cumulative histograms of luminance component of the  FIG. 1A ,  FIG. 1B  and  FIG. 3  according to the preferred embodiment of the present invention. 
           [0093]      FIG. 6  shows cumulative histograms of luminance component of the  FIG. 2A ,  FIG. 2B  and  FIG. 4  according to the preferred embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
       [0094]    Referring to the drawings, the present invention is further illustrated. 
         [0095]    The present invention provided a method for color correction of a pair of colorful stereo microscope images, wherein a quantity of the colors of the image is sufficiently reduced by re-quantifying the original colorful stereo microscope image, then saliency areas of the image is obtained through color contrast and the saliency image is iterated K times for obtaining a segmentation map. For simple images, the colorful stereo microscope image may have only one foreground area and one background because object of the colorful stereo microscope image are simple; but for complex images there may be more foreground areas. Therefore, marching area of the reference image and the uncorrected image are obtained by utilizing a color histogram based scheme, and a color mapping function is established between the marching areas of the reference image and the uncorrected image in such a manner that the color of the corresponding area of the uncorrected image is corrected with the color mapping functions of the three color channels. 
         [0096]    The method for color correction of a pair of colorful stereo microscope images comprising steps of: 
         [0097]    a) taking a first image of a pair of the colorful stereo microscope images in the RGB color space as a reference image I ref , and taking a second image of the pair of the colorful stereo microscope images in the RGB color space as an uncorrected image I sou , wherein the  FIG. 1A  corresponds to the  FIG. 1B  for providing the uncorrected image and the reference image of a first pair of testing images, the  FIG. 2A  corresponds to the  FIG. 2B  for providing the uncorrected image and the reference image of a second pair of testing images; 
         [0098]    b) obtaining a first saliency map of the reference image I ref  and a second saliency map of the uncorrected image I sou , wherein the first saliency map is marked as SaliencyMap ref  and the second saliency map is marked as SaliencyMap sou ; obtaining a first segmentation map of the reference image I ref  and a second segmentation map of the uncorrected image I sou  with the first saliency map of the reference image I ref  and the second saliency map of the uncorrected image I sou  respectively, wherein the first segmentation map is marked as BMap ref  and the second segmentation map is marked as BMap sou , wherein the BMap ref  and the BMap sou  all comprise a plurality of foreground areas, the i′th foreground area of the BMap ref  is marked as BMap i′   ref ′, and the i′th foreground area of the BMap sou  is marked as BMap i′   sou ′, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap ref  or the BMap sou ; 
         [0099]    wherein in the preferred embodiment, for obtaining the first saliency map of the reference image I ref  and the second saliency map of the uncorrected image I sou , the step b) specifically comprises steps of: 
         [0100]    b-a1) respectively re-quantifying color values of a R, a G and a B channel of the reference image I ref  into M levels for obtaining an initial quantified image corresponding to the reference image I ref , wherein the initial quantified image has M 3  kinds of color; 
         [0101]    b-a2) calculating an occurrence probability of each the color of the initial quantified image for obtaining the color histogram thereof, marking the occurrence probability of the ith color C i  as P i , wherein, 1≦i≦M 3 ; 
         [0102]    b-a3) replacing the color whose the occurrence probability is lower than a constant threshold T with the next color in the color histogram of the initial quantified image for obtaining a final quantified image corresponding to the reference image I ref , wherein the final quantified image has L kinds of color, wherein for the ith color C i  in the initial quantified image, judging whether P i &lt;T or not, if yes, replacing the ith color C i  in the initial quantified image with the i+1th color C i+1  or the i−1th color next to the C i  in the color histogram, if no, keeping the ith color C i  in the initial quantified image, wherein L≦M 3 ; wherein in the preferred embodiment, when M=12, and the constant threshold T is 0.05 times of the number of the pixels of the original colorful stereo microscope image, an efficient saliency object is obtained; 
         [0103]    b-a4) calculating a saliency value of each the color of the final quantified image for obtaining the first saliency map of the reference image I ref , marking the first saliency map as SaliencyMap ref , the values of which are the saliency value, and marking the saliency value of the kth color C k ′ of the final quantified image as Sal(C k ′), 
         [0000]    
       
         
           
             
               
                 Sal 
                  
                 
                   ( 
                   
                     C 
                     k 
                     ′ 
                   
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       C 
                       j 
                       ′ 
                     
                     ∈ 
                     
                       I 
                       q 
                     
                   
                 
                  
                 
                   
                     f 
                      
                     
                       ( 
                       
                         C 
                         j 
                         ′ 
                       
                       ) 
                     
                   
                   × 
                   
                     D 
                      
                     
                       ( 
                       
                         
                           C 
                           k 
                           ′ 
                         
                         , 
                         
                           C 
                           j 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein 1≦k≦L, 1≦j≦L, C j ′ is the jth color of the final quantified image, I q  is all the colors of the final quantified image, f(C j ′) is the occurrence probability of the C j ′ in the final quantified image, D(C k ′, C j ′) is a distance between the C k ′ and the C j ′ in the lαβ color space after the C k ′ and the C j ′ are transformed to the lαβ color space; and 
         [0104]    b-a5) obtaining the SaliencyMap sou  of the uncorrected image I sou  by the same method as recited in the step b-a1) to the step b-a4) for obtaining the SaliencyMap ref  of the reference image I ref ; 
         [0105]    wherein the  FIG. 1C  shows the second saliency map of the  FIG. 1A , the  FIG. 1D  shows the first saliency map of the  FIG. 1B , the  FIG. 2C  shows the second saliency map of the  FIG. 2A , the  FIG. 2D  shows the first saliency map of the  FIG. 2B ; 
         [0106]    wherein in the preferred embodiment, for obtaining the first segmentation map of the reference image I ref  and the second segmentation map of the uncorrected image I sou , the step b) specifically comprises steps of: 
         [0107]    b-c1) defining a constant threshold T f , and thresholding the SaliencyMap ref  of the reference image I ref  by utilizing the constant threshold T f  for obtaining a binary image thereof, wherein the binary image is marked as B ref , wherein T f ε[0,255], and the value 255 of the B ref  marks the foreground area, and the value 0 of the B ref  marks the background area; 
         [0108]    wherein in the preferred embodiment, a large number of experiment results illustrated that when the constant threshold T f  is 2 times of the average pixel value of all the pixels of the saliency map of the original colorful stereo microscope image, a best result is obtained, that is to say, when obtaining the first segmentation map BMap ref  of the reference image I ref , the constant threshold T f  is 2 times of the average pixel value of all the pixels of the SaliencyMap ref  of the reference image I ref , when obtaining the second segmentation map BMap sou  of the uncorrected image I sou , the constant threshold T f  is 2 times of the average pixel value of all the pixels of the SaliencyMap sou  of the uncorrected image I sou ; 
         [0109]    b-c2) obtaining a plurality of initial foreground areas and initial background areas of the reference image I ref  by utilizing a pixel value of each the pixel in the B ref  wherein each the pixel in the initial foreground areas of the reference image I ref  is corresponding to the pixel with the pixel value of 255 in the B ref , that is to say the pixel value of the pixel in the B ref  corresponding to the pixel in the initial foreground area of the reference image I ref  is 255, each the pixel in the initial background areas of the reference image I ref  is corresponding to the pixel with the pixel value of 0 in the B ref , that is to say the pixel value of the pixel in the B ref  corresponding to the pixel in the initial background area of the reference image I ref  is 0; 
         [0110]    b-c3) taking the ith initial foreground area of the I ref  under treating as a present foreground area Trimap i , wherein, 1≦i≦I, I is the number of the initial foreground areas of the reference image I ref ; 
         [0111]    b-c4) denoting an area of B ref  corresponding to the Trimap i  as B i   ref , marking a min X axis position, a max X axis position, a min Y axis position and a max Y axis position of the pixels in the area B i   ref  as miX i ′, maX i ′, miY i ′ and maY i ′; 
         [0112]    b-c5) enlarging the B i   ref  to a rectangle area, marking the rectangle area as B i   ref ′, and marking the min X axis position, the max X axis position, the min Y axis position and the max Y axis position of the pixels in the B i   ref  as miX i ′, maX i ′, miY i ′ and maY i ′, wherein 
         [0000]    
       
         
           
             
               miX 
               i 
               ′ 
             
             = 
             
               { 
               
                 
                   
                     
                       
                         
                           
                             miX 
                             i 
                           
                           - 
                           
                             0.5 
                             × 
                             
                               ( 
                               
                                 
                                   maX 
                                   i 
                                 
                                 - 
                                 
                                   miX 
                                   i 
                                 
                               
                               ) 
                             
                           
                         
                         , 
                       
                     
                     
                       
                         
                           
                             if 
                              
                             
                                 
                             
                              
                             
                               miX 
                               i 
                             
                           
                           - 
                           
                             0.5 
                             × 
                             
                               ( 
                               
                                 
                                   maX 
                                   i 
                                 
                                 - 
                                 
                                   miX 
                                   i 
                                 
                               
                               ) 
                             
                           
                         
                         ≥ 
                         0 
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       
                         
                           
                             if 
                              
                             
                                 
                             
                              
                             
                               miX 
                               i 
                             
                           
                           - 
                           
                             0.5 
                             × 
                             
                               ( 
                               
                                 
                                   maX 
                                   i 
                                 
                                 - 
                                 
                                   miX 
                                   i 
                                 
                               
                               ) 
                             
                           
                         
                         &lt; 
                         0 
                       
                     
                   
                 
                 , 
                 
                   
 
                 
                  
                 
                   
                     maX 
                     i 
                     ′ 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               
                                 
                                   maX 
                                   i 
                                 
                                 + 
                                 
                                   0.5 
                                   × 
                                   
                                     ( 
                                     
                                       
                                         maX 
                                         i 
                                       
                                       - 
                                       
                                         miX 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   
                                     maX 
                                     i 
                                   
                                 
                                 + 
                                 
                                   0.5 
                                   × 
                                   
                                     ( 
                                     
                                       
                                         maX 
                                         i 
                                       
                                       - 
                                       
                                         miX 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               &lt; 
                               W 
                             
                           
                         
                         
                           
                             
                               
                                 W 
                                 - 
                                 1 
                               
                               , 
                             
                           
                           
                             
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   
                                     maX 
                                     i 
                                   
                                 
                                 + 
                                 
                                   0.5 
                                   × 
                                   
                                     ( 
                                     
                                       
                                         maX 
                                         i 
                                       
                                       - 
                                       
                                         miX 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               ≥ 
                               W 
                             
                           
                         
                       
                       , 
                       
                         
 
                       
                        
                       
                         
                           miY 
                           i 
                           ′ 
                         
                         = 
                         
                           { 
                           
                             
                               
                                 
                                   
                                     
                                       
                                         miY 
                                         i 
                                       
                                       + 
                                       
                                         0.5 
                                         × 
                                         
                                           ( 
                                           
                                             
                                               maY 
                                               i 
                                             
                                             - 
                                             
                                               miY 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     , 
                                   
                                 
                                 
                                   
                                     
                                       
                                         if 
                                          
                                         
                                             
                                         
                                          
                                         
                                           miY 
                                           i 
                                         
                                       
                                       + 
                                       
                                         0.5 
                                         × 
                                         
                                           ( 
                                           
                                             
                                               maY 
                                               i 
                                             
                                             - 
                                             
                                               miY 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     ≥ 
                                     0 
                                   
                                 
                               
                               
                                 
                                   
                                     0 
                                     , 
                                   
                                 
                                 
                                   
                                     
                                       
                                         if 
                                          
                                         
                                             
                                         
                                          
                                         
                                           miY 
                                           i 
                                         
                                       
                                       - 
                                       
                                         0.5 
                                         × 
                                         
                                           ( 
                                           
                                             
                                               maY 
                                               i 
                                             
                                             - 
                                             
                                               miY 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     &lt; 
                                     0 
                                   
                                 
                               
                             
                             , 
                             
                               
 
                             
                              
                             
                               
                                 maY 
                                 i 
                                 ′ 
                               
                               = 
                               
                                 { 
                                 
                                   
                                     
                                       
                                         
                                           
                                             
                                               maY 
                                               i 
                                             
                                             + 
                                             
                                               0.5 
                                               × 
                                               
                                                 ( 
                                                 
                                                   
                                                     maY 
                                                     i 
                                                   
                                                   - 
                                                   
                                                     miY 
                                                     i 
                                                   
                                                 
                                                 ) 
                                               
                                             
                                           
                                           , 
                                         
                                       
                                       
                                         
                                           
                                             
                                               if 
                                                
                                               
                                                   
                                               
                                                
                                               
                                                 maY 
                                                 i 
                                               
                                             
                                             + 
                                             
                                               0.5 
                                               × 
                                               
                                                 ( 
                                                 
                                                   
                                                     maY 
                                                     i 
                                                   
                                                   - 
                                                   
                                                     miY 
                                                     i 
                                                   
                                                 
                                                 ) 
                                               
                                             
                                           
                                           &lt; 
                                           H 
                                         
                                       
                                     
                                     
                                       
                                         
                                           
                                             H 
                                             - 
                                             1 
                                           
                                           , 
                                         
                                       
                                       
                                         
                                           
                                             
                                               if 
                                                
                                               
                                                   
                                               
                                                
                                               
                                                 maY 
                                                 i 
                                               
                                             
                                             + 
                                             
                                               0.5 
                                               × 
                                               
                                                 ( 
                                                 
                                                   
                                                     maY 
                                                     i 
                                                   
                                                   - 
                                                   
                                                     miY 
                                                     i 
                                                   
                                                 
                                                 ) 
                                               
                                             
                                           
                                           ≥ 
                                           H 
                                         
                                       
                                     
                                   
                                   , 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    supposing that a size of the B i   ref ′ is W i ×H i , then W i ′=maX i ′−miX i ′, H i =maY i ′−miY i ′, wherein the W is a width of the B ref , H is a height of the B ref ; 
         [0113]    b-c6) enlarging the present foreground area Trimap i  to the rectangle area with the same position as the B i   ref ′, wherein the area is marked as Trimap i ; for each the pixel in the Trimap i ′, judging whether the pixel in the Trimap i ′ belongs to the foreground area or the background area according to the pixel value of the corresponding pixel in the B i   ref ′, wherein for the pixel having the position of (x,y) in the Trimap i ′, judging whether the pixel value of the pixel having the position of (x,y) in the B i   ref ′ is 255 or not, if yes, the pixel having the position of (x,y) in the Trimap i ′ belongs to the foreground area, if no, the pixel having the position of (x,y) in the Trimap i ′ belongs to the background area, wherein, 0≦x≦W i , 0≦y≦H i , the W i  is a width of the B i   ref ′ and the Trimap i ′, W i ′=maX i ′−miX i ′, the H i  is a height of the B i   ref ′ and the Trimap i ′, H i =maY i ′−miY i ′; 
         [0114]    b-c7) letting miX i =miX i ′, maX i =maX i ′, miY i =miY i ′ and maY i =maY i ′, and taking the B i   ref ′ as the new untreated rectangle area B i   ref ′ taking the Trimap i ′ as the new present foreground area Trimap i , repeating the step b-c5) to the step b-c7) again and circularly, judging whether the number of the pixels in the foreground area of the Trimap i ′ after repeating K times is equal to the number of the pixels in the foreground of the Trimap i ′ after repeating K−1 times, if yes, segmenting the Trimap i ′ with a GrabCut method, which is an image segmentation method based on graph cuts, for obtaining a final foreground area and a final background area of the Trimap i ′, if no, repeating the step b-c5) to the step b-c7) again, wherein the “=” is an assignment symbol, an initial value of the K is 1; 
         [0115]    wherein in the preferred embodiment, a large number of experiment results illustrated that when K=4, that is to say iterating 4 times, the number of the pixels in the foreground area is equal to the number of the pixels in the foreground area after iterating 3 times; 
         [0116]    b-c8) letting i=i+1, wherein the “=” is the assignment symbol, taking the next untreated initial foreground area of the reference image I ref  as the present foreground area Trimap i , repeating the step b-c4) to the step b-c8) again and circularly until all the initial foreground areas of the reference image I ref  are treated for obtaining the first segmentation map BMap ref  of the reference image I ref , marking the i′th foreground area of the BMap ref  as BMap i′   ref ′, 1≦i′&lt;I′, wherein the I′ is the number of the foreground areas of the BMap ref ; and 
         [0117]    b-c9) obtaining the BMap sou  of the uncorrected image I sou  by the same method as recited in the step b-c1) to the step b-c8) for obtaining the BMap ref  of the reference image I ref , marking the i′th foreground area of the BMap sou  as BMap i′   sou ′, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap sou ; 
         [0118]    wherein the  FIG. 1E  shows the segmented result of the  FIG. 1A , the  FIG. 1F  shows the segmented result of the  FIG. 1B , the  FIG. 2E  shows the segmented result of the  FIG. 2A , the  FIG. 2F  shows the segmented result of the  FIG. 2B ; 
         [0119]    c) calculating histograms, normalized histograms and cumulative histograms of a luminance component Y, a first chroma component Cb and a second chroma component Cr for each the foreground area of the BMap ref  in the YCbCr color space, and calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr for each the foreground area of the BMap sou  in the YCbCr color space; 
         [0120]    wherein in the preferred embodiment, the step c) specifically comprises steps of: 
         [0121]    c-1) taking the i′th foreground area BMap i′   ref ′ under treating of the BMap ref  as the present foreground area, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap ref ; 
         [0122]    c-2) calculating the histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the BMap i′   ref ′: denoting the histogram of the luminance component Y of the BMap i′   ref ′ as H i′   Y     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   Y_ref 
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     
                       
                         BMap 
                         
                           i 
                           ′ 
                         
                         
                           ref 
                            
                           
                               
                           
                         
                       
                        
                       ′ 
                     
                   
                 
                  
                 
                     
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         Y 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
              
             
                 
             
             , 
           
         
       
     
         [0000]    wherein Y(x′,y′) is the value of the luminance component of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     Y 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         1 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         = 
                         
                           Y 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         ≠ 
                         
                           Y 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
                 , 
               
             
           
         
       
     
         [0000]    denoting the histogram of the first chroma component Cb of the BMap i′   ref ′ as H i′   Cb     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   Cb_ref 
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     
                       
                         BMap 
                         
                           i 
                           ′ 
                         
                         ref 
                       
                        
                       ′ 
                     
                   
                   
                       
                   
                 
                  
                 
                     
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         Cb 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cb(x′,y′) is the value of the first chroma component of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     Cb 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         1 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         = 
                         
                           Cb 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         ≠ 
                         
                           Cb 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
                 , 
               
             
           
         
       
     
         [0000]    denoting the histogram of the second chroma component Cr of the BMap i′   ref ′ as H i′   Cr     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   Cr_ref 
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     
                       
                         BMap 
                         
                           i 
                           ′ 
                         
                         ref 
                       
                        
                       ′ 
                     
                   
                   
                       
                   
                 
                  
                 
                     
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         Cr 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cr(x′,y′) is the value of the second chroma component of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     Cr 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         Cr 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           u 
                         
                         ≠ 
                         
                           Cr 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    wherein uε[0,255]; 
         [0123]    c-3) calculating the normalized histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the BMap i′   ref ′: denoting the normalized histogram of the luminance component Y of the BMap i′   ref ′ as H i′   Y     —     Norm     —     ref (u), H i′   Y     —     Norm     —     ref (u)=H i′   Y     —     ref (u)/PixelCount i ′, denoting the normalized histogram of the first chroma component Cb of the BMap i′   ref ′ as H i′   Cb     —     Norm     —hu ref   (u), H i′   Cb     —     Norm     —hu ref   (u)=H i′   Cb     —     ref (u)/PixelCount i′ , denoting the normalized histogram of the second chroma component Cr of the BMap i′   ref ′ as H i′   Cr     —     Norm     —     ref  (u) H i′   Cr     —     Norm     —     ref (u)=H i′   Cr     —     ref  (u)/PixelCount i′ , wherein uε[0,255], and the PixelCount i′  is the number of the pixels in the present foreground area BMap i′   ref ′; 
         [0124]    c-4) calculating the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the BMap i′   ref ′: denoting the cumulative histogram of the luminance component Y of the BMap i′   ref ′ as H i′   Y     —     Cum     —     ref (u) 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Y_Cum 
                      
                     _ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       i 
                       ′ 
                     
                     
                       Y_Norm 
                        
                       _ref 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the first chroma component Cb of the BMap i′   ref ′ as H i′   Cb     —     Cum     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Cb_Cum 
                      
                     _ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       i 
                       ′ 
                     
                     
                       Cb_Norm 
                        
                       _ref 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the second chroma component Cr of the BMap i′   ref ′ as H i′   Cr     —     Cum     —     ref (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   
                     Cr_Cum 
                      
                     _ref 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       i 
                       ′ 
                     
                     
                       Cr_Norm 
                        
                       _ref 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein uδ[0,255]; 
         [0125]    c-5) letting i′=i′+1, taking the next untreated foreground area of the BMap ref  as the present foreground area, repeating the step c-2) to the step c-5) again and circularly until all the foreground areas of the BMap ref  are treated, wherein the “=” is the assignment symbol; and 
         [0126]    c-6) calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of each the foreground area of the BMap sou  by the same method as recited in the step c-1) to the step c-5); 
         [0127]    d) calculating color histograms for each the foreground area of the BMap i′   ref ′ and the BMap sou  in the RGB color space; 
         [0128]    wherein in the preferred embodiment, the step d) specifically comprises steps of: 
         [0129]    d-a1) taking the i′th foreground area BMap i′   ref ′ under treating of the BMap ref  as the present foreground area, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap ref ; 
         [0130]    d-a2) calculating the color histogram of the present foreground area BMap i′   ref ′: denoting the color histogram as H i′   RGB     —     ref (c), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   RGB_ref 
                 
                  
                 
                   ( 
                   c 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                       BMap 
                       
                         i 
                         ′ 
                       
                       
                         ref 
                          
                         
                             
                         
                          
                         ′ 
                       
                     
                   
                 
                  
                 
                   
                     δ 
                      
                     
                       [ 
                       
                         c 
                         , 
                         
                           C 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                   / 
                   
                     PixelCount 
                     
                       i 
                       ′ 
                     
                     PGB_ref 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein C=256×R+16×G+B, the R is the value of a red component of the pixel in the BMap i′   ref ′, the G is the value of a green component of the pixel in the BMap i′   ref ′, the B is the value of a blue component of the pixel in the BMap i′   ref ′, wherein C(x′,y′) is the value of the C of the pixel at the position of (x′,y′) in the BMap i′   ref ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   c 
                   , 
                   
                     C 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         c 
                       
                       = 
                       
                         C 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           c 
                         
                         ≠ 
                         
                           C 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    PixelCount i′   RCB     —     ref  is the number of the pixels in the present foreground area BMap i′   ref ′; 
         [0131]    d-a3) letting i′=i′+1, taking the next untreated foreground area of the BMap ref  as the present foreground area, repeating the step d-a2) to the step d-a3) again and circularly until all the foreground areas of the BMap ref  are treated, wherein the “=” is the assignment symbol; and 
         [0132]    d-a4) calculating the color histogram H i′   RGB     —     sou (c) of each the foreground area of the BMap sou  by the same method as recited in the step d-a1) to the step d-a3), that is to say: first, taking the i′th foreground area BMap i′   sou ′ under treating of the BMap sou  as the present foreground area, wherein, 1≦i′≦I′, the I′ is the number of the foreground areas of the BMap sou ; second, calculating the color histogram of the present foreground area BMap i′   sou ′, denoting the color histogram as H i′   RGB     —     sou (c), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     i 
                     ′ 
                   
                   RGB_sou 
                 
                  
                 
                   ( 
                   c 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     
                       
                         BMap 
                         
                           i 
                           ′ 
                         
                         sou 
                       
                        
                       ′ 
                     
                   
                 
                  
                 
                   
                     δ 
                      
                     
                       [ 
                       
                         c 
                         , 
                         
                           C 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                   / 
                   
                     PixelCount 
                     
                       i 
                       ′ 
                     
                     PGB_sou 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein C=256×R+16×G+B, the R is the value of the red component of the pixel in the BMap i′   sou ′, the G is the value of the green component of the pixel in the BMap i′   sou ′, the B is the value of the blue component of the pixel in the BMap i′   sou ′, wherein C(x′,y′) is the value of the C of the pixel at the position of (x′,y′) in the BMap i′   sou ′, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   c 
                   , 
                   
                     C 
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         c 
                       
                       = 
                       
                         C 
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                            
                           
                               
                           
                            
                           c 
                         
                         ≠ 
                         
                           C 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ′ 
                               
                               , 
                               
                                 y 
                                 ′ 
                               
                             
                             ) 
                           
                         
                       
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0133]    PixelCount i′   RGB     —     sou  is the number of the pixels in the present foreground area BMap i′   sou ′; third, letting i′=i′+1, taking the next untreated foreground area of the BMap sou  as the present foreground area, repeating the second step to the third step again and circularly until all the foreground areas of the BMap sou  are treated; 
         [0134]    e) for each the foreground area of the BMap ref , calculating a similarity value of the color histogram of the foreground area of the BMap ref  and the color histogram of the corresponding foreground area of the BMap sou  and judging whether the foreground area of the BMap ref  is marching with the corresponding foreground area of the BMap sou  or not from the similarity value of the color histograms of the two marching foreground areas; 
         [0135]    wherein whether the two foreground areas are marching with each other or not is judged from the similarity value, a range of the similarity value function is between 0 and 1, the higher value means that the two foreground areas are more similar to each other, when the value is 1, the two foreground areas are completely similar to each other; 
         [0136]    wherein in the preferred embodiment, the step e) specifically comprises steps of: 
         [0137]    e-1) taking the pth foreground area BMap p   ref ′ under treating of the BMap ref  as the first present foreground area, taking the qth foreground area BMap q   sou ′ under treating of the BMap sou  as the second present foreground area, wherein, 1≦p≦P, 1≦q≦Q, the P is the number of the foreground areas of the BMap ref , the Q is the number of the foreground areas of the BMap sou ; 
         [0138]    e-2) calculating the similarity value of the color histogram H p   RGB     —     ref  of the first foreground area BMap p   ref ′ and the color histogram H q   RGB     —     sou  of the second foreground area BMap q   sou ′, marking the similarity value as Sim(H p   RGB     —     ref , H q   RGB     —     sou ), 0≦Sim(H p   RGB     —     ref ,H q   RGB     —     sou )≦1, wherein the larger the value of Sim(H p   RGB     —     ref , H q   RGB     —     sou ) is, the more similar the two color histograms are, and the value 1 of Sim(H p   RGB     —     ref ,H q   RGB     —     sou ) means that the two color histograms are same with each other; there are several existed different methods to measure the similarity of two histograms which can be used in this step, wherein in the preferred embodiment, 
         [0000]    
       
         
           
             
               
                 Sim 
                  
                 
                   ( 
                   
                     
                       H 
                       p 
                       RGB_ref 
                     
                     , 
                     
                       H 
                       q 
                       RGB_sou 
                     
                   
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     c 
                     = 
                     
                       Min 
                        
                       
                           
                       
                        
                       C 
                     
                   
                   
                     Max 
                      
                     
                         
                     
                      
                     C 
                   
                 
                  
                 
                   
                     
                       
                         
                           H 
                           p 
                           RGB_ref 
                         
                          
                         
                           ( 
                           c 
                           ) 
                         
                       
                       × 
                       
                         
                           H 
                           q 
                           RGB_sou 
                         
                          
                         
                           ( 
                           
                             c 
                             + 
                             
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 c 
                                 max 
                               
                             
                           
                           ) 
                         
                       
                     
                      
                     
                         
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein the MaxC is the max value of the C of the first foreground area BMap p   ref ′, the MinC is the min value of the C of the first foreground area BMap p   ref ′, and 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               
                 c 
                 max 
               
             
             = 
             
               
                 
                   arg 
                    
                   
                       
                   
                    
                   max 
                 
                 
                   Δ 
                    
                   
                       
                   
                    
                   c 
                 
               
                
               
                 ( 
                 
                   
                     ∑ 
                     
                       c 
                       = 
                       
                         Min 
                          
                         
                             
                         
                          
                         C 
                       
                     
                     
                       Max 
                        
                       
                           
                       
                        
                       C 
                     
                   
                    
                   
                     
                       
                         
                           
                             H 
                             p 
                             RGB_ref 
                           
                            
                           
                             ( 
                             c 
                             ) 
                           
                         
                         × 
                         
                           
                             H 
                             q 
                             RGB_sou 
                           
                            
                           
                             ( 
                             
                               c 
                               + 
                               
                                 Δ 
                                  
                                 
                                     
                                 
                                  
                                 c 
                               
                             
                             ) 
                           
                         
                       
                        
                       
                           
                       
                     
                   
                 
                 ) 
               
             
           
         
       
     
         [0000]    with the constraint that H q   RGB     —     sou (c+Δc max ) is within a definition of the color histogram H q   RGB     —     sou (c); 
         [0139]    e-3) judging whether Sim(H p   RGB     —     ref ,H q   RGB     —     sou ) is larger than a threshold T s  or not, if yes, the first foreground area BMap p   ref ′ is marching with the second foreground area BMap q   sou ′, if no, the first foreground area BMap p   ref ′ is not marching with the second foreground area BMap q   sou ′; wherein in the preferred embodiment the T s =1; and 
         [0140]    e-4) letting p=p+1, q=q+1, wherein the “=” is the assignment symbol, taking the next untreated foreground area of the BMap ref  as the first present foreground area, taking the next untreated foreground area of the BMap sou  as the second present foreground area, repeating the step e-2) to the step e-4) again and circularly until all the foreground areas of the BMap ref  or the foreground areas of the BMap sou  are treated; 
         [0141]    f) for each pair of the foreground area of the BMap ref  and the marched foreground area of the BMap sou , calculating transfer functions with respect to a luminance component Y, a first chroma component Cb and a second chroma component Cr of the pair, and correcting the luminance component Y, the first chroma component Cb and the second chroma component Cr of the area of the uncorrected image I sou  corresponding to the marched foreground area of the BMap sou  according to the transfer functions with respect to the luminance component, the first chroma component and the second chroma component of the foreground area of the BMap ref  and the marched foreground area of the BMap sou ; 
         [0142]    wherein in the preferred embodiment, the step f) specifically comprises steps of: 
         [0143]    f-1) taking the matched foreground areas under treating of the BMap ref  and the BMap sou  respectively as the first present foreground area and the second present foreground area, supposing that the first present foreground area is the p′th matched foreground area BMap p   ref ′ under treating of the BMap ref , supposing that the second present foreground area is the q′th matched foreground area BMap q   sou ′ under treating of the BMap sou , wherein, 1≦p′≦S, 1≦q′≦S, the S is the number of the pairs of the matched foreground areas of the BMap ref  and the BMap sou ; 
         [0144]    f-2) judging whether the values u′ and u′+1 of the luminance component Y of the first present foreground area BMap p   ref ′ and the value v′ of the luminance component Y of the second present foreground area BMap q   sou ′ satisfy a following inequality: H p′   Y     —     Cum     —     ref (u′)≦H q′   Y     —     Cum     —     sou (v′)&lt;H p′   Y     —     Cum     —     ref (u′+1) if yes, the value u′ of the luminance component Y of the first present foreground area BMap p   ref ′ is marching with the value v′ of the luminance component Y of the second present foreground area BMap q′   sou ′, calculating a color transfer function of the value v′ of the luminance component Y of the second present foreground area BMap q′   sou ′, marking the color transfer function as M q′   Y (v′), wherein M q′   Y (v′)=u′ and then providing a step f-4), if no, providing a step f-3), wherein H p′   Y     —     Cum     —     ref  is the cumulative histogram of the luminance component Y of the first present foreground area BMap p′   ref ′, H q′   Y     —     Cum     —     sou  is the cumulative histogram of the luminance component Y of the second present foreground area BMap q′   sou ′; 
         [0145]    f-3) letting u′=u′+1, repeating the step f-2) for judging the value of the luminance component Y of the first present foreground area BMap p′   ref ′ by the inequality, wherein the “=” is the assignment symbol; 
         [0146]    f-4) judging whether the values u′ and u′+1 of the first chroma component Cb of the first present foreground area BMap p   ref ′ and the value v′ of the first chroma component Cb of the second present foreground area BMap q′   sou ′ satisfy the following inequality: H p′   Cb     —     Cum     —     ref (u′)≦H q′   Cb     —     Cum     —     sou (v′)&lt;H p′   Cb     —     Cum     —     ref (u′+1), if yes, the value u′ of the first chroma component Cb of the first present foreground area BMap p′   ref ′ is marching with the value v′ of the first chroma component Cb of the second present foreground area BMap q′   sou ′, calculating the color transfer function of the value v′ of the first chroma component Cb of the second present foreground area BMap q′   sou ′, marking the color transfer function as M q′   Cb (v′), wherein M q′   Cb (v′)=u′, and then providing a step f-6), if no, providing a step f-5), wherein H p′   Cb     −     Cum     —     ref  is the cumulative histogram of the first chroma component Cb of the first present foreground area BMap p′   ref ′, H q′   Cb     —     Cum     —     sou  is the cumulative histogram of the first chroma component Cb of the second present foreground area BMap q   sou ′; 
         [0147]    f-5) letting u′=u′+1, repeating the step f-4) for judging the value of the first chroma component Cb of the first present foreground area BMap p′   ref ′ by the inequality, wherein the “=” is the assignment symbol; 
         [0148]    f-6) judging whether the values u′ and u′+1 of the second chroma component Cr of the first present foreground area BMap p′   ref ′ and the value v′ of the second chroma component Cr of the second present foreground area BMap q   sou ′ satisfy the following inequality: H p′   Cr     —     Cum     —     ref (u′)≦H q′   Cr     —     Cum     —     sou (v′)&lt;H p′   Cr     —     Cum     —     ref (u′+1), if yes, the value u′ of the second chroma component Cr of the first present foreground area BMap p′   ref ′ is marching with the value v′ of the second chroma component Cr of the second present foreground area BMap q   sou ′, calculating the color transfer function of the value v′ of the second chroma component Cr of the second present foreground area BMap q′   sou ′, marking the color transfer function as M q′   Cr (v′), wherein M q′   Cr (v′)=u′, and then providing a step f-8), if no, providing a step f-7), wherein H p′   Cr     —     Cum     —     ref  is the cumulative histogram of the second chroma component Cr of the first present foreground area BMap p′   ref ′, H q′   Cr     —     Cum     —     sou  is the cumulative histogram of the second chroma component Cr of the second present foreground area BMap q′   sou ′; 
         [0149]    f-7) letting u′=u′+1, repeating the step f-6) for judging the value of the second chroma component Cr of the first present foreground area BMap p′   ref ′ by the inequality, wherein the “=” is the assignment symbol; 
         [0150]    f-8) correcting the color of the corresponding area of the uncorrected image I sou  by utilizing the M q′   Y (v′), M q′   Cb (v′) and M q′   Cr (v′) for obtaining the corrected area, marking the luminance component, the first chroma component and the second chroma component of the pixel at the position of (x,y) in the corrected area as Correct Y (x,y), Correct Cb (x,y) and Correct Cr (x,y), wherein Correct Y (x,y)=M q′   Y [Y sou (x,y)], Correct Cb (x,y)=M q′   Cb [Cb sou (x,y)], Correct Cr (x,y)=M q′   Cr [Cr sou (x,y)], wherein the (x,y) is the coordinate of the pixel in the first present foreground area, the second present foreground area or the corrected area, Y sou (x,y) is the value of the luminance component of the pixel at the position of (x,y) in the second present foreground area, Cb sou (x,y) is the value of the first chroma component of the pixel at the position of (x,y) in the second present foreground area, Cr sou (x,y) is the value of the second chroma component of the pixel at the position of (x,y) in the second present foreground area, M q′   Y (Y sou (x,y)) is the value of the Y sou (x,y) after being corrected, M q′   Cb (Cb sou (x,y)) is the value of the Cb sou (x,y) after being corrected, M q′   Cr (Cr sou (x,y)) is the value of the Cr sou (x,y) after being corrected; and 
         [0151]    f-9) letting p′=p′+1, q′=q′+1, taking the next untreated foreground area from the marched foreground areas of the BMap ref  as the first present foreground area, taking the next untreated foreground area from the marched foreground areas of the BMap sou  as the second present foreground area, repeating the step f-2) to the step f-9) again and circularly until all the marched foreground areas of the BMap ref  and the BMap sou  are treated, then combining the luminance component, the first chroma component and the second chroma component of each the corrected area for obtaining the corrected foreground areas of the uncorrected image I sou , wherein the “=” in the equation p′=p′+1 or q′=q′+1 is the assignment symbol; 
         [0152]    wherein after all the marched foreground areas are treated, the color of the background area is corrected; the background area comprises all pixels which do not belong to any of the foreground areas, thus, the reference image only has one background area as well as the uncorrected image; 
         [0153]    g) calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap ref  in the YCbCr color space, and calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap sou  in the YCbCr color space; 
         [0154]    wherein in the preferred embodiment, the step g) specifically comprises steps of: 
         [0155]    g-1) taking the area comprising all the pixels of the BMap ref  with the pixel value of 0 as the background area, calculating the histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap ref : denoting the histogram of the luminance component Y of the background area as H Y     —     ref     —     back  (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     
                       Y 
                        
                       _ref 
                     
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     background 
                   
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         
                           Y 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Y back (x′,y′) is the value of the luminance component of the pixel at the position of (x′,y′) in the background area, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     
                       Y 
                       back 
                     
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         
                           Y 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       otherwise 
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    denoting the histogram of the first chroma component Cb of the background area as H Cb     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     
                       Cb 
                        
                       _ref 
                     
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     background 
                   
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         
                           Cb 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cb back (x′,y′) is the value of the first chroma component of the pixel at the position of (x′,y′) in the background area, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     
                       Cb 
                       back 
                     
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         
                           Cb 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       otherwise 
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    denoting the histogram of the second chroma component Cr of the background area as H Cr     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     
                       Cr 
                        
                       _ref 
                     
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     background 
                   
                 
                  
                 
                   δ 
                    
                   
                     [ 
                     
                       u 
                       , 
                       
                         
                           Cr 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein Cr back (x′,y′) is the value of the second chroma component of the pixel at the position of (x′,y′) in the background area, 
         [0000]    
       
         
           
             
               δ 
                
               
                 [ 
                 
                   u 
                   , 
                   
                     
                       Cr 
                       back 
                     
                      
                     
                       ( 
                       
                         
                           x 
                           ′ 
                         
                         , 
                         
                           y 
                           ′ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         if 
                          
                         
                             
                         
                          
                         u 
                       
                       = 
                       
                         
                           Cr 
                           back 
                         
                          
                         
                           ( 
                           
                             
                               x 
                               ′ 
                             
                             , 
                             
                               y 
                               ′ 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       otherwise 
                       , 
                     
                   
                 
               
             
           
         
       
     
         [0000]    wherein uε[0,255]; 
         [0156]    g-2) calculating the normalized histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area: denoting the normalized histogram of the luminance component Y of the background area as H Y     —Norm       —     ref     −     back (u), H Y     —Norm       —     ref     −     back (u)=H Y     —     ref     −     back (u)/PixelCount back , denoting the normalized histogram of the first chroma component Cb of the background area as H Cb     —     Norm     —     ref     —     back (u), H Cb     —     Norm     —     ref     —     back (u)=H Cb     —     ref     —     back (u)/PixelCount back , denoting the normalized histogram of the second chroma component Cr of the background area as H Cr     —     Norm     —     ref     —     back (u), H Cr     —     Norm     —     ref     —     back (u)=H Cr     —     ref     —     back (u)/PixelCount back , wherein uε[0,255], and the Pixe/Count back  is the number of all the pixels in the background area; 
         [0157]    g-3) calculating the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area: denoting the cumulative histogram of the luminance component Y of the background area as H Y     —     Cum     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Y_Cum 
                      
                     _ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       Y_Norm 
                        
                       _ref 
                        
                       _back 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the first chroma component Cb of the background area as H Cb     —     Cum     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Cb_Cum 
                      
                     _ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       CB_Norm 
                        
                       _ref 
                        
                       _back 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    denoting the cumulative histogram of the second chroma component Cr of the background area as H Cr     —     Cum     —     ref     —     back (u), 
         [0000]    
       
         
           
             
               
                 
                   H 
                   
                     Cr_Cum 
                      
                     _ref 
                      
                     _back 
                   
                 
                  
                 
                   ( 
                   u 
                   ) 
                 
               
               = 
               
                 
                   ∑ 
                   
                     j 
                     = 
                     0 
                   
                   u 
                 
                  
                 
                   
                     H 
                     
                       Cr_Norm 
                        
                       _ref 
                        
                       _back 
                     
                   
                    
                   
                     ( 
                     j 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    wherein uε[0,255]; and 
         [0158]    g-4) calculating the histograms, the normalized histograms and the cumulative histograms of the luminance component Y, the first chroma component Cb and the second chroma component Cr of the background area of the BMap sou  by the same method as recited in step g-1) to step g-3); 
         [0159]    h) calculating transfer functions with respect to the luminance component, the first chroma component and the second chroma component of the background area of the BMap ref  and the background area of the BMap sou , and correcting the luminance component Y, the first chroma component Cb and the second chroma component Cr of the area of the uncorrected image I sou  corresponding to the background area of the BMap sou  according to the transfer functions with respect to the luminance component, the first chroma component and the second chroma component of the background areas of the BMap ref  and the BMap sou ; 
         [0160]    wherein in the preferred embodiment, the step h) is similar to the step f), the step h) specifically comprises steps of: 
         [0161]    h-1) judging whether the values u′ and u′+1 of the luminance component Y of the background area of the BMap ref  and the value v′ of the luminance component Y of the background area of the BMap sou  satisfy the following inequality: H Y     —     Cum     —     ref     —     back (u′)≦H Y     —     Cum     —     sou     —     back (v′)&lt;H Y     —     Cum     —     ref     —     back (u′+1), if yes, the value u′ of the luminance component Y of the background area of the BMap ref  is marching with the value v′ of the luminance component Y of the background area of the BMap sou , calculating the color transfer function of the value v′ of the luminance component Y of the background area of the BMap sou , marking the color transfer function as M Y     —     back (v′) wherein M Y     —     back (v′)=u′, and then providing a step h-3), if no, providing a step h-2), wherein H Y     —     Cum     —     ref     —     back  is the cumulative histogram of the luminance component Y of the background area of the BMap ref , H Y     —     Cum     —     sou     —     back  is the cumulative histogram of the luminance component Y of the background area of the BMap sou ; 
         [0162]    h-2) letting u′=u′+1, repeating the step h-1) for judging the value of the luminance component Y of the background area of the BMap ref  by the inequality, wherein the “=” is the assignment symbol; 
         [0163]    h-3) judging whether the values u′ and u′+1 of the first chroma component Cb of the background area of the BMap ref  and the value v′ of the first chroma component Cb of the background area of the BMap sou  satisfy the following inequality: H Cb     —     Cum     —     ref     —     back (u′)≦H Cb     —     Cum     —     sou     —     back (v′)&lt;H Cb     —     Cum     —     ref     —     back (u′+1), if yes, the value u′ of the first chroma component Cb of the background area of the BMap ref  is marching with the value v′ of the first chroma component Cb of the background area of the BMap sou , calculating the color transfer function of the value v′ of the first chroma component Cb of the background area of the BMap sou , marking the color transfer function as M Cb     —     back (v′) wherein M Cb     —     back (v′)=u′, and then providing a step h-5), if no, providing a step h-4), wherein H Cb     —     Cum     —     ref     —     back  is the cumulative histogram of the first chroma component Cb of the background area of the BMap ref , H Cb     —     Cum     —     sou     —     back  is the cumulative histogram of the first chroma component Cb of the background area of the BMap sou ; 
         [0164]    h-4) letting u′=u′+1, repeating the step h-3) for judging the value of the first chroma component Cb of the background area of the BMap ref  by the inequality, wherein 
         [0165]    h-5) judging whether the values u′ and u′+1 of the second chroma component Cr of the background area of the BMap ref  and the value v′ of the second chroma component Cr of the background area of the BMap sou  satisfy the following inequality: H Cr     —     Cum     —     ref     —     back (u′)≦H Cr     —     Cum     —     sou     —     back (v′)&lt;H Cr     —     Cum     —     ref     —     back (u′+ 1 ), if yes, the value u′ of the second chroma component Cr of the background area of the BMap ref  is marching with the value v′ of the second chroma component Cr of the background area of the BMap sou , calculating the color transfer function of the value v′ of the second chroma component Cr of the background area of the BMap sou , marking the color transfer function as M Cr     —     back (v′) wherein M Cr     —     back (v′)=u′, and then providing a step h-7), if no, providing a step h-6), wherein H Cr     —     Cum     —     ref     —     back  is the cumulative histogram of the second chroma component Cr of the background area of the BMap ref , H Cr     —     Cum     —     sou     —     back  is the cumulative histogram of the second chroma component Cr of the background area of the BMap sou ; 
         [0166]    h-6) letting u′=u′+1, repeating the step h-5) for judging the value of the second chroma component Cr of the background area of the BMap ref  by the inequality, wherein the “=” is the assignment symbol; and 
         [0167]    h-7) correcting the color of the corresponding area of the uncorrected image I sou  by utilizing the M Y     —     back (v′), M Cb     —     back (v′) and M Cr     —     back (v′) for obtaining the corrected background area, marking the luminance component, the first chroma component and the second chroma component of the pixel at the position of (x,y) in the corrected background area as Correct Y     —     back (x,y), Correct Cb     —     back (x,y) and Correct Cr     —     back (x,y), wherein, Correct Y     —     back (x,y)=M Y     —     back  (Y sou     —     back (x,y)), Correct Cb     —     back (x,y)=M Cb     —     back (Cb sou     —     back (x,y)), Correct Cr     —     back (x,y)=M Cr     —     back (Cr sou     —     back (x,y)) wherein the (x,y) is the coordinate of the pixel in the background area of the BMap ref , the background area of the BMap sou  or the corrected background area, Y sou     —     back (x,y) is the value of the luminance component of the pixel at the position of (x,y) in the background area of the BMap sou , Cb sou     —     back (x,y) is the value of the first chroma component of the pixel at the position of (x,y) in the background area of the BMap sou , Cr sou     —     back (x,y) is the value of the second chroma component of the pixel at the position of (x,y) in the background area of the BMap sou , M Y     —     back (Y sou     —     back (x,y)) is the value of the Y so     —     back (x,y) after being corrected M Cb     —     back (Cb sou     —     back (x,y)) is the value of the Cb sou     —     back (x,y) after being corrected, M Cr     —     back (Cr sou     —     back (x,y)) is the value of the Cr sou     —     back (x,y) after being corrected; and 
         [0168]    i) combining the luminance component, the first chroma component and the second chroma component of each corrected area of the uncorrected image for obtaining an corrected image. 
         [0169]    The  FIG. 3  is the corrected image of the  FIG. 1A  corrected by the method recited in the present invention, the  FIG. 4  is the corrected image of the  FIG. 2A  corrected by the method recited in the present invention. It is illustrated by the  FIG. 3  and the  FIG. 4  that the color of the uncorrected image is sufficiently corrected to the color of the reference image, while texture information of the uncorrected image is well kept. 
         [0170]    The  FIG. 5  shows the cumulative histograms of luminance component of the  FIG. 1A ,  FIG. 1B  and  FIG. 3 , the  FIG. 6  shows the cumulative histograms of luminance component of the  FIG. 2A ,  FIG. 2B  and  FIG. 4 . It is illustrated by the  FIG. 5  and the  FIG. 6  that the cumulative histogram of luminance component of the corrected image almost overlaps with the cumulative histogram of luminance component of the reference image. Since the cumulative histogram well illustrates distribution of the color information, the overlapping cumulative histograms indicates that the color distribution of the reference image and corrected image are almost the same. By contrast, the color distribution shown by the cumulative histograms of the uncorrected image and the reference image has evident difference. The method transmits the color information of the reference image to the uncorrected image, thus illustrates efficiency and feasibility of the present invention. 
         [0171]    One skilled in the art will understand that the embodiment of the present invention as shown in the drawings and described above is exemplary only and not intended to be limiting. 
         [0172]    It will thus be seen that the objects of the present invention have been fully and effectively accomplished. Its embodiments have been shown and described for the purposes of illustrating the functional and structural principles of the present invention and is subject to change without departure from such principles. Therefore, this invention includes all modifications encompassed within the spirit and scope of the following claims.