JP3880665B2 - Multi-tone image density histogram calculation device - Google Patents

Multi-tone image density histogram calculation device Download PDF

Info

Publication number
JP3880665B2
JP3880665B2 JP25356296A JP25356296A JP3880665B2 JP 3880665 B2 JP3880665 B2 JP 3880665B2 JP 25356296 A JP25356296 A JP 25356296A JP 25356296 A JP25356296 A JP 25356296A JP 3880665 B2 JP3880665 B2 JP 3880665B2
Authority
JP
Japan
Prior art keywords
data
gradation
circuit
frequency
gradation data
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.)
Expired - Fee Related
Application number
JP25356296A
Other languages
Japanese (ja)
Other versions
JPH10105702A (en
Inventor
勝之 喜瀬
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.)
Subaru Corp
Original Assignee
Fuji Jukogyo KK
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 Fuji Jukogyo KK filed Critical Fuji Jukogyo KK
Priority to JP25356296A priority Critical patent/JP3880665B2/en
Publication of JPH10105702A publication Critical patent/JPH10105702A/en
Application granted granted Critical
Publication of JP3880665B2 publication Critical patent/JP3880665B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、多階調画像の濃度ヒストグラムをハードウエア回路で高速に算出する多階調画像の濃度ヒストグラム算出装置に関する。
【0002】
【従来の技術】
従来、多階調画像から濃度ヒストグラムを算出するには、コンピュータによるソフトウエア処理が採用されることが多く、このソフトウエア処理では、多階調画像データを格納した画像メモリから濃度データ(階調データ)を読み込み、読み込んだ濃度データに対応する度数が格納されているメモリに1を加算するという手順を繰り返すのが一般的である。
【0003】
この場合、広いサンプルエリアの多階調画像信号に対応するためには、階調数×サンプル数分のメモリエリアを予約しておく必要があり、ソフトウエア処理では、これらのメモリエリアに対する処理を逐次行うため膨大な処理時間がかかり、ヒストグラムをリアルタイムに求めることは困難である。
【0004】
これに対処するに、特開昭61−153771号公報には、階調信号の各濃度値に対応する数のゲート回路と、各ゲート回路の出力によって各濃度値の度数をカウントするカウンタとを設けることにより、画像信号の濃度ヒストグラムを高速で求める技術が開示されている。
【0005】
【発明が解決しようとする課題】
しかしながら、上記先行技術では、ヒストグラムを得るには全てのカウンタの値を読み取る必要があり、その中には度数0のデータがランダムに混在し、度数0の無駄なアクセスが多く発生する。例えば、8ビットの256階調の画像でサンプル数が10個の場合であっても、256個のカウンタ回路全てを読み出さねばならず、その中には度数0のデータがランダムに数多く存在する。
【0006】
そのため、ヒストグラムを算出する回路までは高速で動作しても、算出したヒストグラムデータを後段の処理に受け渡す際に時間がかかり、システム全体のスループットが低下する可能性がある。
【0007】
本発明は上記事情に鑑みてなされたもので、度数0の無駄なアクセス発生による処理速度の低下を解消し、高速で濃度ヒストグラムを算出することのできる多階調画像の濃度ヒストグラム算出装置を提供することを目的としている。
【0008】
【課題を解決するための手段】
請求項1記載の発明は、多階調画像信号の各階調データを保持する回路と、新たに入力された階調データと保持した階調データとが一致するか否かを判定する回路と、この回路からの一致判定信号により、保持した階調データの度数を積算する回路とを備えた回路モジュールを、複数個並列に接続し、上記多階調画像を、被写体を異なる位置から撮像した1組の画像に対し、画像を複数の小領域に分割してステレオマッチングにより小領域単位のずれ量を求めた距離分布画像とし、上記小領域内の有効データの度数を求め、この度数と上記小領域単位のずれ量を代表階調とする階調データとを上記回路モジュールに出力する前処理回路を設けたことを特徴とする。
【0011】
請求項記載の発明は、多階調画像信号の各階調データを保持する回路と、新たに入力された階調データと保持した階調データとが一致するか否かを判定する回路と、この回路からの一致判定信号により、保持した階調データの度数を積算する回路とを備えた回路モジュールを、複数個並列に接続し、さらに、上記複数の回路モジュールに対して階調データを順次保持させ、その際、過去に階調データを保持した全ての回路モジュールからデータ不一致の判定信号が出力されたときにのみ、そのときの入力階調データを次の回路モジュールに保持させる制御回路を備えたことを特徴とする。
【0012】
すなわち、請求項1記載の発明では、複数の回路モジュールを並列接続し、各回路モジュール内で、それぞれ階調データを保持し、新たに入力された階調データと保持した階調データとが一致するか否かを判定してデータが一致する場合、保持した階調データの度数を積算することで、濃度ヒストグラムを高速に算出する。
【0013】
そして、多階調画像がステレオマッチングにより小領域単位のずれ量を求めた距離分布画像である場合、回路モジュールに対して前処理回路を設け、この前処理回路により、小領域内の有効データの度数を求め、この度数と上記小領域単位のずれ量を代表階調とする階調データとを回路モジュールに出力する。また、複数の回路モジュールに階調データを保持させる際には、請求項に記載したように、過去に階調データを保持した全ての回路モジュールからデータ不一致の判定信号が出力されたときにのみ、そのときの入力階調データを次の回路モジュールに保持させる制御回路を設けることが望ましい。
【0014】
【発明の実施の形態】
以下、図面を参照して本発明の実施の形態を説明する。図1〜図5は本発明の実施の第1形態に係わり、図1はヒストグラム算出装置の全体構成図、図2は自己加算型階調・度数モジュールの回路ブロック図、図3は基本画像と比較画像との比較による距離データの説明図、図4はヒストグラム算出のための領域設定を示す説明図、図5は各モジュール毎の処理を示すタイムチャートである。
【0015】
図1において、符号10は、多階調画像データを処理して濃度ヒストグラムを算出するヒストグラム算出装置であり、階調データと、その度数データとからなるヒストグラムデータが階調・度数メモリ20に出力される。
【0016】
上記ヒストグラム算出装置10への入力データは、本形態においては、1組のCCDカメラ1a,1bで撮像したステレオ画像対を処理して得られる距離画像であり、この距離画像は、上記CCDカメラ1a,1bで撮像した1対のアナログ画像を、それぞれ、A/Dコンバータ2a,2bにより所定の輝度階調(例えば256階調のグレースケール)のデジタル画像に変換して画像メモリ3a,3bにストアし、これらの画像メモリ3a,3bの基本画像及び比較画像をステレオマッチング処理して生成される。
【0017】
基本画像及び比較画像のステレオマッチング処理は、距離データ計算回路4によって行われる。この距離データ計算回路4は、上記画像メモリ3a,3bにストアされている基本画像及び比較画像に対し、微小領域毎に同一の物体が写っている部分を探索し、対応する位置の一致度を評価するためのシティブロック距離を計算するシティブロック距離計算部、シティブロック距離の最小値及び最大値を検出する最小・最大値検出部、この最小・最大値検出部で得られた最小値が基本画像及び比較画像における各小領域の一致を示すものであるか否かをチェックしてズレ量を決定するズレ量決定部等から構成され、ズレ量決定部の出力である距離分布データが距離画像として上記距離データメモリ5にストアされる。
【0018】
すなわち、画面左上を原点として、画像横方向をi座標軸,縦方向をj座標軸とし、単位を画素としたとき、図4に示すように、画像を、例えば、4×4画素の小領域に分割し、各画像の小領域毎に、基本画像のi,j番目の輝度Ai,jと比較画像のi,j番目の輝度Bi,jとの差に基づくシティブロック距離Z(=Σ|Ai,j−Bi,j|:i,j=0〜3)が最小となる位置すなわち対応位置を求め、この対応位置のズレ量(シティブロック距離が最小値のときのズレ量;図4においては20H)を距離分布データとして距離データメモリ5にストアする。
【0019】
尚、シティブロック距離を計算して距離画像を生成する回路の詳細な構成及び動作については、本出願人によって先に提出された特開平5−114099号に詳述されている。
【0020】
一方、上記ヒストグラム算出装置10は、並列接続された#1〜#nのn個の自己加算型階調・度数モジュール11、各階調・度数モジュール11の動作を制御する制御回路12から構成され、入力画像におけるサンプル数と階調数とのうちの大きい方の数に見合うだけの階調・度数モジュール11が使用される。
【0021】
それぞれの階調・度数モジュール11は、図2に示すように、階調ラッチ13、比較器による一致検出回路14、OR回路15、度数カウンタ16から構成されている。上記階調ラッチ13のD入力端子、CK端子、EN端子、SET端子には、それぞれ、上記距離データメモリ5からの階調データ、同期クロック、上記制御回路12からのロード信号(ラッチイネーブル信号)、装置の初期化を行うクリア信号が入力され、上記一致検出回路14の各入力端子に、上記距離データメモリ5からの階調データと上記階調ラッチ13のQ端子からのラッチデータとが入力される。
【0022】
また、上記度数カウンタ16のCK端子、EN端子、CL端子には、それぞれ、同期クロック、上記OR回路15の出力、上記制御回路12からのクリア信号が入力される。上記OR回路15には、上記一致検出回路14からの一致判定信号が入力されるとともに、上記制御回路12からのロード信号が反転入力される。そして、上記一致検出回路14の一致判定信号が上記制御回路12に入力され、上記階調ラッチ13のQ端子から階調データが出力されるとともに上記度数カウンタ16のQ端子から度数データが出力され、上記階調・度数メモリ20にストアされる。
【0023】
上記ヒストグラム算出装置10による濃度ヒストグラムの算出は、図4に示すように、距離画像を例えば12×6画素の領域に分割し、その領域毎に行われる。各領域内の1つ1つのデータは、階調・度数モジュール11へ与えられ、度数がカウントされる。以下、上記ヒストグラム算出装置10の動作について説明する。
【0024】
まず、ヒストグラム算出に際し、初期化が行われる。この初期化では、データをラッチする階調・度数モジュール11の番号を指定するための制御回路12内のモジュール番号カウンタが0にされ、また、クリア信号により、全ての階調・度数モジュール11内の度数カウンタ16が0にされるとともに階調ラッチ13が初期値とされる。この階調ラッチ13の初期値は、例えば、入力階調データの最大値がFFH(256階調)の場合、100Hのデータとなる。
【0025】
そして、初期化後、最初の階調データが入力されると、制御回路12内部のモジュール番号カウンタが1とされ、#1の階調・度数モジュール11#1(以下、モジュール番号を添え字#1〜#nによって示す)内の階調ラッチ13#1にロード信号が出力されるとともにOR回路15#1を介して度数カウンタ16#1にロード信号が出力される。これにより、階調ラッチ13#1がイネーブルとなって同期クロックにより最初の階調データが書き込まれてラッチされ、また、度数カウンタ16#1がイネーブルとなって同期クロックにより度数カウンタ16#1に1が加算されてカウント値が1とされる。
【0026】
次に、2番目の階調データが階調・度数モジュール11#1に入力されると、階調・度数モジュール11#1では、内部の階調ラッチ13#1でラッチした最初の階調データと2番目の階調データとを一致検出回路14#1で比較し、一致判定信号をOR回路15#1及び制御回路12に出力する。この一致判定信号は、データが一致しているときに1、不一致のときに0の信号であり、一致検出回路14#1の出力が1のとき、すなわち、最初の階調データと2番目の階調データとが一致するとき、OR回路15#1を介して度数カウンタ16#1がイネーブルとなり、同期クロックにより1が加算されてカウント値が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とされる。
【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によって比較される。
【0029】
そして、3番目の階調データが最初の階調データと一致しているときには、#1の階調・度数モジュール11#1内部の度数カウンタ16#1に1が加算され、3番目の階調データが2番目の階調データと一致しているときには、#1の階調・度数モジュール11#1内部の度数カウンタ16#1はカウントアップされず、#2の階調・度数モジュール11#2内部の度数カウンタ16#2に1が加算されてカウントアップされる。
【0030】
また、3番目の階調データが最初の階調データ及び2番目の階調データのいずれとも一致しないときには、#1の階調・度数モジュール11#1内部の度数カウンタ16#1、及び、#2の階調・度数モジュール11#2内部の度数カウンタ16#2のいずれもカウントアップされず、制御回路12内部のモジュール番号カウンタが3となって#3の階調・度数モジュール11#3にロード信号が出力される。そして、#3の階調・度数モジュール11#3内部の階調ラッチ13#3及び度数カウンタ16#3がイネーブルとなって階調ラッチ13#3に3番目の階調データが書き込まれるとともに度数カウンタ16#3に1が加算されてカウント値が1とされる。
【0031】
すなわち、図5のタイムチャートに示すように、階調データが入力される毎に、過去に階調データがラッチされている各モジュールで一致判定が行われ、データが一致したモジュールでのみ度数がアップされ、各モジュールからの一致判定信号が全て0、すなわち、過去に階調データがラッチされたどのモジュールでもデータが一致しない場合にのみ、制御回路12内部のモジュール番号カウンタがカウントアップされて新しいモジュールにロード信号が出力され、新しい階調データが新しいモジュールにラッチされる。このような過程を繰り返し、入力画像の全ての種類の階調データが次々とラッチされ、度数がカウントされてゆく。
【0032】
このように12×6の領域の全ての階調データの度数をカウントすると、#1の階調・度数モジュール11#1から順に階調データ及び度数を読み出して階調・度数メモリ20にストアしてゆき、度数が0で階調データが初期値のままのモジュールで処理を終了する。そして、クリア信号による再初期化後、次の12×6の領域の処理に移る。
【0033】
すなわち、#1のモジュールから順に階調データ及び度数を読み出す過程で、度数のあるモジュール間に度数0のモジュールが存在することはなく、度数0のモジュールが出現したときには、ヒストグラムデータの終わりとなる。これにより、度数0の無駄なアクセス発生による処理速度の低下を回避することができ、後段の処理にヒストグラムデータを高速で受け渡してシステム全体のスループットを向上し、画像処理のリアルタイム化を図ることができる。
【0034】
図6〜図10は本発明の実施の第2形態に係わり、図6はヒストグラム算出装置の全体構成図、図7は自己加算型階調・度数モジュールの回路ブロック図、図8はビットパターンによる度数計算の説明図、図9はマスクパターンによるデータのマスクを示す説明図、図10は各モジュール毎の処理を示すタイムチャートである。
【0035】
本形態は、ステレオ画像処理のように小領域(例えば、4×4画素)単位のずれ量(階調データ)を小領域全体の平均的な値(代表階調データ)として求めて距離データとする場合、すなわち、距離画像のように決まった小領域で必ず同じ階調データが得られる場合、その小領域内のデータを予め処理するための前処理回路を設け、処理速度の向上を図るものである。
【0036】
すなわち、画像メモリ3aにストアされている基本画像の4×4画素の小領域毎に、画像メモリ3bにストアされている比較画像からシティブロック距離を計算して距離分布データを求めるわけであるが、この処理に並行して、基本画像の4×4画素の小領域における距離分布データ算出の有効データの度数を予め算出しておき、4×4画素の小領域毎の代表階調データ(シティブロック距離が最小値のときのズレ量)と度数とを入力データとして前述の第1形態と略同様なヒストグラム算出処理を行う。
【0037】
このため、本形態のヒストグラム算出装置10Aでは、図6に示すように、並列接続された#1〜#nのn個の自己加算型階調・度数モジュール31、各階調・度数モジュール31の動作を制御する制御回路32に加え、前処理回路として、ビットパターン生成回路33、マスクパターン生成回路34、AND回路35、ビット加算器36を備えている。尚、上記階調・度数モジュール31の個数は、前述の第1形態と同様、入力画像におけるサンプル数と階調数とのうち、大きい方の数に見合う個数である。
【0038】
そして、距離データ計算回路4による4×4画素の小領域の代表階調であるシティブロック距離が最小値のときのズレ量と、画像メモリ3aの基本画像データに基づいてビットパターン生成回路33で計算した有効データのビットパターンとが距離データメモリ5にストアされ、この距離データメモリ5からの階調データが階調・度数モジュール31に入力されるとともに、距離データメモリ5のビットパターンデータと、後述するマスクパターン生成回路34からのデータとのAND回路35による論理積がビット加算器36を介して度数データとして階調・度数モジュール31に入力される。
【0039】
また、上記階調・度数モジュール31は、第1形態の階調・度数モジュール11に対し、図7に示すように、第1形態と同様の階調ラッチ13、一致検出回路14、及び、OR回路15に対し、度数カウンタ16に代えて度数ラッチ17を採用し、さらに、加算器18を備えた構成となっている。
【0040】
上記階調ラッチ13のD入力端子、CK端子、EN端子、SET端子には、それぞれ、上記距離データメモリ5からの階調データ、同期クロック、上記制御回路32からのロード信号、装置の初期化を行うクリア信号が入力され、上記一致検出回路14の各入力端子に、上記距離データメモリ5からの階調データと上記階調ラッチ13のQ端子からのラッチデータとが入力される。
【0041】
また、上記度数ラッチ17のD入力端子には、上記ビット加算器36からの度数データと上記度数ラッチ17のQ端子からのラッチデータとを上記加算器18によって加算した値が入力され、上記度数ラッチ17のCK端子、EN端子、CL端子には、それぞれ、同期クロック、上記OR回路15の出力、上記制御回路32からのクリア信号が入力される。上記OR回路15には、上記一致検出回路14からの一致判定信号が入力されるとともに、上記制御回路32からのロード信号が反転入力される。そして、上記一致検出回路14の一致判定信号が上記制御回路32に入力され、上記階調ラッチ13のQ端子から階調データが出力されるとともに上記度数ラッチ17のQ端子から度数データが出力され、上記階調・度数メモリ20にストアされる。
【0042】
以上の構成による本形態のヒストグラム算出装置10Aでは、前述の第1形態と同様、12×6画素の領域を1つの評価単位としてヒストグラム算出処理を行うものの、1つの12×6画素の領域に対し、4×4画素の小領域を一まとめとして扱い、この小領域の代表階調データ(シティブロック距離が最小値のときのズレ量)と前処理で計算した有効データの度数とを階調・度数モジュール31に入力する処理を、j方向、i方向にずらして6回行う。
【0043】
4×4画素の小領域に対する前処理の度数計算は、図8に示すように、画像メモリ3aにストアされている基本画像における4×4画素の小領域の16個のデータに対し、例えば、隣接する画素間の輝度の差が所定の閾値よりも大きいときに1(有効ビット)、閾値よりも小さいときに0のビットパターンをビットパターン生成回路33で生成することで行われる。
【0044】
図8は、基本画像の4×4画素の小領域に対し、1110,1100,1000,0000のビットパターン(EC8OHの2バイトデータ)となる例を示し、1つの小領域に対応して、距離データメモリ5の4バイトの領域にシティブロック距離が最小値のときのズレ量とビットパターンデータとが格納される。すなわち、距離データ計算回路4で計算したシティブロック距離が最小値のときのズレ量が先頭の1バイトの領域に格納され、次の2バイトの領域に上記ビットパターン生成回路33によるビットパターンデータが格納される。最後の1バイトの領域は予備の空の領域である。これにより、距離画像の4×4画素の小領域における16バイトのデータを4バイト(実質的には3バイト)のデータに圧縮することができる。
【0045】
この場合、図9に示すように、12×6画素の領域内で4×4画素の小領域をj方向、i方向にずらしながら前処理を行うわけであるが、j方向にずらした場合、4×4画素の小領域の一部が12×6画素の領域からはみ出してしまい、距離データメモリ5に格納されるデータには、12×6画素の領域外のデータが含まれることになる。
【0046】
そのため、12×6画素の領域外のデータを、マスクパターン生成回路34で生成したマスクパターンによってマスクする。すなわち、12×6画素の領域外となってマスクすべき部分は4×4画素の小領域の下半分の4×2の領域であるため、マスクパターン生成回路34では、図9に示すように、0000,0000,1111,1111(=00FFH)のマスクパターンを生成する。そして、このマスクパターンとビットパターンデータとのビット毎の論理積をAND回路35で取り、ビット加算器36によって有効ビット数のバイトデータ(度数データ)として#1の階調・度数モジュール31#1に出力することで、12×6画素の領域外のデータをマスクすることができる。
【0047】
尚、マスクすべきビットパターンデータは、12×6画素の領域内で4×4画素の小領域をずらす場合、2,4,6番目の小領域から得られるデータであり、これら以外のデータ(1,3,5番目)に対しては、マスクパターン生成回路34で生成するビットパターンは、1111,1111,1111,1111(=FFFFH)のパターンとなり、データのマスクを行わない。
【0048】
次に、以上の前処理を伴う本形態のヒストグラム算出処理について説明する。まず、クリア信号により、前述の第1形態と同様、制御回路32内のモジュール番号カウンタが0にされ、全ての階調・度数モジュール31内の度数ラッチ17が0にされるとともに、階調ラッチ13が初期値(入力階調データの最大値がFFHの場合、100H)にされる。そして、基本画像の4×4画素の小領域に対し、比較画像を用いて距離データ計算回路4で計算したシティブロック距離が最小値のときのズレ量と、ビットパターン生成回路33によるビットパターンデータとが距離データメモリ5に格納される。
【0049】
次いで、制御回路32内部のモジュール番号カウンタがカウントアップされて1となり、#1の階調・度数モジュール31#1内部の階調ラッチ13#1及び度数ラッチ17#1にロード信号が出力されて内部の階調ラッチ13#1及び度数ラッチ17#1がイネーブルとなる。そして、同期クロックにより、最初の小領域の階調データが階調ラッチ13#1に書き込まれるとともに、前処理後の度数データが度数ラッチ17#1に書き込まれる。
【0050】
尚、前述したように、この最初の小領域に対するビットパターンデータに対しては、データをマスクする必要がないため、マスクパターン生成回路34で生成するデータはFFFFHとなり、AND回路35、ビット加算器36を介して階調・度数モジュール31#1に入力される前処理後の度数データは、距離データメモリ5のビットパターンデータの有効ビット数と同じである。
【0051】
次に、12×6画素の領域内で4×4画素の小領域をj方向にずらし、この小領域の一部が12×6画素の領域からはみ出した状態で、再び、ビットパターン生成回路33による処理でデータのビットパターンを求め、そのビットパターンデータを、距離データ計算回路4で計算したシティブロック距離が最小値のときのズレ量とともに距離データメモリ5に格納する。
【0052】
そして、距離データメモリ5から、2番目の小領域の階調データを#1の階調モジュール31#1に出力するとともに、2番目の小領域のビットパターンデータをAND回路35に出力する。このAND回路35には、マスクパターン生成回路34で生成した00FFHのマスクデータが入力されており、2番目の小領域のビットパターンデータとのビット毎の論理積によってビットパターンデータに含まれる12×6画素の領域外のデータがマスクされ、ビット加算器36を介して前処理後の有効ビットの度数データとして#1の階調・度数モジュール31#1に出力される。
【0053】
#1の階調・度数モジュール31#1では、階調ラッチ13#1でラッチした最初の小領域の階調データと今回入力された2番目の小領域の階調データとを一致検出回路14#1で比較し、一致判定信号をOR回路15#1及び制御回路32に出力する。
【0054】
上記一致検出回路14#1の一致判定出力が1のとき、すなわち、ラッチした最初の小領域の階調データと今回入力された2番目の小領域の階調データとが一致するときには、OR回路15#1を介して度数ラッチ17#1がイネーブルとなり、この度数ラッチ17#1でラッチしている度数データと今回入力された度数データ(マスク後度数データ)とが加算器18#1で加算されて度数ラッチ17#1に書き込まれる。
【0055】
一方、一致検出回路14#1の出力が0のとき、すなわち、ラッチしている最初の小領域の階調データと今回入力された2番目の小領域の階調データとが一致しないときには、OR回路15#1を介して度数ラッチ17#1がディスエイブルの状態のままラッチデータが保持される一方、制御回路32では内部のモジュール番号カウンタを2とし、#2の階調・度数モジュール31#2にロード信号を出力する。
【0056】
これにより、#2の階調・度数モジュール31#2内部の階調ラッチ13#2及び度数ラッチ17#2がイネーブルとなり、階調ラッチ13#2に2番目の小領域の階調データが書き込まれるとともに、度数ラッチ17#1に2番目の小領域の度数データ(マスク後データ)が書き込まれる。
【0057】
その後、4×4画素の小領域を最初の位置からi方向にずらし、ビットパターン生成回路33による処理でビットパターンデータを求めると、この3番目の小領域におけるビットパターンデータの計算結果を、距離データ計算回路4で計算したシティブロック距離が最小値のときのズレ量とともに距離データメモリ5に格納する。この3番目の小領域におけるビットパターンデータは、マスクする必要がないため、マスクパターン生成回路34からのデータによってマスクされることなく、ビット加算器36において度数データに変換された後、階調データとともに#1,#2の各階調・度数モジュール31#1,#2に入力される。
【0058】
そして、#1の階調・度数モジュール11#1において、階調ラッチ13#1でラッチされている最初の小領域の階調データと今回入力された3番目の小領域の階調データとが一致検出回路14#1によって比較され、#2の階調・度数モジュール11#2において、階調ラッチ13#2でラッチされている2番目の小領域の階調データと今回入力された3番目の小領域の階調データとが一致検出回路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に書き込まれる。
【0060】
一方、3番目の小領域の階調データが最初の小領域の階調データ及び2番目の小領域の階調データのいずれとも一致しないときには、制御回路32内部のモジュール番号カウンタが3となって#3の階調・度数モジュール31#3にロード信号が出力され、階調・度数モジュール31#3内部の階調ラッチ13#3及び度数ラッチ17#3がイネーブルとなって階調ラッチ13#3に3番目の小領域の階調データが書き込まれるとともに、度数ラッチ17#3に3番目の小領域の度数データが書き込まれる。
【0061】
その後、4番目の小領域、5番目の小領域、6番目の小領域のデータを、同様にして処理し、1つの12×6の領域に対する処理が終了すると、#1の階調・度数モジュール11#1から順に階調及び度数データを読み出して階調・度数メモリ20にストアしてゆき、度数が0のモジュールで動作を停止してクリア信号による再初期化を行い、次の12×6の領域の処理に移る。
【0062】
すなわち、図10のタイムチャートに示すように、階調データと前処理で計算した度数データとを各モジュールの入力データとして各モジュールでラッチしておき、入力された階調データが過去にラッチした階調データと一致する場合、そのモジュールでラッチしている度数データに新たな度数データを加算して再ラッチすることで度数データを蓄積する。
【0063】
一方、過去に階調データがラッチされたどのモジュールでもデータが一致しない場合には、制御回路32内部のモジュール番号カウンタがカウントアップされて新しいモジュールにロード信号が出力され、新しい階調データ及び度数データが新しいモジュールにラッチされる過程を繰り返し、入力画像の全ての種類の階調データ及び前処理後の度数データが次々とラッチされ、度数データが蓄積されてゆくのである。
【0064】
本形態においては、度数0の無駄なアクセス発生による処理速度の低下を回避することができるばかりでなく、決まった小領域で必ず同じ階調データが得られる距離画像のような多階調画像に対し、前処理回路で小領域内のデータの度数を計数するため、さらに処理速度を向上することができる。
【0065】
【発明の効果】
以上説明したように本発明によれば、複数の回路モジュールを並列接続し、各回路モジュール内で、それぞれ階調データを保持し、新たに入力された階調データと保持した階調データとが一致するか否かを判定してデータが一致する場合、保持した階調データの度数を積算するため、度数0の無駄なアクセス発生による処理速度の低下を回避して後段の処理にヒストグラムデータを高速で受け渡すことができ、システム全体のスループットを向上して画像処理のリアルタイム化を図ることができる等優れた効果が得られる。
【図面の簡単な説明】
【図1】本発明の実施の第1形態に係わり、ヒストグラム算出装置の全体構成図
【図2】同上、自己加算型階調・度数モジュールの回路ブロック図
【図3】同上、基本画像と比較画像との比較による距離データの説明図
【図4】同上、ヒストグラム算出のための領域設定を示す説明図
【図5】同上、各モジュール毎の処理を示すタイムチャート
【図6】本発明の実施の第2形態に係わり、ヒストグラム算出装置の全体構成図
【図7】同上、自己加算型階調・度数モジュールの回路ブロック図
【図8】同上、ビットパターンによる度数計算の説明図
【図9】同上、マスクパターンによるデータのマスクを示す説明図
【図10】同上、各モジュール毎の処理を示すタイムチャート
【符号の説明】
10,10A…ヒストグラム算出装置
11,31 …自己加算型階調・度数モジュール(回路モジュール)
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a multi-tone image density histogram calculation apparatus that calculates a multi-tone image density histogram at high speed using a hardware circuit.
[0002]
[Prior art]
Conventionally, in order to calculate a density histogram from a multi-tone image, a software process by a computer is often adopted. In this software process, density data (gray scale) is obtained from an image memory storing multi-tone image data. In general, the procedure of reading 1) and adding 1 to the memory storing the frequency corresponding to the read density data is repeated.
[0003]
In this case, in order to support a multi-tone image signal of a wide sample area, it is necessary to reserve a memory area corresponding to the number of gradations × the number of samples. In software processing, processing for these memory areas is performed. Since it is performed sequentially, it takes enormous processing time, and it is difficult to obtain a histogram in real time.
[0004]
In order to cope with this, Japanese Patent Application Laid-Open No. 61-153771 discloses a number of gate circuits corresponding to each density value of the gradation signal and a counter for counting the frequency of each density value by the output of each gate circuit. A technique for obtaining a density histogram of an image signal at high speed by providing the image signal is disclosed.
[0005]
[Problems to be solved by the invention]
However, in the above prior art, it is necessary to read the values of all counters in order to obtain a histogram, and data of frequency 0 is randomly mixed therein, and many unnecessary accesses of frequency 0 occur. 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 there are a lot of data of frequency 0 in them at random.
[0006]
For this reason, 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, which may reduce the throughput of the entire system.
[0007]
The present invention has been made in view of the above circumstances, and provides a density histogram calculation device for a multi-tone image that can solve a decrease in processing speed due to occurrence of useless access of frequency 0 and can calculate a density histogram at high speed. The purpose is to do.
[0008]
[Means for Solving the Problems]
According to the first aspect of the present invention, a circuit for holding each gradation data of a multi-tone image signal, a circuit for determining whether or not newly inputted gradation data matches the held gradation data, Connect multiple circuit modules in parallel with a circuit that integrates the frequency of the stored grayscale data based on the coincidence determination signal from this circuit. Then, the multi-gradation image is a distance distribution image obtained by dividing the image into a plurality of small regions with respect to a set of images obtained by capturing the subject from different positions, and obtaining a shift amount in units of small regions by stereo matching. There is provided a preprocessing circuit for obtaining the frequency of the effective data in the small area and outputting the frequency and gradation data having the shift amount of the small area unit as a representative gradation to the circuit module. It is characterized by that.
[0011]
Claim 2 The described invention A circuit for holding each gradation data of the multi-gradation image signal, a circuit for judging whether or not the newly inputted gradation data matches the held gradation data, and a coincidence determination signal from this circuit A plurality of circuit modules having a circuit for integrating the frequency of the stored gradation data are connected in parallel, Further, the gradation data is sequentially stored in the plurality of circuit modules, and only when the data mismatch determination signal is output from all the circuit modules that previously stored the gradation data, A control circuit for holding the input gradation data in the next circuit module is provided.
[0012]
That is, according to the first aspect of the present invention, a plurality of circuit modules are connected in parallel, and the gradation data is held in each circuit module, and the newly input gradation data and the held gradation data match. If the data match when it is determined whether or not to do so, the density histogram is calculated at high speed by integrating the frequency of the stored gradation data.
[0013]
And When the multi-tone image is a distance distribution image obtained by obtaining a shift amount in small area units by stereo matching, a pre-processing circuit is provided for the circuit module, and the pre-processing circuit determines the frequency of effective data in the small area. Then, this frequency and the gradation data having the deviation amount of the small area unit as the representative gradation are output to the circuit module. Further, when the gradation data is held in a plurality of circuit modules, the claims 2 As described in the above, the control circuit that holds the input grayscale data at that time in the next circuit module only when the data mismatch determination signal is output from all the circuit modules that previously held the grayscale data. It is desirable to provide it.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. 1 to 5 relate to a first embodiment of the present invention, FIG. 1 is an overall configuration diagram of a histogram calculation apparatus, FIG. 2 is a circuit block diagram of a self-addition type gradation / frequency module, and FIG. 3 is a basic image. FIG. 4 is an explanatory diagram illustrating distance setting by comparison with a comparative image, FIG. 4 is an explanatory diagram illustrating region setting for calculating a histogram, and FIG. 5 is a time chart illustrating processing for each module.
[0015]
In FIG. 1, reference numeral 10 denotes a histogram calculation apparatus that processes multi-gradation image data to calculate a density histogram, and histogram data including gradation data and its frequency data is output to the gradation / frequency memory 20. Is done.
[0016]
In this embodiment, the input data to the histogram calculation device 10 is a distance image obtained by processing a pair of stereo images captured by a pair of CCD cameras 1a and 1b, and this distance image is the CCD camera 1a. , 1b are converted into digital images of predetermined luminance gradations (for example, 256 gradation gray scales) by A / D converters 2a, 2b, respectively, and stored in image memories 3a, 3b. These basic images and comparison images in the image memories 3a and 3b are generated by stereo matching processing.
[0017]
Stereo matching processing of the basic image and the comparison image is performed by the distance data calculation circuit 4. The distance data calculation circuit 4 searches the basic image and the comparison image stored in the image memories 3a and 3b for a portion where the same object is shown for each minute region, and determines the matching degree of the corresponding position. The city block distance calculation unit that calculates the city block distance for evaluation, the minimum / maximum value detection unit that detects the minimum and maximum values of the city block distance, and the minimum value obtained by this minimum / maximum value detection unit The distance distribution data, which is an output of the deviation amount determination unit, is configured by a deviation amount determination unit that checks whether or not each of the small areas in the image and the comparison image indicates coincidence and determines the deviation amount. Is stored in the distance data memory 5.
[0018]
That is, when the upper left corner 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 a pixel, the image is divided into small areas of 4 × 4 pixels, for example, as shown in FIG. For each small area of each image, the city block distance Z (= Σ | Ai, based on the difference between the i, jth luminance Ai, j of the basic image and the i, jth luminance Bi, j of the comparative image The position where j-Bi, j |: i, j = 0 to 3), that is, the corresponding position is obtained, and the amount of deviation of this corresponding position (the amount of deviation when the city block distance is the minimum value; 20H in FIG. 4) ) Is stored in the distance data memory 5 as distance distribution data.
[0019]
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 Laid-Open No. 5-1114099 previously filed by the present applicant.
[0020]
On the other hand, the histogram calculation apparatus 10 includes n self-addition type gradation / frequency modules 11 of # 1 to #n connected in parallel, and a control circuit 12 that controls the operation of each gradation / frequency module 11. The gradation / frequency module 11 is used as much as the larger of the number of samples and the number of gradations in the input image.
[0021]
As shown in FIG. 2, each gradation / frequency module 11 includes a gradation latch 13, a comparator coincidence detection circuit 14, an OR circuit 15, and a frequency counter 16. The grayscale data from the distance data memory 5, the synchronous clock, and the load signal (latch enable signal) from the control circuit 12 are respectively input to the D input terminal, CK terminal, EN terminal, and SET terminal of the grayscale latch 13. A clear signal for initializing the device is input, and gradation data from the distance data memory 5 and latch data from the Q terminal of the gradation latch 13 are input to each input terminal of the coincidence detection circuit 14. Is done.
[0022]
Further, a synchronous clock, an output of the OR circuit 15 and a clear signal from the control circuit 12 are input to the CK terminal, EN terminal, and CL terminal of the frequency counter 16, respectively. The OR circuit 15 is supplied with the coincidence determination signal from the coincidence detection circuit 14 and with the load signal from the control circuit 12 inverted. Then, the coincidence determination signal of the coincidence detection circuit 14 is input to the control circuit 12, and gradation data is output from the Q terminal of the gradation latch 13, and frequency data is output from the Q terminal of the frequency counter 16. Are stored in the gradation / frequency memory 20.
[0023]
As shown in FIG. 4, the calculation of the density histogram by the histogram calculation apparatus 10 divides the distance image into, for example, 12 × 6 pixel areas, and is performed for each area. Each piece of data in each area is given to the gradation / frequency module 11 and the frequency is counted. Hereinafter, the operation of the histogram calculation apparatus 10 will be described.
[0024]
First, initialization is performed when calculating a histogram. In this initialization, the module number counter in the control circuit 12 for designating the number of the gradation / frequency module 11 for latching data is set to 0, and all the gradation / frequency modules 11 are set by the clear signal. The frequency counter 16 is set to 0 and the gradation latch 13 is set to an 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]
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 gradation / frequency module 11 # 1 (hereinafter referred to as the module number is attached as a subscript # 1). The load signal is output to the gray scale latch 13 # 1 in 1 to #n) and the load signal is output to the frequency counter 16 # 1 via the OR circuit 15 # 1. As a result, the gray scale latch 13 # 1 is enabled and the first gray scale data is written and latched by the synchronous clock, and the frequency counter 16 # 1 is enabled and stored in the frequency counter 16 # 1 by the synchronous clock. 1 is added to make the count value 1.
[0026]
Next, when the second gradation data is input to the gradation / frequency module 11 # 1, the gradation / frequency module 11 # 1 receives the first gradation data latched by the internal gradation latch 13 # 1. And the second gradation data are compared by the coincidence detection circuit 14 # 1, and a coincidence determination signal is output to the OR circuit 15 # 1 and the control circuit 12. This coincidence determination signal is a signal 1 when the data coincides and 0 when the data do not coincide. When the output of the coincidence detection circuit 14 # 1 is 1, that is, the first gradation data and the second gradation data. When the grayscale data matches, the frequency counter 16 # 1 is enabled via the OR circuit 15 # 1, and 1 is added by the synchronous clock to make the count value 2.
[0027]
On the other hand, when the output of the coincidence detection circuit 14 # 1 is 0, that is, when the first gradation data and the second gradation data do not coincide, the frequency counter 16 # 1 is turned off via the OR circuit 15 # 1. The count value of the frequency counter 16 # 1 is maintained at 1 while being in the enabled state, while the control circuit 12 sets the internal module number counter to 2 and sends a load signal to the gradation / frequency module 11 # 2 of # 2. Output. This enables the gradation latch 13 # 2 and the frequency counter 16 # 2 of the gradation / frequency module 11 # 2, and the second gradation data is written to the gradation latch 13 # 2 by the synchronous clock and the frequency counter 16 # 2 is set to 1.
[0028]
Thereafter, the third gradation data is input to the gradation and frequency modules 11 # 1 and # 2 of # 1 and # 2, and as described above, each of the coincidence detection circuits 14 # 1 and # 2 It is compared with the latched gradation data. That is, in the # 1 gradation / frequency module 11 # 1, the first gradation data latched by the gradation latch 13 # 1 and the third gradation data input this time are matched by the coincidence detection circuit 14 # 1. In the # 2 gradation / frequency module 11 # 2, the second gradation data latched by the gradation latch 13 # 2 and the third gradation data inputted this time are matched detection circuit 14 #. Compared by two.
[0029]
When the third gradation data matches the first gradation data, 1 is added to the frequency counter 16 # 1 in the # 1 gradation / frequency module 11 # 1, and the third gradation data is added. When the data matches the second gradation data, the frequency counter 16 # 1 in the # 1 gradation / frequency module 11 # 1 is not counted up, and the # 2 gradation / frequency module 11 # 2 is not counted up. 1 is added to the internal frequency counter 16 # 2 and counted up.
[0030]
When the third gradation data does not match either the first gradation data or the second gradation data, the frequency counter 16 # 1 in the # 1 gradation / frequency module 11 # 1 and ## None of the frequency counter 16 # 2 in the 2 gradation / frequency module 11 # 2 is counted up, and the module number counter in the control circuit 12 becomes 3, so that the gradation / frequency module 11 # 3 in # 3 A load signal is output. Then, the gradation latch 13 # 3 and the frequency counter 16 # 3 inside the # 3 gradation / frequency module 11 # 3 are enabled, and the third gradation data is written in the gradation latch 13 # 3 and the frequency is written. 1 is added to the counter 16 # 3 to set the count value to 1.
[0031]
That is, as shown in the time chart of FIG. 5, each time grayscale data is input, a match determination is performed in each module for which the grayscale data has been latched in the past. The module number counter in the control circuit 12 is incremented only when the coincidence determination signals from the respective modules are all 0, that is, when the data does not coincide in any module for which gradation data has been latched in the past. A load signal is output to the module, and new gradation data is latched in the new module. By repeating such a process, all kinds of gradation data of the input image are latched one after another, and the frequency is counted.
[0032]
When the frequencies of all the gradation data in the 12 × 6 area are counted in this way, the gradation data and the frequencies are sequentially read out from the # 1 gradation / frequency module 11 # 1 and stored in the gradation / frequency memory 20. Then, the process ends with the module in which the frequency is 0 and the gradation data is the initial value. Then, after reinitialization by the clear signal, the process proceeds to the next 12 × 6 area.
[0033]
That is, in the process of reading out the gradation data and the frequency in order from the module # 1, there is no frequency 0 module between the frequency modules, and when the frequency 0 module appears, the histogram data ends. . As a result, it is possible to avoid a decrease in processing speed due to occurrence of useless access with frequency 0, and to transfer histogram data at a high speed to the subsequent processing to improve the throughput of the entire system and to achieve real-time image processing. it can.
[0034]
FIGS. 6 to 10 relate to the second embodiment of the present invention, FIG. 6 is an overall configuration diagram of a histogram calculation apparatus, FIG. 7 is a circuit block diagram of a self-addition type gradation / frequency module, and FIG. FIG. 9 is an explanatory diagram showing frequency calculation, FIG. 9 is an explanatory diagram showing masking of data by a mask pattern, and FIG. 10 is a time chart showing processing for each module.
[0035]
In this embodiment, as in stereo image processing, a shift amount (gradation data) in units of small areas (for example, 4 × 4 pixels) is obtained as an average value (representative gradation data) of the entire small area, and distance data and In other words, when the same gradation data is always obtained in a small area such as a distance image, a pre-processing circuit for pre-processing data in the small area is provided to improve the processing speed. It is.
[0036]
That is, for each 4 × 4 pixel small area of the basic image stored in the image memory 3a, the city block distance is calculated from the comparison image stored in the image memory 3b to obtain distance distribution data. In parallel with this process, the frequency of the effective data for calculating the distance distribution data in the 4 × 4 pixel small area of the basic image is calculated in advance, and the representative gradation data (city) for each 4 × 4 pixel small area is calculated. A histogram calculation process substantially similar to that of the first embodiment described above is performed using the deviation amount when the block distance is the minimum value) and the frequency as input data.
[0037]
Therefore, in the histogram calculation apparatus 10A of this embodiment, as shown in FIG. 6, the operations of the n self-addition type gradation / frequency modules 31 of # 1 to #n connected in parallel and the gradation / frequency modules 31 are performed. In addition to a control circuit 32 for controlling the above, a pre-processing circuit includes a bit pattern generation circuit 33, a mask pattern generation circuit 34, an AND circuit 35, and a bit adder 36. Note that the number of gradation / frequency modules 31 is the number corresponding to the larger one of the number of samples and the number of gradations in the input image, as in the first embodiment.
[0038]
Then, the bit pattern generation circuit 33 based on the shift amount when the city block distance, which is the representative gradation of the small area of 4 × 4 pixels, by the distance data calculation circuit 4 is the minimum value and the basic image data of the image memory 3a. The calculated bit pattern of the effective data is stored in the distance data memory 5, and the gradation data from the distance data memory 5 is input to the gradation / frequency module 31, and the bit pattern data in the distance data memory 5 A logical product obtained by AND circuit 35 and data from a mask pattern generation circuit 34 to be described later is input to the gradation / frequency module 31 as frequency data via a bit adder 36.
[0039]
The gradation / frequency module 31 is different from the gradation / frequency module 11 of the first embodiment as shown in FIG. 7 in the gradation latch 13, the coincidence detection circuit 14, and the OR as in the first embodiment. The circuit 15 employs a frequency latch 17 instead of the frequency counter 16 and further includes an adder 18.
[0040]
The D input terminal, CK terminal, EN terminal, and SET terminal of the gradation latch 13 have gradation data from the distance data memory 5, a synchronous clock, a load signal from the control circuit 32, and device initialization, respectively. A clear signal is input, and 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.
[0041]
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. A synchronous clock, an output from the OR circuit 15, and a clear signal from the control circuit 32 are input to the CK terminal, EN terminal, and CL terminal of the latch 17, respectively. The OR circuit 15 is supplied with the coincidence determination signal from the coincidence detection circuit 14 and with the load signal from the control circuit 32 inverted. Then, the coincidence determination signal of the coincidence detection circuit 14 is input to the control circuit 32, gradation data is output from the Q terminal of the gradation latch 13, and frequency data is output from the Q terminal of the frequency latch 17. Are stored in the gradation / frequency memory 20.
[0042]
In the histogram calculation apparatus 10A of the present embodiment configured as described above, the histogram calculation processing is performed using a 12 × 6 pixel region as one evaluation unit, as in the first embodiment described above, but one 12 × 6 pixel region is processed. A small area of 4 × 4 pixels is treated as a group, and the representative gradation data of this small area (the amount of deviation when the city block distance is the minimum value) and the frequency of the effective data calculated in the preprocessing are represented by gradation / The process input to the frequency module 31 is performed six times while shifting in the j direction and the i direction.
[0043]
As shown in FIG. 8, the frequency calculation of the preprocessing for the 4 × 4 pixel small area is performed on, for example, 16 pieces of data of the 4 × 4 pixel small area in the basic image stored in the image memory 3a. The bit pattern generation circuit 33 generates a bit pattern of 1 (effective bit) when the difference in luminance between adjacent pixels is larger than a predetermined threshold, and 0 when it is smaller than the threshold.
[0044]
FIG. 8 shows an example of a bit pattern of 1110, 1100, 1000, 0000 (2-byte data of EC8OH) for a small area of 4 × 4 pixels of the basic image, and the distance corresponding to one small area. The amount of deviation and the bit pattern data when the city block distance is the minimum value are stored in the 4-byte area of the data memory 5. That is, the shift amount when the city block distance calculated by the distance data calculation circuit 4 is the minimum value is stored in the first 1-byte area, and the bit pattern data generated by the bit pattern generation circuit 33 is stored in the next 2-byte area. Stored. The last 1-byte area is a spare empty area. As a result, 16-byte data in a small region of 4 × 4 pixels of the distance image can be compressed into 4-byte (substantially 3 bytes) data.
[0045]
In this case, as shown in FIG. 9, pre-processing is performed while shifting a small region of 4 × 4 pixels in the j direction and the i direction within the region of 12 × 6 pixels. A part of the 4 × 4 pixel small region protrudes from the 12 × 6 pixel region, and the data stored in the distance data memory 5 includes data outside the 12 × 6 pixel region.
[0046]
Therefore, data outside the 12 × 6 pixel area is masked by the mask pattern generated by the mask pattern generation circuit 34. That is, the portion to be masked outside the 12 × 6 pixel region is a 4 × 2 region in the lower half of the small region of 4 × 4 pixels. Therefore, the mask pattern generation circuit 34 as shown in FIG. , 0000,0000,1111,1111 (= 00FFH) mask patterns are generated. The AND of each bit of the mask pattern and the bit pattern data is taken by the AND circuit 35, and the bit adder 36 converts the # 1 gradation / frequency module 31 # 1 as byte data (frequency data) of the effective number of bits. To output data outside the region of 12 × 6 pixels.
[0047]
The bit pattern data to be masked is data obtained from the 2nd, 4th, and 6th small areas when shifting the 4 * 4 pixel small area within the 12 * 6 pixel area, and other data ( For the first, third, and fifth), the bit pattern generated by the mask pattern generation circuit 34 is a pattern of 1111, 1111, 1111, 1111 (= FFFFH), and data is not masked.
[0048]
Next, a histogram calculation process according to the present embodiment that includes the above pre-process will be described. First, in response to the clear signal, the module number counter in the control circuit 32 is set to 0, the frequency latches 17 in all the gradation / frequency modules 31 are set to 0, and the gradation latches, as in the first embodiment. 13 is set to an initial value (100H when the maximum value of the input gradation data is FFH). The shift amount 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 generated by the bit pattern generation circuit 33 for the 4 × 4 pixel small area of the basic image. Are stored in the distance data memory 5.
[0049]
Next, the module number counter in the control circuit 32 is incremented to 1, and a load signal is output to the gradation latch 13 # 1 and the frequency latch 17 # 1 in the # 1 gradation / frequency module 31 # 1. The internal gradation latch 13 # 1 and the frequency latch 17 # 1 are enabled. Then, the grayscale data of the first small area is written in the grayscale latch 13 # 1 by the synchronous clock, and the frequency data after the preprocessing is written in the frequency latch 17 # 1.
[0050]
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 bit adder. The frequency data after pre-processing input to the gradation / frequency module 31 # 1 via 36 is the same as the number of effective bits of the bit pattern data in the distance data memory 5.
[0051]
Next, the 4 × 4 pixel small region is shifted in the j direction within the 12 × 6 pixel region, and the bit pattern generation circuit 33 is again in a state where a part of the small region protrudes from the 12 × 6 pixel region. The bit pattern of the data is obtained by the process of, and the bit pattern data is stored in the distance data memory 5 together with the amount of deviation when the city block distance calculated by the distance data calculation circuit 4 is the minimum value.
[0052]
Then, the gradation data of the second small area is output from the distance data memory 5 to the gradation module 31 # 1 of # 1, and the bit pattern data of the second small area is output to the AND circuit 35. The AND circuit 35 receives the 00FFH mask data generated by the mask pattern generation circuit 34, and is included in the bit pattern data by the logical product for each bit with the bit pattern data of the second small area. Data outside the 6 pixel area is masked and output to the # 1 gradation / frequency module 31 # 1 as the frequency data of the pre-processed effective bits via the bit adder.
[0053]
In the # 1 gradation / frequency module 31 # 1, the first small area gradation data latched by the gradation latch 13 # 1 and the second small area gradation data input this time are matched. The comparison is performed at # 1, and the coincidence determination signal is output to the OR circuit 15 # 1 and the control circuit 32.
[0054]
When the coincidence determination output of the coincidence detection circuit 14 # 1 is 1, that is, when the gradation data of the first small area latched matches the gradation data of the second small area inputted this time, the OR circuit The frequency latch 17 # 1 is enabled via 15 # 1, and the frequency data latched by the frequency latch 17 # 1 and the frequency data (the frequency data after masking) input this time are added by the adder 18 # 1. And written in the frequency latch 17 # 1.
[0055]
On the other hand, when the output of the coincidence detection circuit 14 # 1 is 0, that is, when the gradation data of the first small area latched does not coincide with the gradation data of the second small area input this time, OR The latch data is held via the circuit 15 # 1 while the frequency latch 17 # 1 is disabled. In the control circuit 32, the internal module number counter is set to 2, and the # 2 gradation / frequency module 31 # is set. Output load signal to 2.
[0056]
As a result, the gradation latch 13 # 2 and the frequency latch 17 # 2 inside the # 2 gradation / frequency module 31 # 2 are enabled, and the gradation data of the second small area is written in the gradation latch 13 # 2. At the same time, the frequency data (masked data) of the second small area is written in the frequency latch 17 # 1.
[0057]
Then, when the bit pattern data is obtained by processing the bit pattern generation circuit 33 by shifting the small area of 4 × 4 pixels in the i direction from the first position, the calculation result of the bit pattern data in the third small area is expressed as a distance. The data is stored in the distance data memory 5 together with the shift amount when the city block distance calculated by the data calculation circuit 4 is the minimum value. Since the bit pattern data in the third small area does not need to be masked, it is not masked by the data from the mask pattern generation circuit 34 and is converted into frequency data by the bit adder 36, and then the gradation data. At the same time, it is input to each gradation / frequency module 31 # 1, # 2 of # 1, # 2.
[0058]
Then, in the gradation / frequency module 11 # 1 of # 1, the gradation data of the first small area latched by the gradation latch 13 # 1 and the gradation data of the third small area inputted this time are obtained. Compared by the coincidence detection circuit 14 # 1, the gradation data of the second small area latched by the gradation latch 13 # 2 in the gradation / frequency module 11 # 2 of # 2 and the third input this time Are compared by the coincidence detection circuit 14 # 2.
[0059]
As a result, when the gradation data of the third small area coincides with the gradation data of the first small area, it 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 inputted this time are added by the adder 18 # 1 and written to the frequency latch 17 # 1. Further, when the gradation data of the third small area coincides with the gradation data of the second small area, it 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 inputted this time are added by the adder 18 # 2 and written to the frequency latch 17 # 2.
[0060]
On the other hand, when the gradation data of the third small area does not match 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 becomes 3. The load signal is output to the # 3 gradation / frequency module 31 # 3, and the gradation latch 13 # 3 and the frequency latch 17 # 3 in the gradation / frequency module 31 # 3 are enabled to enable the gradation latch 13 #. The gradation data of the third small region is written in 3, and the frequency data of the third small region is written in the frequency latch 17 # 3.
[0061]
After that, 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 one 12 × 6 area is completed, the gradation / frequency module of # 1 Gradation and frequency data are read out sequentially from 11 # 1 and stored in the gradation / frequency memory 20, and the operation is stopped at the module whose frequency is 0 and re-initialization is performed by the clear signal. Move on to processing of the area.
[0062]
That is, as shown in the time chart of FIG. 10, the gradation data and the frequency data calculated in the preprocessing are latched in each module as input data of each module, and the inputted gradation data is latched in the past. If it matches the gradation data, the frequency data is accumulated by adding new frequency data to the frequency data latched by the module and re-latching.
[0063]
On the other hand, if the data does not match in any module for which the gradation 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. The process of latching data in a new module is repeated, and all kinds of gradation data and pre-processed frequency data of the input image are latched one after another, and the frequency data is accumulated.
[0064]
In this embodiment, it is possible not only to avoid a decrease in processing speed due to occurrence of unnecessary accesses with frequency 0, but also to a multi-gradation image such as a distance image in which the same gradation data can always be obtained in a fixed small area. On the other hand, since the frequency of data in the small area is counted by the preprocessing circuit, the processing speed can be further improved.
[0065]
【The invention's effect】
As described above, according to the present invention, a plurality of circuit modules are connected in parallel, and gradation data is held in each circuit module, and newly inputted gradation data and held gradation data are obtained. If the data match when it is determined whether or not they match, the frequency of the stored gradation data is integrated, so that a decrease in processing speed due to occurrence of unnecessary access with frequency 0 is avoided, and histogram data is used for subsequent processing. It is possible to transfer at high speed, and it is possible to obtain excellent effects such as improving the throughput of the entire system and achieving real-time image processing.
[Brief description of the drawings]
FIG. 1 is an overall configuration diagram of a histogram calculation apparatus according to a first embodiment of the present invention.
FIG. 2 is a circuit block diagram of the self-addition type gradation / frequency module.
FIG. 3 is an explanatory diagram of distance data obtained by comparing the basic image with the comparative image.
FIG. 4 is an explanatory diagram showing region setting for calculating a histogram as above.
FIG. 5 is a time chart showing processing for each module as above.
FIG. 6 is an overall configuration diagram of a histogram calculation apparatus according to a second embodiment of the present invention.
FIG. 7 is a circuit block diagram of the self-addition type gradation / frequency module.
FIG. 8 is an explanatory diagram of frequency calculation based on the bit pattern.
FIG. 9 is an explanatory diagram showing a mask of data by a mask pattern as in the above.
FIG. 10 is a time chart showing the processing for each module.
[Explanation of symbols]
10, 10A ... Histogram calculation device
11, 31 ... Self-addition type gradation / frequency module (circuit module)

