JPH05233804A - Median filter - Google Patents

Median filter

Info

Publication number
JPH05233804A
JPH05233804A JP4036185A JP3618592A JPH05233804A JP H05233804 A JPH05233804 A JP H05233804A JP 4036185 A JP4036185 A JP 4036185A JP 3618592 A JP3618592 A JP 3618592A JP H05233804 A JPH05233804 A JP H05233804A
Authority
JP
Japan
Prior art keywords
pixel data
data
pixel
median filter
bit
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
JP4036185A
Other languages
Japanese (ja)
Inventor
Mikio Fujiwara
美貴雄 藤原
Takayuki Minemaru
貴行 峯丸
Hisashi Takayama
久 高山
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP4036185A priority Critical patent/JPH05233804A/en
Publication of JPH05233804A publication Critical patent/JPH05233804A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

PURPOSE:To obtain the median filter at low cost with a hardware amount less than half in comparison with the conventional amount by inserting new data to already positioned data. CONSTITUTION:This median filter is provided with pixel data identifying means 113a-113i, pixel data discharging means 115a-115i and 116a-116i, pixel data inserting means 115a-115i and 116a-116i, and pixel data extracting means. Concerning an operation to update pixel data for each picture element, picture elements to get out of a comparing object at the time of updating and picture element to be newly added to the comparing object are managed by relative position numbers for identification from [m is an integer 1] m<2> pieces of pixel data such as positive integers from '0' to (m<2>-1) or (u, v) (0<=u<=m-1, 0<=v<=m-1) expressed by the remainder system of m while utilizing the size relation of (m<2>-1) pieces of pixel data are already known among the m<2> pieces of pixel data so as to a ways insert one new data to the (m<2>-1) pieces of already ordered data.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、衛星放送受信装置や
FA(Factory Automation;ファクトリ・オートメーシ
ョン)機器のパターン認識装置や自動外観検査装置等で
入力画像データの雑音成分の低減を含む画質改善のため
に用いられるメディアンフィルタに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to image quality improvement including reduction of noise components of input image data in a satellite broadcasting receiver, a pattern recognition device of FA (Factory Automation) equipment, an automatic appearance inspection device and the like. It relates to a median filter used for.

【0002】[0002]

【従来の技術】多値画像の画像処理で、雑音成分の低減
を含む画質改善のために、画像認識の前処理でよく用い
られるメディアンフィルタは、隣接するm×m個(mは
1より大きい正の整数)の画素領域の中で、最大値から
2 /2番目の画素の値を中央値として出力するフィル
タである。
2. Description of the Related Art In image processing of a multi-valued image, median filters often used in preprocessing of image recognition for improving image quality including reduction of noise components are adjacent m × m filters (m is larger than 1). It is a filter that outputs the value of the m 2 / 2nd pixel from the maximum value as the median value in the (positive integer) pixel area.

【0003】メディアンフィルタは、局所平均をとるフ
ィルタに比較して、輪郭部がぼけないという利点がある
ため、フリッカ状の雑音の除去に有効である。メディア
ンフィルタでの処理は、nビット長の画像信号I(i,
j)について隣接するm×m個の画素領域を想定し、そ
の領域内の画素値を逐次比較し、画素値の大きい順番に
並べたときのm2 /2番目の画素値を処理結果として出
力するものであり、ソート処理の一種と考えることがで
きる。
The median filter is effective in removing flicker-like noise because it has the advantage that the contour portion is not blurred as compared with a filter that takes a local average. The processing by the median filter is performed by the image signal I (i, i,
Assuming adjacent m × m pixel regions for j), pixel values in the regions are sequentially compared, and the m 2 / 2nd pixel value when arranged in the descending order of pixel values is output as the processing result. It can be considered as a sort of sorting process.

【0004】メディアンフィルタを構成する従来例とし
て、各画素間での比較を行うコンパレータモジュールの
ネットワークで構成する例が、ソーティング・アンド・
サーチング、ザ・アート・オブ・コンピュータ・プログ
ラミング(Sorting and Searching,THE ART OF COMPUTE
R PROGRAMMING vol.3 pp.220-246 )に掲載されてい
る。この構成の具体例を、m=3の場合について、図を
用いて説明する。
As a conventional example of configuring a median filter, an example of configuring with a network of comparator modules for comparing each pixel is a sorting and
Sorting and Searching, THE ART OF COMPUTE
R PROGRAMMING vol.3 pp.220-246). A specific example of this configuration will be described with reference to the drawings when m = 3.

【0005】図4は3×3個の画素領域に対してメディ
アンフィルタを構成する場合のブロック図である。図4
において、画像信号入力端子40にはnビット長の画像
信号I(i+2,j+1)が入力され、画像信号入力端
子41には画像信号入力端子40よりも1水平期間ずれ
たnビット長の画像信号I(i+2,j)が入力され、
画像信号入力端子42には画像信号入力端子40よりも
2水平期間ずれたnビット長の画像信号I(i+2,j
−1)が入力される。
FIG. 4 is a block diagram when a median filter is formed for 3 × 3 pixel areas. Figure 4
, An image signal I (i + 2, j + 1) having an n-bit length is input to the image signal input terminal 40, and an image signal having an n-bit length shifted by one horizontal period from the image signal input terminal 40 is input to the image signal input terminal 41. I (i + 2, j) is input,
The image signal input terminal 42 has an image signal I (i + 2, j) of n-bit length which is shifted from the image signal input terminal 40 by two horizontal periods.
-1) is input.

