JP2010140082A - Image processing method and image processor - Google Patents

Image processing method and image processor Download PDF

Info

Publication number
JP2010140082A
JP2010140082A JP2008313262A JP2008313262A JP2010140082A JP 2010140082 A JP2010140082 A JP 2010140082A JP 2008313262 A JP2008313262 A JP 2008313262A JP 2008313262 A JP2008313262 A JP 2008313262A JP 2010140082 A JP2010140082 A JP 2010140082A
Authority
JP
Japan
Prior art keywords
image
correlation
value
unit
original image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008313262A
Other languages
Japanese (ja)
Inventor
Kenji Oda
賢治 小田
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2008313262A priority Critical patent/JP2010140082A/en
Publication of JP2010140082A publication Critical patent/JP2010140082A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce a circuit scale, and to quickly and satisfactorily perform pattern matching of an image without changing a threshold. <P>SOLUTION: An image processor is provided with: an edge extraction part 2 of an original image, for generating an edge image from an original image input by an original image input part 1; a binarization part 3 for an original image, for binarizing the edge image generated by the edge extraction part 2 of the original image based on mutually different thresholds, and for generating a plurality of binary images; a correlation part 8 for calculating a correlation value between each of the plurality of binary images generated by the binarization part 3 for an original image and a binary image for reference stored in a memory part 7; and a correlation value selection part 9 for selecting the correlation value indicating that correlation is the highest from among a plurality of correlation values calculated by the correlation part 8. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、画像処理方法および画像処理装置に関し、特に、2値化しにくい濃淡画像について良好にパターンマッチングを行い、画像の位置合わせや特定パターンの抽出を可能にする画像処理方法および画像処理装置に関する。   The present invention relates to an image processing method and an image processing apparatus, and more particularly, to an image processing method and an image processing apparatus that perform pattern matching satisfactorily for grayscale images that are difficult to binarize and enable image alignment and extraction of specific patterns. .

自動化された製造ライン等において、進行する物体をカメラ等で撮影し、画像中の対象物の位置や姿勢を自動的に計測したり物体の種類を判別する画像処理装置が用いられている。   In an automated production line or the like, an image processing apparatus is used in which a moving object is photographed with a camera or the like, and the position and orientation of an object in the image are automatically measured and the type of the object is determined.

図7は、特許文献1に記載された画像処理装置の構成を示すブロック図である。図7に示す画像処理装置において、DOG(Difference of Gaussian)フィルタリング手段42は、原画像入力手段(カメラ)41で撮像された画像を入力し、DOGフィルタリング処理を行う。閾値処理手段43は、DOGフィルタリング手段42の出力を3値化(−1、0、+1)する。3値化された画像は第2メモリ48に格納される。また、DOGフィルタリング手段45は、所定のメモリに格納されている参照パターン44についてDOGフィルタリング処理を行う。閾値処理手段46は、DOGフィルタリング手段45の出力を3値化する。3値化された画像は第1メモリ47に格納される。類似度計算手段49は、第1メモリ47に格納された画像と第2メモリ48に格納された画像との類似度を計算し、記憶部であるスコアマップ50に格納する。制御手段51は、スコアマップ50を探索し、最も類似度が高いものを求める。   FIG. 7 is a block diagram showing the configuration of the image processing apparatus described in Patent Document 1. In the image processing apparatus shown in FIG. 7, a DOG (Difference of Gaussian) filtering unit 42 inputs an image captured by an original image input unit (camera) 41 and performs DOG filtering processing. The threshold processing means 43 ternarizes (-1, 0, +1) the output of the DOG filtering means 42. The ternarized image is stored in the second memory 48. The DOG filtering unit 45 performs DOG filtering processing on the reference pattern 44 stored in a predetermined memory. The threshold processing unit 46 ternizes the output of the DOG filtering unit 45. The ternarized image is stored in the first memory 47. The similarity calculation means 49 calculates the similarity between the image stored in the first memory 47 and the image stored in the second memory 48 and stores it in the score map 50 that is a storage unit. The control means 51 searches the score map 50 and finds the one with the highest similarity.

特開平6−76062号公報(段落0056−0066、図1)JP-A-6-76062 (paragraphs 0056-0066, FIG. 1)

図7に示された画像処理装置では、空間バンドパスフィルタとしてDOGフィルタを使用するので計算が複雑で処理時間がかかるという課題がある。また、DOGフィルタをハードウェアで実現しようとすると、回路が複雑で大規模になるという課題がある。   In the image processing apparatus shown in FIG. 7, since a DOG filter is used as a spatial bandpass filter, there is a problem that calculation is complicated and processing time is required. In addition, when the DOG filter is realized by hardware, there is a problem that the circuit becomes complicated and large-scale.

また、図7に示された画像処理装置では、参照パターンがあらかじめ装置内部に格納される。参照パターンは入力される原画像と同様に、多ビットデータであるから、多数の参照パターンを格納する場合には記憶手段に求められるメモリ容量が大きくなり回路が大規模になるという課題がある。また、多数の参照パターンから所望の参照パターンの検索および選択を行うための処理時間がかかるという課題もある。   In the image processing apparatus shown in FIG. 7, the reference pattern is stored in the apparatus in advance. Since the reference pattern is multi-bit data like the input original image, there is a problem that when a large number of reference patterns are stored, the memory capacity required for the storage means becomes large and the circuit becomes large. Another problem is that it takes a long time to search and select a desired reference pattern from a large number of reference patterns.

さらに、閾値処理手段43,46がDOGフィルタリング手段42,45の出力画像を3値化するために、閾値が設定されていなければならない。例えば、画像処理装置を自律ロボットの自然地形認識等の用途に用いる場合には、日照条件や照明条件が変化するようなシーンの入力が想定され、適宜閾値を変更することが好ましい。しかし、オフラインで動く自律ロボットには人の入力が介在されないため、容易に閾値設定の変更を行うことができないという課題がある。   Furthermore, in order for the threshold processing means 43 and 46 to ternarize the output images of the DOG filtering means 42 and 45, a threshold must be set. For example, when the image processing apparatus is used for an application such as recognition of natural terrain of an autonomous robot, it is preferable to input a scene in which sunshine conditions and lighting conditions change, and to change the threshold appropriately. However, since there is no human input in the autonomous robot that moves offline, there is a problem that the threshold setting cannot be easily changed.

そこで、本発明は、回路規模を小規模にでき、かつ、閾値を変更することなく高速で良好に画像のパターンマッチングを行うことができる画像処理方法および画像処理装置を提供することを目的とする。   Accordingly, an object of the present invention is to provide an image processing method and an image processing apparatus capable of reducing the circuit scale and performing good pattern matching at high speed without changing the threshold value. .

本発明による画像処理方法は、パターンマッチングの参照パターンにする参照画像を入力する参照画像入力ステップと、入力された参照画像から、濃度変化を強調した参照用のエッジ画像を生成する参照画像のエッジ抽出ステップと、参照画像のエッジ抽出ステップで生成された参照用のエッジ画像を2値化して、参照用の2値画像を生成する参照画像用2値化ステップと、パターンマッチングの対象となる画像を入力する原画像入力ステップと、入力された原画像から、濃度変化を強調したエッジ画像を生成する原画像のエッジ抽出ステップと、原画像のエッジ抽出ステップで生成されたエッジ画像を互いに異なる閾値にもとづいて2値化し、複数の2値画像を生成する原画像用2値化ステップと、原画像用2値化ステップで生成された複数の2値画像のそれぞれと、参照画像用2値化ステップで生成された参照用の2値画像との間で相関値を算出する相関ステップと、相関ステップで算出された複数の相関値の中から最も相関が高いことを示す相関値を選択する相関値選択ステップと、相関値選択ステップで選択された相関値の算出の基になった原画像を特定するデータを出力する画像同定ステップとを含むことを特徴とする。   An image processing method according to the present invention includes a reference image input step of inputting a reference image to be a reference pattern for pattern matching, and an edge of the reference image for generating a reference edge image in which density change is emphasized from the input reference image A reference image binarization step that binarizes the reference edge image generated in the extraction step, the reference image edge extraction step, and generates a reference binary image; and an image to be subjected to pattern matching The original image input step for inputting the edge image, the edge extraction step for generating the edge image in which the density change is emphasized from the input original image, and the edge image generated in the edge extraction step for the original image are different from each other. Binarization based on the original image and generating a plurality of binary images, and the binarization step generated by the original image binarization step. A correlation step for calculating a correlation value between each of the binary images and the reference binary image generated in the reference image binarization step, and a plurality of correlation values calculated in the correlation step A correlation value selection step for selecting a correlation value indicating the highest correlation from the correlation value selection step, and an image identification step for outputting data for specifying an original image used as a basis for calculation of the correlation value selected in the correlation value selection step. It is characterized by including.

本発明による画像処理装置は、パターンマッチングの参照パターンとして用いられる参照画像を入力する参照画像入力部と、参照画像入力部が入力した参照画像から、濃度変化を強調した参照用のエッジ画像を生成する参照画像のエッジ抽出部と、参照画像のエッジ抽出部が生成した参照用のエッジ画像を2値化して、参照用の2値画像を生成する参照画像用2値化部と、参照画像用2値化部が生成した参照用の2値画像を一時的に格納するメモリ部と、パターンマッチングの対象となる画像を入力する原画像入力部と、原画像入力部が入力した原画像から、濃度変化を強調したエッジ画像を生成する原画像のエッジ抽出部と、原画像のエッジ抽出部が生成したエッジ画像を互いに異なる閾値にもとづいて2値化し、複数の2値画像を生成する原画像用2値化部と、原画像用2値化部が生成した複数の2値画像のそれぞれと、メモリ部に格納された参照用の2値画像との間で相関値を算出する相関部と、相関部が算出した複数の相関値の中から最も相関が高いことを示す相関値を選択する相関値選択部と、相関値選択部が選択した相関値の算出の基になった原画像を特定するデータを出力する画像同定部とを備えたことを特徴とする。   An image processing apparatus according to the present invention generates a reference image that emphasizes a change in density from a reference image input unit that inputs a reference image used as a reference pattern for pattern matching and a reference image that is input by the reference image input unit. A reference image edge extraction unit, a reference image binarization unit that binarizes the reference edge image generated by the reference image edge extraction unit, and generates a reference binary image; From a memory unit that temporarily stores a reference binary image generated by the binarization unit, an original image input unit that inputs an image to be subjected to pattern matching, and an original image input by the original image input unit, The edge extraction unit of the original image that generates the edge image that emphasizes the density change and the edge image generated by the edge extraction unit of the original image are binarized based on different threshold values to generate a plurality of binary images. Correlation for calculating a correlation value between an original image binarization unit, each of a plurality of binary images generated by the original image binarization unit, and a reference binary image stored in the memory unit A correlation value selection unit that selects a correlation value that indicates the highest correlation among a plurality of correlation values calculated by the correlation unit, and an original that is a basis for calculating the correlation value selected by the correlation value selection unit. And an image identification unit that outputs data for specifying an image.

本発明によれば、回路規模を小規模にでき、かつ、閾値を変更することなく高速で良好に画像のパターンマッチングを行うことができる。   According to the present invention, the circuit scale can be reduced and image pattern matching can be performed at high speed and satisfactorily without changing the threshold value.

以下、本発明の実施形態を図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明による画像処理装置の構成の一例を示すブロック図である。図1に示す画像処理装置において、原画像入力手段11は、パターンマッチングの対象となるシーンをカメラで撮像し撮像信号をディジタルデータにA−D変換して、エッジ抽出手段12に出力する。エッジ抽出手段12は、入力した原画像のディジタルデータを2次元の微分処理によって原画像の濃度変化が大きい部分を強調した多値のエッジ画像にし、エッジ画像を2値化変換手段130に出力する。2値化変換手段130は、複数個の2値化手段131,132,・・・,13nで構成されている。エッジ抽出手段12からの多値のエッジ画像は、全ての2値化手段131,132,・・・,13nに入力される。複数個の2値化手段131,132,・・・,13nは、入力したエッジ画像を互いに異なる所定の閾値によって2値化し(「0」または「1」にし)、2値画像を、2値化手段131,132,・・・,13nの各々に対応して設けられている2値相関手段141,142,・・,14nに出力する。すなわち、2値化手段131が出力する2値画像を2値相関手段141に入力され、2値化手段132が出力する2値画像が2値相関手段142に入力され、2値化手段13nが出力する2値画像が2値相関手段14nに入力される。   FIG. 1 is a block diagram showing an example of the configuration of an image processing apparatus according to the present invention. In the image processing apparatus shown in FIG. 1, an original image input unit 11 captures a scene to be subjected to pattern matching with a camera, A / D converts the imaged signal into digital data, and outputs the digital data to the edge extraction unit 12. The edge extraction unit 12 converts the input digital data of the original image into a multi-valued edge image by emphasizing a portion where the density change of the original image is large by two-dimensional differentiation, and outputs the edge image to the binarization conversion unit 130. . The binarization conversion means 130 is composed of a plurality of binarization means 131, 132,. The multi-valued edge image from the edge extraction means 12 is input to all the binarization means 131, 132,. The plurality of binarizing means 131, 132,..., 13n binarize the input edge images with different predetermined threshold values ("0" or "1"), and binarize the binary image. , 13n are output to binary correlation means 141, 142,..., 14n provided corresponding to each of the conversion means 131, 132,. That is, the binary image output from the binarizing unit 131 is input to the binary correlating unit 141, the binary image output from the binarizing unit 132 is input to the binary correlating unit 142, and the binarizing unit 13n The binary image to be output is input to the binary correlation means 14n.

また、シーンを撮像する前に、あらかじめ、図1に示す破線部21における各ブロックを用いた処理が実施される。すなわち、原画像入力手段11、エッジ抽出手段12および2値化手段131,132,・・・,13nと同様の処理を行う参照画像入力手段17、エッジ抽出手段18および2値化手段19を用いて、参照画像から、パターンマッチングを行うためのテンプレート画像を作成する。なお、2値化手段19は、原画像の場合とは異なり、1つだけ設けられている。   Further, before the scene is imaged, processing using each block in the broken line portion 21 shown in FIG. 1 is performed in advance. That is, the reference image input means 17, the edge extraction means 18 and the binarization means 19 that perform the same processing as the original image input means 11, the edge extraction means 12 and the binarization means 131, 132,. Thus, a template image for pattern matching is created from the reference image. Unlike the original image, only one binarizing means 19 is provided.

また、テンプレート画像のサイズは、原画像入力手段11が入力する画像のサイズよりも小さい。すなわち、本実施形態では、原画像入力手段11が撮像するシーンの中から、参照画像に類似する画像を見出すことことを想定する。ただし、テンプレート画像のサイズが、原画像入力手段11が入力する画像のサイズと同じであっても、本発明を適用することができる。また、参照画像は、あらかじめ記憶手段に格納されているのではなく、パターンマッチングを行う場合に、カメラ等による参照画像入力手段17によって取り込まれる。   The size of the template image is smaller than the size of the image input by the original image input unit 11. That is, in this embodiment, it is assumed that an image similar to the reference image is found from the scene captured by the original image input unit 11. However, the present invention can be applied even if the size of the template image is the same as the size of the image input by the original image input means 11. Further, the reference image is not stored in advance in the storage means, but is captured by the reference image input means 17 such as a camera when pattern matching is performed.

具体的には、カメラ等の撮像素子である参照画像入力手段17は、あらかじめ参照画像とするシーンを撮像し撮像信号をA−D変換してディジタルデータに変換し、エッジ抽出手段18に出力する。エッジ抽出手段18は、入力した参照画像のディジタルデータをエッジ抽出手段12と同じ2次元の微分処理によって多値のエッジ画像にして2値化手段19に出力する。2値化手段19は、エッジ抽出手段18から入力したエッジ画像を、あらかじめ設定した閾値によって2値化し(「0」または「1」にし)、2値画像をメモリ20に格納する。メモリ20は、格納した2値画像を2値化手段131,132,・・・,13nからの2値画像の出力タイミングに合わせて、複数個で構成される2値相関手段141,142,・・,14nの全てに出力する。   Specifically, the reference image input means 17 that is an image pickup device such as a camera picks up a scene as a reference image in advance, A-D converts the image pickup signal into digital data, and outputs it to the edge extraction means 18. . The edge extracting unit 18 converts the input digital data of the reference image into a multi-valued edge image by the same two-dimensional differentiation process as that of the edge extracting unit 12 and outputs the multi-valued edge image to the binarizing unit 19. The binarizing means 19 binarizes the edge image input from the edge extracting means 18 with a preset threshold (“0” or “1”), and stores the binary image in the memory 20. The memory 20 stores a plurality of binary correlation means 141, 142,... Configured in accordance with the output timing of the binary images from the binarization means 131, 132,.・ Output to all 14n.

2値相関手段141,142,・・,14nは、対応する2値化手段131,132,・・・,13nから入力した原画像の2値画像とメモリ20から入力した参照画像の2値画像との相関を取り、それぞれ、最も相関が高い点の画像上の2次元座標値およびその相関値を相関値選択手段15に出力する。相関値選択手段15は、2値相関手段141,142,・・,14nから入力した相関値の中から最も相関が高い値を選択し、その画像上の2次元座標値を位置同定手段16に出力する。位置同定手段16は、相関値選択手段15から入力した座標値をナビゲーション用の制御CPU等の上位装置のインタフェースに出力する。   The binary correlation means 141, 142,..., 14n are binary images of the original image input from the corresponding binarization means 131, 132,. And the two-dimensional coordinate value on the image of the point having the highest correlation and the correlation value thereof are output to the correlation value selection means 15. The correlation value selection means 15 selects the value having the highest correlation from the correlation values input from the binary correlation means 141, 142,..., 14n, and the two-dimensional coordinate value on the image is sent to the position identification means 16. Output. The position identification unit 16 outputs the coordinate value input from the correlation value selection unit 15 to an interface of a host device such as a control CPU for navigation.

