JPH01155708A - High speed sequential filter circuit - Google Patents

High speed sequential filter circuit

Info

Publication number
JPH01155708A
JPH01155708A JP31361887A JP31361887A JPH01155708A JP H01155708 A JPH01155708 A JP H01155708A JP 31361887 A JP31361887 A JP 31361887A JP 31361887 A JP31361887 A JP 31361887A JP H01155708 A JPH01155708 A JP H01155708A
Authority
JP
Japan
Prior art keywords
bit
window
result
stage
circuit
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
JP31361887A
Other languages
Japanese (ja)
Inventor
Toshiyuki Goto
敏行 後藤
Masatoshi Komeichi
正俊 古明地
Koyo Nakagawa
幸洋 中川
Toshiya Mima
美間 俊哉
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP31361887A priority Critical patent/JPH01155708A/en
Publication of JPH01155708A publication Critical patent/JPH01155708A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

PURPOSE:To execute the two-dimensional sequential filter processing at a high speed by entering each picture element sequentially by a window register section 12 according to the picture raster scanning, reconstituting picture elements in a 3X3 window and giving the result sequentially to a bit deciding section. CONSTITUTION:The most significant bit - the least significant bit of an input data are fed to window generating circuits 512-515 while being retarded sequentially by the unit time. The bit deciding section 52 comprises stages 521-524 of the stage number corresponding to the bit length of the input data and each stage consists of determining circuits of the same structure and a number (9 circuits) equal to number of picture elements in the window. The determining circuit 53 consists of determining circuits 531-534 of the stage number corresponding to the data bit length of the input data. An output register 54 receives the result of decision by a bit corresponding to each picture element outputted from the decision circuits 531-534 and applies delay synthesis and then the result of a prescribed sequential filter processing is obtained sequentially simultaneously for 4 bits each.

Description

【発明の詳細な説明】 〔概 要〕 2次元の順序フィルタ回路に関し、 2次元順序フィルタ処理を高速に実行できるようにする
ことを目的とし、 画像データを入力されるウィンドレジスタ部(41)と
、該レジスタ部よりウィンド内画素の最上位ビット、第
2位ビット、・・・・・・最下位ビットを入力され、画
素のビット数に等しい個数のステージ(421,422
,・・・・・・)を有するビット判定部(42)と、ビ
ット判定部の各ステージの各判定回路の判定結果を入力
され、設定数と比較した結果(A。
[Detailed Description of the Invention] [Summary] Regarding a two-dimensional sequential filter circuit, the purpose of the present invention is to enable high-speed execution of two-dimensional sequential filter processing, and a window register section (41) into which image data is input; , the most significant bit, second bit, . . . , least significant bit of the pixel within the window are input from the register section, and the stages (421, 422) equal to the number of bits of the pixel are input.
, . . .) and the judgment results of each judgment circuit of each stage of the bit judgment section are inputted and compared with the set number (A.

B、・・・・・・)を出力するビット決定部(43)と
、該判定結果(A、B、・・・・・・)を入力されて指
定されたウィンド内画素データを出力する出力レジスタ
部(44)で構成される。
A bit determination unit (43) that outputs the determination results (A, B, . . .); and an output that receives the determination result (A, B, . . .) and outputs pixel data within the specified window. It is composed of a register section (44).

〔産業上の利用分野〕[Industrial application field]

本発明は、2次元の順序フィルタ処理を高速に実行でき
る高速順序フィルタ回路に関する。
The present invention relates to a high-speed sequential filter circuit that can perform two-dimensional sequential filter processing at high speed.

順序フィルタは、信号中に設定されたウィンドを信号全
体に渡って走査し、そのウィンド内の各サンプルの値を
ソートし、そのなかから特定の順番のサンプル(値)を
出力するものである。
An ordered filter scans a window set in a signal over the entire signal, sorts the values of each sample within the window, and outputs samples (values) in a specific order.

第8図で説明すると、左側の111・・・・・・が入力
データ、Wがウィンドである。ウィンド内には本例では
11512なる入力データ(入力信号の各サンプル又は
その値)が入っているが、これをソートして小さい順に
並べると11125になるが、取出すサンプルは中央と
すると本例ではlが取出され、これが出力データになる
。ウィンドWは1サンプルのピッチで右方へ進み、その
都度同様処理するので、出力データは図示の如くなる。
To explain with reference to FIG. 8, 111 on the left side is input data, and W is a window. In this example, the window contains 11,512 input data (each sample of the input signal or its value), but if you sort it and arrange it in ascending order, it will become 11,125, but if the sample to be extracted is in the center, in this example, l is extracted and becomes the output data. The window W advances to the right at a pitch of one sample, and the same processing is performed each time, so the output data becomes as shown in the figure.

ウィンドから取出すサンプルは中央のサンプルとは限ら
ず、最大のもの、最小のもの、適宜指定したi番目のも
のなどがあり、中央を取出すフィルタはmediumフ
ィルタ、最大値を取出すフィルタはmaxフィルタなど
と呼ばれる。
The sample extracted from the window is not necessarily the center sample, but the largest one, the smallest one, the i-th sample specified as appropriate, etc. A filter that extracts the center value is a medium filter, a filter that extracts the maximum value is a max filter, etc. Called.

このフィルタを信号処理に用いた場合には信号中の雑音
除去や信号の成形などが、また、画像処理に通用した場
合には濃淡画像の雑音除去処理や領域の膨大や収縮処理
を効果的に行うことができ、幅広い分野で利用されてい
る。
When this filter is used for signal processing, it can be used to remove noise in signals and shape signals, and when used for image processing, it can be used to effectively remove noise from grayscale images and to enlarge and shrink areas. It can be done and is used in a wide range of fields.

〔従来の技術〕[Conventional technology]

