JP2020071661A - Image processing method and image processing system by geometrical shape matching - Google Patents

Image processing method and image processing system by geometrical shape matching Download PDF

Info

Publication number
JP2020071661A
JP2020071661A JP2018205052A JP2018205052A JP2020071661A JP 2020071661 A JP2020071661 A JP 2020071661A JP 2018205052 A JP2018205052 A JP 2018205052A JP 2018205052 A JP2018205052 A JP 2018205052A JP 2020071661 A JP2020071661 A JP 2020071661A
Authority
JP
Japan
Prior art keywords
edge
image
model image
edges
model
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.)
Granted
Application number
JP2018205052A
Other languages
Japanese (ja)
Other versions
JP7252591B2 (en
Inventor
長谷川 潤
Jun Hasegawa
潤 長谷川
邦彦 佐藤
Kunihiko Sato
邦彦 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HST VISION CORP
Original Assignee
HST VISION CORP
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HST VISION CORP filed Critical HST VISION CORP
Priority to JP2018205052A priority Critical patent/JP7252591B2/en
Publication of JP2020071661A publication Critical patent/JP2020071661A/en
Application granted granted Critical
Publication of JP7252591B2 publication Critical patent/JP7252591B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

To provide an image processing method and an image processing system that select edges uniformly and perform matching processing between a target image and a model image accurately and at high speed.SOLUTION: An image processing system 1, which performs matching processing of geometric shapes shown in a target image and a model image respectively, detects, by an edge detection unit 12, a plurality of edges indicating a contour of a geometric shape from a target image and a model image, rearranges, by an edge group selection unit 13, an edge array of the plurality of edges of the model image so that an edge having a high dispersiveness in angle and position and a high contrast has a higher rank, selects, in the rearranged edge array, edges having a predetermined number of elements continuous from beginning as an edge group, and performs, by a search execution unit 14, by using the plurality of edges of the target image and the edge group of the model image, matching processing.SELECTED DRAWING: Figure 1

Description

本発明は、対象画像及びモデル画像にそれぞれ示される特徴的な幾何学形状のマッチング処理を行う画像処理方法及び画像処理装置に関する。   The present invention relates to an image processing method and an image processing apparatus that perform matching processing of characteristic geometric shapes shown in a target image and a model image, respectively.

従来、画像から所定の特徴的な特徴を幾何学形状として探索するマシンビジョンシステム等の画像処理システムでは、基準となる位置や向きで幾何学形状(モデル形状)を示すモデル画像が予め用意され、処理対象の幾何学形状(対象形状)を示した対象画像とモデル画像(テンプレート)とのマッチング処理(テンプレートマッチング)を行う。マッチング処理によって、対象画像における対象形状とモデル画像におけるモデル形状とが合致する場合の、対象画像に対するモデル画像の位置を探索し、その探索結果に基づいて対象画像の幾何学形状の位置決めを行う。例えば、テンプレートマッチングでは、正規化相関法が利用されることが知られている(特許文献1参照)。   Conventionally, in an image processing system such as a machine vision system that searches for a predetermined characteristic feature from an image as a geometric shape, a model image showing a geometric shape (model shape) at a reference position or orientation is prepared in advance, A matching process (template matching) between a target image showing a geometric shape (target shape) to be processed and a model image (template) is performed. By the matching process, when the target shape in the target image matches the model shape in the model image, the position of the model image with respect to the target image is searched, and the geometric shape of the target image is positioned based on the search result. For example, in template matching, it is known that the normalized correlation method is used (see Patent Document 1).

特開2014−26521号公報JP, 2014-26521, A

マッチング処理において、対象画像とモデル画像とでは、幾何学形状の位置、回転角度、スケール率、せん断変形率等の姿勢が異なることがある。そのため、対象画像及びモデル画像のそれぞれの幾何学形状の姿勢を合わせてマッチング処理が行われることが望ましい。例えば、様々な姿勢の幾何学形状のモデル画像を対象画像と比較し、合致の指標値が最も高くなる姿勢を網羅的に探索する。   In the matching process, the target image and the model image may have different postures such as the position of the geometric shape, the rotation angle, the scale ratio, and the shear deformation ratio. Therefore, it is desirable that the matching process is performed by matching the postures of the geometric shapes of the target image and the model image. For example, model images of geometric shapes of various postures are compared with the target image, and the postures having the highest matching index value are exhaustively searched.

マシンビジョンシステム等の画像処理システムでは、対象画像とモデル画像とのマッチング処理を正確且つ高速に実行することが求められている。しかしながら、対象画像とモデル画像との合致度の指標を求めるために、正規化相関値等を用いる場合には、両画像の全画素を計算に用いるので、計算量が多くなり、処理時間が長くなってしまう。   In image processing systems such as machine vision systems, it is required to execute matching processing between a target image and a model image accurately and at high speed. However, when the normalized correlation value or the like is used to obtain the index of the matching degree between the target image and the model image, all the pixels of both images are used for calculation, so that the calculation amount is large and the processing time is long. turn into.

あるいは、マッチング処理では、モデル画像に示されるモデル形状の輪郭線形状と、対象画像に示される対象形状の輪郭線形状とを比較し、その合致度を指標として用いることがある。この場合、輪郭上のエッジ要素のみを評価するので、計算量を少なく抑えることができ、処理時間を短縮することができる。   Alternatively, in the matching process, the contour line shape of the model shape shown in the model image may be compared with the contour line shape of the target shape shown in the target image, and the degree of matching may be used as an index. In this case, since only the edge element on the contour is evaluated, the amount of calculation can be reduced and the processing time can be shortened.

マッチング処理の計算量をより少なくして高速化するためには、モデル画像で比較される幾何学形状のエッジの数を減らす必要がある。例えば、モデル画像を縮小化することで画素数を減らし、これによりモデル画像から検出されるエッジの数を減らすことがある。しかしながら、モデル画像の画素数を単純に減らすことで、図9に示すように、幾何学形状の微小な構造が強調されなくなると、微小な構造のエッジを検出できず、モデル画像で比較されるエッジに微小な構造が含まれない場合がある。そうすると、幾何学形状の特徴が微小な構造にある場合には、モデル画像の特徴的な微小な構造が損なわれ、モデル画像と対象画像との適切な比較ができなくなるおそれがある。   In order to reduce the calculation amount of the matching process and speed it up, it is necessary to reduce the number of edges of the geometric shapes compared in the model images. For example, the number of pixels may be reduced by reducing the size of the model image, which may reduce the number of edges detected from the model image. However, by simply reducing the number of pixels of the model image, as shown in FIG. 9, when the minute structure of the geometrical shape is not emphasized, the edge of the minute structure cannot be detected and the model images are compared. In some cases, the edge does not include minute structures. Then, if the geometrical shape has a minute structure, the characteristic minute structure of the model image may be lost, and appropriate comparison between the model image and the target image may not be possible.

あるいは、モデル画像を縮小せずに、モデル画像の幾何学形状について検出されたエッジを間引き処理して一部のみを選択的に用いることで、モデル画像で比較されるエッジの数を減らすことがある。しかしながら、間引き処理では、図10に示すように、モデル画像からエッジが偏って選択され、幾何学形状の輪郭線形状の特徴的な構造を示すエッジが選択されない場合がある。そうすると、モデル画像の特徴的な構造が損なわれ、モデル画像と対象画像との適切な比較ができなくなるおそれがある。   Alternatively, the number of edges compared in the model image can be reduced by thinning out the detected edges of the geometric shape of the model image and selectively using only a part of the model image without reducing the size of the model image. is there. However, in the thinning-out process, as shown in FIG. 10, the edges may be biasedly selected from the model image, and the edges showing the characteristic structure of the contour line shape of the geometric shape may not be selected. Then, the characteristic structure of the model image may be lost, and appropriate comparison between the model image and the target image may not be possible.

本発明は上記した課題を解決すべくなされたものであり、偏りなくエッジを選択して対象画像とモデル画像とのマッチング処理を正確且つ高速に行うことを目的とするものである。   The present invention has been made to solve the above problems, and an object of the present invention is to select edges uniformly and perform matching processing between a target image and a model image accurately and at high speed.

上記した目的を達成するため、本発明の画像処理方法は、対象画像及びモデル画像にそれぞれ示される幾何学形状のマッチング処理を行う画像処理方法であって、前記対象画像及び前記モデル画像から前記幾何学形状の輪郭を示す複数のエッジを検出する工程と、前記モデル画像の前記複数のエッジのエッジ配列を、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替える工程と、並べ替えた前記エッジ配列において、先頭から連続する所定の要素数のエッジをエッジ群として選択する工程と、前記対象画像の前記複数のエッジと前記モデル画像の前記エッジ群とを用いて、前記マッチング処理を行う工程とを含むことを特徴とする。   In order to achieve the above-mentioned object, the image processing method of the present invention is an image processing method for performing matching processing of geometric shapes shown in a target image and a model image, respectively. A step of detecting a plurality of edges showing a contour of a geometric shape, and a step of rearranging an edge array of the plurality of edges of the model image so that an edge having a high dispersiveness in angle and position and a high contrast becomes higher. In the rearranged edge array, using a step of selecting a predetermined number of continuous edges from the beginning as an edge group, using the plurality of edges of the target image and the edge group of the model image, And a step of performing the matching process.

また、本発明の画像処理装置は、対象画像及びモデル画像にそれぞれ示される幾何学形状のマッチング処理を行う画像処理装置であって、前記対象画像及び前記モデル画像から前記幾何学形状の輪郭を示す複数のエッジを検出し、前記モデル画像の前記複数のエッジのエッジ配列を、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替え、並べ替えた前記エッジ配列において、先頭から連続する所定の要素数のエッジをエッジ群として選択し、前記対象画像の前記複数のエッジと前記モデル画像の前記エッジ群とを用いて、前記マッチング処理を行うことを特徴とする。   Further, the image processing apparatus of the present invention is an image processing apparatus that performs a matching process of the geometric shapes shown in the target image and the model image, respectively, and shows the contour of the geometric shape from the target image and the model image. Detecting a plurality of edges, the edge array of the plurality of edges of the model image, the edge having high dispersiveness of angle and position and having a high contrast is rearranged to be higher, and in the edge array rearranged, It is characterized in that a predetermined number of edges continuous from the beginning are selected as an edge group, and the matching processing is performed using the plurality of edges of the target image and the edge group of the model image.

例えば、前記モデル画像の各エッジについて、角度の分散性を評価可能な角度分散性正規化スコアを算出し、前記角度分散性正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うとよい。   For example, for each edge of the model image, an angle dispersivity normalization score capable of evaluating the angle dispersibility is calculated, and an edge having a larger angle dispersibility normalization score has a higher rank, so that The edge array may be rearranged.

また、前記モデル画像の各エッジについて、位置の分散性を評価可能な位置分散性正規化スコアを算出し、前記位置分散性正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うとよい。   Further, for each edge of the model image, a position dispersivity normalization score capable of evaluating the dispersibility of positions is calculated, and an edge having a larger position dispersibility normalization score has a higher rank, so that the model image of the model image has a higher rank. The edge array may be rearranged.

また、前記モデル画像の各エッジについて、コントラストの強度を評価可能なコントラスト正規化スコアを算出し、前記コントラスト正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うとよい。   Further, for each edge of the model image, a contrast normalization score capable of evaluating the contrast intensity is calculated, and the edge array of the model image is arranged so that the edge having the higher contrast normalization score is higher. It is good to change.

更に、前記モデル画像の各エッジについて、角度の分散性を評価可能な角度分散性正規化スコア、位置の分散性を評価可能な位置分散性正規化スコア、及びコントラストの強度を評価可能なコントラスト正規化スコアを算出し、前記角度分散性正規化スコア、前記位置分散性正規化スコア及び前記コントラスト正規化スコアの重み付き平均を算出して総合正規化スコアを算出し、前記総合正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うとよい。   Furthermore, for each edge of the model image, an angle dispersive normalization score that can evaluate the angle dispersibility, a position dispersive normalization score that can evaluate the position dispersibility, and a contrast normal that can evaluate the contrast intensity. Calculating a normalized score, calculating a weighted average of the angular dispersive normalization score, the position dispersive normalization score, and the contrast normalization score to calculate a total normalization score, and the large total normalization score. The edge arrangement of the model image may be rearranged so that the edge is higher.

本発明によれば、偏りなくエッジを選択して対象画像とモデル画像とのマッチング処理を正確且つ高速に行うことができる。   According to the present invention, it is possible to select edges without bias and perform matching processing between a target image and a model image accurately and at high speed.

本発明の一実施形態に係る画像処理装置を示すブロック図である。It is a block diagram showing an image processing device concerning one embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、モデル画像や対象画像から検出されるエッジのテーブルを示す表である。6 is a table showing a table of edges detected from a model image and a target image in the image processing apparatus according to the embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、モデル画像の複数のエッジを角度に関して平衡二分探索木で示す概要図である。FIG. 3 is a schematic diagram showing a plurality of edges of a model image as a balanced binary search tree in terms of angles in the image processing device according to the embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、モデル画像を、複数のエッジの位置座標に関して空間分割した状態を示す概要図である。FIG. 6 is a schematic diagram showing a state in which the model image is spatially divided with respect to position coordinates of a plurality of edges in the image processing device according to the embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、モデル画像の複数のエッジを位置座標に関して平衡二次元kdで示す概要図である。FIG. 6 is a schematic diagram showing a plurality of edges of a model image in balanced two-dimensional kd with respect to position coordinates in the image processing device according to the embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、モデル画像の学習動作を示すフローチャートである。6 is a flowchart showing a model image learning operation in the image processing apparatus according to the embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、対象画像に対するモデル画像の探索動作を示すフローチャートである。6 is a flowchart showing a model image search operation for a target image in the image processing apparatus according to the embodiment of the present invention. 本発明の一実施形態に係る画像処理装置において、モデル画像のエッジ群の例を示す概要図である。FIG. 3 is a schematic diagram showing an example of an edge group of a model image in the image processing device according to the embodiment of the present invention. 縮小により微小な構造が損なわれたモデル画像の例を示す概要図である。It is a schematic diagram showing an example of a model image in which a minute structure is damaged by reduction. 間引き処理により特徴的な構造が損なわれたモデル画像の例を示す概要図である。FIG. 9 is a schematic diagram showing an example of a model image in which a characteristic structure is damaged by thinning processing.

以下、図面を参照しつつ、本発明の実施形態について説明する。本発明の画像処理装置1は、画像から所定の特徴的な特徴を幾何学形状として探索するものであって、基準となる位置や向きで幾何学形状(モデル形状)を示すモデル画像を予め用意しておき、処理対象の幾何学形状(対象形状)を示した対象画像の位置決めを行うために、対象画像とモデル画像とのマッチング処理を行うように構成される。本実施形態において、マッチング処理は、モデル画像を学習させる学習動作と、対象画像に対してモデル画像を探索する探索動作とを含む。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. The image processing apparatus 1 of the present invention searches a predetermined characteristic feature from an image as a geometric shape, and prepares in advance a model image showing a geometric shape (model shape) at a reference position or orientation. In addition, in order to perform the positioning of the target image showing the geometric shape (target shape) of the processing target, it is configured to perform the matching process between the target image and the model image. In the present embodiment, the matching process includes a learning operation for learning the model image and a searching operation for searching the target image for the model image.

なお、画像処理装置1は、様々な装置やコンピュータ、システムの一部として構成されてよい。例えば、画像処理装置1は、電子部品等の被検査物の特徴的な形状を幾何学形状とする対象画像とモデル画像とのマッチング処理を行い、対象画像に対するモデル画像の位置を探索し、その探索結果に基づいて対象画像の位置決めを行うマシンビジョンシステムに適用される。また、画像処理装置1は、他の画像処理システムや撮像システム等のシステムの一部として組み込まれてもよく、あるいは、パーソナルコンピュータ等の独立したコンピュータに適用されてもよい。   The image processing apparatus 1 may be configured as various devices, computers, or a part of a system. For example, the image processing apparatus 1 performs a matching process between a target image and a model image whose geometrical shape is a characteristic shape of an inspection object such as an electronic component, searches for the position of the model image with respect to the target image, and It is applied to a machine vision system that positions a target image based on the search results. Further, the image processing apparatus 1 may be incorporated as a part of a system such as another image processing system or an imaging system, or may be applied to an independent computer such as a personal computer.

図1に示すように、画像処理装置1は、モデル画像入力部10と、対象画像入力部11と、エッジ検出部12と、エッジ群選択部13と、探索実行部14とを備える。また、画像処理装置1は、CPU等からなる制御部20と、ROMやRAM等からなる記憶部21とを備える。画像処理装置1は、撮像システムに組み込まれる場合には、上記の制御部20及び記憶部21として、撮像システムに備わる制御部及び記憶部を使用してもよい。画像処理装置1は、ハードディスクや外部メモリ等の記録媒体22を備えてもよく、また、マッチング処理を操作するためのキーボードやマウス等の操作部23や、マッチング処理を確認するためのディスプレイ等の表示部24を備えてもよい。   As shown in FIG. 1, the image processing device 1 includes a model image input unit 10, a target image input unit 11, an edge detection unit 12, an edge group selection unit 13, and a search execution unit 14. The image processing apparatus 1 also includes a control unit 20 including a CPU and the like, and a storage unit 21 including a ROM and a RAM. When the image processing apparatus 1 is incorporated in an imaging system, the control unit and the storage unit included in the imaging system may be used as the control unit 20 and the storage unit 21. The image processing apparatus 1 may include a recording medium 22 such as a hard disk or an external memory, and also includes an operation unit 23 such as a keyboard or a mouse for operating the matching process, a display for confirming the matching process, or the like. The display unit 24 may be provided.

画像処理装置1は、制御部20がバス等を介して接続された各部を制御することで動作するように構成される。記憶部21は、画像処理装置1の機能を制御するためのプログラムやデータを記憶している。そして、制御部20は、記憶部21に記憶された各プロクラム等に従って演算処理を実行して、制御部20に接続された各部を制御する。   The image processing apparatus 1 is configured to operate by the control unit 20 controlling each unit connected via a bus or the like. The storage unit 21 stores programs and data for controlling the functions of the image processing apparatus 1. Then, the control unit 20 executes arithmetic processing according to each program stored in the storage unit 21 and controls each unit connected to the control unit 20.

例えば、エッジ検出部12と、エッジ群選択部13と、探索実行部14は、記憶部21に記憶されて制御部20に実行される画像処理プログラムで構成されてよく、具体的には、マッチング処理を行うマッチング処理プログラムで構成されてよい。   For example, the edge detection unit 12, the edge group selection unit 13, and the search execution unit 14 may be configured by an image processing program stored in the storage unit 21 and executed by the control unit 20. It may be configured by a matching processing program that performs processing.

モデル画像入力部10は、モデル画像を入力するインタフェースである。モデル画像入力部10は、ソフトウェア及びハードウェアの何れで構成されてもよい。例えば、モデル画像入力部10は、撮像システム等に備わるカメラ等の撮像装置で撮影された画像をモデル画像として入力してもよく、記録媒体22に記録された画像を読み取って入力してもよく、あるいは、他の装置との通信によって画像を入力してもよい。モデル画像入力部10は、入力したモデル画像を記憶部21又は記録媒体22に記憶する。   The model image input unit 10 is an interface for inputting a model image. The model image input unit 10 may be configured by either software or hardware. For example, the model image input unit 10 may input an image captured by an image capturing device such as a camera included in an image capturing system as a model image, or may read an image recorded in the recording medium 22 and input it. Alternatively, the image may be input by communication with another device. The model image input unit 10 stores the input model image in the storage unit 21 or the recording medium 22.

対象画像入力部11は、対象画像を入力するインタフェースである。対象画像入力部11は、ソフトウェア及びハードウェアの何れで構成されてもよい。例えば、対象画像入力部11は、撮像システム等に備わるカメラ等の撮像装置で撮影された画像を対象画像として入力してもよく、記録媒体22に記録された画像を読み取って入力してもよく、あるいは、他の装置との通信によって画像を入力してもよい。対象画像入力部11は、入力した対象画像を記憶部21又は記録媒体22に記憶する。   The target image input unit 11 is an interface for inputting a target image. The target image input unit 11 may be composed of either software or hardware. For example, the target image input unit 11 may input an image captured by an image capturing apparatus such as a camera included in an image capturing system as a target image, or may read an image recorded in the recording medium 22 and input it. Alternatively, the image may be input by communication with another device. The target image input unit 11 stores the input target image in the storage unit 21 or the recording medium 22.

エッジ検出部12は、モデル画像入力部10によって入力されたモデル画像に示される幾何学形状(モデル形状)及び対象画像入力部11によって入力された対象画像に示される幾何学形状(対象形状)について、輪郭線形状に対応するエッジを検出する。   The edge detection unit 12 regards the geometric shape (model shape) shown in the model image input by the model image input unit 10 and the geometric shape (target shape) shown in the target image input by the target image input unit 11. , Detect edges corresponding to the contour shape.

具体的には、エッジ検出部12は、先ず、モデル画像及び対象画像を所定の粒度に縮小化する。ここで、粒度とは、各画像を縮小するときの比率を表し、例えば、粒度が3の場合には、3×3画素が1画素になるように画像を縮小し、粒度が大きくなるほど、画像(画素)が粗くなる。エッジ検出部12は、モデル画像の位置を比較的粗く探索する粗位置探索の場合、比較的大きい粗粒度を用いる。また、エッジ検出部12は、モデル画像の位置を比較的詳細に探索する詳細位置探索の場合、比較的小さい詳細粒度を用いる。なお、粗粒度や詳細粒度は、予め設定されていてよく、ユーザーによって変更されてもよいが、モデル画像及び対象画像に対して共通した値に設定される。なお、粗粒度や詳細粒度は、幾何学形状の特徴的な構造が損なわれない範囲で、できるだけ大きい値が設定される。   Specifically, the edge detection unit 12 first reduces the model image and the target image to a predetermined granularity. Here, the granularity represents a ratio when reducing each image. For example, when the granularity is 3, the image is reduced so that 3 × 3 pixels become 1 pixel, and the image becomes larger as the granularity increases. (Pixel) becomes coarse. The edge detection unit 12 uses a relatively large coarse granularity in the case of a coarse position search for relatively coarsely searching the position of the model image. In addition, the edge detection unit 12 uses a relatively small detail granularity in the case of the detailed position search for searching the position of the model image in relatively detail. The coarse grain size and the fine grain size may be set in advance and may be changed by the user, but are set to a value common to the model image and the target image. The coarse grain size and the fine grain size are set as large as possible within a range in which the characteristic structure of the geometric shape is not damaged.

また、エッジ検出部12は、縮小したモデル画像及び対象画像について各画素の輝度の勾配方向及び勾配強度を算出し、勾配方向及び勾配強度に基づいて幾何学形状の輪郭線形状に対応する複数のエッジ(エッジ配列)を検出する。エッジ検出部12によるエッジ検出処理は、例えば、ソーベルフィルタを用いたフィルタリング処理や細線化処理等によって行われてよいが、これらの処理に限定されず、何れの画像処理によってエッジを検出してもよい。   In addition, the edge detection unit 12 calculates the gradient direction and the gradient strength of the brightness of each pixel for the reduced model image and the target image, and based on the gradient direction and the gradient strength, a plurality of edges corresponding to the contour line shape of the geometric shape are calculated. Detect edges (edge array). The edge detection processing by the edge detection unit 12 may be performed by, for example, filtering processing using a Sobel filter, thinning processing, or the like, but is not limited to these processing, and any image processing may be used to detect edges. Good.

エッジ検出部12は、図2に示すように、モデル画像及び対象画像から検出した複数のエッジのエッジ配列のテーブルを、記憶部21又は記録媒体22に記憶する。各エッジは、少なくとも、エッジ毎に付加されてエッジを識別するID、エッジの方向を示す角度、エッジの位置を示す座標、エッジの強度を示すコントラスト等の情報を有する。また、各エッジのテーブルには、下記のように、エッジ群選択部13で算出される角度分散性正規化スコアSdir[i]、位置分散性正規化スコアSxy[i]及びコントラスト正規化スコアScon[i]も含まれる。 As shown in FIG. 2, the edge detection unit 12 stores a table of edge arrangements of a plurality of edges detected from the model image and the target image in the storage unit 21 or the recording medium 22. Each edge has at least information such as an ID that is added to each edge to identify the edge, an angle that indicates the direction of the edge, coordinates that indicate the position of the edge, and contrast that indicates the intensity of the edge. In addition, in the table of each edge, the angle dispersive normalization score S dir [i], the position dispersive normalization score S xy [i], and the contrast normalization calculated by the edge group selection unit 13 are described below. Also included is the score S con [i].

なお、エッジ配列における複数のエッジは、エッジ検出部12による検出時点では、何れの順に並べられていてもよく、例えば、検出された順に並べられてよい。例えば、エッジ検出部12は、画像の左上から検出を開始して、上端から下端までの位置毎に、左端から右端まで走査して検出を行う。   Note that the plurality of edges in the edge array may be arranged in any order at the time of detection by the edge detection unit 12, for example, may be arranged in the order of detection. For example, the edge detection unit 12 starts detection from the upper left of the image and performs detection by scanning from the left end to the right end at each position from the upper end to the lower end.

エッジ群選択部13は、エッジ検出部12によって検出されたモデル画像のエッジ配列(元のエッジ配列)を所定の条件に基づいて並べ替え(ソートし)、並べ替えたエッジ配列(ソート後のエッジ配列)から探索動作に用いるエッジ群(モデルエッジ群)を選択する。具体的には、エッジ群選択部13は、先ず、元のエッジ配列の複数のエッジについて、角度の分散性スコア、位置の分散性スコア及びコントラストの強度スコアを算出する。角度の分散性スコア、位置の分散性スコア及びコントラストの強度スコアは、同じ基準で評価できるように換算して算出されるとよい。エッジ群選択部13は、これらのスコアに基づいて、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるような条件で、複数のエッジを並べ替える。   The edge group selection unit 13 rearranges (sorts) the edge array (original edge array) of the model image detected by the edge detection unit 12 based on a predetermined condition, and rearranges the edge array (the sorted edge). From the array, an edge group (model edge group) used for the search operation is selected. Specifically, the edge group selection unit 13 first calculates the angle dispersiveness score, the position dispersiveness score, and the contrast intensity score for a plurality of edges in the original edge array. The angle dispersiveness score, the position dispersiveness score, and the contrast intensity score may be calculated by conversion so that they can be evaluated by the same criterion. Based on these scores, the edge group selection unit 13 rearranges a plurality of edges under a condition that an edge having a high angle and position dispersibility and a high contrast has a higher rank.

例えば、エッジ群選択部13は、モデル画像の元のエッジ配列の各エッジの角度の値Edir[i]に基づいて、図3に示すように、各エッジをノードとした平衡二分探索木を作成する(iは1〜Nまでの整数、Nはエッジ数)。図3において、四角内の数値は、各エッジのIDを示し、括弧内の数値は、各エッジの角度を示す。 For example, the edge group selection unit 13 creates a balanced binary search tree with each edge as a node, as shown in FIG. 3, based on the angle value E dir [i] of each edge of the original edge array of the model image. Create (i is an integer from 1 to N, N is the number of edges). In FIG. 3, the numerical value inside the square indicates the ID of each edge, and the numerical value inside the parentheses indicates the angle of each edge.

そして、この平衡二分探索木において、各エッジをルートとする部分木に含まれるノード数を、各エッジの部分木の大きさλdir[i]とする。各エッジの部分木の大きさλdir[i]を、所定の単調増加関数f(z)を用いて増加させて各エッジの角度の評価値f(λdir[i])を算出し、各エッジの角度の評価値f(λdir[i])に基づいて、全エッジの平均値mdir及び標準偏差σdirを、次の数式(1)及び(2)によって算出する。 Then, in this balanced binary search tree, the number of nodes included in a subtree having each edge as a root is defined as the size of the subtree of each edge λ dir [i]. The evaluation value f (λ dir [i]) of the angle of each edge is calculated by increasing the size λ dir [i] of the subtree of each edge using a predetermined monotonically increasing function f (z). Based on the edge angle evaluation value f (λ dir [i]), the average value m dir and standard deviation σ dir of all edges are calculated by the following mathematical expressions (1) and (2).

Figure 2020071661
Figure 2020071661
Figure 2020071661
Figure 2020071661

なお、所定の単調増加関数f(z)は、各エッジの部分木の大きさλdir[i]を評価値として必要に応じて増加させるための関数であり、角度の分散性スコアが適切に評価されるように定められ、例えば、下記の角度分散性正規化スコアSdir[i]の算出結果をフィードバックして実験的に定められてもよい。そして、次の数式(3)に示すように、各エッジの角度の評価値f(λdir[i])から平均値mdirを減算し、更にその減算結果を標準偏差σdirで除算し、その除算結果の値を、各エッジの角度の分散性スコアに対応する角度分散性正規化スコアSdir[i]とする。 It should be noted that the predetermined monotonically increasing function f (z) is a function for increasing the size λ dir [i] of the subtree of each edge as an evaluation value as necessary, and the dispersiveness score of the angle is appropriately set. It may be determined so as to be evaluated, and for example, may be determined experimentally by feeding back the calculation result of the angular dispersion normalization score S dir [i] below. Then, as shown in the following formula (3), the average value m dir is subtracted from the evaluation value f (λ dir [i]) of the angle of each edge, and the subtraction result is divided by the standard deviation σ dir , The value of the division result is set as the angular dispersiveness normalized score S dir [i] corresponding to the dispersiveness score of the angle of each edge.

Figure 2020071661
Figure 2020071661

また、エッジ群選択部13は、モデル画像の元のエッジ配列の各エッジのxy座標(E[i],E[i])に基づいて、図4に示すように、各エッジを通過する分割線でモデル画像を空間分割した場合の各エッジの分布を把握し、各エッジの分布に基づいて、図5に示すように、各エッジをノードとした平衡二次元kd木を作成する(iは1〜Nまでの整数、Nはエッジ数)。図4において、黒丸は、各エッジを示し、図5において、四角内の数値は、各エッジのIDを示し、括弧内の数値は、各エッジのxy座標を示す。 Further, the edge group selection unit 13 passes each edge as shown in FIG. 4 based on the xy coordinates (E x [i], E y [i]) of each edge of the original edge array of the model image. The distribution of each edge when the model image is spatially divided by the dividing line is grasped, and a balanced two-dimensional kd tree having each edge as a node is created based on the distribution of each edge as shown in FIG. i is an integer from 1 to N, and N is the number of edges). In FIG. 4, black circles indicate each edge, in FIG. 5, the numerical values in the squares indicate the ID of each edge, and the numerical values in parentheses indicate the xy coordinates of each edge.

そして、この平衡二次元kd木において、各エッジをルートとする部分木に含まれるノード数を、各エッジの部分木の大きさλxy[i]とする。各エッジの部分木の大きさλxy[i]を、所定の単調増加関数g(z)を用いて増加させて各エッジの位置の評価値g(λxy[i])を算出し、各エッジの位置の評価値g(λxy[i])に基づいて、全エッジの平均値mxy及び標準偏差σxyを、次の数式(4)及び(5)によって算出する。 Then, in this balanced two-dimensional kd tree, the number of nodes included in the subtree having each edge as a root is defined as the size of the subtree of each edge λ xy [i]. The subtree size λ xy [i] of each edge is increased using a predetermined monotonically increasing function g (z) to calculate the evaluation value g (λ xy [i]) of the position of each edge. Based on the edge position evaluation value g (λ xy [i]), the average value m xy and standard deviation σ xy of all edges are calculated by the following mathematical expressions (4) and (5).

Figure 2020071661
Figure 2020071661
Figure 2020071661
Figure 2020071661

なお、所定の単調増加関数g(z)は、各エッジの部分木の大きさλxy[i]を評価値として必要に応じて増加させるための関数であり、位置の分散性スコアが適切に評価されるように定められ、例えば、下記の位置分散性正規化スコアSxy[i]の算出結果をフィードバックして実験的に定められてもよい。そして、次の数式(6)に示すように、各エッジの位置の評価値g(λxy[i])から平均値mxyを減算し、更にその減算結果を標準偏差σxyで除算し、その除算結果の値を、各エッジの位置の分散性スコアに対応する位置分散性正規化スコアSxy[i]とする。 Note that the predetermined monotonically increasing function g (z) is a function for increasing the size λ xy [i] of the subtree of each edge as an evaluation value as necessary, and the dispersiveness score of the position is appropriately set. It may be determined so as to be evaluated, and for example, may be determined experimentally by feeding back the calculation result of the following positional dispersibility normalized score S xy [i]. Then, as shown in the following formula (6), the average value m xy is subtracted from the evaluation value g (λ xy [i]) of the position of each edge, and the subtraction result is further divided by the standard deviation σ xy , The value of the division result is set as the position dispersiveness normalized score S xy [i] corresponding to the dispersiveness score of the position of each edge.

Figure 2020071661
Figure 2020071661

また、エッジ群選択部13は、モデル画像の元のエッジ配列の各エッジのコントラストEcon[i]を、所定の単調増加関数h(z)を用いて増加させて各エッジのコントラストの評価値h(Econ[i])を算出し、各エッジのコントラストの評価値h(Econ[i])に基づいて、全エッジの平均値mcon及び標準偏差σconを、次の数式(7)及び(8)によって算出する。 Further, the edge group selection unit 13 increases the contrast E con [i] of each edge of the original edge array of the model image by using a predetermined monotonically increasing function h (z) to evaluate the contrast of each edge. h (E con [i]) is calculated, and based on the evaluation value h (E con [i]) of the contrast of each edge, the average value m con and the standard deviation σ con of all edges are calculated by the following formula (7). ) And (8).

Figure 2020071661
Figure 2020071661
Figure 2020071661
Figure 2020071661

なお、所定の単調増加関数h(z)は、各エッジのコントラストEcon[i]を評価値として必要に応じて増加させるための関数であり、コントラストの強度スコアが適切に評価されるように定められ、例えば、下記のコントラスト正規化スコアScon[i]の算出結果をフィードバックして実験的に定めてもよい。そして、次の数式(9)に示すように、各エッジのコントラストの評価値h(Econ[i])から平均値mconを減算し、更にその減算結果を標準偏差σconで除算し、その除算結果の値を、各エッジのコントラストの強度スコアに対応するコントラスト正規化スコアScon[i]とする。 It should be noted that the predetermined monotonically increasing function h (z) is a function for increasing the contrast E con [i] of each edge as an evaluation value as needed, so that the contrast intensity score is appropriately evaluated. For example, the calculation result of the contrast normalization score S con [i] described below may be fed back and determined experimentally. Then, as shown in the following mathematical expression (9), the average value m con is subtracted from the contrast evaluation value h (E con [i]) of each edge, and the subtraction result is divided by the standard deviation σ con , The value of the division result is set as the contrast normalization score S con [i] corresponding to the contrast intensity score of each edge.

Figure 2020071661
Figure 2020071661

そして、エッジ群選択部13は、上記のように算出した角度分散性正規化スコアSdir[i]、位置分散性正規化スコアSxy[i]及びコントラスト正規化スコアScon[i]に基づいて、各エッジの総合正規化スコアStotal[i]を算出する。例えば、エッジ群選択部13は、次の数式(10)に示すように、角度、位置、コントラストにそれぞれ対応する所定の重み係数α、β、γを用いて、各正規化スコアの重み付き平均を算出することで総合正規化スコアStotal[i]を算出する。 Then, the edge group selection unit 13 is based on the angle dispersive normalization score S dir [i], the position dispersive normalization score S xy [i], and the contrast normalization score S con [i] calculated as described above. Then, the total normalized score S total [i] of each edge is calculated. For example, the edge group selection unit 13 uses the predetermined weighting factors α, β, and γ corresponding to the angle, the position, and the contrast, respectively, as shown in the following Expression (10), and the weighted average of each normalized score is used. By calculating, the total normalized score S total [i] is calculated.

Figure 2020071661
Figure 2020071661

なお、重み係数α、β、γは、これらの和が1となるように、即ち、数式α+β+γ=1が成り立つように設定され、例えば、α=β=γ=1/3に設定される。重み係数α、β、γが大きくなるほど、対応する各正規化スコア、即ち、角度、位置、コントラストによる総合正規化スコアStotal[i]への依存度が高くなる。なお、重み係数α、β、γは、予め設定されていてよく、ユーザーによって変更されてもよい。また、重み係数α、β、γは、モデル画像を粗粒度で縮小した場合と詳細粒度で縮小した場合とで、共通した値に設定されてもよく、あるいは異なる値に設定されてもよい The weighting factors α, β, and γ are set such that the sum of them is 1, that is, the equation α + β + γ = 1 holds, for example, α = β = γ = 1/3. The larger the weighting factors α, β, and γ, the higher the degree of dependence on the corresponding normalization score, that is, the total normalization score S total [i] based on the angle, position, and contrast. The weighting factors α, β, and γ may be set in advance and may be changed by the user. Further, the weighting factors α, β, and γ may be set to a common value or different values depending on whether the model image is reduced to a coarse grain size or a detailed grain size.

