Patent Publication Number: US-6707952-B1

Title: Method for removing ringing artifacts from locations near dominant edges of an image reconstructed after compression

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention is related to the field of digital image processing, and more specifically to filtering to remove ringing artifacts from decompressed images. 
     2. Description of the Related Art 
     Images are stored in arrays of pixels. Each pixel stores a small portion of an image, in the form of image data. The same is true for both static images (such as photographs), and for video sequences. 
     The large volume of image data slows down its transmission. To alleviate the problem, compression techniques are used to reduce the amount of data. Sometimes high compression is used for fastest transmission. 
     A problem arises when a high compression technique is used with insufficient bit rate of transmission. When the image is reconstructed, it includes visual noise, which is also called ringing artifacts. These artifacts are introduced in the places of the image where high spatial frequency DCT (Direct Cosine transform) components are substantially reduced. This occurs also around the dominant edges of the image. 
     The prior art has addressed this problem by applying a de-ringing filter, to remove the artifacts. This approach does not work satisfactorily. Either the artifacts are not removed fully, or the dominant edges are filtered too much. In that case, the dominant edges become so smoothened that they no longer appear as dominant, which detracts from the overall image quality. 
     BRIEF SUMMARY OF THE INVENTION 
     The present invention overcomes these problems and limitations of the prior art. 
     Generally, the present invention provides a method for removing ringing artifacts from locations near dominant edges of a reconstructed image. The invention exploits the fact that artifacts near dominant edges has a direction that can be inferred from a main direction of the dominant edge. The invention teaches to filter the image data on either side of the pixels containing the edge. Filtering is with a special directional de-ringing filter according to the invention, which means that the de-ringing filter has a main direction aligned with the edge direction. 
     It will be appreciated that the dominant edges of the image are therefore not smoothened, since they themselves are not filtered. In addition, the artifacts are eliminated through a single filtering pass, since the directional de-ringing filter of the invention is fundamentally aligned with their main direction. 
     The invention will become more readily apparent from the following Detailed Description, which proceeds with reference to the drawings, in which: 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a flowchart illustrating a method according to the invention. 
     FIG. 2 is a first portion of a flowchart illustrating another method according to the invention. 
     FIG. 3 is a second portion of the flowchart of FIG.  2 . 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT(S) 
     As has been mentioned, the present invention provides methods. The methods of the invention can be implemented by software. 
     Although only two methods are described, that is for illustration. Some of their steps overlap, and a method according to the invention can contain steps of both. 
     Referring now to FIG. 1, a first method of the invention is described. The method is for filtering image data corresponding to an image. The image data are stored in a plurality of pixels. 
     According to a box  110 , base directions are defined for a plane. The base directions are chosen so that any direction belonging in a plane of the image can be described in terms of them. The preferred base directions are the horizontal and the vertical. Any direction in a plane of the image can be described in terms of a percentage of vertical and a percentage of horizontal. 
     In its most general form, the invention can be applied for only one of the base directions, which can be an identified, preset direction of interest. This will cover all dominant edges aligned with the preset direction. The method is preferably repeated with all the base directions, so as to cover all the possible directions of the dominant edges of the image. 
     The whole array of pixels is decomposed into blocks of pixels. The block size is chosen to be small enough to contain only one significant edge, and the associated ringing artifacts near it. A block size that works well is 8×8 pixels. 
     Each block is tested for containing a significant edge. If evidence of a significant edge is found, then the strongest edge is tested for being a dominant image edge. The testing for containing an edge includes using directional edge detection masks. A number of such masks are selected. Each mask has a mask direction associated with a respective one of the base directions. The masks are applied to at least some of the image data. This identifies at least one of the pixels that stores image data corresponding to an image edge, which is aligned with an identified one of the base directions. Since the base direction is known, the dominant edge direction is also known. 
     According to a box  120 , a block of pixels is selected that contains a dominant edge along one of the base directions. Blocks that do not contain a dominant edge are inferred to not contain ringing artifacts and are preferably not processed. 
     According to a box  130 , once a block has been identified, then at least one pixel of the block is identified whose unfiltered image data best corresponds to an edge. It is preferred to identify all the pixels of the block whose image data contains the dominant edge. 
     According to a box  140 , even though unfiltered, the image data of the identified pixels is output. This will prevent smoothing of the dominant edge of the image. Once output, it is known that the remaining pixels contain image data that do not include the dominant edge. 
     According to a box  150 , a directional de-ringing filter is selected. The filter is selected to have a main direction that corresponds to the identified base direction. This ensures that the filter&#39;s main direction is also inherently aligned with the direction of the dominant edge of the image. 
     The invention exploits the fact that ringing artifacts have an inherent alignment with the direction of the dominant edge of the image. The selected filter&#39;s main direction will turn out to be aligned with the inherent alignment of the ringing artifacts. 
     According to a box  160 , the selected filter is applied to the image data of at least another one of the pixels. It is preferred to apply it to all the pixels remaining after the operation of box  140 . 
     According to a box  170 , the filtered image data is also output. 
     Referring now to FIGS. 2 and 3, a second method of the invention is described. It is a method for generating filtered image data that correspond to an image, from respective unfiltered image data which are stored in a plurality of respective pixels. The second method resembles the first method in a number of ways. For example, it will be recognized that boxes  210  through  260  can correspond to box  120  of FIG.  1 . 
     According to a box  210 , the next block of pixels is chosen. If this is the beginning of the process, then the first block of pixels is chosen. 
     The processing that follows is for the image data of the pixels of the selected block. 
     According to a box  220 , the image data of at least some of the pixels are filtered, which is also known as convolved, with a horizontal edge detection mask E H . A suitable horizontal edge detection mask E H  is given by Equation (1): 
     
       
           E   H =[−1 0 1]  Equation (1) 
       
     
     Preferably all the pixels of the block are so filtered. This will compute a horizontal edge gradient G H (i,j) for each pixel of the block. 
     According to a box  230 , the absolute values of the individual pixel horizontal edge gradients G H (i,j) are summed. The sum, also known as the horizontal edge content of a horizontal edge C HB  in the block, is given by Equation (2):                C   HB     =       ∑     i   ,   j                   G   H          (     i   ,   j     )                      Equation                   (   2   )                           
     According to boxes  240  and  250 , the same computation is made for the vertical content. More specifically, the image data of at least some of the pixels are filtered, which is also known as convolved, with a vertical edge detection mask E V . A suitable vertical edge detection mask E V  is given by Equation (3):                E   V     =     [           -   1             0           1         ]             Equation                   (   3   )                           
     Preferably all the pixels of the block are filtered according to this method. This will compute a vertical edge gradient G V (i,j) for each pixel of the block. 
     According to a box  250 , the absolute values of the individual pixel vertical edge gradients G V (i,j) are summed. The sum, also known as the vertical edge content of a vertical edge C VB  in the block, is given by Equation (4):                C   VB     =       ∑     i   ,   j                   G   V          (     i   ,   j     )                      Equation                   (   4   )                           
     According to a box  260 , the horizontal edge content of the block C HB  is compared to the vertical edge content C VB  of the block. If C HB  is larger than C VB , then the portion of the image of the image data contained in pixels of the block is classified as containing a horizontal edge. Conversely, if C VB  is larger than C HB , then the portion of the image is classified as containing a vertical edge. 
     Optionally and preferably, a maximum edge content statistic MC is determined. MC is preferably determined as per Equation (5).              MC   =       max     i   ,   j            {              G   H          (     i   ,   j     )            ,                       G   V          (     i   ,   j     )              }               Equation                   (   5   )                           
     According to a box  270 , the maximum edge content statistic MC is compared to a preset smoothness threshold S T . This is equivalent to inquiring whether the strongest edge of the block is a dominant edge of the image. If not, the according to box  280 , the selected block is output as the final block. If yes, then processing continues as per the box  310 . 
     According to a next box  310 , a binary gradients map B(i,j) is generated, according to equation (6).                B        (     i   ,   j     )       =     {         1           if                 max                   ⌊         G   H          (     i   ,   j     )       ,       G   V          (     i   ,   j     )         ⌋       &gt;     Thr   EDGE               0       otherwise                   Equation                   (   6   )                           
     The binary gradients map B(i,j) is for pixels of the block. Computation of some of the values requires using the image data of pixels adjacent to the block. It will be appreciated that each pixel is classified as more horizontal or more vertical, and also larger than a threshold gradient G T . As such, the threshold gradient G T  is different from the threshold smoothness S T  defined above. 
     Similarly to box  130  of FIG. 1, this method also identifies pixels of the block whose image data best correspond to the edge. By this time, it is known that there exists some edge along one of the base directions, and that it is a dominant edge of the image. 
     Referring to box  320 , a threshold sharpness EB is set for each of the pixels of the block, as quantified by the binary gradients map B(i,j). 
     According to box  330 , a filtering mask M×N is determined. Preferably N&gt;=M works better. The larger the M, the more smooth the filtering results. Filtering masks with sizes 3×7, 3×5, 1×7, 1×5, and 3×3 work well. In general, the smaller the image, the smaller the size of the filtering mask should be, so as not to lose the image details. 
     According to box  340 , the filtering mask M×N is applied to the binary gradients map B(i,j) to determine which pixels of the block contained the sharpest edge transition. This is best implemented by using Equation (7).                  ∑         i   -     ⌊     M   /   2     ⌋       ≤   r   ≤     i   +     ⌊     M   /   2     ⌋             j   -     ⌊     N   /   2     ⌋       ≤   s   ≤     j   +     ⌊     N   /   2     ⌋                  B        (     r   ,   s     )         &gt;     E   B             Equation                   (   7   )                           
     Each pixel which satisfies Equation (7) is deemed to have another sharp edge transition. The threshold EB is set low enough so that at least one pixel satisfies Equation (7), and high enough so that at least another one pixel does not. 
     According to box  350 , the pixels that satisfy equation 6 are output without further processing. The remaining pixels are deemed to be non-edge pixels in the block, and to contain the associated ringing artifacts. 
     According to box  360 , a directional filter is selected. The selected filter has a main direction parallel to the direction of the edge, as classified by the operation of box  270 . If the dominant edge direction has transitions along the horizontal direction, then the directional filter L DRH  is used. Use of the filter is by operation of Equation (8) below:                  L   DRH          (     i   ,   j     )       =       mean           i   -     ⌊     M   /   2     ⌋       ≤   r       r   ≤     i   +     ⌊     M   /   2     ⌋                          [           median           j   -     ⌊     N   /   2     ⌋       ≤       s   ≤     j   +     ⌊     N   /   2     ⌋              s             {     L        (     r   ,   s     )       }           ]             Equation                   (   8   )                           
     On the other hand, if the dominant edge direction has transitions along the vertical direction, then the directional filter L DRV  is used. Use of the filter is by operation of Equation (9) below:                  L   DRV          (     i   ,   j     )       =       mean           i   -     ⌊     M   /   2     ⌋       ≤   s       s   ≤     i   +     ⌊     M   /   2     ⌋                          [           median           j   -     ⌊     N   /   2     ⌋       ≤       r   ≤     j   +     ⌊     N   /   2     ⌋              r             {     L        (     r   ,   s     )       }           ]             Equation                   (   9   )                           
     According to box  370 , the image data of the remaining pixels are filtered by the directional filter. According to box  380 , the filtered image data is output. 
     It will be appreciated that, due to the nature of the filter, the invention results in a different mean value for each side of the edge. This phenomenon makes the edge appear a more natural part of the reconstructed image. 
     A person skilled in the art will be able to practice the present invention in view of the description present in this document, which is to be taken as a whole. Numerous details have been set forth in order to provide a more thorough understanding of the invention. In other instances, well-known features have not been described in detail in order not to obscure unnecessarily the invention. 
     While the invention has been disclosed in its preferred form, the specific embodiments thereof as disclosed and illustrated herein are not to be considered in a limiting sense. Indeed, it should be readily apparent to those skilled in the art in view of the present description that the invention can be modified in numerous ways. The inventor regards the subject matter of the invention to include all combinations and subcombinations of the various elements, features, functions and/or properties disclosed herein. 
     The following claims define certain combinations and subcombinations, which are regarded as novel and non-obvious. Additional claims for other combinations and subcombinations of features, functions, elements and/or properties may be presented in this or a related document.