【0006】データロード機能付のnビットデータラッ
チ43a〜43cで、これらの画像信号をラッチし、一
画素単位でつぎのnビットデータラッチ44aに画像信
号を送りこむ。nビットデータラッチ44a〜44iで
は、データロード機能付のnビットデータラッチ43a
〜43cでパラレルからシリアルに変換された画像信号
が、44aから44iまで順番に、I(i,j+1),
I(i,j),I(i,j−1),I(i−1,j+
1),I(i−1,j),I(i−1,j−1),I
(i−2,j+1),I(i−2,j),I(i−2,
j−1)という形で、一次元のデータ列としてセットさ
れる。
These image signals are latched by the n-bit data latches 43a to 43c with a data loading function, and the image signals are sent to the next n-bit data latch 44a in pixel units. The n-bit data latches 44a to 44i are the n-bit data latches 43a with the data loading function.
The image signals converted from parallel to serial at ~ 43c are I (i, j + 1), 44a to 44i in order.
I (i, j), I (i, j-1), I (i-1, j +)
1), I (i-1, j), I (i-1, j-1), I
(I-2, j + 1), I (i-2, j), I (i-2,
j-1) and is set as a one-dimensional data string.

【0007】コンパレータモジュール45a〜45yで
は、入力された二つのデータの大小比較を行い、大きい
方のデータを上側の出力端子より出力し、小さい方のデ
ータを下側の出力端子より出力する。このコンパレータ
モジュール45a〜45yの構造をもう少し具体化した
ものが図5である。図5において、nビット長のデータ
入力端子50に、いまnビット長のデータMk が入力さ
れているとする。また、nビット長のデータ入力端子5
1に、いまnビット長のデータMl が入力されていると
する。
In the comparator modules 45a to 45y, the two input data are compared in size, the larger data is output from the upper output terminal, and the smaller data is output from the lower output terminal. FIG. 5 is a more specific embodiment of the structure of the comparator modules 45a to 45y. In FIG. 5, it is assumed that the data M k having an n-bit length is currently input to the data input terminal 50 having an n-bit length. In addition, an n-bit data input terminal 5
It is assumed that the data M 1 having an n-bit length is input to 1 .

【0008】nビット長の比較器52では、データMk
とデータMl の大小比較を行い、データMk がデータM
l よりも大きい時は、フラグ信号53に“1”をセット
し、それ以外の場合は“0”をセットする。この関係を
数式で表現すると、数1のようになる。
In the n-bit length comparator 52, the data M k
And data M l are compared in magnitude, and data M k is data M
When it is larger than l , the flag signal 53 is set to "1", and otherwise it is set to "0". When this relationship is expressed by a mathematical formula, it becomes as shown in Formula 1.

【0009】[0009]

【数1】IF Mk ≧Ml then Flag=1 IF Mk <Ml then Flag=0 つぎに、スイッチ54では、フラグ信号53に従い、入
力されたデータMk ,Ml を、nビット長のデータM’
k ,M’l としてnビット長の出力端子55,56に振
り分ける。
## EQU1 ## IF M k ≧ M l then Flag = 1 IF M k <M l then Flag = 0 Then, in the switch 54, according to the flag signal 53, the input data M k and M l are n-bit long. Data M '
It is distributed to the output terminals 55 and 56 having an n-bit length as k and M ′ l .

【0010】フラグ信号53が“1”の時には、データ
M’k としてデータMk がセットされ、データM’l
してデータMl がセットされる。一方、フラグ信号53
が“0”の時には、データM’k としてデータMl がセ
ットされ、データM’l としてデータMk がセットされ
る。この関係を数式で表現すると、数2のように表現で
きる。
[0010] When the flag signal 53 is "1", the data M 'data M k as k is set, the data M' data M l is set as l. On the other hand, the flag signal 53
But in the time of "0", the data M 'data M l as k is set, the data M' data M k is set as l. If this relationship is expressed by a mathematical expression, it can be expressed as in Equation 2.

【0011】[0011]

【数2】 IF Flag=1 then M’k =Mk 、M’l =Ml IF Flag=0 then M’k =Ml 、M’l =Mk これらのコンパレータモジュール45a〜45yのネッ
トワークを通すことにより、上から大きさの順に並べ換
えられたデータが、nビット長のデータラッチ46a〜
46iにセットされ、ソーティグ処理が終了する。
[Number 2] IF Flag = 1 then M 'k = M k, M' l = M l IF Flag = 0 then M 'k = M l, M' l = M k a network of these comparator module 45a~45y By passing the data, the data rearranged in the order of size from the top is the data latches 46a to
46i is set, and the sorting process is completed.

【0012】この結果、上から5番目のデータラッチ4
6eに所望の中央値(メディアン)を得ることができ
る。
As a result, the fifth data latch 4 from the top
A desired median can be obtained in 6e.

【0013】[0013]

【発明が解決しようとする課題】しかしながら、この構
成では、コンパレータモジュール45a〜45yのネッ
トワークで、コンパレータモジュール45a〜45yが
25個(もし、6番目以下の順位付けのためのコンパレ
ータモジュールを取り除くと23個)が必要である。
However, in this configuration, in the network of the comparator modules 45a to 45y, the number of the comparator modules 45a to 45y is 25 (if the comparator modules for ranking the sixth rank and below are removed, 23 Are required).

【0014】処理の逐次性を考慮すると、さらに9段の
パイプライン構成が必要となり、パイプラインレジスタ
として図示以外に72個のnビット長のデータラッチが
必要となる。このように、m=3の9個のデータに対す
るメディアンフィルタでも、データのスループットをよ
くするために同期型のパイプライン構成をとると、23
個のコンパレータモジュールと90個のデータラッチと
3個のデータロード機能付のデータラッチとが必要とな
る。
Considering the sequentiality of processing, a pipeline structure of 9 stages is further required, and 72 n-bit data latches other than those shown in the figure are required as pipeline registers. In this way, even in the median filter for 9 data of m = 3, if the synchronous pipeline configuration is adopted to improve the data throughput, it becomes 23
This requires comparator modules, 90 data latches, and 3 data latches with a data loading function.

