JPH10105702A - Density histogram calculation device for multi-gradation image - Google Patents
Density histogram calculation device for multi-gradation imageInfo
- Publication number
- JPH10105702A JPH10105702A JP8253562A JP25356296A JPH10105702A JP H10105702 A JPH10105702 A JP H10105702A JP 8253562 A JP8253562 A JP 8253562A JP 25356296 A JP25356296 A JP 25356296A JP H10105702 A JPH10105702 A JP H10105702A
- Authority
- JP
- Japan
- Prior art keywords
- data
- gradation
- frequency
- circuit
- module
- 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.)
- Granted
Links
- 238000007781 pre-processing Methods 0.000 claims description 14
- 238000000034 method Methods 0.000 claims description 9
- 230000015654 memory Effects 0.000 abstract description 32
- 238000001514 detection method Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 15
- 230000001360 synchronised effect Effects 0.000 description 8
- 238000006073 displacement reaction Methods 0.000 description 3
- 230000000873 masking effect Effects 0.000 description 3
- 230000000052 comparative effect Effects 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、多階調画像の濃度
ヒストグラムをハードウエア回路で高速に算出する多階
調画像の濃度ヒストグラム算出装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for calculating a density histogram of a multi-tone image at a high speed by a hardware circuit.
【0002】[0002]
【従来の技術】従来、多階調画像から濃度ヒストグラム
を算出するには、コンピュータによるソフトウエア処理
が採用されることが多く、このソフトウエア処理では、
多階調画像データを格納した画像メモリから濃度データ
(階調データ)を読み込み、読み込んだ濃度データに対
応する度数が格納されているメモリに1を加算するとい
う手順を繰り返すのが一般的である。2. Description of the Related Art Conventionally, in order to calculate a density histogram from a multi-tone image, software processing by a computer is often used. In this software processing,
Generally, a procedure of reading density data (gradation data) from an image memory storing multi-gradation image data and adding 1 to a memory storing a frequency corresponding to the read density data is repeated. .
【0003】この場合、広いサンプルエリアの多階調画
像信号に対応するためには、階調数×サンプル数分のメ
モリエリアを予約しておく必要があり、ソフトウエア処
理では、これらのメモリエリアに対する処理を逐次行う
ため膨大な処理時間がかかり、ヒストグラムをリアルタ
イムに求めることは困難である。In this case, in order to cope with a multi-tone image signal having a wide sample area, it is necessary to reserve memory areas for the number of tones × the number of samples. In software processing, these memory areas are required. It takes an enormous amount of processing time since the processing is performed sequentially, and it is difficult to obtain a histogram in real time.
【0004】これに対処するに、特開昭61−1537
71号公報には、階調信号の各濃度値に対応する数のゲ
ート回路と、各ゲート回路の出力によって各濃度値の度
数をカウントするカウンタとを設けることにより、画像
信号の濃度ヒストグラムを高速で求める技術が開示され
ている。To cope with this, Japanese Patent Application Laid-Open No. 61-1537 discloses
Japanese Patent Application Laid-Open No. 71-71709 provides a gate circuit of a number corresponding to each density value of a gradation signal and a counter for counting the frequency of each density value based on the output of each gate circuit, so that the density histogram of an image signal can be processed at high speed. The technology required in the above is disclosed.
【0005】[0005]
【発明が解決しようとする課題】しかしながら、上記先
行技術では、ヒストグラムを得るには全てのカウンタの
値を読み取る必要があり、その中には度数0のデータが
ランダムに混在し、度数0の無駄なアクセスが多く発生
する。例えば、8ビットの256階調の画像でサンプル
数が10個の場合であっても、256個のカウンタ回路
全てを読み出さねばならず、その中には度数0のデータ
がランダムに数多く存在する。However, in the above-mentioned prior art, in order to obtain a histogram, it is necessary to read the values of all counters. Access often occurs. For example, even if the number of samples is 10 in an 8-bit 256-gradation image, all 256 counter circuits must be read out, and a large number of data having a frequency of 0 exists randomly in them.
【0006】そのため、ヒストグラムを算出する回路ま
では高速で動作しても、算出したヒストグラムデータを
後段の処理に受け渡す際に時間がかかり、システム全体
のスループットが低下する可能性がある。Therefore, even if the circuit for calculating the histogram operates at high speed, it takes time to transfer the calculated histogram data to the subsequent processing, and the throughput of the entire system may be reduced.
【0007】本発明は上記事情に鑑みてなされたもの
で、度数0の無駄なアクセス発生による処理速度の低下
を解消し、高速で濃度ヒストグラムを算出することので
きる多階調画像の濃度ヒストグラム算出装置を提供する
ことを目的としている。SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and eliminates a reduction in processing speed due to the occurrence of useless accesses having a frequency of 0, and calculates a density histogram of a multi-tone image capable of calculating a density histogram at a high speed. It is intended to provide a device.
【0008】[0008]
【課題を解決するための手段】請求項1記載の発明は、
多階調画像信号の各階調データを保持する回路と、新た
に入力された階調データと保持した階調データとが一致
するか否かを判定する回路と、この回路からの一致判定
信号により、保持した階調データの度数を積算する回路
とを備えた回路モジュールを、複数個並列に接続したこ
とを特徴とする。According to the first aspect of the present invention,
A circuit for holding each gradation data of the multi-gradation image signal, a circuit for judging whether the newly inputted gradation data matches the held gradation data, and a circuit for judging the coincidence judgment signal from this circuit. A plurality of circuit modules each including a circuit for integrating the frequency of the held gradation data are connected in parallel.
【0009】請求項2記載の発明は、請求項1記載の発
明において、上記回路モジュールを、上記多階調画像に
おけるサンプル数と階調数とのうち、大きい方の数だけ
並列接続することを特徴とする。According to a second aspect of the present invention, in the first aspect, the circuit modules are connected in parallel by a larger one of the number of samples and the number of tones in the multi-tone image. Features.
【0010】請求項3記載の発明は、請求項1記載の発
明において、上記多階調画像を、被写体を異なる位置か
ら撮像した1組の画像に対し、画像を複数の小領域に分
割してステレオマッチングにより小領域単位のずれ量を
求めた距離分布画像とし、上記小領域内の有効データの
度数を求め、この度数と上記小領域単位のずれ量を代表
階調とする階調データとを上記回路モジュールに出力す
る前処理回路を設けたことを特徴とする。According to a third aspect of the present invention, in the first aspect of the present invention, the multi-tone image is obtained by dividing the image into a plurality of small regions with respect to a set of images of a subject taken from different positions. A distance distribution image in which the amount of shift in small area units is obtained by stereo matching, the frequency of valid data in the small area is obtained, and this frequency and tone data in which the amount of shift in the small area unit is used as a representative tone is calculated. A pre-processing circuit for outputting to the circuit module is provided.
【0011】請求項4記載の発明は、請求項1,2,3
のいずれか一に記載の発明において、さらに、上記複数
の回路モジュールに対して階調データを順次保持させ、
その際、過去に階調データを保持した全ての回路モジュ
ールからデータ不一致の判定信号が出力されたときにの
み、そのときの入力階調データを次の回路モジュールに
保持させる制御回路を備えたことを特徴とする。[0011] The invention according to claim 4 is the invention according to claims 1, 2, 3
In the invention according to any one of the above, further, the gradation data is sequentially held in the plurality of circuit modules,
At that time, a control circuit for holding the input gradation data at that time in the next circuit module only when a data mismatch determination signal is output from all the circuit modules that previously held the gradation data was provided. It is characterized by.
【0012】すなわち、請求項1記載の発明では、複数
の回路モジュールを並列接続し、各回路モジュール内
で、それぞれ階調データを保持し、新たに入力された階
調データと保持した階調データとが一致するか否かを判
定してデータが一致する場合、保持した階調データの度
数を積算することで、濃度ヒストグラムを高速に算出す
る。That is, according to the first aspect of the present invention, a plurality of circuit modules are connected in parallel, each of the circuit modules holds gradation data, and newly inputted gradation data and the held gradation data. Is determined, and if the data match, the density histogram is calculated at high speed by integrating the frequencies of the held gradation data.
【0013】その際、請求項2記載の発明では、上記回
路モジュールは、多階調画像におけるサンプル数と階調
数とのうち、大きい方の数だけ並列接続され、また、請
求項3記載の発明では、多階調画像がステレオマッチン
グにより小領域単位のずれ量を求めた距離分布画像であ
る場合、回路モジュールに対して前処理回路を設け、こ
の前処理回路により、小領域内の有効データの度数を求
め、この度数と上記小領域単位のずれ量を代表階調とす
る階調データとを回路モジュールに出力する。また、複
数の回路モジュールに階調データを保持させる際には、
請求項4に記載したように、過去に階調データを保持し
た全ての回路モジュールからデータ不一致の判定信号が
出力されたときにのみ、そのときの入力階調データを次
の回路モジュールに保持させる制御回路を設けることが
望ましい。In this case, according to the second aspect of the present invention, the circuit modules are connected in parallel by a larger one of the number of samples and the number of tones in the multi-tone image. According to the present invention, when the multi-tone image is a distance distribution image in which a shift amount of each small area is obtained by stereo matching, a pre-processing circuit is provided for the circuit module, and the pre-processing circuit causes the effective data in the small area to be provided. And outputs to the circuit module the frequency and tone data having the shift amount in the small area unit as a representative tone. Also, when holding gradation data in a plurality of circuit modules,
As described in claim 4, only when a data mismatch judgment signal is output from all the circuit modules that previously held the gradation data, the input gradation data at that time is held in the next circuit module. It is desirable to provide a control circuit.
【0014】[0014]
【発明の実施の形態】以下、図面を参照して本発明の実
施の形態を説明する。図1〜図5は本発明の実施の第1
形態に係わり、図1はヒストグラム算出装置の全体構成
図、図2は自己加算型階調・度数モジュールの回路ブロ
ック図、図3は基本画像と比較画像との比較による距離
データの説明図、図4はヒストグラム算出のための領域
設定を示す説明図、図5は各モジュール毎の処理を示す
タイムチャートである。Embodiments of the present invention will be described below with reference to the drawings. 1 to 5 show a first embodiment of the present invention.
1 is an overall configuration diagram of a histogram calculation device, FIG. 2 is a circuit block diagram of a self-addition type tone / frequency module, and FIG. 3 is an explanatory diagram of distance data obtained by comparing a basic image and a comparison image. 4 is an explanatory diagram showing an area setting for calculating a histogram, and FIG. 5 is a time chart showing a process for each module.
【0015】図1において、符号10は、多階調画像デ
ータを処理して濃度ヒストグラムを算出するヒストグラ
ム算出装置であり、階調データと、その度数データとか
らなるヒストグラムデータが階調・度数メモリ20に出
力される。In FIG. 1, reference numeral 10 denotes a histogram calculation device for processing a multi-tone image data to calculate a density histogram. The histogram data including the tone data and its frequency data is stored in a tone / frequency memory. 20.
【0016】上記ヒストグラム算出装置10への入力デ
ータは、本形態においては、1組のCCDカメラ1a,
1bで撮像したステレオ画像対を処理して得られる距離
画像であり、この距離画像は、上記CCDカメラ1a,
1bで撮像した1対のアナログ画像を、それぞれ、A/
Dコンバータ2a,2bにより所定の輝度階調(例えば
256階調のグレースケール)のデジタル画像に変換し
て画像メモリ3a,3bにストアし、これらの画像メモ
リ3a,3bの基本画像及び比較画像をステレオマッチ
ング処理して生成される。In the present embodiment, the input data to the histogram calculator 10 is a set of CCD cameras 1a,
1b is a distance image obtained by processing the stereo image pair picked up by the CCD camera 1b.
A pair of analog images taken at 1b are respectively represented by A /
The digital images are converted into digital images of a predetermined luminance gradation (for example, 256 gray scales) by the D converters 2a and 2b and stored in the image memories 3a and 3b, and the basic image and the comparative image of these image memories 3a and 3b are stored. Generated by stereo matching.
【0017】基本画像及び比較画像のステレオマッチン
グ処理は、距離データ計算回路4によって行われる。こ
の距離データ計算回路4は、上記画像メモリ3a,3b
にストアされている基本画像及び比較画像に対し、微小
領域毎に同一の物体が写っている部分を探索し、対応す
る位置の一致度を評価するためのシティブロック距離を
計算するシティブロック距離計算部、シティブロック距
離の最小値及び最大値を検出する最小・最大値検出部、
この最小・最大値検出部で得られた最小値が基本画像及
び比較画像における各小領域の一致を示すものであるか
否かをチェックしてズレ量を決定するズレ量決定部等か
ら構成され、ズレ量決定部の出力である距離分布データ
が距離画像として上記距離データメモリ5にストアされ
る。The stereo matching of the basic image and the comparison image is performed by the distance data calculation circuit 4. The distance data calculation circuit 4 is provided with the image memories 3a and 3b.
City block distance calculation for searching for a portion where the same object is shown for each micro area for the basic image and the comparison image stored in, and calculating the city block distance for evaluating the degree of coincidence of the corresponding position Unit, a minimum / maximum value detection unit for detecting the minimum value and the maximum value of the city block distance,
The minimum / maximum value detection unit is configured to include a shift amount determining unit that checks whether or not the minimum value obtained by each of the small regions in the basic image and the comparison image indicates the coincidence of the small regions and determines the shift amount. , The distance distribution data output from the shift amount determining unit is stored in the distance data memory 5 as a distance image.
【0018】すなわち、画面左上を原点として、画像横
方向をi座標軸,縦方向をj座標軸とし、単位を画素と
したとき、図4に示すように、画像を、例えば、4×4
画素の小領域に分割し、各画像の小領域毎に、基本画像
のi,j番目の輝度Ai,jと比較画像のi,j番目の輝度
Bi,jとの差に基づくシティブロック距離Z(=Σ|A
i,j−Bi,j|:i,j=0〜3)が最小となる位置すな
わち対応位置を求め、この対応位置のズレ量(シティブ
ロック距離が最小値のときのズレ量;図4においては2
0H)を距離分布データとして距離データメモリ5にス
トアする。That is, assuming that the upper left of the screen is the origin, the horizontal direction of the image is the i coordinate axis, the vertical direction is the j coordinate axis, and the unit is pixels, as shown in FIG.
The image is divided into small regions of pixels, and for each small region of each image, a city block distance Z based on the difference between the i, j-th luminance Ai, j of the basic image and the i, j-th luminance Bi, j of the comparison image. (= Σ | A
i, j−Bi, j |: i, j = 0 to 3) is determined to be the minimum position, that is, the corresponding position, and the deviation amount of the corresponding position (the deviation amount when the city block distance is the minimum value; FIG. 4) Is 2
0H) is stored in the distance data memory 5 as distance distribution data.
【0019】尚、シティブロック距離を計算して距離画
像を生成する回路の詳細な構成及び動作については、本
出願人によって先に提出された特開平5−114099
号に詳述されている。The detailed configuration and operation of the circuit for calculating the city block distance and generating the distance image are described in detail in Japanese Patent Application Laid-Open No. H5-114099 filed by the present applicant.
Issue.
【0020】一方、上記ヒストグラム算出装置10は、
並列接続された#1〜#nのn個の自己加算型階調・度
数モジュール11、各階調・度数モジュール11の動作
を制御する制御回路12から構成され、入力画像におけ
るサンプル数と階調数とのうちの大きい方の数に見合う
だけの階調・度数モジュール11が使用される。On the other hand, the histogram calculation device 10
It is composed of n self-addition type gradation / frequency modules 11 # 1 to #n connected in parallel, and a control circuit 12 for controlling the operation of each gradation / frequency module 11, and the number of samples and the number of gradations in the input image. As many gradation / frequency modules 11 as the number corresponding to the larger of the two are used.
【0021】それぞれの階調・度数モジュール11は、
図2に示すように、階調ラッチ13、比較器による一致
検出回路14、OR回路15、度数カウンタ16から構
成されている。上記階調ラッチ13のD入力端子、CK
端子、EN端子、SET端子には、それぞれ、上記距離
データメモリ5からの階調データ、同期クロック、上記
制御回路12からのロード信号(ラッチイネーブル信
号)、装置の初期化を行うクリア信号が入力され、上記
一致検出回路14の各入力端子に、上記距離データメモ
リ5からの階調データと上記階調ラッチ13のQ端子か
らのラッチデータとが入力される。Each tone / frequency module 11
As shown in FIG. 2, the circuit comprises a gradation latch 13, a match detection circuit 14 using a comparator, an OR circuit 15, and a frequency counter 16. D input terminal of the above-mentioned gradation latch 13, CK
To the terminal, the EN terminal, and the SET terminal, gray scale data from the distance data memory 5, a synchronous clock, a load signal (latch enable signal) from the control circuit 12, and a clear signal for initializing the device are input, respectively. The gradation data from the distance data memory 5 and the latch data from the Q terminal of the gradation latch 13 are input to each input terminal of the coincidence detection circuit 14.
【0022】また、上記度数カウンタ16のCK端子、
EN端子、CL端子には、それぞれ、同期クロック、上
記OR回路15の出力、上記制御回路12からのクリア
信号が入力される。上記OR回路15には、上記一致検
出回路14からの一致判定信号が入力されるとともに、
上記制御回路12からのロード信号が反転入力される。
そして、上記一致検出回路14の一致判定信号が上記制
御回路12に入力され、上記階調ラッチ13のQ端子か
ら階調データが出力されるとともに上記度数カウンタ1
6のQ端子から度数データが出力され、上記階調・度数
メモリ20にストアされる。The CK terminal of the frequency counter 16
The synchronous clock, the output of the OR circuit 15, and the clear signal from the control circuit 12 are input to the EN terminal and the CL terminal, respectively. The OR circuit 15 receives a match determination signal from the match detection circuit 14 and
The load signal from the control circuit 12 is inverted and input.
Then, the coincidence determination signal of the coincidence detection circuit 14 is input to the control circuit 12, the gradation data is output from the Q terminal of the gradation latch 13, and the frequency counter 1
Frequency data is output from the Q terminal 6 and stored in the gradation / frequency memory 20.
【0023】上記ヒストグラム算出装置10による濃度
ヒストグラムの算出は、図4に示すように、距離画像を
例えば12×6画素の領域に分割し、その領域毎に行わ
れる。各領域内の1つ1つのデータは、階調・度数モジ
ュール11へ与えられ、度数がカウントされる。以下、
上記ヒストグラム算出装置10の動作について説明す
る。The calculation of the density histogram by the histogram calculator 10 is performed as shown in FIG. 4 by dividing the distance image into, for example, an area of 12 × 6 pixels and for each area. Each piece of data in each area is provided to the gradation / frequency module 11, and the frequency is counted. Less than,
The operation of the histogram calculation device 10 will be described.
【0024】まず、ヒストグラム算出に際し、初期化が
行われる。この初期化では、データをラッチする階調・
度数モジュール11の番号を指定するための制御回路1
2内のモジュール番号カウンタが0にされ、また、クリ
ア信号により、全ての階調・度数モジュール11内の度
数カウンタ16が0にされるとともに階調ラッチ13が
初期値とされる。この階調ラッチ13の初期値は、例え
ば、入力階調データの最大値がFFH(256階調)の
場合、100Hのデータとなる。First, initialization is performed when calculating a histogram. In this initialization, the grayscale
Control circuit 1 for designating number of frequency module 11
The module number counter in 2 is set to 0, and the frequency counters 16 in all the tone / frequency modules 11 are set to 0 by the clear signal, and the tone latch 13 is set to the initial value. The initial value of the gradation latch 13 is, for example, 100H data when the maximum value of the input gradation data is FFH (256 gradations).
【0025】そして、初期化後、最初の階調データが入
力されると、制御回路12内部のモジュール番号カウン
タが1とされ、#1の階調・度数モジュール11#1(以
下、モジュール番号を添え字#1〜#nによって示す)内の
階調ラッチ13#1にロード信号が出力されるとともにO
R回路15#1を介して度数カウンタ16#1にロード信号
が出力される。これにより、階調ラッチ13#1がイネー
ブルとなって同期クロックにより最初の階調データが書
き込まれてラッチされ、また、度数カウンタ16#1がイ
ネーブルとなって同期クロックにより度数カウンタ16
#1に1が加算されてカウント値が1とされる。When the first gradation data is input after the initialization, the module number counter in the control circuit 12 is set to 1, and the # 1 gradation / frequency module 11 # 1 (hereinafter referred to as the module number) The load signal is output to the gradation latch 13 # 1 within the subscripts # 1 to #n) and
A load signal is output to the frequency counter 16 # 1 via the R circuit 15 # 1. As a result, the grayscale latch 13 # 1 is enabled and the first grayscale data is written and latched by the synchronous clock, and the frequency counter 16 # 1 is enabled and the frequency counter 16 # 1 is enabled by the synchronous clock.
The count value is set to 1 by adding 1 to # 1.
【0026】次に、2番目の階調データが階調・度数モ
ジュール11#1に入力されると、階調・度数モジュール
11#1では、内部の階調ラッチ13#1でラッチした最初
の階調データと2番目の階調データとを一致検出回路1
4#1で比較し、一致判定信号をOR回路15#1及び制御
回路12に出力する。この一致判定信号は、データが一
致しているときに1、不一致のときに0の信号であり、
一致検出回路14#1の出力が1のとき、すなわち、最初
の階調データと2番目の階調データとが一致するとき、
OR回路15#1を介して度数カウンタ16#1がイネーブ
ルとなり、同期クロックにより1が加算されてカウント
値が2となる。Next, when the second gradation data is input to the gradation / frequency module 11 # 1, the gradation / frequency module 11 # 1 latches the first gradation data latched by the internal gradation latch 13 # 1. Match detection circuit 1 for the gradation data and the second gradation data
The comparison is performed at 4 # 1, and a match determination signal is output to the OR circuit 15 # 1 and the control circuit 12. This match determination signal is a signal of 1 when the data matches, and a signal of 0 when the data does not match.
When the output of the coincidence detection circuit 14 # 1 is 1, that is, when the first gradation data matches the second gradation data,
The frequency counter 16 # 1 is enabled via the OR circuit 15 # 1, and 1 is added by the synchronous clock, and the count value becomes 2.
【0027】一方、一致検出回路14#1の出力が0のと
き、すなわち、最初の階調データと2番目の階調データ
とが一致しないときには、OR回路15#1を介して度数
カウンタ16#1がディスエイブルの状態のまま、度数カ
ウンタ16#1のカウント値が1に維持される一方、制御
回路12では内部のモジュール番号カウンタを2とし、
#2の階調・度数モジュール11#2にロード信号を出力
する。これにより、階調・度数モジュール11#2の階調
ラッチ13#2及び度数カウンタ16#2がイネーブルとな
り、同期クロックにより階調ラッチ13#2に2番目の階
調データが書き込まれるとともに度数カウンタ16#2が
1とされる。On the other hand, when the output of the coincidence detection circuit 14 # 1 is 0, that is, when the first gradation data does not match the second gradation data, the frequency counter 16 # is output via the OR circuit 15 # 1. While 1 remains disabled, the count value of the frequency counter 16 # 1 is maintained at 1, while the control circuit 12 sets the internal module number counter to 2,
The load signal is output to the # 2 gradation / frequency module 11 # 2. As a result, the grayscale latch 13 # 2 and the frequency counter 16 # 2 of the grayscale / frequency module 11 # 2 are enabled, and the second grayscale data is written into the grayscale latch 13 # 2 by the synchronous clock, and the frequency counter 16 # 2 is set to 1.
【0028】その後、3番目の階調データが#1,#2
の各階調・度数モジュール11#1,#2に入力され、以上
説明したように、各一致検出回路14#1,#2において、
それぞれがラッチしている階調データと比較される。す
なわち、#1の階調・度数モジュール11#1では、階調
ラッチ13#1でラッチされた最初の階調データと今回入
力された3番目の階調データとが一致検出回路14#1に
よって比較され、#2の階調・度数モジュール11#2で
は、階調ラッチ13#2でラッチされた2番目の階調デー
タと今回入力された3番目の階調データとが一致検出回
路14#2によって比較される。Thereafter, the third gradation data is # 1, # 2
Are input to the respective tone / frequency modules 11 # 1 and # 2, and as described above, in each of the coincidence detection circuits 14 # 1 and # 2,
Each data is compared with the latched gradation data. That is, in the gradation / frequency module 11 # 1 of # 1, the first gradation data latched by the gradation latch 13 # 1 and the third gradation data inputted this time are determined by the coincidence detection circuit 14 # 1. Then, in the gradation / frequency module 11 # 2 of # 2, the second gradation data latched by the gradation latch 13 # 2 and the third gradation data inputted this time match each other. Compared by two.
【0029】そして、3番目の階調データが最初の階調
データと一致しているときには、#1の階調・度数モジ
ュール11#1内部の度数カウンタ16#1に1が加算さ
れ、3番目の階調データが2番目の階調データと一致し
ているときには、#1の階調・度数モジュール11#1内
部の度数カウンタ16#1はカウントアップされず、#2
の階調・度数モジュール11#2内部の度数カウンタ16
#2に1が加算されてカウントアップされる。When the third gradation data coincides with the first gradation data, 1 is added to the frequency counter 16 # 1 inside the # 1 gradation / frequency module 11 # 1, and the third When the gradation data of # 1 coincides with the second gradation data, the frequency counter 16 # 1 inside the gradation / frequency module 11 # 1 of # 1 is not counted up, and
Frequency counter 16 inside gradation / frequency module 11 # 2
1 is added to # 2 and counted up.
【0030】また、3番目の階調データが最初の階調デ
ータ及び2番目の階調データのいずれとも一致しないと
きには、#1の階調・度数モジュール11#1内部の度数
カウンタ16#1、及び、#2の階調・度数モジュール1
1#2内部の度数カウンタ16#2のいずれもカウントアッ
プされず、制御回路12内部のモジュール番号カウンタ
が3となって#3の階調・度数モジュール11#3にロー
ド信号が出力される。そして、#3の階調・度数モジュ
ール11#3内部の階調ラッチ13#3及び度数カウンタ1
6#3がイネーブルとなって階調ラッチ13#3に3番目の
階調データが書き込まれるとともに度数カウンタ16#3
に1が加算されてカウント値が1とされる。When the third gradation data does not match with either the first gradation data or the second gradation data, the frequency counter 16 # 1 inside the # 1 gradation / frequency module 11 # 1 And # 2 gradation / frequency module 1
None of the frequency counter 16 # 2 inside 1 # 2 is counted up, and the module number counter inside the control circuit 12 becomes 3, and a load signal is output to the # 3 gradation / frequency module 11 # 3. Then, the gradation latch 13 # 3 and the frequency counter 1 inside the # 3 gradation / frequency module 11 # 3
6 # 3 is enabled, the third gradation data is written into the gradation latch 13 # 3, and the frequency counter 16 # 3
Is added to 1 to make the count value 1.
【0031】すなわち、図5のタイムチャートに示すよ
うに、階調データが入力される毎に、過去に階調データ
がラッチされている各モジュールで一致判定が行われ、
データが一致したモジュールでのみ度数がアップされ、
各モジュールからの一致判定信号が全て0、すなわち、
過去に階調データがラッチされたどのモジュールでもデ
ータが一致しない場合にのみ、制御回路12内部のモジ
ュール番号カウンタがカウントアップされて新しいモジ
ュールにロード信号が出力され、新しい階調データが新
しいモジュールにラッチされる。このような過程を繰り
返し、入力画像の全ての種類の階調データが次々とラッ
チされ、度数がカウントされてゆく。That is, as shown in the time chart of FIG. 5, each time gray-scale data is input, a coincidence determination is made in each module whose gray-scale data has been latched in the past.
The frequency is increased only in the module that matched the data,
The match determination signals from each module are all 0, that is,
Only when the data does not match in any module in which the gradation data has been latched in the past, the module number counter in the control circuit 12 is counted up and the load signal is output to the new module, and the new gradation data is transferred to the new module. Latched. By repeating such a process, all types of gradation data of the input image are latched one after another, and the frequency is counted.
【0032】このように12×6の領域の全ての階調デ
ータの度数をカウントすると、#1の階調・度数モジュ
ール11#1から順に階調データ及び度数を読み出して階
調・度数メモリ20にストアしてゆき、度数が0で階調
データが初期値のままのモジュールで処理を終了する。
そして、クリア信号による再初期化後、次の12×6の
領域の処理に移る。As described above, when the frequencies of all the gradation data in the 12 × 6 area are counted, the gradation data and the frequencies are sequentially read out from the gradation / frequency module 11 # 1 of # 1, and the gradation / frequency memory 20 is read out. Then, the processing is terminated by the module having the frequency of 0 and the gradation data kept at the initial value.
Then, after re-initialization by the clear signal, the processing shifts to processing of the next 12 × 6 area.
【0033】すなわち、#1のモジュールから順に階調
データ及び度数を読み出す過程で、度数のあるモジュー
ル間に度数0のモジュールが存在することはなく、度数
0のモジュールが出現したときには、ヒストグラムデー
タの終わりとなる。これにより、度数0の無駄なアクセ
ス発生による処理速度の低下を回避することができ、後
段の処理にヒストグラムデータを高速で受け渡してシス
テム全体のスループットを向上し、画像処理のリアルタ
イム化を図ることができる。That is, in the process of sequentially reading out the gradation data and the frequency from the # 1 module, there is no module having the frequency 0 between the modules having the frequency, and when the module having the frequency 0 appears, the histogram data It is the end. As a result, it is possible to avoid a reduction in processing speed due to the occurrence of useless access with a frequency of 0, and to transfer the histogram data at a high speed to subsequent processing, thereby improving the throughput of the entire system and realizing image processing in real time. it can.
【0034】図6〜図10は本発明の実施の第2形態に
係わり、図6はヒストグラム算出装置の全体構成図、図
7は自己加算型階調・度数モジュールの回路ブロック
図、図8はビットパターンによる度数計算の説明図、図
9はマスクパターンによるデータのマスクを示す説明
図、図10は各モジュール毎の処理を示すタイムチャー
トである。6 to 10 relate to a second embodiment of the present invention. FIG. 6 is a diagram showing the overall configuration of a histogram calculating device, FIG. 7 is a circuit block diagram of a self-addition type gradation / frequency module, and FIG. FIG. 9 is an explanatory diagram of frequency calculation using a bit pattern, FIG. 9 is an explanatory diagram showing data masking using a mask pattern, and FIG. 10 is a time chart showing processing for each module.
【0035】本形態は、ステレオ画像処理のように小領
域(例えば、4×4画素)単位のずれ量(階調データ)
を小領域全体の平均的な値(代表階調データ)として求
めて距離データとする場合、すなわち、距離画像のよう
に決まった小領域で必ず同じ階調データが得られる場
合、その小領域内のデータを予め処理するための前処理
回路を設け、処理速度の向上を図るものである。In the present embodiment, as in the case of stereo image processing, the shift amount (gradation data) in small areas (for example, 4 × 4 pixels) is used.
Is calculated as an average value (representative gradation data) of the entire small area and used as distance data, that is, when the same gradation data is always obtained in a fixed small area such as a distance image, In order to improve the processing speed, a pre-processing circuit for processing the data in advance is provided.
【0036】すなわち、画像メモリ3aにストアされて
いる基本画像の4×4画素の小領域毎に、画像メモリ3
bにストアされている比較画像からシティブロック距離
を計算して距離分布データを求めるわけであるが、この
処理に並行して、基本画像の4×4画素の小領域におけ
る距離分布データ算出の有効データの度数を予め算出し
ておき、4×4画素の小領域毎の代表階調データ(シテ
ィブロック距離が最小値のときのズレ量)と度数とを入
力データとして前述の第1形態と略同様なヒストグラム
算出処理を行う。That is, for each 4 × 4 pixel small area of the basic image stored in the image memory 3a,
The distance distribution data is obtained by calculating the city block distance from the comparison image stored in b. In parallel with this processing, the effective distance distribution data calculation in the 4 × 4 pixel small area of the basic image is performed. The frequency of the data is calculated in advance, and the representative grayscale data (the amount of displacement when the city block distance is the minimum value) and the frequency for each of the small areas of 4 × 4 pixels and the frequency are used as input data. A similar histogram calculation process is performed.
【0037】このため、本形態のヒストグラム算出装置
10Aでは、図6に示すように、並列接続された#1〜
#nのn個の自己加算型階調・度数モジュール31、各
階調・度数モジュール31の動作を制御する制御回路3
2に加え、前処理回路として、ビットパターン生成回路
33、マスクパターン生成回路34、AND回路35、
ビット加算器36を備えている。尚、上記階調・度数モ
ジュール31の個数は、前述の第1形態と同様、入力画
像におけるサンプル数と階調数とのうち、大きい方の数
に見合う個数である。For this reason, in the histogram calculation apparatus 10A of this embodiment, as shown in FIG.
#N n self-addition type gradation / frequency modules 31 and a control circuit 3 for controlling the operation of each gradation / frequency module 31
2, a bit pattern generation circuit 33, a mask pattern generation circuit 34, an AND circuit 35,
A bit adder 36 is provided. Note that the number of the tone / frequency modules 31 is a number corresponding to the larger one of the number of samples and the number of tones in the input image, as in the first embodiment.
【0038】そして、距離データ計算回路4による4×
4画素の小領域の代表階調であるシティブロック距離が
最小値のときのズレ量と、画像メモリ3aの基本画像デ
ータに基づいてビットパターン生成回路33で計算した
有効データのビットパターンとが距離データメモリ5に
ストアされ、この距離データメモリ5からの階調データ
が階調・度数モジュール31に入力されるとともに、距
離データメモリ5のビットパターンデータと、後述する
マスクパターン生成回路34からのデータとのAND回
路35による論理積がビット加算器36を介して度数デ
ータとして階調・度数モジュール31に入力される。The distance data calculation circuit 4 calculates 4 ×
The displacement amount when the city block distance, which is the representative gradation of the small area of 4 pixels, is the minimum value, and the bit pattern of the effective data calculated by the bit pattern generation circuit 33 based on the basic image data in the image memory 3a are the distances. The gradation data stored in the data memory 5 is input to the gradation / frequency module 31 from the distance data memory 5, and the bit pattern data of the distance data memory 5 and the data from the mask pattern generation circuit 34 described later are stored. AND by the AND circuit 35 is input to the gradation / frequency module 31 via the bit adder 36 as frequency data.
【0039】また、上記階調・度数モジュール31は、
第1形態の階調・度数モジュール11に対し、図7に示
すように、第1形態と同様の階調ラッチ13、一致検出
回路14、及び、OR回路15に対し、度数カウンタ1
6に代えて度数ラッチ17を採用し、さらに、加算器1
8を備えた構成となっている。Further, the gradation / frequency module 31
As shown in FIG. 7, the frequency counter 1 is provided for the gradation latch 13, the coincidence detection circuit 14, and the OR circuit 15 similar to those of the first embodiment.
6, a frequency latch 17 is employed.
8 is provided.
【0040】上記階調ラッチ13のD入力端子、CK端
子、EN端子、SET端子には、それぞれ、上記距離デ
ータメモリ5からの階調データ、同期クロック、上記制
御回路32からのロード信号、装置の初期化を行うクリ
ア信号が入力され、上記一致検出回路14の各入力端子
に、上記距離データメモリ5からの階調データと上記階
調ラッチ13のQ端子からのラッチデータとが入力され
る。The D input terminal, the CK terminal, the EN terminal, and the SET terminal of the gradation latch 13 have gradation data from the distance data memory 5, a synchronization clock, a load signal from the control circuit 32, and a device, respectively. , And the input terminal of the coincidence detection circuit 14 receives the gradation data from the distance data memory 5 and the latch data from the Q terminal of the gradation latch 13. .
【0041】また、上記度数ラッチ17のD入力端子に
は、上記ビット加算器36からの度数データと上記度数
ラッチ17のQ端子からのラッチデータとを上記加算器
18によって加算した値が入力され、上記度数ラッチ1
7のCK端子、EN端子、CL端子には、それぞれ、同
期クロック、上記OR回路15の出力、上記制御回路3
2からのクリア信号が入力される。上記OR回路15に
は、上記一致検出回路14からの一致判定信号が入力さ
れるとともに、上記制御回路32からのロード信号が反
転入力される。そして、上記一致検出回路14の一致判
定信号が上記制御回路32に入力され、上記階調ラッチ
13のQ端子から階調データが出力されるとともに上記
度数ラッチ17のQ端子から度数データが出力され、上
記階調・度数メモリ20にストアされる。A value obtained by adding the frequency data from the bit adder 36 and the latch data from the Q terminal of the frequency latch 17 by the adder 18 is input to the D input terminal of the frequency latch 17. , The frequency latch 1
7, a CK terminal, an EN terminal, and a CL terminal respectively have a synchronous clock, the output of the OR circuit 15, and the control circuit 3
2 is input. The OR circuit 15 receives the match determination signal from the match detection circuit 14 and receives the inverted load signal from the control circuit 32. Then, the coincidence determination signal of the coincidence detection circuit 14 is input to the control circuit 32, the gradation data is output from the Q terminal of the gradation latch 13, and the frequency data is output from the Q terminal of the frequency latch 17. Are stored in the gradation / frequency memory 20.
【0042】以上の構成による本形態のヒストグラム算
出装置10Aでは、前述の第1形態と同様、12×6画
素の領域を1つの評価単位としてヒストグラム算出処理
を行うものの、1つの12×6画素の領域に対し、4×
4画素の小領域を一まとめとして扱い、この小領域の代
表階調データ(シティブロック距離が最小値のときのズ
レ量)と前処理で計算した有効データの度数とを階調・
度数モジュール31に入力する処理を、j方向、i方向
にずらして6回行う。In the histogram calculating apparatus 10A according to the present embodiment having the above-described configuration, similar to the above-described first embodiment, the histogram calculating process is performed using an area of 12 × 6 pixels as one evaluation unit, but one 12 × 6 pixel area is used. 4x for the area
A small area of 4 pixels is treated as a whole, and the representative gradation data of this small area (the amount of displacement when the city block distance is the minimum value) and the frequency of the effective data calculated in the pre-processing are represented by gradation /
The process of inputting to the frequency module 31 is performed six times while shifting in the j direction and the i direction.
【0043】4×4画素の小領域に対する前処理の度数
計算は、図8に示すように、画像メモリ3aにストアさ
れている基本画像における4×4画素の小領域の16個
のデータに対し、例えば、隣接する画素間の輝度の差が
所定の閾値よりも大きいときに1(有効ビット)、閾値
よりも小さいときに0のビットパターンをビットパター
ン生成回路33で生成することで行われる。As shown in FIG. 8, the frequency calculation of the pre-processing for the small area of 4 × 4 pixels is performed for 16 data of the small area of 4 × 4 pixels in the basic image stored in the image memory 3a. For example, the bit pattern generation circuit 33 generates a bit pattern of 1 (valid bit) when the difference in luminance between adjacent pixels is larger than a predetermined threshold, and generates a bit pattern of 0 when the difference is smaller than the threshold.
【0044】図8は、基本画像の4×4画素の小領域に
対し、1110,1100,1000,0000のビッ
トパターン(EC8OHの2バイトデータ)となる例を
示し、1つの小領域に対応して、距離データメモリ5の
4バイトの領域にシティブロック距離が最小値のときの
ズレ量とビットパターンデータとが格納される。すなわ
ち、距離データ計算回路4で計算したシティブロック距
離が最小値のときのズレ量が先頭の1バイトの領域に格
納され、次の2バイトの領域に上記ビットパターン生成
回路33によるビットパターンデータが格納される。最
後の1バイトの領域は予備の空の領域である。これによ
り、距離画像の4×4画素の小領域における16バイト
のデータを4バイト(実質的には3バイト)のデータに
圧縮することができる。FIG. 8 shows an example in which a bit pattern (2 byte data of EC8OH) of 1110, 1100, 1000, 0000 is formed for a small area of 4 × 4 pixels of the basic image, and corresponds to one small area. In the 4-byte area of the distance data memory 5, the shift amount when the city block distance is the minimum value and the bit pattern data are stored. That is, the deviation amount when the city block distance calculated by the distance data calculation circuit 4 is the minimum value is stored in the first one-byte area, and the bit pattern data by the bit pattern generation circuit 33 is stored in the next two-byte area. Is stored. The last one-byte area is a spare empty area. As a result, 16-byte data in a small area of 4 × 4 pixels of the distance image can be compressed to 4-byte (substantially 3 bytes) data.
【0045】この場合、図9に示すように、12×6画
素の領域内で4×4画素の小領域をj方向、i方向にず
らしながら前処理を行うわけであるが、j方向にずらし
た場合、4×4画素の小領域の一部が12×6画素の領
域からはみ出してしまい、距離データメモリ5に格納さ
れるデータには、12×6画素の領域外のデータが含ま
れることになる。In this case, as shown in FIG. 9, the pre-processing is performed while shifting the small area of 4 × 4 pixels in the area of 12 × 6 pixels in the j direction and the i direction. In such a case, a part of the small area of 4 × 4 pixels is protruded from the area of 12 × 6 pixels, and the data stored in the distance data memory 5 includes data outside the area of 12 × 6 pixels. become.
【0046】そのため、12×6画素の領域外のデータ
を、マスクパターン生成回路34で生成したマスクパタ
ーンによってマスクする。すなわち、12×6画素の領
域外となってマスクすべき部分は4×4画素の小領域の
下半分の4×2の領域であるため、マスクパターン生成
回路34では、図9に示すように、0000,000
0,1111,1111(=00FFH)のマスクパタ
ーンを生成する。そして、このマスクパターンとビット
パターンデータとのビット毎の論理積をAND回路35
で取り、ビット加算器36によって有効ビット数のバイ
トデータ(度数データ)として#1の階調・度数モジュ
ール31#1に出力することで、12×6画素の領域外の
データをマスクすることができる。Therefore, data outside the area of 12 × 6 pixels is masked by the mask pattern generated by the mask pattern generation circuit 34. That is, since the portion to be masked outside the 12 × 6 pixel region is the lower half 4 × 2 region of the 4 × 4 pixel small region, the mask pattern generation circuit 34 performs the operation as shown in FIG. , 0,000,000
A mask pattern of 0, 1111, 1111 (= 00FFH) is generated. Then, the AND of each bit of the mask pattern and the bit pattern data is calculated by an AND circuit 35.
By outputting the data as byte data (frequency data) having an effective number of bits to the grayscale / frequency module 31 # 1 of # 1 by the bit adder 36, the data outside the area of 12 × 6 pixels can be masked. it can.
【0047】尚、マスクすべきビットパターンデータ
は、12×6画素の領域内で4×4画素の小領域をずら
す場合、2,4,6番目の小領域から得られるデータで
あり、これら以外のデータ(1,3,5番目)に対して
は、マスクパターン生成回路34で生成するビットパタ
ーンは、1111,1111,1111,1111(=
FFFFH)のパターンとなり、データのマスクを行わ
ない。The bit pattern data to be masked is data obtained from the second, fourth and sixth small areas when the small area of 4 × 4 pixels is shifted within the area of 12 × 6 pixels. For the data (1, 3rd, 5th), the bit pattern generated by the mask pattern generation circuit 34 is 1111, 1111, 1111, 1111 (=
FFFFH) and the data is not masked.
【0048】次に、以上の前処理を伴う本形態のヒスト
グラム算出処理について説明する。まず、クリア信号に
より、前述の第1形態と同様、制御回路32内のモジュ
ール番号カウンタが0にされ、全ての階調・度数モジュ
ール31内の度数ラッチ17が0にされるとともに、階
調ラッチ13が初期値(入力階調データの最大値がFF
Hの場合、100H)にされる。そして、基本画像の4
×4画素の小領域に対し、比較画像を用いて距離データ
計算回路4で計算したシティブロック距離が最小値のと
きのズレ量と、ビットパターン生成回路33によるビッ
トパターンデータとが距離データメモリ5に格納され
る。Next, a description will be given of the histogram calculation processing of the present embodiment involving the above preprocessing. First, in the same manner as in the first embodiment, the module number counter in the control circuit 32 is set to 0 by the clear signal, the frequency latches 17 in all the gradation / frequency modules 31 are set to 0, and 13 is the initial value (the maximum value of the input gradation data is FF
In the case of H, it is set to 100H). And 4 of the basic image
The distance when the city block distance calculated by the distance data calculation circuit 4 using the comparison image is the minimum value and the bit pattern data by the bit pattern generation circuit 33 are stored in the distance data memory 5 for the small area of × 4 pixels. Is stored in
【0049】次いで、制御回路32内部のモジュール番
号カウンタがカウントアップされて1となり、#1の階
調・度数モジュール31#1内部の階調ラッチ13#1及び
度数ラッチ17#1にロード信号が出力されて内部の階調
ラッチ13#1及び度数ラッチ17#1がイネーブルとな
る。そして、同期クロックにより、最初の小領域の階調
データが階調ラッチ13#1に書き込まれるとともに、前
処理後の度数データが度数ラッチ17#1に書き込まれ
る。Next, the module number counter in the control circuit 32 is counted up to 1 and the load signal is supplied to the gradation latch 13 # 1 and the frequency latch 17 # 1 in the # 1 gradation / frequency module 31 # 1. The signal is output and the internal gradation latch 13 # 1 and frequency latch 17 # 1 are enabled. Then, the grayscale data of the first small area is written into the grayscale latch 13 # 1 and the frequency data after the preprocessing is written into the frequency latch 17 # 1 by the synchronous clock.
【0050】尚、前述したように、この最初の小領域に
対するビットパターンデータに対しては、データをマス
クする必要がないため、マスクパターン生成回路34で
生成するデータはFFFFHとなり、AND回路35、
ビット加算器36を介して階調・度数モジュール31#1
に入力される前処理後の度数データは、距離データメモ
リ5のビットパターンデータの有効ビット数と同じであ
る。As described above, since it is not necessary to mask the bit pattern data for the first small area, the data generated by the mask pattern generation circuit 34 is FFFFH, and the AND circuit 35,
The gradation / frequency module 31 # 1 via the bit adder 36
Is the same as the number of effective bits of the bit pattern data in the distance data memory 5.
【0051】次に、12×6画素の領域内で4×4画素
の小領域をj方向にずらし、この小領域の一部が12×
6画素の領域からはみ出した状態で、再び、ビットパタ
ーン生成回路33による処理でデータのビットパターン
を求め、そのビットパターンデータを、距離データ計算
回路4で計算したシティブロック距離が最小値のときの
ズレ量とともに距離データメモリ5に格納する。Next, the small area of 4 × 4 pixels is shifted in the j direction within the area of 12 × 6 pixels, and a part of the small area is shifted by 12 × 6 pixels.
In the state of being out of the area of 6 pixels, the bit pattern of the data is obtained again by the processing by the bit pattern generation circuit 33, and the bit pattern data is calculated when the city block distance calculated by the distance data calculation circuit 4 is the minimum value. The distance data is stored in the distance data memory 5 together with the deviation amount.
【0052】そして、距離データメモリ5から、2番目
の小領域の階調データを#1の階調モジュール31#1に
出力するとともに、2番目の小領域のビットパターンデ
ータをAND回路35に出力する。このAND回路35
には、マスクパターン生成回路34で生成した00FF
Hのマスクデータが入力されており、2番目の小領域の
ビットパターンデータとのビット毎の論理積によってビ
ットパターンデータに含まれる12×6画素の領域外の
データがマスクされ、ビット加算器36を介して前処理
後の有効ビットの度数データとして#1の階調・度数モ
ジュール31#1に出力される。Then, the gradation data of the second small area is output from the distance data memory 5 to the # 1 gradation module 31 # 1, and the bit pattern data of the second small area is output to the AND circuit 35. I do. This AND circuit 35
Contains the 00FF generated by the mask pattern generation circuit 34.
The mask data of H is input, and the data outside the area of 12 × 6 pixels included in the bit pattern data is masked by a logical AND for each bit with the bit pattern data of the second small area. Is output to the # 1 gradation / frequency module 31 # 1 as frequency data of valid bits after pre-processing via the.
【0053】#1の階調・度数モジュール31#1では、
階調ラッチ13#1でラッチした最初の小領域の階調デー
タと今回入力された2番目の小領域の階調データとを一
致検出回路14#1で比較し、一致判定信号をOR回路1
5#1及び制御回路32に出力する。In the # 1 gradation / frequency module 31 # 1,
The gradation data of the first small area latched by the gradation latch 13 # 1 is compared with the gradation data of the second small area inputted this time by the coincidence detection circuit 14 # 1, and the coincidence determination signal is output to the OR circuit 1
5 # 1 and output to the control circuit 32.
【0054】上記一致検出回路14#1の一致判定出力が
1のとき、すなわち、ラッチした最初の小領域の階調デ
ータと今回入力された2番目の小領域の階調データとが
一致するときには、OR回路15#1を介して度数ラッチ
17#1がイネーブルとなり、この度数ラッチ17#1でラ
ッチしている度数データと今回入力された度数データ
(マスク後度数データ)とが加算器18#1で加算されて
度数ラッチ17#1に書き込まれる。When the coincidence determination output of the coincidence detecting circuit 14 # 1 is 1, that is, when the gradation data of the latched first small region matches the gradation data of the second small region inputted this time. , The frequency latch 17 # 1 is enabled via the OR circuit 15 # 1, and the frequency data latched by the frequency latch 17 # 1 and the currently input frequency data (frequency data after masking) are added to the adder 18 #. It is added by 1 and written to the frequency latch 17 # 1.
【0055】一方、一致検出回路14#1の出力が0のと
き、すなわち、ラッチしている最初の小領域の階調デー
タと今回入力された2番目の小領域の階調データとが一
致しないときには、OR回路15#1を介して度数ラッチ
17#1がディスエイブルの状態のままラッチデータが保
持される一方、制御回路32では内部のモジュール番号
カウンタを2とし、#2の階調・度数モジュール31#2
にロード信号を出力する。On the other hand, when the output of the coincidence detection circuit 14 # 1 is 0, that is, the gradation data of the latched first small area does not match the gradation data of the second small area inputted this time. Occasionally, the latch data is held via the OR circuit 15 # 1 while the frequency latch 17 # 1 is in a disabled state, while the control circuit 32 sets the internal module number counter to 2, and the # 2 gradation / frequency Module 31 # 2
Output the load signal.
【0056】これにより、#2の階調・度数モジュール
31#2内部の階調ラッチ13#2及び度数ラッチ17#2が
イネーブルとなり、階調ラッチ13#2に2番目の小領域
の階調データが書き込まれるとともに、度数ラッチ17
#1に2番目の小領域の度数データ(マスク後データ)が
書き込まれる。As a result, the grayscale latch 13 # 2 and the frequency latch 17 # 2 inside the # 2 grayscale / frequency module 31 # 2 are enabled, and the grayscale latch 13 # 2 stores the grayscale of the second small area. While data is written, the frequency latch 17
In # 1, frequency data (data after masking) of the second small area is written.
【0057】その後、4×4画素の小領域を最初の位置
からi方向にずらし、ビットパターン生成回路33によ
る処理でビットパターンデータを求めると、この3番目
の小領域におけるビットパターンデータの計算結果を、
距離データ計算回路4で計算したシティブロック距離が
最小値のときのズレ量とともに距離データメモリ5に格
納する。この3番目の小領域におけるビットパターンデ
ータは、マスクする必要がないため、マスクパターン生
成回路34からのデータによってマスクされることな
く、ビット加算器36において度数データに変換された
後、階調データとともに#1,#2の各階調・度数モジ
ュール31#1,#2に入力される。Thereafter, the small area of 4 × 4 pixels is shifted in the i direction from the initial position, and the bit pattern data is obtained by the processing by the bit pattern generation circuit 33. The calculation result of the bit pattern data in the third small area is obtained. To
The city block distance calculated by the distance data calculation circuit 4 is stored in the distance data memory 5 together with the deviation amount when the distance is the minimum value. Since the bit pattern data in the third small area need not be masked, the bit pattern data is converted into frequency data by the bit adder 36 without being masked by the data from the mask pattern generation circuit 34, At the same time, they are input to the tone / frequency modules 31 # 1 and # 2 of # 1 and # 2.
【0058】そして、#1の階調・度数モジュール11
#1において、階調ラッチ13#1でラッチされている最初
の小領域の階調データと今回入力された3番目の小領域
の階調データとが一致検出回路14#1によって比較さ
れ、#2の階調・度数モジュール11#2において、階調
ラッチ13#2でラッチされている2番目の小領域の階調
データと今回入力された3番目の小領域の階調データと
が一致検出回路14#2によって比較される。Then, the # 1 gradation / frequency module 11
In # 1, the match detection circuit 14 # 1 compares the gradation data of the first small region latched by the gradation latch 13 # 1 with the gradation data of the third small region inputted this time, In the second gradation / frequency module 11 # 2, the gradation data of the second small area latched by the gradation latch 13 # 2 matches the gradation data of the third small area inputted this time. The comparison is made by the circuit 14 # 2.
【0059】その結果、3番目の小領域の階調データが
最初の小領域の階調データと一致する場合には、#1の
階調・度数モジュール31#1の度数ラッチ17#1でラッ
チしている最初の小領域の度数データと今回入力された
3番目の小領域の度数データとが加算器18#1で加算さ
れて度数ラッチ17#1に書き込まれる。また、3番目の
小領域の階調データが2番目の小領域の階調データと一
致する場合には、#2の階調・度数モジュール31#2の
度数ラッチ17#2でラッチしている2番目の小領域の度
数データと今回入力された3番目の小領域の度数データ
とが加算器18#2で加算されて度数ラッチ17#2に書き
込まれる。As a result, if the gradation data of the third small region matches the gradation data of the first small region, the gradation is latched by the frequency latch 17 # 1 of the # 1 gradation / frequency module 31 # 1. The frequency data of the first small area and the frequency data of the third small area input this time are added by the adder 18 # 1 and written into the frequency latch 17 # 1. When the gradation data of the third small region matches the gradation data of the second small region, the gradation data is latched by the frequency latch 17 # 2 of the # 2 gradation / frequency module 31 # 2. The frequency data of the second small area and the frequency data of the third small area input this time are added by the adder 18 # 2 and written into the frequency latch 17 # 2.
【0060】一方、3番目の小領域の階調データが最初
の小領域の階調データ及び2番目の小領域の階調データ
のいずれとも一致しないときには、制御回路32内部の
モジュール番号カウンタが3となって#3の階調・度数
モジュール31#3にロード信号が出力され、階調・度数
モジュール31#3内部の階調ラッチ13#3及び度数ラッ
チ17#3がイネーブルとなって階調ラッチ13#3に3番
目の小領域の階調データが書き込まれるとともに、度数
ラッチ17#3に3番目の小領域の度数データが書き込ま
れる。On the other hand, when the gradation data of the third small area does not match any of the gradation data of the first small area and the gradation data of the second small area, the module number counter in the control circuit 32 is set to 3 As a result, a load signal is output to the # 3 gradation / frequency module 31 # 3, and the gradation latch 13 # 3 and the frequency latch 17 # 3 inside the gradation / frequency module 31 # 3 are enabled, and the gradation is performed. The gradation data of the third small area is written into the latch 13 # 3, and the frequency data of the third small area is written into the frequency latch 17 # 3.
【0061】その後、4番目の小領域、5番目の小領
域、6番目の小領域のデータを、同様にして処理し、1
つの12×6の領域に対する処理が終了すると、#1の
階調・度数モジュール11#1から順に階調及び度数デー
タを読み出して階調・度数メモリ20にストアしてゆ
き、度数が0のモジュールで動作を停止してクリア信号
による再初期化を行い、次の12×6の領域の処理に移
る。Thereafter, the data of the fourth small area, the fifth small area, and the sixth small area are processed in the same manner, and
When the processing for two 12 × 6 areas is completed, the gradation and frequency data are read out sequentially from the # 1 gradation / frequency module 11 # 1 and stored in the gradation / frequency memory 20, and the module having the frequency of 0 is read out. To stop the operation, re-initialize by the clear signal, and proceed to the processing of the next 12 × 6 area.
【0062】すなわち、図10のタイムチャートに示す
ように、階調データと前処理で計算した度数データとを
各モジュールの入力データとして各モジュールでラッチ
しておき、入力された階調データが過去にラッチした階
調データと一致する場合、そのモジュールでラッチして
いる度数データに新たな度数データを加算して再ラッチ
することで度数データを蓄積する。That is, as shown in the time chart of FIG. 10, the gradation data and the frequency data calculated in the preprocessing are latched as input data of each module in each module, and the inputted gradation data is stored in the past. If the data coincides with the gradation data latched in the module, the frequency data is accumulated by adding new frequency data to the frequency data latched by the module and re-latching.
【0063】一方、過去に階調データがラッチされたど
のモジュールでもデータが一致しない場合には、制御回
路32内部のモジュール番号カウンタがカウントアップ
されて新しいモジュールにロード信号が出力され、新し
い階調データ及び度数データが新しいモジュールにラッ
チされる過程を繰り返し、入力画像の全ての種類の階調
データ及び前処理後の度数データが次々とラッチされ、
度数データが蓄積されてゆくのである。On the other hand, if the data does not match in any of the modules in which the grayscale data has been latched in the past, the module number counter in the control circuit 32 is counted up and a load signal is output to the new module, and the new grayscale data is output. Repeat the process of latching the data and frequency data in the new module, all types of gradation data of the input image and frequency data after pre-processing are latched one after another,
Frequency data accumulates.
【0064】本形態においては、度数0の無駄なアクセ
ス発生による処理速度の低下を回避することができるば
かりでなく、決まった小領域で必ず同じ階調データが得
られる距離画像のような多階調画像に対し、前処理回路
で小領域内のデータの度数を計数するため、さらに処理
速度を向上することができる。In this embodiment, it is possible not only to avoid a reduction in processing speed due to the occurrence of useless access with a frequency of 0, but also to obtain a multi-level image such as a distance image in which the same gradation data can always be obtained in a fixed small area. Since the frequency of data in the small area is counted by the preprocessing circuit for the toned image, the processing speed can be further improved.
【0065】[0065]
【発明の効果】以上説明したように本発明によれば、複
数の回路モジュールを並列接続し、各回路モジュール内
で、それぞれ階調データを保持し、新たに入力された階
調データと保持した階調データとが一致するか否かを判
定してデータが一致する場合、保持した階調データの度
数を積算するため、度数0の無駄なアクセス発生による
処理速度の低下を回避して後段の処理にヒストグラムデ
ータを高速で受け渡すことができ、システム全体のスル
ープットを向上して画像処理のリアルタイム化を図るこ
とができる等優れた効果が得られる。As described above, according to the present invention, a plurality of circuit modules are connected in parallel, the gradation data is held in each circuit module, and the newly input gradation data is held. It is determined whether or not the data matches the gradation data. If the data matches, the frequency of the held gradation data is integrated, so that the processing speed is prevented from lowering due to the useless access of frequency 0 to avoid the lower processing speed. Histogram data can be transferred to the processing at high speed, and excellent effects can be obtained, such as improving the throughput of the entire system and realizing image processing in real time.
【図1】本発明の実施の第1形態に係わり、ヒストグラ
ム算出装置の全体構成図FIG. 1 is an overall configuration diagram of a histogram calculation device according to a first embodiment of the present invention.
【図2】同上、自己加算型階調・度数モジュールの回路
ブロック図FIG. 2 is a circuit block diagram of the self-addition type gradation / frequency module.
【図3】同上、基本画像と比較画像との比較による距離
データの説明図FIG. 3 is an explanatory diagram of distance data obtained by comparing a basic image and a comparative image.
【図4】同上、ヒストグラム算出のための領域設定を示
す説明図FIG. 4 is an explanatory diagram showing an area setting for calculating a histogram;
【図5】同上、各モジュール毎の処理を示すタイムチャ
ートFIG. 5 is a time chart showing processing for each module;
【図6】本発明の実施の第2形態に係わり、ヒストグラ
ム算出装置の全体構成図FIG. 6 is an overall configuration diagram of a histogram calculation device according to a second embodiment of the present invention.
【図7】同上、自己加算型階調・度数モジュールの回路
ブロック図FIG. 7 is a circuit block diagram of the self-addition type gradation / frequency module.
【図8】同上、ビットパターンによる度数計算の説明図FIG. 8 is an explanatory diagram of frequency calculation using a bit pattern according to the embodiment;
【図9】同上、マスクパターンによるデータのマスクを
示す説明図FIG. 9 is an explanatory view showing a data mask using a mask pattern;
【図10】同上、各モジュール毎の処理を示すタイムチ
ャートFIG. 10 is a time chart showing processing for each module;
10,10A…ヒストグラム算出装置 11,31 …自己加算型階調・度数モジュール(回路
モジュール)10, 10A: histogram calculation device 11, 31: self-addition type gradation / frequency module (circuit module)
Claims (4)
る回路と、新たに入力された階調データと保持した階調
データとが一致するか否かを判定する回路と、この回路
からの一致判定信号により、保持した階調データの度数
を積算する回路とを備えた回路モジュールを、複数個並
列に接続したことを特徴とする多階調画像の濃度ヒスト
グラム算出装置。1. A circuit for holding each gradation data of a multi-gradation image signal, a circuit for determining whether newly input gradation data and the held gradation data match, A multi-tone image density histogram calculating apparatus, wherein a plurality of circuit modules each including a circuit for integrating the frequency of held gradation data in accordance with the coincidence determination signal are connected in parallel.
におけるサンプル数と階調数とのうち、大きい方の数だ
け並列接続することを特徴とする請求項1記載の多階調
画像の濃度ヒストグラム算出装置。2. The density of a multi-tone image according to claim 1, wherein the circuit modules are connected in parallel by the larger one of the number of samples and the number of tones in the multi-tone image. Histogram calculation device.
から撮像した1組の画像に対し、画像を複数の小領域に
分割してステレオマッチングにより小領域単位のずれ量
を求めた距離分布画像とし、 上記小領域内の有効データの度数を求め、この度数と上
記小領域単位のずれ量を代表階調とする階調データとを
上記回路モジュールに出力する前処理回路を設けたこと
を特徴とする請求項1記載の多階調画像の濃度ヒストグ
ラム算出装置。3. A distance distribution obtained by dividing the multi-tone image into a plurality of small regions with respect to a set of images obtained by photographing a subject from different positions and obtaining a shift amount in small region units by stereo matching. A preprocessing circuit that obtains the frequency of the effective data in the small area as an image, and outputs the frequency and the gradation data having the deviation amount in the small area unit as a representative gradation to the circuit module. The apparatus for calculating a density histogram of a multi-tone image according to claim 1.
して階調データを順次保持させ、その際、過去に階調デ
ータを保持した全ての回路モジュールからデータ不一致
の判定信号が出力されたときにのみ、そのときの入力階
調データを次の回路モジュールに保持させる制御回路を
備えたことを特徴とする請求項1,2,3のいずれか一
に記載の多階調画像の濃度ヒストグラム算出装置。4. A method of causing the plurality of circuit modules to sequentially hold grayscale data, and in this case, when a data mismatch determination signal is output from all circuit modules that previously held grayscale data. 4. A multi-gradation image density histogram calculating apparatus according to claim 1, further comprising a control circuit for holding only the input gradation data at that time in a next circuit module. .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP25356296A JP3880665B2 (en) | 1996-09-25 | 1996-09-25 | Multi-tone image density histogram calculation device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP25356296A JP3880665B2 (en) | 1996-09-25 | 1996-09-25 | Multi-tone image density histogram calculation device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH10105702A true JPH10105702A (en) | 1998-04-24 |
| JP3880665B2 JP3880665B2 (en) | 2007-02-14 |
Family
ID=17253101
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP25356296A Expired - Fee Related JP3880665B2 (en) | 1996-09-25 | 1996-09-25 | Multi-tone image density histogram calculation device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3880665B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9030570B2 (en) | 2011-06-27 | 2015-05-12 | Renesas Electronics Corporation | Parallel operation histogramming device and microcomputer |
-
1996
- 1996-09-25 JP JP25356296A patent/JP3880665B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9030570B2 (en) | 2011-06-27 | 2015-05-12 | Renesas Electronics Corporation | Parallel operation histogramming device and microcomputer |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3880665B2 (en) | 2007-02-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112215255B (en) | Training method of target detection model, target detection method and terminal equipment | |
| US4736443A (en) | Pattern discriminator | |
| US5287193A (en) | Parallel processing architecture of run-length codes | |
| US4982342A (en) | Image processor system having multifunction look-up table units | |
| JPH03256485A (en) | Motion vector detecting circuit | |
| US5701364A (en) | Image processing apparatus | |
| US5687252A (en) | Image processing apparatus | |
| US5315409A (en) | Method of and apparatus for obtaining binary image | |
| EP0501450A2 (en) | Apparatus for distinguishing between different areas of an image | |
| JPH0749927A (en) | Pattern recognition method | |
| US6052474A (en) | Method and apparatus for collating images | |
| JPH08292014A (en) | Measuring method of pattern position and device thereof | |
| CN106845555A (en) | Image matching method and image matching apparatus based on Bayer format | |
| JPH10105702A (en) | Density histogram calculation device for multi-gradation image | |
| US6188798B1 (en) | Apparatus and method for detecting motion vector | |
| US5438682A (en) | Data processing system for rewriting parallel processor output data using a sequential processor | |
| TWI689893B (en) | Background model updating method and related device | |
| US5103487A (en) | Image processing method | |
| KR100206258B1 (en) | Image processing apparatus | |
| JP3052520B2 (en) | Pattern classification device | |
| JP3770465B2 (en) | Image processing device | |
| JPH03237571A (en) | Device for calculating binarizing threshold of image | |
| JPH02105272A (en) | Image processing device | |
| JP2621868B2 (en) | Image feature extraction device | |
| SU1270781A1 (en) | Device for recognizing contours of object images |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060613 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060801 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060925 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20061024 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20061108 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091117 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101117 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111117 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121117 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121117 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131117 Year of fee payment: 7 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |