Abstract:
A method of processing digital images to reduce the effects of color bleeding. Chrominance components for pixels in a working window are determined and weights are assigned to the pixels in the working window. A chrominance correction for a center pixel in the working window is generated based on the chrominance components and the assigned weights. Fuzzy variables and thresholds may be applied to generate the assigned weights and the chrominance correction.

Description:
BACKGROUND 
       [0001]    1. Technical Field 
         [0002]    This disclosure relates to methods of processing digital images and more particularly to methods of processing a digital image for reducing color bleeding effects. 
         [0003]    2. Description of the Related Art 
         [0004]    Common artifacts introduced by compression algorithms of static or video images based on the discrete cosine transform (DCT) include the so-called block and ringing artifacts. Block artifacts stem from the fact that compression schemes process blocks of an image and consist in visible discontinuities at borders between adjacent blocks. Ringing artifacts consist in distortions and erroneous displaying of borders of objects of the displayed scene. 
         [0005]    Both kinds of artifacts occur because a relevant amount of information, carried by the DCT coefficients, is lost in quantization. Block compression plays a role even in the so-called color bleeding. 
         [0006]    Color bleedings are distortions of the original image that are present in static images and in the images of video sequences, in the form of color blurring between zones of strong chromatic contrast. 
         [0007]    Let us refer to  FIG. 1  for better understanding the causes of this phenomenon. The chrominance values of the sixteen input pixels to be processed ( FIG. 1   a ) are decimated with a ratio 2:1 and quantized ( FIG. 1   b ) for obtaining a compressed image. In order to reconstruct an uncompressed image, the pixels of the image of  FIG. 1   b  are dequantized ( FIG. 1   c ) and then interpolated ( FIG. 1   d ). 
         [0008]    Chrominance levels of the reconstructed image ( FIG. 1   d ) are substantially different from those of the original image ( FIG. 1   a ) because of the abrupt variation (stepwise) of the chrominance in the original image. 
         [0009]    As stated in F. X. Coudoux, M. G. Gazalet, and P. Corlay, “An adaptive post-processing technique for the reduction of color bleeding in DCT coded images,”  IEEE Transaction on Circuits Systems for Video Technology , Vol. 14, No. 1 (January 2004), this phenomenon is due to the fact that a quantization and a decimation are executed (essentially in a 4:2:0 subsampling), that introduce spurious information in the reconstructed image. 
         [0010]    Examples of color bleeding are evident in a reconstructed image of  FIG. 2   b  (same scene of  FIG. 2   a ), according to the MPEG4 standard, in particular in proximity of the poster and close to the neck of the player, as highlighted in the magnified detail views of  FIGS. 2   b ′ and  2   b ″. Artifacts of this type are present also in  FIGS. 3   b  and  4   b . Recent articles such as F. X. Coudoux, M. G. Gazalet, and P. Corlay, “An adaptive post-processing technique for the reduction of color bleeding in DCT coded images,”  IEEE Transaction on Circuits Systems for Video Technology , Vol. 14, No. 1 (January 2004), and F. X. Coudoux, M. G. Gazalet and P. Corlay, “A DCT Domain Postprocessor For Color Bleeding Removal”, Proceedings of the 2005 European Conference on Circuit Theory and Design (2005), propose algorithms for reducing these undesired effects. The image to be elaborated is decomposed in blocks, as depicted in  FIG. 5 , thus the blocks A B C D potentially affected by color bleeding are identified and their chrominance components Cr and Cb are corrected. 
         [0011]    In order to identify image blocks potentially affected by color bleeding, the variances of the chrominance components Cr and Cb and the sharpness of the related luminance block are calculated using a filter for detecting contours of displayed objects, and these values are compared with thresholds. The reason for doing this consists in that color bleeding phenomena occur in correspondence of blocks containing relatively abrupt chrominance and luminance variations. 
         [0012]    Undesired effects of color bleeding are eliminated by substituting chrominance components of each block to be corrected (A, B, C, D) with an average of the chrominance components of the surrounding blocks b 0 , b 1 , . . . , b 7  not affected by color bleeding. 
         [0013]    However, these known methods are unable to correct color bleeding effects without sensibly worsening the definition of the contours of the displayed objects. Correcting each pixel simply by averaging chrominance pixels of neighboring blocks reduces color bleeding effects, but at the same time increases the blurring of the contours of displayed objects. This happens because pixels of a block that are differently affected by color bleeding are processed all in the same way. Moreover, the known methods are based on a discrimination among blocks recognized as affected or not by color bleeding, thus in case of an imprecise discrimination they introduce chromatic distortions in blocks originally free of distortion. 
       BRIEF SUMMARY 
       [0014]    In an embodiment, a method of processing digital images to reduce the effects of color bleeding comprises determining chrominance components for pixels in a working window and assigning weights to the pixels in the working window. A chrominance correction for a center pixel in the working window is generated based on the chrominance components and the assigned weights. Fuzzy variables and thresholds may be applied to generate the assigned weights and the chrominance correction. 
         [0015]    The applicants have found a method of processing digital images for reducing color bleeding effects without degrading the definition of the contours of depicted objects. 
         [0016]    An embodiment processes the image to be corrected not per blocks, as in known methods, but per pixels by averaging chrominance components of each pixel with that of the pixels contained in a working window centered on the current pixel, using weights established by fuzzy rules. The weights are obtained as a product of two fuzzy variables ew and mw, the membership functions of which are established such that relatively large weights are assigned to chrominance pixels relatively far from the contour of depicted objects and belonging to homogeneous zones, and relatively small or even null weights are assigned in the opposite case. 
         [0017]    In an embodiment, the first fuzzy variable ew is null if the maximum chromatic variation d inside a working window centered on the current pixel exceeds a first threshold and has a linear characteristic that decreases for increasing values of d below the first threshold, whilst the second fuzzy variable mw depends on the square of the amplitude m of the chrominance gradient in correspondence of the central pixel of the window. The fuzzy variable mw is preferably null if m exceeds a second threshold, is always 1 in correspondence of the central pixel of the working window and has a linear decreasing characteristic for increasing values of m below the second threshold. 
         [0018]    An embodiment of a method of this invention may be implemented through a software run in a computer or microprocessor. 
         [0019]    In an embodiment, a method of processing pixels in a digital image to reduce color bleeding comprises: identifying a working window around a selected pixel in the digital image; determining a chrominance component for each pixel in the working window around the selected pixel; assigning a weight to each pixel in the working window around the selected pixel based on a comparison of the determined chrominance components with a threshold; and selectively adjusting a chrominance component for the selected pixel based on the determined chrominance components and the assigned weights. In an embodiment, determining the chrominance components comprises determining a maximum amplitude of a chrominance gradient. In an embodiment, the method further comprises determining the assigned weights based on a product of two fuzzy variables. In an embodiment, assigning the weight to a pixel in the working window around the selected pixel comprises determining whether the pixel is part of an object associated with the selected pixel. 
         [0020]    In an embodiment, a device for processing a digital image comprises: an input configured to receive the digital image; a chrominance magnitude calculation module configured to generate chrominance components for a set of pixels in a working window in the digital image; a kernel modulator configured to selectively assign weights to the pixels in the working window and to selectively generate a corrected chrominance component of a center pixel in the working window based on the generated chrominance components and the assigned weights; and an output for outputting the processed digital image. In an embodiment, the device further comprises: an activation module coupled to the kernel modulator and configured to selectively adjust the corrected chrominance component based on a calculated chrominance magnitude for the selected pixel and the corrected chrominance component. In an embodiment, the device further comprises an edges detector configured to compare pixel gradients with threshold gradients; and a bleeding macro-block detection module configured to identify blocks of pixels for processing by the kernel modulator. 
         [0021]    In an embodiment, a system to process digital images comprises: an input configured to receive a digital image; means for calculating chrominance components of pixels in a working window in the digital image; means for assigning weights to each pixel in the working window and generating a chrominance correction for a center pixel in the working window based on the calculated chrominance components and the assigned weights; and an output configured to output the processed digital image. In an embodiment, the system further comprises: means for selectively adjusting the chrominance correction for the center pixel based on a calculated chrominance magnitude for the center pixel and the chrominance correction for the center pixel. In an embodiment, the system further comprises: means for identifying blocks in the digital image for processing by the means for assigning weights and generating chrominance corrections. In an embodiment, the system further comprises means for acquiring a digital image coupled to the input. 
         [0022]    In an embodiment, a computer-readable medium comprises program code that causes a computing device to implement a method that includes: identifying a working window around a selected pixel in a digital image; determining a chrominance component for each pixel in the working window around the selected pixel; and selectively, assigning a weight to each pixel in the working window around the selected pixel based on a comparison of the determined chrominance components with a threshold; and adjusting a chrominance component for the selected pixel based on the determined chrominance components and the assigned weights. In an embodiment, determining the chrominance components comprises determining a maximum amplitude of a chrominance gradient. In an embodiment, the method further includes determining the assigned weights based on a product of two fuzzy variables. In an embodiment, assigning the weight to a pixel in the working window around the selected pixel comprises determining whether the pixel is part of an object associated with the selected pixel. In an embodiment, the method further includes identifying blocks in the digital image for the selective assignment and adjusting. 
         [0023]    In an embodiment, a method of processing a digital image for reducing eventual color bleeding effects comprises the step of generating two corrected chrominance components (outputCi,j) of a pixel to be corrected as a weighted mean of respective chrominance values (inputCi,j) of all the pixels of said original image contained in a working window centered on the current pixel, wherein the weights (tap) used in said weighted mean are determined for each pixel of the window different from the central pixel as the product between a first fuzzy variable (ew) and a second fuzzy variable (mw), the value of the first fuzzy variable (ew) having values that decrease when the maximum difference (d) between the chrominance components of the central pixel and of the considered pixel increase, the value of the second fuzzy variable (mw) depending on the amplitude (m) of the chrominance gradient calculated in correspondence of the central pixel; the weight corresponding to the central pixel being one. In an embodiment, the values of said first (ew) and second (mw) fuzzy variables are determined by a decreasing linear function that is null only for values of said maximum difference and of said amplitude if the chrominance gradient smaller of a first (Tew) and second (Tmw) threshold, respectively. In an embodiment, the second threshold (Tmw) is proportional to the arithmetic mean on the whole image of the maximum squares of the chrominance gradients. In an embodiment, the first threshold (Tew) equals a fraction of the maximum value that a pixel of the input image may assume. In an embodiment, the chrominance gradient is obtained by using horizontal and vertical Sobel filters defined on said working window. In an embodiment, the method further comprises the steps of: generating final chrominance components (final_outputCi,j) for said current pixel through a second weighted mean of the respective chrominance components of said pixel of the original image (inputCi,j) and of said corrected chrominance components (outputCi,j), said corrected chrominance components (outputCi,j) being weighted with the one&#39;s complement of the weight (ow) for the chrominance components of said pixel of the original image (inputCi,j), said weight being determined through the following steps: defining a third fuzzy variable (cw) in function of the maximum squared amplitude of the gradients of the chrominance components (MAX(MagCb, MagCr)) in correspondence of the current pixel (i,j), defining a fourth fuzzy variable (lw ) in function of the squared amplitude of the luminance gradient (MagY) in correspondence of the current pixel (i,j), said weight (ow) being equal to the smallest of the values of said third (cw) and fourth (lw) fuzzy variables in correspondence of the current pixel (i,j). In an embodiment, the third (cw) and fourth (lw) fuzzy variables are defined by increasing membership functions equal to: one, for values of the maximum square of amplitudes of the gradients of chrominance components (MAX(MagCb, MagCr)) and of the maximum amplitude of the luminance gradient (MagY) larger than respective thresholds third (TC+AC) and fourth (TY+AY), respectively; zero, for values of the maximum square of amplitudes of the gradients of chrominance components (MAX(MagCb, MagCr)) and of the squared amplitude of the luminance gradient (MagY) smaller than respective thresholds fifth (TC−AC) and sixth (TY−AY), respectively. In an embodiment, the membership functions are linear between said third threshold (TC+AC) and said fifth threshold (TC−AC) and between said fourth threshold (TY+AY) and sixth threshold (TY−AY), respectively. In an embodiment, the mean values (TC, TY) between the thresholds third (TC+AC) and fifth (TC−AC) and between the thresholds fourth (TY+AY) and sixth (TY−AY) are respectively proportional to the arithmetic mean (MeanC) on the whole image of the maximum squared chrominance gradients and to the arithmetic mean (MeanY) on the whole image of the square of the amplitude of the luminance gradient (MagY); the differences between the thresholds third (TC+AC) and fifth (TC−AC) and between the thresholds (TY+AY) and sixth (TY−AY) are a fraction of the corresponding mean values (TC, TY). In an embodiment, the method comprises the step of identifying blocks of pixels of said image that are potentially corrupted by color bleeding through the steps of: calculating for each macroblock of said image to be processed a first arithmetic mean (MeanC) on the whole image of the maximum squares of the chrominance gradients and a second arithmetic mean (MeanY) on the whole image of the squared amplitude of the luminance gradient (MagY), comparing the amplitude of chrominance and luminance gradients in correspondence of each pixel with respective seventh and eighth thresholds determined in function of said first (MeanC) and second (MeanY) arithmetic means, judging the current block as a block potentially affected by color bleeding in function of the results of comparisons carried out at the previous point; reducing color bleeding effects by carrying out the method steps only on blocks potentially affected by color bleeding identified at the previous step. In an embodiment, the seventh and eighth thresholds are proportional to said first (MeanC) and second (MeanY) arithmetic mean. In an embodiment, the current macroblock is judged potentially affected by color bleeding if the amplitude of at least a chrominance gradient of any pixel of the macroblock exceeds the seventh threshold. In an embodiment, the current macroblock is judged potentially affected by color bleeding if at the same time the amplitude of the chrominance gradient of any pixel of the macroblock exceeds the eighth threshold. In an embodiment, the method comprises the step of calculating said chrominance gradients on the image of the video sequence that precedes the image to be processed. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
         [0024]    The patent or application file contains at least one drawing executed in color. Copies of the patent or patent application publication with color drawings will be provided by the Office upon request and payment of the necessary fee. 
           [0025]      FIG. 1  illustrates how the color bleeding phenomenon is generated. 
           [0026]      FIG. 2   a  is an image of a video sequence (referred as “table”). 
           [0027]      FIGS. 2   a ′ and  2   a ″ show details of the image of  FIG. 2   a.    
           [0028]      FIG. 2   b  is a replica of the image of  FIG. 2   a  coded according to the 114kbit/s MPEG4 standard, at 15 fps. 
           [0029]      FIGS. 2   b ′ and  2   b ″ show details of the image of  FIG. 2   b  corresponding to those of  FIGS. 2   a ′ and  2   a″.    
           [0030]      FIG. 3   a  is an image of a video sequence (referred as “weather”). 
           [0031]      FIGS. 3   a ′ and  3   a ″ show details of the image of  FIG. 3   a.    
           [0032]      FIG. 3   b  is a replica of the image of  FIG. 3   a  coded according to the 114 kbit/s MPEG4 standard, at 15 fps. 
           [0033]      FIGS. 3   b ′ and  3   b ″ show details of the image of  FIG. 3   b  corresponding to those of  FIGS. 3   a ′ and  3   a″.    
           [0034]      FIG. 4   a  is an image of a video sequence (referred as “synthetic 2 ”). 
           [0035]      FIGS. 4   a ′ and  4   a ″ show details of the image of  FIG. 4   a.    
           [0036]      FIG. 4   b  is a replica of the image of  FIG. 4   a  coded according to the 114 kbit/s MPEG4 standard, at 15 fps. 
           [0037]      FIGS. 4   b ′ and  4   b ″ show details of the image of  FIG. 4   b  corresponding to those of  FIGS. 4   a ′ and  4   a″.    
           [0038]      FIG. 5  shows blocks of pixels (grey shaded) used in a prior art method for correcting blocks A, B, C and D affected by color bleeding. 
           [0039]      FIG. 6  illustrates an embodiment for correcting image blocks affected by color bleeding in a video sequence. 
           [0040]      FIG. 7  depicts a 8×8 luminance block and two 4×4 chrominance blocks Cb and Cr that compose an image macroblock. 
           [0041]      FIG. 8  schematically illustrates an embodiment of a method of calculation a maximum square of the amplitude of the luminance gradient in a 2×2 sub-block of the luminance block. 
           [0042]      FIG. 9  schematically illustrates an embodiment of a method of calculating the maximum square of the chrominance gradient from two 1×1 sub-blocks of the chrominance blocks Cb and Cr. 
           [0043]      FIG. 10  depicts image blocks of  FIG. 2   a  that could be affected by color bleeding. 
           [0044]      FIG. 11  is a graph of a sample membership function for the fuzzy variables ew and mw. 
           [0045]      FIG. 12  is a graph of sample membership functions for the fuzzy variables cw and lw. 
           [0046]      FIG. 13  is a graph of a membership function for the fuzzy variables cw and lw. 
           [0047]      FIG. 14  compares the image of  FIG. 2   a  and the details of  FIGS. 2   a ′ and  2   a ″ with the corresponding corrected image ( 14   b ) and the corresponding details ( 14   b ′ and  14   b ″). 
           [0048]      FIG. 15  compares the image of  FIG. 3   a  and the details of  FIGS. 3   a ′ and  3   a ′ with the corresponding corrected image ( 15   b ) and the corresponding details ( 15   b ′ and  15   b ″). 
           [0049]      FIG. 16  compares the image of  FIG. 4   a  and the details of  FIGS. 4   a ′ and  4   a ″ with the corresponding corrected image ( 16   b ) and the corresponding details ( 16   b ′ and  16   b ″). 
           [0050]      FIGS. 17 and 18  show PSNR graphs of the chrominance channels Cb and Cr, respectively, for each of the 300 images of the video sequence “table” before and after processing them according to an embodiment of a method. 
           [0051]      FIGS. 19 and 20  show PSNR graphs of the chrominance channels Cb and Cr, respectively, for each of the 300 images of the video sequence “weather” before and after processing them according to an embodiment of a method. 
           [0052]      FIGS. 21 and 22  show PSNR graphs of the chrominance channels Cb and Cr, respectively, for each of the 22 images of the video sequence “synthetic 2 ” before and after processing them according to an embodiment of a method. 
           [0053]      FIG. 23   a  is a static image (referred as “pool”) coded at 0.8 bpp. 
           [0054]      FIGS. 23   a ′ and  23   a ″ show details of the image of  FIG. 23   a.    
           [0055]      FIG. 23   b  is the image of  FIG. 23   a  processed according to an embodiment of a method. 
           [0056]      FIGS. 23   b ′ and  23   b ″ show details of the image of  FIG. 23   b  corresponding to those of  FIGS. 23   a ′ and  23   a″.    
           [0057]      FIG. 24   a  is a static image (referred as “Macbeth”) coded at 0.6 bpp. 
           [0058]      FIGS. 24   a ′ and  24   a ″ show details of the image of  FIG. 24   a.    
           [0059]      FIG. 24   b  is the image of  FIG. 24   a  processed according to an embodiment of a method. 
           [0060]      FIGS. 24   b ′ and  24   b ″ show details of the image of  FIG. 24   b  corresponding to those of  FIGS. 24   a ′ and  24   a″.    
           [0061]      FIG. 25   a  is a static image (referred as “kodim 1 ”) coded at 0.4 bpp. 
           [0062]      FIGS. 25   a ′ and  25   a ″ show details of the image of  FIG. 25   a.    
           [0063]      FIG. 25   b  is the image of  FIG. 25   a  processed according to an embodiment of a method. 
           [0064]      FIGS. 25   b ′ and  25   b ″ show details of the image of  FIG. 25   b  corresponding to those of  FIGS. 25   a ′ and  25   a″.    
       
    
    
     DETAILED DESCRIPTION  
       [0065]    A block diagram of an embodiment of a system  600  is illustrated in  FIG. 6 . The system  600  comprises an input  602  for receiving an input frame, a mean Sobel magnitude calculation block or module  604 , an edges detection block  606 , a bleeding MB detection block  608 , a kernel modulation block  610 , an activation function block  612 , and an output  614 . As illustrated, the mean Sobel magnitude calculation module  604  comprises a processor  616  and a memory  618 . The system  600  also comprises a means for acquiring a digital images, which as illustrated is an image sensor  620 . Images may also be acquired from, for example, a memory storing a digital image or a receiver receiving a signal containing a digital image. Embodiments of the system  600  and the various modules of the system  600  may be implemented in a variety of ways, including as a combined system or as separate subsystems. Embodiments may be implemented as discrete circuitry, one or more microprocessors, digital signal processors (DSP), application-specific integrated circuits (ASIC), or the like, or as a series of instructions stored in a memory and executed by a controller, or various combinations of the above. In some embodiments, separately described sub-modules may be combined. 
         [0066]    An embodiment of a method of processing images of video sequences will be described with respect to the embodiment of the system  600  illustrated in  FIG. 6 . The blocks bordered by dotted rectangles symbolize modules or operations that may often be omitted in some embodiments. 
         [0067]    The image to be processed is subdivided into macroblocks, each macroblock being composed, for example, of a 3×8 block of luminance Y and by two blocks 4×4 of chrominance, respectively Cb and Cr ( FIG. 7 ). In correspondence of each pixel of the luminance block and of the chrominance blocks Cb and Cr, horizontal and vertical components S x  and S y  of the luminance and chrominance gradients using horizontal and vertical Sobel filters (MEAN SOBEL MAGNITUDE CALCULATION): 
         [0000]    
       
         
           
             
               S 
               x 
             
             = 
             
               
                 
                   [ 
                   
                     
                       
                         
                           - 
                           1 
                         
                       
                       
                         0 
                       
                       
                         1 
                       
                     
                     
                       
                         
                           - 
                           2 
                         
                       
                       
                         0 
                       
                       
                         2 
                       
                     
                     
                       
                         
                           - 
                           1 
                         
                       
                       
                         0 
                       
                       
                         1 
                       
                     
                   
                   ] 
                 
                  
                 
                     
                 
                  
                 and 
                  
                 
                     
                 
                  
                 
                   S 
                   y 
                 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         - 
                         1 
                       
                     
                     
                       
                         - 
                         2 
                       
                     
                     
                       
                         - 
                         1 
                       
                     
                   
                   
                     
                       0 
                     
                     
                       0 
                     
                     
                       0 
                     
                   
                   
                     
                       1 
                     
                     
                       2 
                     
                     
                       1 
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0000]    respectively, are calculated by Mean Sobel Calculation block  604 . 
         [0068]    Then the square of the amplitudes Mag y (x,y), Mag Cb (x,y), Mag Cr (x,y) of these gradients of luminance Y and of chrominance Cb and Cr, respectively, are calculated. 
         [0069]    The mean value MeanY and MeanC of the squares of the luminance and chrominance amplitudes for the whole image may be calculated using the following formulas: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       MeanY 
                       = 
                       
                         
                           ∑ 
                           
                             
                               Mag 
                               Y 
                             
                              
                             
                               ( 
                               
                                 x 
                                 , 
                                 y 
                               
                               ) 
                             
                           
                         
                         
                           YWidth 
                           * 
                           YHeight 
                         
                       
                     
                     ; 
                   
                    
                   
                     
 
                   
                    
                   
                     MeanC 
                     = 
                     
                       
                         ∑ 
                         
                           MAX 
                            
                           
                             ( 
                             
                               
                                 
                                   Mag 
                                   Cr 
                                 
                                  
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                   
                                   ) 
                                 
                               
                               , 
                               
                                 
                                   Mag 
                                   Cb 
                                 
                                  
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                   
                                   ) 
                                 
                               
                             
                             ) 
                           
                         
                       
                       
                         CWidth 
                         * 
                         CHeight 
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    wherein 
         [0070]    YWidth=width of the image of the luminance component; 
         [0071]    YHeight=height of the image of the luminance component; 
         [0072]    CWidth=width of the image of the chrominance component; 
         [0073]    CHeight=height of the image of the chrominance component; 
         [0074]    MAX(a, b)=maximum value between the two values a and b. 
         [0075]    The 8×8 luminance block Y is subdivided into 2×2 sub-blocks ( FIG. 7 ) and for each 2×2 sub-block the maximum amplitude Mag YMAX  of luminance gradient is determined, as illustrated in  FIG. 8 . Moreover, for each pixel of the chrominance blocks Cb and Cr the maximum amplitude Mag CMAX  of the chrominance gradient is determined. These values are used by successive blocks or in the successive steps for correcting color bleeding defects. 
         [0076]    Two chrominance components Cb and Cr of each pixel of the current macroblock (KERNEL MODULATION) are obtained by determining a working window of a selected size centered on the current pixel and by calculating the chrominance components outputC i,j  of the pixel (i,j) by carrying out a weighted mean of the respective chrominance components inputC i+u,j+v  of all the pixels of the window, as defined in the following formula: 
         [0000]    
       
         
           
             
               
                 
                   
                     outputC 
                     
                       i 
                       , 
                       j 
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         u 
                         = 
                         
                           - 
                           2 
                         
                       
                       
                         u 
                         = 
                         
                           - 
                           2 
                         
                       
                     
                      
                     
                         
                     
                      
                     
                       
                         ∑ 
                         
                           v 
                           = 
                           
                             - 
                             2 
                           
                         
                         
                           v 
                           = 
                           2 
                         
                       
                        
                       
                           
                       
                        
                       
                         
                           inputC 
                           
                             
                               i 
                               + 
                               u 
                             
                             , 
                             
                               j 
                               + 
                               v 
                             
                           
                         
                         * 
                         
                           tap 
                           
                             u 
                             , 
                             v 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     2 
                      
                     a 
                   
                   ) 
                 
               
             
           
         
       
     
         [0077]    In the previous example, the case in which the working window is a 5×5 window has been considered, but it is possible to use also a 3×3 working window or even of different size. 
         [0078]    Each weight tap u,v , may be obtained as the product of two fuzzy variables ew i+u,j+v  and mw i+u,j+v : 
         [0000]        tap   u,v   =ew   i+u,j+v   *mw   i+u,j+v    (2b) 
         [0000]    the value of which is determined with the fuzzy rules defined in function of the maximum module of chrominance variation, of the square of the amplitude of the chrominance gradient Mag(i,j) in the central pixel and of two thresholds. The variable ew i+u,j+v  assumes nonnull values if in the working window there are chrominance variations smaller than a first threshold T ew , that are null if the first threshold T ew  is exceeded. The variable mw i+u,j+v  is 1 for coordinates (i,j) of the central pixel of the window, while for the other pixels of the working window (i+u, j+v) assumes nonnull values if the square of the amplitude of the gradient in correspondence of the central pixel does not exceed a second threshold T mw , null values if the second threshold T mw  is exceeded. 
         [0079]    The fuzzy variable ew may be chosen such to be substantially null for the pixels (i+u, j+v) of the working windows that belong to a different object from that to which the central pixel belongs, such to preserve the contours of the various depicted objects. Indeed, pixels of different objects have substantially different chrominance levels, while neighboring pixels belonging to a same object will have chrominance values very close one to the other. 
         [0080]    The fuzzy variable mw determines a null weight to the chrominance value Cb or Cr of those pixels (i+u, j+v) of the working window different from the central pixel (i,j) if in correspondence of the central pixel the square of the chrominance gradient is larger than a second threshold, such to make larger the correction carried out in homogeneous regions. Indeed, if the central pixel belongs to an homogeneous zone, the chrominance gradients in correspondence thereof will be relatively small. 
         [0081]    The weight tap is the product between the two fuzzy variables ew and mw, thus it is relatively large for the pixels of the working window (i+u, j+v) belonging to the same object of the central pixel (i,j) and is null for pixels (i+u, j+v) belonging to different objects. 
         [0082]    The two fuzzy variable ew and mw are modeled with a triangular membership function for simplifying calculations, like the membership function depicted in  FIG. 11  and described by the following equations: 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             
                               ew 
                               
                                 
                                   i 
                                   + 
                                   u 
                                 
                                 , 
                                 
                                   j 
                                   + 
                                   v 
                                 
                               
                             
                             = 
                             
                               Triangular 
                                
                               
                                 ( 
                                 
                                   
                                     T 
                                     ew 
                                   
                                   , 
                                   d 
                                 
                                 ) 
                               
                             
                           
                         
                       
                       
                         
                           
                             d 
                             = 
                             
                               MAX 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       
                                         input 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         Cr 
                                       
                                       - 
                                       
                                         input 
                                         
                                           
                                             i 
                                             + 
                                             u 
                                           
                                           , 
                                           
                                             j 
                                             + 
                                             v 
                                           
                                         
                                         Cr 
                                       
                                     
                                      
                                   
                                   , 
                                   
                                      
                                     
                                       
                                         input 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         Cb 
                                       
                                       - 
                                       
                                         input 
                                         
                                           
                                             i 
                                             + 
                                             u 
                                           
                                           , 
                                           
                                             j 
                                             + 
                                             v 
                                           
                                         
                                         Cb 
                                       
                                     
                                      
                                   
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       { 
                       
                         
                           
                             
                               
                                 mw 
                                 
                                   
                                     i 
                                     + 
                                     u 
                                   
                                   , 
                                   
                                     j 
                                     + 
                                     v 
                                   
                                 
                               
                               = 
                               
                                 { 
                                 
                                   
                                     
                                       
                                         Triangular 
                                          
                                         
                                           ( 
                                           
                                             
                                               T 
                                               mw 
                                             
                                             , 
                                             m 
                                           
                                           ) 
                                         
                                       
                                     
                                     
                                       
                                         if 
                                          
                                         
                                             
                                         
                                          
                                         
                                           ( 
                                           
                                             u 
                                             ≠ 
                                             
                                               0 
                                                
                                               
                                                   
                                               
                                                
                                               and 
                                                
                                               
                                                   
                                               
                                                
                                               v 
                                             
                                             ≠ 
                                             0 
                                           
                                           ) 
                                         
                                       
                                     
                                   
                                   
                                     
                                       1 
                                     
                                     
                                       otherwise 
                                     
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               m 
                               = 
                               
                                 Mag 
                                  
                                 
                                   ( 
                                   
                                     i 
                                     , 
                                     j 
                                   
                                   ) 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0083]    After reviewing the specification, any skilled person will recognize that it is possible to choose a different membership function that assigns a null weight or a very small weight to chrominance values of pixels of different objects and a relatively large weight to pixels close to the considered one and that belong to the same displayed objects. 
         [0084]    The thresholds may be chosen as defined by the following equations: 
         [0000]    
       
         
           
               
             
               { 
               
                 
                   
                     
                       
                         T 
                         ew 
                       
                       = 
                       
                         K 
                         ew 
                       
                     
                   
                 
                 
                   
                     
                       
                         T 
                         mw 
                       
                       = 
                       
                         
                           K 
                           mw 
                         
                         * 
                         MeanC 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    with K ew =64 and K mw =1. 
         [0085]    An advantage due to the use of equations (2a) and (2b) is in that the image is locally processed at pixel level, whilst for example the methods disclosed in F. X. Coudoux, M. G. Gazalet, and P. Corlay, “An adaptive post-processing technique for the reduction of color bleeding in DCT coded images,” IEEE Transaction on Circuits Systems for Video Technology, Vol. 14, No. 1 (January 2004) and F. X. Coudoux, M. G. Gazalet and P. Corlay, “A DCT Domain Postprocessor For Color Bleeding Removal”, Proceedings of the 2005 European Conference on Circuit Theory and Design (28 Aug.-2 Sep. 2005) operate on blocks affected by color bleeding by correcting them using neighboring blocks. With an embodiment using equations 2a and 2b, pixels inside a chrominance block that are differently affected by color bleeding will be treated differently. This is due to the fact that the weights in equation (2a) are determined through fuzzy rules, the antecedents of which assume values that depend on chrominance values of the considered pixel and of neighboring pixels. 
         [0086]    By contrast, with the known methods, for example those disclosed in the references identified in the previous paragraph, pixels belonging to the same block are corrected in the same way even if they are differently affected by color bleeding. 
         [0087]    According to an embodiment of a method, the chrominance values outputC i,j  obtained with equation (2a) are further corrected with a second weighted mean (ACTIVATION FUNCTION) of the values outputC i,j  and inputC i,j  using weights the value of which is defined by a fuzzy variable ow i,j  determined in function of the maximum square of the amplitude of chrominance and luminance gradients in correspondence of the central pixel (i,j) of the working window and of other two thresholds T Y  and T C . 
         [0088]    The weight ow i,j  is fixed as follows. The 8×8 luminance block ( FIG. 7 ) is subdivided in 2×2 sub-blocks ( FIG. 8 ) and the maximum square Mag Y  of the amplitude of the luminance gradient for the pixels of each 2×2 sub-block is determined. The 4×4 chrominance blocks Cb and Cr are considered and for each pixel the corresponding maximum square Mag C  of the amplitude of chrominance gradients Cb and Cr is determined ( FIG. 9 ). 
         [0089]    As depicted in  FIG. 12 , the fuzzy variable ow i,j  is determined by choosing the minimum between two auxiliary fuzzy variables cw i,j  and lw i,j  described by a trapezoidal membership function, the value of each auxiliary fuzzy variable cw i,j  and lw i,j  being determined in function of the values Mag Y  and Mag C  ( FIGS. 8 and 9 ) for the considered pixel (i,j). 
         [0090]    In an embodiment, the chrominance values of the corrected pixels may be determined with the following equation: 
         [0000]      final_output C   i,j =(1.0 −ow   i,j )*output C   i,j   +ow   i,j *input C   i,j    (4) 
         [0091]    It is convenient to use also equation (4) and not only equation (2a) to reduce blurring of border pixels between two displayed objects. Tests carried out by the present applicant showed that there are relatively large luminance and chrominance gradients in correspondence of pixels of edges of depicted objects. If thus both luminance and chrominance gradients are relatively large, this means that a border is close to the considered pixel and the chrominance components final_outputC i,j  of the corrected pixel are almost equal to the chrominance components inputC i,j  of the original pixel. 
         [0092]    According to an embodiment, the thresholds T Y  and T C  are proportional to the luminance and chrominance averages MeanY and MeanC, respectively: 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             T 
                             Y 
                           
                           = 
                           
                             
                               K 
                               Y 
                             
                             * 
                             MeanY 
                           
                         
                       
                     
                     
                       
                         
                           
                             T 
                             C 
                           
                           = 
                           
                             
                               K 
                               C 
                             
                             * 
                             MeanC 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0093]    In an embodiment, the trapezoidal membership function of the two auxiliary fuzzy variables cw i,j  and lw i,j  is defined as shown in  FIG. 13 , wherein: 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             T 
                             Y 
                           
                           = 
                           
                             
                               K 
                               Y 
                             
                             * 
                             FI 
                             * 
                             MeanY 
                           
                         
                       
                     
                     
                       
                         
                           
                             A 
                             Y 
                           
                           = 
                           
                             
                               T 
                               Y 
                             
                             / 
                             20 
                           
                         
                       
                     
                     
                       
                         
                           
                             T 
                             C 
                           
                           = 
                           
                             
                               K 
                               C 
                             
                             * 
                             FI 
                             * 
                             MeanC 
                           
                         
                       
                     
                     
                       
                         
                           
                             A 
                             C 
                           
                           = 
                           
                             
                               T 
                               C 
                             
                             / 
                             20 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0094]    In an embodiment, the described method is executed on all pixels of the image. Indeed, besides correcting the undesired color blurring effects, the method of this invention surprisingly reduces also chromatic artifacts such as aliasing, blocking, noise, without introducing any kind of artifact, independently from eventual subsampling and from quantization. 
         [0095]    With the method of an embodiment it is possible to reduce or eliminate color bleedings without preventively discriminating blocks that are potentially affected or not affected by color bleeding. If it is too onerous to carry out the method on all image blocks, it is possible to select only some of the macroblocks that potentially can be affected by color bleeding, through the operations EDGE DETECTION and BLEEDING MB DETECTION illustrated in  FIG. 6 . 
         [0096]    Tests carried out by the applicant showed that, if the method of an embodiment is used a discrimination among the various blocks is no longer a critical operation. As a matter of fact, with an embodiment of a method, considering a macroblock as potentially affected by color bleeding when it is not does not adversely affect the quality of the relative image portion. 
         [0097]    The operation of edge detection EDGE DETECTION consists in locating all pixels of each macroblock in correspondence of which there are relatively large luminance and/or chrominance gradients. 
         [0098]    As indicated in the following equations, 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       Mark 
                       Y 
                     
                      
                     
                       ( 
                       pixel 
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           1 
                         
                         
                           
                             
                               
                                 Mag 
                                 Y 
                               
                                
                               
                                 ( 
                                 pixel 
                                 ) 
                               
                             
                             &gt; 
                             
                               T 
                               Y 
                             
                           
                         
                       
                       
                         
                           0 
                         
                         
                           otherwise 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       Mark 
                       C 
                     
                      
                     
                       ( 
                       pixel 
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           1 
                         
                         
                           
                             
                               
                                 
                                   
                                     
                                       
                                         Mag 
                                         Cr 
                                       
                                        
                                       
                                         ( 
                                         pixel 
                                         ) 
                                       
                                     
                                     &gt; 
                                     
                                       
                                         T 
                                         C 
                                       
                                        
                                       
                                           
                                       
                                        
                                       or 
                                     
                                   
                                    
                                   
                                       
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       Mag 
                                       Cb 
                                     
                                      
                                     
                                       ( 
                                       pixel 
                                       ) 
                                     
                                   
                                   &gt; 
                                   
                                     T 
                                     C 
                                   
                                 
                               
                             
                           
                         
                       
                       
                         
                           0 
                         
                         
                           otherwise 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0000]    the gradients the squared amplitude of which exceeds a corresponding threshold, that in the example of equations (7) (8) are the already used thresholds T Y  and T C , are considered large. With equations (7) and (8), all pixels near borders (contours of objects of the scene) are located, because in presence of contours there are large gradients of luminance and/or chrominance. 
         [0099]    If a macroblock contains at least a pixel located with the operation EDGE DETECTION, it is selected with the operation BLEEDING MB DETECTION. This operation, described by equations (7) and (8), locates a macroblock the pixels of which may be corrected with the algorithm illustrated above if a chrominance and/or luminance gradient exceeds the corresponding threshold, which may be pre-established. 
         [0100]    Tests showed that relevant chrominance gradients are not always present where there are relevant luminance gradients. For this reason, macroblocks to be treated are preferably located only if they contain at least a pixel to which a relatively large chrominance gradient is associated. 
         [0101]      FIG. 10   a  depicts an image affected by color bleeding, while  FIG. 10   b  depicts the same image in which the blocks to be treated with the method of this invention, located with the EDGE DETECTION and BLEEDING MB DETECTION operations, are highlighted. 
         [0102]    Embodiments of methods of this invention may be implemented both on static images and on images of a video sequence. 
         [0103]    In an embodiment, as schematically indicated in  FIG. 6 , for speeding up the processing of an image of a video sequence, luminance and chrominance gradients are calculated by applying the Sobel filters on the image (t- 1 ) that immediately precedes the currently processed image (t). 
         [0104]    Tests carried out on different images produced optimal results both in terms of pleasantness of the corrected image and in terms of PSNR.  FIGS. 14 ,  15 ,  16 ,  23 ,  24  and  25  compare static images or images of a sequence to be processed and the corresponding images processed according to the method of this invention. 
         [0105]      FIGS. from 17 to 22  are diagrams that depict the relevant increment of the PSNR obtained with the method of this invention for the chrominance components. 
         [0106]    The following Table 1 provides values of the PSNR for a set of tests of video sequences: 
         [0000]    
       
         
               
               
               
               
             
               
               
               
               
               
               
               
               
             
               
               
               
               
               
               
               
               
             
           
               
                 TABLE 1 
               
             
             
               
                   
               
               
                 Sequence 
                 kbit/s@ 
                 PSNR Cr Component 
                 PSNR Cb Component 
               
             
          
           
               
                 (QP = 15) 
                 15fps 
                 Decoded 
                 Debleeded 
                 Enhanced 
                 Decoded 
                 Debleeded 
                 Enhanced 
               
               
                   
               
             
          
           
               
                 Cheers 
                 400 
                 30.24 
                 30.33 
                 0.09 
                 31.51 
                 31.98 
                 0.46 
               
               
                 Children 
                 189 
                 30.366 
                 30.72 
                 0.06 
                 31.23 
                 31.37 
                 0.14 
               
               
                 Foreman 
                 116 
                 35.60 
                 35.74 
                 0.15 
                 38.43 
                 38.54 
                 0.11 
               
               
                 kitchgrass 
                 156 
                 37.11 
                 37.37 
                 0.26 
                 37.59 
                 37.78 
                 0.19 
               
               
                 lab1 
                 507 
                 35.51 
                 38.94 
                 0.44 
                 35.34 
                 35.53 
                 0.19 
               
               
                 lab2 
                 493 
                 36.67 
                 36.97 
                 0.30 
                 37.07 
                 37.56 
                 0.49 
               
               
                 Paris 
                 122 
                 31.68 
                 31.96 
                 0.29 
                 31.65 
                 31.89 
                 0.24 
               
               
                 Renata 
                 314 
                 36.59 
                 36.83 
                 0.25 
                 36.44 
                 36.63 
                 0.19 
               
               
                 synthetic1 
                 208 
                 40.92 
                 40.99 
                 0.07 
                 40.47 
                 41.24 
                 0.78 
               
               
                 synthetic2 
                 536 
                 35.66 
                 36.00 
                 0.34 
                 36.12 
                 36.64 
                 0.51 
               
               
                 Table 
                 122 
                 37.47 
                 37.57 
                 0.10 
                 36.00 
                 36.10 
                 0.10 
               
               
                 Tempete 
                 293 
                 32.85 
                 33.02 
                 0.17 
                 35.28 
                 35.72 
                 0.44 
               
               
                 Weather 
                 114 
                 29.25 
                 29.29 
                 0.04 
                 29.83 
                 31.30 
                 1.47 
               
               
                   
               
             
          
         
       
     
         [0107]    The following Table 2 refers to static images: 
         [0000]                                                                                                    TABLE 2                   Image   Size   PSNR Cr Component   PSNR Cb Component            0.8 bpp   W × H   Decoded   Debleeded   Enhanced   Decoded   Debleeded   Enhanced                    baboon   512 × 512   29.35   29.46   0.11   30.04   30.21   0.18       Fruits   640 × 480   34.83   35.17   0.34   36.84   37.25   0.41       Kodim1   768 × 512   39.95   40.30   0.35   40.94   41.41   0.47       Kodim2   768 × 512   39.27   39.76   0.48   39.46   39.80   0.34       Kodim3   768.512   39.91   40.13   0.22   41.64   41.72   0.09       Kodim4   768 × 512   41.40   41.71   0.31   36.83   36.99   0.16       Lena   512 × 512   31.89   32.08   0.19   33.39   33.55   0.17       macbeth   640 × 480   37.29   38.41   1.13   38.17   39.02   0.86       newspaper   640 × 480   38.22   38.45   0.23   36.20   36.30   0.10       Pool   640 × 480   38.40   38.68   0.27   36.40   36.84   0.44                    
PSNR is relevantly increased.
 
         [0108]    The following Table 3 provides the numbers and the type of operations executed for implementing the algorithm of this invention. 
         [0000]    
       
         
               
               
               
             
               
               
               
               
               
               
               
               
               
               
               
             
               
               
               
               
               
               
               
               
               
               
               
             
           
               
                   
                 TABLE 3 
               
             
             
               
                   
                   
               
               
                   
                 LUMA (channel Y) 
                 CHROMA (channels Cr and Cb) 
               
             
          
           
               
                 Operation per pixel 
                 ADD 
                 SHIFT 
                 MUL 
                 DIV 
                 COMP 
                 ADD 
                 SHIFT 
                 MUL 
                 DIV 
                 COMP 
               
               
                   
               
             
          
           
               
                 Mean Sobel Magnitude 
                 14 
                 4 
                 2 
                 0 
                 0 
                 27 
                 8 
                 4 
                 0 
                 1 
               
               
                 Calculation 
               
               
                 Edges Detection 
                 0 
                 0 
                 0 
                 0 
                 4 
                 0 
                 0 
                 0 
                 0 
                 3 
               
               
                 Bleeding MB Detection 
                 0 
                 0 
                 0 
                 0 
                 0 
                 0 
                 0 
                 0 
                 0 
                 2 
               
               
                 Kernel Modulation 
                 0 
                 0 
                 0 
                 0 
                 0 
                 168 
                 0 
                 48 
                 50 
                 145 
               
               
                 Activation Function 
                 0 
                 0 
                 0 
                 0 
                 0 
                 6 
                 0 
                 4 
                 2 
                 5 
               
               
                 TOTAL 
                 14 
                 4 
                 2 
                 0 
                 4 
                 201 
                 8 
                 56 
                 52 
                 156 
               
               
                   
               
             
          
         
       
     
         [0109]    Table 4 is similar to Table 3 but refers to the case of subsampled images  4 : 2 : 0 . 
         [0000]    
       
         
               
               
               
               
               
               
             
           
               
                 TABLE 3 
               
               
                   
               
               
                 Operation per pixel 
                 ADD 
                 SHIFT 
                 MUL 
                 DIV 
                 COMP 
               
               
                   
               
             
             
               
                 TOTALE 
                 64.25 
                 6 
                 16 
                 13 
                 43 
               
               
                   
               
             
          
         
       
     
         [0110]    Embodiments of a method can be conveniently used with any compression algorithm for video sequences or static images that uses the discrete cosine transform (DCT) and whichever the type subsampling is used. 
         [0111]    Embodiments of the systems and methods described herein may be implemented in a variety of ways, including as a combined system or as separate subsystems. Embodiments may be implemented as discrete circuitry, one or more microprocessors, digital signal processors (DSP), application-specific integrated circuits (ASIC), or the like, or as a series of instructions stored in a memory and executed by a controller, or various combinations of the above. In some embodiments, separately described sub-modules may be combined. 
         [0112]    The various embodiments described above can be combined to provide further embodiments. All of the U.S. patents, U.S. patent application publications, U.S. patent applications, foreign patents, foreign patent applications and non-patent publications referred to in this specification and/or listed in the Application Data Sheet, are incorporated herein by reference, in their entirety. Aspects of the embodiments can be modified, if necessary to employ concepts of the various patents, applications and publications to provide yet further embodiments. 
         [0113]    These and other changes can be made to the embodiments in light of the above-detailed description. In general, in the following claims, the terms used should not be construed to limit the claims to the specific embodiments disclosed in the specification and the claims, but should be construed to include all possible embodiments along with the full scope of equivalents to which such claims are entitled. Accordingly, the claims are not limited by the disclosure.