JP6582618B2 - Template matching program, template matching method, and template matching apparatus - Google Patents
Template matching program, template matching method, and template matching apparatus Download PDFInfo
- Publication number
- JP6582618B2 JP6582618B2 JP2015130252A JP2015130252A JP6582618B2 JP 6582618 B2 JP6582618 B2 JP 6582618B2 JP 2015130252 A JP2015130252 A JP 2015130252A JP 2015130252 A JP2015130252 A JP 2015130252A JP 6582618 B2 JP6582618 B2 JP 6582618B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- pixel
- scale
- captured image
- template matching
- 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.)
- Active
Links
Images
Description
本発明は、テンプレートマッチングプログラム等に関する。 The present invention relates to a template matching program and the like.
従来、対象物を撮影して、撮影された画像から人手を介さずに対象物の検出を行う技術が広く使われている.例えば、道路を走行する車を撮影した画像からの車番の検出が挙げられる。検出結果を利用することで、監視員への車番表示や文字認識手段と組み合わせた車番の自動認識が可能となる。また、人を検出することで、建物への侵入者検知も行うことができる。これらの用途では、検出処理はリアルタイムに行われるため、処理の高速性が重要となる。 Conventionally, a technique for photographing an object and detecting the object from the photographed image without human intervention has been widely used. For example, detection of a car number from an image obtained by photographing a car traveling on a road can be mentioned. By using the detection result, it is possible to automatically recognize the vehicle number in combination with the vehicle number display to the monitoring staff and the character recognition means. Moreover, the intruder detection to a building can also be performed by detecting a person. In these applications, since the detection process is performed in real time, the high speed of the process is important.
対象物の検出を行う基本的な手法として、テンプレートマッチングがある。テンプレートマッチングにおいては、あらかじめ対象物を表すテンプレートを用意しておき、撮影した画像上でそのテンプレートを走査してテンプレートとの類似性が高い箇所を対象物と判定する。外光等の影響を受けにくくするため、画像そのものではなく、画像から特徴を抽出してマッチングを行うことが多い。特徴抽出には例えばエッジ抽出等のフィルタが用いられる。また、対象物は画像内で様々な大きさで写るので、例えば、テンプレートや画像の縮尺を様々に変更して繰り返しマッチングが行われる。 There is a template matching as a basic method for detecting an object. In template matching, a template representing an object is prepared in advance, and the template is scanned on the photographed image to determine a portion having high similarity to the template as the object. In order to reduce the influence of external light or the like, matching is often performed by extracting features from the image, not the image itself. For feature extraction, for example, a filter such as edge extraction is used. In addition, since the object is captured in various sizes in the image, for example, the matching is repeatedly performed by changing the scale of the template or the image in various ways.
しかしながら、上述した従来技術では、テンプレートや画像の縮尺を様々に変えてマッチングを行うため、処理量が増えるという問題がある。 However, the above-described conventional technique has a problem that the amount of processing increases because matching is performed by changing the scale of the template or image in various ways.
1つの側面では、本発明は、テンプレートや画像の縮尺を様々に変えることなくマッチングを行うことができるテンプレートマッチングプログラム、テンプレートマッチング方法およびテンプレートマッチング装置を提供することを目的とする。 In one aspect, an object of the present invention is to provide a template matching program, a template matching method, and a template matching apparatus that can perform matching without changing the scale of a template or an image in various ways.
第1の案では、テンプレートマッチングプログラムは、コンピュータに下記の処理を実行させる。コンピュータは、同一形状の複数の物体が撮影された撮影画像を取得する。コンピュータは、撮影画像に含まれる複数の物体に対する基準点の位置を受け付け、物体の基準点の間隔に基づいて、撮影画像の各画素における縮尺を算出する。コンピュータは、撮影画像の各画素における縮尺を基にして、撮影画像を、各画素における縮尺が一定となる補正画像に変換する。コンピュータは、補正画像に対してテンプレートマッチングを実行することで対象物を検出する。 In the first plan, the template matching program causes the computer to execute the following processing. The computer acquires captured images obtained by capturing a plurality of objects having the same shape. The computer receives the positions of the reference points for a plurality of objects included in the captured image, and calculates the scale of each pixel of the captured image based on the interval between the reference points of the objects. The computer converts the photographed image into a corrected image in which the scale of each pixel is constant based on the scale of each pixel of the photographed image. The computer detects an object by executing template matching on the corrected image.
テンプレートや画像の縮尺を様々に変えることなくマッチングを行うことができる。 Matching can be performed without changing the scale of the template or image.
以下に、本願の開示するテンプレートマッチングプログラム、テンプレートマッチング方法およびテンプレートマッチング装置の実施例を図面に基づいて詳細に説明する。なお、この実施例によりこの発明が限定されるものではない。 Hereinafter, embodiments of a template matching program, a template matching method, and a template matching apparatus disclosed in the present application will be described in detail with reference to the drawings. Note that the present invention is not limited to the embodiments.
図1は、本実施例1にかかるシステムの構成を示す図である。図1に示すように、このシステムは、カメラ50および画像処理装置100を有する。画像処理装置100は、テンプレートマッチング装置の一例である。
FIG. 1 is a diagram illustrating the configuration of the system according to the first embodiment. As shown in FIG. 1, this system includes a
カメラ50は、例えば、建物の天井に設置され、広角レンズによって撮影範囲の画像を撮影する装置である。例えば、カメラ50は、防犯カメラに対応するが、これに限定されるものではない。カメラ50は、撮影した画像の情報を、画像処理装置100に送信する。以下の説明において、カメラ50によって撮影された画像の情報を適宜、撮影画像と表記する。
The
画像処理装置100は、テンプレートマッチングを実行して、撮影画像から対象物を検出する装置である。例えば、画像処理装置100は、対象物を検出した場合には、警報等を出力しても良い。
The
ここで、カメラ50が撮影した撮影画像は、広角レンズで撮影されているため、同じ対象物であっても、例えば、撮影画像の上側よりも、撮影画像の下側で対象物が大きくなる場合がある。このため、画像処理装置100は、予め撮影画像の画素毎にそこに対象物が写るときの縮尺を調べておき、各位置での対象物の大きさの違いを打ち消すように、撮影画像を拡大補正してからテンプレートマッチングを実行する。例えば、画像処理装置100は、画像の各画素での補正すべき縮尺を読み込み、読み込んだ縮尺が一定となるように、撮影画像を補正することで補正画像を生成し、補正画像から特徴点を抽出してテンプレートマッチングを実行する。
Here, since the captured image captured by the
本システムに関して、校正時の処理と検出時の処理を実行する。まず、校正時の処理について説明する。まず、作業員は多数の校正物体を建物の様々な場所に置く。建物天井に設置されたカメラ50が、校正物体の画像を撮影する。
For this system, calibration processing and detection processing are executed. First, processing during calibration will be described. First, the worker places a large number of calibration objects at various locations in the building. A
画像処理装置100は、カメラ50から取得した撮影画像を、ディスプレイ(図示せず)に表示する。かかる撮影画像には、複数の校正物体が含まれる。作業員は、表示された校正物体上の定められた2つの基準点をマウス(図示せず)の操作によって指示する。画像処理装置100は、作業員によって指示された基準点を読み込む。画像処理装置100は、指示された基準点に基づき、撮影画像の各画素での補正すべき縮尺を算出する。画像処理装置100は、撮影画像全体を補正する補正パラメータを決定し、補正パラメータを保存する。
The
次に、検出時の処理について説明する。建物天井に設置されたカメラ50は、例えば、人を含む建物内の画像を撮影する。画像処理装置100は、校正時の処理で保存しておいた補正パラメータに基づいて撮影画像全体を補正することで、補正画像を生成する。画像処理装置100は、補正画像から特徴を抽出し、内部に保持したテンプレートを用いてテンプレートマッチングを行い人の位置を検出する。画像処理装置100は、検出結果を出力する。
Next, processing at the time of detection will be described. The
次に、画像処理装置100の構成の一例について説明する。図2は、本実施例1にかかる画像処理装置の構成を示す機能ブロック図である。図2に示すように、画像処理装置100は、カメラ50に接続される。画像処理装置100は、取得部110、校正物体表示部120、校正情報入力部130、局所変換算出部140、大域変換決定部150、補正パラメータ記憶部160を有する。画像処理装置100は、補正画像生成部170、テンプレートマッチング実行部180、検出結果出力部190を有する。
Next, an example of the configuration of the
カメラ50は、図1に示したカメラ50に対応するものである。例えば、カメラ50は、CMOS(Complementary MOS)カメラまたはCCD(Charge-Coupled Device)カメラであることが好ましい。カメラ50の撮影結果は、撮影画像として表現される。
The
撮影画像は、多数の画素から構成された2次元の配列であり、各画素は光の強度に応じた値(画素値)を持つ。カラー画像の場合には各画素は例えばR、G、Bに応じた3つの値を持つ。各画素は、その座標値で特定される。座標値は、例えば左上端の画素を(0,0)とし、画像右側ほど第1成分が大きく、画像下側ほど第2成分が大きくなると定める。画素の座標値は離散的な値を取り、例えば非負の整数値で表される。 A captured image is a two-dimensional array composed of a large number of pixels, and each pixel has a value (pixel value) corresponding to the intensity of light. In the case of a color image, each pixel has three values corresponding to R, G, and B, for example. Each pixel is specified by its coordinate value. For example, the coordinate value is defined such that the upper left pixel is (0, 0), the first component increases toward the right side of the image, and the second component increases toward the bottom of the image. The coordinate value of the pixel takes a discrete value and is represented by, for example, a non-negative integer value.
図3および図4は、撮影画像の一例を示す図である。図3に示す撮影画像10は、校正時の処理で、カメラ50によって撮影された画像である。例えば、図3に示すように、撮影画像10には、複数の校正物体10a〜10tが含まれる。校正物体10a〜10tは、同一形状であるが、広角レンズで撮影されているため、上側の校正物体よりも下側の校正物体の方が大きく写っている。
3 and 4 are diagrams illustrating an example of a captured image. A captured
図4に示す撮影画像20は、検出時処理で、カメラ50によって撮影された画像である。例えば、図4に示すように、撮影画像20には、複数の人20a〜20dが含まれる。例えば、図3および図4に示す撮影画像10,20のサイズは、640×480である。
A captured
図2の説明に戻る。取得部110は、カメラ50から撮影画像を取得する処理部である。取得部110は、校正時の処理で撮影された撮影画像を、校正物体表示部120に出力する。取得部110は、検出時の処理で撮影された撮影画像を、補正画像生成部170に出力する。
Returning to the description of FIG. The
校正物体表示部120は、校正時の処理で撮影された撮影画像をディスプレイ等に表示する処理部である。例えば、校正時の処理で撮影された撮影画像は、図3に示す撮影画像10である。校正物体表示部120は、校正物体10a〜10tを見やすくなるように、撮影画像の明るさを変える等の処理を実行しても良い。
The calibration object display unit 120 is a processing unit that displays a captured image captured by the process at the time of calibration on a display or the like. For example, the photographed image photographed in the calibration process is the photographed
作業員は、ディスプレイに表示された撮影画像10を参照し、画像処理装置100に接続されたマウス等の入力装置を操作して、校正物体毎に定まった2つの基準点を指定する。図5は、本実施例1にかかる基準点の位置を説明するための図である。図5では、校正物体の一例として、校正物体10aを示す。基準点は、例えば、校正物体10aの左上1aと、校正物体10aの右上1bとする。以下の説明では、適宜、校正物体の左上の基準点を、1番目の基準点と表記し、右上の基準点を2番目の基準点と表記する。
The worker refers to the captured
校正情報入力部130は、校正物体毎に作業員に指定された1番目の基準点と、2番目の基準点の座標値を読み込み、座標値テーブルを生成する処理部である。図6は、本実施例1にかかる座標値テーブルのデータ構造の一例を示す図である。図6に示すように、この座標値テーブル130aは、校正物体番号と、1番目の基準点の座標と、2番目の基準点の座標とを対応付ける。校正物体番号は、校正物体を一意に識別する番号である。校正情報入力部130は、座標値テーブル130aを、局所変換算出部140に出力する。
The calibration
局所変換算出部140は、座標値テーブル130aを基にして、撮影画像上の局所的な縮尺を算出する処理部である。ここで、局所的な縮尺は、撮影画像上の校正物体が存在する位置の縮尺である。例えば、局所変換算出部140は、下記の処理を実行する。
The local
局所変換算出部140は、着目する基準点を、座標値テーブル130aの先頭とすることで、初期化を行う。局所変換算出部140は、1番目の基準点と2番目の基準点との距離で所定値を割ることで、1番目の基準点の位置における縮尺を算出する。局所変換算出部140は、着目する基準点を、座標値テーブル130aの一つ下に移動し、縮尺を算出する処理を繰り返し実行する。局所変換算出部140は、座標値テーブル130aの一番下の基準点に対する縮尺を算出した場合には、処理を終了する。
The local
局所変換算出部140は、縮尺の算出結果を縮尺テーブルに登録する。図7は、本実施例1にかかる縮尺テーブルの一例を示す図である。図7に示すように、縮尺テーブル140aは、点の座標と、縮尺とを対応付ける。点の座標は、1番目の基準点の座標に対応する。局所変換算出部140は、縮尺テーブル140aを、大域変換決定部150に出力する。
The local
ここで、局所変換算出部140は、点の距離として、例えば、ユークリッド距離を用いる。ユークリッド距離は、第1成分の差の2乗と第2成分の差の2乗の和の平方根で定義される。また、上記の所定値としては、例えば校正物体を標準的な位置、向きに置いたときの基準点間の距離を用いる。
Here, the local
大域変換決定部150は、縮尺テーブル140aを基にして、撮影画像を補正画像に変換するための補正パラメータを生成する処理部である。大域変換決定部150は、パラメータを、補正パラメータ記憶部160に格納する。
The global
大域変換決定部150は、例えば、データ補間処理、データ加算処理、逆変換算出処理を順に実行することで、補正パラメータを生成する。
For example, the global
大域変換決定部150が実行するデータ補間処理について説明する。大域変換決定部150は、縮尺テーブル140aに登録された局所的な縮尺を用いて、未知の縮尺を補間することで、撮影画像の全画素に対応する縮尺を算出する。例えば、大域変換決定部150は、式(1)に基づいて、撮影画像の画素(u,v)における縮尺s(u,v)を算出する。式(1)において、作業員に指定された1番目の基準点を(pi,0,qi,0)とする。また、1番目の基準点(pi,0,qi,0)に対応する縮尺をsiとする。i=1,・・・,nは、校正物体の番号である。nは、校正物体の総数を表す。
Data interpolation processing executed by the global
式(1)において、distは、2点間の距離を表す。w(u,v)は、重みを正規化したものであり、式(2)によって定義される。 In equation (1), dist represents the distance between two points. w (u, v) is a normalized weight and is defined by equation (2).
大域変換決定部150は、式(1)、式(2)を用いて、撮影画像の各画素(u,v)の縮尺を算出する。図8は、各画素の縮尺の算出例を示す図である。例えば、図8では、画素30a〜30fを示す。原点の画素を30aとする。画素30aの縮尺を0.8とし、画素30bの縮尺を0.7とし、画素30cの縮尺を0.6とする。画素30dの縮尺を0.8とし、画素30eの縮尺を0.7とし、画素30fの縮尺を0.6とする。
The global
続いて、大域変換決定部150が実行するデータ加算処理について説明する。図9、図10、図11は、本実施例1にかかるデータ加算処理を説明するための図である。大域変換決定部150は、撮影画像の原点と、補正画像の原点とを決めて、撮影画像の原点と、補正画像の原点とを対応させる。例えば、図9に示すように、撮影画像の原点を撮影画像上の画素30aとし、補正画像の原点を補正画像上の画素40aとすると、大域変換決定部150は、画素30aと画素40aとを対応させる。
Next, the data addition process executed by the global
続いて、大域変換決定部150は、原点における縮尺だけはなして、隣接する点を対応させる。例えば、図10に示すように、撮影画像の画素30aから1離れて隣接する画素を画素30bとし、画素30aの縮尺を「0.8」とする。また、図9で説明したように、画素30aは、画素40aに対応付けられているものとする。この場合には、大域変換決定部150は、画素30bに対応する点を、画素40aから「0.8」離れた点40bと対応付ける。すなわち、撮影画像上の座標(1,0)の画素30bは、補正画像上の座標(0.8,0)の点40bに対応する。
Subsequently, the global
また、大域変換決定部150は、画素に対応する縮尺を加算する上記の処理を繰り返し実行することで、順番に点(画素)の対応を求める。これにより、撮影画像の各画素に対して、その画素が対応する補正画像の点の座標値が定まる。ただし、補正画像の点の座標値は、必ずしも整数になるとは限らない。
In addition, the global
図11に、撮影画像上の画素と、この画素に対応付けた補正画像の座標値との関係を示す。例えば、撮影画像の画素30aに対応する補正画像の点の座標値は(0,0)となる。撮影画像の画素30bに対応する補正画像の点の座標値は(0.8,0)となる。撮影画像の画素30cに対応する補正画像の点の座標値は(1.5,0)となる。撮影画像の画素30dに対応する補正画像の点の座標値は(0,0.8)となる。撮影画像の画素30eに対応する補正画像の点の座標値は(0.8,0.7)となる。撮影画像の画素30fに対応する補正画像の点の座標値は(1.5,0.6)となる。
FIG. 11 shows the relationship between the pixel on the captured image and the coordinate value of the corrected image associated with this pixel. For example, the coordinate value of the point of the corrected image corresponding to the
例えば、画素30cに対応する補正画像の座標値は、x座標について、画素30aの縮尺「0.8」と、画素30bの縮尺「0.7」を加算した値「1.5」となる。また、画素30dに対応する補正画像の座標値は、y座標について、画素30aの縮尺「0.8」を加算した値「0.8」となる。
For example, the coordinate value of the corrected image corresponding to the
続いて、大域変換決定部150が実行する逆変換算出処理について説明する。上記のデータ加算処理では、撮影画像の画素に対して、その画素が対応する補正画像の点の座標値を求めた。これに対して、逆変換算出処理では、大域変換決定部150は、補正画像の各画素(x,y)に対して、その画素が対応する撮影画像の点の座標値(u,v)を算出する。これは、補正画像を生成する場合に、この対応関係を用いるためである。
Next, the inverse conversion calculation process executed by the global
大域変換決定部150は、補正画像の画素(x,y)に対応する、撮影画像の点の座標値(u(x,y),v(x,y))を、式(3)、式(4)に基づいて算出する。式(3)、(4)について、(ui,j,vi,j)は、撮影画像の各画素を示す。x(ui,j,vi,j),y(ui,j,vi,j)は、撮影画像の画素(ui,j,vi,j)に対応する補正画像の点の座標値を表す。w(x,y)は重みの正規化を表し、式(5)によって定義される。
The global
大域変換決定部150は、式(3)〜式(4)の計算を、補正画像の全ての画素(x,y)について実行し、実行した結果を補正パラメータとして生成する。
The global
図12は、補正パラメータのデータ構造の一例を示す図である。図12に示すように、補正パラメータ160aは、補正画像の画素の座標値と、撮影画像の点の座標値とを有する。例えば、補正画像の画素の座標値(0,0)に対応する、撮影画像の点の座標値は、(u0,0,v0,0)となることが示される。
FIG. 12 is a diagram illustrating an example of the data structure of the correction parameter. As shown in FIG. 12, the
図2の説明に戻る。補正パラメータ記憶部160は、補正パラメータを記憶する記憶部である。 Returning to the description of FIG. The correction parameter storage unit 160 is a storage unit that stores correction parameters.
補正画像生成部170は、撮影画像と補正パラメータ160aとを基にして、補正画像を生成する処理部である。補正画像生成部170は、補正パラメータ160aに示される補正画像の画素の座標値に、撮影画像の座標値の点(画素)を移動させていくことで、補正画像を生成する。例えば、補正画像生成部170は、以下の処理を実行する。
The corrected image generation unit 170 is a processing unit that generates a corrected image based on the captured image and the
補正画像生成部170は、注目画素を補正画像の左上に設定し、補正画像を生成する2次元配列を用意することで、初期化を行う。補正画像生成部170は、補正パラメータを読み込み、補正パラメータから、注目画素に対応する撮影画像の点の座標値を求める。補正画像生成部170は、求めた座標値に最も近い画素の画素値を補正画像の画素値として2次元配列に書き込む。補正画像生成部170は、注目画素の移動を行う。補正画像生成部170は、注目画像を1つ右に移動させ、右端の場合には、1段下の左端に移動し、右下の場合には終了する。補正画像生成部170は、再び、補正パラメータの読み込みを行い、上記処理を繰り返し実行する。 The corrected image generation unit 170 performs initialization by setting the target pixel at the upper left of the corrected image and preparing a two-dimensional array for generating the corrected image. The corrected image generation unit 170 reads the correction parameter and obtains the coordinate value of the point of the captured image corresponding to the target pixel from the correction parameter. The corrected image generation unit 170 writes the pixel value of the pixel closest to the obtained coordinate value into the two-dimensional array as the pixel value of the corrected image. The corrected image generation unit 170 moves the target pixel. The corrected image generation unit 170 moves the image of interest to the right by one, moves it to the left end one step lower in the case of the right end, and ends it in the case of the lower right. The corrected image generation unit 170 reads the correction parameter again and repeats the above processing.
補正画像生成部170は、画素値を計算する場合に、上記の例では、最も近い画素の画素値をそのまま用いたが、複数個の画素の画素値を距離で重み付けして平均した値を用いても良い。例えば、図4に示した撮影画像20を基にして、補正画像生成部170が、補正画像を生成すると、図13に示す補正画像25が生成される。図13は、補正画像の一例を示す図である。補正画像生成部170は、補正画像を、テンプレートマッチング実行部180に出力する。
When calculating the pixel value, the corrected image generation unit 170 uses the pixel value of the nearest pixel as it is in the above example, but uses the average value obtained by weighting the pixel values of a plurality of pixels by the distance. May be. For example, when the corrected image generation unit 170 generates a corrected image based on the captured
なお、本願では主に対象物の写り方が定まっている固定カメラでの撮影を想定しているが、ズーム等の機能を持つカメラであっても、ズーム倍率に応じて補正パラメータを切り替えることで本願が適用可能となる。 Note that this application mainly assumes shooting with a fixed camera in which the way an object is captured, but even with a camera having a zoom function, the correction parameters can be switched according to the zoom magnification. The present application can be applied.
テンプレートマッチング実行部180は、補正画像から特徴を抽出し、テンプレートを走査して対象物を検出する処理部である。テンプレートマッチング実行部180は、マッチング結果を、検出結果出力部190に出力する。例えば、テンプレートマッチング実行部180は、補正画像から特徴を抽出する場合に、フィルタを用いる。
The template
本願で特徴抽出としてフィルタを用いる理由は以下の通りである。フィルタは、どの画素でも同じ演算方法で特徴を抽出する。したがって,補正画像全体に適用しても一部分の画像に適用しても同じ特徴が抽出される。一方、フィルタでない一般の特徴抽出では、画素の位置によって異なる演算が行われる。このため、対象物の候補となる部分画像を切り出して特徴抽出するように特徴が設計されている場合には,補正画像全体で一括して特徴抽出を行うことができない。 The reason why a filter is used for feature extraction in the present application is as follows. The filter extracts features by the same calculation method for every pixel. Therefore, the same feature is extracted regardless of whether it is applied to the entire corrected image or a partial image. On the other hand, in general feature extraction that is not a filter, different calculations are performed depending on the pixel position. For this reason, when a feature is designed so as to extract a feature by cutting out a partial image that is a candidate for an object, feature extraction cannot be performed collectively for the entire corrected image.
検出結果出力部190は、マッチング結果を基にして、人の人数と位置とを出力する処理部である。検出結果出力部190は、人の位置として、例えば、補正画像上での人のテンプレートの中心座標を用いても良い。図14は、検出結果の一例を示す図である。例えば、検出結果には、通し番号と、検出された座標値とが含まれる。通し番号は、検出された人を識別する番号である。検出された座標値は、補正画像上での人のテンプレートの中心座標に対応する。 The detection result output unit 190 is a processing unit that outputs the number and positions of people based on the matching result. The detection result output unit 190 may use, for example, the center coordinates of the person's template on the corrected image as the person's position. FIG. 14 is a diagram illustrating an example of the detection result. For example, the detection result includes a serial number and a detected coordinate value. The serial number is a number for identifying the detected person. The detected coordinate value corresponds to the center coordinate of the human template on the corrected image.
次に、本実施例1にかかる画像処理装置100の処理手順の一例について説明する。図15は、校正時の画像処理装置の処理手順を示すフローチャートである。図15に示すように、画像処理装置100の取得部110は、校正物体を撮影した撮影画像を取得し(ステップS101)、画像処理装置100の校正物体表示部120は、撮影画像を表示する(ステップS102)。
Next, an example of a processing procedure of the
画像処理装置100の校正情報入力部130は、基準点を読み込む(ステップS103)。画像処理装置100の局所変換算出部140および大域変換決定部150は、補正する縮尺を算出し(ステップS104)、大域変換決定部150は、補正パラメータ160aを決定する(ステップS105)。大域変換決定部150は、補正パラメータ160aを、補正パラメータ記憶部160に保存する(ステップS106)。
The calibration
図16は、検出時の画像処理装置の処理手順を示すフローチャートである。図16に示すように、画像処理装置100の取得部110は、撮影画像を取得する(ステップS201)。画像処理装置100の補正画像生成部170は、補正パラメータ160aに基づいて、撮影画像を補正することで、補正画像を生成する(ステップS202)。
FIG. 16 is a flowchart illustrating a processing procedure of the image processing apparatus at the time of detection. As illustrated in FIG. 16, the
画像処理装置100のテンプレートマッチング実行部180は、補正画像に対してテンプレートマッチングを実行する(ステップS203)。画像処理装置100の検出結果出力部190は、テンプレートマッチングの結果を出力する(ステップS204)。
The template
次に、本実施例にかかる画像処理装置100の効果について説明する。画像処理装置100は、撮影画像に含まれる複数の構成物体に対する基準点の位置を受け付け、校正物体の基準点の間隔を基づいて、撮影画像の各画素における縮尺を算出する。画像処理装置100は、各画素の縮尺が一定となるように、撮影画像を補正することで補正画像を生成し、補正画像から特徴点を抽出してテンプレートマッチングを実行する。かかる処理を実行することで、同一の対象物の大きさが位置によらず均一となるため、テンプレートや画像の縮尺を様々に変えてマッチングを行わなくても良くなり、処理量を削減することができる。
Next, effects of the
ここで、汎用性のある従来技術として、撮影画像の縮尺を変えて特徴抽出を何度も行う場合と比較して、本実施例1にかかる画像処理装置100の処理が高速であることについて説明する。図17は、本実施例1にかかる画像処理装置の効果を説明するための図である。
Here, as a conventional technique having versatility, it is described that the processing of the
従来技術では、一つの画素に対して、縮尺を変えて特徴を何度も抽出するため、処理量が多くなる。図17に示す例では、テンプレートと同じ縮尺に揃えて処理を行うべく、下記の処理を行う。従来技術は、撮影画像5の部分画像5aを1.1倍に拡大して、補正部分画像6aを生成し、補正部分画像6aから特徴を抽出した特徴抽出画像7aを生成する。また、従来技術は、撮影画像5の部分画像5bを1.3倍に拡大して、補正部分画像6bを生成し、補正部分画像6bから特徴を抽出した特徴抽出画像7bを生成する。そうすると、ある画素8に対して特徴抽出が2回行われることになる。
In the prior art, since a feature is extracted many times at different scales for one pixel, the processing amount increases. In the example shown in FIG. 17, the following processing is performed in order to perform processing at the same scale as the template. In the conventional technique, the
従来技術における必要な処理量は、1画素あたりの特徴抽出の処理量*補正部分画像の画素数*繰り返し数と見積もられる。例えば、1画素あたりの特徴抽出の処理量が100,補正部分画像の画素数が100*100、繰り返し数が10002の場合、処理量は、100*1002*10002=1012となり、膨大な値になる。これは、単位処理を1ピコ秒できる高速計算機であっても全処理で1秒かかるため,リアルタイム処理としては不十分である。
The required processing amount in the prior art is estimated as processing amount of feature extraction per pixel * number of pixels of the corrected partial image * number of repetitions. For example, the process of feature extraction per pixel is 100, the correction partial images the number of pixels is 100 * 100, if the repetition number is 1000 2,
一方、本実施例にかかる画像処理装置100では、必要な処理量は、1画素あたりの特徴抽出の処理量*補正画像の画素数と見積もられる。上記と同じ数値例に対して、テンプレートマッチングの処理量は,同じ数値例に対して2*1010と見積もられる。このため、単位処理を1ピコ秒で実行できる高速計算機であれば全体で20msで済み、リアルタイム処理が可能となる。
On the other hand, in the
次に、本実施例2にかかる画像処理装置について説明する。システムの構成は、実施例1に示したシステムと同様である。 Next, an image processing apparatus according to the second embodiment will be described. The system configuration is the same as that of the system shown in the first embodiment.
図18は、本実施例2にかかる画像処理装置の構成を示す機能ブロック図である。図18に示すように、画像処理装置200は、カメラ50に接続される。画像処理装置200は、取得部210、校正物体表示部220、校正情報入力部230、局所変換算出部240、大域変換決定部250、補正パラメータ記憶部260を有する。画像処理装置200は、補正画像生成部270、テンプレートマッチング実行部280、検出結果出力部290を有する。
FIG. 18 is a functional block diagram of the configuration of the image processing apparatus according to the second embodiment. As shown in FIG. 18, the
カメラ50、取得部210、校正物体表示部220に関する説明は、図2のカメラ50、取得部110、校正物体表示部120に関する説明と同様である。補正画像生成部270、テンプレートマッチング実行部280、検出結果出力部290に関する説明は、図2の補正画像生成部170、テンプレートマッチング実行部180、検出結果出力部190に関する説明と同様である。
The description regarding the
校正情報入力部230は、校正物体毎に作業員に指定された1番目の基準点と、2番目の基準点と、3番目の基準点との座標値を読み込み、座標値テーブルを生成する処理部である。図19は、本実施例2にかかる基準点位置を説明するための図である。図19では、校正物体の一例として、基準点は、例えば、校正物体10aの左上1aと、校正物体10aの右上1bと、校正物体10aの左下1cとする。以下の説明では、適宜、校正物体の左上の基準点を、1番目の基準点と表記し、右上の基準点を2番目の基準点と表記し、左下の基準点を3番目の基準点と表記する。作業員は、ディスプレイに表示された撮影画像10を参照し、画像処理装置200に接続されたマウス等の入力装置を操作して、校正物体毎に定まった3つの基準点を指定する。
The calibration
図20は、本実施例2にかかる座標値テーブルのデータ構造の一例を示す図である。図20に示すように、この座標値テーブル230aは、校正物体番号と、1番目の基準点の座標と、2番目の基準点の座標と、3番目の基準点の座標とを対応付ける。校正物体番号は、校正物体を一意に識別する番号である。校正情報入力部230は、座標値テーブル230aを、局所変換算出部240に出力する。
FIG. 20 is a diagram illustrating an example of the data structure of the coordinate value table according to the second embodiment. As shown in FIG. 20, the coordinate value table 230a associates the calibration object number, the coordinates of the first reference point, the coordinates of the second reference point, and the coordinates of the third reference point. The calibration object number is a number that uniquely identifies the calibration object. The calibration
局所変換算出部240は、局所的な座標変換として、式(6)を用いる。実施例1の局所変換算出部140は、対象物の縮尺の変化に対応する構成を開示したが、式(6)を用いることで、対象物の向きの変化にも対応することができる。
The local
式(6)において、(δx,δy)Tは、補正画像の点の微小変化を表し、(δu,δv)Tは、撮影画像の点の微小変化を表す。なお、上付きの添え字のTは、行列やベクトルの転置を表す。a,b,c,dは、線形変換のパラメータであり、撮影画像の点(u,v)によって異なる。b=c=0、a=dの場合が、縮尺だけの変換(実施例1の構成等)に対応する。 In Expression (6), (δx, δy) T represents a minute change in the point of the corrected image, and (δu, δv) T represents a minute change in the point of the captured image. Note that the superscript T indicates transposition of a matrix or a vector. “a”, “b”, “c”, and “d” are linear transformation parameters, which differ depending on the point (u, v) of the photographed image. The case of b = c = 0 and a = d corresponds to the conversion with only the reduced scale (configuration of the first embodiment, etc.).
作業員に指定された基準点の3つの組を(pi,0,qi,0)、(pi,x,qi,x)、(pi,y,qi,y)(i=1,・・・,n)とする。校正物体の標準幅をw0、標準高をh0とする。このとき、逆向きの変換パラメータa’,b’,c’,d’を式(7)〜式(10)で定める。 Three sets of reference points designated by the worker are expressed as ( pi, 0 , qi , 0 ), ( pi, x , qi , x ), ( pi, y , qi , y ) (i = 1,..., N). The standard width of the calibration object is w 0 and the standard height is h 0 . At this time, reverse conversion parameters a ′, b ′, c ′, and d ′ are determined by Expressions (7) to (10).
式(6)の線形変換パラメータa,b,c,dは、a’,b’,c’,d’からなる行列の逆行列として定められ、式(11)〜式(14)で表される。ここでは、引数の(pi,0,qi,0)を省略した。 The linear conversion parameters a, b, c, and d in Equation (6) are defined as inverse matrices of a matrix composed of a ′, b ′, c ′, and d ′, and are expressed by Equations (11) to (14). The Here, the argument (p i, 0 , q i, 0 ) is omitted.
局所変換算出部240は、各基準点に対応する局所的な線形変換パラメータa,b,c,dを算出する。局所変換算出部240は、局所的な線形変換パラメータa,b,c,dを、大域変換決定部250に出力する。
The local
大域変換決定部250は、局所的な線形変換パラメータを基にして、撮影画像を補正画像に変換するための補正パラメータを生成する処理部である。大域変換決定部250は、例えば、データ補間処理、データ加算処理、逆変換算出処理を順に実行することで、補正パラメータを生成する。大域変換決定部250は、補正パラメータを補正パラメータ記憶部260に格納する。
The global conversion determination unit 250 is a processing unit that generates a correction parameter for converting a captured image into a corrected image based on a local linear conversion parameter. The global conversion determination unit 250 generates a correction parameter by sequentially executing, for example, a data interpolation process, a data addition process, and an inverse conversion calculation process. The global conversion determination unit 250 stores the correction parameter in the correction
大域変換決定部250が実行するデータ補間処理について説明する。大域変換決定部250は、局所的な線形変換パラメータを基にして、撮影画像の全画素に対して、各画素での線形変換パラメータを算出する。これは、作業員に指定された基準点から得られる線形変換パラメータ(局所的な線形変換パラメータ)を補間することで求める。 Data interpolation processing executed by the global conversion determination unit 250 will be described. The global conversion determination unit 250 calculates a linear conversion parameter at each pixel for all pixels of the captured image based on the local linear conversion parameter. This is obtained by interpolating a linear transformation parameter (local linear transformation parameter) obtained from a reference point designated by the worker.
作業員に指定された1番目の基準点の座標を(pi,0,qi,0)とし、かかる座標の線形変換パラメータをai,bi,ci,diとする。i=1,・・・,nは、校正物体の番号を表し、nは校正物体の総数を表す。このとき、撮影画像の画素(u,v)における線形変換パラメータを、式(15)〜式(18)で定める。 The coordinates of the first reference point specified in the operator and (p i, 0, q i , 0), the linear conversion parameters of such coordinates a i, b i, c i , and d i. i = 1,..., n represents the number of calibration objects, and n represents the total number of calibration objects. At this time, the linear conversion parameters for the pixel (u, v) of the captured image are defined by Expressions (15) to (18).
式(15)〜式(18)において、distは2点間の距離を表す。w(u,v)は重みの正規化を表し、式(19)により定められる。 In Expressions (15) to (18), dist represents the distance between two points. w (u, v) represents weight normalization and is defined by equation (19).
大域変換決定部250は、撮影画像の各画素(u,v)に対して、式(15)〜式(19)に基づき、線形変換のパラメータを計算する。図21は、各画素の線形変換パラメータの算出例を示す図である。図21では、画素30a〜30fを示す。原点の画素を30aとする。画素30aの線形パラメータをa1,b1,c1,d1とする。画素30bの線形パラメータをa2,b2,c2,d2とする。画素30cの線形パラメータをa3,b3,c3,d3とする。画素30dの線形パラメータをa4,b4,c4,d4とする。画素30eの線形パラメータをa5,b5,c5,d5とする。画素30fの線形パラメータをa6,b6,c6,d6とする。
The global conversion determination unit 250 calculates linear conversion parameters for each pixel (u, v) of the captured image based on Expressions (15) to (19). FIG. 21 is a diagram illustrating a calculation example of the linear conversion parameter of each pixel. In FIG. 21,
続いて、大域変換決定部250が実行するデータ加算処理について説明する。図22は、本実施例2にかかるデータ加算処理を説明するための図である。大域変換決定部250は、実施例1の大域変換決定部150と同様にして、撮影画像の原点と、補正画像の原点とを決めて、撮影画像の原点と、補正画像の原点とを対応させる。そして、大域変換決定部250は、原点の画素から順番に線形変換パラメータを加算することで、順方向の大域的な座標変換を定める。
Next, the data addition process executed by the global conversion determination unit 250 will be described. FIG. 22 is a diagram for explaining the data addition processing according to the second embodiment. Similar to the global
図22において、撮影画像上の画素と、この画素に対応する線形変換パラメータとの関係を示す。例えば、撮影画像の画素30aに対応する補正画像の点の座標値は(0,0)となる。撮影画像の画素30bに対応する補正画像の画点の座標は(a1,c1)となる。撮影画像の画素30cに対応する補正画像の点の座標は(a1+a2,c1+c2)となる。撮影画像の画素30dに対応する補正画像の点の座標は(b1,d1)となる。撮影画像の画素30eに対応する補正画像の点の座標は(a1+b2,c1+d2)となる。撮影画像の画素30fに対応する補正画像の点の座標は(a1+a2+b3,c1+c2+d3)となる。
FIG. 22 shows the relationship between the pixels on the captured image and the linear conversion parameters corresponding to the pixels. For example, the coordinate value of the point of the corrected image corresponding to the
続いて、大域変換決定部250が実行する逆変換算出処理について説明する。大域変換決定部250が実行する逆変換算出処理は、実施例1の大域変換決定部150が実行する逆変換算出処理と同様である。
Next, the inverse conversion calculation process executed by the global conversion determination unit 250 will be described. The inverse conversion calculation process executed by the global conversion determination unit 250 is the same as the inverse conversion calculation process executed by the global
次に、本実施例2にかかる画像処理装置200の効果について説明する。画像処理装置200は、撮影画像に含まれる複数の校正物体に対する基準点の位置を受け付けて線形変換パラメータを算出し、各縮尺が一定となるように、撮影画像を補正することで補正画像を生成し、補正画像から特徴点を抽出してテンプレートマッチングを実行する。かかる処理を実行することで、同一の対象物の大きさが位置、向きによらず均一となるため、テンプレートや画像の縮尺を様々に変えてマッチングを行わなくても良くなり、処理量を削減することができる。
Next, effects of the
次に、本実施例3にかかる画像処理装置について説明する。システムの構成は、実施例1に示したシステムと同様である。 Next, an image processing apparatus according to the third embodiment will be described. The system configuration is the same as that of the system shown in the first embodiment.
図23は、本実施例3にかかる画像処理装置の構成を示す機能ブロック図である。図23に示すように、画像処理装置300は、カメラ50に接続される。画像処理装置300は、取得部310、校正物体表示部320、校正情報入力部330、局所変換算出部340、大域変換決定部350、補正パラメータ記憶部360を有する。画像処理装置300は、補正画像生成部370、テンプレートマッチング実行部380、検出結果出力部390を有する。
FIG. 23 is a functional block diagram of the configuration of the image processing apparatus according to the third embodiment. As shown in FIG. 23, the
カメラ50、取得部310、校正物体表示部320、校正情報入力部330、局所変換算出部340に関する説明は、図18のカメラ50、取得部210、校正物体表示部220、校正情報入力部230、局所変換算出部240に関する説明と同様である。補正画像生成部370、テンプレートマッチング実行部380、検出結果出力部390に関する説明は、図18の補正画像生成部270、テンプレートマッチング実行部280、検出結果出力部290に関する説明と同様である。
The description of the
実施例2においては、大域的な座標変換を定める際に、画素の順番を決める必要がある。画素の順番を変えると一般に得られる変換は変化する。画素には本来、順番は付与されておらず、順番に依存せずに変換を定める方法が望ましい。そこで,本実施例3では画素の順番に依存しない変換決定方法を開示する。 In the second embodiment, it is necessary to determine the order of pixels when determining global coordinate transformation. Changing the order of the pixels generally changes the resulting conversion. Originally, the order is not given to the pixels, and a method of determining conversion without depending on the order is desirable. Therefore, this third embodiment discloses a conversion determination method that does not depend on the order of pixels.
大域変換決定部350は、局所的な線形変換パラメータを基にして、撮影画像を補正画像に変換するための補正パラメータを生成する処理部である。大域変換決定部350は、パラメータを、補正パラメータ記憶部360に格納する。
The global
大域変換決定部350は、例えば、順変換決定処理、逆変換算出処理を順に実行することで、補正パラメータを生成する。
For example, the global
大域変換決定部350が実行する順変換決定処理について説明する。一般に、大域的な座標変換は狭い範囲ではその微分を変換パラメータとする線形変換で近似される。この性質に基づき、順変換決定処理において、大域変換決定部350は、未知の係数を持つ関数(の族)を予め定めておき、その微分が与えられた局所的な座標変換とできるだけ一致するように最小二乗法で係数を定める。これにより、画像の各点で局所的な座標変換をよく近似する順向きの大域的な座標変換を定めることができる。
The forward conversion determination process executed by the global
大域変換決定部350は、関数の族として、例えば、式(20)、式(21)を用いる。
The global
最小二乗法の評価関数Fは、式(22)で表される。式(22)において、下付の添え字は、その変数による偏微分を表す。評価関数Fは、未知の係数a0,・・・,a5,b0,・・・,b5について2次式であるので、最小化は線形連立方程式を解くことで帰着される。線形連立方程式は、例えば、公知のガウスの消去法で解くことができる。 The evaluation function F of the least square method is expressed by Expression (22). In the equation (22), the subscript suffix represents the partial differentiation by the variable. Since the evaluation function F is a quadratic expression with respect to the unknown coefficients a 0 ,..., A 5 , b 0 ,..., B 5 , the minimization is reduced by solving the linear simultaneous equations. The linear simultaneous equations can be solved, for example, by a known Gaussian elimination method.
係数a0,・・・,a5,b0,・・・,b5が求められると、撮影画像の各画素(u,v)に対して、対応する補正画像の点(fx,fy)を計算することができる。 When the coefficients a 0 ,..., A 5 , b 0 ,..., B 5 are obtained, for each pixel (u, v) of the photographed image, the corresponding corrected image point (f x , f y ) can be calculated.
続いて、大域変換決定部350が実行する逆変換算出処理について説明する。大域変換決定部350が実行する逆変換算出処理は、実施例1の大域変換決定部150が実行する逆変換算出処理と同様である。
Next, the inverse conversion calculation process executed by the global
次に、本実施例3にかかる画像処理装置300の効果について説明する。画像処理装置300は、大域的な座標変換は狭い範囲ではその微分を変換パラメータとする線形変換で近似されるという特性に基づいて、未知の係数を持つ関数の族を予め定めておき、その微分が与えられた局所的な座標変換とできるだけ一致するように最小二乗法で係数を定める。これによって、画素の順番に依存しないで、撮影画像の画素に対応する補正画像の点を特定することができる。
Next, effects of the
次に、本実施例4にかかる画像処理装置について説明する。システムの構成は、実施例1に示したシステムと同様である。 Next, an image processing apparatus according to the fourth embodiment will be described. The system configuration is the same as that of the system shown in the first embodiment.
実施例1〜3においては、局所的な座標変換、大域的な座標変換はともに撮影画像の各画素が補正画像のどの点に対応するかを表していた。そのため,補正画像を生成する際には逆変換を算出する。これに対して、本実施例4では、実施例1〜3とは逆向きに変換を定める。これにより、逆変換を算出する処理が不要になる。変換の回数が少なくなるため、補間画像の品質向上が期待できる。また、後述するように、大域的な座標変換が望ましい性質を満たすことが数学的に保証される。 In the first to third embodiments, both local coordinate conversion and global coordinate conversion indicate to which point of the corrected image each pixel of the captured image corresponds. Therefore, inverse transformation is calculated when generating a corrected image. On the other hand, in the fourth embodiment, conversion is determined in the opposite direction to the first to third embodiments. Thereby, the process which calculates reverse transformation becomes unnecessary. Since the number of conversions is reduced, the quality of the interpolated image can be improved. In addition, as will be described later, it is mathematically guaranteed that global coordinate transformation satisfies desirable properties.
図24は、本実施例4にかかる画像処理装置の構成を示す機能ブロック図である。図24に示すように、画像処理装置400は、カメラ50に接続される。画像処理装置400は、取得部410、校正物体表示部420、校正情報入力部430、局所変換算出部440、大域変換決定部450、補正パラメータ記憶部460を有する。画像処理装置400は、補正画像生成部470、テンプレートマッチング実行部480、検出結果出力部490を有する。
FIG. 24 is a functional block diagram of the configuration of the image processing apparatus according to the fourth embodiment. As shown in FIG. 24, the
カメラ50、取得部410、校正物体表示部420、校正情報入力部430に関する説明は、図2のカメラ50、取得部110、校正物体表示部120、校正情報入力部130(または、構成情報入力部230)に関する説明と同様である。補正画像生成部470、テンプレートマッチング実行部480、検出結果出力部490に関する説明は、図2の補正画像生成部170、テンプレートマッチング実行部180、検出結果出力部190に関する説明と同様である。
The
局所変換算出部440は、局所的な座標変換として、式(23)を用いる。式(23)において、(δu,δv)Tは、撮影画像の点の微小変化を表し、(δx,δy)Tは、補正画像の点の微小変化を表す。a,b,c,dは、線形変換パラメータであり、撮影画像の点(u,v)によって異なる。 The local conversion calculation unit 440 uses Expression (23) as local coordinate conversion. In Expression (23), (δu, δv) T represents a minute change in the point of the captured image, and (δx, δy) T represents a minute change in the point of the corrected image. “a”, “b”, “c”, and “d” are linear conversion parameters, which differ depending on the point (u, v) of the photographed image.
作業員に指定された基準点の3つの組を(pi,0,qi,0)、(pi,x,qi,x)、(pi,y,qi,y)(i=1,・・・,n)とする。校正物体の標準幅をw0、標準高をh0とする。このとき、局所的な座標変換のパラメータa,b,c,dを式(24)〜式(27)で定める。 Three sets of reference points designated by the worker are expressed as ( pi, 0 , qi , 0 ), ( pi, x , qi , x ), ( pi, y , qi , y ) (i = 1,..., N). The standard width of the calibration object is w 0 and the standard height is h 0 . At this time, parameters a, b, c, and d for local coordinate conversion are determined by equations (24) to (27).
局所変換算出部440は、局所的な線形変換パラメータa,b,c,dを、大域変換決定部450に出力する。
The local conversion calculation unit 440 outputs the local linear conversion parameters a, b, c, and d to the global
大域変換決定部450は、局所的な線形変換パラメータを基にして、撮影画像を補正画像に変換するための補正パラメータを生成する処理部である。大域変換決定部450は、例えば、データ回帰処理、積分処理を順に実行することで、補正パラメータを生成する。大域変換決定部460は、補正パラメータを補正パラメータ記憶部460に格納する。
The global
大域変換決定部450が実行するデータ回帰処理について説明する。大域変換決定部450は、未知の係数を持つ関数の族を予め定めておき、与えられた局所的な座標変換とできるだけ一致するように最小二乗法で係数を求める。これにより、撮影画像の全ての点に対して、局所的な座標変換を求めることができる。
Data regression processing executed by the global
大域変換決定部450は、関数の族として、例えば、式(28)〜式(31)を用いる。
The global
最小二乗法の評価関数Fは、式(32)で表される。 The evaluation function F of the least square method is expressed by Expression (32).
大域変換決定部450は、式(32)の評価関数Fの値を最小にするように係数a0,・・・,a5,b0,・・・,b5,c0,・・・,c5,d0,・・・,d5を定める。ただし、後述する積分処理を実行するため、数学的要請として、fu,x,fu,y,fv,x,fv,yは、式(33)、式(34)の条件を満たす必要がある。
The global
上例の2次式の場合に、式(33)、式(34)の積分可能条件を計算すると、係数に関する下記の制約式(35)〜式(54)が得られる。 In the case of the quadratic expression in the above example, the following constraint expressions (35) to (54) relating to the coefficients are obtained by calculating the integrable conditions of Expression (33) and Expression (34).
大域変換決定部450は、上記の制約式(35)〜式(54)を満たす係数の組み合わせの中で上記の評価関数Fを最小化するものを探索する。例えば、大域変換決定部450は、公知技術であるラグランジュ未定乗数法に基づき、上記の制約式(35)〜式(54)を満し、評価関数Fを最小化する係数を探索する。
The global
続いて、大域変換決定部450の積分処理について説明する。大域変換決定部450は、式(55)に示す偏微分方程式を解く。
Next, the integration process of the global
大域変換決定部450は、偏微分方程式の初期条件として、補正画像の1点(x0,y0)が撮影画像の1点(u0,v0)に対応するように選択する。例えば、大域変換決定部450は、偏微分方程式の初期条件として、補正画像の中心と、撮影画像の中心とを選択しても良い。
The global
上記の積分可能条件となる式(35)〜式(54)は、上記の偏微分方程式(55)に解が存在するための必要十分条件である。具体的には、積分可能条件は、uxをyで微分した値と、uyをxで微分した値とが一致することを表している。vについても同様である。逆に積分可能条件が成り立てば、グリーンの補助公式から線積分が経路によらないことが示されるので、式(56)、式(57)で定義されるu,vが微分方程式の解となる。 Expressions (35) to (54), which are the above-mentioned integration enable conditions, are necessary and sufficient conditions for the solution to exist in the partial differential equation (55). Specifically, the integrable condition represents that the value obtained by differentiating u x by y matches the value obtained by differentiating u y by x. The same applies to v. On the other hand, if the integrable condition is satisfied, Green's auxiliary formula indicates that the line integral does not depend on the path, so u and v defined by Equation (56) and Equation (57) are the solutions of the differential equation. .
大域変換決定部450が、偏微分方程式を数値的に解く方法としては、例えば、公知技術であるオイラー法を用いる。線積分が経路によらないので、大域変換決定部450は、初期条件で選んだ1点(x0,y0)と各点(x,y)を結んだ適当な経路に沿って、積分を和で近似することで、解を求める。解いた結果は、補正画像の各画素(x,y)が対応する撮影画像の点の座標(u,v)で表され、補正パラメータとなる。
As a method for the global
図25は、本実施例4にかかる補正パラメータのデータ構造の一例を示す図である。図25に示すように、補正パラメータ460aは、補正画像の画素の座標値と、撮影画像の点の座標値とを有する。例えば、補正画像の画素の座標値(0,0)に対応する、撮影画像の点の座標値は、(u0,0,v0,0)となることが示される。
FIG. 25 is a diagram illustrating an example of the data structure of the correction parameter according to the fourth embodiment. As shown in FIG. 25, the
ここで、大域的な座標変換の性質について説明する。 Here, the property of global coordinate transformation will be described.
本願では補正画像から対象物の検出を行うので、補正処理の結果得られる補正画像が撮影画像全体を表し、かつ対象物が2重写しになるような補正にならないことが必要である。このことは、補正画像を生成する大域的な座標変換が大域的に全単射であることを意味する。変換φが大域的に全単射であるとは、撮影画像の任意の点(u,v)に対して、(u,v)=φ(x,y)となるような補正画像の点(x,y)が存在し、かつそのような(x,y)はただ1つであることを表す。 In the present application, since the target object is detected from the corrected image, it is necessary that the corrected image obtained as a result of the correction process represents the entire captured image, and the correction is not performed so that the target object becomes a double copy. This means that the global coordinate transformation that generates the corrected image is bijective globally. That the transformation φ is bijective globally is that a point of the corrected image (u, v) = φ (x, y) with respect to an arbitrary point (u, v) of the captured image ( x, y) is present and such (x, y) represents only one.
撮影画像において校正物体の基準点が見えるように設置されており、かつ作業員が適切な指定を行うことを仮定すると、3つの基準点が1つの直線に乗ることはない。この場合,a(u,v)d(u,v)−b(u,v)c(u,v)はu=pi,0,v=qi,0(i=1,・・・,n)において全て0でない値を取る。fu,x,fu,y,fv,x,fv,yは、撮影画像の全点で値を持つようにa,b,c,dを補間した関数である。そこで、fu,x(u,v)fv,y(u,v)−fu,y(u,v)fv,x(u,v)も全点で0にならないことが期待できる。上式は、大域的な変換におけるヤコビアン、すなわち1階微分のヤコビ行列の行列式に等しい。 Assuming that the reference point of the calibration object is visible in the photographed image and that the operator makes an appropriate designation, the three reference points do not ride on one straight line. In this case, a (u, v) d (u, v) -b (u, v) c (u, v) is u = pi, 0 , v = qi , 0 (i = 1,... , N) all take non-zero values. Fu, x , fu, y , fv, x , fv, and y are functions obtained by interpolating a, b, c, and d so as to have values at all points of the captured image. Therefore, it can be expected that f u, x (u, v) f v, y (u, v) −fu , y (u, v) f v, x (u, v) do not become zero at all points. . The above equation is equal to the Jacobian in the global transformation, that is, the determinant of the first derivative Jacobian matrix.
一般に、変換のヤコビアンが0でなければ、その変換は局所的には全単射になることが知られている。しかし、大域的な全単射性は必ずしも保証されない。例えば、x(u,v)=u cosv あるいはu*cos(v)等,y(u,v)=u sin vあるいはu*sin(v)等は、u>0でヤコビアン0にならないが、v=0,2πで値が一致するため、大域的には全単射にはならない。 In general, it is known that if the Jacobian of the conversion is not 0, the conversion is locally bijective. However, global bijectivity is not always guaranteed. For example, x (u, v) = u cosv or u * cos (v) etc., y (u, v) = u sin v or u * sin (v) etc. does not become Jacobian 0 when u> 0. Since the values match at v = 0, 2π, it is not bijective globally.
しかし、本実施例で定められる大域的な変換は、大域的に全単射になることが数学的に保証される。これは、望ましい性質である。以下に数学の定理の形でまとめる。 However, the global transformation defined in this embodiment is mathematically guaranteed to be bijective globally. This is a desirable property. The following is a summary of mathematical theorems.
[定理] fu,x,fu,y,fv,x,fv,yは、1階微分可能で微分は連続とし、積分可能条件を満たすと仮定する。このとき、偏微分方程式の解u,vは、ヤコビアンが0でなければ大域的に全単射になる。ただし、単射性では定義域は凸と仮定する。 [Theorem] It is assumed that fu, x , fu, y , fv, x , fv, and y are first-order differentiable, the differentiation is continuous, and satisfy an integrable condition. At this time, the solutions u and v of the partial differential equations are bijective globally unless the Jacobian is 0. However, in the case of injectivity, the domain is assumed to be convex.
[略証] 単射性:結論を否定して矛盾を導く。異なる2点(x1,y1),(x2,y2)に対して、同一の値(u1,v1)を取るような解u,vが存在すると仮定する。この2点を結んだ線分Lを考える。線分の向きを(a,b)と置く。線分Lは定義域に含まれるので、L上の点に対してu,vは閉曲線Cとなる。u,vの微分はu,vの値のみで決まるため、Cは自己交差のない単純閉曲線になる。ジョルダンの曲線定理より、閉曲線Cは平面を内側と外側に分ける。内側Dは,有界な単連結成分になる。CとDの各点において、ベクトル(afu,x+bfu,y,afv,x+bfv,y)を対応させるベクトル場を考える。このベクトル場は連続になる。また、ヤコビアンが0でないことからC,Dの各点でベクトルの大きさは0にならない。一方,Cにおいて上記のベクトルはCの接線方向を向く。これは、ポアンカレ・ホップの定理に反するので矛盾する。よって、大域的に単射である。 [Proof] Injectivity: Denies the conclusion and leads to contradiction. It is assumed that there are solutions u and v that take the same value (u 1 , v 1 ) for two different points (x 1 , y 1 ) and (x 2 , y 2 ). Consider a line segment L connecting these two points. The direction of the line segment is set as (a, b). Since the line segment L is included in the domain, u and v are closed curves C for points on L. Since the differentiation of u and v is determined only by the values of u and v, C becomes a simple closed curve without self-intersection. From the Jordan curve theorem, the closed curve C divides the plane into an inside and an outside. The inner side D becomes a bounded single connected component. Consider a vector field that correlates vectors (af u, x + bf u, y , af v, x + bf v, y ) at points C and D. This vector field is continuous. Further, since the Jacobian is not 0, the vector size does not become 0 at each point of C and D. On the other hand, in C, the above vector faces the tangential direction of C. This contradicts the Poincare hop theorem. Therefore, it is injectable globally.
全射性:初期条件で指定された(u0,v0)を含む任意の有界領域(連結した開集合)Ωに対して全射になることを示す。解析学でよく知られた逆写像定理の証明を若干修正することで以下の補題が得られる。写像の像になる(Ωに属する)任意の(u,v)に対して、|(u’,v’)−(u,v)|<rを満たす(Ωに属する)任意の(u’,v’)も写像の像になる。ここで,rは正数で(u,v)の境界までの距離dだけに依存する。r=r(d)は単調増加関数である。以下ではこの補題を用いて全射性を示す。Ωは連結なので、位相空間論の一般論から、Ωを共通部分のない2つの開集合A,Bの合併で表すと一方の開集合は空集合になる。ここで、Ωの部分集合Aを写像の像になる元を集めたものと定める。また、部分集合Bを写像の像にならない元を集めたものと定める。明らかに両者の共通部分はなく、AとBの合併はΩに一致する.また,(u0,v0)はAの元なので、Aは空集合ではない。局所的な全射性からAが開集合になることは明らかである。Bが開集合になることは以下のように示される。結論を否定すると、Bに属するある(u,v)と任意の正数εに対して、|(u’,v’)−(u,v)|<εを満たすAの元(u’,v’)が存在することになる。まず、(u,v)の境界までの距離をdとする。上記補題のrをr=r(d/2)で定める。ε=min(d/2,r)とおく。このとき、上記のAの元(u’,v’)の境界までの距離d’はd/2以上であり、かつ|(u’,v’)−(u,v)|<r(d/2)≦r(d’)となる。上記補題より、(u,v)がAの元になり矛盾する.従って,Bが空集合になることが導かれる。これは、大域的な全射性を表す。 Radiality: indicates that it is surjective for any bounded region (connected open set) Ω including (u 0 , v 0 ) specified in the initial condition. The following lemma can be obtained by slightly modifying the proof of the inverse mapping theorem, which is well known in analytics. Arbitrary (u ′) satisfying | (u ′, v ′) − (u, v) | <r with respect to arbitrary (u, v) that becomes a mapping image (belonging to Ω) , V ′) is also a mapping image. Here, r is a positive number and depends only on the distance d to the boundary of (u, v). r = r (d) is a monotonically increasing function. In the following, this lemma is used to show the bijectivity. Since Ω is connected, from the general theory of phase space theory, when Ω is represented by merging two open sets A and B having no common part, one open set is an empty set. Here, a subset A of Ω is defined as a collection of elements that become mapping images. Further, the subset B is defined as a collection of elements that do not become mapping images. Obviously, there is no common part between the two, and the merger of A and B matches Ω. Since (u 0 , v 0 ) is an element of A, A is not an empty set. It is clear that A is an open set from the local radiation. The fact that B becomes an open set is shown as follows. If the conclusion is negated, for some (u, v) and any positive number ε belonging to B, an element of A that satisfies | (u ′, v ′) − (u, v) | <ε (u ′, v ′) exists. First, let d be the distance to the boundary of (u, v). The r of the lemma is defined as r = r (d / 2). Let ε = min (d / 2, r). At this time, the distance d ′ to the boundary of the element (u ′, v ′) of A is not less than d / 2, and | (u ′, v ′) − (u, v) | <r (d / 2) ≦ r (d ′). From the above lemma, (u, v) becomes an element of A and contradicts. Therefore, it is derived that B becomes an empty set. This represents a global shot.
次に、本実施例4にかかる画像処理装置400の効果について説明する。画像処理装置400は、未知の係数を持つ関数の族を予め定めておき、与えられた局所的な座標変換とできるだけ一致するように最小二乗法で係数を求める。また、画像処理装置400は、求めた係数を用いて偏微分方程式を解くことで、補正画像の各画素(x,y)が対応する撮影画像の点の座標(u,v)を特定する。すなわち、画像処理装置400は、実施例1〜3とは逆向きに変換を定めることで、逆変換を算出する処理が不要になる。このため、変換の回数が少なくなるため、補間画像の品質向上が期待できる。
Next, effects of the
次に、上記実施例に示した画像処理装置100〜400と同様の機能を実現する画像処理プログラムを実行するコンピュータの一例について説明する。図26は、画像処理プログラムを実行するコンピュータの一例を示す図である。
Next, an example of a computer that executes an image processing program that implements the same functions as those of the
図26に示すように、コンピュータ500は、各種演算処理を実行するCPU501と、ユーザからのデータの入力を受け付ける入力装置502と、ディスプレイ503とを有する。また、コンピュータ500は、記憶媒体からプログラム等を読み取る読み取り装置504と、ネットワークを介して他のコンピュータとの間でデータの授受を行うインターフェース装置505とを有する。また、コンピュータ500は、各種情報を一時記憶するRAM506と、ハードディスク装置507とを有する。そして、各装置501〜507は、バス508に接続される。
As illustrated in FIG. 26, the
ハードディスク装置507は、取得プログラム507a、算出プログラム507b、検出プログラム507cを有する。CPU501は、取得プログラム507a、算出プログラム507b、検出プログラム507cを読み出してRAM506に展開する。取得プログラム507aは、取得プロセス506aとして機能する。算出プログラム507bは、算出プロセス506bとして機能する。検出プログラム507cは、検出プロセス506cとして機能する。取得プロセス506aの処理は、取得部110、210,310,410の処理に対応する。算出プロセス506bの処理は、局所変換算出部140、240,340,440、大域変換決定部150,250,350,450の処理に対応する。検出プロセス506cの処理は、補正画像生成部170、270,370,470、テンプレートマッチング実行部180,280,380,480、検出結果出力部190,290,390,490の処理に対応する。
The
なお、取得プログラム507a、算出プログラム507b、検出プログラム507cについては、必ずしも最初からハードディスク装置507に記憶させておかなくても良い。例えば、コンピュータ500に挿入されるフレキシブルディスク(FD)、CD−ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に各プログラムを記憶させておく。そして、コンピュータ500が取得プログラム507a、算出プログラム507b、検出プログラム507cを読み出して実行するようにしてもよい。
Note that the
以上の各実施例を含む実施形態に関し、さらに以下の付記を開示する。 The following supplementary notes are further disclosed with respect to the embodiments including the above examples.
(付記1)コンピュータに、
同一形状の複数の物体が撮影された撮影画像を取得し、
前記撮影画像に含まれる前記複数の物体に対する基準点の位置を受け付け、前記物体の基準点の間隔に基づいて、前記撮影画像の各画素における縮尺を算出し、
前記撮影画像の各画素における縮尺を基にして、前記撮影画像を、各画素における縮尺が一定となる補正画像に変換し、
前記補正画像に対してテンプレートマッチングを実行することで対象物を検出する
処理を実行させることを特徴とするテンプレートマッチングプログラム。
(Supplementary note 1)
Acquire a captured image of multiple objects of the same shape,
Receiving positions of reference points for the plurality of objects included in the photographed image, and calculating a scale at each pixel of the photographed image based on an interval between the reference points of the objects;
Based on the scale of each pixel of the photographed image, the photographed image is converted into a corrected image in which the scale of each pixel is constant,
A template matching program that executes processing for detecting an object by executing template matching on the corrected image.
(付記2)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の間隔を基にして、前記撮影画像の前記物体の位置に対応する局所的な縮尺を算出し、前記局所的な縮尺を用いて補間を行うことで、前記撮影画像の各画素における縮尺を算出することを特徴とする付記1に記載のテンプレートマッチングプログラム。
(Supplementary Note 2) The process of calculating the scale at each pixel of the captured image calculates a local scale corresponding to the position of the object in the captured image based on the interval between the reference points of the object, The template matching program according to
(付記3)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の間隔を基にして、前記撮影画像の点を前記補正画像の点に変換する線形変換パラメータを算出し、前記補正画像に変換する処理は、前記線形変換パラメータを基にして、前記撮影画像を、各画素における縮尺が一定となる補正画像に変換することを特徴とする付記1に記載のテンプレートマッチングプログラム。
(Additional remark 3) The process which calculates the reduced scale in each pixel of the said picked-up image calculates the linear conversion parameter which converts the point of the said picked-up image into the point of the said correction | amendment image based on the space | interval of the reference point of the said object. The template matching program according to
(付記4)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の間隔を基にして、前記撮影画像の前記物体の位置に対応する局所的な縮尺を算出し、前記局所的な縮尺とある点の縮尺との関係を示し、かつ、未知の係数を持つ関数を微分した関数を基にして、前記未知の係数を特定することで、前記撮影画像の各画素における縮尺を算出することを特徴とする付記1に記載のテンプレートマッチングプログラム。
(Additional remark 4) The process which calculates the reduced scale in each pixel of the said picked-up image calculates the local scale corresponding to the position of the said object of the said picked-up image based on the space | interval of the reference point of the said object, The relationship between the local scale and the scale of a certain point is shown, and the scale of each pixel of the captured image is determined by specifying the unknown coefficient based on a function obtained by differentiating a function having an unknown coefficient. The template matching program according to
(付記5)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の位置を基にして、前記補正画像の局所的な点を前記撮影画像の局所的な点に変換する第1関数を特定し、未知の係数を持つ第2関数を微分した関数が前記第1関数に一致するように、前記未知の係数を特定し、特定した未知の係数を設定した第2関数に基づき、前記撮影画像の各画素における縮尺を算出することを特徴とする付記1に記載のテンプレートマッチングプログラム。
(Additional remark 5) The process which calculates the reduced scale in each pixel of the said picked-up image converts the local point of the said correction image into the local point of the said picked-up image based on the position of the reference point of the said object. The first function is specified, the unknown coefficient is specified so that a function obtained by differentiating the second function having the unknown coefficient matches the first function, and the specified unknown coefficient is set to the second function. The template matching program according to
(付記6)コンピュータが実行するテンプレートマッチング方法であって、
同一形状の複数の物体が撮影された撮影画像を取得し、
前記撮影画像に含まれる前記複数の物体に対する基準点の位置を受け付け、前記物体の基準点の間隔に基づいて、前記撮影画像の各画素における縮尺を算出し、
前記撮影画像の各画素における縮尺を基にして、各画素における縮尺が一定となる補正画像を生成し、
前記補正画像に対してテンプレートマッチングを実行することで対象物を検出する
処理を実行することを特徴とするテンプレートマッチング方法。
(Appendix 6) A template matching method executed by a computer,
Acquire a captured image of multiple objects of the same shape,
Receiving positions of reference points for the plurality of objects included in the photographed image, and calculating a scale at each pixel of the photographed image based on an interval between the reference points of the objects;
Based on the scale of each pixel of the captured image, generate a corrected image in which the scale of each pixel is constant,
The template matching method characterized by performing the process which detects a target object by performing template matching with respect to the said correction | amendment image.
(付記7)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の間隔を基にして、前記撮影画像の前記物体の位置に対応する局所的な縮尺を算出し、前記局所的な縮尺を用いて補間を行うことで、前記撮影画像の各画素における縮尺を算出することを特徴とする付記6に記載のテンプレートマッチング方法。 (Supplementary Note 7) The process of calculating the scale at each pixel of the captured image calculates a local scale corresponding to the position of the object in the captured image based on the interval between the reference points of the object, The template matching method according to appendix 6, wherein a scale at each pixel of the captured image is calculated by performing interpolation using a local scale.
(付記8)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の間隔を基にして、前記撮影画像の点を前記補正画像の点に変換する線形変換パラメータを算出し、前記補正画像に変換する処理は、前記線形変換パラメータを基にして、前記撮影画像を、各画素における縮尺が一定となる補正画像に変換することを特徴とする付記6に記載のテンプレートマッチング方法。 (Supplementary Note 8) The process of calculating the scale at each pixel of the captured image calculates linear conversion parameters for converting the points of the captured image into the points of the corrected image based on the interval between the reference points of the object. The template matching method according to appendix 6, wherein the process of converting to the corrected image converts the captured image into a corrected image in which the scale of each pixel is constant based on the linear conversion parameter. .
(付記9)前記撮影画像の各画素における縮尺を算出する処理は、前記物体の基準点の間隔を基にして、前記撮影画像の前記物体の位置に対応する局所的な縮尺を算出し、前記局所的な縮尺とある点の縮尺との関係を示し、かつ、未知の係数を持つ関数を微分した関数を基にして、前記未知の係数を特定することで、前記撮影画像の各画素における縮尺を算出することを特徴とする付記7に記載のテンプレートマッチング方法。 (Supplementary note 9) The process of calculating the scale at each pixel of the photographed image calculates a local scale corresponding to the position of the object in the photographed image based on the interval between the reference points of the object, The relationship between the local scale and the scale of a certain point is shown, and the scale of each pixel of the captured image is determined by specifying the unknown coefficient based on a function obtained by differentiating a function having an unknown coefficient. 8. The template matching method according to appendix 7, wherein the template matching method is calculated.
(付記10)同一形状の複数の物体が撮影された撮影画像を取得する取得部と、
前記撮影画像に含まれる前記複数の物体に対する基準点の位置を受け付け、前記物体の基準点の間隔に基づいて、前記撮影画像の各画素における縮尺を算出し、前記撮影画像の各画素における縮尺を基にして、各画素における縮尺が一定となる補正画像を生成する補正画像生成部と、
前記補正画像に対してテンプレートマッチングを実行することで対象物を検出する検出部と
を有することを特徴とするテンプレートマッチング装置。
(Additional remark 10) The acquisition part which acquires the picked-up image by which the several object of the same shape was imaged,
Accepting positions of reference points for the plurality of objects included in the captured image, calculating a scale at each pixel of the captured image based on an interval between the reference points of the objects, and calculating a scale at each pixel of the captured image. Based on the correction image generation unit that generates a correction image in which the scale of each pixel is constant,
And a detection unit that detects an object by executing template matching on the corrected image.
(付記11)前記補正画像生成部は、前記物体の基準点の間隔を基にして、前記撮影画像の前記物体の位置に対応する局所的な縮尺を算出し、前記局所的な縮尺を用いて補間を行うことで、前記撮影画像の各画素における縮尺を算出することを特徴とする付記10に記載のテンプレートマッチング装置。
(Additional remark 11) The said correction | amendment image generation part calculates the local scale corresponding to the position of the said object of the said picked-up image based on the space | interval of the reference point of the said object, and uses the said local scale. The template matching apparatus according to
(付記12)前記補正画像生成部は、前記物体の基準点の間隔を基にして、前記撮影画像の局所的な点を前記補正画像の局所的な点に変換する線形変換パラメータを算出し、前記線形変換パラメータを基にして、前記撮影画像の各画素における縮尺を算出することを特徴とする付記10に記載のテンプレートマッチング装置。
(Supplementary Note 12) The correction image generation unit calculates a linear conversion parameter for converting a local point of the captured image into a local point of the correction image based on an interval between reference points of the object, The template matching apparatus according to
(付記13)前記補正画像生成部は、前記物体の基準点の間隔を基にして、前記撮影画像の前記物体の位置に対応する局所的な縮尺を算出し、前記局所的な縮尺とある点の縮尺との関係を示し、かつ、未知の係数を持つ関数を微分した関数を基にして、前記未知の係数を特定することで、前記撮影画像の各画素における縮尺を算出することを特徴とする付記10に記載のテンプレートマッチング装置。
(Additional remark 13) The said correction | amendment image generation part calculates the local scale corresponding to the position of the said object of the said picked-up image based on the space | interval of the reference point of the said object, and there exists the said local scale A scale at each pixel of the captured image is calculated by specifying the unknown coefficient based on a function obtained by differentiating a function having an unknown coefficient. The template matching apparatus according to
(付記14)前記補正画像生成部は、前記物体の基準点の位置を基にして、前記補正画像の局所的な点を前記撮影画像の局所的な点に変換する第1関数を特定し、未知の係数を持つ第2関数を微分した関数が前記第1関数に一致するように、前記未知の係数を特定し、特定した未知の係数を設定した第2関数に基づき、前記撮影画像の各画素における縮尺を算出することを特徴とする付記10に記載のテンプレートマッチング装置。
(Supplementary Note 14) The correction image generation unit specifies a first function for converting a local point of the correction image into a local point of the captured image based on the position of the reference point of the object, The unknown coefficient is specified such that a function obtained by differentiating the second function having an unknown coefficient matches the first function, and each of the captured images is determined based on the second function in which the specified unknown coefficient is set. The template matching apparatus according to
50 カメラ
100,200,300,400 画像処理装置
110,210,310,410 取得部
120,220,320,420 校正物体表示部
130,230,330,430 校正情報入力部
140,240,340,440 局所変換算出部
150,250,350,450 大域変換決定部
160,260,360,460 補正パラメータ記憶部
170,270,370,470 補正画像生成部
180,280,380,480 テンプレートマッチング実行部
190,290,390,490 検出結果出力部
50
Claims (7)
同一形状の複数の物体が撮影された撮影画像を取得し、
前記撮影画像に含まれる前記複数の物体それぞれに対する複数の基準点の位置を受け付け、前記複数の基準点の間隔に基づいて、前記撮影画像の各画素における縮尺を算出し、
前記撮影画像の各画素における縮尺を基にして、各画素における縮尺が一定となる補正画像を生成し、
前記補正画像に対してテンプレートマッチングを実行することで対象物を検出する
処理を実行させることを特徴とするテンプレートマッチングプログラム。 On the computer,
Acquire a captured image of multiple objects of the same shape,
Receiving positions of a plurality of reference points for each of the plurality of objects included in the photographed image, and calculating a scale at each pixel of the photographed image based on an interval between the plurality of reference points;
Based on the scale of each pixel of the captured image, generate a corrected image in which the scale of each pixel is constant,
A template matching program that executes processing for detecting an object by executing template matching on the corrected image.
同一形状の複数の物体が撮影された撮影画像を取得し、
前記撮影画像に含まれる前記複数の物体それぞれに対する複数の基準点の位置を受け付け、前記複数の基準点の間隔に基づいて、前記撮影画像の各画素における縮尺を算出し、
前記撮影画像の各画素における縮尺を基にして、各画素における縮尺が一定となる補正画像を生成し、
前記補正画像に対してテンプレートマッチングを実行することで対象物を検出する
処理を実行することを特徴とするテンプレートマッチング方法。 A template matching method executed by a computer,
Acquire a captured image of multiple objects of the same shape,
Receiving positions of a plurality of reference points for each of the plurality of objects included in the photographed image, and calculating a scale at each pixel of the photographed image based on an interval between the plurality of reference points;
Based on the scale of each pixel of the captured image, generate a corrected image in which the scale of each pixel is constant,
The template matching method characterized by performing the process which detects a target object by performing template matching with respect to the said correction | amendment image.
前記撮影画像に含まれる前記複数の物体それぞれに対する複数の基準点の位置を受け付け、前記複数の基準点の間隔に基づいて、前記撮影画像の各画素における縮尺を算出し、前記撮影画像の各画素における縮尺を基にして、各画素における縮尺が一定となる補正画像を生成する補正画像生成部と、
前記補正画像に対してテンプレートマッチングを実行することで対象物を検出する検出部と
を有することを特徴とするテンプレートマッチング装置。 An acquisition unit for acquiring a captured image in which a plurality of objects having the same shape are captured;
Receiving positions of a plurality of reference points for each of the plurality of objects included in the photographed image, calculating a scale at each pixel of the photographed image based on an interval between the plurality of reference points, and each pixel of the photographed image A corrected image generation unit that generates a corrected image in which the scale of each pixel is constant based on the scale of
And a detection unit that detects an object by executing template matching on the corrected image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015130252A JP6582618B2 (en) | 2015-06-29 | 2015-06-29 | Template matching program, template matching method, and template matching apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015130252A JP6582618B2 (en) | 2015-06-29 | 2015-06-29 | Template matching program, template matching method, and template matching apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017016266A JP2017016266A (en) | 2017-01-19 |
JP6582618B2 true JP6582618B2 (en) | 2019-10-02 |
Family
ID=57829185
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015130252A Active JP6582618B2 (en) | 2015-06-29 | 2015-06-29 | Template matching program, template matching method, and template matching apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6582618B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008146155A (en) * | 2006-12-06 | 2008-06-26 | Sony Corp | Image processing method and device |
JP2008287338A (en) * | 2007-05-15 | 2008-11-27 | Konica Minolta Holdings Inc | Image processor |
JP2010218226A (en) * | 2009-03-17 | 2010-09-30 | Suzuki Motor Corp | Measurement map generation device and traveling environment confirmation device |
-
2015
- 2015-06-29 JP JP2015130252A patent/JP6582618B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017016266A (en) | 2017-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Vishwakarma et al. | Image fusion using adjustable non-subsampled shearlet transform | |
CN105590312B (en) | Foreground image dividing method and device | |
US8422827B2 (en) | Image correction apparatus and image correction method | |
WO2015165222A1 (en) | Method and device for acquiring panoramic image | |
JP2017518556A (en) | Image display method and apparatus | |
JP6579950B2 (en) | Image analysis apparatus, program, and method for detecting person appearing in captured image of camera | |
JP2011134012A (en) | Image processor, image processing method for the same and program | |
US11145032B2 (en) | Image processing apparatus, method and storage medium for reducing color noise and false color | |
JP2015148979A (en) | Image processing method, image processing program, and image processing device | |
JP7032913B2 (en) | Image processing device, image processing method, computer program | |
JP6582618B2 (en) | Template matching program, template matching method, and template matching apparatus | |
JP6669390B2 (en) | Information processing apparatus, information processing method, and program | |
JP2017162391A (en) | Image processing method and image processing program | |
WO2014199824A1 (en) | Image processing method, image processing device, and image processing program | |
JP6378496B2 (en) | Image processing apparatus, control method, and recording medium | |
JP2018160024A (en) | Image processing device, image processing method and program | |
JP6056354B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5643147B2 (en) | Motion vector detection apparatus, motion vector detection method, and motion vector detection program | |
JP2017041113A (en) | Image processing device, image processing system, image processing method, and program | |
JP6066282B2 (en) | Image processing apparatus, image processing program, and image processing method | |
Agarwal et al. | Specular reflection removal in cervigrams | |
RU2630744C2 (en) | Method of detecting periodical textures | |
EP3496390B1 (en) | Information processing device, information processing method, and storage medium | |
JP6751663B2 (en) | Image processing device, image processing method | |
JP2016110341A (en) | Image processing device, image processing method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180306 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190611 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190718 |
|
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: 20190806 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190819 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6582618 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |