Image filter, image filtering method and computer program

A first pixel group containing a pixel of interest, a second pixel group containing the first pixel group, and a third pixel group containing the second pixel group are defined. A first reference pixel value is calculated based on the first pixel group, and a second reference pixel value is calculated based on the third pixel group. The second pixel group is divided into two sub-groups with respect to the second reference pixel value. The sub-group containing the pixel of interest is selected as a target set. In the target set, a pixel with a pixel value close to the first reference pixel value is selected as a corrective pixel. The pixel value of the pixel of interest is replaced with the pixel value of the corrective pixel.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to filtering for reducing noise in images.

2. Description of the Background Art

A mean filter and a median filter are used to reduce noise in images. The mean filter is used to calculate the average pixel value of a pixel of interest and its neighboring pixels to replace the value of the pixel of interest with this average pixel value. Namely, the intensity of the pixel of interest, or whether the pixel of interest is black or white is determined by the use of the mean filter. The mean filter serves to filter out high frequency components of an image, to thereby realize noise removal and prevention of blurring.

However, the mean filter suffers from blurring of high frequency components. In contrast, a non-linear filter typified by a median filter has received attention by reason of simple algorithm, excellence in edge conservation, no degradation of afterimage in principle that is unavoidable annoyance to cyclic noise reduction, and the like.

According to the technique introduced in Japanese Patent Application Laid-Open No. 4-235472 (1992), an image signal given from a solid state imaging device is subjected to the processing using the median filter to correct data error caused by flaws or defects in pixels. According to the filtering technique introduced in Japanese Patent Application Laid-Open No. 6-178165 (1994), the average pixel value of a pixel of interest and its neighboring pixels is calculated, and a pixel with a pixel value closest to the average pixel value is selected from the neighboring pixels including the pixel of interest to be applied for use as a corrective pixel.

However, the technique introduced in Japanese Patent Application Laid-Open No. 4-235472 fails to perform accurate correction in the event that data error continuously occurs in the neighborhood of a pixel of interest, for example. Namely, data correction cannot be realized when a median value itself largely deviates from the original pixel value of a pixel of interest. The technique introduced in Japanese Patent Application Laid-Open No. 6-178165 is intended to remove or reduce Gaussian noise. This technique fails to perform accurate correction, in the event that a distribution of pixel values in a region targeted for the calculation of an average value and a distribution of pixel values of neighboring pixels including a pixel of interest are significantly different from each other, for example.

SUMMARY OF THE INVENTION

The present invention is intended to provide an image filtering technique to be effectively applied for noise reduction in images.

An image filter according to a first aspect of the present invention is intended to filter a pixel of interest using the pixel of interest and its neighboring pixels. In the image filter of the first aspect, a first pixel group containing the pixel of interest, a second pixel group containing the first pixel group, and a third pixel group containing the second pixel group are defined relative to the pixel of interest. The image filter of the first aspect comprises: a calculation part for calculating a first reference pixel value based on pixels contained in the first pixel group, and calculating a second reference pixel value based on pixels contained in the third pixel group; a judgment part for dividing the second pixel group into two sub-groups, and selecting one of the two sub-groups containing the pixel of interest as a target set, the two sub-groups including one sub-group containing pixels with pixel values greater than the second reference pixel value and the other sub-group containing pixels with pixel values smaller than the second reference pixel value; a selection part for selecting a pixel with a pixel value closest to the first reference pixel value as a corrective pixel from pixels contained in the target set; and an output part for outputting the pixel value of the corrective pixel as the pixel value of the pixel of interest.

An image filter according to a second aspect of the present invention is intended to filter a pixel of interest using the pixel of interest and its neighboring pixels. In the image filter of the second aspect, a first pixel group containing the pixel of interest, a second pixel group containing the first pixel group, and a third pixel group containing the second pixel group are defined relative to the pixel of interest. The image filter of the second aspect comprises: a calculation part for calculating a first reference pixel value based on pixels contained in the first pixel group, and calculating a second reference pixel value based on pixels contained in the third pixel group; a judgment part for dividing the second pixel group into two sub-groups, and selecting one of the two sub-groups containing a larger number of pixels as a target set, the two sub-groups including one sub-group containing pixels with pixel values greater than the second reference pixel value and the other sub-group containing pixels with pixel values smaller than the second reference pixel value; a selection part for selecting a pixel with a pixel value closest to the first reference pixel value as a corrective pixel from pixels contained in the target set; and an output part for outputting the pixel value of the corrective pixel as the pixel value of the pixel of interest.

A image filter according to a third aspect of the present invention is intended to filter a pixel of interest using the pixel of interest and its neighboring pixels. In the image filter of the third aspect, a first pixel group containing the pixel of interest, a second pixel group containing the first pixel group, and a third pixel group containing the second pixel group are defined relative to the pixel of interest. The image filter of the third aspect comprises: a calculation part for calculating a first reference pixel value based on pixels contained in the first pixel group, and calculating a second reference pixel value based on pixels contained in the pixel group; a judgment part for dividing the second pixel group into two sub-groups, and selecting one of the two sub-groups in which the first reference pixel value exists within a range of not less than a minimum pixel value and not more than a maximum pixel value as a target set, the two sub-groups including one sub-group containing pixels with pixel values greater than the second reference pixel value and the other sub-group containing pixels with pixel values smaller than the second reference pixel value; a selection part for selecting a pixel with a pixel value closest to the first reference pixel value as a corrective pixel from pixels contained in the target set; and an output part for outputting the pixel value of the corrective pixel as the pixel value of the pixel of interest.

The present invention is also intended for an image filtering method for filtering a pixel of interest using the pixel of interest and its neighboring pixels.

The present invention is still intended for a computer program causing a computer to implement an image filtering method for filtering a pixel of interest using the pixel of interest and its neighboring pixels.

According to the present invention, the first pixel group containing the pixel of interest, the second pixel group containing the first pixel group, and the third pixel group containing the second pixel group are applied for use in the filtering. The second reference pixel value is calculated based on the third pixel group, and the target set is determined based on the second reference pixel value. This means pixel variations in the wide area in the neighborhood of the pixel of interest can be taken into consideration for defining the target set. The first reference pixel value is calculated based on the first pixel group covering a limited area in the neighborhood of the pixel of interest, and a pixel with a value close to the first reference pixel value is applied for use as a corrective pixel. Thus the corrective pixel can be responsive to local pixel variations around the pixel of interest. Further, the target set is selected from the second pixel group covering an area smaller than that of the third pixel group. Thus the required amount of calculation can be reduced.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

First Preferred Embodiment

Preferred embodiments of the present invention will be described with reference to the accompanying drawings.FIG. 1is a circuit diagram of an image filter10according to a first preferred embodiment of the present invention. The image filter10comprises an image memory11, a reference value calculation circuit12, a judgment circuit13, a difference pixel value calculation circuit14and a minimum value selection circuit15.

With reference toFIG. 2, the image memory11has49registers R00, R01, . . . R66and six line buffers111,112, . . .116. The49registers R00, R01, . . . R66each have a storage area capable of storing pixel data corresponding to one pixel. Assuming that each horizontal line of image data received by the image filter10contains N pixels, the line buffers111,112, . . .116are FIFO memories each capable of storing pixel data corresponding to (N-7) pixels.

A more specific configuration will be discussed. In a first line, the registers R00, R01, . . . R06are connected in series. The line buffer111is arranged in a post stage of the resisters R00, R01, . . . R06. In a second line, the registers R10, R11, . . . R16are connected in series and are arranged in a post stage of the line buffer111. The line buffer112is arranged in a post stage of the registers R10, R11, . . . R16. In a third line, the registers R20, R21, . . . R26are connected in series and are arranged in a post stage of the line buffer112. The line buffer113is arranged in a post stage of the registers R20, R21, . . . R26. Likewise, seven registers and a line buffer are alternately connected, whereby the series connection of the49registers R00, R01, . . . R66and the seven line buffers111,112, . . .116is formed as shown inFIG. 2.

When a clock signal is given, the registers R00, R01, . . . R066each transfer pixel data stored therein to a post-stage register. The clock signal also triggers each of the line buffers111,112, . . .116to receive new pixel data from an ante-stage register, and to transfer pixel data received (N-7) clocks ago to a post-stage register. That is, pixel data is stored in the line buffer during a time interval of (N-7) clocks, and is thereafter transferred to a post-stage register.

With the configuration of the image memory11discussed above, pixel data given to the image memory11is first stored in the register R00, thereafter moving to a serially-connected post-stage register to be stored therein at the time of each clock, and is then transferred from the register R06to the line buffer111. Pixel data stored in the line buffer111(N-7) clocks ago is transferred to the register R10, which is timed to coincide with the transfer of the pixel data from the register R06to the line buffer111. Likewise, pixel data given from the register R16is transferred to and stored in the line buffer112, and is then transferred to the register R20after the expiration of a time interval of (N-7) clocks. Pixel data given to the image memory11thereby passes through each register and each line buffer to be eventually stored in the register R66. The pixel data stored in the register66is abandoned when a next clock signal is given.

Thus in the49registers R00, R01, . . . R66, pixel data are temporarily stored in a 7×7 square, at the center of which the register R33storing a pixel of interest is located. This 7×7 square is applied for use in the filtering of the first preferred embodiment.

When pixel data stored in each register RXY (X and Y are integers from 0 to 6) is represented as PXY, pixel data stored in the registers R00, R01, . . . R66are respectively represented as P00, P01, . . . P66. The resultant pixel arrangement in squares relative to a pixel of interest located at the center is shown inFIG. 3. The pixel data P33corresponds to the data of a pixel of interest.

Three pixel groups relative to the pixel of interest located at the center are defined as follows. A first pixel group PA1contains pixels arranged in a 3×3 square relative to the pixel of interest with the pixel data P33located at the center. More specifically, the pixel group PA1contains9pixels having pixel data P22, P23, P24, P32, P33, P34, P42, P43and P44. A second pixel group PA2contains pixels arranged in a 5×5 square relative to the pixel of interest with the pixel data P33located at the center. More specifically, the pixel group PA2contains 25 pixels having pixel data P11through P15, P21through P25, P31through P35, P41through P45and P51through P55. A third pixel group PA3contains pixels arranged in a 7×7 square relative to the pixel of interest with the pixel data P33located at the center. More specifically, the pixel group PA3contains49pixels having pixel data P00through P06, P10through P16, P20through P26, P30through P36, P40through P46, P50through P56, and P60through P66. Namely, the second pixel group PA2contains the first pixel group PA1, and the third pixel group PA3contains the second pixel group PA2.

FIG. 4is a flow chart showing an image filtering method according to the first preferred embodiment. With reference toFIGS. 1 and 4, in step s1, the reference value calculation circuit12receives the pixel data P00, P01, . . . P66of 49 pixels respectively stored in the registers R00, R01, . . . R66. Namely, pixel data in a 7×7 square containing the pixel data P33of the pixel of interest and those of its neighboring pixels are received.

Next, the reference value calculation circuit12calculates a first reference pixel value BV1based on the first pixel group PA1, and a second reference pixel value BV2based on the third pixel group PA3. The first reference pixel value BV1is the average pixel value of all the pixels contained in the first pixel group PA1. The second reference pixel value BV2is the average pixel value of all the pixels contained in the third pixel group PA3.

The reference value calculation circuit12outputs the calculated second reference pixel value BV2to the judgment circuit13, and outputs the calculated first reference pixel value BV1to the difference pixel value calculation circuit14.

Next, in step s2, the judgment circuit13receives the pixel data of the 25 pixels contained in the second pixel group PA2from the image memory11. The pixel values of these 25 pixels are each compared in magnitude with the second reference pixel value BV2. Then the second pixel group PA2is divided into two sub-groups: one sub-group contains pixels having pixel values greater than the second reference pixel value BV2; and the other sub-group contains pixels having pixel values smaller than the second reference pixel value BV2. Then in step s3, one of these sub-groups containing the pixel data P33of the pixel of interest is selected as a target set EA. To describe this from a different view, the pixel value of the pixel data P33and the second reference pixel value BV2are compared in magnitude. When the pixel value of the pixel data P33is greater than the second reference pixel value BV2, a set of pixels with pixel values greater than the second reference pixel value BV2is selected as the target set EA. Conversely, when the pixel value of the pixel data P33is smaller than the second reference pixel value BV2, a set of pixels with pixel values smaller than the second reference pixel value BV2is selected as the target set EA.

After the target set EA is selected, the judgment circuit13outputs the information related to the target set EA to the difference pixel value calculation circuit14. The information related to the target set EA specifies pixels contained in the target set EA or, specifies registers that store pixels contained in the target set EA.

Next, in step s4, the difference pixel value calculation circuit14receives the pixel data of pixels contained in the target set EA. Then the absolute value DV of the difference between the pixel value of each pixel in the target set EA and the first reference pixel value BV1is calculated. When two pixel values targeted for the calculation are identified as PV1and PV2, the absolute value of difference is obtained by calculating the difference between these two pixel values (PV1−PV2), and then calculating the absolute value of this difference (|PV1−PV2|). The difference pixel value calculation circuit14outputs the absolute value DV obtained with respect to each pixel in the target set EA to the minimum value selection circuit15. The difference pixel value calculation circuit14also outputs information together with the absolute value DV that indicates the corresponding pixel subjected to the calculation.

The minimum value selection circuit15selects a minimum from the received absolute values DV. When the pixel data PXY giving the minimum absolute value DV is specified, the minimum value selection circuit15obtains this pixel data PXY as corrective pixel data from the image memory11. Then in step s5, the minimum value selection circuit15outputs the pixel data PXY as corrective pixel data that has been received from the image memory11.

The corrective pixel data given from the image filter10is applied for use as the pixel value of the pixel of interest, whereby filtering is completed with respect to the pixel of interest. Subsequently, new pixel data is given to the image memory11triggered by a next clock signal, and pixel data stored in each register moves to a post-stage register. The pixel having the new pixel data replacing the former pixel data in the register R33is applied for use as a new pixel of interest to realize the same filtering.

FIG. 5simply illustrates the filtering in the first preferred embodiment. InFIG. 5, small circles show the pixels contained in the second pixel group PA2. These pixels are located based on the magnitude of the pixel values thereof (pixels on the upper side ofFIG. 5have greater pixel values). The second pixel group PA2is divided into two sub-groups with respect to the second reference pixel value BV2. The sub-group including the pixel of interest having the pixel data P33is selected as the target set EA. A pixel having a pixel value closest to the first reference pixel value BV1(inFIG. 5, pixel data P44) is selected as a corrective pixel from the target set EA.

Pixel data to be subjected to the filtering has not been specifically limited. As an example, brightness data may be applied for use in the processing. Alternatively, when a color image is a target for the processing, data of its color component may be employed. Still alternatively, data of several color components may be employed.

As discussed, according to the first preferred embodiment, the second reference pixel value BV2is calculated based on the third pixel group PA3covering a wide area in the neighborhood of a pixel of interest, and the target set EA is determined based on the second reference pixel value BV2. This means pixel variations in the wide area in the neighborhood of the pixel of interest can be taken into consideration for defining the target set EA. The first reference pixel value BV1is calculated based on the first pixel group PA1covering a limited area in the neighborhood of the pixel of interest, and a pixel with a value close to the first reference pixel value BV1is applied for use as a corrective pixel. Thus the corrective pixel can be responsive to local pixel variations around the pixel of interest. Further, the target set EA is selected from the second pixel group PA2covering an area smaller than that of the third pixel group PA3. Thus the required amount of calculation at the difference pixel value calculation circuit14and the minimum value selection circuit15can be reduced.

Next, modifications of the image filter10according to the first preferred embodiment will be described. In the foregoing description of the first preferred embodiment, the average values in the first pixel group PA1and third pixel group PA3are respectively applied as the first and second reference pixel values BV1and BV2. The reference pixel values BV1and BV2may be obtained by alternative calculation.

A first modification employs a weighted average value. By way of example, a weighting factor may be determined based on a distance from the pixel of interest with the pixel data P33: a pixel value of a pixel close to the pixel of interest with the pixel data P33is given a high weighting factor whereas a pixel value of a pixel far from the pixel of interest is given a low weighting factor. Thereafter the average of the weighted pixel values is calculated. As a specific example, the pixel of interest is given a weighting factor3, eight pixels with the pixel data P22, P23, P24, P32, P34, P42, P43and P44adjacent to the pixel of interest are each given a weighting factor2, and the pixels arranged outside these eight pixels are each given a weighting factor1. The pixel values of these pixels are multiplied by the respective weighting factors and the resultant pixel values are added. Then the sum is divided by the number of pixels to obtain a weighted average of pixel values.

A second modification employs a median value. Pixels values of a pixel of interest and its neighboring pixels are sorted in numerical order, and the middle pixel value is applied for use as a reference pixel value.

A third modification employs a weighted median value. As an example, assuming that the pixel of interest with the pixel data P33is given a weighting factor2, and that eight pixels with the pixel data P22, P23, P24, P32, P34, P42, P43and P44adjacent to the pixel of interest are each given a weighting factor1, the weighted median value of the first pixel group PA1is calculated. In this case, considering the pixel of interest as two pixels, the pixel values of the ten pixels with the pixel data P22, P23, P24, P32, P33, P33, P34, P42, P43and P44are sorted in numerical order. The middle pixel value is applied for use as a reference pixel value.

A reference pixel value may be calculated by any of the first, second and third modifications. As an example, either the first or second reference pixel value PA1or PA2may be calculated by any of the first, second and third modifications. Alternatively, both the first and second reference pixel values PA1and PA2may be calculated by any of the first, second and third modifications.

Second Preferred Embodiment

Next, a second preferred embodiment of the present invention will be described. Like in the first preferred embodiment, pixel data are stored in the image memory11and the reference value calculation circuit12calculates the first and second reference pixel values BV1and BV2in step s1. Then in step s2, the judgment circuit13receives the pixel data contained in the second pixel group PA2from the image memory11, and divides the second pixel group PA2into two sub-groups with respect to the second reference pixel value BV2.

Next, in step s3, the judgment circuit13selects one of these two sub-groups containing a larger number of pixels as the target set EA. Namely, of the sub-group of pixels with pixel values greater than the second reference pixel value BV2and the sub-group of pixels with pixel values smaller than the reference pixel value BV2, the sub-group containing a larger number of pixels is selected as the target set EA.

The subsequent processes in steps s4and s5described in the first preferred embodiment are also followed in the second preferred embodiment. The difference pixel value calculation circuit14calculates the absolute value DV of the difference between the pixel value of each pixel contained in the target set EA and the first reference pixel value BV1. The minimum value selection circuit15selects a minimum from the absolute values DV, to thereby specify a corrective pixel.

FIG. 6simply illustrates the filtering in the second preferred embodiment. InFIG. 6, the second pixel group PA2is divided into two sub-groups with respect to the second reference pixel value BV2. The sub-group including a larger number of pixels is selected as the target set EA. A pixel having a pixel value closest to the first reference pixel value BV1(inFIG. 6, a pixel with pixel data P22) is selected as a corrective pixel from the target set EA.

As discussed, according to the second preferred embodiment, the second reference pixel value BV2is calculated based on the third pixel group PA3covering a wide area in the neighborhood of a pixel of interest, and the target set EA is determined based on the second reference pixel value BV2. This means pixel variations in the wide area in the neighborhood of the pixel of interest can be taken into consideration for defining the target set EA. The first reference pixel value BV1is calculated based on the first pixel group PA1covering a limited area in the neighborhood of the pixel of interest, and a pixel with a value close to the first reference pixel value BV1is applied for use as a corrective pixel. Thus the corrective pixel can be responsive to local pixel variations around the pixel of interest. Further, the target set EA is selected from the second pixel group PA2covering an area smaller than that of the third pixel group PA3. Thus the required amount of calculation at the difference pixel value calculation circuit14and the minimum value selection circuit15can be reduced.

