JP3880665B2 - Multi-tone image density histogram calculation device - Google Patents
Multi-tone image density histogram calculation device Download PDFInfo
- 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
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】
請求項2記載の発明は、多階調画像信号の各階調データを保持する回路と、新たに入力された階調データと保持した階調データとが一致するか否かを判定する回路と、この回路からの一致判定信号により、保持した階調データの度数を積算する回路とを備えた回路モジュールを、複数個並列に接続し、さらに、上記複数の回路モジュールに対して階調データを順次保持させ、その際、過去に階調データを保持した全ての回路モジュールからデータ不一致の判定信号が出力されたときにのみ、そのときの入力階調データを次の回路モジュールに保持させる制御回路を備えたことを特徴とする。
【0012】
すなわち、請求項1記載の発明では、複数の回路モジュールを並列接続し、各回路モジュール内で、それぞれ階調データを保持し、新たに入力された階調データと保持した階調データとが一致するか否かを判定してデータが一致する場合、保持した階調データの度数を積算することで、濃度ヒストグラムを高速に算出する。
【0013】
そして、多階調画像がステレオマッチングにより小領域単位のずれ量を求めた距離分布画像である場合、回路モジュールに対して前処理回路を設け、この前処理回路により、小領域内の有効データの度数を求め、この度数と上記小領域単位のずれ量を代表階調とする階調データとを回路モジュールに出力する。また、複数の回路モジュールに階調データを保持させる際には、請求項2に記載したように、過去に階調データを保持した全ての回路モジュールからデータ不一致の判定信号が出力されたときにのみ、そのときの入力階調データを次の回路モジュールに保持させる制御回路を設けることが望ましい。
【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
[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
[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]
[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
[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,
[0016]
In this embodiment, the input data to the
[0017]
Stereo matching processing of the basic image and the comparison image is performed by the distance
[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
[0021]
As shown in FIG. 2, each gradation /
[0022]
Further, a synchronous clock, an output of the
[0023]
As shown in FIG. 4, the calculation of the density histogram by the
[0024]
First, initialization is performed when calculating a histogram. In this initialization, the module number counter in the
[0025]
When the first gradation data is input after the initialization, the module number counter in the
[0026]
Next, when the second gradation data is input to the gradation /
[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
[0028]
Thereafter, the third gradation data is input to the gradation and
[0029]
When the third gradation data matches the first gradation data, 1 is added to the
[0030]
When the third gradation data does not match either the first gradation data or the second gradation data, the
[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
[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 /
[0033]
That is, in the process of reading out the gradation data and the frequency in order from the
[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
[0037]
Therefore, in the
[0038]
Then, the bit
[0039]
The gradation /
[0040]
The D input terminal, CK terminal, EN terminal, and SET terminal of the
[0041]
A value obtained by adding the frequency data from the
[0042]
In the
[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
[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
[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
[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
[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
[0049]
Next, the module number counter in the
[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
[0051]
Next, the 4 × 4 pixel small region is shifted in the j direction within the 12 × 6 pixel region, and the bit
[0052]
Then, the gradation data of the second small area is output from the distance data memory 5 to the
[0053]
In the # 1 gradation /
[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
[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
[0056]
As a result, the
[0057]
Then, when the bit pattern data is obtained by processing the bit
[0058]
Then, in the gradation /
[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 /
[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
[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 /
[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
[0064]
In this embodiment, it is possible not only to avoid a decrease in processing speed due to occurrence of unnecessary accesses with
[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
[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 .
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013008270A (en) | 2011-06-27 | 2013-01-10 | Renesas Electronics Corp | Parallel arithmetic unit and microcomputer |
-
1996
- 1996-09-25 JP JP25356296A patent/JP3880665B2/en not_active Expired - Fee Related
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 | |
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 | |
JPH02105272A (en) | Picture processor | |
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) | ||
JPS6112174A (en) | System for identifying intermediate tone region |
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 |