DEVICE AND METHOD FOR FILTERING

Abstract: The invention relates to a method of processing data, which may be pixels (P[i,j]) representing a sequence of pictures, previously encoded and decoded. The method comprises at least in series a first step (ED) of detecting edge pixels within a picture, followed by a subsequent step (TEST) in which a choice is made from the pixels not detected as edges in the previous step, as to whether these pixels are to be filtered or not. Then, the method comprises a filtering step (SAF) which consists in replacing at least a pixel to be filtered with a pixel belonging to a close neighborhood of said pixel, said close neighborhood comprising said pixel and pixels adjacent to said pixel.

Description: DEVICE AND METHOD FOR FILTER ING FIELD OF THE INVENTION The invention relates to a method of processing data which represent a sequence of pictures, previously encoded and decoded. The invention also relates to a filtering device for carrying out such a method. The invention is particularly relevant for the post-processing of a low-bitrate video signal which was previously compressed and decompressed. BACKGROUND ART Coding a sequence of pictures comprises different steps. Each picture is composed of a bidimensional array of picture elements or pixels, each of them having luminance and chrominance components. For encoding purposes, the picture is subdivided into non-overlapping blocks of pixels. A discrete cosine transform (DCT) is applied to each block of the picture. The coefficients obtained from this DCT are rounded to the closest value given by a fixed quantization law and then quantized, depending on the spatial frequency within the block that they represent. The quantized data thus obtained are then coded. During a decoding step, the coded data are successively decoded, treated by inverse quantization and inverse discrete cosine transform, and finally filtered before being displayed. Quantization is, in data transmission, one of the steps for data compression and is a treatment which involves losses. The quantization errors introduced by quantization of the DCT coefficients in the coding have as a main result the occurrence of ringing artifacts. This ringing noise is the Gibb's phenomenon caused by truncation of the high- frequency coefficients through quantization during encoding. Therefore, ringing artifacts occur near high-frequency areas which are located in low activity regions and may appear as "false edges" in the picture. A possible method of removing these ringing artifacts is proposed by Park et al. in IEEE Transactions on CSVT, vol.9, no.l, February 1999, pp 161-171. The disclosed method comprises, for a given picture, a first step of edge detection followed by a low-pass filtering. The edge detection step makes use of a quantized factor QP taken from the encoding stage. Furthermore, the proposed filtering step involves low-pass filtering of the luminance components by means of the derivation of weighted means of a defined set of luminance values. Thus the method proposed by the prior art involves the use of encoding parameters, which might not always be available at the edge detection stage, while the low- pass filtering may introduce blurring effects in areas of the picture where extreme values of luminance can be found. SUMMARY OF THE INVENTION It is an object of the invention to propose an efficient method of processing picture data resulting in a picture of better quality and highly removed from artifacts due to a prior compression of the picture. To this end, a method as described in the introduction comprises at least in series the steps of : detecting edge pixels within a picture, determining pixels to be filtered from among pixels which were not detected as edges in the previous step, replacing at least a pixel to be filtered with a pixel belonging to a close neighborhood of said pixel, said close neighborhood comprising said pixel and pixels adjacent to said pixel. In a method according to the invention, there is a first step of edge detection in order to predict the areas in the picture where ringing is likely to occur. Indeed, ringing effects mainly appear in areas located along edges in a picture. These areas along edges may be filtered without disturbing the picture edges. The pixels belonging to these areas may be corrected by being replaced by an adjacent pixel. An advantage of the proposed correction of pixels to be filtered is the high picture quality because the filter does not introduce annoying blurring effects as does the low-pass filter of the prior art. Another advantage of the invention is that the proposed method does not require any information from a previous treatment applied to the picture data, contrary to the method disclosed by the prior art. Furthermore, a pixel not detected as an edge pixel in the first step of a method according to the invention is not necessarily filtered. A second step is performed in order to determine which pixels may be filtered according to set of criteria. In an embodiment of the invention, at least the pixel to be filtered is replaced with the median pixel of a set having an odd number of pixels which were not detected as edges, the set comprising at least once said pixel and pixels adjacent to said pixel. In this embodiment of the invention, a set is formed for a pixel to be filtered, with an odd number of pixels belonging to a close neighborhood of said pixel. The median filter allows to replace a pixel value which was not detected as an edge with the median pixel value of this set associated with the pixel. Thus, thanks to this median filtering step, any extreme value in the neighborhood of the pixel is removed. In the document of the prior art, extreme pixels in the neighborhood of a pixel are taken into account in the filtering and may have a blurring influence on the filtered pixel. In another embodiment of the invention, the method is applied to the luminance component of the pixels of a picture. The human eye is very sensitive to the luminance component and therefore filtering of the luminance components gives a very high processed picture quality. The invention also relates to a filtering device for carrying out a method according to the invention. The particular aspects of the invention will now be explained with reference to the embodiments described hereinafter and considered in connection with the accompanying drawings, in which: Fig. 1 is a block diagram of the various steps of a method according to the invention, Fig. 2 is a diagram of a pixel neighborhood, Fig. 3 is a block diagram of an edge detection step according to the invention, Fig. 4 gives the matrices used for the edge detection, Fig. 5 shows five neighboring blocks of pixels, Fig. 6 is a block diagram of a step allowing to decide whether a pixel should be filtered according to the invention. A method of processing data according to the invention is depicted in Fig. 1. In this embodiment, the method is applied to successive pixels P[ij]. In this embodiment of the invention, the provided pixels P[iJ] belong to a frame in the spatial domain which was possibly compressed and decompressed in a previous treatment. An edge detection is performed during a step ED for each received pixel P[iJ] and allows to determine whether the received pixel P[ij] is an edge or not. This step of edge detection will be explained in detail in a paragraph below. A pixel P[i,j] detected as an edge during the edge detection step is given an associated value EDG[i,j] of 1. A pixel P[ij] not detected as an edge during the edge detection step is given an associated value EDG[i,j] of 0. If the pixel P[ij] is not detected as an edge, which means EDG[i,j] = 0, the pixel P[iJ] may be filtered in a spatially- adaptive filter SAF. In fact, a pixel P[i,j] not detected as an edge is filtered when additional conditions are satisfied. These additional conditions will be defined in a paragraph below. The decision of filtering a pixel P[i,j] not detected as an edge is taken in a step TEST described below with reference to Fig. 6. If the pixel P[i,j] is detected as an edge, it is not filtered and not modified. Indeed, only pixels along edges, but which are not edges, may be filtered so that picture contours are preserved. Fig. 2 shows a pixel P[i j] belonging to a picture to be processed. This pixel P[ij] is surrounded by eight adjacent pixels {P[i-1 J-l], P[i-l,j], P[i-l,j+l], P[i,j+1], P[i+l,j+l], P[i+l,j], P[i+l,j-l], P[i,j-1]} located in a close neighborhood of the pixel P[ij]. The pixels P[i,j-1], P[i-1 j], P[ij+1], P[i+l,j] will be referred to as the left pixel, the upper pixel, the right pixel and the lower pixel of P[i,j], respectively, hereinafter. A possible way of performing an edge detection step ED according to the invention is depicted in Fig. 3. In this embodiment of the invention, each picture may be divided into non-overlapping blocks of 4x4 pixels, each block having a number N[bck] of detected edges. This proposed step of edge detection ED, in accordance with the invention, is based on the luminance component Y[iJ] of each pixel P[ij]. This is by no means a limitation of the invention and any pixel component may be used as the so-called pixel value in the calculations involved in such a step of edge detection. For each provided pixel P[ij], a horizontal component GH[ij] and a vertical component Gv[i,j] of a gradient G[ij] are evaluated. A possible way of deriving a gradient is to use the Sobel matrices SH and Sv given in Fig. 4. Let us consider a matrix composed of the luminance component Y[ij] of the pixel P[ij] and the luminance components {Y[i-1 j-l], ..., Y[ij-1]} of the eight adjacent pixels {P[i-1 j-l], ..., P[ij-1]} as shown in Fig. 4. The horizontal and vertical components GH[ij], Gv[ij] respectively, of the gradient G[ij] are then derived as convolution products as follows : G H [i,j]= Y *S H G v [i,j] = Y * S v The gradient G[ij] is the modulus of the two components and is worth ■sJG H 2 [i,j]+ Gy[i,j] . A pixel, having a greater gradient than its surrounding pixels, is more likely to be detected as an edge. Thus, as shown in Fig. 3 in a first step 1, the gradient G[ij] is derived for each pixel P[ij] of a picture and a mean Gm of the various obtained gradients is also derived for the whole picture. Then, in a subsequent step 2 and for each provided pixel P[i j], the gradient G[ij] of the pixel P[ij] is compared with the mean Gm. If the gradient G[ij] is lower than half the mean Gm, the corresponding pixel P[ij] is not detected as an edge and EDG[ij] is set to 0. If the gradient G[i j] is greater than half the mean Gm, the pixel P[ij] may be detected as an edge, and the horizontal and vertical components GH[ij], Gv[ij] are compared in turn as described in the next paragraphs. The pixel P[i j] belongs to a horizontal edge if, in a step 3, the horizontal component GH[ij] is greater than the vertical component Gv[ij] and, in a step 4, the gradient G[ij] is greater than both the gradient G[ij-1] of the left pixel P[ij-1] and the gradient G[ij+1] of the right pixel P[ij+1]. In such a case, P[ij] is detected as an edge and EDG[ij] is set to 1 and the number N[bck] of detected edges in the block, to which P[ij] belongs, is incremented. If in the step 4 the horizontal component GH[ij] is greater than the vertical component Gv[ij] and the gradient G[ij] is lower than either the gradient G[ij-1] of the left pixel P[ij-1] or the gradient G[ij+1] of the right pixel P[ij+1], the pixel P[ij] is not detected as an edge, and EDG[i j] is set to 0. The pixel P[ij] belongs to a vertical edge if, in the step 3, the horizontal component GH[ij] is lower than the vertical component Gv[i j] and, in a step 5, the gradient G[ij] is greater than both the gradient G[i-lj] of the upper pixel P[i-1 j] and the gradient G[i+1 j] of the lower pixel P[i+lj]. In such a case, the pixel P[ij] is detected as an edge, EDG[ij] is set to 1 and the number N[bck] of detected edges of the block to which P[ij] belongs is incremented. If in the step 5 the horizontal component GH[i j] is lower than the vertical component Gv[ij] and the gradient G[ij] is greater than either the gradient G[i-lj] of the upper pixel P[i-1 j] or the gradient G[i+1 j] of the lower pixel P[i+1 j], the pixel P[ij] is not detected as an edge and EDG[i j] is set to 0. The proposed edge detection step only provides edges having a width of one pixel at most so that a fine filtering may be performed. In Fig. 5, a block A consisting of 4x4 pixels P[ij] is surrounded by four non- overlapping 4x4 blocks B, C, D, E. Let us consider a pixel P[ij] belonging to the block A, which was not detected as an edge during the edge detection step depicted in Fig. 3 and which may be filtered. Thus a pixel P[ij] may be filtered when EDG[ij] = 0. In an embodiment of the invention, any pixel P[ij] not detected as an edge is not necessarily filtered. Indeed, additional conditions have to be satisfied, as shown in Fig. 6, where operations performed in the TEST unit of Fig. 1 are depicted. Thus, for any pixel P[ij] belonging to the block A and having a value EDG[ij] of 0, the density of detected edges in a defined neighborhood of the pixel P[ij] is taken into account. Thus, for example, a condition is set up for the total amount of edges in the block A and in the neighboring blocks B, C, D, and E. In a step 11, a first condition is tested : the total number of edges in the blocks A, B, C, D, and E must be lower than a predetermined maximum number of edges Nmax. Thus the sum of the numbers of edges N(A), N(B), N(C), N(D), N(E) per block A, B, C, D, E, respectively, must be lower than the defined number Nmax. In the present case, the total number of edges is greater than Nmax : there are too many edges in total in the five blocks A, B, C, D, E, and the pixel P[ij] is not filtered. If the number of edges in the five blocks A, B, C, D, E is not greater than Nmax, some additional conditions are set concerning the minimum number of edges per block in order to decide whether the pixel P[ij] shall be filtered. In subsequent steps 12, 13, 14, 15 and 16 the number of edges per block is compared with a minimum threshold Nmin. At least one of the blocks A, B, C, D, and E must contain at least a minimum number of edges Nmin. If and when all these conditions are satisfied, the choice is made of transmitting the pixel P[ij] to the spatially-adaptive filter SAF for filtering. If not, i.e. the total number of edges in the five blocks A, B, C, D, E is greater than Nmax or none of the blocks contain at least Nmin edges, the pixel P[ij] is not filtered. The order in which the steps 11, 12, 13, 14, 15, 16 are carried out in this embodiment is immaterial ; any other order may be chosen. The predetermined numbers Nmin and Nmax allow to adjust the precision of the method. Nmax is used to prevent the filtering of areas which are too complex and which could lead to degradations when filtered. Nmin will be chosen low enough so that the effect of the method is not reduced. An example of a spatially-adaptive filtering step SAF is given in detail in the following paragraphs. It should be noted that the term SAF may indicate a filtering step as well as a filter. Thus, a possible spatially-adaptive filter SAF replaces the luminance value Y[ij] of the pixel P[ij] with the median value of a corresponding set S[ij]. The set S[ij] associated with the pixel P[ij] may possibly comprise the luminance components Y[ij], Y[i- 1 j], Y[i+1 j], Y[ij-1] and Y[ij+1] of the adjacent pixels P[ij], P[i-1 j], P[i+1 j], P[ij-1] and P[ij+1]. Each luminance component Y[i-lj], Y[i+1 j], Y[ij-1] or Y[ij+1] effectively belongs to the set S[ij] when the associated pixel P[ij] is not detected as an edge. The set S[i j] also comprises the value Y[i j], which may be repeated so that the set S[ij] is composed of an odd number of values. An even number of elements of the set S[ij] would render it necessary to derive the mean of the two median values of the set S[i,j], which would lead to a low-pass filtering. Table 1 gives the composition of the possible sets S[ij] for a given pixel P[ij] to be filtered in dependence on the status of the adjacent pixels P[i-1 j], P[i+1 j], P[ij- 1] > P[i,j+1], i.e. whether these are edge pixels or not. Table 1 It should be noted on Table 1 that, if the number of edges surrounding the pixel P[i ] is greater than 3, the proposed filtering pattern is inactive for the pixel P[ij], which is kept unmodified. The proposed filtering pattern allows to eliminate any possible extreme value of the luminance component of a pixel belonging to the set S[ij]. Besides, since there is no low-pass filtering in the described filtering pattern, no blurring effect is introduced into the picture. It is to be noted on the described coding method that modifications or improvements may be proposed without departing from the scope of the invention. For instance, it is clear that this processing method can be implemented in several manners, such as by means of wired electronic circuits or, alternatively, by means of a set of instructions stored in a computer-readable medium, said instructions replacing at least part of said circuits and being executable under the control of a computer or a digital processor in order to carry out the same functions as fulfilled in said replaced circuits. The invention then also relates to a storage medium comprising a software module for storing a set of instructions executable under the control of a computer or a processor and provided for performing at least some of the steps of the processing method. The blocks in Fig. 1, Fig. 3 and Fig. 6, represent both a step of a method according to the invention and a processing circuit of a general filtering device for performing such a step. It is to be noted in this text that the use of the verb "comprise" does not exclude the presence of other elements or steps than those listed in a claim.

