JP3608771B2 - Rotation angle detection method, apparatus and recording medium - Google Patents
Rotation angle detection method, apparatus and recording medium Download PDFInfo
- Publication number
- JP3608771B2 JP3608771B2 JP35138198A JP35138198A JP3608771B2 JP 3608771 B2 JP3608771 B2 JP 3608771B2 JP 35138198 A JP35138198 A JP 35138198A JP 35138198 A JP35138198 A JP 35138198A JP 3608771 B2 JP3608771 B2 JP 3608771B2
- Authority
- JP
- Japan
- Prior art keywords
- rotation angle
- pattern image
- rotation
- calculated
- zernike
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Length Measuring Devices With Unspecified Measuring Means (AREA)
- Image Analysis (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、画像中から特定パターンの回転角度を検出する回転角度検出方法、装置および回転角度検出プログラムを記録した記録媒体に関する。
【0002】
【従来の技術】
本出願人は先に、ツェルニケ・モーメントの特性を利用して、パターン画像の回転角度を精度よく検出する回転角度検出方法を提案した(特願平10−4224号)。以下、先の出願で提案した方法について説明する。
【0003】
図6は、上記出願の実施例の構成を示す。また、図7は、上記出願の実施例の処理フローチャートである。画像入力部11には、パターン(例えば、図13、14)が入力される。そして、そのようなパターンが入力されたとき、その中心座標が与えられ、パターン画像が正規化されているものとする(ステップ201)。なお、入力画像は2値画像を対象とするが、入力画像がカラー画像であるときは、その明度を求め、明度を所定の閾値とを比較することによって2値画像を作成して用いる。
【0004】
積和演算部12は、パターン画像の中心座標と、ツェルニケ多項式テーブル13の中心との位置合わせを行う(ステップ202)。位置合わせ後に、パターン画像の各画素値と上記テーブルの対応する値との積和計算を行い、ツェルニケ・モーメント(以下、ZM)を算出する(ステップ203)。
【0005】
ここでは、パターン画像と、予め用意された3種類のツェルニケ多項式テーブル(以下、ZPT)13との積和計算を行う。図8、9、10は、ZPTの例を示す。これらの図では、白画素が−63、黒画素が63の値を示す(中間調のグレー(周辺の色の部分)が0の値を示している)。また、円の中心がZPTの中心座標(0,0)、X軸は右側に正、Y軸は上側に正とする。
【0006】
図8は、3次1階のZPTを示す。(a)はその実数部であり、(b)はπ/2の回転関係にある虚数部である。なお、階は、円周上の周期数を表わし、1階は周期数が1(白から黒)であるので、以下周期1のZPTという。
【0007】
図9は、4次2階のZPT(周期数が2、以下周期2のZPT)を示し、(a)はその実数部であり、(b)はπ/4の回転関係にある虚数部である。
【0008】
図10は、6次4階のZPT(周期数が4、以下周期4のZPT)を示し、(a)はその実数部であり、(b)はπ/8の回転関係にある虚数部である。
【0009】
図11は、ZPT(ここでは、実数部用テーブル)31と画像32の対応画素値とが掛け合わされることにより、ZMの実数部33が得られる例を示す。
【0010】
すなわち、入力画像は2値画像であるので、入力画像の黒画素に対応するZPTの画素値の総和を算出する。上記したように、本実施例のZPTは、周期1、2、4の3種類のテーブルで構成されているので、総和の処理は、
周期数1の実数部ZPT、周期数1の虚数部ZPT
周期数2の実数部ZPT、周期数2の虚数部ZPT
周期数4の実数部ZPT、周期数4の虚数部ZPT
のそれぞれについて行い、全部で6個のZMが算出される(ステップ203、204)。なお、上記した例では周期1、2、4を順番に処理したが、これらを並列に処理することも可能である。また、周期数は上記したものに限定されず、他の周期数を用いてもよい。さらに、上記した例は2値画像の例であるが、多値画像でも同様に処理することができる。
【0011】
以後、
周期数1のZPTから求められた実数部ZMをZmr1、周期数1のZPTから求められた虚数部ZMをZmi1、
周期数2のZPTから求められた実数部ZMをZmr2、周期数2のZPTから求められた虚数部ZMをZmi2、
周期数4のZPTから求められた実数部ZMをZmr4、周期数4のZPTから求められた虚数部ZMをZmi4、
と表わす。
【0012】
ZM算出部14は、各周期について以下の式で定義されるZMの大きさを算出する(ステップ205)。それぞれのZMの大きさは回転不変な値である。
【0013】
周期数1のZPTから求められたZMの大きさZmag1=〔Zmr1〕2+〔Zmi1〕2
周期数2のZPTから求められたZMの大きさZmag2=〔Zmr2〕2+〔Zmi2〕2
周期数4のZPTから求められたZMの大きさZmag4=〔Zmr4〕2+〔Zmi4〕2
次いで、ZM判定部15は、辞書16に登録されているパターンのZMの大きさと照合することにより、ZMの大きさの妥当性を判定する。
【0014】
すなわち、所定の閾値をTh1、Th2としたとき、周期1のZmag1が
Th2<Zmag1<Th1
であるか否かを調べ(ステップ206)、
周期2についても同様に、所定の閾値をTh3、Th4としたとき、周期2のZmag2が
Th4<Zmag2<Th3
であるか否かを調べ(ステップ207)、
周期4についても同様に、所定の閾値をTh5、Th6としたとき、周期4のZmag4が
Th6<Zmag4<Th5
であるか否かを調べ(ステップ208)、Zmag1、Zmag2、Zmag4の全てが上記した条件を満たすときのみ、以降の処理を実行し、そうでないときは処理を終了する。
【0015】
次いで、評価値算出部17は、各周期の評価値を算出する(ステップ209)。ここで、評価値は、(ZMの大きさ)×周期数(階数)で表わす。例えば、周期1の評価値はZmag1×周期数(階数=1)となる。
【0016】
回転角度算出部18は、周期1の実数部Zmr1(または虚数部Zmi1)から回転角度θ1を算出し、周期2の実数部Zmr2(または虚数部Zmi2)から回転角度θ2を算出し、周期4の実数部Zmr4(または虚数部Zmi4)から回転角度θ4を算出する(ステップ210)。
【0017】
以下に、各周期(階数)における回転角度の算出について説明する。
周期1(階数1)における回転角度の算出;
周期が1の場合には、入力画像から算出されたツェルニケ・モーメントを基に0〜2πの間で一意に回転角度が求められる(入力画像が円周方向に周期性がある場合には、入力画像の周期数分の回転角度が求まることになるが、回転角度算出後の処理においては何れの回転角度を用いても、回転角度に基づいて画像を補正した場合に同じ画像が得られる)。
【0018】
精度良く回転角度を算出するために、周期1の実数部Zmr1、または虚数部Zmi1の内、絶対値の小さい方(回転角度の変化に対する、実数部Zmr1の変化率、虚数部Zmi1の変化率の大きい方)を用いて算出する。そして、回転角度を算出する際には、回転角度とツェルニケ・モーメントの関係を用いる。
【0019】
図12は、回転角度とツェルニケ・モーメントの関係を示す図であり、(a)は3次1階、(b)は4次2階、(c)は6次4階の場合の両者の関係を示す。横軸の回転角度は1周(2π)を296に量子化したものであり、縦軸はツェルニケ・モーメントの実数部である(図示しないツェルニケ・モーメントの虚数部は、実数部に対してπ/2だけ位相がずれている)。この図は、例えば360度を360等分し、辞書作成画像を1度ずつ回転させたとき(1度、2度、3度...360度)のZMの実数部を計算した値を収集(テーブル化)することによって得られる。従って、ある入力画像とZPTとの積和から求められた実数部を用いてテーブルを参照することにより、入力画像の回転角度が求められる。
【0020】
なお、回転角度の算出方法としては、この他にtanφ=ZMの虚数部/ZMの実数部であるので、φ=arctan(ZMの虚数部/ZMの実数部)、φ=arcsin(ZMの虚数部/ZMの大きさ)などで求めてもよい。
【0021】
具体的な手順を次に示す。
(1)入力画像からツェルニケ・モーメント(実数部Zmr1、虚数部Zmi1)を算出する。
(2)実数部Zmr1、虚数部Zmi1の内、絶対値の小さいツェルニケ・モーメントを選択する。
(3)選択されたツェルニケ・モーメントが、各回転角度毎のツェルニケ・モーメントの内で最も値の近いデータを検出し、そのときの回転角度を入力画像の回転角度とする。例えば(a)において、選択されたツェルニケ・モーメントの実数部に最も近い値がRe1であるとき、回転角度はθ1となる。
【0022】
周期2(階数2)における回転角度の算出;
周期が2の場合には、入力画像から算出されたツェルニケ・モーメントを基に0〜2πの間で2つの回転角度の候補が求まる。2つの内、1つは正しい回転角度であるが、もつ1つはツェルニケ・モーメントの周期性から現われるもので、正しく画像の回転角度を表わしているものではない。
【0023】
従って、回転角度を算出する処理は、0〜πの間で前述した周期1の場合と同様に行う。0〜πの間で算出された回転角度と、それにπを加えた角度が周期2における回転角度の候補となる。
【0024】
入力画像が特定パターンであって誤差がない場合には、周期1で算出した回転角度と周期2で算出した回転角度は等しくなる。ここでは誤差は小さい(π/2未満)ものとして周期2で得られる2つの回転角度の候補の内、周期1の回転角度に近い方を周期2の回転角度とする。図12(b)の例では、θ1に近いθ2が周期2における回転角度となる。
【0025】
周期4(階数4)における回転角度の算出;
周期2の場合と同様にして、周期が4の場合には0〜2πの間で4つの回転角度の候補が求まる。周期4では0〜π/2の間で前述した周期1の場合と同様にして回転角度を求め、この回転角度およびこの回転角度にπ/2、π、3π/2を加えた角度を4つの回転角度の候補とする。
【0026】
4つの回転角度の候補から回転角度を選択する場合には、やはり誤差が相対的に小さいものとして周期1あるいは周期2の回転角度を参照して周期4の回転角度を求める。
【0027】
参照する回転角度を(周期1の回転角度、周期2の回転角度から1つに)定めるために、上記した評価値を用いる。周期1に対する評価値が周期2に対する評価値よりも大きい場合には、周期4で得られる4つの回転角度の内、周期1の回転角度に最も近いものを周期4の回転角度とする。同様に、周期2に対する評価値が周期1に対する評価値よりも大きい場合には、周期2の回転角度に最も近いものを周期4の回転角度とする。このようにして算出された各周期1、2、4の回転角度をθ1、θ2、θ4とする。
【0028】
続いて、回転角度選択部19は、ステップ209で算出された3個の評価値の内、最も大きな評価値をとる回転角度を選択する(ステップ211)。
【0029】
そして、角度差判定部20は、上記した回転角度θ1とθ2との差をθaとし、θ2とθ4との差をθbとし、θ1とθ4との差をθcとしたとき、
θa+2θb+2θc<Th(所定の閾値)
を満たか否かを判定し(ステップ212)、上記条件を満たすとき、回転角度出力部21はステップ211で選択された回転角度を出力し(ステップ213)、そうでないとき処理を終了する。
【0030】
【発明が解決しようとする課題】
上記した出願では、図12(a)〜(c)に示すように、周期数2のツェルニケ・モーメントを用いて回転角度を算出する場合において、周期数2のツェルニケ・モーメントから求められる2つの回転角度(丸付き数字2)から正しい回転角度を選ぶために、周期数1のツェルニケ・モーメントから算出される回転角度を参照する必要があった。
【0031】
また、同様に、周期数4のツェルニケ・モーメントを用いて回転角度を算出する場合にも、周期数4のツェルニケ・モーメントから求められる4つの回転角度(丸付き数字3)から正しい回転角度を選ぶために、周期数1と周期数2のツェルニケ・モーメントから算出される回転角度を参照する必要がある。このように、上記提案した方法は、回転角度を精度よく検出するために処理量が多くなってしまう。
【0032】
本発明は上記提案した発明を改良するものであり、
本発明の目的は、より少ない処理量によって回転角度を検出する回転角度検出方法、装置および記録媒体を提供することにある。
【0033】
【課題を解決するための手段】
前記目的を達成するために、請求項1記載の発明では、複数の回転角度が算出される次数/階数のツェルニケ・モーメントを用いて画像中のパターン画像の回転角度を検出する回転角度検出方法であって、前記パターン画像中で回転の影響を受けずパターン画像中の特定の位置に算出される座標の組を特徴量として算出し、該特徴量を用いて、前記ツェルニケ・モーメントにより算出される複数の回転角度から1つの回転角度を選択することを特徴としている。
【0034】
請求項2記載の発明では、前記パターン画像中の特定の位置に算出される座標としてパターン画像の中心を用いることを特徴としている。
【0035】
請求項3記載の発明では、前記パターン画像中の特定の位置に算出される座標としてパターン画像の重心を用いることを特徴としている。
【0036】
請求項4記載の発明では、パターン画像中で回転の影響を受けずパターン画像中の特定の位置に算出される座標の組を用い、該座標間の距離が近いとき、階数の少ないツェルニケ・モーメントから算出される回転角度を参照して1つの回転角度を選択し、前記座標間の距離が遠いとき、請求項1記載の特徴量を用いて、階数の多いツェルニケ・モーメントにより算出された複数の回転角度から1つの回転角度を選択することを特徴としている。
【0037】
請求項5記載の発明では、パターン画像を入力する手段と、前記パターン画像の次数、階数が異なる複数のツェルニケ・モーメントを算出する手段と、階数が2以上のツェルニケ・モーメントを用いたとき、該ツェルニケ・モーメントを基に複数の回転角度を算出する手段と、前記パターン画像中で回転の影響を受けずパターン画像中の特定の位置に算出される座標の組を特徴量として算出する手段と、該特徴量を用いて、前記複数の回転角度から1つの回転角度を選択する手段と、該選択された回転角度を前記入力されたパターン画像の回転角度として出力する手段とを備えたことを特徴としている。
【0038】
請求項6記載の発明では、パターン画像を入力する手段と、前記パターン画像の次数、階数が異なる複数のツェルニケ・モーメントを算出する手段と、特定パターンについて使用すべきツェルニケ・モーメントの階数を含む情報を格納した手段と、前記格納手段内の階数のツェルニケ・モーメントを基に複数の回転角度を算出する手段と、前記パターン画像中で回転の影響を受けずパターン画像中の特定の位置に算出される座標の組を特徴量として算出する手段と、該特徴量を用いて、前記複数の回転角度から1つの回転角度を選択する手段と、該選択された回転角度を前記入力されたパターン画像の回転角度として出力する手段とを備え、前記格納手段からなる第1の構成部分と、前記格納手段を除いた他の手段からなる第2の構成部分に分離し、前記第1の構成部分と第2の構成部分とをネットワークを介して接続したことを特徴としている。
【0039】
請求項7記載の発明では、パターン画像を入力する機能と、前記パターン画像の次数、階数が異なる複数のツェルニケ・モーメントを算出する機能と、階数が2以上のツェルニケ・モーメントを用いたとき、該ツェルニケ・モーメントを基に複数の回転角度を算出する機能と、前記パターン画像中で回転の影響を受けずパターン画像中の特定の位置に算出される座標の組を特徴量として算出する機能と、該特徴量を用いて、前記複数の回転角度から1つの回転角度を選択する機能と、該選択された回転角度を前記入力されたパターン画像の回転角度として出力する機能をコンピュータに実現させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体であることを特徴としている。
【0040】
【発明の実施の形態】
以下、本発明の一実施例を図面を用いて具体的に説明する。
(実施例1)
本発明においては、周期数2あるいは周期数4のツェルニケ・モーメントを用いて回転角度を算出する場合に、複数算出される回転角度から正しいものを選び出すとき、より周期数の少ないツェルニケ・モーメントから算出された回転角を参照するのではなく、ツェルニケ・モーメントを用いた方法よりも、軽い処理で高速に回転角を算出できる手法を用いることにより、処理の軽減を図る。
【0041】
図1は、本発明の実施例1の構成を示す。図において、画像入力部1、積和演算部2、ツェルニケ多項式テーブル3、ツェルニケ・モーメント算出部4、ツェルニケ・モーメント判定部5、辞書6、回転角度出力部9は、前述した出願のものと同様である。
【0042】
本発明では、先の出願の回転角度算出部を、第1の回転角度算出部7に置き換え、また、第2の回転角度算出部8を設けている。
【0043】
図2は、本発明の実施例1の処理フローチャートである。ステップ108までの処理は前掲した出願の処理フローチャートのステップ208までの処理と同様である。第2の回転角度算出部8は、入力パターン画像の中心と重心の位置関係を基に回転角を算出し(ステップ109)、第1の回転角度算出部7は、ステップ109で算出された回転角を用いて、ツェルニケ・モーメントから算出された回転角を選択し、より高精度に回転角を求める(ステップ110)。つまり、複数の回転角が算出される、周期数2以上のツェルニケ・モーメントを用いる場合には、中心と重心の位置関係(つまり、パターン画像中で回転の影響を受けず、パターン画像中の特定の位置に算出される座標の組)から算出された回転角に最も近い、ツェルニケ・モーメントから算出された回転角を選択し、パターン画像の回転角として出力する。
【0044】
入力パターン画像の中心と重心の位置関係から回転角を求める手法について、図3を参照して説明する。重心(Xg、Yg)は以下の式を用いて算出できる。
Xg=Σxf(x,y)/Σf(x,y)
Yg=Σyf(x,y)/Σf(x,y)
図3において、回転角度0の場合のX軸と中心重心間の線分のなす角度をαとする。ここで、入力パターン画像において、X軸と中心重心間の線分のなす角度がβであったとすると、入力パターン画像の回転角度はβ−αで求めることができる。
【0045】
中心と重心から算出される回転角度は、処理が簡単であるものの精度が低い場合が多いので、本発明では、前掲した出願の手法とを組合せて回転角度を算出する。
【0046】
図4の(a)〜(c)は、図12の(a)〜(c)で説明したものと同様である。図4において、例えば周期数4を用いて回転角を算出する場合に、前掲した出願のように周期数1、2の回転角を参照するのではなく、β−αに最も近い回転角(θ4)を選択する。この本発明の方法を用いることにより、従来は周期数4のツェルニケ・モーメントを用いて回転角度を算出する場合に、周期数1、2の回転角を参照する必要があったが、高い周期数のツェルニケ・モーメントを用いる場合でも、1つのツェルニケ・モーメントから算出される複数の回転角度の中から、高精度に回転角度を算出することができる。
【0047】
なお、上記した例では、周期数4を用いた場合であるが、周期数2の場合でも同様であり、周期数1の回転角度を参照する必要がない。また、周期数2または4の何れを用いるかは、例えば以下のように行う。入力パターン画像が特定のパターンであるときには、予め辞書6には、例えば周期数4のツェルニケ・モーメントを用いることが記録されていて、ZM判定部5はツェルニケ・モーメント判定時に、この情報を取得し、第1の回転角度算出部7に渡せばよい。第1の回転角度算出部7は、周期数4の回転角度(図4の(c))のみを算出する。また、辞書6に、周期数1のツェルニケ・モーメントを用いることが記録されている場合には、先願と同様にしてθ1を出力する(図4(a))。
【0048】
また、上記した実施例では最も典型的な例として重心を用いたが、パターン画像の回転の影響を受けずに必ずパターン画像上で同じ点の座標が算出される点であれば、どのような座標を用いてもよい。例えば以下のような座標を用いてもよい。
Xh=Σx2f(x,y)/Σf(x,y)
Yh=Σy2f(x,y)/Σf(x,y)
何れの場合においても、重心あるいは特定の手法により算出された(マーク中の特定の位置に必ず算出される)座標と、中心の位置は所定の閾値以上、離れている方が好ましい。
【0049】
この距離が近い(所定の閾値以下)場合には、従来通り、周期数の少ないツェルニケ・モーメントから算出される回転角度を参照する方法を併用する。つまり、中心と重心の距離が近いパターン画像に対しては従来手法を用い、中心と重心の距離の離れているパターン画像に対しては中心と重心から算出される回転角を用いて周期数の多いツェルニケ・モーメントから算出された回転角を選択する。
【0050】
このように、例えばマーク等の検出システムにおいては、複数のマークが検出対象となる場合が多いので、一部の処理でも本発明の方法を用いることによって、システム全体の高速化が図られる。
【0051】
なお、図1の構成において、辞書6をサーバ側に設け、他の構成部分をクライアント側に設け、クライアント側と辞書とをネットワークを介して接続する構成を採ってもよい。このような構成を採ると、辞書などの情報として常に最新のものを用いることができる。
【0052】
(実施例2)
本発明は上記した実施例に限定されず、ソフトウェアによっても実現することができる。本発明をソフトウェアによって実現する場合には、図5に示すように、CPU、メモリ、表示装置、ハードディスク、キーボード、CD−ROMドライブ、スキャナなどからなるコンピュータシステムを用意し、CD−ROMなどのコンピュータ読み取り可能な記録媒体には、本発明の回転角度の検出機能を実現するプログラムが記録されていて、このプログラムをシステムにインストールする。また、スキャナなどの画像入力手段から入力された画像は一時的にハードディスクなどに格納される。そして、該プログラムが起動されると、一時保存された画像データが読み込まれて、回転角度の検出処理を実行し、その検出結果をディスプレイなどに出力する。また、検出対象となるパターン画像はさまざまな要因で変更になる場合があるため、辞書など情報の一部をネットワークを介してアクセスすることにより、常に最新の情報を用いてシステムを動作させる方法を採る。
【0053】
【発明の効果】
以上、説明したように、本発明によれば、複数の回転角度が算出される周期数2以上のツェルニケ・モーメントを用いて画像中のパターン画像の回転角度を検出するとき、パターン画像の中心と重心から算出される回転角度を参照しているので、より周期数の少ない回転角を参照する必要がなくなり、処理が高速化される。
【図面の簡単な説明】
【図1】本発明の実施例1の構成を示す。
【図2】本発明の実施例1の処理フローチャートである。
【図3】入力パターンの中心と重心から回転角度を求める図である。
【図4】(a)〜(c)は、回転角度の選択を説明する図である。
【図5】本発明の実施例2の構成を示す。
【図6】先願発明の実施例の構成を示す。
【図7】先願発明の実施例の処理フローチャートを示す。
【図8】(a)、(b)は3次1階のZPTを示す。
【図9】(a)、(b)は4次2階のZPTを示す。
【図10】(a)、(b)は6次4階のZPTを示す。
【図11】ZPTと画像の対応画素値とが掛け合わされることにより、ZMが得られる例を示す。
【図12】回転角度とツェルニケ・モーメントの関係を示す図である。
【図13】パターン例を示す。
【図14】図13のパターンが回転している例を示す。
【符号の説明】
1 画像入力部
2 積和演算部
3 ツェルニケ多項式テーブル
4 ZM算出部
5 ZM判定部
6 辞書
7 第1の回転角度算出部
8 第2の回転角度算出部
9 回転角度出力部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a rotation angle detection method and apparatus for detecting a rotation angle of a specific pattern from an image, and a recording medium on which a rotation angle detection program is recorded.
[0002]
[Prior art]
The present applicant has previously proposed a rotation angle detection method for accurately detecting the rotation angle of a pattern image using the characteristics of Zernike moment (Japanese Patent Application No. 10-4224). The method proposed in the previous application will be described below.
[0003]
FIG. 6 shows the configuration of the embodiment of the above application. FIG. 7 is a process flowchart of the embodiment of the above application. A pattern (for example, FIGS. 13 and 14) is input to the image input unit 11. Then, when such a pattern is input, its center coordinate is given and the pattern image is normalized (step 201). Although the input image is a binary image, when the input image is a color image, the brightness is obtained and the binary image is created and used by comparing the brightness with a predetermined threshold value.
[0004]
The product-sum operation unit 12 aligns the center coordinates of the pattern image with the center of the Zernike polynomial table 13 (step 202). After alignment, the product sum of each pixel value of the pattern image and the corresponding value in the table is calculated to calculate Zernike moment (hereinafter referred to as ZM) (step 203).
[0005]
Here, a product-sum calculation is performed on the pattern image and three types of Zernike polynomial tables (hereinafter referred to as ZPT) 13 prepared in advance. 8, 9, and 10 show examples of ZPT. In these figures, white pixels have a value of −63 and black pixels have a value of 63 (halftone gray (a peripheral color portion) has a value of 0). The center of the circle is the ZPT center coordinate (0, 0), the X axis is positive on the right side, and the Y axis is positive on the upper side.
[0006]
FIG. 8 shows the third-order first-floor ZPT. (A) is the real part, and (b) is the imaginary part having a rotational relationship of π / 2. The floor represents the number of cycles on the circumference. Since the number of cycles on the first floor is 1 (white to black), it is hereinafter referred to as ZPT of
[0007]
FIG. 9 shows the fourth-order second-order ZPT (ZPT with a period number of 2 and a period of 2 hereinafter), (a) is the real part thereof, and (b) is the imaginary part having a rotational relation of π / 4. is there.
[0008]
FIG. 10 shows the sixth-order fourth-order ZPT (ZPT with a period number of 4 and a period of 4 hereinafter), (a) is the real part thereof, and (b) is the imaginary part having a rotational relationship of π / 8. is there.
[0009]
FIG. 11 shows an example in which the real part 33 of ZM is obtained by multiplying the ZPT (here, the real part table) 31 and the corresponding pixel value of the
[0010]
That is, since the input image is a binary image, the sum of the pixel values of ZPT corresponding to the black pixels of the input image is calculated. As described above, since the ZPT of this embodiment is composed of three types of tables with
Real part ZPT with
Real part ZPT with
Real part ZPT with
A total of 6 ZMs are calculated (
[0011]
After that
Zmr1 represents the real part ZM obtained from the ZPT having the
Zmr2 represents the real part ZM obtained from the ZPT having the
Zmr4 represents the real part ZM obtained from the ZPT having the
It expresses.
[0012]
The
[0013]
ZM magnitude Zmag1 = [Zmr1] 2 + [Zmi1] 2 obtained from the ZPT having a period of 1
ZM magnitude Zmag2 = [Zmr2] 2 + [Zmi2] 2 obtained from ZPT having a period of 2
ZM magnitude Zmag4 = [Zmr4] 2 + [Zmi4] 2 obtained from the ZPT with a period of 4
Next, the ZM determination unit 15 determines the validity of the ZM size by collating it with the ZM size of the pattern registered in the dictionary 16.
[0014]
That is, when the predetermined threshold values are Th1 and Th2, Zmag1 in
Whether or not (step 206),
Similarly for
(Step 207),
Similarly for
(Step 208), the following process is executed only when all of Zmag1, Zmag2, and Zmag4 satisfy the above-described conditions, and otherwise the process is terminated.
[0015]
Next, the evaluation
[0016]
The rotation
[0017]
Hereinafter, calculation of the rotation angle in each cycle (floor) will be described.
Calculation of rotation angle in period 1 (floor 1);
If the period is 1, the rotation angle is uniquely determined between 0 and 2π based on the Zernike moment calculated from the input image (if the input image is periodic in the circumferential direction, Although the rotation angle corresponding to the number of cycles of the image is obtained, the same image is obtained when the image is corrected based on the rotation angle regardless of which rotation angle is used in the processing after the rotation angle calculation).
[0018]
In order to calculate the rotation angle with high accuracy, the smaller the absolute value of the real part Zmr1 or the imaginary part Zmi1 of period 1 (the change rate of the real part Zmr1 and the change rate of the imaginary part Zmi1 with respect to the change of the rotation angle) Calculate using the larger one). When calculating the rotation angle, the relationship between the rotation angle and Zernike moment is used.
[0019]
FIG. 12 is a diagram showing the relationship between the rotation angle and the Zernike moment, where (a) is the third and first floor, (b) is the fourth and second floor, and (c) is the sixth and fourth floor. Indicates. The rotation angle on the horizontal axis is obtained by quantizing one round (2π) to 296, and the vertical axis is the real part of the Zernike moment (the imaginary part of the Zernike moment (not shown) is π / 2 is out of phase). This figure collects the calculated values of the real part of ZM when 360 degrees is divided into 360 equal parts and the dictionary creation image is rotated by 1 degree (1 degree, 2 degrees, 3 degrees ... 360 degrees) (Table). Therefore, the rotation angle of the input image can be obtained by referring to the table using the real part obtained from the product sum of an input image and ZPT.
[0020]
In addition to this, as a calculation method of the rotation angle, since tan φ = imaginary part of ZM / real part of ZM, φ = arctan (imaginary part of ZM / real part of ZM), φ = arcsin (imaginary number of ZM) Part / ZM size).
[0021]
The specific procedure is as follows.
(1) A Zernike moment (real part Zmr1, imaginary part Zmi1) is calculated from the input image.
(2) A Zernike moment with a small absolute value is selected from the real part Zmr1 and the imaginary part Zmi1.
(3) Data having the closest value among the Zernike moments selected for each rotation angle is detected, and the rotation angle at that time is set as the rotation angle of the input image. For example, in (a), when the value closest to the real part of the selected Zernike moment is Re1, the rotation angle is θ1.
[0022]
Calculation of the rotation angle in period 2 (floor 2);
When the period is 2, two rotation angle candidates are obtained between 0 and 2π based on the Zernike moment calculated from the input image. Of the two, one is the correct rotation angle, but one has the Zernike moment periodicity and does not accurately represent the image rotation angle.
[0023]
Therefore, the process for calculating the rotation angle is performed in the same manner as in the case of the
[0024]
When the input image has a specific pattern and no error, the rotation angle calculated in
[0025]
Calculation of rotation angle in period 4 (floor 4);
Similarly to the case of the
[0026]
When the rotation angle is selected from the four rotation angle candidates, the rotation angle of the
[0027]
In order to determine the rotation angle to be referred to (one from the rotation angle of
[0028]
Subsequently, the rotation angle selection unit 19 selects a rotation angle having the largest evaluation value among the three evaluation values calculated in Step 209 (Step 211).
[0029]
The angle
θa + 2θb + 2θc <Th (predetermined threshold)
Is satisfied (step 212). When the above condition is satisfied, the rotation
[0030]
[Problems to be solved by the invention]
In the above-described application, as shown in FIGS. 12A to 12C, when calculating the rotation angle using the Zernike moment having the
[0031]
Similarly, when calculating the rotation angle using the Zernike moment with the
[0032]
The present invention improves the proposed invention,
An object of the present invention is to provide a rotation angle detection method, apparatus, and recording medium that detect a rotation angle with a smaller amount of processing.
[0033]
[Means for Solving the Problems]
In order to achieve the above object, according to the first aspect of the present invention, there is provided a rotation angle detection method for detecting a rotation angle of a pattern image in an image using a Zernike moment of an order / rank from which a plurality of rotation angles are calculated. Then, a set of coordinates calculated at a specific position in the pattern image without being influenced by rotation in the pattern image is calculated as a feature value, and the feature value is used to calculate the Zernike moment. One rotation angle is selected from a plurality of rotation angles.
[0034]
The invention according to
[0035]
The invention according to
[0036]
The invention according to
[0037]
In the invention according to
[0038]
According to a sixth aspect of the present invention, there is provided means for inputting a pattern image, means for calculating a plurality of Zernike moments having different orders and ranks of the pattern image, and information including the Zernike moment rank to be used for the specific pattern. And means for calculating a plurality of rotation angles based on the Zernike moment of the rank in the storage means, and is calculated at a specific position in the pattern image without being affected by the rotation in the pattern image. Means for calculating a set of coordinates as a feature amount, means for selecting one rotation angle from the plurality of rotation angles using the feature amount, and the selected rotation angle of the input pattern image Means for outputting as a rotation angle, and a first component part comprising the storage means and a second component part comprising other means excluding the storage means Release, is characterized in that the said first component and second component are connected via a network.
[0039]
In the invention according to
[0040]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
Example 1
In the present invention, when calculating the rotation angle using the Zernike moment with the
[0041]
FIG. 1 shows the configuration of
[0042]
In the present invention, the rotation angle calculation unit of the previous application is replaced with a first rotation
[0043]
FIG. 2 is a processing flowchart of the first embodiment of the present invention. The processing up to step 108 is the same as the processing up to step 208 in the processing flowchart of the above-mentioned application. The second rotation
[0044]
A method for obtaining the rotation angle from the positional relationship between the center of the input pattern image and the center of gravity will be described with reference to FIG. The center of gravity (Xg, Yg) can be calculated using the following equation.
Xg = Σxf (x, y) / Σf (x, y)
Yg = Σyf (x, y) / Σf (x, y)
In FIG. 3, an angle formed by a line segment between the X axis and the center of gravity at the
[0045]
Although the rotation angle calculated from the center and the center of gravity is easy to process, the accuracy is often low. Therefore, in the present invention, the rotation angle is calculated in combination with the technique of the above-mentioned application.
[0046]
4A to 4C are the same as those described with reference to FIGS. 12A to 12C. In FIG. 4, for example, when calculating the rotation angle using the
[0047]
In the above example, the number of
[0048]
In the above-described embodiment, the center of gravity is used as the most typical example. However, as long as the coordinates of the same point are always calculated on the pattern image without being affected by the rotation of the pattern image, Coordinates may be used. For example, the following coordinates may be used.
Xh = Σx 2 f (x, y) / Σf (x, y)
Yh = Σy 2 f (x, y) / Σf (x, y)
In any case, it is preferable that the coordinates calculated by the center of gravity or a specific method (which is always calculated at a specific position in the mark) and the center position are separated by a predetermined threshold or more.
[0049]
When this distance is close (below a predetermined threshold value), a method of referring to the rotation angle calculated from the Zernike moment with a small number of cycles is used together as in the past. In other words, the conventional method is used for pattern images where the distance between the center and the center of gravity is close, and for pattern images where the distance between the center and the center of gravity is far away, the rotation number calculated from the center and the center of gravity is used. Select a rotation angle calculated from many Zernike moments.
[0050]
As described above, for example, in a detection system for marks or the like, a plurality of marks are often to be detected. Therefore, the speed of the entire system can be increased by using the method of the present invention even in some processes.
[0051]
1, the
[0052]
(Example 2)
The present invention is not limited to the above-described embodiments, and can be realized by software. When the present invention is realized by software, as shown in FIG. 5, a computer system including a CPU, a memory, a display device, a hard disk, a keyboard, a CD-ROM drive, a scanner, etc. is prepared, and a computer such as a CD-ROM is prepared. A program that realizes the rotation angle detection function of the present invention is recorded on the readable recording medium, and this program is installed in the system. An image input from an image input unit such as a scanner is temporarily stored in a hard disk or the like. When the program is started, the temporarily stored image data is read, a rotation angle detection process is executed, and the detection result is output to a display or the like. Since the pattern image to be detected may change due to various factors, a method of operating the system using the latest information at all times by accessing a part of information such as a dictionary via the network. take.
[0053]
【The invention's effect】
As described above, according to the present invention, when the rotation angle of a pattern image in an image is detected using a Zernike moment with a cycle number of 2 or more in which a plurality of rotation angles are calculated, Since the rotation angle calculated from the center of gravity is referred to, it is not necessary to refer to a rotation angle with a smaller number of cycles, and the processing is speeded up.
[Brief description of the drawings]
FIG. 1 shows a configuration of
FIG. 2 is a process flowchart of
FIG. 3 is a diagram for obtaining a rotation angle from the center and the center of gravity of an input pattern.
4A to 4C are diagrams illustrating selection of a rotation angle. FIG.
FIG. 5 shows a configuration of
FIG. 6 shows a configuration of an embodiment of the prior invention.
FIG. 7 shows a processing flowchart of an embodiment of the invention of the prior application.
FIGS. 8A and 8B show the third-order first-order ZPT.
FIGS. 9A and 9B show the fourth-order second-order ZPT.
FIGS. 10A and 10B show sixth-order fourth-floor ZPTs.
FIG. 11 shows an example in which ZM is obtained by multiplying ZPT and a corresponding pixel value of an image.
FIG. 12 is a diagram showing a relationship between a rotation angle and Zernike moment.
FIG. 13 shows an example pattern.
14 shows an example in which the pattern of FIG. 13 is rotating.
[Explanation of symbols]
DESCRIPTION OF
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP35138198A JP3608771B2 (en) | 1998-12-10 | 1998-12-10 | Rotation angle detection method, apparatus and recording medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP35138198A JP3608771B2 (en) | 1998-12-10 | 1998-12-10 | Rotation angle detection method, apparatus and recording medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000180155A JP2000180155A (en) | 2000-06-30 |
| JP3608771B2 true JP3608771B2 (en) | 2005-01-12 |
Family
ID=18416914
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP35138198A Expired - Fee Related JP3608771B2 (en) | 1998-12-10 | 1998-12-10 | Rotation angle detection method, apparatus and recording medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3608771B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4890904B2 (en) * | 2005-07-05 | 2012-03-07 | Juki株式会社 | Component position detection method and apparatus |
-
1998
- 1998-12-10 JP JP35138198A patent/JP3608771B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000180155A (en) | 2000-06-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5261501B2 (en) | Permanent visual scene and object recognition | |
| US8160366B2 (en) | Object recognition device, object recognition method, program for object recognition method, and recording medium having recorded thereon program for object recognition method | |
| JP3675629B2 (en) | Pattern recognition method, apparatus and recording medium | |
| US20150279048A1 (en) | Method for generating a hierarchical structured pattern based descriptor and method and device for recognizing object using the same | |
| US10275682B2 (en) | Information processing apparatus, information processing method, and storage medium | |
| CN113918744B (en) | Similar image retrieval methods, devices, storage media, and computer program products | |
| Almqvist et al. | Learning to detect misaligned point clouds | |
| CN117474918A (en) | Abnormality detection method and device, electronic device, and storage medium | |
| US20190279022A1 (en) | Object recognition method and device thereof | |
| US20230306791A1 (en) | Method and apparatus with liveness detection | |
| JP2018526754A (en) | Image processing apparatus, image processing method, and storage medium | |
| JP7490886B2 (en) | Information processing device and information processing method | |
| CN106327503B (en) | A method and device for image registration | |
| CN120147599A (en) | Directed rotating target detection method, system, device, storage medium and product | |
| JP5958101B2 (en) | Image processing method and image processing apparatus | |
| WO2018069861A1 (en) | System and method for object recognition based estimation of planogram compliance | |
| JP3608771B2 (en) | Rotation angle detection method, apparatus and recording medium | |
| JP4339037B2 (en) | Pattern detection apparatus, pattern detection method, pattern detection program, and computer-readable recording medium | |
| JP3655101B2 (en) | Rotation angle detection method, apparatus and recording medium | |
| CN101414352A (en) | Information processing apparatus, information processing method, and program | |
| KR101200378B1 (en) | A robust texture feature extraction using the localized angular phase | |
| Villota et al. | Pairwise registration in indoor environments using adaptive combination of 2D and 3D cues | |
| JP2000298728A (en) | Rotation angle detection method, apparatus and recording medium | |
| JP2803930B2 (en) | Circular pattern identification method and device | |
| JP2015162008A (en) | Information processing device, information processing system, information processing method, and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20040713 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20040720 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20040823 |
|
| 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: 20041005 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20041008 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071022 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081022 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081022 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091022 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101022 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111022 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121022 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131022 Year of fee payment: 9 |
|
| LAPS | Cancellation because of no payment of annual fees |