Filtering process for focussing images

Abstract: High-pass filtering process for focusing images, particularly digital images, or similar, which are composed of a plurality of single dot areas, named pixels (Pi,j), having different individually variable luminous intensities I (Pi,j). The filtering process provides, for each pixel (Pi,j) a correction C (Pi,j) of the intensity value of said pixel (Pi,j), which is calculated statistically, on the basis of combinations of high-pass filterings performed in at least one, preferably in at least four different directions (0°, 45°, 90°, 135°). According to the invention, the high-pass filter determines the correction (C(Pr,r)) of each pixel (Pr,r; Px,x) on the basis of a mean of the intensities of at least pairs of pixels being next to, that is at predetermined distances from and on opposite sides of the filtered pixel (Pr,r; Px,x), with reference to each of the predefined directions (0°, 45°, 90°, 135°), creating a corresponding new filtered image, composed of the corrected pixels.

Description: The invention relates to a filtering process for focusing images, particularly digital images, or similar, which are composed of a plurality of single dot areas, named pixels having different individually variable luminous intensities, so as to generate all together an image, and which filtering process provides for each pixel of the image a correction of the intensity value of said pixel, which is calculated statistically, on the basis of combinations of high-pass filterings performed in at least one, preferably in at least four different directions with respect to the matrix of the pixels forming the image. In prior art methods, each pixel under examination is subjected to high-pass filtering in multiple directions, using high-pass monodirectional filters. Then, the results of each monodirectional high-pass filtering are combined, after being weighted, to obtain statistical corrections of the filtered pixel. These prior art high-pass filtering methods ensure, on the one hand, that the image is well focused, that is provided with sharp outlines, but may cause, at the same time, the outlines having intensity variations to a certain substantial extent, to shift, and thus involve a certain level of deformation in the reproduced image as compared to the real shape of the corresponding object. This is a very serious drawback, particularly in image acquisition devices, such as those for image acquisition by echography or by nuclear magnetic resonance. In this case, a high level of correspondence between the real shape and the reproduced image, as well as a high level of sharpness and clarity are extremely important. US patent US 5,390,264 discloses an image processing device for focussing digital images by generating an enhancement coefficient using a first difference, which is the difference of the target pixel signal minus the signal of the reference pixel positioned on a first direction; and the second difference, which is the target pixel signal minus the average of the signals of the second and third reference pixels, which are the reference pixels in the directions perpendicular to the first direction and on opposite sides of the target pixel. The target pixel signal is corrected by repeating this process for each of the reference pixels positioned on the four directions surrounding the target pixel. Therefore, the invention is based on the problem of providing a filtering process for images made, particularly, of matrices of dot areas, being independent of each other, which allows to obtain sharp and focused images, with the highest fidelity with respect to the object under examination, and with a small computing time requirement. The invention solves the above problem with a process of the type described hereinbefore, in which the filter generates the correction value of each pixel of an image made of a set of pixels, that is of a pixel matrix, said correction value being based on the mean of the intensities of at least pairs of pixels, neighboring, i.e. being at predetermined distances from and on opposite sides of the pixel under examination, creating a corresponding new filtered image, composed of the corrected pixels. According to an improvement, the correction value is calculated as an appropriately weighted mean between correction values obtained from the means of the intensities of at least one pair, or at least several pairs of pixels, of the pixel matrix under examination, on opposite sides of the pixel under examination, with reference to at least two different directions of the pixel matrix, preferably four directions of the pixel matrix, while said procedure is repeated for each pixel of the pixel matrix under examination, that is to be filtered. Advantageously, the correction value of each pixel is calculated on the weighted combination of the so-called directional correction values resulting from the means of at least two pairs of pixels on the opposite sides of the pixel under examination, the pixel pairs being oriented in a horizontal direction, in a vertical direction, and in two intermediate diagonal directions respectively, that is corresponding to the angular positions at 0°, 45°, 90°, 135°. According to a first embodiment, while calculating the means of the intensities of at least pairs of pixels on the opposite sides of the pixel under examination, the pixel intensity is weighted according to their distance from the pixel under examination, each intensity value being multiplied by a factor decreasing as the distance increases. Particularly, the process according to the invention has the following steps: a) Calculating, for each of at least one, preferably of the four different directions, which may be defined with reference to the pixel matrix, the mean values of intensity, appropriately weighted, if necessary, with respect to distance, of two or more pixels of the pixel matrix, that is of the image to be filtered, said pixels being on opposite sides of the pixel under examination, and aligned along a predetermined direction; b) Calculating, for each of at least one, preferably of the four directions, which may be defined with reference to the pixel matrix, a so-called directional intensity threshold, which equals the mean of the means of the intensities, obtained from the means of the intensities of the pixels on the opposite sides of the pixel under examination, hereafter indicated as M (dir, 1) and M (dir, 2); c) Calculating, for each of at least one, preferably of the four directions, which may be defined with reference to the pixel matrix, a so-called directional, i.e. direction-dependent correction value which is the absolute value of the difference between the means of the intensities of the neighboring pixels on the two opposite sides of the pixel under examination, hereafter indicated as M (dir, 1) and M (dir, 2), and aligned in the predetermined direction, the said correction value being appropriately weighted by multiplying it by a weighting factor, and being assigned a positive or negative sign, according to whether the intensity of the pixel under examination is higher or lower than the threshold value for the corresponding direction. d) Calculating the intensity correction of the pixel being filtered, by adding up the individual appropriately weighted directional correction values as in the previous step c) and by normalizing said sum by dividing it by the sum of the weighting factors of the directional correction values; e) Adding the correction value obtained therefrom to the intensity value of the pixel under examination. f) Repeating the previous steps a) to e) for each of at least one predetermined part or of all the pixels of the pixel matrix in the pre-filtering situation. The directional correction values, whose normalized sum gives the intensity correction value of the pixel under examination may be weighted in different ways, and particularly satisfactory results are obtained by weighting each directional correction value, by multiplying it by its own value. The filtering process according to the above description allows to remove the outline blurring effect in a digital image, through relatively fast calculations and thus a shorter computing time, especially in computers with a poorer and cheaper configuration. All this without causing any shift or deformation of lines as compared to the real situation, and thus ensuring a very high fidelity between the real situation and the displayed image, particularly when the image is the resultant of acquisition methods by echography or nuclear magnetic resonance. However, in this basic embodiment, the filter performs nearly on-off corrections, therefore the corrected image may have lines or outlines between bright and dark areas with a saw-profile. In order to remove this drawback, according to an invention improvement, for each direction of at least one, preferably of the four directions, which may be defined with reference to the dot matrix, not only one directional threshold is calculated, but any greater number of thresholds, related to the corresponding direction, may be defined, with the help of the means of the intensities of the neighboring pixels on the opposite sides of the pixel under examination. In this way, the intensity of the pixel under examination may fall in the range of n+1 intervals, defined by n directional thresholds. The sign and the directional correction value, as well as the weight which may be assigned to the latter, may be thus calculated depending on the interval in which the intensity value of the pixel falls. Particularly, in this case, the method according to the invention provides that an attenuation and/or enhancement factor be assigned to the directional correction value of intensity which is a function of the interval between the thresholds in which the intensity of the pixel under examination falls. The function on which the directional correction attenuating/enhancing factor depends is such, that said factor increases as the absolute value of the difference between the intensity of the pixel under examination and the central threshold increases. Particularly, an attenuation factor of 1 is used when the intensity of the pixel under examination falls within the intervals at the maximum distance from the central threshold. Particularly, given an odd number n of thresholds and a number n+1 of intervals, the attenuation factor will increase of 2/(n+1) for each interval progressively departing from the central threshold. On the contrary, the signs and the absolute values of the individual directional correction values are obtained in the same way as in the case of a single threshold, assigning a negative or a positive sign, according to whether the intensity of the pixel under examination is lower or higher than the central threshold, and assigning, as an absolute value of the correction, the weighted difference between the mean values of intensity of the pixels on the opposite sides of the pixel under examination in the corresponding direction. Therefore, the correction value is obtained by summing up the directional correction values, multiplied by their respective attenuation factor and by the corresponding weight of the single directional correction values, and through the division of such a sum by the sum of the weights of the directional correction values. Thanks to this improvement, the intensity correction values for the individual pixels under examination are attenuated or enhanced according to the absolute value of the difference between the intensity value of the filtered image, and the central directional threshold, which is defined as a grand mean of all means named M (dir, 1), and M (dir, 2) of the intensity values of the neighboring pixels on the opposite sides of the pixel under examination and in the corresponding direction. As a result of these attenuations or enhancements of the correction value of the pixel intensities, a removal of the image blurring is still obtained, but the saw profile of lines is also removed. The filter according to the invention is advantageously applied to an image made of a pixel matrix, which has been previously submitted to low-pass filtering in order to remove noise, that is intensity fluctuations of pixels caused by noise while the image is being detected. Even in the case of two or more thresholds, the filter is simple and requires small processing times and a computing powers with respect to prior art filtering methods for sharpness enhancement. Moreover, this improvement also does not cause deformations of the image with respect to the real situation, therefore allowing for a high reproduction fidelity. The invention also relates to further improvements which form the subject of the dependent claims. The characteristics of the invention and the advantages deriving therefrom will appear more clearly from the following description of a non limiting embodiment illustrated in the accompanying figures, in which: Fig. 1 shows an area of a digital image, made of two dark vertical stripes, between which a bright vertical stripe is interposed. Fig. 2 shows the diagram representing the luminous intensities of each pixel, in the line pointed by the arrow, in the digital image according to fig. 1. Fig. 3 shows a possible digital image, corresponding to a situation according to that of fig. 1, as it might be obtained on exit from a low-pass filter and, for example, by a system for nuclear magnetic resonance detection. Fig. 4 shows a diagram representing the pixels and their intensities, in the horizontal line of pixels pointed by the arrow, in fig. 3, whereas the results of the correction of two pixels are shown in a dashed line. Fig. 5 shows the area of the image or of the pixel matrix of fig. 3, which is considered for high-pass filtering of the pixel P 3,4 through the process according to the invention. Fig. 6 shows the diagrams of three horizontal lines of pixels, i.e. an upper line, an intermediate line, containing the pixel under examination and the two opposed pixels on the left and on the right thereof, and a lower line, and of a corresponding threshold for the horizontal direction. Fig. 7 shows, like fig. 6, the intensity diagrams of three columns of pixels, i.e. left, intermediate, and central, in which the intermediate column has, at its center position, the pixel under examination. Figs. 8 and 9 show, like the previous figures 6 and 7, the intensity diagrams of the pixels in the two diagonal directions, the pixel under examination being still provided in the diagonal intermediate line, and in the center position. Fig. 10 shows an area of the digital image according to fig. 3, which is considered for high-pass filtering of another pixel under examination P 3,7 . Figs. 11, 12, 13, 14 show the intensity diagrams of the pixels in the horizontal and vertical direction, and in the two diagonal directions respectively, like in the description of figs. 6 to 9, and with the pixel under examination still being in the center position of the corresponding central line. Fig. 15 shows the variant embodiment, wherein the corrections are obtained by using three directional thresholds for different intensities of pixel being filtered. Figs. 1 and 2 show a digital image in the form of a pixel matrix, as it should appear in case of full acquisition and reproduction fidelity, that is without noise and statistical variations. The image is composed of 9X6 pixels, represented with squares disposed on a grid made of six lines and nine columns. The diagram of fig. 2 shows the curve of intensity related to the third line from above. In the following description, each pixel P i,j is indicated with a pair of numbers, i indicating the horizontal line, and j the column. Hence, the diagram 2 shows the intensity of the pixels P 3,j , with j = 1, 2, 3, 4, 5, 6, 7, 8, 9, that is all pixels in the third line from above. Figure 3 shows a model of a possible digital image, which might be obtained by an acquisition system, such as a device for nuclear magnetic resonance image detection, or a system for echographic image detection. The image shown in fig. 3, contains, in the passage between bright and dark, pixels which are too dark or too bright. The image shown in fig. 3 might be either the image received directly by a detection system, or an image resulting from one or more previous processing operations, like, for example, a first filtering with a low-pass filter of any currently known or used type. The diagram of fig. 4 shows the intensities of the pixels P 3,j , with j = 1, 2, 3, 4, 5, 6, 7, 8, 9, that is belonging to the same pixel line as shown in figures 1 and 2. As is clearly shown, the edges between bright areas and darker ones are no longer well defined, and this involves a blurring effect in the image. In order to correct this defect without causing the outlines to shift, which would affect the fidelity of the corrected image as compared to the real situation, the invention provides a method consisting of the following steps. For each pixel of the matrix of pixels composing the image to be filtered, an area of the image comprising odd numbers of lines and columns is considered, which has, at its center, i.e. at the crossing-point between the central line and the central column, the pixel under examination. The pixels of the examination area are arranged in a matrix, in which, the intensity values of the pixels are stored in their respective positions. Referring to figures 5 to 9, the pixel under the examination is P 3,4 . The image area considered for filtering will be the one comprising the pixels P k,l , with k = 1, 2, 3, 4, 5, and with 1 = 2, 3, 4, 5, 6. If the pixel being filtered is defined as the central pixel of the pixel matrix and, for the sake of simplicity, as P r,r , the area will comprise, for a number z of lines and a number w of columns, the pixels P k,l , with k = r-1/2 (z-1), ..., r, r+1/2 (z-1) and with l = r-1/2 (w-1), ..., r, r+1/2 (w-1). In the illustrated example z=w=5. So, the matrix submitted to the high-pass filtering process, will comprise the intensity values I k,l of the corresponding pixels P k,l , that is I k,l = I(P k,l ) The matrix corresponding to the pixels surrounding the pixel to be filtered is thus multiplied by a filtering matrix for each of the four different directions, corresponding to axes at 0°, 45°, 90°, and 135°. Advantageously, in the 0° and 90° directions, a matrix I k,l , may be considered, which is centered on the intensity value I r,r of the central pixel P r,r to be filtered, and which has only three lines and three columns, whereas the filtering matrices for the 45° and 135° directions, that is the two diagonal directions, have, in the illustrated example, five lines and five columns. Moreover, the intensity values I k,l of the pixels P k,l , surrounding the pixel under examination P r,r may be multiplied by a factor which is a function of their distance from the pixel under examination P r,r . The filtering matrices for the individual 0°, 45°, 90°, 135° directions, i.e. for the horizontal and vertical directions and for the two diagonal directions have the following form: for the 0° direction, that is for the horizontal direction indicated with O in the figures. for the 90° direction, that is for the vertical direction, indicated with V in the figures. for the 45° direction, that is for one of the two diagonal directions, indicated with D1. and for the 135° direction, that is for one of the two diagonal directions, indicated with D2. In which the factors fi, gi, ai, bi, with i = 1, 2, ..., 6, are weighting factors for the intensity values of the pixels surrounding the pixel under examination, that is the central pixel P r,r to be filtered, said factors being functions of the distance of the corresponding pixel from the pixel being filtered P r,r . The dependence of the values fi, gi, ai, bi on the distance of the corresponding pixel from the pixel under examination is inversely proportional to said distance. Among the different available choices, advantages result from choosing f1=f3=-f4=-f6and f2=-f5; and accordingly g1=g3=-g4=-g6 and g2=-g5; a1=a3=-a4=-a6 and a2=-a5; and b1=b3=-b4=-b6 and b2=-b5. A further advantageous, but not compulsory choice is providing also f1=g1=a1=b1 and f2=g2=a2=b2. Several choices are possible for the functions fi, gi, ai, bi. In the illustrated embodiment, the choice has been fl=f3=-f4=-f6=g1=g3=-g4=-g6=al=a3=-a4=-a6=bl=b3=-b4= -b6= 1 and f2=-f5=g2=-g5=a2=-a5=b2=-b5= 2, thus obtaining the following directional filtering matrices. for the 0° direction, that is for the horizontal direction indicated with O in the figures. for the 90° direction, that is for the vertical direction, indicated with V in the figures. for the 45° direction, that is for one of the two diagonal directions, indicated with D1. and for the 135° direction, that is for one of the two diagonal directions, indicated with D2. The multiplication of these matrices, hereafter indicated with ⊗, is defined as the sum of the products of the corresponding elements of the two matrices, i.e. those having the same positions, that is: This multiplication of the above matrices by the corresponding matrix 3X3 or 5X5 related to the intensities I k,l of the pixels P k,l , the definition of the modulus of the multiplication result and the division of the sum of fi, gi, ai, bi with i = 1, 2, 3, by said modulus, generate a value for each direction, which is the modulus of the difference between the mean of the intensities M (dir, 1) and M (dir, 2) of the pixels P k,l , situated on one side of the pixel P r,r being filtered and that of the pixels P k,l , situated on the other side of the pixel P r,r being filtered, with reference to the corresponding 0°, 45°, 90° or 135° direction. The modulus of the difference between the means of the intensities M (dir, 1) and M (dir, 2) of the pixels k,l on the opposite sides of the pixel being filtered P r,r is used to calculate the intensity correction for the pixel being filtered P r,r in the corresponding direction and which, in the present disclosure and in the claims is defined as a directional correction C (dir), that is to say, with reference to the illustrated examples, according to the 0°, 45°, 90°, 135° directions. The final correction of the pixel being filtered is obtained through a weighted and normalized addition of the individual directional corrections. Particularly, the directional correction is given by the modulus of the difference between the means M (dir, 1) and M (dir, 2) of the pixels P k,l on the opposite sides of the pixel being filtered P r,r in the corresponding direction. The weighting operation is performed by multiplying each directional correction C (dir) by a factor Q (dir), which is different for each of the directional corrections provided and, particularly, may be the value C (dir) itself for each direction. The directional corrections C (dir), with dir = 0°, 45°, 90°, 135°, and the corresponding weighting values Q (dir) are absolute values, and bear no sign. In order to determine which of the signs (+) or (-) each directional correction shall be assigned, while adding them up to determine the correction for the pixel being filtered P r,r , the process according to the invention provides threshold values, calculated for every filtering direction, the intensity value I r,r of the pixel being filtered P r,r being compared thereto. In a first embodiment, the directional threshold, indicated with S (dir), in which dir = 0°, 45°, 90°, 135°, is calculated as follows: in which the modulus function is defined as the matrix of the moduli, i.e. of the absolute values of the matrix elements. The same is obtained for the other directions: This mean is used to define a threshold value S(0°), S(45°), S(90°), S(135°), for each 0°, 45°, 90°, 135° direction. The above thresholds, which will be named, hereafter and in the claims, directional thresholds, are compared to the intensity I r,r of the central pixel P r,r , being filtered. This comparison determines the sign of the filtering correction to be applied to the intensity I r,r of the pixel P r,r being filtered, so that the correction is positive when I r,r is higher than the value of its respective directional threshold, whereas the correction is negative when I r,r is lower than the value of said directional value, this operation being executed for every directional threshold. The global correction value is obtained through the following formula: in which sign(x) is the function which takes the value (-1) when x<0 and (+1) when x>0. In the example illustrated in figures 5 to 9, the pixel P r,r has the value of 50, and the directional thresholds are indicated with S(0°), S(45°), S(90°), S(135°). The values of fi, gi, ai, bi, with i = 1, 2, 3, 4, 5, 6 are those indicated hereinbefore, that is: fl=f3=-f4=-f6=gl=g3=-g4=-g6=al=a3=-a4=-a6=bl=b3=-b4= -b6= 1 and f2=-f5=g2=-g5=a2=-a5=b2=-b5= 2 In the example illustrated in figs. 5 to 9, the pixel matrices P k,1 have the following values: in the 0° and 90° directions and for the 45° and 135° directions When the above is applied, the following thresholds are obtained: S(0°)=55>I(P r,r )=50; directional correction sign: (-1) weighted directional correction: |20| × |20| = 40 S(90°)=45<I(P r,r )=50; directional correction sign: (+1) weighted directional correction: |50| × |50| = 2500 S(45°)=52,5>I(P r,r )=50; directional correction sign: (-1) weighted directional correction: |25| × |25| = 625 S (135°) =42,5<I (P r,r ) =50; directional correction sign: (+1) weighted directional correction: |35| × |35| = 1225 Therefore, the global correction of the pixel P r,r is 2500 + 1225 - 400 - 625 50 + 25 + 35 + 20 = +20,7 The filtering process according to the invention increases the intensity of the pixel P r,r according to figs. 5 to 6, from I=50 to I=70,7. Figures 10 to 14 show the area to be examined for filtering another pixel P x,x . The process is the same as described above as regards figures 5 to 9. In this case, the matrices describing the intensity of the pixels which are relevant for the filtering operation and are centered on the pixel being filtered P x,x are as follows: in the 0° and 90° directions and for the 45° and 135° directions the pixel P x,x being filtered has an intensity I(P x,x )=30. When the above is applied, the following thresholds are obtained: S(0°)=32,5>I(P x,x )=30; directional correction sign: (-1) weighted directional correction: l25l × l25l = 625 S(90°)=32,5>I(P x,x )=30; directional correction sign: (-1) weighted directional correction: |45|×|45|=2025 S(45°)=32,5>I(P x,x )=30; directional correction sign: (-1) weighted directional correction: |45|×|45|=2025 S(135°)=27,5<I(P x,x )=30; directional correction sign: (+1) weighted directional correction: |35|×|35|=1225 Therefore, the global correction of the pixel P x,x is -625-2025-2025+1225 25+45+45+35 =-23 The filtering process according to the invention decreases the intensity of the pixel P x,x according to figs. 10 to 14 of 28,5, from I=30 to I=7. The corrections obtained for both cases of figs. 5 to 9, i.e. for the pixel P r,r and of figs. 10 to 14, i.e. for the pixel P x,x are represented in the diagram of fig. 4 with dashed lines. The filtering process is repeated for every pixel P i,j of the image and provides a matrix for the correction of original intensities, which is as large as the original image, or as one portion thereof. According to another improvement of the invention, the corrections of each pixel C(P r,r ), obtained through filtering, may be multiplied by a further attenuation and/or, in case, enhancement weight. The weight may be obtained empirically, through a direct evaluation of the effect on the displayed image. The weight may be different for each correction C(P r,r ) or identical for all corrections of the individual pixels and is generally used to attenuate the correction, and is defined to be the same for all pixels being filtered. The reference for the filtering algorithm is still the original digital image, and the corrected intensity values are only used to produce the new filtered image, and are not involved during filtering. According to a variant of the process described above, different matrices for directional filtering may be used, for example for diagonal directions. Particularly, by using filtering matrices like for diagonal directions, a single 3x3 matrix may be used for all steps of directional filtering, and it is not necessary to isolate two different fields of the digital image, centered on the pixel being filtered P r,r or P x,x . The rest of the process remains unvaried and as described. The process according to these two embodiments is very abrupt, as it suddenly increases or reduces the intensity of the pixel P r,r or P x,x being filtered. This discretized operation, of the on-off type may generate saw-profiled lines, that is with a slight zigzag profile. In order to reduce this saw-tooth effect, the invention provides the improvement of setting a statistical weighting factor of the individual directional corrections C (dir), accounting for the distance between the original value of the pixel being filtered, and the corresponding directional threshold S(dir). The weighting factor may be any function of the modulus of the difference between the value of the directional threshold and the intensity of the pixel being filtered. Preferably, the dependence of the weighting factor on the modulus of the difference between the directional threshold value and the intensity of the pixel being filtered is a discrete function which assigns each quantity range or interval of said difference a fixed value, there being provided a weighting factor 1, for very high difference values, whereas, for smaller difference values, the weighting factor is a predetermined fraction. According to a particular embodiment, the intervals used to calculate the additional weighting factor for a directional correction are obtained by defining several thresholds, i.e. at least three directional thresholds. The thresholds are always calculated starting from the mean of the mean values of the neighboring pixels on the two opposite sides of the pixel P r,r being filtered, and with reference to the direction under examination. The definition of the intensity mean of the pixels P k,l on the opposite sides of the pixel P r,r being filtered with reference to the direction M(dir,1) and M(dir,2), with in which the symbol ⊗ indicates the particular product defined above. The same is provided for the other directions: therefore, it is possible to calculate the individual threshold values by a number k, with k= 1,...,n of thresholds: S(dir,k)= [(n+1-k)xM(dir,1)+kxM(dir,2)]/(n+1) With the fi, gi, ai, bi values as defined in the previous description, and with a number n=3 thresholds, the result is as follows: S(dir,1)=[3M(dir,1)+M(dir,2)]/4 S(dir,2)=[M(dir,1)+M(dir,2)]/2 S(dir,3)=[M(dir,1)+3M(dir,2)]/4 The thresholds 1, 2, 3 divide the difference between the means of the pixels P k,l on the two opposing sides of the pixel being filtered P r,r , and in the corresponding direction, into four intervals. When the intensity I(P r,r ) of the pixel being filtered falls within the outmost intervals, that is below the lowest threshold S(1) or above the highest threshold S(3), then the weighting factor of the directional correction C(dir) for the pixel P r,r being filtered is 1. When said intensity I(P r,r ) of the pixel being filtered P r,r falls in the intervals situated between the two outmost thresholds S(1) and S(3) and the central threshold S(2), then the weighting factor of the corresponding directional correction C(dir) is a fraction of 1, for example 0.5. Fig. 15 shows the intensity diagram of the three pixels P r,r-1 , P r,r and P r,r+1 , which are aligned with the pixel being filtered P r,r in the horizontal direction of the image, that is of an area of the image, made of nine pixels, whose center is a pixel being filtered P r,r with different values of I(P r,r ). The remaining pixels P k,l are like in the previous example of figures 5 to 9, that is: in the 0° and 90° directions and for the 45° and 135° directions. S(0°,1), S(0°,2) and S(0°,3) indicate the three thresholds which have been defined as generally described above and S(0°,1)=50, S(0°,2)=55, S(0°,3)=60. The directional correction C(0°), as calculated in the previous example is of (-400). According to the improvement, if the intensity of the pixel P r,r is of 48, and so falls within the first interval below the threshold S(0°,1), then the directional correction C(0°) is multiplied by a weight W=1. So the global correction will be calculated, while taking C(0°)xW as (-400). If the intensity of P r,r were of 52, then it would fall within the second interval between the lowest threshold S(0°,1) and S(0°,2). In this case, the weighting factor W of the directional correction (-400) is, for example, W=0.5. Therefore, in the combination of the individual directional corrections for calculating the intensity correction for the pixel P r,r , the direction 0° will only be incident for -200. The above is also valid for intervals defined by the thresholds above the central threshold S(2), which are assigned, symmetrically to the previous case, the weighting factor W=1, when the intensity of the pixel being filtered P r,r is higher than that of the threshold S(3) and W=0.5, when said intensity is between the thresholds S(2) and S(3). This expedient allows for a reduction of the correction values for the pixel being filtered, depending on the higher or lower closeness of the intensity value to the central threshold obtained as a grand mean of the intensity values of the pixels on the opposite sides of the pixel being filtered P r,r for each direction. This also reflects a certain statistical concept which reasonably accounts for the fact that, the closer the intensity of the pixel P r,r being filtered is to the central directional threshold value, the more the certainty that its intensity will be decreased or increased is reduced. The introduction of thresholds involves an attenuation of the on-off effect and an outline-straightening effect, the so-called smoothing, without causing said outlines to be deformed or shifted as compared to the original situation and thus maintaining a high reproduction fidelity and a considerable image sharpness. The algorithm which describes the high-pass filtering process according to the invention is very simple and does not need a very high computing power. This involves a remarkable filtering speed and the use of cheap computers. Naturally, the invention is not limited to what has been described and illustrated herein, but may be greatly varied. So, the directions and the structure of matrices, as well as the areas of the image or of the pixel matrix to be considered for filtering the pixel P r,r may be chosen beneath the limits of the description and illustrations included herein. For example, a grater number of pixels for each direction may be considered. Moreover, the directions, though the use of vertical, horizontal, and diagonal directions is much simpler, may be also intended in a broader sense, that is as ideal paths joining a certain number of pixels at predetermined distances and in predetermined positions with respect to each other and to the pixel being filtered, and whose eventually weighted means are mutually statistically processed and used, as a mean to obtain comparison thresholds, and as a difference to define absolute correction values. So, for example, the directions may also be polygonal lines ideally connecting any different pixel of the area under examination. The weighting functions of the intensity values of the pixels P k,l which are selected for filtering the pixel P r,r and may be varied according to their distance from the pixel being filtered, as well as the weighting factors of the directional corrections C(dir), the number of directional thresholds and the statistical attenuation weights related to the different intervals defined by said thresholds are also freely variable. The whole without departing from the guiding principle disclosed above and claimed below.

Claims: Filtering process for focusing images, particularly digital images, which are composed of a plurality of pixels (P i,j ) having different individually variable luminous intensities so as to generate all together an image, and which filtering process provides for each pixel (P i,j ) of the image an intensity correction value (C(P i,j )) for enhancing or attenuating the intensity value of said pixel (P i,j ), the said intensity correction value being calculated statistically from a combination of the intensities of reference pixels positioned in the surrounding of the pixel to be filtered according to at least one, preferably at least four different directions (0°, 45°, 90°, 135°) with respect to the matrix of the pixels (P i,j ) forming the image by determining the correction value (C(P r,r )) of the intensity of each pixel (P r,r ; P x,x ) from the mean of the intensities of at least one pair, preferably at least several pairs of pixels being next to, that is at predetermined distances from and on opposite sides of the pixel to be filtered (P r,r ; P x,x ), with reference to each of the predefined directions (0°, 45°, 90°, 135°), said procedure being repeated for each pixel (P i,j ) of the pixel matrix under examination, that is to be filtered, creating a corresponding new filtered image, composed of the corrected pixels characterised, by the following steps: a) Calculating, for each of at least one, preferably four different directions, which may be defined with reference to the pixel matrix (P i,j ), the means of the intensity values (I i,j ), appropriately weighted (fi, gi, ai, bi), if necessary, with respect to distance, of two or more pixels of the pixel matrix (P i,j ), that is of the image to be filtered, said pixels being on opposite sides of the pixel under examination (P r,r ; P x,x ) and aligned along a predetermined direction (0°, 45°, 90°, 135°); b) Calculating, for each of at least one, preferably of the four directions (0°, 45°, 90°, 135°), which may be defined with reference to the pixel matrix (P i,j ) under examination, a so-called directional intensity threshold (S(dir); S(0°), S(45°), S(90°), S(135°)), which for each direction equals the mean or the means of the intensities of the pixels on the opposite sides of the pixel being filtered relating to the corresponding direction; c) Calculating, for each of at least one, preferably of the four directions (0°, 45°, 90°, 135°), which may be defined with reference to the pixel matrix (P i,j ), a so-called directional, i.e. direction-dependent correction value (C(dir)), which is the absolute value of the difference between the means of the intensities of the neighboring pixels which are positioned on the two opposite sides of the pixel under examination with reference to the predetermined direction, and which are aligned in the said direction, the said directional correction value (C(dir)) being appropriately weighted by multiplying it by a weighting factor (Q(dir)), the said directional correction value (C(dir)) being assigned a positive or negative sign, according to whether the intensity of the pixel being filtered is higher or lower than the threshold value (S(dir); S(0°), S(45°), S(90°), S(135°)) for the corresponding direction. d) Calculating the intensity correction value of the pixel being filtered, by adding up the individual appropriately weighted directional corrections values (C(dir)), as in the previous step c) and by normalizing said sum by dividing it by the sum of the weighting multiplying factors (Q(dir)) of the directional correction values (C(dir)); e) Adding the correction value (C(P r,r ), C(P x,x )) obtained therefrom to the intensity value of the pixel being filtered; g) Creating a digital image, in the form of a pixel matrix, in which, in the corresponding position of the pixel being filtered (P r,r ; P x,x ), the corrected intensity of the filtered pixel (P r,r ; P x,x ) is displayed; f) Repeating the previous steps a) to e) for each of at least one predetermined part or of all the pixels (P i,j ) of the pixel matrix. Process as claimed in claim 1, characterized in that the directional weighting factor (Q(dir)) of the directional correction values (C(dir)), is equal to the modulus of the associated directional correction value (C(dir)). Process as claimed in claims 2 or 3, characterized in that for each direction of the at least one, preferably of the four directions (0°, 45°, 90°, 135°), which may be defined with reference to the pixel matrix (P i,j ), number n of directional thresholds ( S(dir, k); S(1), S(2), S(3), S(n)) is defined, by dividing for each direction the difference between the means of the pixels on the two opposing sides of the pixel being filtered by the number of thresholds (n) thus generating a number of intervals (n+1), in which the intensity of the pixel being filtered (P r,r , P x,x ) may fall, and that a weighting factor is assigned to the directional correction value (C(dir)) of intensity for the corresponding direction, which is a function of the interval between the directional thresholds ( S(dir k); S(1), S(2), S(3), S(n)) in which the intensity of the pixel being filtered falls. Process as claimed in claim 3, characterized in that the weighting factor (W) is such, that the factor (W) increases as the absolute value of the difference between the intensity (I r,r ) of the pixel being filtered (P r,r ) and a central threshold (S(2)) of the n thresholds increases. Process as claimed in claim 4, characterized in that the maximum weighting factor (W) is 1. Process as claimed in claims 4 or 5, characterized in that the function defining the dependence of the weighting factor (W) on the intervals defined by the directional thresholds (S(dir, k); S(1), S(2), S(3),..., S(n)), is a discrete function having fixed decreases of 2/(n+1) for each interval defined by n thresholds, starting from the value of 1, corresponding to the interval outside the highest or lowest threshold, with respect to central threshold, said function defining the weighting factors (W) being symmetrical with respect to the said central threshold (S[(n+1)/2], S(2)), in case of an odd number of thresholds. Process as claimed in one or more of the preceding claims, characterized in that , for each pixel being filtered (P r,r , P x,x ), a surrounding pixel area (P k,l ) is considered, the pixel being filtered (P r,r , P x,x ) occupying the center thereof, and a matrix of the intensity values (I(P k,l )) of pixels (P k,l ), with a predetermined number of lines (z) and a predetermined number of columns (w) is generated, the correction values being obtained through filtering matrices for at least one, preferably more than one, especially four directions, said matrices having the same dimensions (z,w) as the matrices corresponding to the areas under examination÷ and having elements other than zero corresponding to the pixels (P k,l ) whose intensity value is used to calculate the corresponding directional correction value (C(dir)). Process as claimed in claim 7, characterized in that four directions are considered, oriented 0°, 45°, 90°, 135°, with respect to the lines of the matrix under examination (P k,l ), which is centered around the pixel being filtered (P r,r ; P x,x ), the filtering matrices being of the following type: for the 0° direction, that is for the horizontal direction (O). for the 90° direction, that is for the vertical direction (V). for the 45° direction (D1). and for the 135° direction (D2). in which the factors fi, gi, ai, bi, with i = 1, 2, ..., 6, are weighting factors for the intensity values of the pixels surrounding the pixel under examination, that is the central pixel (P r,r ) to be filtered, said factors being functions of the distance of the corresponding pixel from the pixel being filtered (P r,r ). Process as claimed in claim 8, characterized in that the directional thresholds are calculated as follows: in which the modulus function is defined as the matrix of the moduli, i.e. of the absolute values of the matrix elements, and in which ⊗ defines a particular operator defined as convolution of these matrices, and that the same is applicable for the other directions: Process as claimed in claim 9, characterized in that , in the diagonal 45° and 135° directions, the filtering matrices may also have the same dimensions as those in the 0° and 90° directions, that is: of the type: Process as claimed in one or more of the preceding claims 7 to 10, characterized in that f1=f3=-f4=-f6 and f2=-f5; and accordingly g1=g3=-g4=-g6 and g2=-g5; a1=a3=-a4=-a6 and a2=-a5; and b1=b3=-b4=-b6 and b2=-b5. Process as claimed in claim 11, characterized in that f1=g1=a1=b1 and f2=g2=a2=b2. Process as claimed in claim 12, characterized in that f1=f3=-f4=-f6=g1=g3=-g4=-g6=a1=a3=-a4=-a6=b1=b3=-b4=-b6=1 and f2=-f5=g2=-g5=a2=-a5=b2=-b5=2. Process as claimed in one or more of the preceding claims, characterized in that the correction value (C(P r,r )) of the pixel being filtered (P r,r ; P x,x ) is obtained through the following formula: in which sign(x) is the function which takes the value (-1) when x<0 and (+1) when x>0 and in which the variable dir defines four directions in the pixel matrix; C(dir) is the correction value dependent on the direction and is defined as the modulus of the difference between the mean of the intensities (M(dir, 1)) of the pixels situated on one side of the pixel (P r,r ; P x,x ) being filtered and that (M(dir, 2)) of the pixels situated on the other side of the pixel (P r,r ; P x,x ) being filtered with reference to the different directions; Q(dir) is a weighting factor of the different correction dependent values; S(dir) is a direction dependent threshold; Process as claimed in one or more of the preceding claims, characterized in that , for each direction, several directional thresholds are determined as follows: calculating the intensity means (M(dir,1) ; M(dir,2)) of the pixels (P k,1 ) on each of the opposite sides of the pixel (P r,r ) being filtered, with reference to the directions, dir=0°, 45°, 90°, 135° as in which the symbol ⊗ indicates the convolution of matrices: calculating a number of k different threshold values s(dir, k) with k= 1,...,n according to: S(dir,k)= [(n+1-k)xM(dir,1)+k x M(dir,2)]/(n+1) with dir= 0°, 45°, 90°, 135°. Process as claimed in claim 15, characterized in that , three thresholds (S(1), S(2), S(3)) are given one of which is a central threshold having a value centered between the values of the other two thresholds and that a weighting factors (W(s)) for the directional corrections values (C(dir)) is defined which has the value of 0.5 in the intervals between the central threshold (S(2)) and the two lower and higher thresholds (S(1), S(3)), and of 1 in the intervals above the highest threshold (S(3)) and below the lowest threshold (S(1)). Process as claimed in one or more of the preceding claims, characterized in that the intensity correction value of the pixel being filtered, is weighted by an attenuation/enhancement factor, before being added to the original intensity of the pixel being filtered, this attenuation/enhancement factor for the intensity correction value of the pixel being filtered, being empirically defined by evaluating the visual effect on the displayed image. Process as claimed in claim 17, characterized in that the attenuation/enhancement factor for the intensity correction of the pixel being filtered, may be different for different pixels or groups thereof, or the same throughout the pixel matrix.

Inventors: CARLINI DAVIDE, CARLINI, DAVIDE
Applicants: ESAOTE SPA, ESAOTE S.P.A.
Application year: 1998
Main classification: G06T5
IPC codes: G06T5