更に、エッジ群選択部13は、モデル画像の元のエッジ配列における複数のエッジを、総合正規化スコアStotal[i]に関して降順(スコアの大きい順)に並べ替え(ソートし)、ソート後のエッジ配列を記憶部21又は記録媒体22に記憶する。即ち、総合正規化スコアStotal[i]の降順となることが、並べ替えの条件である。なお、記憶部21又は記録媒体22には、エッジ検出部12での検出時点での元のエッジ配列と、ソート後のエッジ配列との両方が記憶されてよい。 Furthermore, the edge group selection unit 13 rearranges (sorts) the plurality of edges in the original edge array of the model image in descending order (larger score) with respect to the total normalized score S total [i], and after sorting. The edge arrangement is stored in the storage unit 21 or the recording medium 22. That is, the sorting condition is that the total normalized score S total [i] is in descending order. The storage unit 21 or the recording medium 22 may store both the original edge array at the time of detection by the edge detection unit 12 and the sorted edge array.

そして、エッジ群選択部13は、ソート後のエッジ配列において、先頭から連続する所定の要素数のエッジを、探索動作に用いるエッジ群として選択する。これにより、角度、位置、コントラストに偏りのないエッジを選択することができる。なお、要素数は、予め設定されていてよく、ユーザーによって変更されてもよい。また、要素数は、モデル画像を粗粒度で縮小した場合と詳細粒度で縮小した場合とで、共通した値に設定されてもよく、あるいは異なる値に設定されてもよい   Then, the edge group selection unit 13 selects, in the sorted edge array, edges having a predetermined number of elements continuous from the beginning as an edge group to be used in the search operation. As a result, it is possible to select edges having no deviation in angle, position and contrast. The number of elements may be set in advance and may be changed by the user. Further, the number of elements may be set to a common value or different values depending on whether the model image is reduced to a coarse grain size or a detailed grain size.

探索実行部14は、エッジ群選択部13によってモデル画像のソート後のエッジ配列から選択されたエッジ群(モデルエッジ群)と、エッジ検出部12によって対象画像から検出された元のエッジ配列(対象エッジ配列)とを突き合わせて、対象画像に対してモデル画像の探索を行う。探索実行部14は、粗粒度で縮小した場合のモデル画像及び対象画像の探索処理(粗位置探索)と、詳細粒度で縮小した場合のモデル画像及び対象画像の探索処理(詳細位置探索)とを行う。   The search execution unit 14 includes an edge group (model edge group) selected from the sorted edge array of the model image by the edge group selection unit 13 and the original edge array (target object detected by the edge detection unit 12 from the target image). Edge model) and a model image is searched for the target image. The search execution unit 14 performs a search process for a model image and a target image (coarse position search) when the size is reduced with a coarse granularity, and a search process (detailed position search) for a model image and a target image when the size is reduced with a detailed granularity. To do.

粗位置探索では、対象エッジ配列に対するモデルエッジ群のおおよその位置及び姿勢を探索し、これらの位置及び姿勢を示す粗位置情報を検出して記憶部21又は記録媒体22に記憶する。例えば、粗位置探索では、対象エッジ配列に対してモデルエッジ群を網羅的に全探索してよく、あるいは、一般化ハフ変換等の画像処理によって対象エッジ配列に対するモデルエッジ群の合致度を算出してもよい。   In the coarse position search, approximate positions and orientations of the model edge group with respect to the target edge array are searched, coarse position information indicating these positions and orientations is detected, and stored in the storage unit 21 or the recording medium 22. For example, in the rough position search, the model edge group may be exhaustively searched for the target edge array, or the degree of matching of the model edge group with the target edge array may be calculated by image processing such as generalized Hough transform. May be.

詳細位置探索では、粗位置探索によって得られた対象エッジ配列に対するモデルエッジ群のおおよその位置及び姿勢を示す既知の粗位置情報を利用しつつ、対象エッジ配列に対するモデルエッジ群の詳細な位置及び姿勢を探索し、これらの位置及び姿勢を示す詳細位置情報を検出して記憶部21又は記録媒体22に記憶する。そのため、詳細位置探索では、探索の範囲を狭く限定することができ、例えば、段階的にステップ幅を小さくしながら網羅的に探索するアルゴリズムや、ICPアルゴリズム又は他のアルゴリズムを適用して、高精度に探索を行うことができる。   In the detailed position search, while using the known coarse position information indicating the approximate position and orientation of the model edge group with respect to the target edge array obtained by the coarse position search, the detailed position and orientation of the model edge group with respect to the target edge array are used. Is detected, detailed position information indicating these positions and orientations is detected and stored in the storage unit 21 or the recording medium 22. Therefore, in the detailed position search, the search range can be narrowly limited. For example, an algorithm for exhaustively searching while gradually reducing the step width, an ICP algorithm, or another algorithm is applied to achieve high accuracy. You can do a search in.

なお、詳細位置探索では、何れのアルゴリズムを適用しても、対象エッジ配列とモデルエッジ群との合致度を評価するための計算量は、エッジの個数に応じて増加するが、本発明では、粗位置情報を利用し、また、モデルエッジ群のエッジ数を減らしているので、計算量を少なくして処理時間を短縮している。   In the detailed position search, whichever algorithm is applied, the calculation amount for evaluating the degree of matching between the target edge array and the model edge group increases according to the number of edges. Since the rough position information is used and the number of edges in the model edge group is reduced, the amount of calculation is reduced and the processing time is shortened.

探索実行部14による詳細位置探索によって対象エッジ配列に対するモデルエッジ群の適切な位置及び姿勢を探索した結果の詳細位置情報に基づいて、対象画像に対するモデル画像の位置及び姿勢を検出することができ、更に、対象画像の幾何学形状の位置決めを行うことができる。   The position and orientation of the model image with respect to the target image can be detected based on the detailed position information obtained by searching the appropriate position and orientation of the model edge group with respect to the target edge array by the detailed position search by the search execution unit 14. Further, the geometrical shape of the target image can be positioned.

画像処理装置1において、モデル画像を学習させる学習動作について、図6に示すフローチャートを参照して説明する。   A learning operation for learning a model image in the image processing apparatus 1 will be described with reference to the flowchart shown in FIG.

先ず、モデル画像入力部10によってモデル画像を入力し、記憶部21又は記録媒体22に記憶させる(ステップS1)。この入力したモデル画像を、元のモデル画像と称する。   First, a model image is input by the model image input unit 10 and stored in the storage unit 21 or the recording medium 22 (step S1). This input model image is referred to as the original model image.

次に、エッジ検出部12によって、元のモデル画像を粗粒度で縮小化し、記憶部21又は記録媒体22に記憶させる(ステップS2)。この粗粒度で縮小化したモデル画像を、粗モデル画像と称する。   Next, the edge detection unit 12 reduces the original model image to a coarse grain size and stores it in the storage unit 21 or the recording medium 22 (step S2). The model image reduced with this coarse grain size is referred to as a coarse model image.