なお、原画像入力手段11および参照画像入力手段17以外の図1に示された構成要素は、プログラムに従って処理を実行する計算機で実現可能である。   The components shown in FIG. 1 other than the original image input unit 11 and the reference image input unit 17 can be realized by a computer that executes processing according to a program.

次に、図1に示された画像処理装置の各部の動作を、図2のフローチャートおよび図3の説明図を参照して説明する。図2は、画像処理装置の動作を示すフローチャートである。図3は、エッジフィルタ処理の一例を示す説明図である。   Next, the operation of each unit of the image processing apparatus shown in FIG. 1 will be described with reference to the flowchart of FIG. 2 and the explanatory diagram of FIG. FIG. 2 is a flowchart showing the operation of the image processing apparatus. FIG. 3 is an explanatory diagram illustrating an example of edge filter processing.

[エッジ抽出手段12,18の動作例]
エッジ抽出手段12は、原画像入力手段11から入力した画像のディジタルデータに対して2次元の微分処理を施して多値のエッジ画像を生成する(ステップS21)。また、エッジ抽出手段18は、参照画像入力手段17から入力した画像のディジタルデータに対して2次元の微分処理を施して多値のエッジ画像を生成する(ステップS21)。
[Operation Example of Edge Extraction Units 12 and 18]
The edge extraction unit 12 performs a two-dimensional differentiation process on the digital data of the image input from the original image input unit 11 to generate a multi-valued edge image (step S21). Further, the edge extraction unit 18 performs a two-dimensional differentiation process on the digital data of the image input from the reference image input unit 17 to generate a multi-valued edge image (step S21).

エッジ抽出手段12,18は、例えば、入力画像における注目画素を中心とする3×3画素や5×5画素等といった微小領域に、ソーベルフィルタ処理やラプラシアンフィルタ処理等のエッジフィルタ処理を施す。入力画像の全画素にエッジフィルタ処理を適用することによってエッジ画像を得る。   The edge extraction units 12 and 18 perform edge filter processing such as Sobel filter processing and Laplacian filter processing on a small region such as 3 × 3 pixels or 5 × 5 pixels centered on the target pixel in the input image, for example. An edge image is obtained by applying edge filtering to all pixels of the input image.

また、以下に説明するエッジフィルタを使用することによって、エッジ抽出手段12,18は、上記の一般的なエッジフィルタ処理に比べて強力なエッジ抽出を行うことができる。すなわち、入力画像における注目画素を中心に3×3画素の微小領域を抽出し、図3(a)〜(d)のそれぞれに示された各々のフィルタ係数と抽出した微小領域の画像の濃淡値とを乗算し、9画素分の乗算結果を合計し、合計値の絶対値をとる。そして、図3(a)〜(d)に示された各々のフィルタ係数を用いて算出された4つの絶対値のうちの最も大きい値をその注目画素の出力値とする。以上の処理を入力画像の全画素について行うことによって、一般的なエッジフィルタ処理による画像に比べて感度が高いエッジ画像を得ることができる。   Further, by using the edge filter described below, the edge extraction means 12 and 18 can perform powerful edge extraction as compared with the general edge filter processing described above. That is, a 3 × 3 pixel minute region is extracted centering on the target pixel in the input image, and each filter coefficient shown in each of FIGS. 3A to 3D and the gradation value of the extracted minute region image are displayed. And the multiplication results for 9 pixels are summed to obtain the absolute value of the sum. Then, the largest value among the four absolute values calculated using the respective filter coefficients shown in FIGS. 3A to 3D is set as the output value of the target pixel. By performing the above processing for all the pixels of the input image, an edge image having higher sensitivity than an image obtained by general edge filter processing can be obtained.

図3(a)に示されたフィルタ係数を用いる場合には、エッジ抽出手段12,18は、注目画素を中心とする微小領域(注目画素を中心に数画素の範囲の近傍領域:この例では縦横3画素の範囲)における上辺の濃淡値の合計から下辺の濃淡値の合計を差分した値の絶対値を演算している。図3(b)に示されたフィルタ係数を用いる場合には、エッジ抽出手段12,18は、近傍領域の左辺の濃淡値の合計から右辺の濃淡値の合計を差分した値の絶対値を演算している。図3(c)に示されたフィルタ係数を用いる場合には、エッジ抽出手段12,18は、近傍領域の左上領域の濃淡値の合計から右下領域の濃淡値の合計を差分した値の絶対値を演算している。図3(d)に示されたフィルタ係数を用いる場合には、エッジ抽出手段12,18は、近傍領域の右上領域の濃淡値の合計から左下領域の濃淡値の合計を差分した値の絶対値を演算している。なお、この例では、縦横3×3画素の範囲を近傍領域にしているが、近傍領域の大きさは3×3画素に限定されない。   When the filter coefficients shown in FIG. 3A are used, the edge extraction means 12 and 18 are arranged so that the minute region centered on the pixel of interest (near region in the range of several pixels centered on the pixel of interest: in this example) The absolute value of the value obtained by subtracting the sum of the shade values of the lower side from the sum of the shade values of the upper side in the range of 3 pixels in the vertical and horizontal directions is calculated. When the filter coefficient shown in FIG. 3B is used, the edge extraction means 12 and 18 calculate the absolute value of a value obtained by subtracting the sum of the gray values on the left side of the neighboring region from the sum of the gray values on the right side. is doing. When the filter coefficient shown in FIG. 3C is used, the edge extraction means 12 and 18 calculates the absolute value of the difference obtained by subtracting the sum of the shade values of the upper left area from the sum of the shade values of the lower right area. The value is being calculated. When the filter coefficients shown in FIG. 3D are used, the edge extraction means 12 and 18 calculate the absolute value of the value obtained by subtracting the sum of the shade values of the lower left region from the sum of the shade values of the upper right region of the neighboring region. Is calculated. In this example, the range of 3 × 3 pixels in the vertical and horizontal directions is set as the neighborhood region, but the size of the neighborhood region is not limited to 3 × 3 pixels.

エッジ抽出手段12は、エッジフィルタ処理による多値のエッジ画像を2値化手段131,132,・・・,13nに出力する(ステップS22)。エッジ抽出手段18は、エッジフィルタ処理による多値のエッジ画像を2値化手段19に出力する(ステップS22)。   The edge extraction unit 12 outputs the multi-valued edge image by the edge filter process to the binarization units 131, 132,..., 13n (step S22). The edge extracting unit 18 outputs a multi-valued edge image obtained by the edge filter process to the binarizing unit 19 (step S22).

[2値化手段131,132,・・・,13nおよび2値化手段19の動作例]
2値化手段131,132,・・・,13nは、各々、エッジ抽出手段12から入力したエッジ画像を所定の閾値によって2値化して、各々の画素値が「0」または「1」である2値画像を生成し、2値画像を2値相関手段141,142,・・,14nに出力する(ステップS23)。2値化手段19は、エッジ抽出手段18から入力したエッジ画像を所定の閾値によって2値化して、各々の画素値が「0」または「1」である2値画像を生成し、2値画像をメモリ20に出力する(ステップS23)。なお、ステップS23の処理において、2値化手段131,132,・・・,13nおよび2値化手段19は、入力したエッジ画像の全画素の各々について、画像の濃淡値が設定された閾値以上である場合には「1」を出力し、閾値未満の場合には「0」を出力する。
[Operation example of binarization means 131, 132,..., 13n and binarization means 19]
Each of the binarizing units 131, 132,..., 13n binarizes the edge image input from the edge extracting unit 12 with a predetermined threshold value, and each pixel value is “0” or “1”. A binary image is generated, and the binary image is output to the binary correlation means 141, 142,..., 14n (step S23). The binarizing unit 19 binarizes the edge image input from the edge extracting unit 18 with a predetermined threshold value, and generates a binary image having each pixel value “0” or “1”, thereby generating a binary image. Is output to the memory 20 (step S23). In the process of step S23, the binarizing means 131, 132,..., 13n and the binarizing means 19 are equal to or greater than a threshold value at which the gray value of the image is set for each of all pixels of the input edge image. If it is, “1” is output, and if it is less than the threshold, “0” is output.

また、2値化手段19には、あらかじめ調整された閾値が設定され、2値化手段131,132,・・・,13nの各々には、互いに異なる閾値があらかじめ設定される。参照画像入力時と原画像入力時とで照明条件等が異なり2値化手段19に設定された閾値が2値化手段131,132,・・・,13nでは最適な閾値ではない場合が想定されるからである。つまり、複数個で構成されている2値化手段131,132,・・・,13nの各々には、照明条件等の環境条件の違いに応じた異なる閾値があらかじめ設定される。すなわち、本実施形態では、環境条件が異なったことに応じて閾値を変更することは要求されない。よって、閾値設定の変更を容易に行うことができない用途に対して、本実施形態を好適に適用することができる。   In addition, a threshold value adjusted in advance is set in the binarizing means 19, and different threshold values are set in advance in each of the binarizing means 131, 132,. It is assumed that the threshold value set in the binarizing means 19 is not the optimum threshold value in the binarizing means 131, 132,. This is because that. That is, different threshold values are set in advance for each of the binarization means 131, 132,. That is, in the present embodiment, it is not required to change the threshold value according to the difference in environmental conditions. Therefore, the present embodiment can be suitably applied to an application in which the threshold setting cannot be easily changed.

なお、原画像入力時に動作する2値化手段131,132,・・・,13nが複数個で構成されているので、異なる閾値による2値化の同時並列処理が実行可能である。   Since the binarization means 131, 132,..., 13n operating at the time of inputting the original image are configured in plural, it is possible to execute binarization simultaneous parallel processing with different threshold values.

また、2値化手段131,132,・・・,13nに設定される閾値は、入力されるエッジ画像から濃淡値のヒストグラムを作成する等によって画像特性を判断し、各々の画像特性にもとづく複数個の閾値を自動設定するようにするようにしてもよい。   Further, the threshold values set in the binarizing means 131, 132,..., 13n are determined based on image characteristics by, for example, creating a grayscale histogram from the input edge image, and a plurality of threshold values based on the respective image characteristics. The threshold values may be automatically set.

[2値相関手段141,142,・・,14nの第1の動作例]
2値相関手段141,142,・・,14nは、それぞれ、対応する2値化手段131,132,・・・,13nから入力した2値画像とメモリ20から入力した2値画像との相関値を演算する(ステップS24)。すなわち、メモリ20から入力した2値画像をテンプレート画像にして、2値化手段131,132,・・・,13nから入力した2値画像について各々パターンマッチングを行う。メモリ20から入力した2値画像がテンプレート画像なので、メモリ20から入力した2値画像の画像サイズの方が2値化手段131,132,・・・,13nから入力した2値画像の画像サイズよりも小さい。相関値rの演算の一例を(1)式に示す。
[First operation example of binary correlation means 141, 142,..., 14n]
The binary correlation means 141, 142,..., 14n are correlation values between the binary image input from the corresponding binarization means 131, 132,..., 13n and the binary image input from the memory 20, respectively. Is calculated (step S24). That is, the binary image input from the memory 20 is used as a template image, and pattern matching is performed for each of the binary images input from the binarizing means 131, 132,. Since the binary image input from the memory 20 is a template image, the image size of the binary image input from the memory 20 is larger than the image size of the binary image input from the binarization means 131, 132,. Is also small. An example of the calculation of the correlation value r is shown in equation (1).

r=Σ|f−g| ・・・(1)       r = Σ | f−g | (1)

(1)式において、gは、メモリ20から入力された2値画像、すなわちテンプレート画像のビット値(「0」または「1」)である。fは、2値化手段131,132,・・・,13nから入力された2値画像からテンプレート画像と同サイズの領域を切り出した部分画像すなわちマッチング対象画像のビット値である。Σの範囲は、テンプレート画像の画素数分である。従って、(1)式によれば、テンプレート画像とマッチング対象画像との全画素について、テンプレート画像とマッチング対象画像との対応する画素においてfとgの差分絶対値が計算され、その合計値が相関値rになる。   In Expression (1), g is a binary image input from the memory 20, that is, a bit value (“0” or “1”) of the template image. f is a bit value of a partial image obtained by cutting out a region having the same size as the template image from the binary image input from the binarizing means 131, 132,. The range of Σ is the number of pixels of the template image. Therefore, according to equation (1), for all the pixels of the template image and the matching target image, the absolute difference value of f and g is calculated at the corresponding pixels of the template image and the matching target image, and the total value is correlated. It becomes the value r.

(1)式を用いるこの例では、相関値rが小さいほど、テンプレート画像とマッチング対象画像との相関が高くなる。2値相関手段141,142,・・,14nは、2値化手段131,132,・・・,13nから入力した2値画像から切り出す部分画像の領域を横方向に1画素ずつずらし、ずらす度に、相関値rを計算する。さらに、縦方向にも1画素ずつずらし、2値化手段131,132,・・・,13nから入力した2値画像全体を走査して、2値化手段131,132,・・・,13nから入力した2値画像から切りだし可能な全ての部分画像について相関値rを計算する。   In this example using equation (1), the smaller the correlation value r, the higher the correlation between the template image and the matching target image. The binary correlation means 141, 142,..., 14n shift the region of the partial image cut out from the binary image input from the binarization means 131, 132,. Then, the correlation value r is calculated. Further, it is shifted by one pixel in the vertical direction, and the entire binary image inputted from the binarizing means 131, 132,..., 13n is scanned, and the binarizing means 131, 132,. Correlation values r are calculated for all partial images that can be cut out from the input binary image.

[相関値選択手段15の第1の動作例]
相関値選択手段15は、2値相関手段141,142,・・,14nが計算した相関値rの中で最も相関が高いことを示す値、すなわち、この例では相関値rの最小値を選択し、選択した相関値rを、そのときの部分画像切り出し座標値とともに位置同定手段16に出力する(ステップS25)。部分画像切り出し座標値は、例えば、部分画像の右上の座標を示す値である。
[First Operation Example of Correlation Value Selection Unit 15]
The correlation value selection means 15 selects the value indicating the highest correlation among the correlation values r calculated by the binary correlation means 141, 142,..., 14n, that is, the minimum value of the correlation value r in this example. Then, the selected correlation value r is output to the position identifying means 16 together with the partial image cut-out coordinate value at that time (step S25). The partial image cutout coordinate value is, for example, a value indicating the upper right coordinate of the partial image.

[2値相関手段141,142,・・,14nの第2の動作例]
相関値rの演算の別の例を(2)式に示す。
[Second operation example of binary correlation means 141, 142,..., 14n]
Another example of the calculation of the correlation value r is shown in equation (2).

r=Σ(f xnor g) ・・・(2)       r = Σ (f xnor g) (2)

(2)式において、Σ,f,gは、(1)式における、Σ,f,gと同じデータを示す。また、xnorは、fとgとの排他的論理和を反転した値を示す。以下、排他的論理和を反転することを、排他的論理和反転という。   In the equation (2), Σ, f, g represents the same data as Σ, f, g in the equation (1). Xnor represents a value obtained by inverting the exclusive OR of f and g. Hereinafter, inverting exclusive OR is referred to as exclusive OR inversion.

図4は、(2)式の演算を実現する構成例を示す回路図である。図4に示す構成において、f,gは、同期信号CLKに同期して対応する画素毎にシリアルに入力される。フリップフロップ31は、f,gの入力タイミングを揃え、排他的論理和反転回路32に出力する。排他的論理和反転回路32は、f,gのビットが異なれば「0」を加算器33に出力し、同一であれば「1」を加算器33に出力する。従って、加算器33は、fとgとが同一であるビット数を合計することになる。加算器33は、加算値を多ビットのフリップフロップ34に出力する。多ビットのフリップフロップ34は、加算器33の出力値であるf,gの同一ビット数の累計値を保持する。   FIG. 4 is a circuit diagram showing a configuration example for realizing the calculation of the equation (2). In the configuration shown in FIG. 4, f and g are input serially for each corresponding pixel in synchronization with the synchronization signal CLK. The flip-flop 31 aligns the input timings of f and g and outputs the same to the exclusive OR inversion circuit 32. The exclusive OR inversion circuit 32 outputs “0” to the adder 33 if the bits of f and g are different, and outputs “1” to the adder 33 if they are the same. Therefore, the adder 33 adds up the number of bits in which f and g are the same. The adder 33 outputs the added value to the multi-bit flip-flop 34. The multi-bit flip-flop 34 holds a cumulative value of the same number of bits of f and g that are output values of the adder 33.

フリップフロップ34が保持する累計値を加算器33にフィードバックされるように構成することによって、加算器33は、フィードバックされた値と新たに排他的論理和反転回路32から入力される値との加算によって、fとgとが同一であるビット数の合計値を更新する。全画素のfおよびgが入力された段階で、図4に示すフリップフロップ34の出力に最終的な相関値rが出力される。   By configuring the cumulative value held by the flip-flop 34 to be fed back to the adder 33, the adder 33 adds the fed back value and the value newly input from the exclusive OR inversion circuit 32. To update the total number of bits in which f and g are the same. At the stage where f and g of all the pixels are inputted, the final correlation value r is outputted to the output of the flip-flop 34 shown in FIG.

なお、図4に示す加算器33、および多ビットのフリップフロップ34に代えて排他的論理和反転回路32の出力信号をイネーブル入力とするアップカウンタを用いてもよい。   Instead of the adder 33 and the multi-bit flip-flop 34 shown in FIG. 4, an up counter that uses the output signal of the exclusive OR inversion circuit 32 as an enable input may be used.