Claims (2)

多階調画像信号の各階調データを保持する回路と、新たに入力された階調データと保持した階調データとが一致するか否かを判定する回路と、この回路からの一致判定信号により、保持した階調データの度数を積算する回路とを備えた回路モジュールを、複数個並列に接続し、
上記多階調画像を、被写体を異なる位置から撮像した1組の画像に対し、画像を複数の小領域に分割してステレオマッチングにより小領域単位のずれ量を求めた距離分布画像とし、
上記小領域内の有効データの度数を求め、この度数と上記小領域単位のずれ量を代表階調とする階調データとを上記回路モジュールに出力する前処理回路を設けたことを特徴とする多階調画像の濃度ヒストグラム算出装置。
A circuit for holding each gradation data of the multi-gradation image signal, a circuit for judging whether or not the newly inputted gradation data matches the held gradation data, and a coincidence determination signal from this circuit A plurality of circuit modules having a circuit for integrating the frequency of the stored gradation data are connected in parallel ,
The multi-gradation image is a distance distribution image obtained by dividing the image into a plurality of small regions and obtaining a shift amount in small region units by stereo matching with respect to a set of images obtained by capturing the subject from different positions.
A pre-processing circuit is provided that calculates the frequency of valid data in the small area and outputs the frequency and gradation data having a shift amount of the small area unit as a representative gradation to the circuit module. Multi-tone image density histogram calculation device.
多階調画像信号の各階調データを保持する回路と、新たに入力された階調データと保持した階調データとが一致するか否かを判定する回路と、この回路からの一致判定信号により、保持した階調データの度数を積算する回路とを備えた回路モジュールを、複数個並列に接続し、
さらに、上記複数の回路モジュールに対して階調データを順次保持させ、その際、過去に階調データを保持した全ての回路モジュールからデータ不一致の判定信号が出力されたときにのみ、そのときの入力階調データを次の回路モジュールに保持させる制御回路を備えたことを特徴とする多階調画像の濃度ヒストグラム算出装置。
A circuit for holding each gradation data of the multi-gradation image signal, a circuit for judging whether or not the newly inputted gradation data matches the held gradation data, and a coincidence determination signal from this circuit A plurality of circuit modules having a circuit for integrating the frequency of the stored gradation data are connected in parallel,
Further, the gradation data is sequentially stored in the plurality of circuit modules, and only when the data mismatch determination signal is output from all the circuit modules that previously stored the gradation data, A density histogram calculation apparatus for a multi-tone image, comprising a control circuit for holding input tone data in a next circuit module .
JP25356296A 1996-09-25 1996-09-25 Multi-tone image density histogram calculation device Expired - Fee Related JP3880665B2 (en)

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 JPH10105702A (en) 1998-04-24
JP3880665B2 true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013008270A (en) 2011-06-27 2013-01-10 Renesas Electronics Corp Parallel arithmetic unit and microcomputer