また、エッジ検出部12によって、粗モデル画像から幾何学形状の複数のエッジを検出し、元のエッジ配列として記憶部21又は記録媒体22に記憶させる(ステップS3)。このエッジ配列を、元の粗エッジ配列と称する。   Further, the edge detection unit 12 detects a plurality of edges of the geometrical shape from the rough model image, and stores them in the storage unit 21 or the recording medium 22 as the original edge array (step S3). This edge arrangement is called the original rough edge arrangement.

そして、エッジ群選択部13によって、元の粗エッジ配列の複数のエッジについて、角度の分散性スコア、位置の分散性スコア及びコントラストの強度スコア(コントラストスコア)を算出する(ステップS4、S5、S6)。また、エッジ群選択部13によって、これらのスコアに基づいて、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように、元の粗エッジ配列の複数のエッジを並べ替える(ソートする)(ステップS7)。ここで、並べ替えられたエッジ配列を、ソート後の粗エッジ配列と称する。   Then, the edge group selection unit 13 calculates the angle dispersiveness score, the position dispersiveness score, and the contrast intensity score (contrast score) for the plurality of edges of the original rough edge array (steps S4, S5, S6). ). In addition, the edge group selection unit 13 rearranges the plurality of edges of the original rough edge array based on these scores so that the edge having higher dispersiveness of angle and position and higher contrast becomes higher. Yes) (step S7). Here, the rearranged edge array is referred to as a sorted rough edge array.

更に、エッジ群選択部13によって、ソート後の粗エッジ配列において、先頭から連続する所定の要素数のエッジを、探索動作に用いるエッジ群として選択し、記憶部21又は記録媒体22に記憶させる(ステップS8)。このエッジ群を、粗エッジ群と称する。   Further, the edge group selection unit 13 selects an edge of a predetermined number of elements continuous from the beginning in the sorted rough edge array as an edge group to be used for the search operation and stores it in the storage unit 21 or the recording medium 22 ( Step S8). This edge group is called a rough edge group.

次に、エッジ検出部12によって、元のモデル画像を詳細粒度で縮小化し、記憶部21又は記録媒体22に記憶させる(ステップS9)。この詳細粒度で縮小化したモデル画像を、詳細モデル画像と称する。   Next, the edge detection unit 12 reduces the original model image in detail granularity and stores it in the storage unit 21 or the recording medium 22 (step S9). The model image reduced with this detailed granularity is referred to as a detailed model image.

また、エッジ検出部12によって、詳細モデル画像から幾何学形状の複数のエッジを検出し、元のエッジ配列として記憶部21又は記録媒体22に記憶させる(ステップS10)。このエッジ配列を、元の詳細エッジ配列と称する。   Further, the edge detection unit 12 detects a plurality of edges of the geometrical shape from the detailed model image and stores them in the storage unit 21 or the recording medium 22 as the original edge array (step S10). This edge arrangement is called the original detailed edge arrangement.

そして、エッジ群選択部13によって、元の詳細エッジ配列の複数のエッジについて、角度の分散性スコア、位置の分散性スコア及びコントラストの強度スコアを算出する(ステップS11、S12、S13)。また、エッジ群選択部13によって、これらのスコアに基づいて、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように、元の詳細エッジ配列の複数のエッジを並べ替える(ステップS14)。ここで、並べ替えられたエッジ配列を、ソート後の詳細エッジ配列と称する。   Then, the edge group selection unit 13 calculates the angle dispersiveness score, the position dispersiveness score, and the contrast intensity score for the plurality of edges of the original detailed edge array (steps S11, S12, and S13). Further, the edge group selecting unit 13 rearranges the plurality of edges of the original detailed edge array based on these scores so that the edge having the higher angle and position dispersibility and the higher the contrast has a higher rank (step S14). Here, the rearranged edge array is referred to as a sorted detailed edge array.

更に、エッジ群選択部13によって、ソート後の詳細エッジ配列において、先頭から連続する所定の要素数のエッジを、探索動作に用いるエッジ群として選択し、記憶部21又は記録媒体22に記憶させる(ステップS15)。このエッジ群を、詳細エッジ群と称する。   Further, the edge group selection unit 13 selects, in the detailed edge array after sorting, an edge having a predetermined number of elements continuous from the beginning as an edge group to be used for the search operation, and stores it in the storage unit 21 or the recording medium 22 ( Step S15). This edge group is called a detailed edge group.

このように、モデル画像について、粗エッジ群及び詳細エッジ群を求めて記憶させることで学習動作を終了する。   In this way, the learning operation ends by obtaining and storing the rough edge group and the detailed edge group for the model image.

画像処理装置1において、対象画像に対してモデル画像を探索する探索動作について、図7に示すフローチャートを参照して説明する。   A search operation of searching the model image for the target image in the image processing apparatus 1 will be described with reference to the flowchart shown in FIG. 7.

先ず、対象画像入力部11によって対象画像を入力し、記憶部21又は記録媒体22に記憶させる(ステップS21)。この入力した対象画像を、元の対象画像と称する。   First, a target image is input by the target image input unit 11 and stored in the storage unit 21 or the recording medium 22 (step S21). The input target image is referred to as the original target image.

次に、エッジ検出部12によって、元の対象画像を粗粒度で縮小化し、記憶部21又は記録媒体22に記憶させる(ステップS22)。この粗粒度で縮小化した対象画像を、粗対象画像と称する。   Next, the edge detection unit 12 reduces the original target image to a coarse grain size and stores it in the storage unit 21 or the recording medium 22 (step S22). The target image reduced with this coarse grain size is referred to as a rough target image.

また、エッジ検出部12によって、粗対象画像から幾何学形状の複数のエッジを検出し、エッジ配列として記憶部21又は記録媒体22に記憶させる(ステップS23)。このエッジ配列を、粗対象エッジ配列と称する。   Further, the edge detection unit 12 detects a plurality of edges of the geometrical shape from the rough target image, and stores them in the storage unit 21 or the recording medium 22 as an edge array (step S23). This edge arrangement is called a rough target edge arrangement.

そして、探索実行部14によって、粗モデルエッジ群と粗対象エッジ配列とを突き合わせて、対象画像に対してモデル画像の探索を行う(ステップS24)。このとき、粗対象エッジ配列に対する粗モデルエッジ群のおおよその位置及び姿勢を探索し、その探索結果である粗位置情報を検出して記憶部21又は記録媒体22に記憶させる(ステップS25)。   Then, the search execution unit 14 matches the rough model edge group with the rough target edge array to search the target image for a model image (step S24). At this time, the rough position and orientation of the rough model edge group with respect to the rough target edge array are searched, and the rough position information as the search result is detected and stored in the storage unit 21 or the recording medium 22 (step S25).

次に、エッジ検出部12によって、元の対象画像を詳細粒度で縮小化し、記憶部21又は記録媒体22に記憶させる(ステップS26)。この詳細粒度で縮小化した対象画像を、詳細対象画像と称する。   Next, the edge detection unit 12 reduces the original target image in detail granularity and stores it in the storage unit 21 or the recording medium 22 (step S26). The target image reduced with this detailed grain size is referred to as a detailed target image.

また、エッジ検出部12によって、詳細対象画像から幾何学形状の複数のエッジを検出し、元のエッジ配列として記憶部21又は記録媒体22に記憶させる(ステップS27)。このエッジ配列を、詳細対象エッジ配列と称する。   Further, the edge detection unit 12 detects a plurality of edges of the geometrical shape from the detail target image and stores them as the original edge array in the storage unit 21 or the recording medium 22 (step S27). This edge array is referred to as a detail target edge array.

そして、探索実行部14によって、詳細モデルエッジ群と詳細対象エッジ配列とを突き合わせて、対象画像に対してモデル画像の探索を行う(ステップS28)。このとき、粗位置情報も利用しつつ、詳細対象エッジ配列に対する詳細モデルエッジ群の詳細な位置及び姿勢を探索し、その探索結果である詳細位置情報を検出して記憶部21又は記録媒体22に記憶させる(ステップS29)。   Then, the search execution unit 14 matches the detailed model edge group with the detailed target edge array to search the target image for a model image (step S28). At this time, the coarse position information is also used to search the detailed position and orientation of the detailed model edge group with respect to the detailed target edge array, and the detailed position information which is the search result is detected and stored in the storage unit 21 or the recording medium 22. It is stored (step S29).

更に、詳細対象エッジ配列に対する詳細モデルエッジ群の詳細位置情報を用いることで、対象画像に対するモデル画像の位置及び姿勢を検出することができ、更に、対象画像の幾何学形状の位置決めを行うことができる。   Furthermore, by using the detailed position information of the detailed model edge group for the detailed target edge array, the position and orientation of the model image with respect to the target image can be detected, and furthermore, the geometric shape of the target image can be positioned. it can.

本実施形態によれば、上記したように、対象画像及びモデル画像にそれぞれ示される幾何学形状のマッチング処理を行う画像処理装置1は、エッジ検出部12によって、対象画像及びモデル画像から幾何学形状の輪郭を示す複数のエッジを検出し、エッジ群選択部13によって、モデル画像の複数のエッジのエッジ配列を、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替え、並べ替えたエッジ配列において、先頭から連続する所定の要素数のエッジをエッジ群として選択し、探索実行部14によって、対象画像の複数のエッジとモデル画像のエッジ群とを用いて、マッチング処理を行う。   According to the present embodiment, as described above, in the image processing apparatus 1 that performs the matching process of the geometric shapes shown in the target image and the model image, the edge detection unit 12 causes the geometric shape to be calculated from the target image and the model image. Edges are detected, and the edge group selecting unit 13 rearranges the edge array of the plurality of edges of the model image so that the edge having a high degree of angle and position dispersion and a high contrast has a higher edge. In the rearranged edge array, edges having a predetermined number of elements continuous from the beginning are selected as an edge group, and the search execution unit 14 uses the plurality of edges of the target image and the edge group of the model image to perform matching processing. I do.

換言すれば、本発明の画像処理方法は、対象画像及びモデル画像にそれぞれ示される幾何学形状のマッチング処理を行う画像処理方法であって、対象画像及びモデル画像から幾何学形状の輪郭を示す複数のエッジを検出する工程と、モデル画像の複数のエッジのエッジ配列を、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替える工程と、並べ替えたエッジ配列において、先頭から連続する所定の要素数のエッジをエッジ群として選択する工程と、対象画像の複数のエッジとモデル画像のエッジ群とを用いて、マッチング処理を行う工程とを含む。   In other words, the image processing method of the present invention is an image processing method for performing the matching process of the geometric shapes shown in the target image and the model image, respectively. The step of detecting the edges of, the step of rearranging the edge array of the plurality of edges of the model image so that the edge having a higher degree of angle and position dispersiveness and higher contrast has a higher order, and the rearranged edge array, The method includes a step of selecting an edge group having a predetermined number of continuous edges from the beginning as an edge group, and a step of performing matching processing using a plurality of edges of the target image and the edge group of the model image.

このように、本実施形態では、マッチング処理に用いられるモデル画像のエッジ群は、角度や位置がばらついた(万遍なく分布した)エッジで構成されるので、対象画像とモデル画像のエッジ間を照合するときの確実性を向上することができる。即ち、様々な角度や位置のエッジを含むほど、エッジ群の信頼性が高くなる。   As described above, in the present embodiment, the edge group of the model image used for the matching process is composed of edges whose angles and positions are dispersed (evenly distributed). The certainty at the time of collation can be improved. That is, the reliability of the edge group increases as the edges at various angles and positions are included.

また、モデル画像のエッジ群は、できるだけコントラストの大きいエッジを含むとよく、即ち、強いエッジをより高く評価するとよい。そこで、本発明において、モデル画像のエッジ配列は、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替えられるので、エッジ配列の先頭から所定の要素数のエッジを選択することで、万遍なく偏りのないエッジ群を検出することができる。そのため、モデル画像の縮小を最小限に抑制しても、マッチング処理に必要な要素数のエッジを選択することができるので、対象画像やモデル画像の幾何学形状の微小な構造を失うことなく、対象画像とモデル画像とを適切に比較してマッチング処理を行うことができる。   In addition, the edge group of the model image may include an edge having the highest contrast, that is, a strong edge may be evaluated higher. Therefore, in the present invention, the edge array of the model image is rearranged so that the edge having the higher dispersiveness of the angle and position and the higher the contrast is rearranged, so that the edge of the predetermined number of elements is selected from the head of the edge array. By doing so, it is possible to detect a uniform and even edge group. Therefore, even if the reduction of the model image is suppressed to the minimum, it is possible to select the edges having the number of elements required for the matching process, and thus without losing the minute structure of the geometric shape of the target image or the model image, The matching process can be performed by appropriately comparing the target image and the model image.

また、エッジ配列は分散性を考慮して並べられているので、間引き処理等を行う必要がなく、エッジ配列の先頭から連続したエッジを単純に抽出するだけで、モデル画像の幾何学形状から偏りなくエッジを選択することができ、エッジ群の要素数を抑制することもできる。そのため、幾何学形状の輪郭線形状の特徴的な構造を失うことなく、対象画像とモデル画像とを適切に比較してマッチング処理を行うことができる。したがって、本発明によれば、偏りなくエッジを選択して対象画像とモデル画像とのマッチング処理を正確且つ高速に行うことが可能となる。   Also, since the edge array is arranged in consideration of dispersibility, it is not necessary to perform thinning-out processing, etc., and it is possible to deviate from the geometric shape of the model image by simply extracting consecutive edges from the beginning of the edge array. It is possible to select an edge without using it, and it is possible to suppress the number of elements in the edge group. Therefore, the matching process can be performed by appropriately comparing the target image and the model image without losing the characteristic structure of the contour shape of the geometric shape. Therefore, according to the present invention, it is possible to select edges without bias and perform matching processing between a target image and a model image accurately and at high speed.

例えば、図8(A)に示すように、エッジ配列の全エッジ数が36である矩形の幾何学形状を有するモデル画像の場合、先頭から18エッジのエッジ群を選択すると、図8(B)に示すように、分散したエッジが選択される。また、先頭から10エッジのエッジ群を選択するときには、図8(C)に示すように、より分散したエッジが選択され、先頭から5エッジのエッジ群を選択するときには、図8(D)に示すように、更に分散したエッジが選択される。そのため、幾何学形状についてその特徴を把握できるようにエッジ群の要素数を設定するとよい。   For example, as shown in FIG. 8A, in the case of a model image having a rectangular geometrical shape in which the total number of edges in the edge array is 36, if an edge group of 18 edges from the beginning is selected, FIG. The dispersed edges are selected, as shown in. Further, when selecting an edge group of 10 edges from the beginning, more dispersed edges are selected as shown in FIG. 8C, and when selecting an edge group of 5 edges from the beginning, it is changed to FIG. 8D. More distributed edges are selected, as shown. Therefore, it is advisable to set the number of elements of the edge group so that the features of the geometric shape can be grasped.

例えば、エッジ群選択部13は、モデル画像の各エッジについて、角度の分散性を評価可能な角度分散性正規化スコア、位置の分散性を評価可能な位置分散性正規化スコア、及びコントラストの強度を評価可能なコントラスト正規化スコアを算出し、これらのスコアの大きいエッジほど、上位になるように、モデル画像のエッジ配列の並べ替えを行う。このように、エッジの角度の分散性、位置の分散性及びコントラストの強度を評価可能なスコアに換算することにより、エッジ間を明瞭に比較できるので、モデル画像のエッジ配列の並べ替えをより適切に行うことができ、より適切にエッジを選択することができる。   For example, the edge group selection unit 13 determines, for each edge of the model image, an angular dispersiveness normalized score that can evaluate the angular dispersiveness, a position dispersiveness normalized score that can evaluate the position dispersiveness, and a contrast strength. Is calculated, and the edge array of the model image is rearranged so that the edge having a larger score has a higher rank. In this way, by converting the dispersiveness of the angle of the edges, the dispersiveness of the positions, and the intensity of the contrast into a score that can be evaluated, the edges can be clearly compared, so that the rearrangement of the edge array of the model image is more appropriate. The edge can be selected more appropriately.

また、エッジ群選択部13は、角度分散性正規化スコア、位置分散性正規化スコア及びコントラスト正規化スコアの重み付き平均を算出して総合正規化スコアを算出し、総合正規化スコアの大きいエッジほど、上位になるように、モデル画像のエッジ配列の並べ替えを行う。これにより、角度、位置及びコントラストの何れかに偏ることなくエッジ間を比較できるので、モデル画像のエッジ配列の並べ替えをより適切に行うことができ、より適切にエッジを選択することができる。   The edge group selection unit 13 also calculates a weighted average of the angular dispersive normalization score, the position dispersive normalization score, and the contrast normalization score to calculate a total normalization score, and an edge having a large total normalization score. The edge arrays of the model images are rearranged so that they are ranked higher. Accordingly, the edges can be compared without being biased in any of the angle, the position, and the contrast, so that the edge arrangement of the model image can be more appropriately rearranged and the edges can be more appropriately selected.

また、本発明は、請求の範囲及び明細書全体から読み取ることのできる発明の要旨又は思想に反しない範囲で適宜変更可能であり、そのような変更を伴う画像処理方法や画像処理装置もまた本発明の技術思想に含まれる。   Further, the present invention can be appropriately modified without departing from the scope or spirit of the invention that can be read from the claims and the entire specification, and an image processing method and an image processing apparatus accompanied by such modification are also included in the present invention. It is included in the technical idea of the invention.