[相関値選択手段15の第2の動作例]
(2)式を用いる例では、相関値rが大きいほど、テンプレート画像とマッチング対象画像との相関が高くなる。(2)式を用いる場合にも、(1)式を用いる場合と同様に、2値相関手段141,142,・・,14nは、2値化手段131,132,・・・,13nから入力した2値画像から切り出す部分画像の領域を1画素ずつずらし、画像全体を走査して、全ての相関値rを計算する。相関値選択手段15は、その相関値rの中で最も相関が高いことを示す値、(2)式を用いる例では相関値rの最大値を選択し、選択した相関値rを、そのときの部分画像切り出し座標値とともに位置同定手段16に出力する。
[Second Example of Operation of Correlation Value Selection Unit 15]
In the example using Expression (2), the correlation between the template image and the matching target image increases as the correlation value r increases. When using equation (2), as in the case of using equation (1), the binary correlation means 141, 142,..., 14n are input from the binarization means 131, 132,. The region of the partial image cut out from the binary image is shifted by one pixel, the entire image is scanned, and all correlation values r are calculated. Correlation value selection means 15 selects a value indicating the highest correlation among the correlation values r, in the example using equation (2), the maximum value of correlation values r, and selects the selected correlation value r at that time. Are output to the position identifying means 16 together with the partial image cutout coordinate values.

位置同定手段16は、相関値選択手段15が選択した相関値rが算出されたときに切り出された部分画像を示す座標値を、画像処理装置の出力を使用する他の装置に出力する。なお、他の装置は、図1に例示された構成の画像処理装置と別体で設けられていてもよいし、図1に例示された構成を一部に含む画像処理装置の他部であってもよい。   The position identification unit 16 outputs the coordinate value indicating the partial image cut out when the correlation value r selected by the correlation value selection unit 15 is calculated to another device that uses the output of the image processing device. The other apparatus may be provided separately from the image processing apparatus having the configuration illustrated in FIG. 1, or may be another part of the image processing apparatus that partially includes the configuration illustrated in FIG. May be.

一例として、他の装置(または、画像処理装置の他部)は、位置同定手段16が出力した部分画像切り出し座標値で特定される画像を原画像から切り出し、自動化された製造ラインにおいて、製品の特定部位を観察するための画像として表示器に表示したり、製品仕分けラインにおいて、特定製品を同定して仕分け機構を制御したりする。   As an example, another apparatus (or another part of the image processing apparatus) cuts out an image specified by the partial image cut-out coordinate value output from the position identification unit 16 from the original image, and in an automated production line, An image for observing a specific part is displayed on a display, or a specific product is identified in a product sorting line to control a sorting mechanism.

以上に説明したように、本実施形態では、多ビットデータの正規化相関のような複雑で処理時間がかかる画像のパターンマッチングを実行するのではなく、2値データの相関演算を行っているので、高速かつ小規模な回路で画像のパターンマッチングを行うことができる。   As described above, in this embodiment, instead of performing complex and time-consuming image pattern matching such as normalized correlation of multi-bit data, correlation calculation of binary data is performed. Image pattern matching can be performed with a high-speed and small-scale circuit.

また、2値化の前処理にDOGフィルタやLOG(Laplace Of Gaussian )フィルタのような複雑で処理時間がかかる画像フィルタを行うのではなく、3×3画素や5×5画素等の微小サイズのエッジ抽出フィルタを用いているので、高速かつ小規模な回路で画像のパターンマッチングを行うことができる。   Also, instead of performing a complex and time-consuming image filter such as a DOG filter or a LOG (Laplace Of Gaussian) filter for binarization pre-processing, it is a small size such as 3 × 3 pixels or 5 × 5 pixels. Since the edge extraction filter is used, image pattern matching can be performed with a high-speed and small-scale circuit.

また、画像の2値化において環境条件の変化等に応じて閾値を変更するのではなく、異なる閾値による複数の2値化手段と、それらのそれぞれに対応する複数の2値相関手段とを備え、その中で最も相関が高い値を出力したものを自動的に選択しているので、人が介在して閾値設定することなく画像のパターンマッチングを行うことができる。   Further, in the binarization of the image, the threshold value is not changed in accordance with a change in environmental conditions or the like, but includes a plurality of binarization means based on different threshold values and a plurality of binary correlation means corresponding to each of them. Since the one that outputs the value having the highest correlation among them is automatically selected, it is possible to perform image pattern matching without setting a threshold with human intervention.

さらに、参照パターンとして多ビットデータの画像を格納するのではなく、オフラインで、すなわちパターンマッチング対象シーンの入力前に参照画像を入力し、参照画像のエッジ抽出を行って2値化した画像をメモリ20に格納するように構成されているので、メモリ20に格納される参照パターンが2値データになり、メモリ20のメモリ容量を小さくすることができ、高速かつ小規模な回路で画像のパターンマッチングを実現することができる。   Further, instead of storing an image of multi-bit data as a reference pattern, a reference image is input offline, that is, before a pattern matching target scene is input, and an edge of the reference image is extracted and a binary image is stored in memory. Since the reference pattern stored in the memory 20 is binary data, the memory capacity of the memory 20 can be reduced, and image pattern matching can be achieved with a high-speed and small-scale circuit. Can be realized.

以上のことから、本実施形態の画像処理方法および画像処理装置は、例えば、自動化された製造ライン等において、もしくは車両、船舶、航空機等の輸送手段での自律誘導における外界認識の用途において、または自律ロボットにおける外界認識の用途において、自動的に画像中の対象物の位置や姿勢を計測したり物体の種類を判別する際に、物体の表面状態が不均一であったり、照明条件が不安定であるような場合でも、良好に、かつ安定に対象物の認識を行うことができるようになる。また、ステレオ視の原理で物体の3次元情報を得る場合において、視野内に複数の物体が存在し得るような状況でも安定して3次元情報を抽出することができる。また、認識対象物の動きを計測する際に、物体を高速に、高信頼度で計測を行うことができる。   From the above, the image processing method and the image processing apparatus according to the present embodiment are used in, for example, an automated production line or the like for external recognition in autonomous guidance in transportation means such as a vehicle, a ship, and an aircraft, or When the position and orientation of an object in an image is automatically measured or the type of an object is automatically determined in an external environment recognition application for an autonomous robot, the surface state of the object is uneven or the lighting conditions are unstable. Even in such a case, the object can be recognized satisfactorily and stably. Further, when obtaining three-dimensional information of an object by the principle of stereo vision, it is possible to stably extract the three-dimensional information even in a situation where a plurality of objects may exist in the field of view. Further, when measuring the movement of the recognition target object, the object can be measured at high speed and with high reliability.

図5は、本発明による画像処理装置における主要部を示すブロック図である。図5に示すように、画像処理装置は、パターンマッチングの参照パターンとして用いられる参照画像を入力する参照画像入力部4(図1における参照画像入力手段17に対応)と、参照画像入力部4が入力した参照画像から、濃度変化を強調した参照用のエッジ画像を生成する参照画像のエッジ抽出部5(図1におけるエッジ抽出手段18に対応)と、参照画像のエッジ抽出部5が生成した参照用のエッジ画像を2値化して、参照用の2値画像を生成する参照画像用2値化部6(図1における2値化手段19に対応)と、参照画像用2値化部6が生成した参照用の2値画像を一時的に格納するメモリ部7(図1におけるメモリ20に対応)と、パターンマッチングの対象となる画像を入力する原画像入力部1(図1における原画像入力手段11に対応)と、原画像入力部1が入力した原画像から、濃度変化を強調したエッジ画像を生成する原画像のエッジ抽出部2(図1におけるエッジ抽出手段12に対応)と、原画像のエッジ抽出部2が生成したエッジ画像を互いに異なる閾値にもとづいて2値化し、複数の2値画像を生成する原画像用2値化部3(図1における2値化手段131〜13nに対応)と、原画像用2値化部3が生成した複数の2値画像のそれぞれと、メモリ部7に格納された参照用の2値画像との間で相関値を算出する相関部8(図1における2値相関手段141〜14nに対応)と、相関部9が算出した複数の相関値の中から最も相関が高いことを示す相関値を選択する相関値選択部9(図1における相関値選択手段15に対応)と、相関値選択部9が選択した相関値の算出の基になった原画像を特定するデータを出力する画像同定部10(図1における位置同定手段16に対応)とを備えている。   FIG. 5 is a block diagram showing the main part of the image processing apparatus according to the present invention. As shown in FIG. 5, the image processing apparatus includes a reference image input unit 4 (corresponding to the reference image input unit 17 in FIG. 1) that inputs a reference image used as a reference pattern for pattern matching, and a reference image input unit 4. The reference image edge extraction unit 5 (corresponding to the edge extraction unit 18 in FIG. 1) that generates a reference edge image in which the density change is emphasized from the input reference image, and the reference image generated by the reference image edge extraction unit 5 A reference image binarization unit 6 (corresponding to the binarization means 19 in FIG. 1) for binarizing the edge image for reference and generating a reference binary image, and a reference image binarization unit 6 A memory unit 7 (corresponding to the memory 20 in FIG. 1) that temporarily stores the generated binary image for reference, and an original image input unit 1 (an original image input in FIG. 1) that inputs an image to be subjected to pattern matching Mean 1 ), An original image edge extracting unit 2 (corresponding to the edge extracting means 12 in FIG. 1) for generating an edge image in which density change is emphasized from the original image input by the original image input unit 1, and The edge image generated by the edge extraction unit 2 is binarized based on different threshold values, and a binarization unit 3 for original image that generates a plurality of binary images (corresponding to the binarization means 131 to 13n in FIG. 1). And a correlation unit 8 that calculates a correlation value between each of the plurality of binary images generated by the original image binarization unit 3 and the reference binary image stored in the memory unit 7 (FIG. 1). And a correlation value selection unit 9 for selecting a correlation value indicating the highest correlation among a plurality of correlation values calculated by the correlation unit 9 (correlation value selection in FIG. 1). The correlation value selection unit 9 selects And an image identification unit 10 for outputting data identifying the original image becomes the basis for calculation of the function value (corresponding to the position identification means 16 in FIG. 1).

図6は、本発明による画像処理方法における主要ステップを示すフローチャートである。図6に示すように、画像処理方法は、パターンマッチングの参照パターンにする参照画像を入力する参照画像入力ステップ(ステップS1)と、入力された参照画像から、濃度変化を強調した参照用のエッジ画像を生成する参照画像のエッジ抽出ステップ(ステップS2)と、参照画像のエッジ抽出ステップで生成された参照用のエッジ画像を2値化して、参照用の2値画像を生成する参照画像用2値化ステップ(ステップS3)と、パターンマッチングの対象となる画像を入力する原画像入力ステップ(ステップS4)と、入力された原画像から、濃度変化を強調したエッジ画像を生成する原画像のエッジ抽出ステップ(ステップS5)と、原画像のエッジ抽出ステップで生成されたエッジ画像を互いに異なる閾値にもとづいて2値化し、複数の2値画像を生成する原画像用2値化ステップ(ステップS6)と、原画像用2値化ステップで生成された複数の2値画像のそれぞれと、参照画像用2値化ステップで生成された参照用の2値画像との間で相関値を算出する相関ステップ(ステップS7)と、相関ステップで算出された複数の相関値の中から最も相関が高いことを示す相関値を選択する相関値選択ステップ(ステップS8)と、相関値選択ステップで選択された相関値の算出の基になった原画像を特定するデータを出力する画像同定ステップ(ステップS9)とを含む。   FIG. 6 is a flowchart showing the main steps in the image processing method according to the present invention. As shown in FIG. 6, the image processing method includes a reference image input step (step S1) for inputting a reference image to be a pattern matching reference pattern, and a reference edge in which density change is emphasized from the input reference image. Reference image 2 for generating a reference binary image by binarizing the reference edge image generated in the reference image edge extracting step (step S2) for generating an image and the reference image edge extracting step. A valuation step (step S3), an original image input step (step S4) for inputting an image to be subjected to pattern matching, and an edge of the original image for generating an edge image in which density change is emphasized from the input original image The edge image generated in the extraction step (step S5) and the edge extraction step of the original image is binarized based on different threshold values, A binarization step for original images for generating a number of binary images (step S6), a plurality of binary images generated in the binarization step for original images, and a binarization step for reference images A correlation step (step S7) for calculating a correlation value with the reference binary image thus selected, and a correlation value indicating the highest correlation among the plurality of correlation values calculated in the correlation step is selected. A correlation value selection step (step S8) and an image identification step (step S9) for outputting data for specifying the original image that is the basis of calculation of the correlation value selected in the correlation value selection step are included.

また、画像処理装置は、相関部が、原画像用2値化部が生成した複数の2値画像(参照画像のサイズよりもサイズが大きい)のそれぞれにおける参照画像のサイズと同サイズの部分画像との間で相関値を算出し、画像同定部が、相関値選択部が選択した相関値の算出の基になった原画像の部分画像を特定する座標データを出力するように構成されていてもよい。そのように構成されている場合には、原画像から所望の画像部分を特定することができる。   In the image processing apparatus, the correlation unit has a partial image having the same size as the size of the reference image in each of the plurality of binary images (the size is larger than the size of the reference image) generated by the original image binarization unit. And the image identification unit is configured to output coordinate data that identifies the partial image of the original image that is the basis of the calculation of the correlation value selected by the correlation value selection unit. Also good. In such a configuration, a desired image portion can be specified from the original image.

また、画像処理装置は、相関部が、部分画像切り出し領域をずらしながら相関値を算出することによって、原画像用2値化部が生成した2値画像から切り出し得る全ての部分画像について相関値を算出するように構成されていてもよい。   In addition, the image processing apparatus calculates correlation values while shifting the partial image cutout region, so that the correlation value is obtained for all partial images that can be cut out from the binary image generated by the binarization unit for the original image. It may be configured to calculate.

また、画像処理装置は、エッジ抽出部が、入力された画像の各画素を中心に数画素の範囲の近傍領域における上辺の濃淡値の合計から下辺の濃淡値の合計を差分した値の絶対値を演算する横微分手段(図1におけるエッジ抽出手段12,18に含まれる:図3(a)参照)と、近傍領域の左辺の濃淡値の合計から右辺の濃淡値の合計を差分した値の絶対値を演算する縦微分手段(図1におけるエッジ抽出手段12,18に含まれる:図3(b)参照)と、近傍領域の左上領域の濃淡値の合計から右下領域の濃淡値の合計を差分した値の絶対値を演算する右上左下斜方微分手段(図1におけるエッジ抽出手段12,18に含まれる:図3(c)参照)と、近傍領域の右上領域の濃淡値の合計から左下領域の濃淡値の合計を差分した値の絶対値を演算する左上右下斜方微分手段(図1におけるエッジ抽出手段12,18に含まれる:図3(d)参照)と、左上右下斜方微分手段が得た絶対値と、右上左下斜方微分手段が得た絶対値と、縦微分手段が得た絶対値と、横微分手段が得た絶対値とを比較し、最大値を選択する選択手段(図1におけるエッジ抽出手段12,18に含まれる)とを含むように構成されていてもよい。   In addition, the image processing apparatus has an absolute value of a value obtained by subtracting the sum of the shade values of the lower side from the sum of the shade values of the lower side from the sum of the shade values of the upper side in the vicinity region of the range of several pixels around each pixel of the input image. And a value obtained by subtracting the sum of the gray values of the right side from the sum of the gray values of the left side of the neighboring region and the horizontal differentiation unit (included in the edge extracting units 12 and 18 in FIG. 1; see FIG. 3A). The vertical differentiation means for calculating the absolute value (included in the edge extraction means 12 and 18 in FIG. 1; see FIG. 3B) and the sum of the gray values in the upper left area of the neighboring area to the total of the gray values in the lower right area From the upper right lower left oblique differentiation means (which is included in the edge extraction means 12 and 18 in FIG. 1; see FIG. 3C) and the sum of the gray values in the upper right area of the neighboring area. The absolute value of the difference of the total gray value in the lower left area The upper left lower right oblique calculating means (included in the edge extracting means 12 and 18 in FIG. 1; see FIG. 3D), the absolute value obtained by the upper left lower right oblique differentiating means, and the upper right lower left oblique The absolute value obtained by the differentiating means, the absolute value obtained by the vertical differentiating means, and the absolute value obtained by the horizontal differentiating means are compared, and a selecting means (selecting the edge extracting means 12, 18 in FIG. 1) is selected. May be included).

また、画像処理装置は、相関部が、参照画像用2値化部が生成した2値画像の値と原画像用2値化部が生成した2値画像の値との排他的論理和を反転する一致検出回路(図1における排他的論理和反転回路32に対応)と、一致検出回路が得た値が「1」である画素数の累計値を保持するレジスタ等の保持回路(図1におけるフリップフロップ34に対応)と、保持回路が保持する累計値と一致検出回路が得た排他的論理和の反転とを加算する加算器(図1における加算器33に対応)とを含むように構成されていてもよい。   In the image processing apparatus, the correlation unit inverts the exclusive OR of the binary image value generated by the reference image binarization unit and the binary image value generated by the original image binarization unit. A coincidence detection circuit (corresponding to the exclusive OR inversion circuit 32 in FIG. 1), and a holding circuit such as a register that holds the cumulative value of the number of pixels whose value obtained by the coincidence detection circuit is “1” Flip-flop 34) and an adder (corresponding to adder 33 in FIG. 1) that adds the cumulative value held by the holding circuit and the inversion of the exclusive OR obtained by the coincidence detection circuit May be.

本発明を、自動化された製造ラインに適用したり、輸送手段や自律ロボットにおける外界認識等の用途に適用することができる。   The present invention can be applied to an automated production line, and can be applied to uses such as external recognition in transportation means and autonomous robots.

本発明による画像処理装置の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the image processing apparatus by this invention. 画像処理装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of an image processing apparatus. エッジフィルタ処理の一例を示す説明図である。It is explanatory drawing which shows an example of an edge filter process. (2)式の演算を実現する構成例を示す回路図である。It is a circuit diagram which shows the structural example which implement | achieves the calculation of (2) Formula. 本発明による画像処理装置における主要部を示すブロック図である。It is a block diagram which shows the principal part in the image processing apparatus by this invention. 本発明による画像処理方法における主要ステップを示すフローチャートである。It is a flowchart which shows the main steps in the image processing method by this invention. 特許文献1に記載された画像処理装置の構成を示すブロック図である。10 is a block diagram illustrating a configuration of an image processing apparatus described in Patent Document 1. FIG.

符号の説明Explanation of symbols

1 原画像入力部
2 原画像のエッジ抽出部
3 原画像用2値化部
4 原画像用2値化部
5 参照画像のエッジ抽出部
6 参照画像用2値化部
7 メモリ部
8 相関部
9 相関値選択部
10 画像同定部
11 原画像入力手段
12 エッジ抽出手段
15 相関値選択手段
16 位置同定手段
17 参照画像入力手段
18 エッジ抽出手段
19 2値化手段
20 メモリ
31 フリップフロップ
32 排他的論理和反転回路
33 加算器
34 フリップフロップ
130 2値化変換手段
131〜13n 2値化手段
141〜14n 2値相関手段
DESCRIPTION OF SYMBOLS 1 Original image input part 2 Original image edge extraction part 3 Original image binarization part 4 Original image binarization part 5 Reference image edge extraction part 6 Reference image binarization part 7 Memory part 8 Correlation part 9 Correlation value selection unit 10 Image identification unit 11 Original image input unit 12 Edge extraction unit 15 Correlation value selection unit 16 Position identification unit 17 Reference image input unit 18 Edge extraction unit 19 Binarization unit 20 Memory 31 Flip-flop 32 Exclusive OR Inverting circuit 33 Adder 34 Flip-flop 130 Binary conversion means 131 to 13n Binary means 141 to 14n Binary correlation means

Claims (10)

パターンマッチングの参照パターンにする参照画像を入力する参照画像入力ステップと、
入力された参照画像から、濃度変化を強調した参照用のエッジ画像を生成する参照画像のエッジ抽出ステップと、
前記参照画像のエッジ抽出ステップで生成された参照用のエッジ画像を2値化して、参照用の2値画像を生成する参照画像用2値化ステップと、
パターンマッチングの対象となる画像を入力する原画像入力ステップと、
入力された原画像から、濃度変化を強調したエッジ画像を生成する原画像のエッジ抽出ステップと、
前記原画像のエッジ抽出ステップで生成されたエッジ画像を互いに異なる閾値にもとづいて2値化し、複数の2値画像を生成する原画像用2値化ステップと、
前記原画像用2値化ステップで生成された複数の2値画像のそれぞれと、前記参照画像用2値化ステップで生成された参照用の2値画像との間で相関値を算出する相関ステップと、
前記相関ステップで算出された複数の相関値の中から最も相関が高いことを示す相関値を選択する相関値選択ステップと、
前記相関値選択ステップで選択された相関値の算出の基になった原画像を特定するデータを出力する画像同定ステップとを含む
ことを特徴とする画像処理方法。
A reference image input step for inputting a reference image to be a pattern matching reference pattern;
An edge extraction step of a reference image for generating a reference edge image in which density change is emphasized from the input reference image;
A reference image binarization step that binarizes the reference edge image generated in the reference image edge extraction step to generate a reference binary image;
An original image input step for inputting an image to be subjected to pattern matching;
An edge extraction step of the original image for generating an edge image in which the density change is emphasized from the input original image;
Binarization step for original image that binarizes the edge image generated in the edge extraction step of the original image based on different threshold values, and generates a plurality of binary images;
Correlation step of calculating a correlation value between each of the plurality of binary images generated in the original image binarization step and the reference binary image generated in the reference image binarization step. When,
A correlation value selection step for selecting a correlation value indicating that the correlation is highest among the plurality of correlation values calculated in the correlation step;
And an image identification step of outputting data for specifying an original image that is a basis for calculating the correlation value selected in the correlation value selection step.
原画像のサイズよりも小さいサイズの参照画像を使用する画像処理方法であって、
相関ステップで、原画像用2値化ステップで生成された複数の2値画像のそれぞれにおける参照画像のサイズと同サイズの部分画像との間で相関値を算出し、
画像同定ステップで、相関値選択ステップで選択された相関値の算出の基になった原画像の部分画像を特定する座標データを出力する
請求項1記載の画像処理方法。
An image processing method using a reference image having a size smaller than that of an original image,
In the correlation step, a correlation value is calculated between the size of the reference image and the partial image of the same size in each of the plurality of binary images generated in the binarization step for the original image,
The image processing method according to claim 1, wherein, in the image identification step, coordinate data for specifying a partial image of the original image that is a basis for calculation of the correlation value selected in the correlation value selection step is output.
相関ステップで、部分画像切り出し領域をずらしながら相関値を算出することによって、原画像用2値化ステップで生成された2値画像から切り出し得る全ての部分画像について相関値を算出する
請求項2記載の画像処理方法。
The correlation value is calculated for all partial images that can be cut out from the binary image generated in the binarization step for the original image by calculating the correlation value while shifting the partial image cut-out region in the correlation step. Image processing method.
エッジ抽出ステップで、入力された画像の各画素を中心に数画素の範囲の近傍領域の演算を行うことによってエッジ画像を生成する画像処理方法であって、
前記エッジ抽出ステップは、
前記近傍領域における上辺の濃淡値の合計から下辺の濃淡値の合計を差分した値の絶対値を演算する横微分ステップと、
前記近傍領域の左辺の濃淡値の合計から右辺の濃淡値の合計を差分した値の絶対値を演算する縦微分ステップと、
前記近傍領域の左上領域の濃淡値の合計から右下領域の濃淡値の合計を差分した値の絶対値を演算する右上左下斜方微分ステップと、
前記近傍領域の右上領域の濃淡値の合計から左下領域の濃淡値の合計を差分した値の絶対値を演算する左上右下斜方微分ステップと、
前記左上右下斜方微分ステップで得られた絶対値と、前記右上左下斜方微分ステップで得られた絶対値と、前記縦微分ステップで得られた絶対値と、前記横微分ステップで得られた絶対値とを比較し、最大値を選択する選択ステップとを含む
請求項1から請求項3のうちのいずれか1項に記載の画像処理方法。
In the edge extraction step, an image processing method for generating an edge image by performing calculation of a neighborhood region of a range of several pixels around each pixel of an input image,
The edge extraction step includes
A lateral differentiation step of calculating an absolute value of a value obtained by subtracting the sum of the shade values of the lower side from the sum of the shade values of the upper side in the vicinity region;
A longitudinal differentiation step of calculating an absolute value of a value obtained by subtracting the sum of the shade values of the right side from the sum of the shade values of the left side of the neighborhood region;
An upper right lower left diagonal differentiation step of calculating an absolute value of a value obtained by subtracting the sum of the shade values of the lower right region from the sum of the shade values of the upper left region of the vicinity region;
An upper left lower right diagonal differentiation step for calculating an absolute value of a value obtained by subtracting the sum of the shade values of the lower left region from the sum of the shade values of the upper right region of the vicinity region;
The absolute value obtained in the upper left lower right oblique differentiation step, the absolute value obtained in the upper right lower left oblique differentiation step, the absolute value obtained in the vertical differentiation step, and the lateral differentiation step. The image processing method according to claim 1, further comprising: a selection step of comparing the absolute values with each other and selecting a maximum value.
相関ステップは、
参照画像用2値化ステップで生成された2値画像の値と原画像用2値化ステップで生成された2値画像の値との排他的論理和を反転する一致検出ステップと、
前記一致検出ステップで得られた値が「1」である画素数の累計値を保持する累計保持ステップと、
前記累計保持ステップで得られた累計値と前記一致検出ステップで得られた排他的論理和の反転とを加算する加算ステップとを含む
請求項1から請求項4のうちのいずれか1項に記載の画像処理方法。
The correlation step is
A match detection step for inverting the exclusive OR of the binary image value generated in the reference image binarization step and the binary image value generated in the original image binarization step;
A cumulative holding step of holding a cumulative value of the number of pixels whose value obtained in the match detection step is “1”;
5. The method according to claim 1, further comprising: an adding step of adding the cumulative value obtained in the cumulative holding step and the inversion of the exclusive OR obtained in the coincidence detecting step. Image processing method.
パターンマッチングの参照パターンとして用いられる参照画像を入力する参照画像入力部と、
前記参照画像入力部が入力した参照画像から、濃度変化を強調した参照用のエッジ画像を生成する参照画像のエッジ抽出部と、
前記参照画像のエッジ抽出部が生成した参照用のエッジ画像を2値化して、参照用の2値画像を生成する参照画像用2値化部と、
前記参照画像用2値化部が生成した参照用の2値画像を一時的に格納するメモリ部と、
パターンマッチングの対象となる画像を入力する原画像入力部と、
前記原画像入力部が入力した原画像から、濃度変化を強調したエッジ画像を生成する原画像のエッジ抽出部と、
前記原画像のエッジ抽出部が生成したエッジ画像を互いに異なる閾値にもとづいて2値化し、複数の2値画像を生成する原画像用2値化部と、
前記原画像用2値化部が生成した複数の2値画像のそれぞれと、前記メモリ部に格納された参照用の2値画像との間で相関値を算出する相関部と、
前記相関部が算出した複数の相関値の中から最も相関が高いことを示す相関値を選択する相関値選択部と、
前記相関値選択部が選択した相関値の算出の基になった原画像を特定するデータを出力する画像同定部とを備えた
ことを特徴とする画像処理装置。
A reference image input unit for inputting a reference image used as a reference pattern for pattern matching;
An edge extraction unit for a reference image that generates a reference edge image in which density change is emphasized from the reference image input by the reference image input unit;
A reference image binarization unit that binarizes the reference edge image generated by the edge extraction unit of the reference image and generates a reference binary image;
A memory unit for temporarily storing a reference binary image generated by the reference image binarization unit;
An original image input unit for inputting an image to be subjected to pattern matching;
From the original image input by the original image input unit, an edge extraction unit of the original image that generates an edge image that emphasizes density change;
An original image binarization unit that binarizes the edge image generated by the edge extraction unit of the original image based on different threshold values, and generates a plurality of binary images;
A correlation unit that calculates a correlation value between each of a plurality of binary images generated by the original image binarization unit and a reference binary image stored in the memory unit;
A correlation value selection unit that selects a correlation value indicating that the correlation is highest among a plurality of correlation values calculated by the correlation unit;
An image processing apparatus comprising: an image identification unit that outputs data for specifying an original image that is a basis for calculating a correlation value selected by the correlation value selection unit.
原画像のサイズよりも小さいサイズの参照画像を使用する画像処理装置であって、
相関部は、原画像用2値化部が生成した複数の2値画像のそれぞれにおける参照画像のサイズと同サイズの部分画像との間で相関値を算出し、
画像同定部は、相関値選択部が選択した相関値の算出の基になった原画像の部分画像を特定する座標データを出力する
請求項6記載の画像処理装置。
An image processing apparatus that uses a reference image having a size smaller than that of an original image,
The correlation unit calculates a correlation value between the size of the reference image and the partial image of the same size in each of the plurality of binary images generated by the original image binarization unit,
The image processing apparatus according to claim 6, wherein the image identification unit outputs coordinate data that specifies a partial image of the original image that is a basis for calculating the correlation value selected by the correlation value selection unit.
相関部は、部分画像切り出し領域をずらしながら相関値を算出することによって、原画像用2値化部が生成した2値画像から切り出し得る全ての部分画像について相関値を算出する
請求項7記載の画像処理装置。
The correlation unit calculates correlation values for all partial images that can be cut out from the binary image generated by the original image binarization unit by calculating a correlation value while shifting the partial image cutout region. Image processing device.
エッジ抽出部が、入力された画像の各画素を中心に数画素の範囲の近傍領域の演算を行うことによってエッジ画像を生成する画像処理装置であって、
前記エッジ抽出部は、
前記近傍領域における上辺の濃淡値の合計から下辺の濃淡値の合計を差分した値の絶対値を演算する横微分手段と、
前記近傍領域の左辺の濃淡値の合計から右辺の濃淡値の合計を差分した値の絶対値を演算する縦微分手段と、
前記近傍領域の左上領域の濃淡値の合計から右下領域の濃淡値の合計を差分した値の絶対値を演算する右上左下斜方微分手段と、
前記近傍領域の右上領域の濃淡値の合計から左下領域の濃淡値の合計を差分した値の絶対値を演算する左上右下斜方微分手段と、
前記左上右下斜方微分手段が得た絶対値と、前記右上左下斜方微分手段が得た絶対値と、前記縦微分手段が得た絶対値と、前記横微分手段が得た絶対値とを比較し、最大値を選択する選択手段とを含む
請求項6から請求項8のうちのいずれか1項に記載の画像処理装置。
An edge extraction unit is an image processing device that generates an edge image by performing calculation of a neighborhood region of a range of several pixels around each pixel of an input image,
The edge extraction unit
Lateral differentiation means for calculating an absolute value of a value obtained by subtracting the sum of the shade values of the lower side from the sum of the shade values of the upper side in the vicinity region;
Vertical differentiation means for calculating the absolute value of the value obtained by subtracting the sum of the shade values of the right side from the sum of the shade values of the left side of the neighborhood region;
Upper right lower left oblique differentiation means for calculating an absolute value of a value obtained by subtracting the sum of the gray value of the lower right region from the sum of the gray value of the upper left region of the vicinity region;
Upper left lower right oblique differentiation means for calculating an absolute value of a value obtained by subtracting the sum of the gray value of the lower left region from the sum of the gray value of the upper right region of the vicinity region;
The absolute value obtained by the upper left lower right oblique differentiation means, the absolute value obtained by the upper right lower left oblique differentiation means, the absolute value obtained by the vertical differentiation means, and the absolute value obtained by the lateral differentiation means The image processing apparatus according to claim 6, further comprising: a selecting unit that compares the two and selects a maximum value.
相関部は、
参照画像用2値化部が生成した2値画像の値と原画像用2値化部が生成した2値画像の値との排他的論理和を反転する一致検出回路と、
前記一致検出回路が得た値が「1」である画素数の累計値を保持する保持回路と、
前記保持回路が保持する累計値と前記一致検出回路が得た排他的論理和の反転とを加算する加算器とを含む
請求項6から請求項9のうちのいずれか1項に記載の画像処理装置。
The correlation part is
A coincidence detection circuit that inverts the exclusive OR of the binary image value generated by the reference image binarization unit and the binary image value generated by the original image binarization unit;
A holding circuit for holding a cumulative value of the number of pixels whose value obtained by the coincidence detection circuit is “1”;
10. The image processing according to claim 6, further comprising: an adder that adds a cumulative value held by the holding circuit and an inversion of an exclusive OR obtained by the coincidence detection circuit. apparatus.
JP2008313262A 2008-12-09 2008-12-09 Image processing method and image processor Pending JP2010140082A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008313262A JP2010140082A (en) 2008-12-09 2008-12-09 Image processing method and image processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008313262A JP2010140082A (en) 2008-12-09 2008-12-09 Image processing method and image processor

Publications (1)

Publication Number Publication Date
JP2010140082A true JP2010140082A (en) 2010-06-24

Family

ID=42350202

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008313262A Pending JP2010140082A (en) 2008-12-09 2008-12-09 Image processing method and image processor

Country Status (1)

Country Link
JP (1) JP2010140082A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101208446B1 (en) 2010-12-02 2012-12-05 김희승 Matching judgment method of matching target image
JP2015182699A (en) * 2014-03-26 2015-10-22 株式会社明電舎 Inspection equipment for dissolved loss of pantagraph collector head

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101208446B1 (en) 2010-12-02 2012-12-05 김희승 Matching judgment method of matching target image
JP2015182699A (en) * 2014-03-26 2015-10-22 株式会社明電舎 Inspection equipment for dissolved loss of pantagraph collector head

Similar Documents

Publication Publication Date Title
US9626766B2 (en) Depth sensing using an RGB camera
EP3502958B1 (en) Object recognition processing apparatus, object recognition processing method, and program
JP2940317B2 (en) Image processing device
US9418313B2 (en) Method for searching for a similar image in an image database based on a reference image
JP4970381B2 (en) Feature extraction device, feature extraction method, image processing device, and program
US10713530B2 (en) Image processing apparatus, image processing method, and image processing program
CN106469455B (en) Image processing method, image processing apparatus, and recording medium
CN113807378B (en) Training data increment method, electronic device and computer readable recording medium
JP6405124B2 (en) Inspection device, inspection method, and program
JP5772675B2 (en) Gray image edge extraction method, edge extraction device, and gray image edge extraction program
Yetiş et al. Adaptive vision based condition monitoring and fault detection method for multi robots at production lines in industrial systems
WO2020209046A1 (en) Object detection device
JP6429483B2 (en) Information processing apparatus, imaging apparatus, information processing system, information processing method, and program
JP2010140082A (en) Image processing method and image processor
KR101733288B1 (en) Object Detecter Generation Method Using Direction Information, Object Detection Method and Apparatus using the same
JP4824729B2 (en) Object detection method
CN111275758A (en) Hybrid 3D visual positioning method and device, computer equipment and storage medium
JP6393495B2 (en) Image processing apparatus and object recognition method
RU2640331C2 (en) Method of identifying extended objects of earth surface
JP2007140729A (en) Method and device detecting position and attitude of article
JP6042289B2 (en) Posture estimation apparatus, posture estimation method and program
CN114310875B (en) Crankshaft positioning identification method, device, storage medium and equipment
JP2018067149A (en) Attribute determining device, attribute determining method, computer program, and recording medium
Park et al. An improved algorithm for laser point detection based on otsu thresholding method
JPH08167029A (en) Image processor