【0015】また、m=4の場合には、54個のコンパ
レータモジュールと176個のデータラッチと4個のデ
ータロード機能付のデータラッチとが必要となる。この
ため、m≧5というような場合に対応するには、必要と
なるハードウエア量が膨大となり現実的ではない。この
発明の目的は、少ないハードウェア量で実現することが
でき、安価なメディアンフィルタを提供することであ
る。
When m = 4, 54 comparator modules, 176 data latches and 4 data latches with data loading function are required. Therefore, in order to deal with the case of m ≧ 5, the amount of hardware required is enormous, which is not realistic. An object of the present invention is to provide an inexpensive median filter that can be realized with a small amount of hardware.

【0016】[0016]

【課題を解決するための手段】この発明は、画素データ
が一画素毎に更新される動作では、m2 個の画素データ
の内の(m2 −1)個の画素データについては、その大
小関係が既知であることを利用して、更新時に比較対象
から外れる画素と新規に比較に加わる画素とを、m2
の画素データから識別するための相対位置番号たとえば
0〜(m2 −1)までの正の整数やmの剰余系で表現さ
れる(u,v)(0 ≦u≦m−1,0≦v≦m−1)で
管理し、常に(m2 −1)個の既に順位付けられたデー
タに対して、新規の1個を挿入することにより、m×m
のメディアンフィルタ処理を実現するものである。
SUMMARY OF THE INVENTION The present invention, in the operation of the pixel data is updated every one pixel, the (m 2 -1) pieces of pixel data of the m 2 pieces of pixel data, the magnitude By utilizing the fact that the relationship is known, a relative position number for identifying a pixel that is out of the comparison target at the time of updating and a pixel newly added to the comparison from the m 2 pixel data, for example, 0 to (m 2 −1) ), And (u, v) (0 ≤ u ≤ m-1, 0 ≤ v ≤ m-1) expressed by a remainder system of m, and always manages (m 2 -1) By inserting a new one into the already ranked data, m × m
The median filter processing of is realized.

【0017】つまり、この発明のメディアンフィルタ
は、1個ずつ更新されるm2 個(mは1より大きい正整
数)の画素データを相互に比較してm2 個の画素データ
の中から中央値を有する画素データを抽出するメディア
ンフィルタであり、画素データ識別手段と画素データ排
出手段と画素データ挿入手段と画素データ抽出手段とを
備えている。
That is, the median filter of the present invention compares m 2 (m is a positive integer larger than 1) pixel data, which are updated one by one, with each other, and calculates the median value from the m 2 pixel data. Is a median filter for extracting pixel data having a pixel data identifying means, a pixel data discharging means, a pixel data inserting means, and a pixel data extracting means.

【0018】画素データ識別手段は、データラッチ上で
大きさ順に並べられた旧のm2 個の画素データの列から
更新時に比較対象から外れる画素データと残りの(m2
−1)の画素データとを識別するとともに、残りの(m
2 −1)の画素データと更新時に新規に比較対象に加わ
る画素データとを識別する機能を有し、m2 個の画素デ
ータを識別するのに、m2 個の画素データの各々に対し
て0〜(m2 −1)までの正の整数もしくはmの剰余系
で表現される(u,v)(ただし、0≦u≦m−1,0
≦v≦m−1)を割り当てている。
The pixel data identification means includes pixel data that is out of the comparison target at the time of updating and the remaining (m 2) from the column of the old m 2 pixel data arranged in the size order on the data latch.
−1) pixel data and the remaining (m
2 -1) and the pixel data having the update time ability to identify the pixel data applied to the new comparison target, to identify the m 2 pieces of pixel data, for each of the m 2 pieces of pixel data Represented by a positive integer from 0 to (m 2 −1) or a remainder system of m (u, v) (where 0 ≦ u ≦ m−1,0
≦ v ≦ m−1) is assigned.

【0019】画素データ排出手段は、大きさ順に並べら
れた旧のm2 個の画素データの配列から比較対象から外
れる画素データを画素データ識別手段による識別情報に
基づいて選択的に排出する機能を有する。画素データ挿
入手段は、画素データ識別手段による識別情報に基づい
て大きさ順に配列された残りの(m2 −1)の画素デー
タと新規に比較対象に加わる画素データとを比較して残
りの(m2 −1)の画素データの列の中に新規に比較対
象に加わる画素データを大きさ順の並びを崩さない状態
に挿入して新のm2 個の画素データの列を作成する機能
を有する。
The pixel data discharging means has a function of selectively discharging pixel data out of the comparison target from the array of the old m 2 pixel data arranged in order of size based on the identification information by the pixel data identification means. Have. The pixel data insertion unit compares the remaining (m 2 −1) pixel data arranged in order of size based on the identification information by the pixel data identification unit with the pixel data newly added to the comparison target, and the remaining ( The function of creating new m 2 pixel data columns by inserting the pixel data newly added to the comparison target into the m 2 -1) pixel data columns in a state that the arrangement in the order of size is not broken. Have.

【0020】画素データ抽出手段は、画素データ挿入手
段により作成された新のm2 個の画素データの列の中央
の画素データを中央値として抽出する機能を有する。
The pixel data extraction means has a function of extracting the central pixel data of the column of the new m 2 pixel data created by the pixel data insertion means as the median value.

【0021】[0021]

【作用】この発明の構成によれば、既に比較処理が終了
した旧のm2 個の画素データから、比較対象から外すべ
き画素データを例えばmの剰余系で表現される相対位置
番号(u,v)で指定し、そのデータが存在していたデ
ータラッチに対して、下位のデータをシフトし、最下位
のデータラッチの値を“0”とし、相対位置番号(u,
v)=(m,m)とし、(m2 −1)個の順位付けられ
たデータ列をデータラッチ上に実現する。つぎに、新規
の比較対象となる画素データが加わると、先程比較対象
から外された画素データの相対位置番号(u,v)をこ
の画素データに与え、(m2 −1)個の順位付けられた
データ列との比較を行う。
According to the structure of the present invention, pixel data to be excluded from the comparison target is extracted from the old m 2 pixel data for which comparison processing has already been completed, for example, a relative position number (u, v), the lower data is shifted with respect to the data latch in which the data existed, the value of the lowest data latch is set to “0”, and the relative position number (u,
v) = (m, m), and realizes (m 2 −1) ordered data strings on the data latches. Next, when new pixel data to be compared is added, the relative position number (u, v) of the pixel data previously removed from the comparison is given to this pixel data, and (m 2 −1) ranking is performed. It is compared with the specified data string.

【0022】その中のi番目以降のデータよりもこのデ
ータが大きければ、i番目以降のデータおよび相対位置
番号が1つずつ下方へシフトし、このデータとその相対
位置番号が、i番目のデータラッチにロードされること
で比較動作が完結し、m画素毎に、1組のm×m個の画
素データに対するメディアンフィルタの出力が得られ
る。
If this data is larger than the i-th data and thereafter, the i-th data and the relative position numbers are shifted downward by one, and this data and its relative position number are shifted to the i-th data. The comparison operation is completed by being loaded in the latch, and the output of the median filter for one set of m × m pixel data is obtained for every m pixels.

【0023】この発明のメディアンフィルタによると、
2 個の画素データに対して、(2×m2 −1)個の比
較器と(2×m2 )個のデータラッチとm個のデータロ
ード機能付のデータラッチと制御回路からメディアンフ
ィルタを構成することができる。例えば、m=3の時に
17個の比較器と18個のデータラッチと3個のデータ
ロード機能付のデータラッチと制御回路とで、m=4の
時に31個の比較器と32個のデータラッチと4個のデ
ータロード機能付のデータラッチと制御回路とで、m=
5の時に49個の比較器と50個のデータラッチと5個
のデータロード機能付のデータラッチと制御回路とでメ
ディアンフィルタが構成ができる。
According to the median filter of the present invention,
For m 2 pixel data, (2 × m 2 −1) comparators, (2 × m 2 ) data latches, m data latches with data loading function and control circuit to median filter Can be configured. For example, when m = 3, there are 17 comparators, 18 data latches, 3 data latches with data loading function, and a control circuit. When m = 4, 31 comparators and 32 data latches. Latch, data latch with four data loading functions, and control circuit, m =
At the time of 5, a median filter can be configured by 49 comparators, 50 data latches, 5 data latches with a data load function, and a control circuit.

【0024】このように、この発明のメディアンフィル
タは、従来例に比較して、半分以下のハードウェア量で
実現でき、1画素1クロック期間で処理を実行できるメ
ディアンフィルタを安価に提供することができる。
As described above, the median filter of the present invention can be realized with less than half the amount of hardware as compared with the conventional example, and it is possible to inexpensively provide the median filter which can execute the processing in one clock period of one pixel. it can.

【0025】[0025]

【実施例】以下、この発明のメディアンフィルタの一実
施例を図面とともに説明する。図1はこの発明の一実施
例で、m=3の場合の3×3のウィンドウサイズでメデ
ィアンフィルタを構成した場合のブロック図である。図
1において、クロック信号100はこの回路全体の基準
クロックであり、回路の同期的な動作を制御する。タイ
ミング生成および相対番号生成回路101はクロック信
号100より回路内部のタイミング信号群の生成と入力
されるデータ毎に識別のために付加される例えば3の剰
余系で表現される4ビットの相対位置番号(u,v)
(0 ≦u≦2,0≦v≦2 )の生成を行う。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the median filter of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram of an embodiment of the present invention in which a median filter is configured with a window size of 3 × 3 when m = 3. In FIG. 1, a clock signal 100 is a reference clock for the entire circuit and controls the synchronous operation of the circuit. The timing generation / relative number generation circuit 101 generates a timing signal group in the circuit from the clock signal 100 and is added for identification for each input data, for example, a 4-bit relative position number represented by a remainder system of 3, for example. (U, v)
(0 ≤ u ≤ 2, 0 ≤ v ≤ 2) is generated.

【0026】内部同期クロック102は内部回路に対す
る同期信号である。画素クロック103は画素信号のラ
ッチおよびシフト動作に対する同期信号である。4ビッ
トの相対位置番号104は、入力された画像信号を他の
2 −1個のデータと識別するために用いられる付加情
報で、例えば0〜(m2 −1)までの正の整数やmの剰
余系で表現される(u,v)(0 ≦u≦m−1,0≦v
≦m−1)を用いることができるが、ここでは3の剰余
系で表現される4ビット情報(u,v)(0 ≦u≦2,
0≦v≦2)を用いて説明する。
The internal synchronizing clock 102 is a synchronizing signal for an internal circuit. The pixel clock 103 is a synchronization signal for latching and shifting pixel signals. The 4-bit relative position number 104 is additional information used to distinguish the input image signal from other m 2 −1 pieces of data, and is, for example, a positive integer from 0 to (m 2 −1) or (u, v) represented by the remainder system of m (0 ≤ u ≤ m-1, 0 ≤ v
≦ m−1) can be used, but here, 4-bit information (u, v) (0 ≦ u ≦ 2, represented by a remainder system of 3 is used.
The description will be made using 0 ≦ v ≦ 2).

【0027】画像信号入力端子105には、nビット長
の画像信号I(i+2,j+1)が入力され、画像信号
入力端子106には画像信号入力端子105よりも1水
平期間ずれたnビット長の画像信号I(i+2,j)が
入力され、画像信号入力端子107には画像信号入力端
子105よりも2水平期間ずれたnビット長の画像信号
I(i+2,j−1)が入力される。
An image signal I (i + 2, j + 1) having an n-bit length is input to the image signal input terminal 105, and the image signal input terminal 106 has an n-bit length shifted by one horizontal period from the image signal input terminal 105. The image signal I (i + 2, j) is input, and the image signal input terminal 107 is input with the image signal I (i + 2, j−1) having an n-bit length which is shifted by two horizontal periods from the image signal input terminal 105.

【0028】データロード機能付のnビットデータラッ
チ108a〜108cは、これらの画像信号入力端子1
05〜107より入力される画像信号をラッチする。4
ビット長のデータラッチ109は、タイミング生成およ
び相対番号生成回路102より生成される相対位置番号
(u,v)(0 ≦u≦2,0≦v≦2)をラッチする。
nビットデータラッチ110は、データロード機能付の
nビットデータラッチ108a〜108cより、画素ク
ロック103に同期してシフト動作で送られてくる画像
信号をラッチする。
The n-bit data latches 108a to 108c with the data loading function are connected to the image signal input terminal 1
The image signals input from 05 to 107 are latched. Four
The bit length data latch 109 latches the relative position number (u, v) (0 ≤ u ≤ 2, 0 ≤ v ≤ 2) generated by the timing generation and relative number generation circuit 102.
The n-bit data latch 110 latches the image signal sent by the shift operation in synchronization with the pixel clock 103 from the n-bit data latches 108 a to 108 c with the data loading function.

【0029】nビットのデータラッチ111a〜111
iは、右端を最大として順序付けられた画像信号(画素
データ)を保持する。nビットの比較回路112a〜1
12iは、nビットデータラッチ110にラッチされた
新規入力の画像信号とnビットのデータラッチ111a
〜111iに保持されている既存のm2 −1個の画像信
号との大きさを比較する。
N-bit data latches 111a-111
i holds image signals (pixel data) ordered with the right end being the maximum. n-bit comparison circuits 112a-1
12i is a newly input image signal latched by the n-bit data latch 110 and an n-bit data latch 111a.
The magnitudes of the image signals are compared with the existing m 2 −1 image signals held in 111 i.

【0030】4ビットのデータラッチ113a〜113
iは、nビットのデータラッチ111a〜111iに保
持されている画像信号に対応する相対位置番号(u,
v)(0≦u≦2,0≦v≦2)を保持し、4ビットの
一致検出回路114b〜114iは、4ビットデータラ
ッチ109にラッチされた新規入力の画像信号に対応す
る相対位置番号と4ビットのデータラッチ113a〜1
13iに保持されている既存のm2 −1個の相対位置番
号との一致を検出する(画素データ識別手段を構成す
る)。
4-bit data latches 113a to 113
i is a relative position number (u, corresponding to the image signal held in the n-bit data latches 111a to 111i).
v) (0 ≦ u ≦ 2, 0 ≦ v ≦ 2), and the 4-bit match detection circuits 114b to 114i have relative position numbers corresponding to the newly input image signal latched by the 4-bit data latch 109. And 4-bit data latches 113a-1
A match with the existing m 2 −1 relative position numbers held in 13i is detected (constituting pixel data identification means).

【0031】4入力セレクタ115a〜115iは、比
較回路112a〜112iの比較結果および4ビットの
一致検出回路114b〜114iの検出結果に従い、n
ビットデータラッチ111a〜111iに更新されるデ
ータを、nビットデータラッチ110上のデータをロー
ド、右方シフト、左方シフト、現在のデータを保持の4
つの場合から選択する(画素データ排出,挿入手段を構
成する)。
The four-input selectors 115a to 115i generate n according to the comparison results of the comparison circuits 112a to 112i and the detection results of the 4-bit match detection circuits 114b to 114i.
The data updated in the bit data latches 111a to 111i is loaded into the n-bit data latch 110, right shift, left shift, and the current data is held.
Select from two cases (constitutes pixel data discharge and insertion means).

【0032】4入力セレクタ116a〜116iは、比
較回路112a〜112iの比較結果および4ビットの
一致検出回路114b〜114iの検出結果に従い、4
ビットのデータラッチ113a〜113iに更新される
データを、4ビット長のデータラッチ109上のデータ
をロード、右方シフト、左方シフト、現在のデータを保
持の4つの場合から選択する(画素データ排出,挿入手
段を構成する)。
The 4-input selectors 116a to 116i have 4 input selectors according to the comparison results of the comparison circuits 112a to 112i and the detection results of the 4-bit match detection circuits 114b to 114i.
The data to be updated in the bit data latches 113a to 113i is selected from the four cases of loading the data in the 4-bit length data latch 109, right shift, left shift, and holding the current data (pixel data It constitutes the ejecting and inserting means).