1 画像処理装置
10 モデル画像入力部
11 対象画像入力部
12 エッジ検出部
13 エッジ群選択部
14 探索実行部
20 制御部
21 記憶部
22 記録媒体
23 操作部
24 表示部
DESCRIPTION OF SYMBOLS 1 Image processing device 10 Model image input unit 11 Target image input unit 12 Edge detection unit 13 Edge group selection unit 14 Search execution unit 20 Control unit 21 Storage unit 22 Recording medium 23 Operation unit 24 Display unit

Claims (6)

対象画像及びモデル画像にそれぞれ示される幾何学形状のマッチング処理を行う画像処理方法であって、
前記対象画像及び前記モデル画像から前記幾何学形状の輪郭を示す複数のエッジを検出する工程と、
前記モデル画像の前記複数のエッジのエッジ配列を、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替える工程と、
並べ替えた前記エッジ配列において、先頭から連続する所定の要素数のエッジをエッジ群として選択する工程と、
前記対象画像の前記複数のエッジと前記モデル画像の前記エッジ群とを用いて、前記マッチング処理を行う工程とを含むことを特徴とする画像処理方法。
An image processing method for performing matching processing of geometric shapes respectively shown in a target image and a model image,
Detecting a plurality of edges indicating the contour of the geometric shape from the target image and the model image,
A step of rearranging an edge array of the plurality of edges of the model image so that an edge having a high degree of angle and position dispersiveness and a high contrast has a higher rank.
In the rearranged edge array, a step of selecting edges having a predetermined number of elements continuous from the beginning as an edge group,
And a step of performing the matching process using the plurality of edges of the target image and the edge group of the model image.
対象画像及びモデル画像にそれぞれ示される幾何学形状のマッチング処理を行う画像処理装置であって、
前記対象画像及び前記モデル画像から前記幾何学形状の輪郭を示す複数のエッジを検出し、
前記モデル画像の前記複数のエッジのエッジ配列を、角度及び位置の分散性が高くコントラストが大きいエッジほど、上位になるように並べ替え、
並べ替えた前記エッジ配列において、先頭から連続する所定の要素数のエッジをエッジ群として選択し、
前記対象画像の前記複数のエッジと前記モデル画像の前記エッジ群とを用いて、前記マッチング処理を行うことを特徴とする画像処理装置。
An image processing device for performing matching processing of geometric shapes respectively shown in a target image and a model image,
Detecting a plurality of edges indicating the contour of the geometric shape from the target image and the model image,
An edge array of the plurality of edges of the model image is rearranged so that an edge having a high dispersiveness in angle and position and a high contrast has a higher rank.
In the rearranged edge array, select edges having a predetermined number of elements continuous from the beginning as an edge group,
An image processing apparatus, wherein the matching process is performed using the plurality of edges of the target image and the edge group of the model image.
前記モデル画像の各エッジについて、角度の分散性を評価可能な角度分散性正規化スコアを算出し、
前記角度分散性正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うことを特徴とする請求項2に記載の画像処理装置。
For each edge of the model image, the angle dispersiveness normalized score that can evaluate the dispersiveness of the angle is calculated,
The image processing apparatus according to claim 2, wherein the edge array of the model image is rearranged so that an edge having a larger normalized angular dispersiveness score has a higher rank.
前記モデル画像の各エッジについて、位置の分散性を評価可能な位置分散性正規化スコアを算出し、
前記位置分散性正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うことを特徴とする請求項2に記載の画像処理装置。
For each edge of the model image, calculate the position dispersiveness normalized score that can evaluate the dispersiveness of the position,
The image processing apparatus according to claim 2, wherein the edge array of the model image is rearranged so that an edge having a larger position-dispersion normalization score has a higher rank.
前記モデル画像の各エッジについて、コントラストの強度を評価可能なコントラスト正規化スコアを算出し、
前記コントラスト正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うことを特徴とする請求項2に記載の画像処理装置。
For each edge of the model image, calculate a contrast normalization score that can evaluate the intensity of contrast,
The image processing apparatus according to claim 2, wherein the edge array of the model image is rearranged so that an edge having a higher contrast normalization score has a higher rank.
前記モデル画像の各エッジについて、角度の分散性を評価可能な角度分散性正規化スコア、位置の分散性を評価可能な位置分散性正規化スコア、及びコントラストの強度を評価可能なコントラスト正規化スコアを算出し、
前記角度分散性正規化スコア、前記位置分散性正規化スコア及び前記コントラスト正規化スコアの重み付き平均を算出して総合正規化スコアを算出し、
前記総合正規化スコアの大きいエッジほど、上位になるように、前記モデル画像の前記エッジ配列の並べ替えを行うことを特徴とする請求項2に記載の画像処理装置。
For each edge of the model image, an angular dispersive normalization score capable of evaluating the angular dispersiveness, a position dispersive normalization score capable of evaluating the position dispersiveness, and a contrast normalizing score capable of evaluating the contrast intensity And calculate
Calculating a generalized score by calculating a weighted average of the angle dispersive normalization score, the position dispersive normalization score and the contrast normalization score,
The image processing apparatus according to claim 2, wherein the edge array of the model image is rearranged such that an edge having a larger total normalization score has a higher rank.
JP2018205052A 2018-10-31 2018-10-31 Image processing method and image processing apparatus by geometric shape matching Active JP7252591B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018205052A JP7252591B2 (en) 2018-10-31 2018-10-31 Image processing method and image processing apparatus by geometric shape matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018205052A JP7252591B2 (en) 2018-10-31 2018-10-31 Image processing method and image processing apparatus by geometric shape matching

Publications (2)

Publication Number Publication Date
JP2020071661A true JP2020071661A (en) 2020-05-07
JP7252591B2 JP7252591B2 (en) 2023-04-05

Family

ID=70549574

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018205052A Active JP7252591B2 (en) 2018-10-31 2018-10-31 Image processing method and image processing apparatus by geometric shape matching

Country Status (1)

Country Link
JP (1) JP7252591B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269522A (en) * 2020-10-27 2021-01-26 维沃移动通信(杭州)有限公司 Image processing method, image processing device, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0418685A (en) * 1990-05-12 1992-01-22 Mitsubishi Electric Corp Picture processing system
WO2007072678A1 (en) * 2005-12-21 2007-06-28 Nikon Corporation Image combining method, image combining program, image combining device, template extracting method, and template extracting program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0418685A (en) * 1990-05-12 1992-01-22 Mitsubishi Electric Corp Picture processing system
WO2007072678A1 (en) * 2005-12-21 2007-06-28 Nikon Corporation Image combining method, image combining program, image combining device, template extracting method, and template extracting program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NATALIA ESAU,3名: "VisiTrack - Video Based Incremental Tracking in Real Time", SIXTH IEEE INTERNATIONAL SYMPOSIUM ON OBJECT-ORIENTED REAL-TIME DISTRIBUTED COMPUTING, 2003., JPN6022044958, 16 May 2003 (2003-05-16), ISSN: 0004903601 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269522A (en) * 2020-10-27 2021-01-26 维沃移动通信(杭州)有限公司 Image processing method, image processing device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
JP7252591B2 (en) 2023-04-05

Similar Documents

Publication Publication Date Title
US10958796B2 (en) Image processing apparatus, image processing method, and storage medium
TWI651662B (en) Image annotation method, electronic device and non-transitory computer readable storage medium
Kumar et al. A dataset for quality assessment of camera captured document images
US10769473B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
US8416982B2 (en) Image processing apparatus, image processing method and program
US10560601B2 (en) Image processing method, image processing apparatus, and storage medium
EP2617006B1 (en) Image processing apparatus and image processing method
US20060029276A1 (en) Object image detecting apparatus, face image detecting program and face image detecting method
US8472757B2 (en) Image search with feature point transformation
US9576218B2 (en) Selecting features from image data
US9633264B2 (en) Object retrieval using background image and query image
JP6393230B2 (en) Object detection method and image search system
US20100074479A1 (en) Hierarchical face recognition training method and hierarchical face recognition method thereof
JP4745207B2 (en) Facial feature point detection apparatus and method
JP2007334766A (en) Abnormal area detection device and abnormal area detection method
CN108573471B (en) Image processing apparatus, image processing method, and recording medium
JP2006338313A (en) Similar image retrieving method, similar image retrieving system, similar image retrieving program, and recording medium
JP6278108B2 (en) Image processing apparatus, image sensor, and image processing method
US8965133B2 (en) Image processing apparatus and control method therefor
KR20210020065A (en) Systems and methods for finding and classifying patterns in images with vision systems
US12013918B2 (en) Method and apparatus for clustering images
JP7252591B2 (en) Image processing method and image processing apparatus by geometric shape matching
US9104450B2 (en) Graphical user interface component classification
JP2006323779A (en) Image processing method and device
US20170213103A1 (en) Image retrieving device, image retrieving method, and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211006

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221013

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221025

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221212

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230316

R150 Certificate of patent or registration of utility model

Ref document number: 7252591

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350