順序フィルタはウィンド内のサンプルを取出し、ソート
し、指定された条件のものを取出し、という操作が入る
ので時間を要する。そこで順序フィルタの高速化技術が
種々提案されており、本出願人も■「ソーティング回路
」 (特開昭58−222342)、■「連続ソーティ
ング回路」 (特開昭60−061831)、■「2次
元ソーティング回路」 (特開昭59−117635)
などを出している。
The order filter takes time because it requires the operations of extracting samples within a window, sorting them, and extracting those that meet specified conditions. Therefore, various speed-up techniques for sequential filters have been proposed, and the present applicant has Dimensional Sorting Circuit” (Japanese Patent Application Laid-Open No. 59-117635)
etc.

上記■および■はいづれも1次元の順序フィルタ処理を
パイプライン方式に基づいて高速に実行するための技術
である。第9図にこれらの方式の基本的な考え方を示す
。第9図において20は処理の対象となる信号列(画像
データ)を示し、この信号列(画像データ)上にウィン
ドW(この場合、サイズは5)が走査される。21は各
時点でウィンド内の各データのソート結果を保持するレ
ジスタであり、たとえば、+8)図の位置にウィンドW
があるときには(blに示すように左から昇順(あるい
は降順)に3−5−6−7−11が蓄えられる。次に、
(C)図に示すようにウィンドWが右側に1デ一タ分シ
フトすると、これに伴って、レジスタの内容が変更され
るが、この処理の流れを(d) (elに示す。ここで
は、最初にレジスタ21内の各データとウィンドのシフ
トにともなってウィンドWから外れるデータ7とを比較
し、レジスタから排出するべきデータ(本例では7)を
見出す。さらに、ウィンドに新たに入力されるデータ4
とレジスタ内の各データを比較し、挿入するべき位置を
決定する(d)。これらの情報を用いてレジスタを制御
し、レジスタに蓄えられているデータを変更する(左ま
たは右のレジスタへの転送、入力データとの置き換え)
。この場合には、レジスタは(e)に示すように制御さ
れ、その結果、シフトしたウィンド内のデータをソート
した結果がレジスタに保持されることになる。これらの
各処理は1クロツク内に完了できるので、パイプライン
方式に基づいて高速に実行できる。。
Both (1) and (2) above are techniques for performing one-dimensional sequential filter processing at high speed based on a pipeline method. Figure 9 shows the basic concept of these methods. In FIG. 9, 20 indicates a signal string (image data) to be processed, and a window W (size 5 in this case) is scanned over this signal string (image data). 21 is a register that holds the sorting results of each data in the window at each point in time; for example, +8)
When there is (as shown in bl), 3-5-6-7-11 are stored in ascending (or descending) order from the left. Next,
(C) As shown in the figure, when the window W is shifted to the right by one data, the contents of the register are changed accordingly.The flow of this process is shown in (d) (el). , first compares each data in the register 21 with the data 7 that comes out of the window W as the window is shifted, and finds the data (7 in this example) that should be ejected from the register. Data 4
and each data in the register to determine the position to be inserted (d). Use this information to control the registers and change the data stored in the registers (transfer to left or right register, replace with input data)
. In this case, the register is controlled as shown in (e), and as a result, the result of sorting the data within the shifted window is held in the register. Since each of these processes can be completed within one clock, they can be executed at high speed based on the pipeline system. .

上記■は2次元順序フィルタ処理を実現するための技術
である。第10図にその基本的な考え方を示す。第10
図において、ウィンド生成部31は画像データ20をシ
ーケンシャルに入力し、画像内のウィンドW(ここでは
3×3)に対応する2次元の画素を逐次再構成する。デ
ータ提供部32はウィンドの走査に伴って新たに入力さ
れる画素を順次ソート部33に転送する。図は入力画像
20上のウィンドWが左端から1サンプルだけ右へ移動
した状態を示しており、このとき排出されたデータは8
.8.2、新りに入ってきたデータは?、5.13であ
る。データ提供部32は新たに入ってきたデータ?、5
.13を順次ソート部33へ送り、前回入力分2. 6
. 8及び前々回入力分3.7.9は送らない(順次ソ
ート部33に有るから)。順次ソート部33は1次元の
順次フィルタであり、本例では9サンプルをソートして
昇順に並べ、ウィンドの中央に相当する、端から5番目
を出力する。これによって、2次元の順次フィルタ処理
が実現できる。
The above (2) is a technique for realizing two-dimensional sequential filter processing. Figure 10 shows the basic idea. 10th
In the figure, a window generation unit 31 sequentially inputs image data 20 and sequentially reconstructs two-dimensional pixels corresponding to a window W (here, 3×3) in the image. The data providing unit 32 sequentially transfers newly input pixels to the sorting unit 33 as the window is scanned. The figure shows a state where the window W on the input image 20 has moved one sample to the right from the left end, and the output data at this time is 8
.. 8.2. What about new data? , 5.13. Is the data providing unit 32 newly received data? , 5
.. 13 are sequentially sent to the sorting unit 33, and the previous inputs 2. 6
.. 8 and the inputs 3, 7, and 9 from the previous time are not sent (because they are in the sequential sorting section 33). The sequential sorting unit 33 is a one-dimensional sequential filter, and in this example, nine samples are sorted and arranged in ascending order, and the fifth sample from the end corresponding to the center of the window is output. Thereby, two-dimensional sequential filter processing can be realized.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

1次元の順次フィルタ処理に関しては、バイブライン方
式でしかもクロックに連動して動作させることができる
が、2次元の順次フィルタについては、ウィンドのサイ
ズをNXMとするとMに比例した時間が必要となり、ウ
ィンド・サイズが大きい場合に高速化できないという問
題がある。
One-dimensional sequential filter processing can be operated using the Vibration method and linked to a clock, but for two-dimensional sequential filtering, if the window size is NXM, a time proportional to M is required. There is a problem that the speed cannot be increased when the window size is large.

本発明はこの点を改善し、2次元順序フィルタ処理を高
速に実行できるようにすることを目的とするものである
The present invention aims to improve this point and enable high-speed execution of two-dimensional sequential filter processing.

〔問題点を解決するための手段〕[Means for solving problems]

第1図に本発明の構成を示す。41は画像データを画素
単位で順次入力されるウィンドレジスタ部、42は該ウ
ィンドレジスタ部よりウィンド内画素の最上位ビット、
第2位ビット、・・・・・・を取込み、判定結果を出力
するビット判定部、43は該判定結果を取込み、設定数
と比較した結果(A。
FIG. 1 shows the configuration of the present invention. 41 is a window register section into which image data is sequentially input pixel by pixel; 42 is the most significant bit of a pixel within the window from the window register section;
A bit judgment unit 43 takes in the second-order bit, and outputs the judgment result, and compares the judgment result with the set number (A).

B、・・・・・・)を出力するビット決定部、44は該
比較結果(A、B、・・・・・・)を取込んで、措定さ
れたウィンド内画素のデータを出力する出力レジスタ部
である。ビット判定部42は複数の判定回路群(ステー
ジ>  421.422.・・・・・・からなり、ビッ
ト決定部43は複数のステージ431.432.・・・
・・・からなる。
The bit determination unit 44 outputs the comparison result (A, B, . . .) and outputs the data of the pixel within the specified window. This is the register section. The bit determination section 42 consists of a plurality of determination circuit groups (stages > 421, 422, . . . , and the bit determination section 43 consists of a plurality of stages 431, 432, . . .
Consists of...

3×3のウィンドを用いた中央値フィルタ処理を例にと
って、この回路の構成の詳細および動作を次に説明する
。以下の説明において、(abcd)2は2進数表現さ
れたデータを示すものとし、a・2 +b−2+c2 
 +dと等価である。
Taking median filter processing using a 3×3 window as an example, the details of the configuration and operation of this circuit will be described below. In the following explanation, (abcd)2 indicates data expressed as a binary number, and a・2 +b−2+c2
Equivalent to +d.

〔作用〕[Effect]

ウインド・レジスタ部41は画像のラスター走査に従っ
て、各画素を逐次入力し、これから3×3のウィンド内
の画素を再構成し、逐盗、ピッ、ト判定部42に提供す
る。
The window register section 41 sequentially inputs each pixel according to the raster scan of the image, reconstructs the pixels within a 3.times.3 window, and provides the reconstructed pixels to the spot, pit, and hit determination section 42.

ビット判定部42はデータのビット長(本例では4)に
対応する数のステージ421. 呼22.・・・・・・
で構成されている。また、各ステージはウィンド内の画
素数(この場合は9)と等しいモジュール(判定回路)
で構成されている。ステージ1(421)では、各モジ
ュールはそれぞれウィンド内の画素が(1・・・)2よ
りも大きいか否かを判定しくなお、(1・・・)2の・
はこのくフトを無視することを示すものとする。したが
って、この場合には最上位ビットのみを比較することに
なる。)、大きいか等しい場合にはその結果をビット決
定部4空に出力する。さらに、ビット決定部43の結果
A(1またはO)に応じて、各画素の値を(A・・・)
2と比較した結果[=<>(例えば、2ビツトの信号線
により、画素の値が大きい場合にはlOl等しい場合に
はl11小さい場合には00と表現する。]を、ステー
ジ2の対応するモジュールに出力する。
The bit determination unit 42 has stages 421 . Call 22.・・・・・・
It consists of Also, each stage has a module (judgment circuit) equal to the number of pixels in the window (9 in this case).
It consists of In stage 1 (421), each module has to judge whether the pixel in the window is larger than (1...)2.
shall indicate that this work is to be ignored. Therefore, in this case, only the most significant bits are compared. ), if they are greater or equal, the result is output to the bit determining section 4. Furthermore, depending on the result A (1 or O) of the bit determination unit 43, the value of each pixel is changed to (A...)
2, the result [=<> (for example, with a 2-bit signal line, if the pixel value is large, it is expressed as lOl, if it is equal, it is expressed as l11, and if it is small, it is expressed as 00.) Output to module.

ステージ2(422)では、ステージ1(421)と同
様にして、各モジュールはそれぞれウィンド内の画素が
(Al・・)2よりも大きいか否かを判定し、その結果
をビット決定部43に出力するとともに、ビット決定部
43の対応するステージの結果B(1または0)に応じ
て、各画素の値を(AB・・)2と比較した結果を次の
ステージの対応するモジュールに出力する。なお、これ
らの判定はステージ1で得られた各画素と(A・・・)
2の比較結果を利用することにより、第2位ビットをの
みを新たに比較することにより得ることができる。
In stage 2 (422), similarly to stage 1 (421), each module determines whether the pixel within the window is larger than (Al...)2, and sends the result to the bit determination unit 43. At the same time, according to the result B (1 or 0) of the corresponding stage of the bit determination unit 43, the result of comparing the value of each pixel with (AB...)2 is output to the corresponding module of the next stage. . Note that these determinations are made using each pixel obtained in stage 1 and (A...)
By using the comparison result of No. 2, the second-order bit can be obtained by newly comparing only the second-order bit.

また、ステージ3(423)では、ステージ1゜2 (
421,422)と同様にして、各モジュールはそれぞ
れウィンド内の画素が(ABI・)2よりも大きいか否
かを判定し、その結果をビット決定部43に出力すると
ともに、ビット決定部43の対応するステージの結果C
(1または0)に応じて、各画素の値を(A B C・
)2と比較した結果を次のステージの対応するモジュー
ルに出力する。なお、これらの判定についても前ステー
ジ(ステージ2)で得られた各画素と(AB・・)2の
比較結果を利用することにより、新たに第3位ビットを
のみを比較することにより得ることができる。
Also, in stage 3 (423), stage 1゜2 (
421, 422), each module determines whether the pixel within the window is larger than (ABI・)2, outputs the result to the bit determination unit 43, and outputs the result to the bit determination unit 43. Result C of the corresponding stage
(1 or 0), change the value of each pixel to (A B C・
)2 and outputs the result to the corresponding module of the next stage. These determinations can also be obtained by newly comparing only the third bit by using the comparison results of each pixel and (AB...)2 obtained in the previous stage (stage 2). Can be done.

さらに、ステージ4(424)では、ステージ1゜2、
 3 (421,422,423)と同様にして、各モ
ジュールはそれぞれウィンド内の画素が(ABCI)2
よりも大きいか否かを判定し、その結果をビット決定部
43に出力する。これらの判定についても前ステージ(
ステージ3)で得られた各画素と(ABC・)2の比較
結果を利用することにより、新たに第4位ビットをのみ
を比較することにより得−ることができる。
Furthermore, in stage 4 (424), stage 1゜2,
3 (421, 422, 423), each module has pixels in the window (ABCI)2
, and outputs the result to the bit determining section 43. These judgments are also at the previous stage (
By using the comparison results between each pixel and (ABC·)2 obtained in stage 3), it is possible to newly obtain the fourth bit by comparing only the fourth bit.

ビット決定部43もデータのビット長に対応する数のス
テージ(431,432,・・・・・・)で構成されて
いる。ここでは、ビット判定部42の各ステージ(42
1,422,・・・・・・)から出力された各モジュー
ルの判定結果を入力し、結果をビー/ ト判定部ならび
に出力レジスタ部に出力する。具体的には、ステージ1
 、(431)ではウィンド内の各画素の値が(l・・
・) 2よりも大きいか等しい画素の個数を計数し、そ
の数とあらかじめ決められた設定値M(例えば、中央値
フィルタの場合には5、第3番目の値を出力する順序フ
ィルタの場合には3となる。)と比較し、その結果A(
設定値Mよりも大きい場合には1、小さい場合には0)
を出力する。
The bit determining unit 43 also includes stages (431, 432, . . . ) corresponding to the bit length of the data. Here, each stage (42
1, 422, . . .), and outputs the results to the beat/beat determination section and the output register section. Specifically, stage 1
, (431), the value of each pixel in the window is (l...
・) Count the number of pixels greater than or equal to 2, and calculate that number and a predetermined setting value M (for example, 5 in the case of a median filter, and in the case of an ordinal filter that outputs the third value) is 3.), and the result is A(
1 if larger than the set value M, 0 if smaller)
Output.

つぎに、ステージ2(432)では同様にして、ウィン
ド内の各画素の値が(AI・・)2よりも大きいか等し
い画素の個数を計数し、その数と設定値Mと比較し、そ
の結果Bを出力する。また、ステージ3(433)でも
同様にして、ウィンド内の各画素の値が(ABI・)2
よりも大きいか等しい画素の個数を計数し、その数と設
定値Mと比較し、その結果Cを出力する。さらに、ステ
ージ4(434)でも同様にして、ウィンド内の各画素
の値が(ABC・)2よりも大きいか等しい画素の個数
を計数し、その数と設定値Mと比較し、その結果りを出
力する。
Next, in stage 2 (432), in the same way, the number of pixels in the window whose value is greater than or equal to (AI...)2 is counted, and the number is compared with the set value M. Output result B. Similarly, in stage 3 (433), the value of each pixel in the window is (ABI・)2
The number of pixels that are greater than or equal to is counted and compared with the set value M, and the result C is output. Furthermore, in the same manner at stage 4 (434), the number of pixels in the window whose value is greater than or equal to (ABC・)2 is counted, the number is compared with the set value M, and the result is Output.

出力レジスタ44では、ビット決定部43の各ステージ
から出力される各ビットデータ(A、B。
In the output register 44, each bit data (A, B.

C,D)を合成し、その結果(ABCD)2を出力する
C, D) and outputs the result (ABCD)2.

第2図(alを用いて中央値フィルタの動作を説明する
。この例では、ビット判定部42のステージ1の各判定
回路(13,(21,・・・・・・でウィンド内の各画
素■(1011)2.■(0110)2.・・・・・・
の最上位ビット(網かけの部分)と(1・・・)2の最
上位ビット(網かけの部分)のみを比較し、画素の値が
大きいか等しい場合にはl、小さい場合には0の判定結
果をビット決定部43へ出力する。ビット決定部43の
ステージ431ではlの数を計数し、本例ではこれは4
であって設定値M(中央値の場合には5)以下であるの
で、中央値の最上位ビットは0とする(出力レジスタ部
44へ送るAがこれ)。さらに、ビット決定部43のス
データlのこの結果に基づいて、ビット判定部42のス
テージlの各判定回路(1)、 (2)、・・・・・・
でウィンド内の各画素■(1011)z、■(0110
)2゜・・・・・・の最上位ビットと(0・・・)2の
最上位ビット(12Iかけの部分)のみを比較し、画素
の値が大きい場合にはlOl等しい場合には11、小さ
い場合には00の判定結果をビット判定部42のステー
ジ2の各対応する判定回路へ出力する。
The operation of the median filter will be explained using FIG. ■(1011)2.■(0110)2.・・・・・・
Compare only the most significant bit (shaded part) of (1...)2 (shaded part), and if the pixel values are larger or equal, set l, and if smaller, set 0 The determination result is output to the bit determination section 43. The stage 431 of the bit determination unit 43 counts the number l, which in this example is 4.
Since it is less than the set value M (5 in the case of the median value), the most significant bit of the median value is set to 0 (this is the A sent to the output register section 44). Furthermore, based on this result of the data l of the bit determination unit 43, each determination circuit (1), (2), . . . of the stage l of the bit determination unit 42
Each pixel in the window ■(1011)z,■(0110
)2゜... Compares only the most significant bit of (0...)2 (the part multiplied by 12I), and if the pixel value is large, lOl is equal, then 11 , the determination result of 00 is output to each corresponding determination circuit of stage 2 of the bit determination section 42.

ウィンド内画素の値(1011)  2.  <011
0)2.・・・・・・と(1・・・)2を比較するには
、4ビツトで比較することな(、最上位ビット同志を比
較すれば充分である。従ってモジュール421の判定回
路(11(21・・・・・・へはウィンド内画素の値の
最上位ビットだけを入力すればよい。
Value of pixel within window (1011) 2. <011
0)2. . . . and (1...)2, it is sufficient to compare the most significant bits. 21... need only input the most significant bit of the value of the pixel within the window.

次のステージ2(422)では中央値の2番目のビット
を決定する0本例では、ステージ1(421)の判定結
果および、ウィンド内の各画素の(1011)2.■(
0110)2.・・・・・・の2番目のビット(網かけ
の部分)と(01・・) 2の2番目のビット(網かけ
の部分)のみを比較した結果を用いて、ウィンド内の各
画素と(01・・) 2との上位2ビット分を比較した
結果を得る。そして、画素の上位2ビツトの値が大きい
か等しい場合には1、小さい場合には0の判定結果をビ
ット決定部3へ出力する。ビット決定部43のステージ
2(432)では1の数を計数し、本例ではこれは8で
あうで設定値(中央値の場合5)より大きいので、中央
値の2番目のビットは1とする(出力レジスタ部44へ
送るBがこれ)。さらに、ビット決定部のステージ2の
この結果に基づいて、ステージ1(421)の判定結果
および、ウィンド内の各i!i棄■(1011)2.■
(0110)2.・・・・・・の2番目のビット(網か
けの部分)と(01・・)2の2番目のビット(w4か
けの部分)のみを比較した結果を用いて、ウィンド内の
各画素と(01・・) 2との上位2ビット分を比較し
た結果(大きい場合にはlOl等しい場合には11、小
さい場合には00)を算出し、その結果をビット判定部
43のステージ3の各対応する判定回路へ出力する。
The next stage 2 (422) determines the second bit of the median value. In this example, the determination result of stage 1 (421) and (1011) 2 . ■(
0110)2. Using the result of comparing only the second bit (shaded part) of ...... and the second bit (shaded part) of (01...)2, each pixel in the window Obtain the result of comparing the upper 2 bits with (01...) 2. Then, if the values of the upper two bits of the pixel are larger or equal, the judgment result is 1, and if the values are smaller, the judgment result is 0, which is output to the bit determining section 3. Stage 2 (432) of the bit determination unit 43 counts the number of 1s, and in this example, this is 8, which is larger than the set value (5 in the case of the median value), so the second bit of the median value is set to 1. (This is the B sent to the output register section 44). Furthermore, based on this result of stage 2 of the bit decision section, the decision result of stage 1 (421) and each i! i abandon■ (1011) 2. ■
(0110)2. Using the result of comparing only the second bit (shaded part) of . (01...) The result of comparing the upper two bits with 2 (11 if larger, 10 if equal, 00 if smaller) is calculated, and the result is applied to each stage 3 of the bit determination unit 43. Output to the corresponding judgment circuit.

中央値の3番目のビットは、前段ステージの判定結果お
よび、ウィンドレジスタ部からの第3位ビットと(01
1・)2の3番目のビットを比較した結果を用い、判定
結果の1を計数し、本例ではこれは6であるから中央値
の3番目のビットは1とし、中央値の4番目のビットに
ついても同様処理を行なって該ビットの1を得る。こう
して出力レジスタ部へはoiitが送られ、中央値は(
0111・)2であることが分る。
The third bit of the median value is the judgment result of the previous stage, the third bit from the window register section, and (01
1.) Using the result of comparing the third bit of 2, count the 1 of the judgment result. In this example, this is 6, so the third bit of the median value is set to 1, and the fourth bit of the median value is counted. Similar processing is performed for bits to obtain 1 for the bits. In this way, oiit is sent to the output register section, and the median value is (
0111·)2.

第2図(b)は第3番目の値を出力する順序フィルタの
例である。この例では、設定値Mが3となっているだけ
で、各部の動作は第2図(alの例と全く同様である。
FIG. 2(b) is an example of a sequential filter that outputs the third value. In this example, the setting value M is only 3, and the operation of each part is exactly the same as the example in FIG. 2 (al).

この回路は同じモジュールの組合せで基本部分を構成で
き、LSI化が容易である。
The basic part of this circuit can be constructed by combining the same modules, and it can be easily integrated into an LSI.

〔実施例〕〔Example〕

第3図〜第5図に本発明の実施例を示す。この回路は外
部からの設定によって、任意の順序フィルタ処理(最大
値〜中央値〜最小値フィルタ処理)を実現できる。
Embodiments of the present invention are shown in FIGS. 3 to 5. This circuit can implement arbitrary order filter processing (maximum value - median value - minimum value filter processing) by external settings.

第3図は全体構成を示し、ウインド・レジスタ部51、
ビット判定部52、ビット決定部53および出力レジス
タ部54で構成される。左上端の入力データは画素単位
で、本例では4ビット同時に入力し、右下端の出力デー
タはウィンド内の指定された本例では中央の画素のデー
タ(4ビツト)である。
FIG. 3 shows the overall configuration, including a window register section 51,
It is composed of a bit determination section 52, a bit determination section 53, and an output register section 54. The input data at the upper left end is input in pixel units, and in this example, 4 bits are input simultaneously, and the output data at the lower right end is the data (4 bits) of the central pixel specified within the window in this example.

ウインド・レジスタ部51は、入力レジスタ回路511
とウィンド生成回路512〜515からなる(lli素
のビット数は4とする)。第4図(a)に示すように、
入力レジスタ回路511は、入力データのビット長(こ
の場合は4)に対応した段数(3段)のD型ラッチで構
成されており、入力データの最上位とット〜最下位ビッ
トを順次単位時間だけ遅延させながらウィンド生成回路
512〜515に提供する。この遅延は、パイプライン
処理のためである。第4図(b)に示すように、ウィン
ド生成回路512〜515は、複数のD型ラッチと画像
の横幅に対応した長さを持つシフト・レジスタSRで構
成されており、入力データ(最上位ビット、第2位ビッ
ト、・・・・・・のいずれか)の各ビットに対して、シ
ーケンシャルなデータ入力を受け、ウィンド内の2次元
データ(本例では9ビツトであり、5211゜5212
、・・・・・・で示す箇所から出力)を逐次パイプライ
ン的に再構成し、ビット判定部52に提供する。
The window register section 51 includes an input register circuit 511
and window generation circuits 512 to 515 (the number of bits of an lli element is assumed to be 4). As shown in Figure 4(a),
The input register circuit 511 is composed of a D-type latch with a number of stages (three stages) corresponding to the bit length of the input data (four in this case), and sequentially reads the most significant bit to the least significant bit of the input data in units of units. It is provided to the window generation circuits 512 to 515 while being delayed by a certain amount of time. This delay is due to pipelining. As shown in FIG. 4(b), the window generation circuits 512 to 515 are composed of a plurality of D-type latches and a shift register SR having a length corresponding to the width of the image. bit, second-order bit, etc.), receives sequential data input, and receives two-dimensional data within the window (9 bits in this example, 5211° 5212
, . . .) are sequentially reconfigured in a pipeline manner and provided to the bit determination unit 52.

ビット判定部52は入力データのビット長に対応する段
数のステージ521〜524で成り立ち、さらに各ステ
ージはウィンド内の画素数と等しい個数(9個)の同一
の構造を持った判定回路で構成されている。第4図(C
)はステージ522の構成を示し、5221〜5229
が9個の判定回路である。他のステージも同様構成であ
る。ステージ1(521)では、各判定回路(5211
〜5219とする)はそれぞれウィンド内の画素が(1
000)2よりも大きいか否かを判定し、大きい場合に
はその結果の1をビット決定部53に通知する。さらに
、ビット決定部53の結果に応じて、その結果をA(1
または0)とすると、各画素の値を(AOOO)2と比
較した結果(=<>)をステージ2(522)の対応す
るモジュール5221〜5229に出力する。ステージ
2(522)では、ステージ1(521)よりの出力(
5211〜5219で示す)とウィンド生成回路513
よりの出力(5221〜5229で示す)を受け、各モ
ジュール5221〜5229がそれぞれウィンド内の画
素が(A100)2よりも大きいか否かを判定し、その
結果をビット決定部53に通知するとともに、ビット決
定部53の対応するステージの結果に応じて、その結果
をB(1またはO)とすると、各画素の値を(ABOO
)2と比較した結果を次のステージ523の対応するモ
ジュール(5231〜5239とする)に出力する。ス
テージ3(523)およびステージ4(524)ではス
テージ1. 2 (521,522)と同様の処理を行
う。
The bit determination unit 52 is composed of stages 521 to 524, the number of which corresponds to the bit length of the input data, and each stage is further composed of determination circuits having the same structure and having the same number (9) as the number of pixels in the window. ing. Figure 4 (C
) indicates the configuration of the stage 522, 5221 to 5229
are nine judgment circuits. The other stages have the same configuration. In stage 1 (521), each judgment circuit (5211
~5219), the pixels within the window are (1
000) is larger than 2, and if it is larger, the result 1 is notified to the bit determination unit 53. Furthermore, according to the result of the bit determination unit 53, the result is A(1
or 0), the value of each pixel is compared with (AOOO)2 and the result (=<>) is output to the corresponding modules 5221 to 5229 of stage 2 (522). In stage 2 (522), the output from stage 1 (521) (
5211 to 5219) and the window generation circuit 513
Upon receiving the outputs (indicated by 5221 to 5229), each module 5221 to 5229 respectively determines whether or not the pixel within the window is larger than (A100)2, and notifies the bit determination unit 53 of the result. , according to the result of the corresponding stage of the bit determination unit 53, and if the result is B (1 or O), the value of each pixel is (ABOO
)2 is output to the corresponding modules (5231 to 5239) of the next stage 523. In stage 3 (523) and stage 4 (524), stage 1. 2 Performs the same processing as (521, 522).

第5図(a)に判定回路の構成を示す。この図は判定回
路5222の構成を示すが、他の判定回路も同様構成で
ある。判定回路は2つの1ビツト比較回路と1つのマル
チプレクス回路から成り立つ。判定回路5222におい
て、入力DINはウインド・レジスタ回路からの各ビッ
トの各ウィンド内画素に対応したデータ(こ−では52
22)が入力される。入力EFおよびLFには前ステー
ジの対応する判定回路から出力された判定結果(こ−で
は5212)が入力される。出力LJは前段の結果のも
とて入力DINと(ABOO)2とを比較した結果を出
力し、ビット決定部53に通知する。次に、入力Sより
ビット決定部53からの結果を入力し、これに基づいて
マルチプレクス回路で比較回路CMP+と比較回路CM
P2の出力を選択し、出力ENおよびLNを経由して、
次のステージの対応する判定回路5232に出力する。
FIG. 5(a) shows the configuration of the determination circuit. Although this figure shows the configuration of the determination circuit 5222, the other determination circuits have similar configurations. The determination circuit consists of two 1-bit comparison circuits and one multiplex circuit. In the determination circuit 5222, the input DIN is data corresponding to each pixel in the window of each bit from the window register circuit (in this case, 5222
22) is input. The determination result (5212 in this case) output from the corresponding determination circuit of the previous stage is input to the inputs EF and LF. The output LJ outputs the result of comparing the input DIN and (ABOO)2 based on the result of the previous stage, and notifies the bit determination unit 53 of the result. Next, the result from the bit determination unit 53 is inputted from the input S, and based on this, the multiplex circuit selects the comparison circuit CMP+ and the comparison circuit CM.
Select the output of P2, via output EN and LN,
It is output to the corresponding determination circuit 5232 of the next stage.

ビット決定部53は入力データのビット長に対応した段
数の決定回路531〜534から成る。各決定回路はウ
ィンドの画素数をnとしたとき、n+LOGnと等しい
ビット数のアドレス(L Js+1〜L 、Js+9 
 、Ca −C] )を持った1ビツト幅のROMで構
成されており、各ステージ(s)における各判定回路の
出力(LJs、1 〜LJs、9)と設定値C(Co=
C3)を2進表現でアドレスとし7て入力し、その内容
を出力する。第5図(b)はビット決定部531の構成
を示し、上記アドレスL Js、1〜L Js、9  
は5219 (A a ) 〜5211 (A e )
に、Ca=CaはA9〜Al 2に相当する。出力は5
2で示す。各決定回路の演算論理を次式に示す。ただし
、Jsは決定回路の出力である。
The bit determining section 53 includes circuits 531 to 534 for determining the number of stages corresponding to the bit length of input data. Each decision circuit has an address (L Js+1 to L , Js+9
, Ca -C]), and the output of each judgment circuit (LJs, 1 to LJs, 9) at each stage (s) and the set value C (Co =
C3) is input as an address in binary representation as 7, and its contents are output. FIG. 5(b) shows the configuration of the bit determination unit 531, and the above addresses L Js, 1 to L Js, 9
is 5219 (A a ) ~ 5211 (A e )
In this case, Ca=Ca corresponds to A9 to Al2. The output is 5
Shown as 2. The arithmetic logic of each decision circuit is shown in the following equation. However, Js is the output of the decision circuit.

・・・・・・(式1) ただし、Cは外部から与える設定値であり、最大値フィ
ルタの場合はC=9、中央値フィルタの場合はC=5、
最小値フィルタの場合はC=1を与えることになる。
......(Equation 1) However, C is a setting value given from the outside, and in the case of the maximum value filter, C=9, and in the case of the median value filter, C=5,
In the case of a minimum value filter, C=1 will be given.

出力レジスタ54は第5図fclに示すように、入力デ
ータのビット長(この場合は4ビツト長)に対応した段
数(3段)のD型ラッチで構成されており、ビット判定
部53の各決定回路531〜534から遅延しながら出
力される各画素に対応したビットごとの判定結果を入力
し、遅延合成することにより、所定の順序フィルタ処理
の結果を4ビット同時に、逐次得ることができる。
The output register 54, as shown in FIG. By inputting the bit-by-bit determination results corresponding to each pixel that are output with a delay from the decision circuits 531 to 534 and performing delayed synthesis, it is possible to obtain four bits of predetermined sequential filter processing results simultaneously and sequentially.

第6図にビット決定部53の変形例を示す。この変形例
は、ビット判定部52の各ステージの各判定回路531
〜534から出力される結果L Js、1〜LJ、、t
、を計数する計数回路91と、計数結果を外部からの入
力されるデータ(Mb)と加算する加算回路92と、そ
の加算結果を設定値Cと比較する比較回路93で構成さ
れる。この回路はMb=oに設定することにより、実施
例のビット決定回路とまったく同一の動作をする。さら
に、この変形例では、第7図に示すようにビット判定部
71〜73およびビット決定部74〜76を複数個用意
し、前段のビット決定部75の各ステージの各判定回路
からの加算結果を次の段76の加算回路の入力とするこ
とにより、ウィンド・サイズの変更を可能にしたもので
ある。
FIG. 6 shows a modification of the bit determination section 53. In this modification, each determination circuit 531 of each stage of the bit determination unit 52
Result output from ~534 L Js, 1~LJ,,t
, an adding circuit 92 that adds the counting result to externally input data (Mb), and a comparing circuit 93 that compares the addition result with a set value C. By setting Mb=o, this circuit operates exactly the same as the bit determining circuit of the embodiment. Furthermore, in this modification, a plurality of bit determination units 71 to 73 and bit determination units 74 to 76 are prepared as shown in FIG. By using this as an input to the adder circuit of the next stage 76, the window size can be changed.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、2次元の順序フィ
ルタ処理を高速に実行できる、さらに順序フィルタ回路
の基本部分を同一のモジュールで構成できるのでLSI
化が容易であるという効果がある。またビット決定部の
演算結果(中途)を別のビット決定部に引き渡すように
することにより、順序フィルタのウィンドの大きさを自
由に拡張できるという効果がある。
As explained above, according to the present invention, two-dimensional sequential filter processing can be executed at high speed, and furthermore, since the basic parts of the sequential filter circuit can be configured in the same module, LSI
This has the effect of being easy to convert. Further, by passing the operation result (intermediate) of the bit determining section to another bit determining section, there is an effect that the size of the window of the order filter can be freely expanded.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の構成を示すブロック図、第2図は本発
明の原理説明図、 第3図は本発明の実施例の全体構成を示すブロック図、 第4図および第5図は第3図の各部の詳細を示すブロッ
ク図、 第6図は本発明の変形例を示すブロック図、第7図はウ
ィンドサイズの拡張例を示すブロック図、 第8図は1次元順序フィルタの説明図、第9図は順序フ
ィルタのソート要領の説明図、第10図は2次元順序フ
ィルタの説明図である。 第9図
FIG. 1 is a block diagram showing the configuration of the present invention, FIG. 2 is a diagram explaining the principle of the present invention, FIG. 3 is a block diagram showing the overall configuration of an embodiment of the present invention, and FIGS. 4 and 5 are 3 is a block diagram showing details of each part, FIG. 6 is a block diagram showing a modification of the present invention, FIG. 7 is a block diagram showing an example of expanding the window size, and FIG. 8 is an explanatory diagram of a one-dimensional ordered filter. , FIG. 9 is an explanatory diagram of the sorting procedure of the sequential filter, and FIG. 10 is an explanatory diagram of the two-dimensional sequential filter. Figure 9

Claims (2)

【特許請求の範囲】[Claims] (1)下記の要件を備えることを特徴とする高速順序フ
ィルタ回路 [1]画像をラスタ走査して得られる画像データを画素
単位に入力し、n×mのウインドに対応する2次元の画
素を再構成するとともに、ウインド内の各画素の2値l
ビットで表現された値の最上位ビット、第2位ビット、
・・・・・・最下位ビットの各ビットを順次遅延を与え
ながら出力するウインド・レジスタ部(41)を持つ。 [2]前記画素のビット数lに対応した数のステージ(
421、422、・・・・・・)で構成されるビット判
定部(42)を持つ。各ステージは、ウインド内の画素
数n×m個と等しい個数の判定回路を有する。最初のス
テージ(421)はその各判定回路がウインド内画素の
最上位ビットを受けそれを、1と比較し、結果をビット
決定部(43)へ通知し、ビット決定部からの結果(A
)を加えた判定結果を次のステージの対応する判定回路
へ出力する。次段以降のステージ(422、・・・・・
・)ではその各判定回路がウインド内画素の第2位ビッ
ト、第3位ビット、・・・・・・を受け、それを2値数
(A100・・・・・・)_2、(AB10・・・・・
・)_2と比較し、結果をビット決定部へ通知し、ビッ
ト決定部からの結果(B、・・・・・・)を加えた判定
結果を次のステージの対応する判定回路へ出力する。 [3]前記画素のビット数lに対応した数のステージ(
431、432、・・・・・・)で構成されるビット決
定部(43)を持つ。ビット決定部(43)の各ステー
ジ(431、432、・・・・・・)は、ビット判定部
(42)の各ステージ(421〜424)から出力され
た各判定回路の判定結果を受け、それを設定値と比較し
た結果(A、B、・・・・・・)をビット判定部(42
)の各ステージ(421、422、・・・・・・)なら
びに出力レジスタ部(44)に出力する。 [4]ビット決定部(43)の各ステージ(431、4
32、・・・・・・)から遅延して出力される各ビット
データを遅延合成する出力レジスタを持つ。
(1) A high-speed sequential filter circuit characterized by having the following requirements [1] Image data obtained by raster scanning an image is input pixel by pixel, and two-dimensional pixels corresponding to an n×m window are At the same time, the binary value l of each pixel in the window is
The most significant bit of the value expressed in bits, the second bit,
. . . It has a window register unit (41) that outputs each bit of the least significant bit sequentially with a delay. [2] The number of stages corresponding to the number of bits l of the pixel (
421, 422, . . . ). Each stage has a number of determination circuits equal to the number of n×m pixels in the window. In the first stage (421), each decision circuit receives the most significant bit of the pixel within the window, compares it with 1, notifies the result to the bit decision section (43), and outputs the result (A) from the bit decision section.
) is added and the judgment result is output to the corresponding judgment circuit of the next stage. The next and subsequent stages (422,...
), each judgment circuit receives the second bit, third bit, etc. of the pixel within the window, and converts it into binary numbers (A100...)_2, (AB10...・・・・・・
・)_2, the result is notified to the bit determination section, and the determination result, which is added with the result (B, . . .) from the bit determination section, is output to the corresponding determination circuit of the next stage. [3] The number of stages corresponding to the number of bits l of the pixel (
431, 432, . . . ). Each stage (431, 432, ...) of the bit determination section (43) receives the determination result of each determination circuit output from each stage (421 to 424) of the bit determination section (42), The bit judgment unit (42
) and the output register section (44). [4] Each stage (431, 4
It has an output register for delay-synthesizing each bit data that is delayed and output from 32, . . . ).
(2)ビット決定部(43)は、ビット判定部(52)
の各ステージの各判定回路から出力される結果を計数す
る計数回路(91)と、計数結果を外部から入力される
データ(Mb)と加算する加算回路(92)と、その加
算結果を設定値(C)と比較する比較回路(93)で構
成されることを特徴とする特許請求の範囲第1項記載の
高速順序フィルタ回路。
(2) The bit determining unit (43) is a bit determining unit (52)
a counting circuit (91) that counts the results output from each judgment circuit of each stage; an adder circuit (92) that adds the counting results to externally input data (Mb); 2. A high-speed sequential filter circuit according to claim 1, characterized in that it is comprised of a comparison circuit (93) for comparing with (C).
JP31361887A 1987-12-11 1987-12-11 High speed sequential filter circuit Pending JPH01155708A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31361887A JPH01155708A (en) 1987-12-11 1987-12-11 High speed sequential filter circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31361887A JPH01155708A (en) 1987-12-11 1987-12-11 High speed sequential filter circuit

Publications (1)

Publication Number Publication Date
JPH01155708A true JPH01155708A (en) 1989-06-19

Family

ID=18043486

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31361887A Pending JPH01155708A (en) 1987-12-11 1987-12-11 High speed sequential filter circuit

Country Status (1)

Country Link
JP (1) JPH01155708A (en)

Similar Documents

Publication Publication Date Title
JP2812126B2 (en) Rank order filter
US4464789A (en) Image analyzer for processing multiple frames of image data
US6119048A (en) Integrated circuit for processing digital signal
US4513440A (en) Hardware median filter
US20070027944A1 (en) Instruction based parallel median filtering processor and method
JPS6053349B2 (en) image processing processor
US8321490B2 (en) Instruction-based parallel median filtering
Bates et al. FPGA implementation of a median filter
EP0109426A1 (en) Sorting technique.
JP3198379B2 (en) Maximum value selection circuit
EP0227406A2 (en) Image signal processor
US20030095718A1 (en) Median filter
JP2003150957A5 (en)
JPS62187982A (en) Bit plane area correlator
US4651301A (en) Circuit arrangement for performing rapid sortation or selection according to rank
JPH01155708A (en) High speed sequential filter circuit
JPS6142031A (en) Sorting processor
JPH0595486A (en) Two-dimension shift array for picture compression
GB2194364A (en) Median filter
JPS6337481A (en) Conversion apparatus and method for gray scale image processing
Chung A fast pipelined median filter network
JP3204562B2 (en) Median filter processing method
Wiatr Pipeline architecture of specialized reconfigurable processors in FPGA structures for real-time image pre-processing
US5680529A (en) Image reduction conversion method
JP2516611B2 (en) Parallel data processing device