【0033】なお、特に図示はしていないが、m個の画
素データについての排出、挿入処理が済んだ後にm2
の画素データを格納したデータラッチの中央のデータラ
ッチの画素データを中央値として抽出する手段が設けら
れている。つぎに、図2の具体的な画像データ例を用い
て、図1の回路動作を説明する。今、図2の太枠で示さ
れたデータに対してメディアンフィルタ処理が終了した
時点を初期状態にして、点線で囲まれた部分のメディア
ンフィルタ処理を行う場合の回路動作を説明する。わか
りやすくするために、この時の処理フローを図示したも
のが図3である。
Although not shown in the drawing, the pixel data of the data latch in the center of the data latch storing m 2 pixel data after the discharge and insertion processing of m pixel data is completed is set to the median value. Is provided. Next, the circuit operation of FIG. 1 will be described using the specific image data example of FIG. Now, the circuit operation in the case where the median filter processing of the portion surrounded by the dotted line is performed by setting the time when the median filter processing is completed for the data shown by the thick frame in FIG. 2 to the initial state will be described. For the sake of clarity, FIG. 3 illustrates the processing flow at this time.

【0034】図3の(0)ステップの初期状態で格子の
上段は相対位置番号を格納する4ビットのデータラッチ
113a〜113iに保持されているデータに対応し、
下段は画像信号を格納するnビットのデータラッチ11
1a〜111iに保持されているデータに対応し、右端
を最大値として左方向に次第に小さな値が格納されてい
る。
In the initial state of step (0) of FIG. 3, the upper stage of the lattice corresponds to the data held in the 4-bit data latches 113a to 113i for storing the relative position number,
The lower stage is an n-bit data latch 11 for storing image signals.
Corresponding to the data held in 1a to 111i, the right end is stored as a maximum value, and a smaller value is stored in the left direction.

【0035】この時のメディアンフィルタ出力は、右端
から5番目のnビットのデータラッチ111eに格納さ
れている相対位置番号(0,2)の“96”である。つ
ぎに、処理対象を点線で囲まれた領域にシフトするとす
る。この時、画像信号入力端子105〜107より入力
される画像信号は“56”,“82”,“56”で、そ
れぞれに対応する相対位置番号は、それぞれ(0,0
),(0,1),(0,2)で、タイミング生成およ
び相対番号生成回路101で画素クロック103に同期
して生成される。
The output of the median filter at this time is "96" of the relative position number (0, 2) stored in the n-bit data latch 111e which is the fifth from the right end. Next, it is assumed that the processing target is shifted to the area surrounded by the dotted line. At this time, the image signals input from the image signal input terminals 105 to 107 are "56", "82", and "56", and the relative position numbers corresponding to each are (0, 0).
), (0, 1), (0, 2) are generated in synchronization with the pixel clock 103 by the timing generation and relative number generation circuit 101.

【0036】nビットのデータラッチ108a〜108
cに取り込まれたこれらの画像信号はシフト動作で、n
ビットデータラッチ110に取り込まれる。最初の画像
信号“56”がnビットデータラッチ110に取り込ま
れると同時に4 ビットのデータラッチ109には、この
画像信号に対応する相対位置番号(0,2)がセットさ
れる。
N-bit data latches 108a-108
These image signals taken in by c are shifted and n
It is taken into the bit data latch 110. At the same time that the first image signal "56" is taken into the n-bit data latch 110, the relative position number (0, 2) corresponding to this image signal is set in the 4-bit data latch 109.

【0037】そして、最初に図3の(1)ステップの既
存データ中で、新規入力の画像信号と同じ相対位置番号
を有する画素信号の排出を行う。この時の実行プロセス
は、現在の相対位置番号104と9個ある4ビットのデ
ータラッチ113a〜113i上のデータとを、それぞ
れ一致検出器114b〜114iで一致検出をおこな
い、一致が見られた検出器の出力フラグを“1”とし、
以下そこから左側のすべての出力フラグを“1”とす
る。
First, in the existing data in step (1) of FIG. 3, the pixel signal having the same relative position number as the newly input image signal is discharged. In the execution process at this time, the current relative position number 104 and the data in the nine 4-bit data latches 113a to 113i are detected by the coincidence detectors 114b to 114i, respectively. Set the output flag of the container to "1",
Hereinafter, all the output flags on the left side from there will be set to "1".

【0038】この出力フラグによって、画像信号用4入
力セレクタ115a〜115iと相対位置番号用4入力
セレクタ116a〜116iを制御し、一致検出のあっ
たラッチから左側で、画像信号および相対位置番号が右
方シフトさせる。この動作は、排出対象データをクリア
して右づめを行う動作に対応する。この時、最左端には
データは存在しないので、画像信号としてnビットラッ
チ111aにはデフォルト値として“00”がセットさ
れ、相対位置番号として4ビットラッチ113aにデフ
ォルト値として(3,3)がセットされる。
This output flag controls the four-input selectors 115a to 115i for image signals and the four-input selectors 116a to 116i for relative position numbers so that the image signal and the relative position number are on the left side from the latch where the coincidence is detected. Shift one direction. This operation corresponds to the operation of clearing the discharge target data and performing right padding. At this time, since there is no data at the leftmost end, "00" is set as the default value in the n-bit latch 111a as the image signal, and (3, 3) is set as the default value in the 4-bit latch 113a as the relative position number. Is set.

【0039】つぎに、(2)ステップとしてnビットデ
ータラッチ110上の画像信号“56”と9個あるnビ
ットのデータラッチ111a〜111i上のデータと
を、それぞれ比較器112a〜112iで大小比較を行
い、データラッチ上のデータが大きい時はこの比較器の
出力フラグを“1”とし、データラッチ上のデータが小
さい時はこの比較器の出力フラグを“0”とする。
Next, in step (2), the image signal "56" on the n-bit data latch 110 and the data on the nine n-bit data latches 111a to 111i are compared by the comparators 112a to 112i. When the data on the data latch is large, the output flag of this comparator is set to "1", and when the data on the data latch is small, the output flag of this comparator is set to "0".