Also Published As

Publication number Publication date
JPH10105702A (en) 1998-04-24

Similar Documents

Publication Publication Date Title
GB2254217A (en) Edge detection method and apparatus for an image processing system
JPH03256485A (en) Motion vector detecting circuit
US4982342A (en) Image processor system having multifunction look-up table units
JP4049831B2 (en) Object contour image detection / thinning apparatus and method
JPH02165775A (en) Picture processor
US5060284A (en) Adaptive error diffusion thresholding for document images
US5521987A (en) Image processing method and apparatus employing gray scale images having fewer bits per pixel and gray scale image restoration using small areas of an image window
US5295202A (en) Method and apparatus for replicating a two-color original image with foreground and background colors exchanged
JP3880665B2 (en) Multi-tone image density histogram calculation device
Turton et al. An architecture for enhancing image processing via parallel genetic algorithms and data compression
US20020024525A1 (en) Image encoding apparatus and method
JP2621868B2 (en) Image feature extraction device
JPS613568A (en) Intermediate tone area identification system
JPH03237571A (en) Device for calculating binarizing threshold of image
JP2938217B2 (en) Image processing device
US20110032265A1 (en) Pipelined computing device for connecting contour elements from image data
JPS63280379A (en) Processor for pore like flaw picture
JPS5937770A (en) Picture reduction device
SU1270781A1 (en) Device for recognizing contours of object images
KR0133008B1 (en) Apparatus for discriminating field frame
JPH0351965A (en) Pattern matching processor
JPH1011576A (en) Component shape recognizing method
JPH0213876B2 (en)
JPS6145690A (en) Processor of binary picture
JPH0381345B2 (en)

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