JP2003296730A - Data processor, data processing method, image processor and image processing method - Google Patents

Data processor, data processing method, image processor and image processing method

Info

Publication number
JP2003296730A
JP2003296730A JP2002099218A JP2002099218A JP2003296730A JP 2003296730 A JP2003296730 A JP 2003296730A JP 2002099218 A JP2002099218 A JP 2002099218A JP 2002099218 A JP2002099218 A JP 2002099218A JP 2003296730 A JP2003296730 A JP 2003296730A
Authority
JP
Japan
Prior art keywords
value
data
median
group
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002099218A
Other languages
Japanese (ja)
Inventor
Tomoyuki Hamamura
倫行 浜村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002099218A priority Critical patent/JP2003296730A/en
Publication of JP2003296730A publication Critical patent/JP2003296730A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To quickly calculate a median by a simple method. <P>SOLUTION: Nine pieces of data are divided into three sets with three pieces of data as one set, data are rearranged in order of a numerical value in each set, the data are rearranged in order of the value of second data of each rearranged set, and data that is not included in a target is determined to reduce data and the number of times to be compared. <P>COPYRIGHT: (C)2004,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】この発明は、メディアンフィ
ルタを用いて画像データ等のデータ処理を行うデータ処
理装置、データ処理方法、画像処理装置、画像処理方法
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing device, a data processing method, an image processing device, and an image processing method for processing data such as image data using a median filter.

【0002】[0002]

【従来の技術】従来、各画素周辺に一定の大きさの画素
領域(ウィンドウ)を設定し、各画素が持っているデー
タ(画素値)をウィンドウ内の全データの中央値(メデ
ィアン)に置き換える処理を行うメディアンフィルタが
知られている。メディアンフィルタは画像データの解像
度を損なうことなくスパイクノイズのような孤立点を除
去できる特長を持っており、コンピュータ上の画像処理
ソフトウェアの1つの機能としてよく使われてきた。
2. Description of the Related Art Conventionally, a pixel area (window) of a certain size is set around each pixel, and the data (pixel value) of each pixel is replaced with the median value (median) of all the data in the window. Median filters that perform processing are known. The median filter has the feature that it can remove isolated points such as spike noise without impairing the resolution of image data, and has been often used as one function of image processing software on computers.

【0003】メディアンフィルタの一般的な実現方法と
しては、ウィンドウ内のデータをソートし、中間順位と
なったデータをメディアンとする方法がある。しかし、
ソート処理は処理量が多いという問題がある。そこで、
メディアンフィルタ処理を高速に行うための方法が様々
に提案されている。
As a general method of implementing the median filter, there is a method of sorting the data in the window and using the data in the intermediate rank as the median. But,
There is a problem that the sorting process has a large processing amount. Therefore,
Various methods have been proposed for performing median filtering at high speed.

【0004】特開2001−45507に示されるもの
は、N×Mサイズのウィンドウに適用されるもので、ウ
ィンドウ内の行ごとの中央値を求め、各行の中央値の中
央値をメディアンの近似値とするものである。その際、
隣接画素の処理結果を用いて処理を高速化している。
The technique disclosed in Japanese Patent Laid-Open No. 2001-45507 is applied to a window of size N × M. The median value of each row in the window is calculated, and the median value of the median values of the rows is used as an approximate median value. It is what that time,
The processing speed is increased by using the processing result of the adjacent pixels.

【0005】特開2001−167262に示されるも
のは、N×Mサイズのウィンドウに適用されるもので、
ウィンドウ内の画素値をソートしてメディアンを求める
ものである。隣接画素のメディアンを求める際にソート
した結果を用い、その結果から不要な画素値を除いたも
のと、新たに付け加わる画素のみでソートしたものとを
合成することで、現在の画素におけるウィンドウ内の画
素値のソート結果を得ている。ハードウェアによる実装
を想定している。
The technique disclosed in Japanese Patent Laid-Open No. 2001-167262 is applied to an N × M size window.
The median is calculated by sorting the pixel values in the window. By using the result of sorting when calculating the median of adjacent pixels, and combining the result with unnecessary pixel values removed and the result of sorting with only newly added pixels, the current pixel within the window The result of sorting the pixel values of is obtained. It is assumed to be implemented by hardware.

【0006】特開平5−300372に示されるもの
は、N×Mサイズのウィンドウに適用されるもので、ウ
ィンドウ内の各行をソートし、その後各列をソートし、
その後斜め列の中央値を得て、メディアンの近似値とし
ている。3×3サイズの場合は正確なメディアンとな
る。
The method disclosed in Japanese Patent Laid-Open No. 5-300372 is applied to a window of size N × M, in which each row in the window is sorted, and then each column is sorted.
After that, the median of the diagonal rows is obtained and used as the median approximation. In the case of 3x3 size, the median is accurate.

【0007】特開平5−128253に示されるもの
は、N×Mサイズのウィンドウに適用されるもので、ウ
ィンドウ内の各行をソートし、その後各行の最大値の中
での最大値を順に取っていくことで、メディアンに限ら
ず任意の順位の画素値を得ている。ハードウェアによる
実装を想定している。
The method disclosed in Japanese Patent Laid-Open No. 5-128253 is applied to a window of size N × M. Each row in the window is sorted, and then the maximum value among the maximum values of each row is taken in order. By going through, the pixel value of an arbitrary rank is obtained not only by the median. It is assumed to be implemented by hardware.

【0008】特開平5−233804に示されるもの
は、N×Mサイズのウィンドウに適用されるもので、ウ
ィンドウ内の画素値をソートしてメディアンを求めるも
のである。隣接画素のメディアンを求める際にソートし
た結果を用い、その結果から不要な画素を除き、新たな
画素値を1画素ずつ付け加えることで、現在の画素にお
けるウィンドウ内の画素値のソート結果を得ている。ハ
ードウェアによる実装を想定している。
The technique disclosed in Japanese Patent Laid-Open No. 5-233804 is applied to an N × M size window, in which pixel values in the window are sorted to obtain a median. Use the result of sorting when calculating the median of adjacent pixels, remove unnecessary pixels from the result, and add a new pixel value one pixel at a time to obtain the result of sorting the pixel values in the window at the current pixel. There is. It is assumed to be implemented by hardware.

【0009】特開平6−274617に示されるもの
は、3×3サイズのウィンドウに適用されるもので、ウ
ィンドウ内の画素値をソートしてメディアンを求めるも
のである。まずウィンドウ内の各列ごとにソートし、1
列ずつ合成していくことで、ウィンドウ内の全画素にお
けるソート結果を得ている。その際、隣接画素の処理結
果を用いて処理を高速化している。
The method disclosed in Japanese Patent Laid-Open No. 6-274617 is applied to a 3 × 3 size window, and the pixel values in the window are sorted to obtain the median. First, sort by each column in the window, 1
By synthesizing columns, the sorting result for all pixels in the window is obtained. At that time, the processing speed is increased by using the processing results of the adjacent pixels.

【0010】しかしながら、メディアンフィルタは1画
素ごとに行われる処理であるため、より高速な方法が望
まれる。また、ソフトウェア上で用いられる場合、並列
な処理が不可能であることが多く、その場合でも高速に
行うことのできる方法が望まれる。また、より性能を向
上させるためには、近似値であるより、正確な中央値を
求めることが望まれる。
However, since the median filter is a process performed for each pixel, a faster method is desired. Further, when used in software, parallel processing is often impossible, and even in that case, a method capable of high speed processing is desired. Further, in order to further improve the performance, it is desired to obtain an accurate median value rather than an approximate value.

【0011】特開2001−45507に示されるもの
は、高速ではあるが、近似値であるため、望ましくな
い。特開2001−167262に示されるものは、ハ
ードウェアにおける実装を想定しており、同様の方法の
ソフトウェア上における動作は十分高速であるとは言え
ない。
The method disclosed in Japanese Patent Laid-Open No. 2001-45507 is not desirable because it is a high speed but an approximate value. The device disclosed in Japanese Patent Laid-Open No. 2001-167262 is assumed to be implemented in hardware, and it cannot be said that the operation of the similar method on software is sufficiently high speed.

【0012】特開平5−300372に示されるもの
は、十分高速であるとは言えない。特開平5−1282
53に示されるものは、ハードウェアにおける実装を想
定しており、同様の方法のソフトウェア上における動作
は十分高速であるとは言えない。
The device disclosed in Japanese Patent Laid-Open No. 5-300372 cannot be said to be sufficiently high speed. Japanese Patent Laid-Open No. 5-1282
The one shown at 53 is assumed to be implemented in hardware, and it cannot be said that the operation in software by the similar method is sufficiently fast.

【0013】特開平5−233804に示されるもの
は、ハードウェアにおける実装を想定しており、同様の
方法のソフトウェア上における動作は十分高速であると
は言えない。特開平6−274617に示されるもの
は、十分高速であるとは言えない。したがって、簡単な
方法で高速にメディアンを求めることができるものが要
望されている。
The device disclosed in Japanese Patent Laid-Open No. 5-233804 is assumed to be implemented in hardware, and it cannot be said that the operation of the similar method on software is sufficiently high speed. The device disclosed in JP-A-6-274617 cannot be said to be sufficiently high speed. Therefore, there is a demand for a median that can be obtained at high speed by a simple method.

【0014】[0014]

【発明が解決しようとする課題】この発明は、メディア
ンフィルタを用いて画像データ等のデータ処理を行うも
のにおいて、簡単な方法でかつ高速に、複数のデータの
中央値を得ることができることを目的としている。
SUMMARY OF THE INVENTION It is an object of the present invention to obtain a median value of a plurality of data in a simple method and at high speed in a data processing such as image data using a median filter. I am trying.

【0015】[0015]

【課題を解決するための手段】この発明のデータ処理装
置は、9個のデータを数値順にした際の中央のデータの
値を得るものにおいて、9個のデータを、3個のデータ
を一組とする3組に分け、各組ごとに数値の大きい順
に、第1データ、第2データ、第3データに並べ替え、
この並び替えた各組の第2データの値の大きい順に、第
1組、第2組、第3組に設定する設定手段と、第1組第
3データの値よりも第2組第2データの値が大きく、か
つ第2組第2データの値よりも第3組第1データの値が
大きい場合、第2組第2データを、上記9個のデータを
数値順にした際の中央のデータと判断する第1の判断手
段と、第1組第3データの値よりも第2組第2データの
値が小さく、かつ第2組第2データの値よりも第3組第
1データの値が小さい場合、第2組第2データを、上記
9個のデータを数値順にした際の中央のデータと判断す
る第2の判断手段と、第1組第3データの値よりも第2
組第2データの値が小さく、かつ第2組第2データの値
よりも第3組第1データの値が大きい場合、第1組第3
データ、第2組第3データ、第3組第1データの中で一
番大きな値のデータを、9個のデータを数値順にした際
の中央のデータと判断する第3の判断手段と、第1組第
3データの値よりも第2組第2データの値が大きく、か
つ第2組第2データの値よりも第3組第1データの値が
小さい場合、第1組第3データ、第2組第3データ、第
3組第1データの中で一番大きな値のデータを、9個の
データを数値順にした際の中央のデータと判断する第4
の判断手段とを有する。
The data processing apparatus of the present invention obtains the value of the central data when 9 pieces of data are arranged in numerical order, and sets 9 pieces of data and 3 pieces of data as a set. The data is sorted into the first data, the second data, and the third data in descending order of numerical value for each group.
Setting means for setting the first set, the second set, and the third set in the descending order of the value of the second data of each sorted set, and the second set of the second data rather than the value of the first set of the third data. Is large and the value of the first data of the third group is larger than the value of the second data of the second group, the second data of the second group is the central data when the above nine data are arranged in numerical order. And a value of the third data set that is smaller than the value of the second data set of the second group and smaller than the value of the second data set of the first set. Is smaller than the value of the third data of the first set, the second determination means for determining the second data of the second set as the central data when the above nine data are arranged in numerical order.
When the value of the second data of the set is small and the value of the first data of the third set is larger than the value of the second data of the second set, the third data of the first set
A third judging means for judging the data having the largest value among the data, the third data of the second group, and the first data of the third group to be the central data when the nine data are arranged in numerical order; When the value of the second set of second data is larger than the value of the first set of third data and the value of the third set of first data is smaller than the value of the second set of second data, the first set of third data, The data of the largest value in the third data of the second group and the first data of the third group is judged to be the central data when the nine data are arranged in numerical order.
And the judgment means of.

【0016】この発明のデータ処理装置は、9個のデー
タの中央値を得るものにおいて、9個のデータを、3個
のデータを一組とする3組に分け、各組ごとにデータ値
の昇順もしくは降順に並べ替える第1の処理手段と、中
央値が最大の第1組と、第1組の次に大きな中央値を持
つ第2組と、最小の中央値を持つ第3組とを判断する第
1の判断手段と、第1組の最小値と第2組の中央値の大
小関係と、第2組の中央値と第3組の最大値の大小関係
とを調べる第2の処理手段と、この第2の処理手段によ
り第1組の最小値が第2組の中央値以上かつ第2組の中
央値が第3組の最大値以上であった場合、あるいは第1
組の最小値が第2組の中央値以下かつ第2組の中央値が
第3組の最大値以下であった場合に、第2組の中央値を
上記9個のデータの中央値と判断する第2の判断手段
と、上記第2の処理手段により第1組の最小値が第2組
の中央値より大きくかつ第3組の最大値が第2組の中央
値より大きい場合、第1組の最小値と第3組の最大値と
第2組の最大値の中の最小値を上記9個のデータの中央
値と判断する第3の判断手段と、上記第2の処理手段に
より第1組の最小値が第2組の中央値より小さくかつ第
3組の最大値が第2組の中央値より小さい場合、第1組
の最小値と第3組の最大値と第2組の最小値の中の最大
値を上記9個のデータの中央値と判断する第4の判断手
段とを有する。
The data processing apparatus of the present invention obtains the median value of nine pieces of data, divides the nine pieces of data into three sets of three pieces, and sets the data value of each set. The first processing means for rearranging in ascending or descending order, the first set having the largest median value, the second set having the next largest median value after the first set, and the third set having the smallest median value are provided. Second processing for checking the first determining means for determining, the magnitude relationship between the minimum value of the first set and the median value of the second set, and the magnitude relationship between the median value of the second set and the maximum value of the third set Means and the second processing means, if the minimum value of the first set is greater than or equal to the median value of the second set and the median value of the second set is greater than or equal to the maximum value of the third set, or
If the minimum value of the set is less than or equal to the median value of the second set and the median value of the second set is less than or equal to the maximum value of the third set, then the median value of the second set is determined to be the median value of the above nine data. If the minimum value of the first set is larger than the median value of the second set and the maximum value of the third set is larger than the median value of the second set by the second determining means and the second processing means, The third judgment means for judging the minimum value of the set, the maximum value of the third set, and the maximum value of the second set as the median value of the nine data, and the second processing means. If the minimum value of one set is less than the median value of the second set and the maximum value of the third set is less than the median value of the second set, then the minimum value of the first set, the maximum value of the third set and the second set of And a fourth judging means for judging the maximum value among the minimum values as the median value of the nine data.

【0017】この発明の画像処理装置は、入力画像の各
画素に対し、各画素を中心とする3×3サイズのウィン
ドウ内の9個の画素値の中央値を、出力画像における各
画素の画素値とするものにおいて、上記ウィンドウ内の
画素を行方向または列方向に並ぶ3画素からなる3組に
分けたとき、上記ウィンドウの3組のうち、上記方向と
異なる方向に隣接する処理済の画素を中心とする前回の
ウィンドウ内に含まれない1組を昇順もしくは降順に並
べ替える第1の処理手段と、上記前回のウィンドウ内に
含まれる2組について、上記処理済の画素の処理時に、
昇順もしくは降順に並べ替えた結果を保持している記憶
手段と、中央値が最大の第1組と、第1組の次に大きな
中央値を持つ第2組と、最小の中央値を持つ第3組とを
判断する第1の判断手段と、第1組の最小値と第2組の
中央値の大小関係と、第2組の中央値と第3組の最大値
の大小関係とを調べる第2の処理手段と、この第2の処
理手段により第1組の最小値が第2組の中央値以上かつ
第2組の中央値が第3組の最大値以上であった場合、あ
るいは第1組の最小値が第2組の中央値以下かつ第2組
の中央値が第3組の最大値以下であった場合に、第2組
の中央値を上記9個の画素の中央値と判断する第2の判
断手段と、上記第2の処理手段により第1組の最小値が
第2組の中央値より大きくかつ第3組の最大値が第2組
の中央値より大きい場合、第1組の最小値と第3組の最
大値と第2組の最大値の中の最小値を上記9個の画素の
中央値と判断する第3の判断手段と、上記第2の処理手
段により第1組の最小値が第2組の中央値より小さくか
つ第3組の最大値が第2組の中央値より小さい場合、第
1組の最小値と第3組の最大値と第2組の最小値の中の
最大値を上記9個の画素の中央値と判断する第4の判断
手段とを有する。
According to the image processing apparatus of the present invention, for each pixel of the input image, the median value of nine pixel values in a 3 × 3 size window centered on each pixel is defined as the pixel value of each pixel in the output image. When the pixels in the window are divided into three groups of three pixels arranged in the row direction or the column direction, the processed pixels that are adjacent in a direction different from the above direction among the three groups of the window. The first processing means for rearranging one set that is not included in the previous window centered on the ascending order or the descending order, and two sets included in the previous window when processing the processed pixels,
A storage means for holding the results sorted in ascending or descending order, a first set having the largest median value, a second set having the next largest median value of the first set, and a second set having the smallest median value. The first determination means for determining three sets, the size relationship between the minimum value of the first set and the median value of the second set, and the size relationship of the median value of the second set and the maximum value of the third set are examined. The second processing means, and when the minimum value of the first set is equal to or larger than the median value of the second set and the median value of the second set is equal to or larger than the maximum value of the third set by the second processing means, or When the minimum value of one set is less than or equal to the median value of the second set and the median value of the second set is less than or equal to the maximum value of the third set, the median value of the second set is the median value of the nine pixels. The minimum value of the first set is larger than the median value of the second set and the maximum value of the third set is larger than the median value of the second set by the second judging means for judging and the second processing means. In this case, a third judging means for judging the minimum value of the minimum value of the first set, the maximum value of the third set and the maximum value of the second set as the median value of the nine pixels, and the second judgment means. When the minimum value of the first set is smaller than the median value of the second set and the maximum value of the third set is smaller than the median value of the second set by the processing means, the minimum value of the first set and the maximum value of the third set And a fourth judgment means for judging the maximum value of the minimum values of the second set as the median value of the nine pixels.

【0018】この発明の画像処理装置は、入力画像の各
画素に対し、各画素を中心とする3×3サイズのウィン
ドウ内の9個の画素値の中央値を、出力画像における各
画素の画素値とするものにおいて、入力画像の3行もし
くは3列の画素を記憶する記憶手段と、記憶された画素
を、列方向もしくは行方向に並ぶ3画素ずつの組に分
け、各組ごとに画素値の昇順もしくは降順に並べ替える
第1の処理手段と、中央値が最大の第1組と、第1組の
次に大きな中央値を持つ第2組と、最小の中央値を持つ
第3組とを判断する第1の判断手段と、第1組の最小値
と第2組の中央値の大小関係と、第2組の中央値と第3
組の最大値の大小関係とを調べる第2の処理手段と、こ
の第2の処理手段により第1組の最小値が第2組の中央
値以上かつ第2組の中央値が第3組の最大値以上であっ
た場合、あるいは第1組の最小値が第2組の中央値以下
かつ第2組の中央値が第3組の最大値以下であった場合
に、第2組の中央値を上記9個の画素の中央値と判断す
る第2の判断手段と、上記第2の処理手段により第1組
の最小値が第2組の中央値より大きくかつ第3組の最大
値が第2組の中央値より大きい場合、第1組の最小値と
第3組の最大値と第2組の最大値の中の最小値を上記9
個の画素の中央値と判断する第3の判断手段と、上記第
2の処理手段により第1組の最小値が第2組の中央値よ
り小さくかつ第3組の最大値が第2組の中央値より小さ
い場合、第1組の最小値と第3組の最大値と第2組の最
小値の中の最大値を上記9個の画素の中央値と判断する
第4の判断手段とを有する。
In the image processing apparatus of the present invention, for each pixel of the input image, the median value of nine pixel values in a 3 × 3 size window centered on each pixel is set as the pixel value of each pixel in the output image. In terms of values, storage means for storing pixels in three rows or three columns of the input image and the stored pixels are divided into groups of three pixels arranged in the column direction or the row direction, and the pixel value is set for each group. A first processing means for rearranging in ascending or descending order, a first set having the largest median value, a second set having a next larger median value than the first set, and a third set having a minimum median value. The first determination means for determining, the magnitude relationship between the minimum value of the first set and the median value of the second set, the median value of the second set, and the third value
The second processing means for checking the magnitude relation of the maximum value of the set, and the second processing means for setting the minimum value of the first set to the median value of the second set and the median value of the second set to the third set. If the minimum value of the first set is less than the median value of the second set and the median value of the second set is less than or equal to the maximum value of the third set, the median value of the second set is greater than or equal to the maximum value. Is determined to be the median value of the nine pixels, and the second processing means determines that the minimum value of the first set is greater than the median value of the second set and the maximum value of the third set is the maximum value. If it is larger than the median value of the two sets, the minimum value of the minimum value of the first set, the maximum value of the third set and the maximum value of the second set is set to 9 above.
The third determination means for determining the median value of the pixels and the second processing means make the minimum value of the first set smaller than the median value of the second set and the maximum value of the third set of the second set. And a fourth determination means for determining the maximum value among the minimum value of the first set, the maximum value of the third set, and the minimum value of the second set as the median value of the nine pixels when the value is smaller than the median value. Have.

【0019】この発明の画像処理装置は、力画像の各画
素に対し、各画素を含む2×2サイズのウィンドウ内の
4個の画素値の中央値を出力画像における各画素の画素
値とするものにおいて、4個の画素のうち任意の3個の
画素値を選び、前記3個の画素値の中央値を出力画像の
画素値とする処理手段を有する。
In the image processing apparatus of the present invention, for each pixel of the force image, the median value of the four pixel values in the 2 × 2 size window including each pixel is set as the pixel value of each pixel in the output image. It has a processing means for selecting any three pixel values out of the four pixels and taking the median value of the three pixel values as the pixel value of the output image.

【0020】この発明の画像処理装置は、入力画像の各
画素に対し、各画素を含む2×2サイズのウィンドウ内
の4個の画素値の中央値を出力画像における各画素の画
素値とするものにおいて、上記ウィンドウ内の画素を2
画素を一組とする2組に分け、各組ごとに2個の画素値
の大小関係を調べる第1の処理手段と、各組の大きい方
の2個の画素値の大小関係を調べ、この2個の画素値の
うち小さい方の画素値を出力する第1の出力手段と、各
組の小さい方の2個の画素値の大小関係を調べ、この2
個の画素値のうち大きい方の画素値を出力する第2の出
力手段と、上記第1の出力手段の出力と上記第2の出力
手段の出力の平均を出力画像の画素値とする第2の処理
手段とを有する。
In the image processing apparatus of the present invention, for each pixel of the input image, the median value of the four pixel values in the 2 × 2 size window including each pixel is set as the pixel value of each pixel in the output image. 2 pixels in the above window
The pixel is divided into two groups, one group is divided into two groups, the first processing means for examining the magnitude relationship between two pixel values for each group, and the magnitude relationship between the two larger pixel values for each group are examined. The magnitude relationship between the first output means for outputting the smaller pixel value of the two pixel values and the two smaller pixel values of each set is checked, and this 2
A second output means for outputting the larger pixel value of the pixel values, and an average of the outputs of the first and second output means as the pixel value of the output image. And processing means.

【0021】[0021]

【発明の実施の形態】[第1の実施形態]以下、図面を
参照してこの発明の第1の実施形態について説明する。
第1の実施形態として、母集団を表す統計量の一つであ
る「メディアン(中央値)」を高速に求めたい場合の実
施例を述べる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [First Embodiment] A first embodiment of the present invention will be described below with reference to the drawings.
As the first embodiment, an example will be described in which "median (median value)", which is one of the statistical quantities representing the population, is to be obtained at high speed.

【0022】メディアンとは、全データを昇順(もしく
は降順)に並べたときに、ちょうど中央の順位となるデ
ータのことである。メディアンの他に、母集団を表す似
た統計量として「平均」があるが、平均はノイズ等のは
ずれ値に影響されやすい。メディアンは、はずれ値に影
響されない量であるため、ノイズなどに影響されない処
理をしたい場合によく用いられる。本実施例は9個のデ
ータのメディアンを求めるものである。
The median is data that is in the central position when all data are arranged in ascending order (or descending order). In addition to medians, there is “average” as a similar statistic that represents a population, but the average is easily affected by outliers such as noise. Since the median is an amount that is not affected by the outlier, it is often used when processing that is not affected by noise or the like is desired. In this embodiment, the median of 9 pieces of data is obtained.

【0023】図1は本発明の第1の実施形態における処
理装置のブロック図である。この処理装置は、同図にお
いて、3組の3個のデータをソートする各組ソート部
1、各組の中央値の大小関係を調べる組中央値順序決定
部2、組中央値順序決定部2の結果を用いてメディアン
を決定するメディアン決定部3、メディアン決定部3に
呼び出され、3個のデータの最小値を決定する最小値決
定部4、メディアン決定部3に呼び出され、3個のデー
タの最大値を決定する最大値決定部5により構成されて
いる。
FIG. 1 is a block diagram of a processing apparatus according to the first embodiment of the present invention. In this processing apparatus, in this drawing, each group sorting section 1 that sorts three sets of three data, group central value order determining section 2 that examines the magnitude relationship of the median values of each group, and group central value order determining section 2 The median determination unit 3 and the median determination unit 3 which determine the median using the result of 3 are called, and the minimum value determination unit 4 and the median determination unit 3 which determine the minimum value of the three data are called and the three data The maximum value determining unit 5 determines the maximum value of

【0024】以下、上記構成における各部の処理につい
て詳しく説明する。まず、各組ソート部1では、9個の
データを3個ずつの3組に分ける。図2にその様子を示
す。同図において、円がデータを表し、長方形が組を表
すものとする。その後、各組を昇順にソートする。ここ
は降順でもよい。図3にその様子を示す。不等号でデー
タの大小関係を示している。
The processing of each unit in the above configuration will be described in detail below. First, each group sort section 1 divides nine pieces of data into three groups of three pieces. The situation is shown in FIG. In the figure, circles represent data and rectangles represent sets. Then, each set is sorted in ascending order. This may be in descending order. The situation is shown in FIG. The inequality sign indicates the magnitude relationship of the data.

【0025】ここで、値の等しい2つのデータの大小関
係を比較した場合は、どちらか一方のデータを他方より
大きいとして処理するものとする。よって、例えば図3
において不等号で大小関係が示されているが、実際は等
しい場合も存在する。
Here, when comparing the magnitude relation of two data having the same value, it is assumed that one of the data is processed as being larger than the other. Therefore, for example, in FIG.
In the inequality sign, the magnitude relationship is shown, but in reality there are cases where they are equal.

【0026】次に、組中央値順序決定部2では、各組の
中央値の順序を調べる。図4にその様子を示す。同図に
おいて、二重の円となっているデータが各組の中央値で
あり、最大の中央値を持つ組を組A(第1組)、2番目
に大きい中央値を持つ組を組B(第2組)、最小の中央
値を持つ組を組C(第3組)と判断している。図5に
A、B、Cの順に並べ替えたものを示す。
Next, the set median value order determination unit 2 checks the order of the median values of each set. This is shown in FIG. In the figure, the data with double circles is the median value of each set, the set having the largest median value is set A (first set), and the set having the second largest median value is set B. (Second group), the group having the smallest median value is determined as the group C (third group). FIG. 5 shows the rearranged order of A, B, and C.

【0027】実際には並べ替える必要はなく、説明の便
宜上並べ替えた図を示した。また、説明のため、組Aの
最小値をD、組Bの中央値をE、組Cの最大値をF、組
Bの最大値をG、組Bの最小値をHとする。
Actually, it is not necessary to rearrange, and a rearranged diagram is shown for convenience of explanation. For the sake of explanation, the minimum value of the set A is D, the median value of the set B is E, the maximum value of the set C is F, the maximum value of the set B is G, and the minimum value of the set B is H.

【0028】次に、メディアン決定部3の処理を述べ
る。ここでは、Eに注目する。図5を見るとわかるとお
り、E以上のデータが3個、E以下のデータが3個、E
との大小関係のわからないデータは2個(DとF)存在
する。そこで、DとFについて、Eとの大小関係を調べ
る。その結果によって、次の3種類に場合分けされる。
Next, the processing of the median decision unit 3 will be described. Here, pay attention to E. As you can see from Fig. 5, there are 3 data above E, 3 data below E, E
There are two data (D and F) whose size relationship with is unknown. Therefore, regarding D and F, the magnitude relation between E and E is examined. The results are classified into the following three cases.

【0029】場合1:DがE以上かつEがF以上の場
合、もしくはDがE以下かつEがF以下の場合この場
合、E以上のデータが4個、E以下のデータが4個であ
ることになり、Eがメディアンであることが確定する。
この場合、メディアン決定部はEを出力する。
Case 1: When D is E or more and E is F or more, or when D is E or less and E is F or less In this case, there are four data of E or more and four data of E or less. It is confirmed that E is a median.
In this case, the median decision unit outputs E.

【0030】場合2:DがEより大きくかつFがEより
大きい場合この場合、E以上のデータが5個、E以下の
データが3個であるので、Eは小さい方から4番目のデ
ータであることになる。図6にその様子を示す。する
と、メディアンは、E以上のデータ5個の中で一番小さ
なデータである。E以上のデータ5個とは、組Aに属す
る3個のデータと、Gと、Fであるが、組Aに属する3
個のデータの中でDが最小であるため、D以外はメディ
アンの候補から外すことができる。よって、メディアン
の候補はD、G、Fの3個となる。よって、D、G、F
の3個の中で最小のデータを選べば、それがメディアン
である。そこで、メディアン決定部3は、最小値決定部
4を用い、D、G、Fのうちの最小値を求め、その結果
を出力とする。
Case 2: When D is larger than E and F is larger than E In this case, since there are 5 pieces of data above E and 3 pieces of data below E, E is the fourth data from the smallest. There will be. This is shown in FIG. Then, the median is the smallest data among the five data of E or more. Five pieces of data equal to or more than E are three pieces of data belonging to the set A, G and F, but three pieces belonging to the set A.
Since D is the smallest among the pieces of data, it is possible to exclude other than D from the median candidates. Therefore, there are three median candidates, D, G, and F. Therefore, D, G, F
If you choose the smallest data among the three, it is the median. Therefore, the median determination unit 3 uses the minimum value determination unit 4 to obtain the minimum value of D, G, and F, and outputs the result.

【0031】場合3:DがEより小さくかつFがEより
小さい場合この場合、E以上のデータが3個、E以下の
データが5個であるので、Eは大きい方から4番目のデ
ータであることになる。図7にその様子を示す。する
と、メディアンは、E以下のデータ5個の中で一番大き
なデータである。E以下のデータ5個とは、組Cに属す
る3個のデータと、Hと、Dであるが、組Cに属する3
個のデータの中でFが最大であるため、F以外はメディ
アンの候補から外すことができる。よって、メディアン
の候補はF、H、Dの3個となる。よって、F、H、D
の3個の中で最大のデータを選べば、それがメディアン
である。そこで、メディアン決定部3は、最大値決定部
5を用い、F、H、Dのうちの最大値を求め、その結果
を出力とする。
Case 3: When D is smaller than E and F is smaller than E In this case, since there are 3 pieces of data above E and 5 pieces of data below E, E is the fourth largest data. There will be. This is shown in FIG. Then, the median is the largest data out of the five data below E. 5 pieces of data less than E are 3 pieces of data belonging to the set C, H and D, and 3 pieces of data belonging to the set C.
Since F is the largest among the individual data, other than F can be excluded from the median candidates. Therefore, there are three median candidates F, H, and D. Therefore, F, H, D
If you choose the largest of the three, the median. Therefore, the median determination unit 3 uses the maximum value determination unit 5 to obtain the maximum value of F, H, and D, and outputs the result.

【0032】ここで、比較回数を調べてみる。まず、3
個のデータの順序を決定するための比較回数は、確率1
/3で2回、確率2/3で3回であるため、平均2+2
/3回、最大3回となる。3個のデータの順序決定は、
第1の実施形態において始めに4度行われるため(各組
のソートと、各組の中央値の順序決定)、合計の比較回
数は、平均10+2/3回、最大12回となる。
Here, the number of comparisons will be examined. First, 3
The number of comparisons for determining the order of the data pieces has a probability of 1
2/3 and 2/3 with a probability of 2/3, so an average of 2 + 2
/ 3 times, up to 3 times. To determine the order of three data,
In the first embodiment, the number of comparisons is 10 + 2/3 times on average, and 12 times at maximum, because it is performed four times at the beginning (sorting each group and determining the order of the median of each group).

【0033】次に、DとFについて、Eとの大小関係を
調べるときに、比較が2回行われる。ここまでの合計の
比較回数は、平均12+2/3回、最大14回となる。
最後に、場合1になる確率が1/2、場合2になる確率
が1/4、場合3になる確率が1/4であり、場合1に
なった場合は比較回数0回、場合2になった場合は比較
回数2回、場合3になった場合は比較回数が2回である
ため、合計の比較回数は、平均13+2/3回、最大1
6回となる。
Next, for D and F, the comparison is performed twice when checking the magnitude relation between E and E. The total number of comparisons so far is 12 + 2/3 times on average, and 14 times at maximum.
Finally, the probability of becoming Case 1 is 1/2, the probability of becoming Case 2 is 1/4, the probability of becoming Case 3 is 1/4, and when Case 1 results in 0 comparisons and Case 2 If the number of comparisons is 2, the number of comparisons is 2, and if the number of 3 is 3, the number of comparisons is 2. Therefore, the total number of comparisons is 13 + 2/3 on average and 1 at maximum.
Six times.

【0034】一方、9個のデータのメディアンを求める
方法としては、特開平5−300372と特開平5−1
28253があるが、特開平5−300372に示され
る方法では、平均18+2/3回、最大21回の比較が
必要であり、また、特開平5−128253に示される
方法では、平均18回、最大19回の比較が必要であ
る。
On the other hand, as a method for obtaining the median of nine pieces of data, Japanese Patent Application Laid-Open No. 5-300372 and Japanese Patent Application Laid-Open No. 5-1
28253, the method disclosed in Japanese Patent Laid-Open No. 5-300372 requires an average of 18 + 2/3 times and a maximum of 21 times, and the method disclosed in Japanese Patent Laid-Open No. 5-128253 has an average of 18 times and a maximum of 21 times. 19 comparisons are required.

【0035】また、一般に、9個のデータのメディアン
を求める方法としては、昇順にソートしていき、5番目
の順位のデータが確定した時点で終了するというものが
よく用いられる。この方法では、1番目の順位のデータ
の確定に8回、2番目の順位のデータの確定に7回、3
番目の順位のデータの確定に6回、4番目の順位のデー
タの確定に5回、5番目の順位のデータの確定に4回の
比較が必要であるため、合計30回の比較が必要であ
る。以上より、本発明は、9個のデータのメディアンを
求める方法として、非常に高速であることがわかる。
In general, as a method for obtaining the median of nine pieces of data, a method of sorting in ascending order and ending when the data of the fifth rank is decided is often used. In this method, the data of the first rank is determined 8 times, the data of the second rank is determined 7 times, 3
Six comparisons are required to determine the data of the fourth rank, five times to confirm the data of the fourth rank, and four times to confirm the data of the fifth rank, so a total of 30 comparisons are required. is there. From the above, it can be seen that the present invention is extremely fast as a method for obtaining the median of 9 pieces of data.

【0036】上記処理についての具体例を、図3、図8
〜12に示すデータの配置例と、図13、14に示すフ
ローチャートとを参照して説明する。たとえば今、参照
する9個のデータを3個ずつの3列(組)に分ける。つ
いで、図3に示すように、1列目の3つを大、中、小
(第1データ、第2データ、第3データ)の順に並び替
え、2列目の3つを大、中、小の順に並び替え、3列目
の3つを大、中、小の順に並び替える(ST1、2、
3)。
A concrete example of the above processing is shown in FIGS.
12 to 12, and the flowcharts shown in FIGS. 13 and 14 will be described. For example, the 9 pieces of data to be referred to are divided into 3 columns (groups) of 3 pieces each. Then, as shown in FIG. 3, the three in the first column are rearranged in the order of large, medium, and small (first data, second data, and third data), and the three in the second column are large, medium, and small. Rearrange in the order of small, and rearrange the three in the third column in the order of large, middle, and small (ST1, 2,
3).

【0037】各列のセンタの(中央値)比較し、各列の
順序付け(順序決定)を行う(ST4)。この順序付け
が行われた状態での仮想のデータ列の配列が、図8に示
すように、センタ値が一番大きい列の大きなデータから
順にA1、A2、A3(第1組、第2組、第3組)と
し、センタ値が中の列の大きなデータから順にB1、B
2、B3とし、センタ値が一番小さい列の大きなデータ
から順にC1、C2、C3とする。この際、A1>A2
>A3と、B1>B2>B3と、C1>C2>C3と、
A2>B2>C2とが確定している。
The center (median value) of each column is compared, and each column is ordered (order is determined) (ST4). As shown in FIG. 8, the array of virtual data strings in this ordered state is A1, A2, A3 (first set, second set, 3rd group), and B1 and B
2, B3, and C1, C2, and C3 in order from the largest data in the column having the smallest center value. At this time, A1> A2
> A3, B1>B2> B3, C1>C2> C3,
It is confirmed that A2>B2> C2.

【0038】これにより、A1、A2は自身より小さい
ものが確実に5個(A3、B2、B3、C2、C3)有
り、5番目に成り得ない。また、C2、C3は自身より
大きいものが確実に5個(A1、A2、B1、B2、C
1)有り、5番目に成り得ない。また、B2より大きい
のが判明しているのが、A1、A2、B1で、B2より
小さいのが判明しているのが、B3、C2、C3であ
り、B2より大きいか小さいかが判明していないのが、
A3とC1である。
As a result, there are definitely five (A3, B2, B3, C2, C3) smaller than itself as A1 and A2, and cannot be the fifth. In addition, C2 and C3 are definitely larger than themselves (A1, A2, B1, B2, C
1) Yes, not the fifth. Further, it is known that B1 is larger than B2, A1, A2 and B1 are smaller than B2, and B3, C2 and C3 are smaller than B2. But not
A3 and C1.

【0039】この状態において、A3とB2とを比較し
て大小関係を得、B2とC1とを比較して大小関係を得
る(ST5)。この際、図9に示すように、A3<B2
かつB2<C1の場合(ST6)、B2より大きいのが
A1、A2、B1、C1の4つであり、B2より小さい
のがA3、B3、C2、C3の4つであり、B2が5番
目と判断される(ST7)。
In this state, A3 and B2 are compared to obtain a magnitude relationship, and B2 and C1 are compared to obtain a magnitude relationship (ST5). At this time, as shown in FIG. 9, A3 <B2
When B2 <C1 (ST6), four are larger than B2, namely A1, A2, B1, and C1, four are smaller than B2, four such as A3, B3, C2, and C3, and B2 is the fifth. (ST7).