Claims: CLAIMS: 1. Method of processing data which represent a sequence of pictures, previously encoded and decoded, comprising at least in series the steps of : - detecting edge pixels within a picture, - determining pixels to be filtered from among pixels which were not detected as edges in the previous step, - replacing at least a pixel to be filtered with a pixel belonging to a close neighborhood of said pixel, said close neighborhood comprising said pixel and pixels adjacent to said pixel. 2. A method of processing data as claimed in claim 1, wherein at least the pixel to be filtered is replaced with the median pixel of a set having an odd number of pixels which were not detected as edges, the set comprising at least once said pixel and pixels adjacent to said pixel. 3. A method of processing data as claimed in claim 1, wherein the method is applied to the luminance component of the pixels of said picture. 4. A method of processing data as claimed in claim 1, wherein a pixel is detected as an edge pixel if a magnitude representative of a gradient of the pixel is greater than a predetermined threshold. 5. A method of processing data as claimed in claim 4, wherein a pixel is detected as an edge pixel if the horizontal component of a gradient of said pixel is greater than the vertical component of said gradient and if the modulus of said gradient is greater than both the modulus of the gradient of the adjacent pixel on the left and the modulus of the gradient of the adjacent pixel on the right. 6. A method of processing data as claimed in claim 4, wherein a pixel is detected as an edge pixel if the vertical component of a gradient of said pixel is greater than the horizontal component of said gradient and if the modulus of said gradient is greater than both the modulus of the gradient of the adjacent lower pixel and the modulus of the gradient of the adjacent upper pixel. 7. A method of processing data as claimed in claim 1, wherein a pixel is filtered if the number of edges pixels in a defined neighborhood of the pixel lies within a defined range. 8. A filtering device for carrying out a method as claimed in claim 1. 9. A storage medium comprising a software module for storing a set of instructions executable under the control of a computer or a processor and provided for performing at least some of the steps of the processing method as claimed in claim 1.

Inventors: DROUOT ANTOINE, DROUOT, ANTOINE
Applicants: KONINKL PHILIPS ELECTRONICS NV, KONINKLIJKE PHILIPS ELECTRONICS N.V.
Application year: 2000
Main classification: G06T9
IPC codes: G06T5, G06T9, H04N1, H04N5, H04N7