【0040】この出力フラグによって、画像信号用4入
力セレクタ115a〜115iと相対位置番号用4入力
セレクタ116a〜116iを制御し、一致が検出され
たラッチから左側で、画像信号および相対位置番号を左
方シフトさせ、一致のあった所のデータラッチに新規入
力の画像信号と相対位置番号をロードする。これによ
り、既存の順列に、一個のデータをインサートソートす
ることが完結する。この時の状態が、図3の(3)ステ
ップ目の状態である。
This output flag controls the four-input selectors 115a to 115i for image signals and the four-input selectors 116a to 116i for relative position numbers, and the image signal and the relative position number are left on the left side of the latch where a match is detected. The image data and the relative position number which are newly input are loaded into the data latch where there is a match. This completes the insert sort of one piece of data in the existing permutation. The state at this time is the state of the step (3) in FIG.

【0041】同様にして、相対位置番号(0,1)の画
像信号“82”を入力した時の処理フローが、図3の
(4)〜(6)ステップであり、そのつぎの相対位置番
号(0,0)の画像信号“56”を入力した時の処理フ
ローが、図3の(7)〜(9)ステップである。この結
果、図3の(9)ステップのように、図2の点線で囲ま
れた3×3の領域に対するメディアンフィルタの出力値
は“94”となる。
Similarly, the processing flow when the image signal "82" of the relative position number (0, 1) is input is steps (4) to (6) in FIG. 3, and the next relative position number. The processing flow when the image signal "56" of (0,0) is input is steps (7) to (9) in FIG. As a result, as in step (9) of FIG. 3, the output value of the median filter for the 3 × 3 area surrounded by the dotted line in FIG. 2 is “94”.

【0042】[0042]

【発明の効果】この発明のメディアンフィルタによれ
ば、m2 個の画素データの内(m2 −1)個の画素デー
タについては、その大小関係が既知であることを利用し
て、比較対象から外れる画素と新規に比較対象に加わる
画素とを、m2 個のデータを識別するための相対位置番
号、例えば0〜(m2 −1)までの正の整数やmの剰余
系で表現される(u,v)(0≦u≦m−1,0≦v≦
m−1)で管理し、常に(m2 −1)個の既に順位付け
られたデータに対して、新規の1個を挿入することによ
り、m2 個のデータに対して、m2 個の比較器と(m2
−1)個の一致検出回路と(2×m2 )個のデータラッ
チとm個のデータロード機能付のデータラッチと制御回
路からメディアンフィルタを構成することができ、従来
例に比較して、半分以下のハードウェア量でメディアン
フィルタを安価に提供することができる。
According EFFECTS OF THE INVENTION median filter of the present invention, for among m 2 pieces of pixel data (m 2 -1) pieces of pixel data, by utilizing the relationship in magnitude is known, comparison Pixels outside the range and pixels newly added to the comparison target are represented by relative position numbers for identifying m 2 data, for example, a positive integer from 0 to (m 2 −1) or a remainder system of m. (U, v) (0≤u≤m-1, 0≤v≤
m-1) and always inserts a new one into (m 2 -1) already ranked data, so that for m 2 data, m 2 Comparator and (m 2
-1) A median filter can be constructed from (1) number of match detection circuits, (2 × m 2 ) number of data latches, m number of data latches with data loading function, and control circuit. A median filter can be provided at low cost with less than half the amount of hardware.

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

【図1】この発明の一実施例における3×3のメディア
ンフィルタのブロック図である。
FIG. 1 is a block diagram of a 3 × 3 median filter according to an embodiment of the present invention.

【図2】画像データの例を示す図である。FIG. 2 is a diagram showing an example of image data.

【図3】図2の画像データに対する処理フローを示した
図である。
FIG. 3 is a diagram showing a processing flow for the image data of FIG.

【図4】従来例としての3×3のメディアンフィルタの
ブロック図である。
FIG. 4 is a block diagram of a 3 × 3 median filter as a conventional example.

【図5】コンパレータモジュールを示す図である。FIG. 5 is a diagram showing a comparator module.

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