【0040】また、図10に示すように、A3>B2か
つB2>C1の場合(ST8)、B2より大きいのがA
1、A2、A3、B1の4つであり、B2より小さいの
がB3、C1、C2、C3の4つであり、B2が5番目
と判断される(ST9)。
Further, as shown in FIG. 10, when A3> B2 and B2> C1 (ST8), A is larger than B2.
1, A2, A3, B1 are four, less than B2 are B3, C1, C2, C3, and B2 is determined to be the fifth (ST9).

【0041】また、図11に示すように、A3>B2か
つB2<C1の場合(ST10)、B2より大きいのが
A1、A2、A3、B1、C1の5つであり、B2が上
から6番目と判断され、A1、A2、A3、B1、C1
の5つの中で一番小さいのが、5番目と判断される。こ
の際、A1、A2は、A3より大きいのが判っているた
め除外され、A3、B1、C1の3つ比較により一番小
さいものが5番目と判断される(ST11)。たとえ
ば、A3とB1の比較による小さい方とC1の比較によ
る小さい方が、一番小さいものとなり、2回の比較で良
い。
Further, as shown in FIG. 11, when A3> B2 and B2 <C1 (ST10), five are larger than B2: A1, A2, A3, B1 and C1, and B2 is 6 from the top. Judged to be the second, A1, A2, A3, B1, C1
The smallest of the five is judged to be the fifth. At this time, A1 and A2 are excluded because they are known to be larger than A3, and the smallest one is determined to be the fifth by comparing the three A3, B1, and C1 (ST11). For example, the smaller one obtained by comparing A3 and B1 and the smaller one obtained by comparing C1 are the smallest ones, and the comparison may be performed twice.

【0042】また、図12に示すように、A3<B2か
つB2>C1の場合(ST12)、B2より小さいのが
A3、B3、C1、C2、C3の5つであり、B2が下
から6番目と判断され、A3、B3、C1、C2、C3
の5つのなかで一番大きいのが、5番目と判断される。
この際、C2、C3は、C1より小さいのが判っている
ため除外され、A3、B3、C1の3つ比較により一番
大きいものが5番目と判断される(ST13)。たとえ
ば、A3とB3の比較による大きい方とC1の比較によ
る大きい方が、一番大きいものとなり、2回の比較で良
い。 [第2の実施形態]第2の実施形態として、入力画像に
3×3サイズのウィンドウのメディアンフィルタを高速
に施したい場合の実施例を述べる。
Further, as shown in FIG. 12, in the case of A3 <B2 and B2> C1 (ST12), five smaller than B2 are A3, B3, C1, C2 and C3, and B2 is 6 from the bottom. Judged to be th, A3, B3, C1, C2, C3
The largest of the five is judged to be the fifth.
At this time, C2 and C3 are excluded because they are known to be smaller than C1, and the largest one is determined to be the fifth by comparing three of A3, B3, and C1 (ST13). For example, the larger one according to the comparison of A3 and B3 and the larger one according to the comparison of C1 are the largest ones, and the comparison may be performed twice. [Second Embodiment] As a second embodiment, an example will be described in which it is desired to apply a median filter of a 3 × 3 size window to an input image at high speed.

【0043】第2の実施形態では、キャッシュが十分に
大きくない場合について述べる。キャッシュが十分に大
きい場合の実施形態は、第3の実施形態において述べ
る。メディアンフィルタとは、画像の各画素の値を、そ
の画素を中心とするウィンドウ内の画素のメディアンで
置き換えるものである。図15に具体例を示す。位置
(i,j)に対しメディアンフィルタ処理を施している
様子である。実線で書かれた枠がウィンドウである。ウ
ィンドウ内の画素値9個を降順に並べると、255,1
68,130,121,69,66,51,13,2と
なり、メディアンは5番目の順位にあたる69である。
そこで、出力画像の位置(i,j)に69を書き込むこ
とになる。
In the second embodiment, the case where the cache is not large enough will be described. An embodiment in which the cache is sufficiently large will be described in the third embodiment. The median filter replaces the value of each pixel of the image with the median of the pixel in the window centered on the pixel. FIG. 15 shows a specific example. It appears that the median filter process is applied to the position (i, j). A frame is a window drawn with a solid line. If nine pixel values in the window are arranged in descending order, 255,1
68,130,121,69,66,51,13,2, and the median is the fifth ranking 69.
Therefore, 69 is written at the position (i, j) of the output image.

【0044】以下、第2の実施形態の説明では、i,j
を0から始まるものとする。また、メディアンフィルタ
処理を、jを固定し、iを0から小さい順にかけるもの
とする。iが最大になったら、jを1増やし、同様の処
理を繰り返すものとする。jについては、0から順に増
やしていくものとする。もちろん、上記の順序は説明の
ためのものであり、iとjを入れ替えたり、小さい順を
大きい順に変えたりしても本発明は有効である。
In the following description of the second embodiment, i, j
Shall start from 0. In addition, the median filter processing is performed by fixing j and applying i from 0 in ascending order. When i becomes maximum, j is incremented by 1 and the same processing is repeated. Regarding j, it is assumed to increase from 0 in order. Of course, the above order is for the purpose of explanation, and the present invention is effective even if i and j are exchanged, or the order from the small is changed to the order from the large.

【0045】メディアンを求める際、第1の実施形態で
述べた方法を用いることもできるが、隣接した画素のウ
ィンドウ同士には、6個の共通の画素が含まれるため、
これを利用して更に高速な処理を行えることを、第2の
実施形態では述べる。
When obtaining the median, the method described in the first embodiment can be used, but since the windows of adjacent pixels include six common pixels,
In the second embodiment, it will be described that higher speed processing can be performed by utilizing this.

【0046】図16は本発明の第2の実施形態における
処理装置のブロック図である。この処理装置は、同図に
おいて、新規に追加される3個の画素をソートする新規
ソート部11、処理済の隣接画素のソート結果に新規ソ
ート結果を加え、必要のないソート結果を削除するソー
ト結果処理記憶部12、各組の中央値の大小関係を調べ
る組中央値順序決定部13、組中央値順序決定部13の
結果を用いてメディアンを決定するメディアン決定部1
4、メディアン決定部14に呼び出され、3個のデータ
の最小値を決定する最小値決定部15、メディアン決定
部14に呼び出され、3個のデータの最大値を決定する
最大値決定部16により構成されている。
FIG. 16 is a block diagram of a processing device according to the second embodiment of the present invention. In this processing apparatus, in this drawing, a new sorting unit 11 that sorts three newly added pixels, a sorting result that adds a new sorting result to the sorted results of processed adjacent pixels, and deletes unnecessary sorting results. Result processing storage unit 12, median determination unit 1 that determines the median using the results of the median value order determination unit 13 and the median value order determination unit 13 that examines the magnitude relationship of the median values of each group.
4. By the median determination unit 14, the minimum value determination unit 15 that determines the minimum value of the three data, and the median determination unit 14 that is called by the maximum value determination unit 16 that determines the maximum value of the three data It is configured.

【0047】以下、上記構成における各部の処理につい
て詳しく説明する。図17において、位置(i−1,
j)の画素は処理済であるとする。また、位置(i,
j)の画素を中心とするウィンドウをL、位置(i−
1,j)の画素を中心とするウィンドウをMとし、位置
(i−2,j−1)、位置(i−2,j)、位置(i−
2,j+1)の3個の画素を一組(組1)、位置(i−
1,j−1)、位置(i−1,j)、位置(i−1,j
+1)の3個の画素を一組(組2)、位置(i,j−
1)、位置(i,j)、位置(i,j+1)の3個の画
素を一組(組3)、位置(i+1,j−1)、位置(i
+1,j)、位置(i+1,j+1)の3個の画素を一
組(組4)とする。
The processing of each unit in the above configuration will be described in detail below. In FIG. 17, the position (i-1,
It is assumed that the pixel of j) has been processed. Also, the position (i,
j) the window centered on the pixel of L, and the position (i-
Let M be a window centered on the pixel of (1, j), position (i-2, j-1), position (i-2, j), position (i-
2, j + 1) of three pixels as one set (set 1) and position (i-
1, j-1), position (i-1, j), position (i-1, j)
+1) three pixels as one set (set 2), position (i, j-
1), position (i, j), and position (i, j + 1), three pixels are set as one set (set 3), position (i + 1, j-1), position (i
Three pixels at +1, j) and position (i + 1, j + 1) are set as one set (set 4).

【0048】新規ソート部11では、ウィンドウMに含
まれていないがウィンドウLに含まれている組4を昇順
にソートする。ここは降順でもよい。ソート結果処理記
憶部12では、位置(i−1,j)の画素の処理時に組
1と組2と組3をそれぞれソートした結果が記憶されて
おり、そこに組4のソート結果を加え、組1のソート結
果を削除する処理を行う。
The new sort unit 11 sorts the sets 4 which are not included in the window M but included in the window L in ascending order. This may be in descending order. The sort result processing storage unit 12 stores the result of sorting the set 1, the set 2, and the set 3 at the time of processing the pixel at the position (i-1, j), and adds the sort result of the set 4 to that. A process of deleting the sorting result of the set 1 is performed.

【0049】組中央値順序決定部13では、ソート結果
処理記憶部12から得られる組2、組3、組4のソート
結果を用い、各組の中央値の順序を調べる。第1の実施
形態における組中央値順序決定部2と同じものである。
メディアン決定部14は、第1の実施形態におけるメデ
ィアン決定部3と同じものである。
The set median order determining unit 13 checks the order of the median value of each set by using the sort results of the sets 2, 3, and 4 obtained from the sort result processing storage unit 12. This is the same as the set median order determining unit 2 in the first embodiment.
The median determination unit 14 is the same as the median determination unit 3 in the first embodiment.

【0050】最小値決定部15は、第1の実施形態にお
ける最小値決定部4と同じものである。最大値決定部1
6は、第1の実施形態における最大値決定部5と同じも
のである。以上により説明された第2の実施形態は、i
が2以上の画素について用いることができる。iが1以
下の画素については、ここでは特定しないが、一例とし
て第1の実施形態に述べる方法を用いることができる。
第2の実施形態では、組2と組3のソートをせずにすむ
ため、第1の実施形態に比べ高速な処理を実現できる。
The minimum value determining unit 15 is the same as the minimum value determining unit 4 in the first embodiment. Maximum value determination unit 1
6 is the same as the maximum value determination unit 5 in the first embodiment. In the second embodiment described above, i
Can be used for two or more pixels. A pixel having i of 1 or less is not specified here, but the method described in the first embodiment can be used as an example.
In the second embodiment, since sorting of the sets 2 and 3 is not required, it is possible to realize higher-speed processing than that of the first embodiment.

【0051】[第3の実施形態]第3の実施形態とし
て、入力画像に3×3サイズのメディアンフィルタを高
速に施したい場合の実施例を述べる。第3の実施形態で
は、キャッシュが十分に大きい場合について述べる。第
3の実施形態においては、行ごとにまとめてメディアン
フィルタ処理を施す。図18にその様子を示す。行方向
をj、列方向をiとする。図18は、第j行にまとめて
メディアンフィルタを施している様子である。第j行の
画素すべてにメディアンフィルタを施すためには、太線
で書かれた枠内の画素値をすべて記憶しておく必要があ
る。
[Third Embodiment] As a third embodiment, an example will be described in which it is desired to apply a 3 × 3 size median filter to an input image at high speed. In the third embodiment, the case where the cache is sufficiently large will be described. In the third embodiment, the median filter processing is collectively performed for each row. The situation is shown in FIG. The row direction is j and the column direction is i. FIG. 18 shows a state in which the median filter is collectively applied to the j-th row. In order to apply the median filter to all the pixels in the j-th row, it is necessary to store all the pixel values in the frame written by the bold line.

【0052】以下、第3の実施形態の説明では、jは0
から始まるものとする。また、jの小さい順にメディア
ンフィルタを施すものとする。もちろん、上記の順序は
説明のためのものであり、iとj、行と列を入れ替えた
り、小さい順を大きい順に変えたりしても本発明は有効
である。
In the following description of the third embodiment, j is 0.
Shall begin with. In addition, the median filter is applied in ascending order of j. Of course, the above order is for explanation, and the present invention is effective even if i and j, rows and columns are exchanged, or small order is changed to large order.

【0053】図19は本発明の第3の実施形態における
処理装置のブロック図である。この処理装置は、同図に
おいて、3行分の画像を読み込む三行画像読み込み部2
1、三行画像読み込み部21で読み込まれた3行分の画
像を記憶しておく三行画像記憶部22、三行画像記憶部
22に記憶されている画像を1列3画素ずつの組に分
け、各組をソートして三行画像記憶部22に保存する各
組ソート部23、三行画像記憶部22に記憶されている
隣接する3組の中央値の大小関係を調べる組中央値順序
決定部24、組中央値順序決定部24の結果を用いてメ
ディアンを決定するメディアン決定部25、メディアン
決定部25に呼び出され、3個のデータの最小値を決定
する最小値決定部26、メディアン決定部25に呼び出
され、3個のデータの最大値を決定する最大値決定部2
7である。
FIG. 19 is a block diagram of a processing device according to the third embodiment of the present invention. In this processing device, a three-row image reading unit 2 for reading an image for three rows is shown in FIG.
1, a three-row image storage unit 22 for storing the images of three rows read by the three-row image reading unit 21, and an image stored in the three-row image storage unit 22 into groups of three pixels in each column A group median order in which each group is sorted, and each group is sorted and stored in the three-row image storage unit 22 and the magnitude relationship between the median values of three adjacent groups stored in the three-row image storage unit 22 is checked. The median determining unit 25, which determines the median using the results of the determining unit 24 and the set median order determining unit 24, is called by the median determining unit 25, and the minimum value determining unit 26 determines the minimum value of the three data, and the median. Maximum value determination unit 2 which is called by the determination unit 25 and determines the maximum value of three data.
7

【0054】以下、上記構成における各部の処理につい
て詳しく説明する。三行画像読み込み部21では、入力
画像の隣接する3行分の画素値を読み込み、三行画像記
憶部22に記憶する。図20においては、第j−1行、
第j行、第j+1行の3行を記憶している。
The processing of each unit in the above configuration will be described in detail below. The three-row image reading unit 21 reads the pixel values of three adjacent rows of the input image and stores them in the three-row image storage unit 22. In FIG. 20, line j−1,
It stores three rows, the j-th row and the j + 1-th row.

【0055】各組ソート部23では、三行画像記憶部2
2に記憶された画像を、列方向に分け、分けられた各組
それぞれをソートして三行画像記憶部22に記憶しなお
す。図20にその様子を示す。各列の3個の画素値が、
昇順にソートされている。各組ソート部23では、三行
画像記憶部22に記憶されているすべての列をソートす
る。
In each group sort section 23, the three-row image storage section 2
The images stored in No. 2 are divided in the column direction, and the divided sets are sorted and stored again in the three-row image storage unit 22. This is shown in FIG. The three pixel values in each column are
Sorted in ascending order. Each group sort section 23 sorts all the columns stored in the three-row image storage section 22.

【0056】組中央値順序決定部24では、三行画像記
憶部22に記憶されている第i−1列、第i列、第i+
1列のそれぞれの組のソート結果を用い、各組の中央値
の順序を調べる。第1の実施形態における組中央値順序
決定部2と同じものである。
In the group median value order determination unit 24, the i−1th column, the ith column, and the i + th column stored in the three-row image storage unit 22.
The order of the median value of each set is examined using the sorting result of each set of one column. This is the same as the set median order determining unit 2 in the first embodiment.

【0057】メディアン決定部25は、第1の実施形態
におけるメディアン決定部3と同じものである。最小値
決定部26は、第1の実施形態における最小値決定部4
と同じものである。最大値決定部27は、第1の実施形
態における最大値決定部5と同じものである。第j行に
ついて三行画像読み込み部21、各組ソート部23の処
理が一度行われると、組中央値順序決定部24、メディ
アン決定部25、最小値決定部26、最大値決定部27
による処理は、すべてのiについて行われる。
The median determination unit 25 is the same as the median determination unit 3 in the first embodiment. The minimum value determination unit 26 is the minimum value determination unit 4 in the first embodiment.
Is the same as. The maximum value determination unit 27 is the same as the maximum value determination unit 5 in the first embodiment. Once the processing of the three-row image reading unit 21 and each group sort unit 23 is performed for the j-th row, the group median order determination unit 24, the median determination unit 25, the minimum value determination unit 26, and the maximum value determination unit 27.
Is performed for all i.

【0058】第3の実施形態は、第2の実施形態と比較
すると、第2の実施形態におけるソート結果処理記憶部
22で行われる処理を省くことで高速化が図られてい
る。しかし、各画素にメディアンフィルタを施す度に、
三行画像記憶部22から、5個ないし6個の画素値を読
み込む必要があり、読み込みのオーバーヘッドが大きい
場合は第2の実施形態の方が高速である。よって、第3
の実施形態は、三行画像記憶部22が、CPUのキャッ
シュなどの、高速にアクセス可能な記憶媒体に割り当て
られる場合に有効である。
In comparison with the second embodiment, the third embodiment is speeded up by omitting the processing performed by the sort result processing storage unit 22 in the second embodiment. However, each time the median filter is applied to each pixel,
It is necessary to read five to six pixel values from the three-row image storage unit 22, and when the read overhead is large, the second embodiment is faster. Therefore, the third
This embodiment is effective when the three-line image storage unit 22 is assigned to a storage medium that can be accessed at high speed, such as a cache of the CPU.

【0059】[第4の実施形態]第4の実施形態とし
て、入力画像に2×2サイズのウィンドウのメディアン
フィルタを高速に施したい場合の実施例を述べる。図2
1に2×2サイズのウィンドウのメディアンフィルタ処
理を施している様子を示す。図21は、位置(i,j)
にメディアンフィルタを施している様子である。図21
の実線で示された枠がウィンドウである。2×2サイズ
のウィンドウのちょうど中心にあたる画素は存在しない
ため、ここでは、位置(i,j)がウィンドウの左上隅
になるよう配置した。もちろん、これは一つの例であ
り、右上隅、左下隅、右下隅になるような配置でも本発
明は同様に適用される。
[Fourth Embodiment] As a fourth embodiment, an example will be described in which it is desired to apply a median filter of a 2 × 2 size window to an input image at high speed. Figure 2
1 shows a state in which the median filter processing of a 2 × 2 size window is performed. FIG. 21 shows the position (i, j)
It seems that the median filter is applied to. Figure 21
The frame indicated by the solid line is the window. Since there is no pixel at the center of the 2 × 2 size window, the position (i, j) is arranged in the upper left corner of the window here. Of course, this is only an example, and the present invention is similarly applied to the arrangement in which the upper right corner, the lower left corner, and the lower right corner are arranged.

【0060】図21におけるウィンドウ内の4個の画素
値を降順に並べると255、31、26、25である。
ここで、4個のデータのメディアンは、ちょうど中間の
順位がないため、一般には、2番目のデータか、3番目
のデータか、2番目のデータと3番目のデータの平均
が、メディアンとして用いられる。そこで、例えば2番
目のデータをメディアンであることにすると、図21で
は31がメディアンとなり、出力画像の位置(i,j)
に31を書き込むことになる。
When the four pixel values in the window in FIG. 21 are arranged in descending order, they are 255, 31, 26 and 25.
Here, since the median of four data does not have an intermediate rank, generally, the second data, the third data, or the average of the second data and the third data is used as the median. To be Therefore, if the second data is a median, for example, 31 becomes a median in FIG. 21, and the position (i, j) of the output image is displayed.
31 will be written in.

【0061】ここで、2番目のデータでも3番目のデー
タでもよいことに注目する。4個の画素のうちから適当
に3個の画素を選び、その3個の画素値の中の中央値T
を得れば、Tは4個の画素値の中では2番目か3番目の
どちらかである。つまり、Tは4個の画素値のメディア
ンであると言える。
Note that the second data or the third data may be used. The three pixels are appropriately selected from the four pixels, and the median value T of the three pixel values is selected.
, T is either the second or third of the four pixel values. That is, it can be said that T is a median of four pixel values.

【0062】図22は本発明の第4の実施形態における
処理装置のブロック図である。この処理装置は、同図に
おいて、4個の画素値から3個を選び、その中央値を出
力画像の画素値とする中央値選択部30により構成され
ている。ここで、比較回数を調べてみる。3個の画素値
の中の中央値を得るための比較回数は、確率1/3で2
回、確率2/3で3回であるため、第4の実施形態にお
ける比較回数は平均2+2/3回、最大3回となる。
FIG. 22 is a block diagram of a processing device according to the fourth embodiment of the present invention. This processing device is configured by a median value selection unit 30 that selects three pixel values from four pixel values and uses the median value as the pixel value of the output image in FIG. Now, let's check the number of comparisons. The number of comparisons to obtain the median value among the three pixel values is 2 with probability 1/3.
Since the number of comparisons is 3 with a probability of 2/3, the average number of comparisons in the fourth embodiment is 2 + 2/3, and a maximum of 3 comparisons.

【0063】一方、一般に4個のデータのメディアンを
求める方法としては、昇順にソートしていき、2番目の
順位のデータが確定した時点で終了するというものがよ
く用いられる。この方法では、1番目の順位のデータの
確定に3回、2番目の順位のデータの確定に2回の比較
が必要であるため、合計5回の比較が必要である。以上
より、本発明は、4個のデータのメディアンを求める方
法として、非常に高速であることがわかる。
On the other hand, in general, as a method for obtaining the median of four data, a method of sorting in ascending order and ending when the data of the second rank is determined is often used. According to this method, three comparisons are required to determine the data of the first rank and two comparisons are required to determine the data of the second rank, so that a total of five comparisons are required. From the above, it can be seen that the present invention is extremely fast as a method for obtaining the median of four data.

【0064】[第5の実施形態]第5の実施形態とし
て、入力画像に2×2サイズのウィンドウのメディアン
フィルタを高速に施したい場合の実施例を述べる。2×
2サイズのメディアンフィルタに関する説明は、第4の
実施形態において述べた通りである。第5の実施形態で
は、4個のデータのメディアンとして、2番目のデータ
と3番目のデータの平均を用いた場合について述べる。
[Fifth Embodiment] As a fifth embodiment, an embodiment will be described in which it is desired to apply a median filter of a 2 × 2 size window to an input image at high speed. 2x
The description regarding the 2-size median filter is as described in the fourth embodiment. In the fifth embodiment, the case where the average of the second data and the third data is used as the median of four data will be described.

【0065】図23は本発明の第5の実施形態における
処理装置のブロック図である。この処理装置は、同図に
おいて、4個の画素値を2個ずつの2組に分け、各組の
2個の画素値の大小関係を調べる各組大小比較部31、
各組の大きい方の画素値同士を大小比較し、小さい方の
画素値を出力する小値決定部32、各組の小さい方の画
素値同士を大小比較し、大きい方の画素値を出力する大
値決定部33、前記の小値決定部32の出力と前記の大
値決定部33の出力との平均を計算する平均値演算部3
4である。
FIG. 23 is a block diagram of a processing device according to the fifth embodiment of the present invention. This processing device divides four pixel values into two groups of two in the figure, and examines the magnitude relationship between the two pixel values of each group.
A small value determination unit 32 that compares the larger pixel value of each group and outputs the smaller pixel value, and a smaller value determination unit 32 that compares the smaller pixel value of each group and outputs the larger pixel value. A large value determination unit 33, an average value calculation unit 3 for calculating an average of the output of the small value determination unit 32 and the output of the large value determination unit 33.
It is 4.

【0066】以下、上記構成における各部の処理につい
て詳しく説明する。各組大小比較部31では、4個の画
素値を2個ずつの2組に分け、各組の2個の画素値の大
小関係を調べる。図24にその様子を示す。組1と組2
の2組に分かれており、それぞれの組の中で2個の画素
値の大小関係が不等号で示されている。
The processing of each unit in the above configuration will be described in detail below. Each group size comparison unit 31 divides the four pixel values into two groups of two, and examines the size relationship of the two pixel values of each group. FIG. 24 shows the situation. Set 1 and set 2
Are divided into two groups, and the magnitude relationship between the two pixel values in each group is indicated by an inequality sign.

【0067】小値決定部32には、組1、組2それぞれ
において、大きいと判断された画素値が入力され、大小
関係が調べられる。大値決定部33には、組1、組2そ
れぞれにおいて、小さいと判断された画素値が入力さ
れ、大小関係が調べられる。
The pixel value determined to be large in each of the set 1 and the set 2 is input to the small value determination unit 32, and the magnitude relationship is checked. The pixel value determined to be small in each of the set 1 and the set 2 is input to the large value determination unit 33, and the size relationship is examined.

【0068】小値決定部32において大きいと判断され
た画素値Uは、4個の画素値の中での最大値となる。ま
た、大値決定部33において小さいと判断された画素値
Vは、4個の画素値の中での最小値となる。すると、4
個の画素値の中でUとVを除く二つの画素値が、2番目
に大きい画素値と3番目に大きい画素値のどちらかであ
ることになる。どちらが2番目でどちらが3番目である
かは調べる必要はなく、この二つの値の平均を取れば、
所望のメディアンを得ることができる。よって、平均値
演算部34により、小値決定部32の出力と、大値決定
部33の出力の平均を取ることで、メディアンを得るこ
とができる。
The pixel value U determined to be large by the small value determination unit 32 is the maximum value among the four pixel values. The pixel value V determined to be small by the large value determination unit 33 is the minimum value among the four pixel values. Then 4
Among the pixel values, the two pixel values excluding U and V are either the second largest pixel value or the third largest pixel value. There is no need to find out which is the second and which is the third, and by averaging these two values,
The desired median can be obtained. Therefore, the median can be obtained by averaging the output of the small value determination unit 32 and the output of the large value determination unit 33 by the average value calculation unit 34.

【0069】ここで、比較回数を調べてみる。各組大小
比較部31において2回比較が行われ、小値決定部32
において1回比較が行われ、大値決定部33において1
回比較が行われるため、第5の実施形態における比較回
数は4回となる。
Here, the number of comparisons will be examined. Each group size comparison unit 31 performs the comparison twice, and the small value determination unit 32
Is compared once, and the maximum value determination unit 33 determines 1
Since the comparison is performed twice, the number of comparisons in the fifth embodiment is four.

【0070】一方、一般に、4個のデータのメディアン
を、2番目の順位のデータと3番目の順位のデータの平
均として求める場合の実現方法としては、昇順にソート
し、2番目のデータと3番目のデータを得る方法が用い
られる。この場合、1番目の順位のデータの確定に3
回、2番目の順位のデータの確定に2回、3番目の順位
のデータの確定に1回の比較が必要であるため、合計6
回の比較が必要である。
On the other hand, in general, when the median of four data is obtained as the average of the data of the second rank and the data of the third rank, sorting is performed in ascending order and the second data and the third data are sorted. The method of obtaining the second data is used. In this case, 3 to confirm the data of the first rank
Since a comparison is required twice to determine the data of the second rank and twice to determine the data of the third rank, a total of 6 is required.
Need to compare twice.

【0071】以上より、本発明は、4個のデータのメデ
ィアンを、2番目の順位のデータと3番目の順位のデー
タの平均として求める場合の実現方法として、非常に高
速であることがわかる。第5の実施形態の、第4の実施
形態からの優位性としては、平均を取ることで、より性
能が高いことが上げられる。一方、第4の実施形態の、
第5の実施形態からの優位性としては、より高速に処理
が行えることが上げられる。
From the above, it can be seen that the present invention is extremely fast as an implementation method when the median of four data is obtained as the average of the data of the second rank and the data of the third rank. As an advantage of the fifth embodiment from the fourth embodiment, it is possible to obtain higher performance by taking an average. On the other hand, in the fourth embodiment,
An advantage of the fifth embodiment is that processing can be performed at higher speed.

【0072】上記したように、9個のデータのメディア
ンを高速に求めることができる。また、従来の方法より
高速な3×3のメディアンフィルタを実現できる。ま
た、従来の方法より高速な2×2のメディアンフィルタ
を実現できる。
As described above, the median of 9 pieces of data can be obtained at high speed. Further, it is possible to realize a 3 × 3 median filter which is faster than the conventional method. In addition, a 2 × 2 median filter that is faster than the conventional method can be realized.

【0073】[0073]

【発明の効果】以上詳述したように、この発明によれ
ば、メディアンフィルタを用いて画像データ等のデータ
処理を行うものにおいて、簡単な方法でかつ高速に、複
数のデータの中央値を得ることができる。
As described above in detail, according to the present invention, a median value of a plurality of data can be obtained by a simple method and at high speed in a data processing such as image data using a median filter. be able to.

【図面の簡単な説明】[Brief description of drawings]

【図1】第1の実施形態における処理装置のブロック
図。
FIG. 1 is a block diagram of a processing device according to a first embodiment.

【図2】各組ソート部を説明するための図。FIG. 2 is a diagram for explaining each group sort unit.

【図3】各組ソート部を説明するための図。FIG. 3 is a diagram for explaining each group sort unit.

【図4】各組ソート部を説明するための図。FIG. 4 is a diagram for explaining each group sort unit.

【図5】メディアン決定部の処理を説明する図。FIG. 5 is a diagram illustrating a process of a median determination unit.

【図6】メディアン決定部の処理を説明する図。FIG. 6 is a diagram illustrating a process of a median determination unit.

【図7】メディアン決定部の処理を説明する図。FIG. 7 is a diagram illustrating a process of a median determination unit.

【図8】9個のデータのメディアンを求める方法を説明
する図。
FIG. 8 is a diagram illustrating a method of obtaining a median of 9 pieces of data.

【図9】9個のデータのメディアンを求める方法を説明
する図。
FIG. 9 is a diagram illustrating a method of obtaining a median of nine pieces of data.

【図10】9個のデータのメディアンを求める方法を説
明する図。
FIG. 10 is a diagram illustrating a method of obtaining medians of nine pieces of data.

【図11】9個のデータのメディアンを求める方法を説
明する図。
FIG. 11 is a diagram illustrating a method of obtaining a median of nine pieces of data.

【図12】9個のデータのメディアンを求める方法を説
明する図。
FIG. 12 is a diagram illustrating a method of obtaining a median of 9 pieces of data.

【図13】9個のデータのメディアンを求める方法を説
明するためのフローチャート。
FIG. 13 is a flowchart for explaining a method of obtaining a median of 9 pieces of data.

【図14】9個のデータのメディアンを求める方法を説
明ためのフローチャート。
FIG. 14 is a flowchart for explaining a method of obtaining medians of nine pieces of data.

【図15】メディアンフィルタの具体例を示す図。FIG. 15 is a diagram showing a specific example of a median filter.

【図16】第2の実施形態における処理装置のブロック
図。
FIG. 16 is a block diagram of a processing device according to a second embodiment.

【図17】第1の実施形態における処理装置の各部の処
理を説明する図。
FIG. 17 is a diagram illustrating the processing of each unit of the processing device according to the first embodiment.

【図18】行ごとにまとめてメディアンフィルタ処理を
施す様子を示す図。
FIG. 18 is a diagram showing a state in which median filter processing is collectively performed for each row.

【図19】第3の実施形態における処理装置のブロック
図。
FIG. 19 is a block diagram of a processing device according to a third embodiment.

【図20】三行画像記憶部の記憶例を示す図。FIG. 20 is a diagram showing a storage example of a three-row image storage unit.

【図21】2×2サイズのウィンドウのメディアンフィ
ルタ処理を施している様子を示す図。
FIG. 21 is a diagram showing how a median filter process is applied to a 2 × 2 size window.

【図22】第4の実施形態における処理装置のブロック
図。
FIG. 22 is a block diagram of a processing device according to a fourth embodiment.

【図23】第5の実施形態における処理装置のブロック
図。
FIG. 23 is a block diagram of a processing device according to a fifth embodiment.

【図24】各組大小比較部の構成例を示す図。FIG. 24 is a diagram showing a configuration example of each group size comparison unit.

【符号の説明】[Explanation of symbols]

1…各組ソート部、2…組中央値順序決定部、3…メデ
ィアン決定部、4…最小値決定部、5…最大値決定部。
1 ... Each set sorting unit, 2 ... Set median value order determining unit, 3 ... Median determining unit, 4 ... Minimum value determining unit, 5 ... Maximum value determining unit.

─────────────────────────────────────────────────────
─────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成15年1月9日(2003.1.9)[Submission date] January 9, 2003 (2003.1.9)

【手続補正1】[Procedure Amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】請求項1[Name of item to be corrected] Claim 1

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【手続補正2】[Procedure Amendment 2]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】請求項2[Name of item to be corrected] Claim 2

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【手続補正3】[Procedure 3]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0015[Name of item to be corrected] 0015

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0015】[0015]

【課題を解決するための手段】この発明のデータ処理装
置は、9個のデータを数値順にした際の中央のデータの
値を得るものにおいて、9個のデータを、3個のデータ
を一組とする3組に分け、各組ごとに数値の大きい順
に、第1データ、第2データ、第3データに並べ替え、
この並び替えた各組の第2データの値の大きい順に、第
1組、第2組、第3組に設定する設定手段と、第1組第
3データの値よりも第2組第2データの値が大きく、か
つ第2組第2データの値よりも第3組第1データの値が
大きい場合、第2組第2データを、上記9個のデータを
数値順にした際の中央のデータと判断する第1の判断手
段と、第1組第3データの値よりも第2組第2データの
値が小さく、かつ第2組第2データの値よりも第3組第
1データの値が小さい場合、第2組第2データを、上記
9個のデータを数値順にした際の中央のデータと判断す
る第2の判断手段と、第1組第3データの値よりも第2
組第2データの値が小さく、かつ第2組第2データの値
よりも第3組第1データの値が大きい場合、第1組第3
データ、第2組第1データ、第3組第1データの中で一
小さな値のデータを、9個のデータを数値順にした際
の中央のデータと判断する第3の判断手段と、第1組第
3データの値よりも第2組第2データの値が大きく、か
つ第2組第2データの値よりも第3組第1データの値が
小さい場合、第1組第3データ、第2組第3データ、第
3組第1データの中で一番大きな値のデータを、9個の
データを数値順にした際の中央のデータと判断する第4
の判断手段とを有する。
The data processing apparatus of the present invention obtains the value of the central data when 9 pieces of data are arranged in numerical order, and sets 9 pieces of data and 3 pieces of data as a set. The data is sorted into the first data, the second data, and the third data in descending order of numerical value for each group.
Setting means for setting the first set, the second set, and the third set in the descending order of the value of the second data of each sorted set, and the second set of the second data rather than the value of the first set of the third data. Is large and the value of the first data of the third group is larger than the value of the second data of the second group, the second data of the second group is the central data when the above nine data are arranged in numerical order. And a value of the third data set that is smaller than the value of the second data set of the second group and smaller than the value of the second data set of the first set. Is smaller than the value of the third data of the first set, the second determination means for determining the second data of the second set as the central data when the above nine data are arranged in numerical order.
When the value of the second data of the set is small and the value of the first data of the third set is larger than the value of the second data of the second set, the third data of the first set
A third judging means for judging the data having the smallest value among the data , the first data of the second set, and the first data of the third set to be the central data when the nine data are arranged in numerical order; When the value of the second set of second data is larger than the value of the first set of third data and the value of the third set of first data is smaller than the value of the second set of second data, the first set of third data, The data of the largest value in the third data of the second group and the first data of the third group is judged to be the central data when the nine data are arranged in numerical order.
And the judgment means of.

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】 9個のデータを数値順にした際の中央の
データの値を得るデータ処理装置において、 9個のデータを、3個のデータを一組とする3組に分
け、各組ごとに数値の大きい順に、第1データ、第2デ
ータ、第3データに並べ替え、この並び替えた各組の第
2データの値の大きい順に、第1組、第2組、第3組に
設定する設定手段と、 第1組第3データの値よりも第2組第2データの値が大
きく、かつ第2組第2データの値よりも第3組第1デー
タの値が大きい場合、第2組第2データを、上記9個の
データを数値順にした際の中央のデータと判断する第1
の判断手段と、 第1組第3データの値よりも第2組第2データの値が小
さく、かつ第2組第2データの値よりも第3組第1デー
タの値が小さい場合、第2組第2データを、上記9個の
データを数値順にした際の中央のデータと判断する第2
の判断手段と、 第1組第3データの値よりも第2組第2データの値が小
さく、かつ第2組第2データの値よりも第3組第1デー
タの値が大きい場合、第1組第3データ、第2組第3デ
ータ、第3組第1データの中で一番大きな値のデータ
を、9個のデータを数値順にした際の中央のデータと判
断する第3の判断手段と、 第1組第3データの値よりも第2組第2データの値が大
きく、かつ第2組第2データの値よりも第3組第1デー
タの値が小さい場合、第1組第3データ、第2組第3デ
ータ、第3組第1データの中で一番大きな値のデータ
を、9個のデータを数値順にした際の中央のデータと判
断する第4の判断手段と、 を具備したことを特徴とするデータ処理装置。
1. A data processing device for obtaining a value of central data when 9 pieces of data are arranged in numerical order. 9 pieces of data are divided into 3 sets of 3 pieces, and each set is divided. Are sorted into the first data, the second data, and the third data in descending order of numerical value, and the first data set, the second data set, and the third data set in descending order of the value of the second data of each sorted data set. And the setting means for setting, the value of the second data of the second group is larger than the value of the third data of the first group, and the value of the third data of the third group is larger than the value of the second data of the second group, The second set of 2nd data is judged to be the central data when the above 9 data are arranged in numerical order.
And the value of the second data of the second group is smaller than the value of the third data of the first group, and the value of the first data of the third group is smaller than the value of the second data of the second group, The 2nd set of 2nd data is judged to be the central data when the above 9 data are arranged in numerical order.
And the value of the second data of the second group is smaller than the value of the third data of the first group, and the value of the first data of the third group is larger than the value of the second data of the second group, The third judgment that the data with the largest value among the third data of the first set, the third data of the second set, and the first data of the third set is the central data when the nine data are arranged in numerical order. Means, and the value of the second data of the second group is larger than the value of the third data of the first group, and the value of the first data of the third group is smaller than the value of the second data of the second group, the first group A fourth judging means for judging the data having the largest value among the third data, the second data set, the third data set, and the third data set, as the central data when the nine data items are arranged in numerical order. A data processing device comprising:
【請求項2】 9個のデータを数値順にした際の中央の
データの値を得るデータ処理方法において、 9個のデータを、3個のデータを一組とする3組に分
け、各組ごとに数値の大きい順に、第1データ、第2デ
ータ、第3データに並べ替え、 この並び替えた各組の第2データの値の大きい順に、第
1組、第2組、第3組とし、 第1組第3データの値よりも第2組第2データの値が大
きく、かつ第2組第2データの値よりも第3組第1デー
タの値が大きい場合、第2組第2データを、上記9個の
データを数値順にした際の中央のデータと判断し、 第1組第3データの値よりも第2組第2データの値が小
さく、かつ第2組第2データの値よりも第3組第1デー
タの値が小さい場合、第2組第2データを、上記9個の
データを数値順にした際の中央のデータと判断し、 第1組第3データの値よりも第2組第2データの値が小
さく、かつ第2組第2データの値よりも第3組第1デー
タの値が大きい場合、第1組第3データ、第2組第3デ
ータ、第3組第1データの中で一番大きな値のデータ
を、9個のデータを数値順にした際の中央のデータと判
断し、 第1組第3データの値よりも第2組第2データの値が大
きく、かつ第2組第2データの値よりも第3組第1デー
タの値が小さい場合、第1組第3データ、第2組第3デ
ータ、第3組第1データの中で一番大きな値のデータ
を、9個のデータを数値順にした際の中央のデータと判
断する、 ことを特徴とするデータ処理方法。
2. A data processing method for obtaining a value of central data when 9 pieces of data are arranged in numerical order, wherein 9 pieces of data are divided into 3 sets of 3 pieces, and each set is divided into 3 sets. The first data, the second data, and the third data are sorted in descending order of numerical value, and the first data set, the second data set, and the third data set are arranged in descending order of the second data value of each sorted data set. When the value of the second data of the second group is larger than the value of the third data of the first group and the value of the first data of the third group is larger than the value of the second data of the second group, the second data of the second group Is determined as the central data when the above 9 data are arranged in numerical order, and the value of the second data of the second group is smaller than the value of the third data of the first group, and the value of the second data of the second group. When the value of the first data of the third set is smaller than that of the second data of the second set If the value of the second data of the second group is smaller than the value of the third data of the first group and the value of the first data of the third group is larger than the value of the second data of the second group, The data with the largest value among the first set third data, the second set third data, and the third set first data is determined to be the central data when the nine data are arranged in numerical order, and If the value of the second data of the second set is larger than the value of the third data of the set and the value of the first data of the third set is smaller than the value of the second data of the second set, the third data of the first set, A data processing method, characterized in that the data having the largest value among the second data of the third set and the first data of the third set is determined to be the central data when the nine data are arranged in numerical order.
【請求項3】 9個のデータの中央値を得るデータ処理
装置において、 9個のデータを、3個のデータを一組とする3組に分
け、各組ごとにデータ値の昇順もしくは降順に並べ替え
る第1の処理手段と、 中央値が最大の第1組と、第1組の次に大きな中央値を
持つ第2組と、最小の中央値を持つ第3組とを判断する
第1の判断手段と、 第1組の最小値と第2組の中央値の大小関係と、第2組
の中央値と第3組の最大値の大小関係とを調べる第2の
処理手段と、 この第2の処理手段により第1組の最小値が第2組の中
央値以上かつ第2組の中央値が第3組の最大値以上であ
った場合、あるいは第1組の最小値が第2組の中央値以
下かつ第2組の中央値が第3組の最大値以下であった場
合に、第2組の中央値を上記9個のデータの中央値と判
断する第2の判断手段と、 上記第2の処理手段により第1組の最小値が第2組の中
央値より大きくかつ第3組の最大値が第2組の中央値よ
り大きい場合、第1組の最小値と第3組の最大値と第2
組の最大値の中の最小値を上記9個のデータの中央値と
判断する第3の判断手段と、 上記第2の処理手段により第1組の最小値が第2組の中
央値より小さくかつ第3組の最大値が第2組の中央値よ
り小さい場合、第1組の最小値と第3組の最大値と第2
組の最小値の中の最大値を上記9個のデータの中央値と
判断する第4の判断手段と、 を具備することを特徴とするデータ処理装置。
3. A data processing device for obtaining a median value of 9 data, wherein 9 data are divided into 3 sets of 3 data, and each set is in ascending or descending order of data values. A first processing means for rearranging, a first group having the largest median value, a second group having a second largest median value of the first group, and a third group having a smallest median value. And a second processing means for checking the magnitude relationship between the minimum value of the first set and the median value of the second set, and the magnitude relationship between the median value of the second set and the maximum value of the third set. When the minimum value of the first set is greater than or equal to the median value of the second set and the median value of the second set is greater than or equal to the maximum value of the third set by the second processing means, or the minimum value of the first set is the second value. If the median value of the second set is less than or equal to the maximum value of the third set, the median value of the second set is determined to be the median value of the above nine data The second determining means and the second processing means, when the minimum value of the first set is larger than the median value of the second set and the maximum value of the third set is larger than the median value of the second set, The minimum value of the set and the maximum value of the third set and the second
Third judging means for judging the minimum value of the maximum values of the set as the median value of the nine data, and the minimum value of the first set being smaller than the median value of the second set by the second processing means. And the maximum value of the third set is smaller than the median value of the second set, the minimum value of the first set, the maximum value of the third set, and the second value
4. A data processing device, comprising: a fourth judgment means for judging the maximum value of the minimum values of the set to be the median value of the nine pieces of data.
【請求項4】 入力画像の各画素に対し、各画素を中心
とする3×3サイズのウィンドウ内の9個の画素値の中
央値を、出力画像における各画素の画素値とする画像処
理装置において、 上記ウィンドウ内の画素を行方向または列方向に並ぶ3
画素からなる3組に分けたとき、上記ウィンドウの3組
のうち、上記方向と異なる方向に隣接する処理済の画素
を中心とする前回のウィンドウ内に含まれない1組を昇
順もしくは降順に並べ替える第1の処理手段と、 上記前回のウィンドウ内に含まれる2組について、上記
処理済の画素の処理時に、昇順もしくは降順に並べ替え
た結果を保持している記憶手段と、 中央値が最大の第1組と、第1組の次に大きな中央値を
持つ第2組と、最小の中央値を持つ第3組とを判断する
第1の判断手段と、 第1組の最小値と第2組の中央値の大小関係と、第2組
の中央値と第3組の最大値の大小関係とを調べる第2の
処理手段と、 この第2の処理手段により第1組の最小値が第2組の中
央値以上かつ第2組の中央値が第3組の最大値以上であ
った場合、あるいは第1組の最小値が第2組の中央値以
下かつ第2組の中央値が第3組の最大値以下であった場
合に、第2組の中央値を上記9個の画素の中央値と判断
する第2の判断手段と、 上記第2の処理手段により第1組の最小値が第2組の中
央値より大きくかつ第3組の最大値が第2組の中央値よ
り大きい場合、第1組の最小値と第3組の最大値と第2
組の最大値の中の最小値を上記9個の画素の中央値と判
断する第3の判断手段と、 上記第2の処理手段により第1組の最小値が第2組の中
央値より小さくかつ第3組の最大値が第2組の中央値よ
り小さい場合、第1組の最小値と第3組の最大値と第2
組の最小値の中の最大値を上記9個の画素の中央値と判
断する第4の判断手段と、 を具備したことを特徴とする画像処理装置。
4. An image processing apparatus in which, for each pixel of an input image, the median value of nine pixel values in a 3 × 3 size window centered on each pixel is the pixel value of each pixel in the output image. In, the pixels in the window are arranged in the row or column direction 3
When divided into three sets of pixels, one set which is not included in the previous window centering on the processed pixel adjacent to the direction different from the above direction among the three sets of windows is arranged in ascending or descending order. A first processing means for changing, a storage means for holding a result of rearranging the two sets included in the previous window in ascending or descending order when processing the processed pixels, and a maximum median value. Of the first set, the second set having the next largest median value of the first set, and the third set having the smallest median value; Second processing means for checking the magnitude relationship between the two groups of median values and the magnitude relationship between the median value of the second group and the maximum value of the third group, and the minimum value of the first group by the second processing means When the median of the second set is greater than or equal to the median of the second set and is greater than or equal to the maximum of the third set , Or if the minimum value of the first set is less than or equal to the median value of the second set and the median value of the second set is less than or equal to the maximum value of the third set, then the median value of the second set is set to The second judging means for judging the median value and the second processing means make the minimum value of the first set larger than the median value of the second set and the maximum value of the third set larger than the median value of the second set. If the minimum value of the first set, the maximum value of the third set, and the second
Third determining means for determining the minimum value of the maximum values of the set as the median value of the nine pixels, and the minimum value of the first set being smaller than the median value of the second set by the second processing means. And the maximum value of the third set is smaller than the median value of the second set, the minimum value of the first set, the maximum value of the third set, and the second value
An image processing apparatus comprising: a fourth determination unit that determines the maximum value of the minimum value of the set as the median value of the nine pixels.
【請求項5】 入力画像の各画素に対し、各画素を中心
とする3×3サイズのウィンドウ内の9個の画素値の中
央値を、出力画像における各画素の画素値とする画像処
理装置において、 入力画像の3行もしくは3列の画素を記憶する記憶手段
と、 記憶された画素を、列方向もしくは行方向に並ぶ3画素
ずつの組に分け、各組ごとに画素値の昇順もしくは降順
に並べ替える第1の処理手段と、 中央値が最大の第1組と、第1組の次に大きな中央値を
持つ第2組と、最小の中央値を持つ第3組とを判断する
第1の判断手段と、 第1組の最小値と第2組の中央値の大小関係と、第2組
の中央値と第3組の最大値の大小関係とを調べる第2の
処理手段と、 この第2の処理手段により第1組の最小値が第2組の中
央値以上かつ第2組の中央値が第3組の最大値以上であ
った場合、あるいは第1組の最小値が第2組の中央値以
下かつ第2組の中央値が第3組の最大値以下であった場
合に、第2組の中央値を上記9個の画素の中央値と判断
する第2の判断手段と、 上記第2の処理手段により第1組の最小値が第2組の中
央値より大きくかつ第3組の最大値が第2組の中央値よ
り大きい場合、第1組の最小値と第3組の最大値と第2
組の最大値の中の最小値を上記9個の画素の中央値と判
断する第3の判断手段と、 上記第2の処理手段により第1組の最小値が第2組の中
央値より小さくかつ第3組の最大値が第2組の中央値よ
り小さい場合、第1組の最小値と第3組の最大値と第2
組の最小値の中の最大値を上記9個の画素の中央値と判
断する第4の判断手段と、 を具備したことを特徴とする画像処理装置。
5. An image processing apparatus in which, for each pixel of an input image, the median value of nine pixel values in a 3 × 3 size window centered on each pixel is the pixel value of each pixel in the output image. In, a storage means for storing pixels in three rows or three columns of an input image, and the stored pixels are divided into groups of three pixels arranged in the column direction or the row direction, and the pixel values are arranged in ascending or descending order for each group. A first processing means for rearranging to, a first group with the largest median value, a second group with the next largest median value of the first group, and a third group with the smallest median value. 1, a second processing means for checking the magnitude relationship between the minimum value of the first set and the median value of the second set, and the magnitude relationship of the median value of the second set and the maximum value of the third set; By this second processing means, the minimum value of the first set is equal to or greater than the median value of the second set and the median value of the second set is the third set. If the minimum value of the first set is less than the median value of the second set and the median value of the second set is less than or equal to the maximum value of the third set, the median value of the second set is greater than or equal to the maximum value. Is determined as the median value of the nine pixels, and the second processing means determines that the minimum value of the first set is greater than the median value of the second set and the maximum value of the third set is the maximum value. If greater than the median of the two sets, the minimum value of the first set and the maximum value of the third set and the second value
Third determining means for determining the minimum value of the maximum values of the set as the median value of the nine pixels, and the minimum value of the first set being smaller than the median value of the second set by the second processing means. And the maximum value of the third set is smaller than the median value of the second set, the minimum value of the first set, the maximum value of the third set, and the second value
An image processing apparatus comprising: a fourth determination unit that determines the maximum value of the minimum value of the set as the median value of the nine pixels.
【請求項6】 入力画像の各画素に対し、各画素を含む
2×2サイズのウィンドウ内の4個の画素値の中央値を
出力画像における各画素の画素値とする画像処理装置に
おいて、 4個の画素のうち任意の3個の画素値を選び、前記3個
の画素値の中央値を出力画像の画素値とする処理手段を
具備したことを特徴とする画像処理装置。
6. An image processing apparatus, wherein, for each pixel of an input image, a median value of four pixel values in a 2 × 2 size window including each pixel is set as a pixel value of each pixel in the output image, An image processing apparatus comprising: a processing unit that selects any three pixel values from the number of pixels and sets a median value of the three pixel values as a pixel value of an output image.
【請求項7】 入力画像の各画素に対し、各画素を含む
2×2サイズのウィンドウ内の4個の画素値の中央値を
出力画像における各画素の画素値とする画像処理装置に
おいて、 上記ウィンドウ内の画素を2画素を一組とする2組に分
け、各組ごとに2個の画素値の大小関係を調べる第1の
処理手段と、 各組の大きい方の2個の画素値の大小関係を調べ、この
2個の画素値のうち小さい方の画素値を出力する第1の
出力手段と、 各組の小さい方の2個の画素値の大小関係を調べ、この
2個の画素値のうち大きい方の画素値を出力する第2の
出力手段と、 上記第1の出力手段の出力と上記第2の出力手段の出力
の平均を出力画像の画素値とする第2の処理手段と、 を具備したことを特徴とする画像処理装置。
7. An image processing apparatus, wherein for each pixel of an input image, a median value of four pixel values in a 2 × 2 size window including each pixel is set as a pixel value of each pixel in the output image, Pixels in the window are divided into two groups, each group consisting of two pixels, and a first processing means for checking the magnitude relationship between two pixel values for each group, and two larger pixel values for each group. The magnitude relationship between the smaller output pixel value of the two pixel values and the first output means for outputting the smaller pixel value of the two pixel values and the smaller size value of the two smaller pixel values of each set are checked, and the two pixel values are checked. Second output means for outputting the larger pixel value of the values, and second processing means for averaging the output of the first output means and the output of the second output means as the pixel value of the output image An image processing apparatus comprising:
【請求項8】 9個のデータの中央値を得るデータ処理
方法において、 9個のデータを、3個のデータを一組とする3組に分
け、各組ごとにデータ値の昇順もしくは降順に並べ替
え、 中央値が最大の第1組と、第1組の次に大きな中央値を
持つ第2組と、最小の中央値を持つ第3組とを判断し、 第1組の最小値と第2組の中央値の大小関係と、第2組
の中央値と第3組の最大値の大小関係とを調べ、 この第1組の最小値が第2組の中央値以上かつ第2組の
中央値が第3組の最大値以上であった場合、あるいは第
1組の最小値が第2組の中央値以下かつ第2組の中央値
が第3組の最大値以下であった場合に、第2組の中央値
を上記9個のデータの中央値と判断し、 上記第1組の最小値が第2組の中央値より大きくかつ第
3組の最大値が第2組の中央値より大きい場合、第1組
の最小値と第3組の最大値と第2組の最大値の中の最小
値を上記9個のデータの中央値と判断し、 上記第1組の最小値が第2組の中央値より小さくかつ第
3組の最大値が第2組の中央値より小さい場合、第1組
の最小値と第3組の最大値と第2組の最小値の中の最大
値を上記9個のデータの中央値と判断するすることを特
徴とするデータ処理方法。
8. A data processing method for obtaining a median value of 9 data, wherein 9 data are divided into 3 sets, each set of 3 data, and each set is arranged in ascending or descending order of data values. Rearrangement, the first group with the largest median value, the second group with the next largest median value of the first group, and the third group with the smallest median value are determined, The relationship between the median value of the second set and the relationship between the median value of the second set and the maximum value of the third set is examined, and the minimum value of this first set is equal to or greater than the median value of the second set and the second set. The median of is greater than or equal to the maximum of the third set, or the minimum of the first is less than or equal to the median of the second and the median of the second is less than or equal to the maximum of the third. The median value of the second set is determined as the median value of the nine data, and the minimum value of the first set is larger than the median value of the second set and the maximum value of the third set is the second set. When it is larger than the median value, the minimum value among the minimum value of the first set, the maximum value of the third set and the maximum value of the second set is determined as the median value of the above nine data, and the minimum value of the first set is determined. If the value is less than the median value of the second set and the maximum value of the third set is less than the median value of the second set, then the minimum value of the first set, the maximum value of the third set, and the minimum value of the second set Is determined as the median value of the above nine pieces of data.
【請求項9】 入力画像の各画素に対し、各画素を中心
とする3×3サイズのウィンドウ内の9個の画素値の中
央値を、出力画像における各画素の画素値とする画像処
理方法において、 上記ウィンドウ内の画素を行方向または列方向に並ぶ3
画素からなる3組に分けたとき、上記ウィンドウの3組
のうち、上記方向と異なる方向に隣接する処理済の画素
を中心とする前回のウィンドウ内に含まれない1組を昇
順もしくは降順に並べ替え、 上記前回のウィンドウ内に含まれる2組について、上記
処理済の画素の処理時に、昇順もしくは降順に並べ替え
た結果を保持し、 中央値が最大の第1組と、第1組の次に大きな中央値を
持つ第2組と、最小の中央値を持つ第3組とを判断し、 第1組の最小値と第2組の中央値の大小関係と、第2組
の中央値と第3組の最大値の大小関係とを調べ、 第1組の最小値が第2組の中央値以上かつ第2組の中央
値が第3組の最大値以上であった場合、あるいは第1組
の最小値が第2組の中央値以下かつ第2組の中央値が第
3組の最大値以下であった場合に、第2組の中央値を上
記9個の画素の中央値と判断し、 上記第1組の最小値が第2組の中央値より大きくかつ第
3組の最大値が第2組の中央値より大きい場合、第1組
の最小値と第3組の最大値と第2組の最大値の中の最小
値を上記9個の画素の中央値と判断し、 上記第1組の最小値が第2組の中央値より小さくかつ第
3組の最大値が第2組の中央値より小さい場合、第1組
の最小値と第3組の最大値と第2組の最小値の中の最大
値を上記9個の画素の中央値と判断することを特徴とす
る画像処理方法。
9. An image processing method in which, for each pixel of an input image, a median value of nine pixel values in a 3 × 3 size window centered on each pixel is set as a pixel value of each pixel in the output image. In, the pixels in the window are arranged in the row or column direction 3
When divided into three sets of pixels, one set which is not included in the previous window centering on the processed pixel adjacent to the direction different from the above direction among the three sets of windows is arranged in ascending or descending order. In other words, for the two groups included in the previous window, the results of rearranging in ascending or descending order when the processed pixels are processed are retained, and the first group having the maximum median and the next group after the first group are retained. The second group having a large median value and the third group having a minimum median value are determined, and the magnitude relationship between the minimum value of the first group and the median value of the second group and the median value of the second group are determined. If the minimum value of the first set is greater than or equal to the median value of the second set and the median value of the second set is greater than or equal to the maximum value of the third set, or The minimum value of the set is less than or equal to the median value of the second set, and the median value of the second set is less than or equal to the maximum value of the third set. And the median value of the second set is determined as the median value of the nine pixels, and the minimum value of the first set is greater than the median value of the second set and the maximum value of the third set is the median value of the second set. If it is larger than the value, the minimum value among the minimum value of the first set, the maximum value of the third set and the maximum value of the second set is determined as the median value of the nine pixels, and the minimum value of the first set is determined. Is smaller than the median value of the second set and the maximum value of the third set is smaller than the median value of the second set, among the minimum value of the first set, the maximum value of the third set and the minimum value of the second set. An image processing method, characterized in that the maximum value is determined to be the median value of the nine pixels.
【請求項10】 入力画像の各画素に対し、各画素を中
心とする3×3サイズのウィンドウ内の9個の画素値の
中央値を、出力画像における各画素の画素値とする画像
処理方法において、 入力画像の3行もしくは3列の画素を記憶し、 この記憶された画素を、列方向もしくは行方向に並ぶ3
画素ずつの組に分け、各組を昇順もしくは降順に並べ替
え、 中央値が最大の第1組と、第1組の次に大きな中央値を
持つ第2組と、最小の中央値を持つ第3組とを判断し、 第1組の最小値と第2組の中央値の大小関係と、第2組
の中央値と第3組の最大値の大小関係とを調べ、 この第1組の最小値が第2組の中央値以上かつ第2組の
中央値が第3組の最大値以上であった場合、あるいは第
1組の最小値が第2組の中央値以下かつ第2組の中央値
が第3組の最大値以下であった場合に、第2組の中央値
を上記9個の画素の中央値と判断し、 上記第1組の最小値が第2組の中央値より大きくかつ第
3組の最大値が第2組の中央値より大きい場合、第1組
の最小値と第3組の最大値と第2組の最大値の中の最小
値を上記9個の画素の中央値と判断し、 上記第1組の最小値が第2組の中央値より小さくかつ第
3組の最大値が第2組の中央値より小さい場合、第1組
の最小値と第3組の最大値と第2組の最小値の中の最大
値を上記9個の画素の中央値と判断することを特徴とす
る画像処理方法。
10. An image processing method in which, for each pixel of an input image, a median value of nine pixel values in a 3 × 3 size window centered on each pixel is set as a pixel value of each pixel in the output image. In, the pixels of three rows or three columns of the input image are stored, and the stored pixels are arranged in the column direction or the row direction.
Divide into groups of pixels, sort each group in ascending or descending order, the first group with the largest median value, the second group with the next largest median value of the first group, and the second group with the smallest median value. It is determined that there are three groups, and the magnitude relationship between the minimum value of the first group and the median value of the second group and the magnitude relationship between the median value of the second group and the maximum value of the third group are examined. If the minimum value is greater than or equal to the median value of the second set and the median value of the second set is greater than or equal to the maximum value of the third set, or the minimum value of the first set is less than or equal to the median value of the second set and of the second set When the median value is less than or equal to the maximum value of the third set, the median value of the second set is determined to be the median value of the nine pixels, and the minimum value of the first set is lower than the median value of the second set. If it is larger and the maximum value of the third set is larger than the median value of the second set, the minimum value of the minimum value of the first set, the maximum value of the third set and the maximum value of the second set is set to 9 pixels above. Judged as the median of However, when the minimum value of the first set is smaller than the median value of the second set and the maximum value of the third set is smaller than the median value of the second set, the minimum value of the first set and the maximum value of the third set An image processing method, characterized in that the maximum value among the minimum values of the second set is judged to be the median value of the nine pixels.
【請求項11】 入力画像の各画素に対し、各画素を含
む2×2サイズのウィンドウ内の4個の画素値の中央値
を出力画像における各画素の画素値とする画像処理方法
において、 4個の画素のうち任意の3個の画素値を選び、前記3個
の画素値の中央値を出力画像の画素値とすることを特徴
とする画像処理方法。
11. An image processing method in which, for each pixel of an input image, a median value of four pixel values in a 2 × 2 size window including each pixel is used as a pixel value of each pixel in the output image, An image processing method, wherein any three pixel values are selected from the pixels and the median value of the three pixel values is set as the pixel value of the output image.
【請求項12】 入力画像の各画素に対し、各画素を含
む2×2サイズのウィンドウ内の4個の画素値の中央値
を出力画像における各画素の画素値とする画像処理方法
において、 上記ウィンドウ内の画素を2画素を一組とする2組に分
け、各組ごとに2個の画素値の大小関係を調べ、 各組の大きい方の2個の画素値の大小関係を調べ、この
2個の画素値のうち小さい方の画素値を出力し、 各組の小さい方の2個の画素値の大小関係を調べ、この
2個の画素値のうち大きい方の画素値を出力し、 上記出力される2つの画素値の平均を出力画像の画素値
とする、 ことを特徴とする画像処理方法。
12. An image processing method, wherein for each pixel of an input image, a median value of four pixel values in a 2 × 2 size window including each pixel is set as a pixel value of each pixel in the output image, Pixels in the window are divided into two groups, each group consisting of two pixels, and the magnitude relationship between the two pixel values in each group is examined, and the magnitude relationship between the two larger pixel values in each group is examined. The smaller pixel value of the two pixel values is output, the magnitude relationship between the two smaller pixel values of each set is checked, and the larger pixel value of the two pixel values is output, An image processing method, wherein an average of the two output pixel values is set as a pixel value of an output image.
JP2002099218A 2002-04-01 2002-04-01 Data processor, data processing method, image processor and image processing method Pending JP2003296730A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002099218A JP2003296730A (en) 2002-04-01 2002-04-01 Data processor, data processing method, image processor and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002099218A JP2003296730A (en) 2002-04-01 2002-04-01 Data processor, data processing method, image processor and image processing method

Publications (1)

Publication Number Publication Date
JP2003296730A true JP2003296730A (en) 2003-10-17

Family

ID=29388110

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002099218A Pending JP2003296730A (en) 2002-04-01 2002-04-01 Data processor, data processing method, image processor and image processing method

Country Status (1)

Country Link
JP (1) JP2003296730A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956598A (en) * 2019-12-05 2020-04-03 开放智能机器(上海)有限公司 Sorting system and sorting method suitable for image median filtering

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956598A (en) * 2019-12-05 2020-04-03 开放智能机器(上海)有限公司 Sorting system and sorting method suitable for image median filtering
CN110956598B (en) * 2019-12-05 2024-02-02 开放智能机器(上海)有限公司 Ordering system and ordering method suitable for median filtering of images

Similar Documents

Publication Publication Date Title
US5737251A (en) Rank order filter
JP3853034B2 (en) Object boundary determination method and apparatus, and recording medium recording object boundary determination program
KR20210036715A (en) Neural processing apparatus and method for processing pooling of neural network thereof
JP6645252B2 (en) Arithmetic processing unit
US4800511A (en) Method of smoothing image data
US20170054990A1 (en) Encoding device, decoding device, and image processing device
CN106682258B (en) Multi-operand addition optimization method and system in high-level comprehensive tool
JP2003296730A (en) Data processor, data processing method, image processor and image processing method
US20160232641A1 (en) Method for efficient median filtering
KR102494565B1 (en) Method for optimizing hardware structure of convolutional neural networks
CN110990349A (en) Unbalanced log oversampling method in intelligent system security system
JP7391824B2 (en) Information processing device, information processing method and program
CN111831207A (en) Data processing method, device and equipment
JP3204562B2 (en) Median filter processing method
JPH07192130A (en) Temporary labeling method
US20220269752A1 (en) Execution method for convolution computation
JPWO2007088973A1 (en) Data classification method, data classification device, computer program, and recording medium
US11132569B2 (en) Hardware accelerator for integral image computation
JP2006085686A (en) Image processing method and image processor
JP2001034751A (en) Image processing method, image processor and storage medium storing image processing program
JP6827721B2 (en) Pattern discrimination device, information processing device, pattern discrimination method
US8347069B2 (en) Information processing device, information processing method and computer readable medium for determining a processing sequence of processing elements
CN117319623A (en) Method for synthesizing pattern
JP2024027790A (en) Estimation device, estimation method, and estimation program
JP2857260B2 (en) Judgment method of rectangular area

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050401

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080513

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080520

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081021