Like in the first preferred embodiment, a weighted average value, a median value or a weighted median value may be applied for use as the first and second reference pixel values BV1and BV2.

Third Preferred Embodiment

Next, a third preferred embodiment of the present invention will be described. Like in the first preferred embodiment, pixel data are stored in the image memory11and the reference value calculation circuit12calculates the first and second reference pixel values BV1and BV2in step s1. Then in step s2, the judgment circuit13receives the pixel data contained in the second pixel group PA2from the image memory11, and divides the second pixel group PA2into two sub-groups with respect to the second reference pixel value BV2.

Then in step s3, the judgment circuit12selects one of these two sub-groups as the target set EA. That is, the judgment circuit12selects either the sub-group containing pixels with pixel values greater than the second reference pixel value BV2or the sub-group containing pixels with pixel values smaller than the second reference pixel value BV2as the target set EA. In the sub-group selected as the target set EA, the first reference pixel value BV1exists within a range of not less than a minimum pixel value and not more than-a maximum pixel value. To describe this from a different view, the first reference pixel value BV1and the second reference pixel value BV2are compared in magnitude. When the first reference pixel value BV1is greater than the second reference pixel value BV2, the sub-group containing pixels with pixel values greater than the second reference pixel value BV2is selected as the target set EA. When the first reference pixel value BV1is smaller than the second reference pixel value BV2, the sub-group containing pixels with pixel values smaller than the second reference pixel value BV2is selected as the target set EA. Both the first and second reference pixel values BV1and BV2are given from the reference value calculation circuit12to the judgment circuit13in the third preferred embodiment, whereas only the second reference pixel value BV2is shown to be given from the reference value calculation circuit12to the judgment circuit13inFIG. 1.

The subsequent processes in steps s4and s5described in the first preferred embodiment are also followed in the second preferred embodiment. The difference pixel value calculation circuit14calculates the absolute value DV of the difference between the pixel value of each pixel contained in the target set EA and the first reference pixel value BV1. The minimum value selection circuit15selects a minimum from the absolute values DV, to thereby specify a corrective pixel.

FIG. 7simply illustrates the filtering in the third preferred embodiment. InFIG. 7, the second pixel group PA2is divided into two sub-groups with respect to the second reference pixel value BV2. One of these two sub-groups is selected as the target set EA. In the sub-group selected as the target set EA, the first reference pixel value BV1exists within a range of not less than a minimum pixel value and not more than a maximum pixel value. A pixel with a pixel value closest to the first reference pixel value BV1(inFIG. 7, a pixel with pixel data P35) is selected as a corrective pixel from the target set EA.

As discussed, according to the third preferred embodiment, the second reference pixel value BV2is calculated based on the third pixel group PA3covering a wide area in the neighborhood of a pixel of interest, and the target set EA is determined based on the second reference pixel value BV2. This means pixel variations in the wide area in the neighborhood of the pixel of interest can be taken into consideration for defining the target set EA. The first reference pixel value BV1is calculated based on the first pixel group PA1covering a limited area in the neighborhood of the pixel of interest, and a pixel with a value close to the first reference pixel value BV1is applied for use as a corrective pixel. Thus the corrective pixel can be responsive to local pixel variations around the pixel of interest. Further, the target set EA is selected from the second pixel group PA2covering an area smaller than that of the third pixel group PA3. Thus the required amount of calculation at the difference pixel value calculation circuit14and the minimum value selection circuit15can be reduced.

Like in the first preferred embodiment, a weighted average value, a median value or a weighted median value may be applied for use as the first and second reference pixel values BV1and BV2.

Other Modifications

In each of the preferred embodiments described above, the second pixel group PA2contains the first pixel group PA1while covering an area wider than that of the first pixel group PA1. Further, the third pixel group PA3contains the second pixel group PA2while covering an area wider than that of the second pixel group PA2. Modifications of the relationships among the first, second and third pixel groups PA1, PA2and PA3may be made as shown inFIGS. 8,9and10.

FIG. 8shows a modification in which the first and second pixel groups PA1and PA2consists of the same pixels.FIG. 9shows a modification in which the second and third pixel groups PA2and PA3consists of the same pixels.FIG. 10shows a modification in which the first, second and third pixel groups PA1, PA2and PA3consists of the same pixels. In either case, the second reference pixel value BV2is calculated based on the third pixel group PA3, and the second pixel group PA2is divided with respect to the second reference pixel value BV2to define the target set EA. The first reference pixel value BV1is calculated based on the first pixel group PA1, and a pixel with a pixel value close to the first reference pixel value BV1is selected as a corrective pixel from the target set EA. The modified relationships among the pixel groups shown inFIGS. 8,9and10allow simpler processing relative to the first, second and third preferred embodiments, while they may be less effective according to the type of images.

Pixel groups may be defined in different ways. The first, second and third pixel groups PA1, PA2and PA3have been described as being defined in squares. Alternatively, the first, second and third pixel groups PA1, PA2and PA3may be defined in circles or ovals, for example.

Still alternatively, a pixel group may be defined three-dimensionally. The three-dimensional pixel group is defined as containing pixels of a plurality of frames in a time-base direction in addition to pixels in the direction of a plane.FIG. 11shows an example of three-dimensional pixel groups.FIG. 11shows the first pixel group PA1defined three-dimensionally and containing the pixel of interest with the pixel data P33, the second pixel group PA2defined three-dimensionally and containing the first pixel group PA1, and the third pixel group PA3defined three-dimensionally and containing the second pixel group PA2. In order to handle these pixel groups, an image memory should have registers and buffers for accumulating pixels of a plurality of frames in a time-base direction in addition to pixels in a planar region.

The first and second pixel groups PA1and PA2may be pixel groups in planar regions whereas only the third pixel group PA3may be a three-dimensional pixel group. Alternatively, the first pixel group PA1may be a pixel group in a planer region whereas the second and third pixel groups PA2and PA3may be three-dimensional pixel groups. Still alternatively, all the first, second and third pixel groups PA1, PA2and PA3may be three-dimensional pixel groups.

In each of the preferred embodiments described above, the image filtering is realized by hardware circuits. Namely, the image filtering is realized by hardware circuits including the reference value calculation circuit12, judgment circuit13, difference pixel value calculation circuit14, minimum value selection circuit15and the like. The processing at each of these circuits may be alternatively realized by a computer program.FIG. 12is a block diagram showing the configuration of the image filter10according to such a modification. With reference toFIG. 12, the image filter10is a computer comprising the above-discussed image memory11, a CPU100and a memory110storing a computer program PRG. The CPU100reads and executes the computer program PRG stored in the memory110, whereby functional blocks including a reference value calculation part120, a judgment part130, a difference pixel value calculation part140and a minimum value selection part150are realized in the CPU100. The reference value calculation part120, judgment part130, difference pixel value calculation part140and minimum value selection part150are responsible for the processing performed by the above-discussed reference value calculation circuit12, judgment circuit13, difference pixel value calculation circuit14and minimum value selection circuit15, respectively. The CPU100thereby becomes operative to perform the above-described image filtering in each of the first, second and third preferred embodiments. The memory110may be a storage device contained on a substrate such as a ROM (read only memory). Alternatively, the memory110may be a recording medium capable of being detachably attached to the image filter10such as a CD-ROM or a flexible disk. In the description of each of the first, second and third preferred embodiments, the image memory11is formed by registers and line buffers. Alternatively, the image memory11may be a RAM having a large capacity for storing pixel data in a square. In this case, the pixel data stored in the RAM is processed by a computer program to realize image filtering.