100 クロック信号 101 タイミング生成および相対番号生成回路 102 内部同期クロック 103 画素クロック 104 4ビットの相対位置番号 105〜107 画像信号入力端子 108a〜108c データロード機能付のnビット
データラッチ 109 4ビット長のデータラッチ 110 nビットデータラッチ 111a〜111i nビットのデータラッチ 112a〜112i nビットの比較回路 113a〜113i 4ビットのデータラッチ 114b〜114i 4ビットの一致検出回路 115a〜115i 4入力セレクタ 116a〜116i 4入力セレクタ
100 clock signal 101 timing generation and relative number generation circuit 102 internal synchronization clock 103 pixel clock 104 4-bit relative position number 105-107 image signal input terminal 108a-108c n-bit data latch with data loading function 109 4-bit length data Latch 110 n-bit data latch 111a-111i n-bit data latch 112a-112in n-bit comparison circuit 113a-113i 4-bit data latch 114b-114i 4-bit match detection circuit 115a-115i 4-input selector 116a-116i 4-input selector

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 1個ずつ更新されるm2 個(mは1より
大きい正整数)の画素データを相互に比較して前記m2
個の画素データの中から中央値を有する画素データを抽
出するメディアンフィルタであって、 データラッチ上で大きさ順に並べられた旧のm2 個の画
素データの列から更新時に比較対象から外れる画素デー
タと残りの(m2 −1)の画素データとを識別するとと
もに、前記残りの(m2 −1)の画素データと更新時に
新規に比較対象に加わる画素データとを識別する画素デ
ータ識別手段と、 大きさ順に並べられた前記旧のm2 個の画素データの配
列から前記比較対象から外れる画素データを前記画素デ
ータ識別手段による識別情報に基づいて選択的に排出す
る画素データ排出手段と、 前記画素データ識別手段による識別情報に基づいて大き
さ順に配列された前記残りの(m2 −1)の画素データ
と前記新規に比較対象に加わる画素データとを比較して
前記残りの(m2 −1)の画素データの列の中に前記新
規に比較対象に加わる画素データを大きさ順の並びを崩
さない状態に挿入して新のm2 個の画素データの列を作
成する画素データ挿入手段と、 前記画素データ挿入手段により作成された前記新のm2
個の画素データの列の中央の画素データを中央値として
抽出する画素データ抽出手段とを備えたメディアンフィ
ルタ。
1. m 2 (m is a positive integer larger than 1) pixel data that is updated one by one is compared with each other to obtain the m 2
A median filter for extracting pixel data having a median value from the pixel data of a number of pixels, the pixel being out of the comparison target at the time of updating from the column of the old m 2 pixel data arranged in order of size on the data latch. Pixel data identifying means for identifying the data and the remaining (m 2 −1) pixel data, and identifying the remaining (m 2 −1) pixel data and the pixel data newly added to the comparison target at the time of updating. And pixel data discharging means for selectively discharging pixel data out of the comparison target from the array of the old m 2 pixel data arranged in size order based on the identification information by the pixel data identification means. The remaining (m 2 −1) pixel data arranged in order of size based on the identification information by the pixel data identification means and the pixel data newly added to the comparison target. By comparison, the pixel data newly added to the comparison target is inserted into the remaining (m 2 −1) pixel data column in a state that the arrangement in the order of size is not broken and new m 2 pixels Pixel data insertion means for creating a data column, and the new m 2 created by the pixel data insertion means
A median filter comprising: pixel data extraction means for extracting pixel data at the center of a column of individual pixel data as a median value.
【請求項2】 画素データ識別手段は、m2 個の画素デ
ータを識別するのに、前記m2 個の画素データの各々に
対して0〜(m2 −1)までの正の整数もしくはmの剰
余系で表現される(u,v)(ただし、0≦u≦m−
1,0≦v≦m−1)を割り当てている請求項1記載の
メディアンフィルタ。
2. The pixel data discriminating means discriminates the m 2 pixel data, and a positive integer from 0 to (m 2 −1) or m for each of the m 2 pixel data. (U, v) represented by the remainder system of (where 0 ≦ u ≦ m−
The median filter according to claim 1, wherein 1, 0 ≤ v ≤ m-1) are assigned.
JP4036185A 1992-02-24 1992-02-24 Median filter Pending JPH05233804A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4036185A JPH05233804A (en) 1992-02-24 1992-02-24 Median filter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4036185A JPH05233804A (en) 1992-02-24 1992-02-24 Median filter

Publications (1)

Publication Number Publication Date
JPH05233804A true JPH05233804A (en) 1993-09-10

Family

ID=12462675

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4036185A Pending JPH05233804A (en) 1992-02-24 1992-02-24 Median filter

Country Status (1)

Country Link
JP (1) JPH05233804A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6687413B2 (en) 1999-12-07 2004-02-03 Canon Kabushiki Kaisha Signal processing apparatus
US6958772B1 (en) 1999-01-20 2005-10-25 Canon Kabushiki Kaisha Image sensing apparatus and image processing method therefor
US8903190B2 (en) 2010-09-28 2014-12-02 Samsung Electronics Co., Ltd. Median filtering method and apparatus

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6958772B1 (en) 1999-01-20 2005-10-25 Canon Kabushiki Kaisha Image sensing apparatus and image processing method therefor
US7542076B2 (en) 1999-01-20 2009-06-02 Canon Kabushiki Kaisha Image sensing apparatus having a color interpolation unit and image processing method therefor
US7929026B2 (en) 1999-01-20 2011-04-19 Canon Kabushiki Kaisha Image sensing apparatus and image processing method thereof using color conversion and pseudo color removing
US6687413B2 (en) 1999-12-07 2004-02-03 Canon Kabushiki Kaisha Signal processing apparatus
US8903190B2 (en) 2010-09-28 2014-12-02 Samsung Electronics Co., Ltd. Median filtering method and apparatus

Similar Documents

Publication Publication Date Title
CA2113140C (en) Rank order filter
US4541116A (en) Neighborhood image processing stage for implementing filtering operations
US5138567A (en) Median filter
US5122979A (en) Method and a digital electronic device for the evaluation of an extremum of a set of binary encoded data words
US5900006A (en) Median filtering method and apparatus using a plurality of processing elements
JPH0789372B2 (en) Image processing device
CA1286732C (en) Rank-order filter
JP4143288B2 (en) Median filter processing device
EP0069542A2 (en) Data processing arrangement
JPH08339291A (en) Selection circuit of maximum value
JPH05233804A (en) Median filter
US6760737B2 (en) Spatial median filter
US6304679B1 (en) Method and apparatus for implementing two-dimensional digital filters
US6731820B2 (en) Image filter circuit and image filtering method
JP2004334545A (en) Filter circuit
GB2194364A (en) Median filter
US5220664A (en) Merging network with three or more simultaneous inputs
US7281009B2 (en) VLSI architecture and implementation for single cycle insertion of multiple records into a priority sorted list
US5987182A (en) Markov model image encoding device and method
KR0166264B1 (en) Median filter and method for filtering median
US8136061B2 (en) Method of logic circuit synthesis and design using a dynamic circuit library
JPS58222341A (en) Median filter circuit
KR100220596B1 (en) Median filtering method and the apparatus using processing element
US20050076071A1 (en) Ordering by hamming value
Chakrabarti Chaitali Chakrabarti