JP3637927B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP3637927B2
JP3637927B2 JP08167695A JP8167695A JP3637927B2 JP 3637927 B2 JP3637927 B2 JP 3637927B2 JP 08167695 A JP08167695 A JP 08167695A JP 8167695 A JP8167695 A JP 8167695A JP 3637927 B2 JP3637927 B2 JP 3637927B2
Authority
JP
Japan
Prior art keywords
image
divided
area
region
input image
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
JP08167695A
Other languages
Japanese (ja)
Other versions
JPH08249468A (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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
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 Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP08167695A priority Critical patent/JP3637927B2/en
Publication of JPH08249468A publication Critical patent/JPH08249468A/en
Application granted granted Critical
Publication of JP3637927B2 publication Critical patent/JP3637927B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

【0001】
【産業上の利用分野】
この発明は、入力画像中に、ある対象画像が含まれているか否かを判定する画像処理装置に関する。
【0002】
【従来の技術】
イメージスキャナにより読み取られた画像などの入力画像中に、ある対象画像が含まれているか否かを判定する、いわゆる画像認識処理では、一般に、まず、入力画像のどこに、どのような向きで対象画像の候補が存在するかを調べ、次いで、その対象画像の候補と対象画像を、パターンマッチングなどの方法により比較して、入力画像中に対象画像が含まれているか否かを判定する。
【0003】
これは、このように対象画像の候補を抽出しない場合には、例えば、あらかじめ保持している対象画像のパターンから、あらゆる向きのパターンを作成し、そのすべてのパターンで入力画像上を走査して、それぞれのパターンと入力画像のパターンを比較しなければならず、認識処理に要する時間が著しく長くなるなどの不都合をきたすからである。
【0004】
このように、入力画像のどこに、どのような向きで対象画像の候補が存在するかを調べる方法としては、従来、一般的な文字認識における文字の切り出しで用いられているように、既知の背景色、例えば白色に対する入力画像の画素値のヒストグラムを作成して対象画像の候補を抽出する方法や、対象画像の色分布を検出し、その色分布範囲に属する画素数から対象画像の候補を抽出する方法が、考えられている。
【0005】
【発明が解決しようとする課題】
しかしながら、前者の方法は、既知の背景色に対する入力画像の画素値のヒストグラムを作成して対象画像の候補を抽出するので、背景色が未定の任意の入力画像中に対象画像が含まれているか否かを判定する場合には適用することができない欠点がある。
【0006】
また、後者の方法は、色分布の状態のみにより対象画像の候補を抽出するため精度的に難があり、類似する色分布が多く存在する入力画像の場合には多くの対象画像候補が抽出されて、その後の認識処理に無駄な時間がかかってしまう可能性がある。
【0007】
そこで、この発明は、任意の入力画像から対象画像の候補を精度よく抽出することができ、任意の入力画像中に対象画像が含まれているか否かを短時間で判定することができるようにしたものである。
【0008】
【課題を解決するための手段】
この発明では、図1および図18〜20に示して後述する実施例の参照符号を対応させると(ただし、以下では*の上つきは省略する)、
入力画像1bを多数の領域に分割するとともに、それぞれの分割領域の画像方向を抽出する領域分割部40と、
対象画像1aを複数の領域に分割するとともに、それぞれの分割領域の画像方向を抽出することにより得られた、対象画像1aの分割結果と、上記領域分割部40により得られた、入力画像1bの分割結果とから、入力画像1b中に対象画像1aが含まれているか否かを判定する画像認識部60と、
を設け、
上記画像認識部60を、
対象画像1aの複数の分割領域中の指定された分割領域の画像方向にもとづいて、対象画像1aの複数の分割領域の相対的位置関係を検出する手段S41,S42と、
入力画像1bの多数の分割領域中の、対象画像1aの上記指定された分割領域と画素値が同一の、または近似する分割領域を含む、対象画像1aの複数の分割領域の相対的位置関係と同一の、または近似する相対的位置関係を有する複数の分割領域を選出する手段S43,S44,S51〜S55と、
対象画像1aの複数の分割領域と入力画像1bの上記選出された複数の分割領域とを比較して、入力画像1b中に対象画像1aが存在するか否かを判断する手段S56,S62と、
を有するものとする。
【0009】
【作用】
上記のように構成した、この発明の画像処理装置においては、入力画像1bの多数の分割領域中の、対象画像1aの複数の分割領域中の指定された分割領域と画素値が同一の、または近似する分割領域を含む、対象画像1aの複数の分割領域の相対的位置関係と同一の、または近似する相対的位置関係を有する複数の分割領域のみが、対象画像1aの候補として抽出される。
【0010】
したがって、任意の入力画像から対象画像の候補が精度よく抽出され、その限られた少数の対象画像候補の複数の分割領域と対象画像の複数の分割領域とが比較されることにより、任意の入力画像中に対象画像が含まれているか否かが短時間で判定される。
【0011】
【実施例】
図1は、この発明の画像処理装置の一例を示す。この例の画像処理装置は、画像入力部10、画像バッファ21〜23、画像方向検出部30、画像バッファ35、領域分割部40、画像バッファ41、分割領域バッファ50、画像認識部60、操作部70、表示部80、システム制御部90を備える。
【0012】
画像入力部10は、システム内の、原稿上の画像を読み取るイメージスキャナ部、もしくはコンピュータ処理により画像を生成する部分、またはシステム外で生成された画像をシステム内に取り込む部分で、この例では、画像入力部10からは、入力画像としてCIE(国際照明委員会)が推奨するL色空間で表現されたフルカラー画像が得られる。
【0013】
ただし、その明度成分および2つの色度成分の、それぞれ例えば8ビットの多階調(多値)画像データは、それぞれ図面上ではl,a,bと表記し、明細書中では*を省略してl,a,bと表記する。
【0014】
なお、この例は、対象画像についても、その画像が画像入力部10から同じ画像処理装置に取り込まれ、後述するように画像方向が検出されるとともに、領域分割される場合である。したがって、「入力画像」には対象画像を含むことがある。
【0015】
画像バッファ21,22,23は、それぞれ画像入力部10からの入力画像データl,a,bが書き込まれるものである。
【0016】
画像方向検出部30は、画像バッファ21から読み出された入力画像データlから、入力画像の各画素についての画像方向を検出して、画像方向成分d1を抽出するもので、その具体例は後述する。画像バッファ35は、画像方向検出部30からの画像方向成分d1が書き込まれるものである。
【0017】
領域分割部40は、図示していないがCPUや、そのCPUが実行すべき領域分割制御プログラムなどが書き込まれたROMなどを有し、画像バッファ21,22,23から読み出された入力画像データl,a,b、システム制御部90から画像バッファ21〜23に対する読み出しアドレスなどとして得られる、入力画像上の各画素のXY座標値x,y、および画像バッファ35から読み出された画像方向成分d1を用いて、後述するように入力画像を領域分割する。
【0018】
画像バッファ41は、領域分割部40での領域分割の過程で得られる、入力画像の各画素と各分割領域との対応関係が書き込まれるものである。
【0019】
分割領域バッファ50は、領域分割部40での領域分割の過程および結果が分割領域テーブルとして書き込まれるものである。
【0020】
画像認識部60は、図示していないがCPUや、そのCPUが実行すべき画像認識制御プログラムなどが書き込まれたROMなどを有し、分割領域バッファ50の分割領域テーブルに記述された、対象画像の分割結果と、対象画像が含まれているか否かが判定されるべき入力画像の分割結果とから、後述するように、その入力画像中に対象画像が含まれているか否かを判定するものである。
【0021】
操作部70は、例えば表示部80に表示された、対象画像の分割結果のデータを見て、オペレータが対象画像の分割結果の複数の分割領域中の特定の分割領域を指定するなどの操作をするものである。
【0022】
表示部80は、例えば対象画像の分割結果のデータや入力画像中に対象画像が含まれているか否かの判定結果などを表示するものである。
【0023】
システム制御部90は、図示していないがCPUや、そのCPUが実行すべきシステム制御プログラムなどが書き込まれたROMなどを有し、システム各部を制御する。
【0024】
図2は、画像方向検出部30の一例で、電子技術総合研究所研究報告第835号第80頁に記載された方法を利用した場合である。
【0025】
すなわち、図1に示した画像バッファ21から読み出された入力画像データlがブロック化回路31に供給されて、ブロック化回路31から、入力画像の図3(A)に示すような注目画素Peを中心とする3×3画素である画素Pa〜Piからなる画素群Gpについての、図3(B)に示すような9個の画像データla〜liからなる画像データ群Gdが取り出され、これが畳み込み演算回路32および33に供給されて、それぞれ画素群Gpの画素Pa〜Piに対する図示するような値の係数からなる係数群KhおよびKvにより畳み込み演算されて、畳み込み演算回路32および33から、それぞれ、
CC=la・(−1)+lb・(−1)+……+li・1 …(1)
LL=la・(−1)+lb・0+……+li・1 …(2)
で表される出力が得られる。
【0026】
入力画像の画像方向とは、入力画像の濃度を等高線表示したときの等高線の方向で、この例は、入力画像データlの値を入力画像の濃度とするものである。そして、係数群Khは水平方向の画像方向の検出用であり、係数群Kvは垂直方向の画像方向の検出用である。
【0027】
さらに、画像方向検出部30においては、畳み込み演算回路32および33の出力CCおよびLLが演算回路34に供給されて、図4に示すように、
α=arctan(LL/CC) …(3)
とするとき、それぞれ、

Figure 0003637927
で表される4ビット成分が算出される。
【0028】
成分daは、入力画像データlから抽出された画像方向成分の向き、すなわち入力画像の濃度を等高線表示したときの等高線の方向を、da=0からda=15までの16段階で示すもので、等高線の方向は向きを考える必要がないので、その等高線の方向、すなわち入力画像の画像方向は、図5に示すように0からπまでの範囲として示されれば十分なものである。
【0029】
成分dbは、入力画像データlから抽出された画像方向成分の大きさ、すなわち入力画像の濃度を等高線表示したときの注目画素における等高線とこれと隣り合う等高線との間の濃度差を、db=0からdb=15までの16段階で示すもので、出力CCの2乗と出力LLの2乗の和に対して1を加えたものの対数値とすることによって、出力CCおよびLLが小さいときでも値を持つようにしたものである。
【0030】
具体的に、図3(B)に示した画像データ群Gdが図6(A)または(B)に示すような値であるときには、α=−π/2またはα=π/2となり、da=0となって、注目画素における画像方向が垂直方向であることが検出される。画像データ群Gdが図6(C)または(D)に示すような値であるときには、α=−π/4となり、da=4となって、注目画素における画像方向が左上から右下にかけてのπ/4の方向であることが検出される。
【0031】
画像データ群Gdが図6(E)または(F)に示すような値であるときには、α=0となり、da=8となって、注目画素における画像方向が水平方向であることが検出される。画像データ群Gdが図6(G)または(H)に示すような値であるときには、α=π/4となり、da=12となって、注目画素における画像方向が右上から左下にかけての3π/4の方向であることが検出される。
【0032】
図2に示した演算回路34からは、すなわち画像方向検出部30からは、成分daおよびdbが全体として8ビットの画像方向成分d1として出力され、その画像方向成分d1が画像バッファ35に書き込まれる。
【0033】
領域分割部40においては、このように画像方向成分d1が画像バッファ35に書き込まれた後、入力画像全体が、その色および画像方向に応じて領域の形状が変えられるように、例えばK平均アルゴリズムにより領域分割される。
【0034】
K平均アルゴリズムは、入力画像に対してK個の初期領域中心を設定する初期領域分割を含めて、分割された領域が一定の状態に収束するまで数次にわたって領域分割を繰り返し、初期領域分割後の各次の領域分割後において各分割領域の領域中心を計算することにより、分割された領域が一定の状態に収束したか否かを判定するものである。その領域中心としては、一般には各分割領域の重心および代表色値(代表画素値)が設定または計算されるが、この発明の図1の例においては、これに加えて各分割領域の代表画像方向成分を設定または計算する。
【0035】
以下においては、初期領域分割を含む各次の領域分割の繰り返し順位をi(初期領域分割ではゼロの意味でi=o、その後の各次の領域分割ではi=1,2…)とし、各次の領域分割で分割された領域の番号をj(j=1,2,…K)として、初期領域分割を含む各次の領域分割による各分割領域の領域中心をCij、重心をXij,Yij、代表色値をLij,Aij,Bij、代表画像方向成分をDijで、それぞれ示す。ただし、重心Xij,Yij、代表色値Lij,Aij,Bij、および代表画像方向成分Dijの詳細は、後述する。
【0036】
以下、このような画像方向を考慮したK平均アルゴリズムによる、領域分割部40での領域分割の具体的手順を、図7を用いて示す。ただし、図7は領域分割部40が実行する領域分割の全体的な手順を示し、以下の例は領域分割数Kを100とした場合である。
【0037】
まず、ステップS1において、入力画像に対して100個の初期領域中心を設定する。すなわち、画像バッファ21,22,23から読み出された入力画像データl,a,b、画像バッファ35から読み出された画像方向成分d1、およびシステム制御部90から得られた座標値x,yから、例えば図8に示すように入力画像1を互いに等しい画素数の縦横10個ずつの合計100個の領域に分割し、その各分割領域の領域中心Cojとして、すなわち各分割領域の重心Xoj,Yoj、代表色値Loj,Aoj,Boj、および代表画像方向成分Dojとして、各分割領域の中心画素の座標xoj,yoj、中心画素についての入力画像データloj,aoj,boj、および中心画素についての画像方向成分d1ojを求める。
【0038】
ただし、代表画像方向成分Dojについては、これを5ビットデータとして、画像方向成分d1中の4ビット成分dbの中心画素についてのそれdbojが1以上であれば、その中心画素は画像方向を有するものとして、5ビット中の最上位ビットを0にするとともに、下位4ビットとして画像方向成分d1中の4ビット成分daの中心画素についてのそれdaojを取り込み、成分dbの中心画素についてのそれdbojが0であれば、その中心画素は画像方向を持たないものとして、5ビット中の最上位ビットを1にするとともに、下位4ビットをすべて0にして、全体として16の値とする。
【0039】
次に、ステップS2において、上記のように求めた各分割領域の領域中心Coj、すなわち各分割領域の重心Xoj,Yoj(xoj,yoj)、代表色値Loj,Aoj,Boj(loj,aoj,boj)、および代表画像方向成分Dojを、初期分割領域テーブルとして分割領域バッファ50に書き込む。
【0040】
図9は、この初期分割領域テーブルを含む、各次の領域分割後に作成される分割領域テーブルを示し、初期分割領域テーブルではi=oと表現されるものである。
【0041】
次に、ステップS3において、分割領域バッファ50から初期分割領域テーブル、すなわち初期領域中心Cojを読み出し、これと、画像バッファ21,22,23から読み出された入力画像データl,a,b、画像バッファ35から読み出された画像方向成分d1、およびシステム制御部90から得られた座標値x,yとから、入力画像のすべての画素を順次、注目画素Pnとして、その注目画素Pnとすべての初期領域中心Cojとの距離Hojnを、以下のように計算する。nは、入力画像の画素番号である。
【0042】
ただし、この距離計算と、これによる以下のような入力画像の各画素の領域判定は、後述するように、分割された領域が一定の状態に収束するまで、各次の領域分割後に繰り返し行うものである。すなわち、各次の領域分割後には、入力画像のすべての画素を順次、注目画素Pnとして、その注目画素Pnと、その順位の領域分割による新たなすべての領域中心Cijとの距離Hijnを計算する。
【0043】
そこで以下では、初期領域分割を含む各次の領域分割後に共通の手順としての、距離Hijnの計算、およびこれによる入力画像の各画素の領域判定につき示す。ただし、初期領域分割後の各次の領域分割による各分割領域の重心Xij,Yijは、各分割領域内の全画素の座標値x,yの平均値とされ、代表色値Lij,Aij,Bijは、各分割領域内の全画素についての入力画像データl,a,bの平均値とされ、代表画像方向成分Dijは、後述するように各分割領域が顕著な画像方向を有するか否かにより0から15までの値または16の値とされるものである。
【0044】
距離Hijnを計算するために、まず、
Δxijn=xn−Xij …(11)
Δyijn=yn−Yij …(12)
Δlijn=ln−Lij …(13)
Δaijn=an−Aij …(14)
Δbijn=bn−Bij …(15)
で表されるように、各分割領域の重心Xij,Yijおよび代表色値Lij,Aij,Bijと、注目画素Pnの座標xn,ynおよび注目画素Pnについての入力画像データln,an,bnとの差を、個々に求める。
【0045】
画像方向成分については、図5に示したように画像方向が0からπまでの範囲の角度として16段階で表されることから、以下の3つの場合に分けて、各分割領域の代表画像方向成分Dijと画像方向成分d1中の4ビット成分daの注目画素Pnについてのそれdanとの差Δdijnを求める。
【0046】
第1に、代表画像方向成分Dijが16で、かつ画像方向成分d1中の4ビット成分dbの注目画素Pnについてのそれdbnが0であるときには、領域中心Cijも注目画素Pnも画像方向を持たないので、差Δdijnはないものとして、
Δdijn=0 …(16)
とする。
【0047】
第2に、代表画像方向成分Dijが15以下で、かつ成分dbnが1以上であるときには、
Δdijn=|dan−Dij| …(17)
とする。
【0048】
ただし、差Δdijnは、図10(A)に示すように領域中心Cijにおける代表画像方向成分Dijが示す画像方向と注目画素Pnにおける成分danが示す画像方向との角度差βに相当し、その角度差βは図10(B)に示すようにπ/2より小さく、差Δdijnは7以下となるべきであるので、Δdijn=|dan−Dij|≧8となるときには、
Δdijn=15−|dan−Dij| …(18)
とする。
【0049】
第3に、代表画像方向成分Dijが16で、かつ成分dbnが1以上であるとき、または代表画像方向成分Dijが15以下で、かつ成分dbnが0であるときには、すなわち、領域中心Cijと注目画素Pnのいずれか一方のみが画像方向を有し、他方は画像方向を持たないときには、領域中心Cijと注目画素Pnの画像方向が同じときよりは差Δdijnは大きく、すなわち差Δdijnは0ではなく、しかも領域中心Cijと注目画素Pnの画像方向がπ/2ずれるときよりは差Δdijnは小さい、すなわち差Δdijnは8よりは小さいと考えて、0と7の中間をとって、
Δdijn=3.5 …(19)
とする。
【0050】
以上の差Δxijn,Δyijn,Δlijn,Δaijn,Δbijn,Δdijnの算出に加えて、領域の大きさを制御する関数F(Δxijn,Δyijn,Dij)を以下のように定義する。
【0051】
すなわち、図11に示すように、
γ=arctan(Δyijn/Δxijn) …(21)
とし、
Figure 0003637927
とするとき、
|Dij−dcn|≦7のときには、
F(Δxijn,Δyijn,Dij)
=1+ke(|Dij−dcn|/3.5−1) …(23)
とし、
|Dij−dcn|≧8のときには、
F(Δxijn,Δyijn,Dij)
=1+ke{(15−|Dij−dcn|)/3.5−1} …(24)
とする。
【0052】
ただし、dcnは、図11から明らかなように、領域中心Cij(重心Xij,Yij)に対する注目画素Pnの方向を、領域中心Cij(重心Xij,Yij)を中心とするxy座標のy軸に対する角(γ+π/2)として、dcn=0からdcn=15までの16段階で示すもので、方向のみで向きを考えないことによって、角(γ+π/2)は、0からπまでの範囲とするものである。keは、後述するような係数である。
【0053】
式(23)の|Dij−dcn|、および式(24)の(15−|Dij−dcn|)は、それぞれ0以上、7以下となるので、関数F(Δxijn,Δyijn,Dij)は、1を中心に±keの広がりを有し、ke=0では常に1となり、ke=1では0になり得る。そこで、係数keは、0<ke<1とする。
【0054】
このように係数keを定め、領域の大きさを制御する関数F(Δxijn,Δyijn,Dij)を定義して、図7のステップS3においては、入力画像のすべての画素を順次、注目画素Pnとして、その注目画素Pnとすべての領域中心Cijとの距離Hijnを、一般的にzの2乗を「(z)**2」で示すとすると、
Figure 0003637927
で定義して計算する。ただし、kx,kl,ka,kb,kdは、それぞれ任意の係数である。
【0055】
次に、ステップS4に進んで、入力画像の注目画素Pnからみて直前の領域分割による各分割領域の領域中心Cijのうち上記の距離Hijnが最も小さい領域中心を有する分割領域に、その注目画素Pnを含めるように、入力画像を新たに領域分割する。
【0056】
すなわち、直前の領域分割の結果、例えば1番目の分割領域に含められた、ある画素からみて、領域中心Cijとの距離Hijnが最も小さいのは2番目の分割領域であるとすれば、その画素は2番目の分割領域に含めるように、また例えば2番目の分割領域に含められた、ある画素からみて、領域中心Cijとの距離Hijnが最も小さいのは1番目の分割領域であるとすれば、その画素は1番目の分割領域に含めるように、領域分割を修正する。
【0057】
ここで、入力画像の注目画素Pnと直前の領域分割による各分割領域の領域中心Cijとの相対位置と、その領域中心Cijの代表画像方向成分Dijとの関係を、図12に示す。
【0058】
同図から明らかなように、式(23)または(24)で表される関数F(Δxijn,Δyijn,Dij)は、領域中心Cij(重心Xij,Yij)と注目画素Pnを結ぶ直線の方向、すなわち式(22)で表される成分dcnが示す方向が、注目画素Pnが点Pn(0)にあって成分dcnがdcn(0)で表されるときのように代表画像方向成分Dijが示す画像方向と一致するとき、最小となり、上記の直線の方向、すなわち、成分dcnが示す方向が、注目画素Pnが点Pn(π/2)にあって成分dcnがdcn(π/2)で表されるときのように代表画像方向成分Dijが示す画像方向に対してπ/2ずれるとき、最大となる。
【0059】
すなわち、ステップS4においては、直前の領域分割による領域中心Cijに対して、その代表画像方向成分Dijが示す方向にある画素は、その領域中心Cijから離れているものも、その領域中心Cijの分割領域に含まれやすくなるが、その代表画像方向成分Dijが示す方向に対してπ/2ずれた方向にある画素は、その領域中心Cijに近いものも、その領域中心Cijの分割領域に含まれにくくなるように、入力画像が領域分割される。
【0060】
そのため、ステップS4においては、直前の領域分割による各分割領域の形状が、代表画像方向成分Dijが示す方向に沿う形状に変えられる。図13は、このように領域分割が修正され、各分割領域の形状が変えられた状態を示す。
【0061】
次に、ステップS5において、入力画像の注目画素Pnと新たな領域分割による各分割領域との対応関係、すなわち新たな領域分割により入力画像の注目画素Pnが属するとされた分割領域の番号を、画像バッファ41に書き込む。
【0062】
次に、ステップS6に進んで、新たな領域中心を計算する。すなわち、画像バッファ21,22,23から読み出された入力画像データl,a,b、画像バッファ35から読み出された画像方向成分d1、画像バッファ41から読み出された分割領域番号、およびシステム制御部90から得られた座標値x,yから、新たに分割された領域ごとに、重心Xij,Yij、代表色値Lij,Aij,Bij、および代表画像方向成分Dijからなる領域中心Cijを計算し直す。
【0063】
ここで、上述したように、重心Xij,Yijは、各分割領域内の全画素の座標値x,yの平均値とし、代表色値Lij,Aij,Bijは、各分割領域内の全画素についての入力画像データl,a,bの平均値とする。代表画像方向成分Dijは、図14に示す算出手順に従って求める。
【0064】
すなわち、入力画像の画素には複数の画像方向を有するものもあり得るが、はっきり観測できるのは最大でも2方向であり、しかもはっきり観測できる第2の方向があるなら、それは第1の方向に対してほぼπ/2ずれていると考えられることから、まず、ステップS11において、新たに分割された領域ごとに、dbn≧1の条件を満たす画素の中で上記の成分danがそれぞれ0,1,2…15の値となる画素の数N0,N1,N2…N15を計算するとともに、dbn=0である画素の数N16を求める。
【0065】
次に、ステップS12において、最も画素数の多い成分値Dmaxと、その最も多い画素数Nmaxを算出する。ただし、N16が一番大きいときには、Dmax=16とする。さらにステップS13に進んで、Dmax=16であるか否かを判断し、Dmax=16と判断したときには、その領域は画像方向を持たないとして、次にステップS14において、その領域の代表画像方向成分Dijを16とする。
【0066】
ステップS13においてDmax≠16と判断したときには、次にステップS15において、図15(A)または(B)に示すように最も画素数の多い成分値Dmaxが示す方向に対してπ/2ずれた方向を示す、すなわち成分値Dmaxに対して+8または−8ずれた成分値Dmidと、その成分値Dmidとなる画素数Nmidを算出し、さらにステップS16に進んで、画素数Nmaxが画素数Nmidの2倍より多いか否かを判断する。
【0067】
ステップS16において画素数Nmaxが画素数Nmidの2倍以下であると判断したときには、その領域は顕著な画像方向を持たないとして、ステップS13においてDmax=16と判断したときと同様に、次にステップS14において、その領域の代表画像方向成分Dijを16とする。
【0068】
ステップS16において画素数Nmaxが画素数Nmidの2倍より多いと判断したときには、その領域は顕著な画像方向を有するが、近接した方向に2つの方向成分が重なり合っているなど、方向成分が広がって存在していることもあり得るとして、さらにステップS17に進んで、その領域につき以下のような加重平均値Daveを算出して、その加重平均値Daveを、その領域の代表画像方向成分Dijとする。
【0069】
すなわち、図16に示すように、最も画素数の多い成分値Dmaxに対して±1,±2,±3,±4ずれた成分値Dp1,Dm1…Dp4,Dm4と、そのそれぞれの成分値Dp1,Dm1…Dp4,Dm4となる画素数Np1,Nm1…Np4,Nm4を算出し、加重平均値Daveとして、
Dave=(Nm4・Dm4+Nm3・Dm3+Nm2・Dm2+Nm1・Dm1+Nmax・Dmax+Np1・Dp1+Np2・Dp2 +Np3・Dp3+Np4・Dp4)/(Nm4+Nm3+Nm2+Nm1+Nmax+Np1+Np2+Np3+Np4) …(26)
を計算する。
【0070】
ステップS14において代表画像方向成分Dijを16とし、またはステップS17において式(26)の加重平均値Daveを代表画像方向成分Dijとしたときは、さらにステップS18に進んで、すべての領域につき代表画像方向成分Dijを求めたか否かを判断し、いまだ代表画像方向成分Dijを求めていない領域があると判断したときには、ステップS11以下に戻って、次の領域につき上述したように代表画像方向成分Dijを求める。
【0071】
このように、図7のステップS6においては、新たに分割された領域ごとに、重心Xij,Yij、代表色値Lij,Aij,Bij、および代表画像方向成分Dijからなる領域中心Cijを計算し直す。
【0072】
次に、ステップS7において、このように求めた各分割領域の領域中心Cij、すなわち重心Xij,Yij、代表色値Lij,Aij,Bij、および代表画像方向成分Dijを、図9に示したような分割領域テーブルとして、直前の領域分割についての分割領域テーブルを残しておく状態で、分割領域バッファ50に書き込む。
【0073】
次に、ステップS8に進んで、分割領域バッファ50から、この新たな分割領域テーブル、すなわち新たな領域中心と、その前の分割領域テーブル、すなわちその前の領域中心を読み出して、分割領域の番号jが等しいもの同士の間で、それぞれ、新たな領域中心の、その前の領域中心に対するずれ量を、以下のように計算する。
【0074】
ただし、ここでは、新たな領域中心をCij、その重心をXij,Yij、代表色値をLij,Aij,Bij、代表画像方向成分をDijで、それぞれ示すとともに、s=i−1とおいて、その前の領域中心をCsj、その重心をXsj,Ysj、代表色値をLsj,Asj,Bsj、代表画像方向成分をDsjで、それぞれ示し、新たな領域中心Cijの、その前の領域中心Csjに対するずれ量をHsijで示す。
【0075】
ずれ量Hsijを計算するために、まず、
ΔXsij=Xij−Xsj …(31)
ΔYsij=Yij−Ysj …(32)
ΔLsij=Lij−Lsj …(33)
ΔAsij=Aij−Asj …(34)
ΔBsij=Bij−Bsj …(35)
で表されるように、新たな領域中心Cijの重心Xij,Yijおよび代表色値Lij,Aij,Bijと、その前の領域中心Csjの重心Xsj,Ysjおよび代表色値Lsj,Asj,Bsjとの差を、個々に求める。
【0076】
代表画像方向成分については、上述したように領域中心Cij,Csjの代表画像方向成分Dij,Dsjが0から16までの値をとり得ることから、以下の3つの場合に分けて、代表画像方向成分Dijと代表画像方向成分Dsjとの差ΔDsijを求める。
【0077】
第1に、代表画像方向成分DijおよびDsjがともに16であるときには、
ΔDsij=0 …(36)
とする。
【0078】
第2に、代表画像方向成分DijおよびDsjがともに15以下であるときには、
ΔDsij=|Dij−Dsi| …(37)
とする。
【0079】
ただし、差ΔDsijは代表画像方向成分Dijが示す画像方向と代表画像方向成分Dsjが示す画像方向との角度差に相当し、その角度差はπ/2より小さく、差ΔDsijは7以下となるべきであるので、ΔDsij=|Dij−Dsj|≧8となるときには、
ΔDsij=15−|Dij−Dsj| …(38)
とする。
【0080】
第3に、代表画像方向成分DijおよびDsjのいすれか一方のみが16であるときには、代表画像方向成分DijおよびDsjがともに16であるときよりは差ΔDsijは大きく、すなわち差ΔDsijは0ではなく、しかも代表画像方向成分Dijが示す画像方向と代表画像方向成分Dsjが示す画像方向との角度差がπ/2となるときよりは差ΔDsijは小さい、すなわち差ΔDsijは8より小さいと考えて、0と7の中間をとって、
ΔDsij=3.5 …(39)
とする。
【0081】
以上の差ΔXsij,ΔYsij,ΔLsij,ΔAsij,ΔBsij,ΔDsijを算出して、図7のステップS8においては、分割領域の番号jが等しいもの同士の間で、それぞれ、新たな領域中心Cijの、その前の領域中心Csjに対するずれ量Hsijを、一般的にZの2乗を「(Z)**2」で示すとすると、
Hsij
=kx{(ΔXsij)**2+(ΔYsij)**2}
+kl・(ΔLsij)**2
+ka・(ΔAsij)**2
+kb・(ΔBsij)**2
+kd・(ΔDsij)**2 …(40)
で定義して計算する。ただし、kx,kl,ka,kb,kdは、ぞれぞれ任意の係数である。
【0082】
次に、ステップS9に進んで、すべての分割領域についてのずれ量Hsijが1より小さいか否かを判断し、いずれかの分割領域についてのずれ量Hsijが1以上であると判断したときには、各分割領域はいまだ一定の状態に収束していないとして、ステップS3以下に戻る。
【0083】
すなわち、ステップS3において、入力画像のすべての画素を順次、注目画素Pnとして、その注目画素Pnと新たなすべての領域中心Cijとの距離Hijnを式(25)に従って計算し、次にステップS4に進んで、注目画素Pnからみて新たなすべての領域中心Cijのうち距離Hijnが最も小さい領域中心を有する分割領域に、その注目画素Pnを含めるように、入力画像をさらに新たに領域分割し、次にステップS5において、入力画像の注目画素Pnとさらに新たな領域分割による各分割領域との対応関係を画像バッファ41に書き込み、次にステップS6に進んで、さらに新たな領域中心Cijを計算し、次にステップS7において、その求めたさらに新たな領域中心Cijを分割領域テーブルとして分割領域バッファ50に書き込み、次にステップS8に進んで、各分割領域ごとに、そのさらに新たな領域中心Cijの、その前の領域中心Csjに対するずれ量Hsijを式(40)に従って計算する、という一連の手順を繰り返し実行する。
【0084】
そして、ステップS9において、すべての分割領域についてのずれ量Hsijが1より小さいと判断したときには、各分割領域は一定の状態に収束したとして、領域分割を終了する。
【0085】
以上のように、領域分割部40においては、入力画像全体が、その色および画像方向に応じて領域の形状が変えられるように領域分割される。
【0086】
図17は、システム制御部90による、この例の画像処理装置における画像認識の全体的な手順を示す。
【0087】
まず、ステップS31において、操作部70におけるオペレータの指示操作にもとづいて、入力画像データl,a,bとして対象画像1aの画像データを、画像入力部10からシステム内に取り込んで、画像バッファ21,22,23に書き込む。
【0088】
次に、ステップS32において、その対象画像1aの画像データから、画像方向検出部30により対象画像1aの画像方向を検出し、画像方向成分d1を抽出して、その画像方向成分d1を画像バッファ35に書き込む。
【0089】
次に、ステップS33において、領域分割部40により対象画像1aを領域分割し、分割領域バッファ50に対象画像1aの最終的な分割結果の分割領域テーブル51xを形成する。
【0090】
次に、ステップS34において、操作部70におけるオペレータの指示操作にもとづいて、入力画像データl,a,bとして対象画像1aが含まれているか否かが判定されるべき入力画像1bの画像データを、画像入力部10からシステム内に取り込んで、画像バッファ21,22,23に書き込む。
【0091】
次に、ステップS35において、その入力画像1bの画像データから、画像方向検出部30により入力画像1bの画像方向を検出し、画像方向成分d1を抽出して、その画像方向成分d1を画像バッファ35に書き込む。
【0092】
次に、ステップS36において、領域分割部40により入力画像1dを領域分割し、分割領域バッファ50に対象画像1aの最終的な分割結果の分割領域テーブル51xとは別に入力画像1bの最終的な分割結果の分割領域テーブル52xを形成する。
【0093】
次に、ステップS37において、操作部70におけるオペレータの指示操作にもとづいて、画像認識部60により、図18〜図20に示して後述する具体的手順に従って、分割領域テーブル51xおよび52xから、入力画像1b中に対象画像1aが含まれているか否かを判定し、その判定結果を表示部80により表示する。
【0094】
図21は、対象画像1aの最終的な分割結果の例を示し、対象画像1aが200×100画素で、領域分割数Kが3とされて、それぞれ領域中心Ca,Cb,Ccを有する3個の分割領域に領域分割された場合である。
【0095】
この対象画像1aの最終的な分割結果の分割領域テーブル51xには、図23に示すように、分割領域の番号、各分割領域のXY座標値で示された重心、代表色値L,A,B、および代表画像方向成分Dが記述されるとともに、各分割領域の画素数Nが記述される。
【0096】
図22は、入力画像1bの最終的な分割結果の例を示し、入力画像1bが400×200画素で、領域分割数Kが8とされて、それぞれ領域中心C1〜C8を有する8個の分割領域に領域分割された場合である。
【0097】
この入力画像1bの最終的な分割結果の分割領域テーブル52xにも、図24に示すように、分割領域の番号、各分割領域のXY座標値で示された重心、代表色値L,A,B、および代表画像方向成分Dが記述されるとともに、各分割領域の画素数Nが記述される。
【0098】
なお、以下では分割領域を、その番号ではなく領域中心で示す。すなわち、例えば、対象画像1aの領域番号3の分割領域は分割領域Ccと称し、入力画像1bの領域番号7の分割領域は分割領域C7と称する。
【0099】
このように対象画像1aおよび入力画像1bの最終的な分割結果の分割領域テーブル51xおよび52xが形成された後の、図17のステップS37における手順として、画像認識部60は、まず、図18のステップS41において、対象画像1aの分割領域テーブル51xから、対象画像1aの最も特徴的な色の分割領域を選出する。
【0100】
例えば、図17のステップS36において入力画像1bの分割領域テーブル52xが形成された後、システム制御部90におけるシステム制御プログラムにより自動的に、または操作部70におけるオペレータの指示操作により、対象画像1aの分割領域テーブル51x上の各分割領域の代表色値L,A,Bが表示部80に表示される。オペレータが、その表示内容を見て、対象画像1aの最も特徴的な色として認識する、またはあらかじめ知っている画像データ値から、対象画像1aの該当する分割領域の番号を操作部70により指示することによって、画像認識部60は、その指示された番号の分割領域を選出する。
【0101】
または、対象画像1aの分割領域テーブル51xの記述内容が表示部80に表示されることなく、オペレータが、対象画像1aの最も特徴的な色としてあらかじめ知っている画像データ値を操作部70から入力することによって、画像認識部60は、対象画像1aの分割領域テーブル51x上の分割領域のうち、代表色値L,A,Bが、その入力された画像データ値に最も近い分割領域を選出する。
【0102】
図21および図23の例においては、分割領域Ccが対象画像1aの最も特徴的な色の領域として選出されるものとする。
【0103】
次に、ステップS42において、このように選出した分割領域の重心を中心とし、画像方向をθ=0として、分割領域テーブル51x上の各分割領域の重心を極座標で記述し直し、分割領域テーブル51rを形成する。
【0104】
すなわち、図21および図23の例においては、分割領域CcのXY座標値で(60,55)である重心が極座標におけるr=0の中心とされ、D=2である代表画像方向成分が示す図21の矢印の方向がθ=0とされて、分割領域テーブル51x上の各分割領域の重心が極座標値で表現されて、図25に示すような分割領域テーブル51rが形成される。図25で、角度θの単位はラジアンである。
【0105】
次に、ステップS43において、入力画像1bの分割領域テーブル52xから、対象画像1aのステップS41で選出した分割領域の代表色と類似する色を代表色として有する分割領域を検索し、さらにステップS44に進んで、類似する色の分割領域があるか否かを判断する。
【0106】
例えば、入力画像1bの分割領域のうち、代表色値L,A,Bが対象画像1aのステップS41で選出した分割領域の代表色値L,A,Bに対して、それぞれ±10%の範囲内にある分割領域が、検索され、対象画像1aのステップS41で選出した分割領域の色と類似する色の分割領域とされる。
【0107】
ステップS44で類似する色の分割領域がないと判断したときには、入力画像1b中に対象画像1aは含まれていないものとして、ステップS45に進んで、入力画像1b中に対象画像1aが含まれていないことを表示部80により表示して、画像認識の処理を終了する。
【0108】
図21〜図25の例においては、入力画像1bの分割領域C7の代表色値L,A,Bのみが対象画像1aの選出された分割領域Ccの代表色値L,A,Bに対してすべて±10%の範囲内にあることから、分割領域C7のみが分割領域Ccの色と類似する色の分割領域とされる。
【0109】
ステップS44で類似する色の分割領域があると判断したときには、次に図19のステップS51において、その類似する色の分割領域を入力画像1bの分割領域テーブル52xから1つ選出し、さらにステップS52に進んで、その選出した分割領域についての後述する変数Qをゼロにクリアする。
【0110】
図21〜図25の例においては、入力画像1bの分割領域C7のみが対象画像1aの分割領域Ccの色と類似する色の分割領域であるので、ステップS51においては分割領域C7が選出され、ステップS52においては分割領域C7についての変数Qがゼロにクリアされる。
【0111】
次に、ステップS53において、その選出した分割領域の重心を中心とし、画像方向をθ=0として、分割領域テーブル52x上の各分割領域の重心を極座標で記述し直すとともに、その選出した分割領域の代表画像方向成分と対象画像1aのステップS41で選出した分割領域の代表画像方向成分との差Ddを求めて、その差Ddを入力画像1bの各分割領域の代表画像方向成分から減じるように分割領域テーブル52x上の各分割領域の代表画像方向成分を記述し直し、分割領域テーブル52rを形成する。ただし、代表画像方向成分Dは、0以上、16以下とされる。
【0112】
すなわち、図21〜図25の例においては、分割領域C7のXY座標値で(150,139)である重心が極座標におけるr=0の中心とされ、D=6である代表画像方向成分が示す図22の矢印の方向がθ=0とされて、分割領域テーブル52x上の各分割領域の重心が極座標値で表現されるとともに、分割領域C7の代表画像方向成分と分割領域Ccの代表画像方向成分との差Dd=6−2=4が入力画像1bの各分割領域の代表画像方向成分から減じられるように分割領域テーブル52x上の各分割領域の代表画像方向成分が書き換えられて、図26に示すような分割領域テーブル52rが形成される。図26で、角度θの単位はラジアンである。
【0113】
次にステップS54において、その分割領域テーブル52rから、入力画像1bの、位置的に対象画像1aのステップS41で選出した分割領域以外の分割領域に対応する分割領域を検索し、さらにステップS55に進んで、位置的に対象画像1aのステップS41で選出した分割領域以外の分割領域に対応する分割領域がすべてあるか否かを判断する。
【0114】
例えば、分割領域テーブル52r上で、重心の極座標値r,θが分割領域テーブル51r上のステップS41で選出した分割領域以外の分割領域の重心の極座標値r,θに対して、それぞれ±10%の範囲内にある分割領域が、検索され、位置的に対象画像1aのステップS41で選出した分割領域以外の分割領域に対応する分割領域とされる。
【0115】
図21〜図26の例においては、入力画像1bの分割領域C5およびC6の重心の極座標値r,θが、それぞれ対象画像1aの分割領域CaおよびCbの重心の極座標値r,θに対して±10%の範囲内にあることから、位置的に対象画像1aのステップS41で選出した分割領域以外の分割領域に対応する分割領域がすべてあると判断される。
【0116】
ステップS55で対応する分割領域がすべてあると判断したときには、次にステップS56に進んで、対象画像1aの各分割領域と、これと位置的に対応する入力画像1bの複数の分割領域との、それぞれ位置的に対応するもの同士の間の類似度を計算して、それぞれの計算結果により、ステップS52においてゼロにクリアした変数Qを更新する。
【0117】
対象画像1aのある分割領域と、これと位置的に対応する入力画像1bの分割領域との間の類似度Qnは、対象画像1aのある分割領域の代表色値L,A,BをLa,Aa,Ba、代表画像方向成分DをDa、画素数NをNa、これと位置的に対応する入力画像1bの分割領域の代表色値L,A,BをLb,Ab,Bb、代表画像方向成分DをDb、画素数NをNbとして、一般的にzの2乗を「(z)**2」で示すとすると、
Qn
=(La−Lb)**2+(Aa−Ab)**2+(Ba−Bb)**2
+kd(Da−Db)**2+kn(Na−Nb)**2 …(41)
で定義して計算する。ただし、kd,knは、それぞれ任意の係数である。
【0118】
図21〜図26の例においては、対象画像1aの分割領域Caと入力画像1bの分割領域C5との間の類似度Q1、対象画像1aの分割領域Cbと入力画像1bの分割領域C6との間の類似度Q2、および対象画像1aの分割領域Ccと入力画像1bの分割領域C7との間の類似度Q3が、それぞれ計算されて、変数Qが、
Q=Q1+Q2+Q3 …(42)
とされる。
【0119】
ステップS55で対応する分割領域がすべてはないと判断したときには、次にステップS57に進んで、入力画像1bのステップS51で選出した分割領域についての変数Qを、後述する所定値Qoより大きい所定値Qmにする。
【0120】
ステップS56で上記のように変数Qを更新し、またはステップS57で変数Qを所定値Qmにした後は、図20のステップS61に進んで、入力画像1bの分割領域中に、対象画像1aのステップS41で選出した分割領域の色と類似する色の分割領域がほかにもあるか否かを判断し、ほかにもあると判断したときには、図19のステップS51以下に戻って、その類似する色のほかの分割領域を入力画像1bの分割領域テーブル52xから1つ選出し、さらにその選出した分割領域についての上記の変数Qをゼロにクリアするなど、その類似する色のほかの分割領域につき、上記の処理を実行する。
【0121】
ただし、図21〜図26の例は、上述したように、入力画像1bの分割領域C7のみが対象画像1aのステップS41で選出した分割領域Ccの色と類似する色の分割領域であるので、ステップS51以下に戻らない。
【0122】
ステップS61で類似する色の分割領域はほかにないと判断したときには、次にステップS62に進んで、類似する色の各分割領域についての変数Qが、すべて所定値Qo以上であるか否かを判断し、すべて所定値Qo以上であると判断したときには、入力画像1bのいずれの位置にも対象画像1aは含まれていないものとして、図18のステップS45に進んで、入力画像1b中に対象画像1aが含まれていないことを表示部80により表示して、画像認識の処理を終了する。
【0123】
ステップS62で類似する色の少なくとも1つの分割領域についての変数Qが所定値Qoより小さいと判断したときには、入力画像1bのいずれかの位置に対象画像1aが含まれているものとして、ステップS63に進んで、入力画像1b中に対象画像1aが含まれていることを表示部80により表示して、画像認識の処理を終了する。
【0124】
図21〜図26の例においては、入力画像1bの分割領域C7のみが対象画像1aのステップS41で選出した分割領域Ccの色と類似する色の分割領域であり、かつ上述したように位置的に入力画像1bの分割領域C5,C6,C7が対象画像1aの分割領域Ca,Cb,Ccに対応するので、式(42)で表される変数Qが所定値Qoより小さいか否かによって、入力画像1b中に対象画像1aが含まれているか否かの判定が分かれることとなる。
【0125】
例えば、所定値Qoは、上記の式(41)の係数kd,knがkd=10,kn=0.001とされるとき、Qo=100とされる。したがって、図21〜図26の例においては、式(42)で表される変数Qが所定値Qoより小さくなり、入力画像1b中に対象画像1aが含まれていると判定されることとなる。
【0126】
上述した例によれば、入力画像1bの多数の分割領域中の、対象画像1aの複数の分割領域中の指定された分割領域と代表色値L,A,Bが同一の、または近似する分割領域を含む、対象画像1aの複数の分割領域の相対的位置関係と同一の、または近似する相対的位置関係を有する複数の分割領域のみが、対象画像1aの候補として抽出される。
【0127】
すなわち、図21〜図26の例においては、入力画像1bの分割領域C1〜C8中の、対象画像1aの分割領域Ca,Cb,Cc中の対象画像1aの最も特徴的な色の領域として指定された分割領域Ccに対して代表色値L,A,Bが一定範囲内にある分割領域C7を含む、対象画像1aの分割領域Ca,Cb,Ccの相対的位置関係に対して一定範囲内の相対的位置関係を有する分割領域C5〜C7のみが、対象画像1aの候補として抽出される。
【0128】
したがって、任意の入力画像から対象画像の候補が精度よく抽出され、その限られた少数の対象画像候補の複数の分割領域と対象画像の複数の分割領域とが比較されることにより、任意の入力画像中に対象画像が含まれているか否かが短時間で判定される。
【0129】
なお、図示した例は入力画像1b中に対象画像1aが含まれているか否かが判定されるだけであるが、図20のステップS62で類似する色の少なくとも1つの分割領域についての変数Qが所定値Qoより小さいと判断したときには、さらにその変数Qが所定値Qoより小さい分割領域が入力画像1bのいずれの分割領域であるかを検出するとともに、その分割領域とともに対象画像1aの複数の分割領域と対応づけられる他の分割領域を検出することによって、入力画像1b中に対象画像1aが含まれていると判定する場合に、同時に入力画像1bのどこに、どのような向きで対象画像1aが存在するかを検出することができる。
【0130】
また、対象画像1aが多数の領域に分割されるような場合には、例えば、図19のステップS56においては、対象画像1aの一部の複数の分割領域と、これと位置的に対応する入力画像1bの複数の分割領域との、それぞれ位置的に対応するもの同士の間の類似度のみを計算して、変数Qを更新するようにしてもよい。
【0131】
なお、対象画像は、その対象画像が含まれているか否かが判定されるべき入力画像を取り込んで領域分割する画像処理装置とは別の画像処理装置により領域分割して、その分割結果のみを分割領域テーブルとして、入力画像を領域分割する画像処理装置のメモリに書き込むようにしてもよい。
【0132】
上述した例は、K平均アルゴリズムによって入力画像を領域分割する場合であるが、K平均アルゴリズムでは一般に、入力画像のすべての画素と新たなすべての領域中心との距離を計算するなどのために、入力画像サイズが大きい場合には、作業エリアや分割領域バッファとしてサイズの大きいものが必要になるとともに、領域分割処理に長時間を要することになる。
【0133】
そこで、発明者は先に、一般に、大きなサイズの入力画像を、小さいサイズの作業エリアや分割領域バッファにより、高速に領域分割することのできる、分割K平均アルゴリズムと呼ぶべき方法を発明し、特願平6−96328号によって提案した。
【0134】
この分割K平均アルゴリズムは、入力画像を複数の中領域に分けて、それぞれの中領域をK平均アルゴリズムにより領域分割するものであるが、入力画像を単純に複数の中領域に分けて、それぞれの中領域を領域分割したのでは、それぞれの中領域の境界で最終的に分割された領域のつながりが悪くなることから、それぞれの中領域の間に境界領域を設けて、それぞれの中領域の領域分割にあたっては、その中領域と接するすべての境界領域を一緒に領域分割するものである。
【0135】
この発明の図1に示した例においても、この分割K平均アルゴリズムによって入力画像を領域分割することができる。
【0136】
なお、画像方向検出部30の画素サイズは、図2および図3に示したような3×3画素に限る必要はない。また、入力画像データlのみからではなく、例えば入力画像データl,a,bを加算し、その加算結果の入力画像データから入力画像の画像方向を検出し、画像方向成分d1を抽出することもできる。さらに、この発明は、入力画像がLab色空間以外の例えばRGB色空間などで表現されたフルカラー画像の場合にも適用することができるとともに、白黒画像などの単色画像の場合にも適用することができる。
【0137】
【発明の効果】
上述したように、この発明によれば、任意の入力画像から対象画像の候補を精度よく抽出することができ、任意の入力画像中に対象画像が含まれているか否かを短時間で判定することができる。
【図面の簡単な説明】
【図1】この発明の画像処理装置の一例を示す機能ブロック図である。
【図2】その画像方向検出部の一例を示す機能ブロック図である。
【図3】画像方向の検出の説明に供する図である。
【図4】画像方向の検出の説明に供する図である。
【図5】画像方向成分の値と画像方向との関係を示す図である。
【図6】入力画像データの値と画像方向との関係を示す図である。
【図7】領域分割部における領域分割の全体的な手順を示すフローチャートである。
【図8】初期領域分割の態様の一例を示す図である。
【図9】領域分割テーブルの一例を示す図である。
【図10】領域分割における距離計算の説明に供する図である。
【図11】領域分割における距離計算の説明に供する図である。
【図12】新たな領域分割の説明に供する図である。
【図13】新たな領域分割により各分割領域の形状が変えられた状態を示す図である。
【図14】新たな領域中心の代表画像方向成分の算出手順を示すフローチャートである。
【図15】代表画像方向成分の算出の説明に供する図である。
【図16】代表画像方向成分の算出の説明に供する図である。
【図17】この発明の画像処理装置の一例における全体的な手順を示すフローチャートである。
【図18】画像認識部における画像認識の手順の一部を示すフローチャートである。
【図19】画像認識部における画像認識の手順の他の一部を示すフローチャートである。
【図20】画像認識部における画像認識の手順の残部を示すフローチャートである。
【図21】対象画像の領域分割の結果の例を示す図である。
【図22】入力画像の領域分割の結果の例を示す図である。
【図23】対象画像の領域分割の結果の分割領域テーブルの例を示す図である。
【図24】入力画像の領域分割の結果の分割領域テーブルの例を示す図である。
【図25】対象画像の領域分割の結果の極座標に変換後の分割領域テーブルの例を示す図である。
【図26】入力画像の領域分割の結果の極座標に変換後の分割領域テーブルの例を示す図である。
【符号の説明】
10 画像入力部
30 画像方向検出部
40 領域分割部
50 分割領域バッファ
60 画像認識部
1a 対象画像
1b 入力画像[0001]
[Industrial application fields]
The present invention relates to an image processing apparatus that determines whether or not a certain target image is included in an input image.
[0002]
[Prior art]
In so-called image recognition processing for determining whether or not a target image is included in an input image such as an image read by an image scanner, generally the target image is first and where in the input image. Then, the candidate of the target image and the target image are compared by a method such as pattern matching to determine whether or not the target image is included in the input image.
[0003]
If the target image candidate is not extracted in this way, for example, a pattern in any direction is created from the pattern of the target image held in advance, and the input image is scanned with all the patterns. This is because each pattern and the pattern of the input image must be compared, which causes inconveniences such as a significant increase in the time required for the recognition process.
[0004]
As described above, as a method for examining where and in what direction the target image candidate exists in the input image, a known background as used in character segmentation in general character recognition is used. Create a histogram of the pixel values of the input image for color, for example white, and extract the target image candidates, or detect the color distribution of the target image and extract the target image candidates from the number of pixels belonging to the color distribution range A way to do it is being considered.
[0005]
[Problems to be solved by the invention]
However, since the former method creates a histogram of pixel values of an input image with respect to a known background color and extracts target image candidates, is the target image included in any input image whose background color is undetermined? There is a disadvantage that cannot be applied when determining whether or not.
[0006]
In addition, the latter method is difficult in terms of accuracy because target image candidates are extracted based only on the color distribution state, and many target image candidates are extracted in the case of an input image having many similar color distributions. As a result, there is a possibility that a subsequent recognition process may take time.
[0007]
Therefore, the present invention can accurately extract a candidate for a target image from an arbitrary input image, and can determine in a short time whether or not the target image is included in the arbitrary input image. It is a thing.
[0008]
[Means for Solving the Problems]
In the present invention, when the reference numerals of the embodiments shown in FIG. 1 and FIGS. 18 to 20 described later correspond to each other (however, the superscript of * is omitted below),
An area dividing unit 40 for dividing the input image 1b into a plurality of areas and extracting the image direction of each divided area;
The target image 1a is divided into a plurality of regions, and the division result of the target image 1a obtained by extracting the image direction of each divided region and the input image 1b obtained by the region dividing unit 40 An image recognition unit 60 that determines whether the target image 1a is included in the input image 1b from the division result;
Provided,
The image recognition unit 60 is
Means S41, S42 for detecting the relative positional relationship of the plurality of divided areas of the target image 1a based on the image direction of the designated divided areas in the plurality of divided areas of the target image 1a;
A relative positional relationship between a plurality of divided areas of the target image 1a including a divided area whose pixel value is the same as or approximate to that of the specified divided area of the target image 1a in a large number of divided areas of the input image 1b; Means S43, S44, S51 to S55 for selecting a plurality of divided regions having the same or approximate relative positional relationship;
Means S56, S62 for comparing the plurality of divided regions of the target image 1a with the selected plurality of divided regions of the input image 1b to determine whether the target image 1a exists in the input image 1b;
It shall have.
[0009]
[Action]
In the image processing apparatus of the present invention configured as described above, the pixel value is the same as the designated divided area in the multiple divided areas of the target image 1a in the multiple divided areas of the input image 1b, or Only a plurality of divided regions that have the same or approximate relative positional relationship as the plurality of divided regions of the target image 1a including the approximated divided regions are extracted as candidates for the target image 1a.
[0010]
Therefore, a target image candidate is accurately extracted from an arbitrary input image, and a plurality of divided regions of the limited number of target image candidates are compared with a plurality of divided regions of the target image. Whether or not the target image is included in the image is determined in a short time.
[0011]
【Example】
FIG. 1 shows an example of an image processing apparatus according to the present invention. The image processing apparatus of this example includes an image input unit 10, image buffers 21 to 23, an image direction detection unit 30, an image buffer 35, a region division unit 40, an image buffer 41, a divided region buffer 50, an image recognition unit 60, and an operation unit. 70, a display unit 80, and a system control unit 90.
[0012]
The image input unit 10 is an image scanner unit that reads an image on a document in the system, or a part that generates an image by computer processing, or a part that takes an image generated outside the system into the system. From the image input unit 10, L recommended by the CIE (International Lighting Commission) as an input image. * a * b * A full color image expressed in a color space is obtained.
[0013]
However, for example, 8-bit multi-gradation (multi-value) image data of the lightness component and the two chromaticity components is 1 * , A * , B * In the specification, * is omitted and expressed as l, a, b.
[0014]
In this example, the target image is also taken from the image input unit 10 into the same image processing apparatus, and the image direction is detected and the area is divided as will be described later. Therefore, the “input image” may include the target image.
[0015]
In the image buffers 21, 22, and 23, input image data l, a, and b from the image input unit 10 are written, respectively.
[0016]
The image direction detection unit 30 detects the image direction for each pixel of the input image from the input image data l read from the image buffer 21, and extracts an image direction component d1, and a specific example thereof will be described later. To do. In the image buffer 35, the image direction component d1 from the image direction detection unit 30 is written.
[0017]
Although not shown, the area dividing unit 40 includes a CPU and a ROM in which an area dividing control program to be executed by the CPU is written, and the input image data read from the image buffers 21, 22, and 23. l, a, b, the XY coordinate values x, y of each pixel on the input image obtained from the system control unit 90 as read addresses for the image buffers 21 to 23, and the image direction component read from the image buffer 35 Using d1, the input image is divided into regions as will be described later.
[0018]
In the image buffer 41, the correspondence relationship between each pixel of the input image and each divided region obtained in the region dividing process in the region dividing unit 40 is written.
[0019]
In the divided area buffer 50, the process and result of area division in the area dividing section 40 are written as a divided area table.
[0020]
Although not shown, the image recognition unit 60 includes a CPU and a ROM in which an image recognition control program to be executed by the CPU is written, and the target image described in the divided area table of the divided area buffer 50. To determine whether or not the target image is included in the input image, as will be described later, from the result of the segmentation and the result of segmenting the input image to be determined whether or not the target image is included It is.
[0021]
For example, the operation unit 70 looks at the data of the division result of the target image displayed on the display unit 80, and the operator performs an operation such as designating a specific division region among the plurality of division regions of the division result of the target image. To do.
[0022]
The display unit 80 displays, for example, data of the division result of the target image, a determination result of whether or not the target image is included in the input image, and the like.
[0023]
Although not shown, the system control unit 90 includes a CPU and a ROM in which a system control program to be executed by the CPU is written, and controls each part of the system.
[0024]
FIG. 2 shows an example of the image direction detection unit 30 in the case of using the method described in Electronic Technology Research Institute Research Report No. 835, page 80.
[0025]
That is, the input image data 1 read from the image buffer 21 shown in FIG. 1 is supplied to the blocking circuit 31, and the pixel of interest Pe as shown in FIG. An image data group Gd consisting of nine image data la to li as shown in FIG. 3B is extracted from the pixel group Gp consisting of the pixels Pa to Pi, which are 3 × 3 pixels centered on. The convolution operation circuits 32 and 33 are supplied to the convolution operation circuits 32 and 33 to perform the convolution operation by the coefficient groups Kh and Kv including the coefficient values as illustrated for the pixels Pa to Pi of the pixel group Gp, respectively. ,
CC = la · (−1) + lb · (−1) + …… + li · 1 (1)
LL = la · (−1) + lb · 0 +... + Li · 1 (2)
The output represented by is obtained.
[0026]
The image direction of the input image is the direction of the contour line when the density of the input image is displayed as a contour line. In this example, the value of the input image data 1 is used as the density of the input image. The coefficient group Kh is for detecting the image direction in the horizontal direction, and the coefficient group Kv is for detecting the image direction in the vertical direction.
[0027]
Further, in the image direction detection unit 30, the outputs CC and LL of the convolution arithmetic circuits 32 and 33 are supplied to the arithmetic circuit 34, and as shown in FIG.
α = arctan (LL / CC) (3)
And when
Figure 0003637927
Is calculated.
[0028]
The component da indicates the direction of the image direction component extracted from the input image data l, that is, the direction of the contour line when the density of the input image is displayed in contour lines, in 16 steps from da = 0 to da = 15. Since it is not necessary to consider the direction of the direction of the contour line, it is sufficient if the direction of the contour line, that is, the image direction of the input image is shown as a range from 0 to π as shown in FIG.
[0029]
The component db is the magnitude of the image direction component extracted from the input image data l, that is, the density difference between the contour line of the pixel of interest and the adjacent contour line when the density of the input image is displayed as a contour line. This is shown in 16 stages from 0 to db = 15. By making the logarithmic value of 1 added to the sum of the square of the output CC and the square of the output LL, even when the outputs CC and LL are small, It has a value.
[0030]
Specifically, when the image data group Gd shown in FIG. 3B has a value as shown in FIG. 6A or 6B, α = −π / 2 or α = π / 2, and da = 0 and it is detected that the image direction at the target pixel is the vertical direction. When the image data group Gd has a value as shown in FIG. 6C or FIG. 6D, α = −π / 4 and da = 4, and the image direction at the target pixel is from the upper left to the lower right. It is detected that the direction is π / 4.
[0031]
When the image data group Gd has a value as shown in FIG. 6E or 6F, α = 0 and da = 8, and it is detected that the image direction at the target pixel is the horizontal direction. . When the image data group Gd has values as shown in FIG. 6G or (H), α = π / 4 and da = 12, and the image direction at the target pixel is 3π / from the upper right to the lower left. 4 directions are detected.
[0032]
From the arithmetic circuit 34 shown in FIG. 2, that is, from the image direction detection unit 30, the components da and db are output as an 8-bit image direction component d1 as a whole, and the image direction component d1 is written to the image buffer 35. .
[0033]
In the region dividing unit 40, after the image direction component d1 is written in the image buffer 35 in this way, for example, a K average algorithm is used so that the shape of the region of the entire input image can be changed according to its color and image direction. Is divided into regions.
[0034]
The K-average algorithm repeats region division over several orders until the divided region converges to a certain state, including initial region division for setting K initial region centers for the input image. After each next area division, the area center of each divided area is calculated to determine whether or not the divided area has converged to a certain state. As the center of the area, the center of gravity and the representative color value (representative pixel value) of each divided area are generally set or calculated. In the example of FIG. 1 of the present invention, in addition to this, the representative image of each divided area is set. Set or calculate the directional component.
[0035]
In the following, the repetition order of each next area division including the initial area division is i (i = o in the meaning of zero in the initial area division, i = 1, 2 in each subsequent area division), and The number of the area divided by the next area division is j (j = 1, 2,... K), the area center of each divided area by the next area division including the initial area division is Cij, and the center of gravity is Xij, Yij. The representative color values are denoted by Lij, Aij, Bij, and the representative image direction component is denoted by Dij, respectively. However, details of the centroids Xij, Yij, the representative color values Lij, Aij, Bij, and the representative image direction component Dij will be described later.
[0036]
Hereinafter, a specific procedure of region division in the region dividing unit 40 by the K-average algorithm considering the image direction will be described with reference to FIG. However, FIG. 7 shows an overall procedure of area division executed by the area dividing unit 40, and the following example is a case where the area division number K is 100.
[0037]
First, in step S1, 100 initial region centers are set for the input image. That is, the input image data l, a, b read from the image buffers 21, 22, 23, the image direction component d1 read from the image buffer 35, and the coordinate values x, y obtained from the system control unit 90. For example, as shown in FIG. 8, the input image 1 is divided into a total of 100 regions each having 10 pixels in the vertical and horizontal directions, and the region centers Coj of the divided regions, that is, the centroids Xoj, Yoj, representative color values Loj, Aoj, Boj, and representative image direction component Doj, coordinates xoj, yoj of the center pixel of each divided region, input image data loj, aoj, boj for the center pixel, and image for the center pixel The direction component d1oj is obtained.
[0038]
However, for the representative image direction component Doj, if this is 5-bit data and the dbboj for the center pixel of the 4-bit component db in the image direction component d1 is 1 or more, the center pixel has the image direction. As a result, the most significant bit in 5 bits is set to 0, the daoj for the central pixel of the 4-bit component da in the image direction component d1 is taken in as the lower 4 bits, and the dboj for the central pixel of the component db is 0 If so, the central pixel has no image direction, the most significant bit in 5 bits is set to 1, and all the lower 4 bits are set to 0, resulting in a value of 16 as a whole.
[0039]
Next, in step S2, the area center Coj of each divided area obtained as described above, that is, the center of gravity Xoj, Yoj (xoji, yoj) of each divided area, representative color values Loj, Aoj, Boj (loj, aoj, boj). ) And the representative image direction component Doj are written in the divided area buffer 50 as an initial divided area table.
[0040]
FIG. 9 shows a divided area table created after each next area division including the initial divided area table, and i = o is expressed in the initial divided area table.
[0041]
Next, in step S3, the initial divided area table, that is, the initial area center Coj is read from the divided area buffer 50, and the input image data l, a, b, image read from the image buffers 21, 22, and 23 are read. From the image direction component d1 read from the buffer 35 and the coordinate values x and y obtained from the system control unit 90, all the pixels of the input image are sequentially set as the target pixel Pn, and the target pixel Pn and all the pixels The distance Hojn from the initial region center Coj is calculated as follows. n is the pixel number of the input image.
[0042]
However, this distance calculation and the following area determination of each pixel of the input image are repeatedly performed after each subsequent area division until the divided area converges to a certain state, as will be described later. It is. That is, after each next region division, all pixels of the input image are sequentially set as the target pixel Pn, and distances Hijn between the target pixel Pn and all the new region centers Cij by the region division of the rank are calculated. .
[0043]
Therefore, in the following, calculation of the distance Hijn and determination of the area of each pixel of the input image as a common procedure after each subsequent area division including the initial area division will be described. However, the centroids Xij and Yij of each divided area by the next area division after the initial area division are the average values of the coordinate values x and y of all the pixels in each divided area, and the representative color values Lij, Aij, and Bij Is the average value of the input image data l, a, b for all pixels in each divided area, and the representative image direction component Dij depends on whether each divided area has a noticeable image direction, as will be described later. A value from 0 to 15 or a value of 16 is assumed.
[0044]
To calculate the distance Hijn, first,
Δxijn = xn−Xij (11)
Δyijn = yn−Yij (12)
Δlijn = ln−Lij (13)
Δaiijn = an−Aij (14)
Δbijn = bn−Bij (15)
As shown in the above, the centroids Xij, Yij and representative color values Lij, Aij, Bij of the respective divided areas, the coordinates xn, yn of the target pixel Pn, and the input image data ln, an, bn about the target pixel Pn Find differences individually.
[0045]
As for the image direction component, as shown in FIG. 5, the image direction is expressed in 16 steps as an angle in the range from 0 to π. Therefore, the representative image direction of each divided region is divided into the following three cases. A difference Δdijn between the component Dij and that of the 4-bit component da in the image direction component d1 with respect to the target pixel Pn is obtained.
[0046]
First, when the representative image direction component Dij is 16 and the dbn for the target pixel Pn of the 4-bit component db in the image direction component d1 is 0, both the region center Cij and the target pixel Pn have the image direction. Since there is no difference Δdijn,
Δdijn = 0 (16)
And
[0047]
Second, when the representative image direction component Dij is 15 or less and the component dbn is 1 or more,
Δdijn = | dan−Dij | (17)
And
[0048]
However, the difference Δdijn corresponds to the angle difference β between the image direction indicated by the representative image direction component Dij at the region center Cij and the image direction indicated by the component dan at the target pixel Pn, as shown in FIG. Since the difference β is smaller than π / 2 and the difference Δdijn should be 7 or less as shown in FIG. 10B, when Δdijn = | dan−Dij | ≧ 8,
Δdijn = 15− | dan−Dij | (18)
And
[0049]
Third, when the representative image direction component Dij is 16 and the component dbn is 1 or more, or when the representative image direction component Dij is 15 or less and the component dbn is 0, that is, the region center Cij is noticed. When only one of the pixels Pn has an image direction and the other has no image direction, the difference Δdijn is larger than when the region center Cij and the target pixel Pn have the same image direction, that is, the difference Δdijn is not 0. In addition, the difference Δdijn is smaller than the case where the image direction of the region center Cij and the target pixel Pn is shifted by π / 2, that is, the difference Δdijn is smaller than 8, and takes the middle of 0 and 7,
Δdijn = 3.5 (19)
And
[0050]
In addition to calculating the above differences Δxijn, Δyijn, Δliijn, Δaijn, Δbijn, and Δdijn, a function F (Δxijn, Δyijn, Dij) for controlling the size of the region is defined as follows.
[0051]
That is, as shown in FIG.
γ = arctan (Δyijn / Δxijn) (21)
age,
Figure 0003637927
And when
When | Dij−dcn | ≦ 7,
F (Δxijn, Δyijn, Dij)
= 1 + ke (| Dij−dcn | /3.5−1) (23)
age,
When | Dij−dcn | ≧ 8,
F (Δxijn, Δyijn, Dij)
= 1 + ke {(15- | Dij-dcn |) /3.5-1} (24)
And
[0052]
However, as is apparent from FIG. 11, dcn represents the direction of the target pixel Pn with respect to the region center Cij (center of gravity Xij, Yij) and the angle with respect to the y axis of the xy coordinates centered on the region center Cij (center of gravity Xij, Yij). (Γ + π / 2) is shown in 16 stages from dcn = 0 to dcn = 15, and the angle (γ + π / 2) is in the range from 0 to π by not considering the direction only by the direction. It is. ke is a coefficient as described later.
[0053]
Since | Dij−dcn | in Expression (23) and (15− | Dij−dcn |) in Expression (24) are 0 or more and 7 or less, the function F (Δxijn, Δyijn, Dij) is 1 With a spread of ± ke, and is always 1 when ke = 0, and can be 0 when ke = 1. Therefore, the coefficient ke is set to 0 <ke <1.
[0054]
In this way, by defining the coefficient ke and defining the function F (Δxijn, Δyijn, Dij) for controlling the size of the region, in step S3 of FIG. 7, all the pixels of the input image are sequentially set as the target pixel Pn. When the distance Hijn between the target pixel Pn and all the area centers Cij is generally expressed by the square of z by “(z) ** 2”,
Figure 0003637927
Define and calculate in However, kx, kl, ka, kb, and kd are arbitrary coefficients, respectively.
[0055]
Next, the process proceeds to step S4, and the target pixel Pn is set to the divided region having the region center having the smallest distance Hijn among the region centers Cij of the respective divided regions as viewed from the target pixel Pn of the input image. So that the input image is newly divided into regions.
[0056]
That is, as a result of the immediately preceding region division, for example, if it is the second divided region that has the smallest distance Hijn from the region center Cij when viewed from a certain pixel included in the first divided region, that pixel Is included in the second divided area, and for example, if the first divided area has the smallest distance Hijn to the area center Cij from a certain pixel included in the second divided area. The region division is corrected so that the pixel is included in the first divided region.
[0057]
Here, FIG. 12 shows the relationship between the relative position between the pixel of interest Pn of the input image and the area center Cij of each divided area obtained by the immediately preceding area division, and the representative image direction component Dij of the area center Cij.
[0058]
As is clear from the figure, the function F (Δxijn, Δyijn, Dij) represented by the equation (23) or (24) is the direction of the straight line connecting the region center Cij (center of gravity Xij, Yij) and the target pixel Pn, That is, the direction indicated by the component dcn represented by the expression (22) is indicated by the representative image direction component Dij as when the pixel of interest Pn is at the point Pn (0) and the component dcn is represented by dcn (0). When it coincides with the image direction, it becomes the minimum, and the direction of the straight line, that is, the direction indicated by the component dcn is represented by the pixel of interest Pn at the point Pn (π / 2) and the component dcn as dcn (π / 2). When it is shifted by π / 2 with respect to the image direction indicated by the representative image direction component Dij, as in
[0059]
That is, in step S4, a pixel in the direction indicated by the representative image direction component Dij with respect to the area center Cij obtained by the immediately preceding area division is divided from the area center Cij. Pixels that are likely to be included in the region but are shifted by π / 2 with respect to the direction indicated by the representative image direction component Dij are also included in the divided regions of the region center Cij even if they are close to the region center Cij. The input image is divided into regions so as to be difficult.
[0060]
Therefore, in step S4, the shape of each divided region by the immediately preceding region division is changed to a shape along the direction indicated by the representative image direction component Dij. FIG. 13 shows a state in which the region division is corrected in this way and the shape of each divided region is changed.
[0061]
Next, in step S5, the correspondence between the pixel of interest Pn of the input image and each divided region by the new region division, that is, the number of the divided region to which the pixel of interest Pn of the input image belongs by the new region division, Write to image buffer 41.
[0062]
Next, it progresses to step S6 and a new area | region center is calculated. That is, the input image data l, a, b read from the image buffers 21, 22, 23, the image direction component d1 read from the image buffer 35, the division area number read from the image buffer 41, and the system From the coordinate values x and y obtained from the control unit 90, for each newly divided area, the center of gravity Xij, Yij, representative color values Lij, Aij, Bij, and the area center Cij consisting of the representative image direction component Dij are calculated. Try again.
[0063]
Here, as described above, the centroids Xij and Yij are the average values of the coordinate values x and y of all the pixels in each divided region, and the representative color values Lij, Aij and Bij are the values for all the pixels in each divided region. Are the average values of the input image data l, a, b. The representative image direction component Dij is obtained according to the calculation procedure shown in FIG.
[0064]
That is, some pixels of the input image may have a plurality of image directions. However, if there are at least two directions that can be clearly observed, and there is a second direction that can be clearly observed, it is in the first direction. First, in step S11, for each newly divided region, the above component dan is 0, 1 in the pixels satisfying the condition of dbn ≧ 1. , 2... 15, the number of pixels N 0, N 1, N 2... N 15 is calculated, and the number N 16 of pixels where dbn = 0 is obtained.
[0065]
Next, in step S12, the component value Dmax with the largest number of pixels and the largest number of pixels Nmax are calculated. However, when N16 is the largest, Dmax = 16. In step S13, it is determined whether or not Dmax = 16. If it is determined that Dmax = 16, the region does not have an image direction. Next, in step S14, the representative image direction component of the region is determined. Let Dij be 16.
[0066]
When it is determined in step S13 that Dmax ≠ 16, in step S15, the direction shifted by π / 2 from the direction indicated by the component value Dmax having the largest number of pixels as shown in FIG. 15A or 15B. That is, the component value Dmid deviated by +8 or −8 from the component value Dmax and the number of pixels Nmid that becomes the component value Dmid are calculated, and the process proceeds to step S16, where the number of pixels Nmax is 2 of the number of pixels Nmid. Judge whether it is more than double.
[0067]
If it is determined in step S16 that the number of pixels Nmax is less than or equal to twice the number of pixels Nmid, the region does not have a noticeable image direction, and the same step as in the case where Dmax = 16 is determined in step S13. In S14, the representative image direction component Dij of the area is set to 16.
[0068]
When it is determined in step S16 that the number of pixels Nmax is more than twice the number of pixels Nmid, the area has a remarkable image direction, but the direction component spreads, for example, two direction components overlap each other in the adjacent direction. Since it may exist, the process further proceeds to step S17 to calculate the following weighted average value Dave for the area, and use the weighted average value Dave as the representative image direction component Dij of the area. .
[0069]
That is, as shown in FIG. 16, component values Dp1, Dm1,... Dp4, Dm4 that are shifted by ± 1, ± 2, ± 3, ± 4 with respect to the component value Dmax with the largest number of pixels, and their respective component values Dp1. , Dm1... Dp4, Dm4, the number of pixels Np1, Nm1... Np4, Nm4 is calculated, and the weighted average value Dave is calculated.
Dave = (Nm4 · Dm4 + Nm3 · Dm3 + Nm2 · Dm2 + Nm1 · Dm1 + Nmax · Dm1 + Np1 · Dp1 + Np2 · Dp2 + Np3 · Dp3 + Np4 · Dp4) / (Nm4 + Nm3 + Np2 + Np + Np + Np + Np +
Calculate
[0070]
When the representative image direction component Dij is set to 16 in step S14 or the weighted average value Dave of the equation (26) is set to the representative image direction component Dij in step S17, the process further proceeds to step S18, and the representative image direction direction is determined for all regions. It is determined whether or not the component Dij has been obtained, and if it is determined that there is an area for which the representative image direction component Dij has not yet been obtained, the process returns to step S11 and the subsequent steps to obtain the representative image direction component Dij as described above for the next area. Ask.
[0071]
As described above, in step S6 of FIG. 7, the area center Cij including the centroids Xij, Yij, the representative color values Lij, Aij, Bij, and the representative image direction component Dij is recalculated for each newly divided area. .
[0072]
Next, in step S7, the area centers Cij of the respective divided areas thus obtained, that is, the centroids Xij and Yij, the representative color values Lij, Aij and Bij, and the representative image direction component Dij are as shown in FIG. As the divided area table, the divided area table for the immediately preceding divided area is left and written in the divided area buffer 50.
[0073]
Next, the process proceeds to step S8, and the new divided area table, that is, the new area center and the previous divided area table, that is, the previous area center are read from the divided area buffer 50, and the divided area number is read. A shift amount of a new area center with respect to the previous area center is calculated as follows between those having the same j.
[0074]
However, here, the center of the new area is Cij, the center of gravity is Xij, Yij, the representative color values are Lij, Aij, Bij, the representative image direction component is Dij, and s = i−1. The previous region center is indicated by Csj, the center of gravity is indicated by Xsj, Ysj, the representative color values are indicated by Lsj, Asj, Bsj, the representative image direction component is indicated by Dsj, and the new region center Cij is shifted from the previous region center Csj. The quantity is indicated by Hsij.
[0075]
In order to calculate the shift amount Hsij, first,
ΔXsij = Xij−Xsj (31)
ΔYsij = Yij−Ysj (32)
ΔLsij = Lij−Lsj (33)
ΔAsij = Aij−Asj (34)
ΔBsij = Bij−Bsj (35)
As shown, the centroids Xij, Yij and the representative color values Lij, Aij, Bij of the new area center Cij, and the centroids Xsj, Ysj and the representative color values Lsj, Asj, Bsj of the previous area center Csj Find differences individually.
[0076]
As for the representative image direction component, as described above, since the representative image direction components Dij and Dsj of the region centers Cij and Csj can take values from 0 to 16, the representative image direction component is divided into the following three cases. A difference ΔDsij between Dij and the representative image direction component Dsj is obtained.
[0077]
First, when both the representative image direction components Dij and Dsj are 16,
ΔDsij = 0 (36)
And
[0078]
Second, when the representative image direction components Dij and Dsj are both 15 or less,
ΔDsij = | Dij−Dsi | (37)
And
[0079]
However, the difference ΔDsij corresponds to an angle difference between the image direction indicated by the representative image direction component Dij and the image direction indicated by the representative image direction component Dsj, and the angle difference should be smaller than π / 2, and the difference ΔDsij should be 7 or less. Therefore, when ΔDsij = | Dij−Dsj | ≧ 8,
ΔDsij = 15− | Dij−Dsj | (38)
And
[0080]
Third, when only one of the representative image direction components Dij and Dsj is 16, the difference ΔDsij is larger than when the representative image direction components Dij and Dsj are both 16, that is, the difference ΔDsij is not 0. In addition, the difference ΔDsij is smaller than when the angle difference between the image direction indicated by the representative image direction component Dij and the image direction indicated by the representative image direction component Dsj is π / 2, that is, the difference ΔDsij is smaller than 8. Taking between 0 and 7,
ΔDsij = 3.5 (39)
And
[0081]
The above differences ΔXsij, ΔYsij, ΔLsij, ΔAsij, ΔBsij, ΔDsij are calculated, and in step S8 of FIG. When the displacement amount Hsij with respect to the previous region center Csj is generally represented by the square of Z as “(Z) ** 2”,
Hsij
= Kx {(ΔXsij) ** 2+ (ΔYsij) ** 2}
+ Kl · (ΔLsij) ** 2
+ Ka · (ΔAsij) ** 2
+ Kb · (ΔBsij) ** 2
+ Kd · (ΔDsij) ** 2 (40)
Define and calculate in However, kx, kl, ka, kb, and kd are arbitrary coefficients, respectively.
[0082]
Next, proceeding to step S9, it is determined whether or not the shift amount Hsij for all the divided regions is smaller than 1, and when it is determined that the shift amount Hsij for any of the divided regions is 1 or more, Assuming that the divided areas have not yet converged to a certain state, the process returns to step S3 and subsequent steps.
[0083]
That is, in step S3, all the pixels of the input image are sequentially set as the target pixel Pn, and distances Hijn between the target pixel Pn and all the new region centers Cij are calculated according to the equation (25), and then in step S4. Proceeding, the input image is further divided into regions so that the pixel of interest Pn is included in the divided region having the region center of the smallest distance Hijn among all the new region centers Cij as viewed from the pixel of interest Pn. In step S5, the correspondence relationship between the pixel of interest Pn of the input image and each divided area obtained by further new area division is written in the image buffer 41. Next, in step S6, a new area center Cij is calculated. Next, in step S7, the obtained new area center Cij is used as a divided area table, and the divided area buffer 50 is used. Next, the process proceeds to step S8, and a series of steps of calculating the shift amount Hsij of the new area center Cij with respect to the previous area center Csj according to the equation (40) is repeated for each divided area. Execute.
[0084]
When it is determined in step S9 that the shift amount Hsij for all the divided areas is smaller than 1, the divided areas are determined to have converged to a certain state, and the area division is terminated.
[0085]
As described above, in the region dividing unit 40, the entire input image is divided so that the shape of the region can be changed according to the color and the image direction.
[0086]
FIG. 17 shows an overall procedure of image recognition by the system control unit 90 in the image processing apparatus of this example.
[0087]
First, in step S31, based on the operator's instruction operation in the operation unit 70, the image data of the target image 1a as the input image data l, a, b is taken into the system from the image input unit 10, and the image buffer 21, 22 and 23 are written.
[0088]
Next, in step S32, the image direction detection unit 30 detects the image direction of the target image 1a from the image data of the target image 1a, extracts the image direction component d1, and extracts the image direction component d1 from the image buffer 35. Write to.
[0089]
Next, in step S <b> 33, the target image 1 a is divided into regions by the region dividing unit 40, and the final divided result table 51 x of the target image 1 a is formed in the divided region buffer 50.
[0090]
Next, in step S34, the image data of the input image 1b to be determined as to whether or not the target image 1a is included as the input image data l, a, b based on the instruction operation of the operator in the operation unit 70. The image is input from the image input unit 10 into the system and written in the image buffers 21, 22, and 23.
[0091]
Next, in step S35, the image direction of the input image 1b is detected from the image data of the input image 1b by the image direction detection unit 30, the image direction component d1 is extracted, and the image direction component d1 is extracted from the image buffer 35. Write to.
[0092]
Next, in step S36, the input image 1d is divided into regions by the region dividing unit 40, and the final division of the input image 1b is performed separately from the divided region table 51x of the final division result of the target image 1a in the divided region buffer 50. The resulting divided area table 52x is formed.
[0093]
Next, in step S37, based on the operator's instruction operation in the operation unit 70, the image recognition unit 60 performs the input image from the divided region tables 51x and 52x according to the specific procedure shown in FIGS. It is determined whether or not the target image 1a is included in 1b, and the determination result is displayed on the display unit 80.
[0094]
FIG. 21 shows an example of the final division result of the target image 1a. The target image 1a is 200 × 100 pixels, the area division number K is 3, and each has three area centers Ca, Cb, and Cc. This is a case where the area is divided into the divided areas.
[0095]
As shown in FIG. 23, the division area table 51x as the final division result of the target image 1a includes the division area number, the center of gravity indicated by the XY coordinate values of each division area, the representative color values L, A, B and the representative image direction component D are described, and the number of pixels N of each divided region is described.
[0096]
FIG. 22 shows an example of the final division result of the input image 1b. The input image 1b is 400 × 200 pixels, the area division number K is 8, and each of the 8 divisions having the area centers C1 to C8. This is a case where the area is divided into areas.
[0097]
As shown in FIG. 24, the division area table 52x as the final division result of the input image 1b also includes the division area number, the center of gravity indicated by the XY coordinate values of each division area, the representative color values L, A, B and the representative image direction component D are described, and the number of pixels N of each divided region is described.
[0098]
In the following, the divided areas are indicated not by their numbers but by the area centers. That is, for example, the divided area with area number 3 of the target image 1a is referred to as a divided area Cc, and the divided area with area number 7 of the input image 1b is referred to as a divided area C7.
[0099]
As a procedure in step S37 of FIG. 17 after the division area tables 51x and 52x as the final division results of the target image 1a and the input image 1b are formed in this manner, the image recognition unit 60 first performs the process shown in FIG. In step S41, the most characteristic color divided area of the target image 1a is selected from the divided area table 51x of the target image 1a.
[0100]
For example, after the divided region table 52x of the input image 1b is formed in step S36 in FIG. 17, the target image 1a is automatically recorded by the system control program in the system control unit 90 or by the operator's instruction operation in the operation unit 70. The representative color values L, A, and B of each divided area on the divided area table 51x are displayed on the display unit 80. The operator looks at the displayed contents and recognizes the most characteristic color of the target image 1a or instructs the operation unit 70 of the number of the corresponding divided area of the target image 1a from the image data value known in advance. Thus, the image recognizing unit 60 selects the divided area having the designated number.
[0101]
Alternatively, the description content of the divided area table 51x of the target image 1a is not displayed on the display unit 80, and the operator inputs an image data value known in advance as the most characteristic color of the target image 1a from the operation unit 70. As a result, the image recognition unit 60 selects a divided area in which the representative color values L, A, and B are closest to the input image data value among the divided areas on the divided area table 51x of the target image 1a. .
[0102]
In the example of FIGS. 21 and 23, it is assumed that the divided area Cc is selected as the most characteristic color area of the target image 1a.
[0103]
Next, in step S42, the center of gravity of the divided area selected in this way is set as the center, the image direction is set to θ = 0, and the center of gravity of each divided area on the divided area table 51x is rewritten in polar coordinates, and the divided area table 51r is rewritten. Form.
[0104]
That is, in the examples of FIGS. 21 and 23, the center of gravity of (60, 55) in the XY coordinate values of the divided region Cc is the center of r = 0 in polar coordinates, and the representative image direction component of D = 2 indicates The direction of the arrow in FIG. 21 is θ = 0, and the center of gravity of each divided area on the divided area table 51x is expressed by polar coordinate values, so that a divided area table 51r as shown in FIG. 25 is formed. In FIG. 25, the unit of the angle θ is radians.
[0105]
Next, in step S43, the divided area table 52x of the input image 1b is searched for a divided area having a color similar to the representative color of the divided area selected in step S41 of the target image 1a as a representative color, and further in step S44. Going forward, it is determined whether there is a similar color segmentation area.
[0106]
For example, in the divided areas of the input image 1b, the representative color values L, A, and B are in a range of ± 10% with respect to the representative color values L, A, and B of the divided areas selected in step S41 of the target image 1a. The divided areas inside are searched and set as divided areas having colors similar to the colors of the divided areas selected in step S41 of the target image 1a.
[0107]
If it is determined in step S44 that there is no similar color segmentation area, it is determined that the target image 1a is not included in the input image 1b, and the process proceeds to step S45, where the target image 1a is included in the input image 1b. The fact that there is no image is displayed on the display unit 80, and the image recognition process is terminated.
[0108]
In the examples of FIGS. 21 to 25, only the representative color values L, A, and B of the divided area C7 of the input image 1b are compared with the representative color values L, A, and B of the selected divided area Cc of the target image 1a. Since all are within the range of ± 10%, only the divided area C7 is a divided area having a color similar to the color of the divided area Cc.
[0109]
If it is determined in step S44 that there is a similar color divided area, then in step S51 of FIG. 19, one similar color divided area is selected from the divided area table 52x of the input image 1b, and step S52 is further selected. Then, the variable Q described later for the selected divided area is cleared to zero.
[0110]
In the examples of FIGS. 21 to 25, since only the divided area C7 of the input image 1b is a divided area having a color similar to the color of the divided area Cc of the target image 1a, the divided area C7 is selected in step S51. In step S52, the variable Q for the divided region C7 is cleared to zero.
[0111]
Next, in step S53, the center of gravity of the selected divided region is set as the center, the image direction is θ = 0, the center of gravity of each divided region on the divided region table 52x is rewritten in polar coordinates, and the selected divided region is also displayed. A difference Dd between the representative image direction component of the target image 1a and the representative image direction component of the divided area selected in step S41 of the target image 1a is obtained, and the difference Dd is subtracted from the representative image direction component of each divided area of the input image 1b. The representative image direction component of each divided area on the divided area table 52x is rewritten to form a divided area table 52r. However, the representative image direction component D is 0 or more and 16 or less.
[0112]
That is, in the examples of FIGS. 21 to 25, the center of gravity of (150, 139) in the XY coordinate values of the divided region C7 is the center of r = 0 in polar coordinates, and the representative image direction component of D = 6 indicates The direction of the arrow in FIG. 22 is θ = 0, the center of gravity of each divided area on the divided area table 52x is expressed by polar coordinate values, the representative image direction component of the divided area C7, and the representative image direction of the divided area Cc. The representative image direction component of each divided region on the divided region table 52x is rewritten so that the difference Dd = 6-2 = 4 from the component is subtracted from the representative image direction component of each divided region of the input image 1b. A divided area table 52r as shown in FIG. In FIG. 26, the unit of the angle θ is radians.
[0113]
Next, in step S54, a divided region corresponding to a divided region other than the divided region selected in step S41 of the target image 1a in the input image 1b is searched from the divided region table 52r, and the process proceeds to step S55. Thus, it is determined whether or not there are all divided areas corresponding to the divided areas other than the divided areas selected in step S41 of the target image 1a.
[0114]
For example, the polar coordinates r and θ of the center of gravity on the divided area table 52r are ± 10% with respect to the polar coordinates r and θ of the center of gravity of the divided areas other than the divided areas selected in step S41 on the divided area table 51r. The divided areas within the range are searched and are set as the divided areas corresponding to the divided areas other than the divided areas selected in step S41 of the target image 1a.
[0115]
In the example of FIGS. 21 to 26, polar coordinate values r and θ of the centroids of the divided regions C5 and C6 of the input image 1b are respectively relative to polar coordinate values r and θ of the centroids of the divided regions Ca and Cb of the target image 1a. Since it is within the range of ± 10%, it is determined that there are all divided areas corresponding to the divided areas other than the divided areas selected in step S41 of the target image 1a.
[0116]
When it is determined in step S55 that there are all corresponding divided areas, the process proceeds to step S56, where each divided area of the target image 1a and a plurality of divided areas of the input image 1b corresponding to the divided areas are positioned. The degree of similarity between those corresponding to each other is calculated, and the variable Q that has been cleared to zero in step S52 is updated based on the respective calculation results.
[0117]
The similarity Qn between the divided area of the target image 1a and the divided area of the input image 1b that corresponds to the target image 1a is represented by La, representative color values L, A, and B of the divided area of the target image 1a. Aa, Ba, the representative image direction component D is Da, the number of pixels N is Na, the representative color values L, A, B of the divided area of the input image 1b corresponding to this position are Lb, Ab, Bb, the representative image direction If the component D is Db, the number of pixels N is Nb, and the square of z is generally represented by “(z) ** 2”,
Qn
= (La-Lb) ** 2 + (Aa-Ab) ** 2 + (Ba-Bb) ** 2
+ Kd (Da-Db) ** 2 + kn (Na-Nb) ** 2 (41)
Define and calculate in However, kd and kn are arbitrary coefficients, respectively.
[0118]
In the example of FIGS. 21 to 26, the similarity Q1 between the divided area Ca of the target image 1a and the divided area C5 of the input image 1b, and the divided area Cb of the target image 1a and the divided area C6 of the input image 1b. And the similarity Q3 between the divided area Cc of the target image 1a and the divided area C7 of the input image 1b are respectively calculated, and the variable Q is
Q = Q1 + Q2 + Q3 (42)
It is said.
[0119]
When it is determined in step S55 that there are no corresponding divided areas, the process proceeds to step S57, and the variable Q for the divided area selected in step S51 of the input image 1b is set to a predetermined value larger than a predetermined value Qo described later. Qm.
[0120]
After the variable Q is updated as described above in step S56 or the variable Q is set to the predetermined value Qm in step S57, the process proceeds to step S61 in FIG. 20 to include the target image 1a in the divided area of the input image 1b. It is determined whether or not there are other divided areas having colors similar to the color of the divided area selected in step S41. If it is determined that there are other divided areas, the process returns to step S51 and subsequent steps in FIG. One other divided area of the color is selected from the divided area table 52x of the input image 1b, and the above variable Q for the selected divided area is cleared to zero. The above processing is executed.
[0121]
However, in the example of FIGS. 21 to 26, as described above, only the divided area C7 of the input image 1b is a divided area having a color similar to the color of the divided area Cc selected in step S41 of the target image 1a. It does not return to step S51 and below.
[0122]
When it is determined in step S61 that there are no other similar color divided areas, the process proceeds to step S62, and it is determined whether or not the variables Q for the similar color divided areas are all equal to or greater than a predetermined value Qo. When it is determined that all the values are equal to or greater than the predetermined value Qo, it is assumed that the target image 1a is not included in any position of the input image 1b, and the process proceeds to step S45 in FIG. The fact that the image 1a is not included is displayed on the display unit 80, and the image recognition process is terminated.
[0123]
If it is determined in step S62 that the variable Q for at least one divided region of similar colors is smaller than the predetermined value Qo, it is assumed that the target image 1a is included in any position of the input image 1b, and the process proceeds to step S63. The display unit 80 displays that the target image 1a is included in the input image 1b, and the image recognition process ends.
[0124]
In the example of FIGS. 21 to 26, only the divided area C7 of the input image 1b is a divided area having a color similar to the color of the divided area Cc selected in step S41 of the target image 1a, and as described above, Since the divided areas C5, C6 and C7 of the input image 1b correspond to the divided areas Ca, Cb and Cc of the target image 1a, depending on whether or not the variable Q represented by the equation (42) is smaller than the predetermined value Qo, The determination of whether or not the target image 1a is included in the input image 1b is divided.
[0125]
For example, the predetermined value Qo is set to Qo = 100 when the coefficients kd and kn of the above equation (41) are kd = 10 and kn = 0.001. Therefore, in the example of FIGS. 21 to 26, the variable Q represented by the equation (42) is smaller than the predetermined value Qo, and it is determined that the target image 1a is included in the input image 1b. .
[0126]
According to the above-described example, among the many divided areas of the input image 1b, the divided color areas having the same or approximate representative color values L, A, and B as the designated divided areas in the plurality of divided areas of the target image 1a. Only a plurality of divided regions having a relative positional relationship that is the same as or close to the relative positional relationship of the plurality of divided regions of the target image 1a including the region are extracted as candidates for the target image 1a.
[0127]
That is, in the examples of FIGS. 21 to 26, the region is designated as the most characteristic color region of the target image 1a in the divided regions Ca, Cb, and Cc of the target image 1a in the divided regions C1 to C8 of the input image 1b. Within a certain range with respect to the relative positional relationship of the divided regions Ca, Cb, Cc of the target image 1a, including the divided region C7 in which the representative color values L, A, B are within the certain range with respect to the divided region Cc. Only the divided areas C5 to C7 having the relative positional relationship are extracted as candidates for the target image 1a.
[0128]
Therefore, a target image candidate is accurately extracted from an arbitrary input image, and a plurality of divided regions of the limited number of target image candidates are compared with a plurality of divided regions of the target image. Whether or not the target image is included in the image is determined in a short time.
[0129]
In the illustrated example, it is only determined whether or not the target image 1a is included in the input image 1b. However, in step S62 in FIG. When it is determined that the divided area is smaller than the predetermined value Qo, it further detects which divided area of the input image 1b the divided area whose variable Q is smaller than the predetermined value Qo, and a plurality of divided areas of the target image 1a together with the divided area. When it is determined that the target image 1a is included in the input image 1b by detecting another divided region associated with the region, the target image 1a is located in the input image 1b at any time and in any direction. It can be detected whether it exists.
[0130]
Further, when the target image 1a is divided into a large number of regions, for example, in step S56 of FIG. 19, a plurality of partial regions of the target image 1a and input corresponding to the position. The variable Q may be updated by calculating only the similarity between the plurality of divided regions of the image 1b that correspond to each other in position.
[0131]
The target image is divided into regions by an image processing device different from the image processing device that takes in an input image to be determined whether or not the target image is included and divides the region, and only the division result is obtained. As the divided area table, the input image may be written in a memory of an image processing apparatus that divides the input image.
[0132]
The above-described example is a case where the input image is divided into regions by the K-average algorithm. However, the K-average algorithm generally calculates the distances between all the pixels of the input image and all the new region centers. When the input image size is large, a large work area or divided area buffer is required, and the area dividing process takes a long time.
[0133]
In view of this, the inventor first invented a method to be called a divided K-average algorithm, which can generally divide a large-sized input image at high speed by a small-sized work area or divided-region buffer. This was proposed by No. 6-96328.
[0134]
In this divided K-average algorithm, the input image is divided into a plurality of middle regions, and each middle region is divided into regions by the K-average algorithm. However, the input image is simply divided into a plurality of middle regions, If the middle region is divided into regions, the connection of the regions finally divided at the boundary of each middle region will deteriorate, so a boundary region is provided between each middle region, and each middle region area In the division, all boundary regions in contact with the middle region are divided together.
[0135]
Also in the example shown in FIG. 1 of the present invention, the input image can be divided into regions by this divided K-average algorithm.
[0136]
Note that the pixel size of the image direction detection unit 30 is not necessarily limited to 3 × 3 pixels as illustrated in FIGS. 2 and 3. Further, not only from the input image data l but also, for example, the input image data l, a, and b are added, the image direction of the input image is detected from the input image data of the addition result, and the image direction component d1 is extracted. it can. Furthermore, the present invention can be applied to a case where the input image is a full-color image expressed in an RGB color space other than the Lab color space, for example, and can also be applied to a single-color image such as a monochrome image. it can.
[0137]
【The invention's effect】
As described above, according to the present invention, candidate target images can be accurately extracted from an arbitrary input image, and it is determined in a short time whether the target image is included in the arbitrary input image. be able to.
[Brief description of the drawings]
FIG. 1 is a functional block diagram illustrating an example of an image processing apparatus according to the present invention.
FIG. 2 is a functional block diagram illustrating an example of the image direction detection unit.
FIG. 3 is a diagram for explaining detection of an image direction.
FIG. 4 is a diagram for explaining detection of an image direction.
FIG. 5 is a diagram illustrating a relationship between a value of an image direction component and an image direction.
FIG. 6 is a diagram illustrating a relationship between values of input image data and image directions.
FIG. 7 is a flowchart showing an overall procedure of area division in an area dividing unit;
FIG. 8 is a diagram illustrating an example of an aspect of initial region division.
FIG. 9 is a diagram illustrating an example of an area division table.
FIG. 10 is a diagram for explaining distance calculation in area division.
FIG. 11 is a diagram for explaining distance calculation in area division;
FIG. 12 is a diagram for explaining a new area division.
FIG. 13 is a diagram illustrating a state in which the shape of each divided region is changed by new region division.
FIG. 14 is a flowchart showing a procedure for calculating a representative image direction component at the center of a new region.
FIG. 15 is a diagram for explaining calculation of a representative image direction component.
FIG. 16 is a diagram for explaining calculation of a representative image direction component.
FIG. 17 is a flowchart showing an overall procedure in an example of an image processing apparatus according to the present invention;
FIG. 18 is a flowchart showing a part of the procedure of image recognition in the image recognition unit.
FIG. 19 is a flowchart showing another part of the image recognition procedure in the image recognition unit;
FIG. 20 is a flowchart showing the remainder of the image recognition procedure in the image recognition unit.
FIG. 21 is a diagram illustrating an example of a result of area division of a target image.
FIG. 22 is a diagram illustrating an example of a result of area division of an input image.
FIG. 23 is a diagram illustrating an example of a divided area table as a result of area division of a target image.
FIG. 24 is a diagram illustrating an example of a divided region table as a result of region division of an input image.
FIG. 25 is a diagram illustrating an example of a divided region table after conversion into polar coordinates as a result of region division of a target image.
FIG. 26 is a diagram illustrating an example of a divided area table after conversion into polar coordinates as a result of area division of an input image.
[Explanation of symbols]
10 Image input section
30 Image direction detector
40 area division
50 partitioned area buffer
60 Image recognition unit
1a Target image
1b Input image

Claims (1)

入力画像を多数の領域に分割するとともに、それぞれの分割領域の画像方向を抽出する領域分割部と、
対象画像を複数の領域に分割するとともに、それぞれの分割領域の画像方向を抽出することにより得られた、対象画像の分割結果と、上記領域分割部により得られた、入力画像の分割結果とから、入力画像中に対象画像が含まれているか否かを判定する画像認識部と、
を備え、
上記画像認識部は、
対象画像の複数の分割領域中の指定された分割領域の画像方向にもとづいて、対象画像の複数の分割領域の相対的位置関係を検出する手段と、
入力画像の多数の分割領域中の、対象画像の上記指定された分割領域と画素値が同一の、または近似する分割領域を含む、対象画像の複数の分割領域の相対的位置関係と同一の、または近似する相対的位置関係を有する複数の分割領域を選出する手段と、
対象画像の複数の分割領域と入力画像の上記選出された複数の分割領域とを比較して、入力画像中に対象画像が存在するか否かを判断する手段と、
を有する画像処理装置。
An area dividing unit that divides an input image into a number of areas and extracts the image direction of each divided area;
From the division result of the target image obtained by dividing the target image into a plurality of regions and extracting the image direction of each divided region, and the division result of the input image obtained by the region division unit An image recognition unit that determines whether or not the target image is included in the input image;
With
The image recognition unit
Means for detecting a relative positional relationship between the plurality of divided regions of the target image based on the image direction of the designated divided region among the plurality of divided regions of the target image;
Among the multiple divided areas of the input image, the same as the relative positional relationship of a plurality of divided areas of the target image including the divided areas having the same or approximate pixel values as those of the specified divided area of the target image. Or means for selecting a plurality of divided regions having approximate relative positional relationships;
Means for comparing the plurality of divided regions of the target image with the selected plurality of divided regions of the input image to determine whether the target image exists in the input image;
An image processing apparatus.
JP08167695A 1995-03-14 1995-03-14 Image processing device Expired - Fee Related JP3637927B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP08167695A JP3637927B2 (en) 1995-03-14 1995-03-14 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP08167695A JP3637927B2 (en) 1995-03-14 1995-03-14 Image processing device

Publications (2)

Publication Number Publication Date
JPH08249468A JPH08249468A (en) 1996-09-27
JP3637927B2 true JP3637927B2 (en) 2005-04-13

Family

ID=13752963

Family Applications (1)

Application Number Title Priority Date Filing Date
JP08167695A Expired - Fee Related JP3637927B2 (en) 1995-03-14 1995-03-14 Image processing device

Country Status (1)

Country Link
JP (1) JP3637927B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4190739B2 (en) 2001-02-19 2008-12-03 日本電気株式会社 Image feature value generating apparatus and method, and storage medium storing image feature value generating program
CN113706468A (en) * 2021-07-27 2021-11-26 河北光兴半导体技术有限公司 Glass defect detection method based on BP neural network

Also Published As

Publication number Publication date
JPH08249468A (en) 1996-09-27

Similar Documents

Publication Publication Date Title
CN110678901B (en) Information processing apparatus, information processing method, and computer-readable storage medium
JP2776295B2 (en) Image index generation method and image index generation device
JP4127594B2 (en) Image processing method and apparatus
JP3614324B2 (en) Image interpolation system and image interpolation method
JPH0750752A (en) Method and device for converting picture density
US20040247179A1 (en) Image processing apparatus, image processing method, and image processing program
JPH11313202A (en) Image processing unit and image processing method
JP2009211490A (en) Image recognition method and image recognition device
US6618500B1 (en) Color conversion matrix based on minimal surface theory
RU2004121993A (en) SEGMENTATION OF IMAGES USING THE WATER DISTRIBUTION METHOD
JP3637927B2 (en) Image processing device
JP3708042B2 (en) Image processing method and program
CN111612797B (en) Rice image information processing system
CN112258561A (en) Matching point acquisition method for image stitching
JP2936599B2 (en) Color image processing equipment
Chamorro-Martinez et al. A fuzzy colour image segmentation applied to robot vision
JP7230608B2 (en) Change point detection device, change point detection method, and change point detection program
JPH08202877A (en) Picture recognition device
Lagodzinski et al. Fast digital image colorization technique
JPS61289386A (en) Contrast conversion control system
JPH08161504A (en) Image processor
JPH08161521A (en) Image processor
JPH06266897A (en) Processing system for extracting character string image from character string with background
JP4129320B2 (en) Image processing apparatus and recording medium
JP6572180B2 (en) Image processing method, image processing apparatus, and program

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041216

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: 20041222

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050104

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: 20080121

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090121

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100121

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110121

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees