JP2015176433A - Image processing device, image processing method, and image processing program - Google Patents

Image processing device, image processing method, and image processing program Download PDF

Info

Publication number
JP2015176433A
JP2015176433A JP2014053367A JP2014053367A JP2015176433A JP 2015176433 A JP2015176433 A JP 2015176433A JP 2014053367 A JP2014053367 A JP 2014053367A JP 2014053367 A JP2014053367 A JP 2014053367A JP 2015176433 A JP2015176433 A JP 2015176433A
Authority
JP
Japan
Prior art keywords
image
determination
window function
processing
determination unit
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
JP2014053367A
Other languages
Japanese (ja)
Other versions
JP6217479B2 (en
Inventor
和馬 新田
Kazuma Nitta
和馬 新田
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.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2014053367A priority Critical patent/JP6217479B2/en
Publication of JP2015176433A publication Critical patent/JP2015176433A/en
Application granted granted Critical
Publication of JP6217479B2 publication Critical patent/JP6217479B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device, an image processing method and an image processing program capable of improving the accuracy of template matching processing using a frequency component.SOLUTION: An image processing device 100 includes a window function processing unit 220 for performing window function processing of each of a template image and an input image, a collation unit 230 for performing frequency conversion of each of the template image and the input image after the window function processing to match the template image and the input image after frequency conversion, and a correction unit 210 for selectively performing negative/position inversion processing of the template image and the input image in independence on a feature amount included in at least one of the template image and the input image before window function processing.

Description

本発明は、テンプレートマッチングを行なう画像処理装置、画像処理方法、および、画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program that perform template matching.

近年、探索対象画像の中から、予め登録されたテンプレート画像に対応する位置を検出するテンプレートマッチングという画像処理技術が実用化されている。テンプレートマッチングの一手法として、位相限定相関法(POC法:Phase-Only Correlation)がしばしば用いられる。POC法は、画像に含まれる周波数成分の位相差情報を用いて画像間の対応点を探索する手法である。位相差情報を用いることで、照明変動などに対するロバスト性を高めることができる。   In recent years, an image processing technique called template matching for detecting a position corresponding to a template image registered in advance from search target images has been put into practical use. As a template matching technique, a phase-only correlation method (POC method) is often used. The POC method is a method of searching for corresponding points between images using phase difference information of frequency components included in the images. By using the phase difference information, it is possible to improve the robustness against illumination fluctuations.

他にも、画像の周波数成分を用いたテンプレートマッチング技術として、様々な手法が提案されている。たとえば、特許文献1は、「複数の画像を対象とした対応点の探索処理における精度の維持と速度の向上とを両立させることが可能な対応点探索技術」を開示している。当該対応点探索技術は、2枚の画像の各々について、当該画像の画像領域の周波数成分を抽出し、抽出した各周波数成分を用いて画像領域間の相関値を算出する。   In addition, various methods have been proposed as a template matching technique using the frequency component of the image. For example, Patent Document 1 discloses a “corresponding point search technique capable of achieving both maintenance of accuracy and speed improvement in corresponding point search processing for a plurality of images”. In the corresponding point search technique, for each of the two images, the frequency component of the image region of the image is extracted, and the correlation value between the image regions is calculated using each extracted frequency component.

特許文献2は、「時系列画像を統合する画像統合装置」を開示している。当該画像統合装置は、各時系列画像について静止体領域を抽出し、時系列画像間の各静止体領域における周波数成分の相関を算出する。これにより、当該画像統合装置は、時系列画像間において対応する静止体領域を探索し、時系列画像を統合する。   Patent Document 2 discloses an “image integration device that integrates time-series images”. The image integration device extracts a stationary body region for each time-series image and calculates a correlation of frequency components in each stationary body region between the time-series images. Accordingly, the image integration device searches for a corresponding stationary body region between the time series images and integrates the time series images.

特許文献3は、「複数の撮像系を用いて共通の被写体を撮像して得られる複数の画像を合成し、高精細な画像を得る複眼撮像装置」を開示している。当該複眼撮像装置は、複数の撮像系により得られる画像信号の周波数成分により対応関係を求めるための演算領域を適応的に変化させて、画像信号間の対応関係を求められた対応関係をもとに複数の画像信号を合成処理する。   Patent Document 3 discloses "a compound eye imaging apparatus that combines a plurality of images obtained by imaging a common subject using a plurality of imaging systems to obtain a high-definition image". The compound-eye imaging apparatus adaptively changes a calculation area for obtaining a correspondence relationship based on frequency components of image signals obtained by a plurality of imaging systems, and obtains a correspondence relationship between the image signals based on the obtained correspondence relationship. A plurality of image signals are synthesized.

特開2011−170519号公報JP 2011-170519 A 国際公開第2010/113239号International Publication No. 2010/113239 特開平06−133207号公報Japanese Patent Laid-Open No. 06-133207

ところで、画像の周波数成分を用いてテンプレートマッチングが行なわれる場合には、FFT(Fast Fourier Transform)などのフーリエ変換により、画像から周波数成分が抽出される。上述のPOC処理もフーリエ変換を応用したものである。フーリエ変換が行なわれる場合には、理論的には、無限長の画像データが必要とされる。実際には、画像データは有限であるため、画像に対してフーリエ変換を行なう場合には、有限の画像データが、周期的な無限の画像データであるものとして仮定される。画像データが無限に周期的に繰り返すデータとして扱われると、画像の端点において、データ(画素値)が急激に変化する不連続な点が生じる。この不連続な点は、周波数空間においては、高周波数成分のノイズとして現れる。   By the way, when template matching is performed using the frequency component of the image, the frequency component is extracted from the image by Fourier transform such as FFT (Fast Fourier Transform). The POC process described above also applies Fourier transform. When Fourier transform is performed, theoretically, infinitely long image data is required. Actually, since image data is finite, when performing Fourier transform on an image, it is assumed that the finite image data is periodic infinite image data. When image data is treated as data that is repeated periodically indefinitely, discontinuous points in which data (pixel values) change abruptly occur at the end points of the image. This discontinuous point appears as noise of a high frequency component in the frequency space.

このような、画像データの不連続性に起因するノイズを低減するために、フーリエ変換前に画像に対して窓関数が掛け合わされる。窓関数は、ある有限領域外では、値が0となる関数である。画像に窓関数が掛け合わされると、当該有限領域外の画像領域においては、画素値が0になり、当該有限領域内の画像領域においては画素値が残る。これにより、窓関数処理後の画像は、当該画像の上端および下端、並びに、当該画像の左端および右端において画素値が0となるため、画像信号が周期的な無限の信号として仮定された場合に、データが連続となる。したがって、周波数空間において、高周波数成分のノイズを除去することができる。   In order to reduce such noise due to the discontinuity of the image data, a window function is multiplied to the image before Fourier transform. The window function is a function having a value of 0 outside a certain finite region. When the image is multiplied by the window function, the pixel value becomes 0 in the image area outside the finite area, and the pixel value remains in the image area in the finite area. As a result, the image after the window function processing has a pixel value of 0 at the upper and lower ends of the image and the left and right ends of the image, so that the image signal is assumed to be a periodic infinite signal. Data is continuous. Therefore, high frequency component noise can be removed in the frequency space.

しかしながら、窓関数の有限領域内の画像領域においては画素値が残るため、当該画像領域における画素値に起因するノイズが周波数空間で現れることがある。すなわち、窓関数起因のノイズが強く出てしまうことで画像データの信号成分が劣化してしまうことがある。これにより、テンプレートマッチングの精度が低下してしまう。   However, since the pixel value remains in the image area within the finite area of the window function, noise due to the pixel value in the image area may appear in the frequency space. That is, the signal component of the image data may be deteriorated due to strong noise caused by the window function. Thereby, the precision of template matching will fall.

この開示は上述のような問題点を解決するためになされたものであって、その目的は、周波数成分を用いたテンプレートマッチング処理の精度を向上することが可能な画像処理装置、画像処理方法、および、画像処理プログラムを提供することである。   This disclosure has been made to solve the above-described problems, and an object thereof is an image processing apparatus, an image processing method, and an image processing apparatus capable of improving the accuracy of template matching processing using frequency components. And providing an image processing program.

一実施の形態に従うと、画像処理装置は、第1の画像と第2の画像との各々に窓関数処理を行うための窓関数処理部と、窓関数処理後の第1の画像および第2の画像の各々を周波数変換して、周波数変換後の第1の画像および第2の画像をマッチングするための照合部と、第1の画像および第2の画像の少なくとも一方に含まれる特徴量に依存して、第1の画像および第2の画像に対して、窓関数処理の前にネガポジ反転処理を選択的に行うための補正部とを備える。   According to one embodiment, the image processing device includes a window function processing unit for performing window function processing on each of the first image and the second image, and the first image and the second image after the window function processing. Frequency conversion of each of the images, a matching unit for matching the first image and the second image after frequency conversion, and a feature amount included in at least one of the first image and the second image Accordingly, a correction unit for selectively performing a negative / positive inversion process on the first image and the second image before the window function process is provided.

好ましくは、画像処理装置は、第1の画像および第2の画像の少なくとも一方を判定画像として用いて、補正部でのネガポジ反転処理が必要であるか否かを判定するための判定部をさらに備える。   Preferably, the image processing apparatus further includes a determination unit for determining whether the negative / positive inversion process in the correction unit is necessary, using at least one of the first image and the second image as the determination image. Prepare.

好ましくは、判定画像は、検査対象となる対象物を含まない、判定画像内の非対象物領域を含む。判定部は、非対象物領域における画素値を特徴量の抽出に用いる。   Preferably, the determination image includes a non-object region in the determination image that does not include an object to be inspected. The determination unit uses the pixel value in the non-object region for feature amount extraction.

好ましくは、特徴量は、画像領域内の各画素の大きさに応じる統計値を含む。判定部は、非対象物領域における統計値が所定値よりも大きい場合にネガポジ反転処理が必要であると判定する。   Preferably, the feature amount includes a statistical value corresponding to the size of each pixel in the image region. The determination unit determines that the negative / positive inversion process is necessary when the statistical value in the non-object region is larger than a predetermined value.

好ましくは、統計値は、非対象物領域における各画素値の、平均値と、中央値と、最頻値と、非対象物領域における画素数に対する、所定の値以上を有する画素の数の割合とのうちの少なくとも1つを含む。   Preferably, the statistical value is an average value, a median value, a mode value of each pixel value in the non-object region, and a ratio of the number of pixels having a predetermined value or more to the number of pixels in the non-object region. And at least one of

好ましくは、判定画像は、検査対象となる対象物を含む、判定画像内の対象物領域をさらに含む。判定部は、対象物領域における各画素値と、前非対象物領域における各画素値とを特徴量の抽出に用いる。   Preferably, the determination image further includes an object region in the determination image including an object to be inspected. The determination unit uses each pixel value in the object region and each pixel value in the previous non-object region for feature amount extraction.

好ましくは、判定部は、判定画像と、当該判定画像に対して窓関数処理を行なった画像とを比較して、ネガポジ反転処理が必要であるか否かを判定する。   Preferably, the determination unit compares the determination image with an image obtained by performing window function processing on the determination image, and determines whether or not negative / positive inversion processing is necessary.

好ましくは、特徴量は、判定画像と、当該判定画像に対して窓関数処理を行なった画像との類似性を示した統計値を含む。判定部は、統計値が所定の値よりも小さい場合に、ネガポジ反転処理が必要であると判定する。   Preferably, the feature amount includes a statistical value indicating similarity between the determination image and an image obtained by performing window function processing on the determination image. The determination unit determines that the negative / positive inversion process is necessary when the statistical value is smaller than a predetermined value.

好ましくは、判定部は、判定画像に対して窓関数処理を行なった画像と、判定画像に対してネガポジ反転処理を行ない、さらに、窓関数処理を行なって得られた画像とを比較して、ネガポジ反転処理が必要であるか否かを判定する。   Preferably, the determination unit compares the image obtained by performing window function processing on the determination image with the image obtained by performing negative / positive inversion processing on the determination image and further performing window function processing, It is determined whether or not negative / positive inversion processing is necessary.

好ましくは、判定画像は、第1の画像と、第2の画像とに加えて、第1の画像をネガポジ反転した画像と、第2の画像をネガポジ反転した画像とのうちから選択される。   Preferably, in addition to the first image and the second image, the determination image is selected from an image obtained by negative-positive reversal of the first image and an image obtained by negative-positive reversal of the second image.

他の実施の形態に従うと、画像処理方法は、第1の画像と第2の画像との各々に窓関数処理を行うステップと、窓関数処理後の第1の画像および第2の画像の各々を周波数変換して、周波数変換後の第1の画像および第2の画像をマッチングするステップと、第1の画像および第2の画像の少なくとも一方に含まれる特徴量に依存して、第1の画像および第2の画像に対して、窓関数処理の前にネガポジ反転処理を選択的に行うステップとを備える。   According to another embodiment, an image processing method includes a step of performing window function processing on each of a first image and a second image, and each of the first image and the second image after the window function processing. The frequency conversion of the first image and the second image after frequency conversion, and depending on the feature amount included in at least one of the first image and the second image, Selectively performing a negative / positive inversion process on the image and the second image before the window function process.

さらに他の実施の形態に従うと、画像処理プログラムが提供される。画像処理プログラムは、コンピュータに、第1の画像と第2の画像との各々に窓関数処理を行うステップと、窓関数処理後の第1の画像および第2の画像の各々を周波数変換して、周波数変換後の第1の画像および第2の画像をマッチングするステップと、第1の画像および第2の画像の少なくとも一方に含まれる特徴量に依存して、第1の画像および第2の画像に対して、窓関数処理の前にネガポジ反転処理を選択的に行うステップとを実行させる。   According to yet another embodiment, an image processing program is provided. The image processing program causes the computer to perform window function processing on each of the first image and the second image, and frequency-convert each of the first image and the second image after the window function processing. , Matching the first image and the second image after frequency conversion, and depending on a feature amount included in at least one of the first image and the second image, the first image and the second image A step of selectively performing a negative / positive inversion process on the image before the window function process.

本発明によれば、周波数成分を用いたテンプレートマッチング処理の精度を向上することができる。   According to the present invention, the accuracy of template matching processing using frequency components can be improved.

本発明の上記および他の目的、特徴、局面および利点は、添付の図面と関連して理解される本発明に関する次の詳細な説明から明らかとなるであろう。   The above and other objects, features, aspects and advantages of the present invention will become apparent from the following detailed description of the present invention taken in conjunction with the accompanying drawings.

第1の実施の形態に従う画像処理装置を含む画像処理システムの全体構成を示す概略図である。1 is a schematic diagram showing an overall configuration of an image processing system including an image processing device according to a first embodiment. ある画像に対して窓関数を掛け合わせて得られた画像を示した図である。It is the figure which showed the image obtained by multiplying a certain image with a window function. ある画像に対してネガポジ反転処理を行なって得られた画像を示した図である。It is the figure which showed the image obtained by performing negative positive inversion processing with respect to a certain image. 第1の実施の形態に従う画像処理装置の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of the image processing apparatus according to 1st Embodiment. 第1の実施の形態に従う画像処理装置に含まれる照合部の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of the collation part contained in the image processing apparatus according to 1st Embodiment. 第1の実施の形態に従う画像処理装置のハードウェア構成の一例を示すブロック図である。It is a block diagram which shows an example of the hardware constitutions of the image processing apparatus according to 1st Embodiment. 第1の実施の形態に従う画像処理装置が実行する処理の一部を表わすフローチャートである。It is a flowchart showing a part of process which the image processing apparatus according to 1st Embodiment performs. 第2の実施の形態に従う画像処理装置の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of the image processing apparatus according to 2nd Embodiment. 第2の実施の形態に従う画像処理装置が実行する処理の一部を表わすフローチャートである。It is a flowchart showing a part of process which the image processing apparatus according to 2nd Embodiment performs. 具体例1に従う判定部の処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of processing of a determination unit according to a specific example 1; 判定画像をワーク領域および非ワーク領域に分割している様子を示している図である。It is a figure which shows a mode that the determination image is divided | segmented into a work area | region and a non-work area | region. 判定画像を複数のブロックに分割している様子を示している図である。It is a figure which shows a mode that the determination image is divided | segmented into several blocks. 具体例2に従う判定部の処理の一例を示すフローチャートである。12 is a flowchart illustrating an example of processing of a determination unit according to Specific Example 2. 具体例3に従う判定部の処理の一例を示すフローチャートである。12 is a flowchart illustrating an example of processing of a determination unit according to a specific example 3; 具体例3に従う判定部の処理の概略を表した概念図である。It is a conceptual diagram showing the outline of the process of the determination part according to the specific example 3. 具体例4に従う判定部の処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of processing of a determination unit according to a fourth specific example. 具体例4に従う判定部の処理の概略を表した概念図である。It is a conceptual diagram showing the outline of the process of the determination part according to the specific example 4. 具体例6に従う判定部の処理の一例を示すフローチャートである。12 is a flowchart illustrating an example of processing of a determination unit according to a specific example 6; 具体例6に従う判定部の処理の概略を表した概念図である。It is a conceptual diagram showing the outline of the process of the determination part according to the specific example 6. 第2の実施の形態に従う画像処理装置の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of the image processing apparatus according to 2nd Embodiment. 第2の実施の形態に従う画像処理装置の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of the image processing apparatus according to 2nd Embodiment. 具体例8に従う判定部の処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of processing of a determination unit according to a specific example 8. 具体例9に従う判定部の処理の一例を示すフローチャートである。22 is a flowchart illustrating an example of processing of a determination unit according to Specific Example 9;

以下、図面を参照しつつ、本実施の形態について説明する。以下の説明では、同一の部品および構成要素には同一の符号を付してある。それらの名称および機能も同じである。したがって、これらについての詳細な説明は繰り返さない。なお、以下で説明される各実施の形態、および/または、各変形例は、選択的に組み合わされてもよい。   Hereinafter, the present embodiment will be described with reference to the drawings. In the following description, the same parts and components are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated. Each embodiment described below and / or each modification may be selectively combined.

<第1の実施の形態>
[システム構成]
図1は、本実施の形態に従う画像処理装置100を含む画像処理システム50の全体構成を示す概略図である。図1を参照して、画像処理システム50は、たとえば、検査対象物(以下、「ワーク」ともいう。)の位置や姿勢を検査する。より具体的には、画像処理システム50は、生産ラインなどに組み込まれ、予め登録されたテンプレート画像を用いて、ワーク116を撮影して取得した画像とテンプレートマッチングを行う。
<First Embodiment>
[System configuration]
FIG. 1 is a schematic diagram showing an overall configuration of an image processing system 50 including an image processing apparatus 100 according to the present embodiment. Referring to FIG. 1, for example, the image processing system 50 inspects the position and orientation of an inspection object (hereinafter also referred to as “work”). More specifically, the image processing system 50 performs template matching with an image acquired by photographing the workpiece 116 using a template image incorporated in a production line or the like and registered in advance.

より具体的には、画像処理システム50は、画像処理装置100と、カメラ110と、製造装置112と、搬送機構114と、表示装置120と、マウス130とを含む。   More specifically, the image processing system 50 includes an image processing device 100, a camera 110, a manufacturing device 112, a transport mechanism 114, a display device 120, and a mouse 130.

製造装置112は、ワーク116を製造するための装置である。たとえば、ワーク116は、回路基板などの機械部品を含む。ワーク116は、製造装置112により製造されるとベルトコンベアなどの搬送機構114によって搬送される。搬送されたワーク116は、カメラ110により所定のタイミングで撮影される。カメラ110により得られた画像は、画像処理装置100へ伝送される。   The manufacturing apparatus 112 is an apparatus for manufacturing the workpiece 116. For example, the workpiece 116 includes mechanical parts such as a circuit board. When the workpiece 116 is manufactured by the manufacturing apparatus 112, the workpiece 116 is transferred by a transfer mechanism 114 such as a belt conveyor. The conveyed workpiece 116 is photographed by the camera 110 at a predetermined timing. An image obtained by the camera 110 is transmitted to the image processing apparatus 100.

画像処理装置100は、テンプレート画像の登録処理を行うための登録モードと、ワーク116に対して検査を実行する検査モードとを有する。ユーザは、マウス118などの入力装置により、検査モードおよび登録モードを交互に切り替えることができる。登録モードにおいて、画像処理装置100は、基準となる目的のワーク116を撮影することで得られた画像をテンプレート画像として登録する。検査モードにおいて、画像処理装置100は、ワーク116などの検査対象物を撮像することで得られた画像(以下、「入力画像」ともいう。)とテンプレート画像とを用いてテンプレートマッチングを行う。これにより、画像処理システム50は、ワーク116の欠陥等を自動的に検査することができる。   The image processing apparatus 100 has a registration mode for performing template image registration processing and an inspection mode for executing inspection on the workpiece 116. The user can alternately switch between the inspection mode and the registration mode using an input device such as a mouse 118. In the registration mode, the image processing apparatus 100 registers an image obtained by photographing the reference target workpiece 116 as a template image. In the inspection mode, the image processing apparatus 100 performs template matching using an image (hereinafter, also referred to as “input image”) obtained by imaging an inspection target such as the workpiece 116 and a template image. Thereby, the image processing system 50 can automatically inspect for defects or the like of the workpiece 116.

[概要]
図2および図3を参照して、第1の実施の形態に従う画像処理装置100の概要について説明する。図2は、ある画像に対して窓関数を掛け合わせて得られた画像を示した図である。図3は、ある画像に対してネガポジ反転処理を行なって得られた画像を示した図である。図2および図3においては、画素値が0に近いほど画像の色は黒色に近くなり、画素値が大きくなるほど(典型的には、画素値が255に近くなるほど)、画像の色は白色に近くなるように示される。
[Overview]
An overview of image processing apparatus 100 according to the first embodiment will be described with reference to FIGS. 2 and 3. FIG. 2 is a diagram showing an image obtained by multiplying a certain image by a window function. FIG. 3 is a diagram showing an image obtained by performing negative / positive inversion processing on a certain image. 2 and 3, the closer the pixel value is to 0, the closer the color of the image is to black, and the larger the pixel value (typically, the closer the pixel value is to 255), the color of the image becomes white. Shown to be close.

図2(A)には、画像処理装置100が画像30Aに対して窓関数32を掛け合わせて得られた窓関数画像34Aが示される。上述したように、画像処理装置100は、周波数空間において、ノイズを低減するために、フーリエ変換前に画像に対して窓関数を掛け合わせる。窓関数32は、ある有限領域外では値が0となる関数である、有限領域内では値が0よりも大きくなる関数である。たとえば、図2(A)に示される窓関数32においては、有限領域が、白色または灰色の部分(中央領域)で示される。   FIG. 2A shows a window function image 34A obtained by the image processing apparatus 100 multiplying the image 30A by the window function 32. FIG. As described above, the image processing apparatus 100 multiplies an image with a window function before Fourier transform in order to reduce noise in the frequency space. The window function 32 is a function having a value of 0 outside a certain finite region, and a function having a value larger than 0 within the finite region. For example, in the window function 32 shown in FIG. 2A, the finite region is indicated by a white or gray portion (central region).

窓関数32を掛け合わされて得られた窓関数画像34Aの中央領域において、画素値が0以上となる。また、窓関数画像34Aの周辺画像領域においては、画素値が0(黒色)になる。ここで、窓関数画像34Aの中央領域の画素値の残り方によっては、ノイズが生じる原因となる可能性がある。このノイズは、画像30Aのワーク116が写っていない領域(以下、「非ワーク領域」ともいう。)において画素値が大きく(白い)場合に生じる。これにより生じたノイズの例が図2(A)の窓関数画像34Aに示されている。   In the central region of the window function image 34A obtained by multiplying the window functions 32, the pixel value becomes 0 or more. In the peripheral image area of the window function image 34A, the pixel value is 0 (black). Here, depending on how the pixel values in the central region of the window function image 34A remain, there is a possibility that noise is generated. This noise occurs when the pixel value is large (white) in an area where the work 116 of the image 30A is not shown (hereinafter also referred to as “non-work area”). An example of the noise generated by this is shown in the window function image 34A of FIG.

このノイズを低減するため、本実施の形態に従う画像処理装置100は、非ワーク領域の画素値が小さくなるように画像30Aを補正する。たとえば、図3に示されるように、画像処理装置100は、非ワーク領域の画素値が大きい場合に、画像30Aに対してネガポジ反転処理を行うことで非ワーク領域の画素値を小さくする。ここでいうネガポジ反転処理とは、画像における白黒を逆転させる処理である。すなわち、画像処理装置100は、255(画素値)から、画像30Aの各画素値を引くことで、白黒を逆転させる。   In order to reduce this noise, image processing apparatus 100 according to the present embodiment corrects image 30A so that the pixel value of the non-work area becomes small. For example, as illustrated in FIG. 3, when the pixel value of the non-work area is large, the image processing apparatus 100 reduces the pixel value of the non-work area by performing negative / positive inversion processing on the image 30 </ b> A. Here, the negative / positive inversion processing is processing for reversing black and white in an image. That is, the image processing apparatus 100 reverses black and white by subtracting each pixel value of the image 30A from 255 (pixel value).

このように、画像処理装置100は、画像30Aに対してネガポジ反転処理を行なって画像30Bを得ることで、非ワーク領域における画素値を下げる。これにより、図2(B)に示されるように、画像30Bは、窓関数32を掛けわされても、得られた画像34Bは、その中央領域において、ノイズを含まなくなる。したがって、画像処理装置100は、窓関数32に起因するノイズを低減することができ、高精度なテンプレートマッチング処理を実現することができる。   As described above, the image processing apparatus 100 performs negative / positive inversion processing on the image 30A to obtain the image 30B, thereby reducing the pixel value in the non-work area. 2B, even if the image 30B is multiplied by the window function 32, the obtained image 34B does not contain noise in the central region. Therefore, the image processing apparatus 100 can reduce noise caused by the window function 32 and can realize a highly accurate template matching process.

なお、図2および図3では、画素値が0に近いほど画像の色が黒色に近くなり、画素値が大きくなるほど(典型的には、画素値が255に近くなるほど)、画像の色が白色に近くなるように示されているが、画素値の大きさと色との関係は、これに限定されるわけではない。たとえば、画素値が0に近いほど画像の色が白色に近くなり、画素値が大きくなるほど(典型的には、画素値が255に近くなるほど)、画像の色が黒色に近くなるように示されてもよい。また、画像は、必ずしも白黒画像である必要は無く、カラー画像であってもよい。以下で示される図面についても同様のことがいえる。   2 and 3, the closer the pixel value is to 0, the closer the image color is to black, and the larger the pixel value (typically, the closer the pixel value is to 255), the image color is white. However, the relationship between the size of the pixel value and the color is not limited to this. For example, the closer the pixel value is to 0, the closer the image color is to white, and the larger the pixel value (typically the closer the pixel value is to 255), the closer the image color is to black. May be. The image is not necessarily a black and white image, and may be a color image. The same applies to the drawings shown below.

[機能構成]
図4を参照して、第1の実施の形態に従う画像処理装置100の機能構成について説明する。図4は、画像処理装置100の機能構成の一例を示すブロック図である。画像処理装置100は、補正部210と、窓関数処理部220と、照合部230とを備える。
[Function configuration]
With reference to FIG. 4, the functional configuration of image processing apparatus 100 according to the first embodiment will be described. FIG. 4 is a block diagram illustrating an example of a functional configuration of the image processing apparatus 100. The image processing apparatus 100 includes a correction unit 210, a window function processing unit 220, and a collation unit 230.

補正部210は、入力画像およびテンプレート画像の少なくとも一方に含まれる特徴量に依存して、入力画像およびテンプレート画像に対して、窓関数処理の前にネガポジ反転処理を選択的に行う。典型的には、補正部210は、以下で示される判定部200によりネガポジ反転処理が必要であると判定された場合、画像処理装置100のユーザによりネガポジ反転処理を実行するように設定された場合などにネガポジ反転処理を行なう。   The correction unit 210 selectively performs negative / positive inversion processing on the input image and the template image before the window function processing, depending on the feature amount included in at least one of the input image and the template image. Typically, the correction unit 210 is configured to execute the negative / positive inversion process by the user of the image processing apparatus 100 when the determination unit 200 described below determines that the negative / positive inversion process is necessary. Perform negative / positive inversion processing.

窓関数処理部220は、入力画像およびテンプレート画像の各々に窓関数を掛け合わせる。窓関数処理部220は、入力画像またはテンプレート画像と、窓関数32(図2参照)とのサイズを拡大縮小処理により合わせる。これにより、窓関数処理部220は、入力画像およびテンプレート画像の各々に窓関数を掛け合わせることが可能になる。窓関数としては、たとえば、矩形窓、ガウス窓、ハミング窓、テューキー窓、ブラックマン窓、カイザー窓、指数窓、一般化ハミング窓、ナットール窓、ブラックマン−ハリス窓、ブラックマン−ナットール窓、フラット・トップ窓、パルザン窓、赤池窓、ウェルチ窓、サイン窓、Vorbis窓、カイザー−ベッセル派生窓、ランツォシュ窓などが挙げられる。   The window function processing unit 220 multiplies each of the input image and the template image by a window function. The window function processing unit 220 matches the sizes of the input image or template image and the window function 32 (see FIG. 2) by the enlargement / reduction process. As a result, the window function processing unit 220 can multiply the input image and the template image by the window function. Examples of window functions include rectangular windows, gauss windows, hamming windows, tukey windows, black man windows, kaiser windows, exponential windows, generalized hamming windows, natto windows, black man-harris windows, black man natto windows, flats. -Top windows, Parzan windows, Akaike windows, Welch windows, sign windows, Vorbis windows, Kaiser-Bessel derived windows, Lanzosh windows, etc.

照合部230は、窓関数処理後の入力画像およびテンプレート画像の各々を周波数変換して、周波数変換した入力画像およびテンプレート画像をマッチングする。マッチングの手法としては、テンプレートマッチングが挙げられる。テンプレートマッチングは、たとえば、位相限定相関法(POC)、回転不変位相限定相関(RIPOC:Rotation Invariant Phase Only Correlation)、フーリエメリン変換を用いたマッチング処理、その他の周波数成分を用いたマッチング処理などを含む。   The collation unit 230 performs frequency conversion on each of the input image and the template image after the window function processing, and matches the input image and template image that have been subjected to frequency conversion. Template matching is an example of the matching method. Template matching includes, for example, phase-only correlation (POC), rotation invariant phase only correlation (RIPOC), matching processing using Fourier Merin transform, matching processing using other frequency components, and the like. .

(照合部230の詳細)
図5を参照して、照合部230によるテンプレートマッチング処理の一例であるRIPOCについて詳細に説明する。図5は、照合部230の機能構成の一例を示すブロック図である。RIPOC処理は、テンプレート画像に対して入力画像がどれだけ回転しているかを算出するとともに、テンプレートの回転量を補正する処理(参照符号230−1)と、回転量を補正された補正後テンプレート画像と入力画像(または、その抽出領域)との間でどれだけの類似度および平行移動量が存在するのかを算出する処理(参照符号230−2)とを含む。
(Details of collation unit 230)
With reference to FIG. 5, RIPOC, which is an example of template matching processing by collation unit 230, will be described in detail. FIG. 5 is a block diagram illustrating an example of a functional configuration of the collation unit 230. The RIPOC process calculates how much the input image is rotated with respect to the template image, corrects the rotation amount of the template (reference numeral 230-1), and the corrected template image with the corrected rotation amount. And a process (reference numeral 230-2) for calculating how much similarity and translation amount exist between the input image (or its extraction region).

図5に示されるように、照合部230は、フーリエ変換部231A,231Bと、対数化処理部232A,232Bと、極座標変換部233A,233Bと、POC処理部234と、回転量補正部235と、POC処理部236とを含む。   As shown in FIG. 5, the collation unit 230 includes Fourier transform units 231A and 231B, logarithmic processing units 232A and 232B, polar coordinate conversion units 233A and 233B, a POC processing unit 234, and a rotation amount correction unit 235. , And POC processing unit 236.

フーリエ変換部231Aは、テンプレート画像に含まれる周波数情報(振幅成分および位相成分)を算出する。フーリエ変換部231Bは、入力画像中の検出対象物が存在しそうな位置を中心に探索範囲を設定し、当該探索範囲に対応するテンプレート部分を入力画像から切り出す。典型的には、切り出される領域のサイズは、テンプレート画像と同じサイズである。また、フーリエ変換部231Bは、切り出された領域に含まれる周波数情報(振幅成分および位相成分)を算出する。なお、RIPOC処理においては、位相成分は必ずしも必要ではないので算出されなくてもよい。   The Fourier transform unit 231A calculates frequency information (amplitude component and phase component) included in the template image. The Fourier transform unit 231B sets a search range around a position where the detection target object is likely to exist in the input image, and cuts out a template portion corresponding to the search range from the input image. Typically, the size of the region to be cut out is the same size as the template image. Further, the Fourier transform unit 231B calculates frequency information (amplitude component and phase component) included in the cut out region. In the RIPOC process, the phase component is not necessarily required and may not be calculated.

対数化処理部232Aおよび極座標変換部233Aは、テンプレート画像についての振幅成分を対数化するとともに、極座標へ変換する。同様に、対数化処理部232Bおよび極座標変換部233Bは、入力画像についての振幅成分を対数化するとともに、極座標へ変換する。この極座標への変換によって、回転量が2次元座標上の座標点として表現される。   The logarithmic processing unit 232A and the polar coordinate conversion unit 233A logarithmize the amplitude component of the template image and convert it to polar coordinates. Similarly, the logarithmic processing unit 232B and the polar coordinate conversion unit 233B logarithmize the amplitude component of the input image and convert it to polar coordinates. By this conversion to polar coordinates, the rotation amount is expressed as a coordinate point on two-dimensional coordinates.

POC処理部234は、極座標変換部233Aおよび極座標変換部233Bからそれぞれ出力される極座標変換された結果について、類似度および平行移動量(回転量に相当)を算出する。POC処理では、テンプレート画像および入力画像の画像同士を順次ずらすとともに、それぞれに含まれる空間周波数の成分の間で相関値を算出することで、最も類似度の高いもの(POC値のピーク値)を探索する。POC処理部234は、極座標変換された結果同士で類似度が最も高くなる位置を特定し、それに対応する回転量を回転量補正部235に出力する。   The POC processing unit 234 calculates a similarity and a parallel movement amount (corresponding to a rotation amount) for the result of the polar coordinate conversion output from the polar coordinate conversion unit 233A and the polar coordinate conversion unit 233B, respectively. In the POC processing, the template image and the input image are sequentially shifted, and the correlation value is calculated between the components of the spatial frequency included in each, thereby obtaining the highest similarity (POC peak value). Explore. The POC processing unit 234 specifies the position where the similarity is the highest among the results of the polar coordinate conversion, and outputs the corresponding rotation amount to the rotation amount correction unit 235.

回転量補正部235は、POC処理部234において算出された回転量に従ってテンプレート画像を回転補正する。すなわち、POC処理部234、テンプレート画像を回転補正して補正テンプレートを生成する。   The rotation amount correction unit 235 corrects the rotation of the template image according to the rotation amount calculated by the POC processing unit 234. That is, the POC processing unit 234 generates a correction template by rotationally correcting the template image.

回転量補正部235におけるテンプレート画像を回転補正する方法としては、テンプレート画像そのものを実空間で回転させる方法を採用することができる。POC処理部236において周波数空間を扱うような場合には、実空間で回転させる必要はなく、POC処理の内部表現であるフーリエ変換後のデータ(振幅情報および位相情報)を回転させる方法を採用してもよい。   As a method of rotating and correcting the template image in the rotation amount correcting unit 235, a method of rotating the template image itself in real space can be employed. When the frequency space is handled in the POC processing unit 236, it is not necessary to rotate in the real space, and a method of rotating the data (amplitude information and phase information) after Fourier transform, which is an internal representation of the POC processing, is adopted. May be.

POC処理部236は、補正テンプレート画像と入力画像との間で、類似度および位置(平行移動量)を算出する。類似度が最も高くなる位置が、入力画像に含まれる補正テンプレート画像と一致する領域を示す。POC処理部236は、平行移動量、回転量、倍率などの情報を含む位置情報を出力する。   The POC processing unit 236 calculates a similarity and a position (a parallel movement amount) between the correction template image and the input image. The position with the highest similarity indicates a region that matches the correction template image included in the input image. The POC processing unit 236 outputs position information including information such as a translation amount, a rotation amount, and a magnification.

[ハードウェア構成]
図6は、画像処理装置100のハードウェア構成の一例を示すブロック図である。図6を参照して、画像処理装置100のハードウェア構成について説明する。
[Hardware configuration]
FIG. 6 is a block diagram illustrating an example of a hardware configuration of the image processing apparatus 100. A hardware configuration of the image processing apparatus 100 will be described with reference to FIG.

図6を参照して、画像処理装置100は、主として、汎用的なアーキテクチャーを有するコンピュータ上に実装される。画像処理装置100は、主たるコンポーネントとして、ROM(Read Only Memory)1と、CPU(Central Processing Unit)2と、RAM(Random Access Memory)3と、カメラインターフェイス(I/F)4と、メモリーカードインターフェイス(I/F)5と、ネットワークインターフェイス(I/F)6と、記憶装置20とを含む。   Referring to FIG. 6, image processing apparatus 100 is mainly implemented on a computer having a general-purpose architecture. The image processing apparatus 100 includes, as main components, a ROM (Read Only Memory) 1, a CPU (Central Processing Unit) 2, a RAM (Random Access Memory) 3, a camera interface (I / F) 4, and a memory card interface. (I / F) 5, network interface (I / F) 6, and storage device 20 are included.

ROM1は、画像処理装置100において起動時に実行される初期プログラム(ブートプログラム)などを格納する。CPU2は、ROM1や記憶装置20などに格納された、オペレーティングシステム(OS:Operating System)や画像処理プログラム22などの各種プログラムを実行することで、画像処理装置100の全体を制御する。RAM3は、CPU2でプログラムを実行するためのワーキングメモリとして機能し、プログラムの実行に必要な各種データを一次的に格納する。   The ROM 1 stores an initial program (boot program) that is executed when the image processing apparatus 100 is started up. The CPU 2 controls the entire image processing apparatus 100 by executing various programs such as an operating system (OS) and an image processing program 22 stored in the ROM 1 and the storage device 20. The RAM 3 functions as a working memory for executing a program by the CPU 2 and temporarily stores various data necessary for executing the program.

カメラI/F4は、CPU2とカメラ110とのデータ通信を仲介する。たとえば、カメラI/F4は、画像バッファを含み、カメラ110から伝送される入力画像24を一旦蓄積する。カメラI/F4は、少なくとも1枚分の入力画像のデータが蓄積されると、その蓄積されたデータを記憶装置20またはROM1へ転送する。また、カメラI/F4は、CPU2が発生した内部コマンドに従って、カメラ110に対して撮像指令を与える。なお、カメラ110は、画像処理装置100に組み込まれてもよい。   The camera I / F 4 mediates data communication between the CPU 2 and the camera 110. For example, the camera I / F 4 includes an image buffer and temporarily stores the input image 24 transmitted from the camera 110. When at least one input image data is accumulated, the camera I / F 4 transfers the accumulated data to the storage device 20 or the ROM 1. The camera I / F 4 gives an imaging command to the camera 110 in accordance with an internal command generated by the CPU 2. The camera 110 may be incorporated in the image processing apparatus 100.

メモリーカードI/F5は、SD(Secure Digital)カードやCF(Compact Flash(登録商標))カードなどの各種メモリーカード(不揮発性記憶媒体)5Aとの間で、データの読み書きを行なう。典型的には、メモリーカードI/F5には、他の装置で取得した入力画像24およびテンプレート画像26を格納したメモリーカード5Aが装着され、そのメモリーカード5Aから読み出された入力画像24およびテンプレート画像26が記憶装置20へ格納される。   The memory card I / F 5 reads / writes data from / to various memory cards (nonvolatile storage media) 5A such as an SD (Secure Digital) card and a CF (Compact Flash (registered trademark)) card. Typically, the memory card I / F 5 is mounted with a memory card 5A storing an input image 24 and a template image 26 acquired by another device, and the input image 24 and the template read from the memory card 5A are loaded. The image 26 is stored in the storage device 20.

ネットワークI/F6は、各種の通信媒体を介して、他の装置(サーバ装置など)とデータをやり取りする。より具体的には、ネットワークI/F6は、イーサネット(登録商標)などの有線回線(LAN(Local Area Network)やWAN(Wide Area Network)など)、および/または、無線LANなどの無線回線を介してデータ通信を行なう。   The network I / F 6 exchanges data with other devices (such as server devices) via various communication media. More specifically, the network I / F 6 is connected via a wired line such as Ethernet (registered trademark) (LAN (Local Area Network) or WAN (Wide Area Network)) and / or a wireless line such as a wireless LAN. Data communication.

記憶装置20は、典型的には、ハードディスクなどの大容量磁気記憶媒体などを含む。記憶装置20は、本実施の形態に従う各種を実現するための画像処理プログラム22と、入力画像24と、テンプレート画像26とを格納する。さらに、記憶装置20には、オペレーティングシステムなどのプログラムが格納されてもよい。   The storage device 20 typically includes a large-capacity magnetic storage medium such as a hard disk. The storage device 20 stores an image processing program 22 for realizing various types according to the present embodiment, an input image 24, and a template image 26. Further, the storage device 20 may store a program such as an operating system.

カメラ110は、外付けではなく、画像処理装置100の内部に組み込まれて、画像処理装置100本体が被写体を撮像する機能を有していてもよい。また、画像処理装置100は、カメラに類似した機構を用いて入力画像24およびテンプレート画像26を取得し、取得した入力画像24およびテンプレート画像26を任意の方法で画像処理装置100へ入力するように構成されてもよい。この場合、入力画像24およびテンプレート画像26は、メモリーカードI/F5またはネットワークI/F6を介して画像処理装置100に入力される。   The camera 110 may be incorporated in the image processing apparatus 100 instead of being externally attached, and the image processing apparatus 100 main body may have a function of capturing an image of a subject. The image processing apparatus 100 acquires the input image 24 and the template image 26 using a mechanism similar to a camera, and inputs the acquired input image 24 and template image 26 to the image processing apparatus 100 by an arbitrary method. It may be configured. In this case, the input image 24 and the template image 26 are input to the image processing apparatus 100 via the memory card I / F 5 or the network I / F 6.

記憶装置20に格納される画像処理プログラム22は、CD−ROM(Compact Disk-Read Only Memory)などの記憶媒体に格納されて流通し、あるいは、ネットワークを介してサーバ装置などから配信される。画像処理プログラム22は、画像処理装置100で実行されるオペレーティングシステムの一部として提供されるプログラムモジュールのうち必要なモジュールを、所定のタイミングおよび順序で呼出して処理を実現するようにしてもよい。この場合、画像処理プログラム22自体には、オペレーティングシステムによって提供されるモジュールは含まれず、オペレーティングシステムと協働して画像処理が実現される。   The image processing program 22 stored in the storage device 20 is stored and distributed in a storage medium such as a CD-ROM (Compact Disk-Read Only Memory) or distributed from a server device or the like via a network. The image processing program 22 may call a required module among program modules provided as a part of the operating system executed by the image processing apparatus 100 at a predetermined timing and order to realize the processing. In this case, the image processing program 22 itself does not include a module provided by the operating system, and image processing is realized in cooperation with the operating system.

また、画像処理プログラム22は、単体のプログラムではなく、任意のプログラムの一部に組込まれて提供されてもよい。このような場合にも、画像処理プログラム22自体には、任意のプログラムにおいて共通に利用されるようなモジュールは含まれず、任意のプログラムと協働して画像処理が実現される。このような一部のモジュールを含まない画像処理プログラム22であっても、本実施の形態に従う画像処理装置100の趣旨を逸脱するものではない。さらに、画像処理プログラム22によって提供される機能の一部または全部は、専用のハードウェアによって実現されてもよい。   Further, the image processing program 22 may be provided by being incorporated in a part of an arbitrary program instead of a single program. Even in such a case, the image processing program 22 itself does not include a module that is commonly used in an arbitrary program, and image processing is realized in cooperation with the arbitrary program. Even such an image processing program 22 that does not include some modules does not depart from the spirit of the image processing apparatus 100 according to the present embodiment. Furthermore, some or all of the functions provided by the image processing program 22 may be realized by dedicated hardware.

さらに、画像処理装置100は、必ずしも、リアルタイムに処理を行わなくてもよい。たとえば、少なくとも1つのサーバ装置が本実施の形態に従う処理を実現する、いわゆるクラウドサービスのような形態で画像処理装置100が構成されてもよい。この場合、入力画像24およびテンプレート画像26がサーバ装置(クラウド側)へ送信され、サーバ装置は、受信した入力画像24およびテンプレート画像26に対して、本実施の形態に従う画像処理を実行する。さらに、サーバ装置側がすべての機能(処理)を行なう必要はなく、ユーザ側の端末とサーバ装置とが協働して、本実施の形態に従う画像処理を実現するようにしてもよい。   Furthermore, the image processing apparatus 100 does not necessarily perform processing in real time. For example, the image processing apparatus 100 may be configured in a form such as a so-called cloud service in which at least one server apparatus realizes processing according to the present embodiment. In this case, the input image 24 and the template image 26 are transmitted to the server device (cloud side), and the server device performs image processing according to the present embodiment on the received input image 24 and template image 26. Further, it is not necessary for the server device side to perform all functions (processing), and the user side terminal and the server device may cooperate to realize the image processing according to the present embodiment.

[フローチャート]
図7を参照して、画像処理装置100の制御構造について説明する。図7は、画像処理装置100が実行する処理の一部を表わすフローチャートである。図7の処理は、CPU2がプログラムを実行することにより実現される。他の局面において、処理の一部又は全部が、回路素子その他のハードウェアによって実行されてもよい。
[flowchart]
The control structure of the image processing apparatus 100 will be described with reference to FIG. FIG. 7 is a flowchart showing a part of processing executed by the image processing apparatus 100. The processing in FIG. 7 is realized by the CPU 2 executing a program. In other aspects, some or all of the processing may be performed by circuit elements or other hardware.

ステップS510において、CPU2は、カメラ110からテンプレート画像を取得する。ステップS512において、CPU2は、カメラ110から入力画像を取得する。ステップS520において、CPU2は、補正部210として、入力画像およびテンプレート画像の少なくとも一方から抽出した特徴量が所定の条件を満たしたか否かを判断する。典型的には、CPU2は、後述する判定部200が、入力画像およびテンプレート画像に対するネガポジ反転処理が必要であると判定した場合に、所定の条件を満たしたものと判断する。CPU2は、所定の条件を満たしたと判断した場合には(ステップS520においてYES)、制御をステップS522に切り替える。そうでない場合には(ステップS520においてNO)、CPU2は、制御をステップS524に切り替える。   In step S <b> 510, the CPU 2 acquires a template image from the camera 110. In step S <b> 512, the CPU 2 acquires an input image from the camera 110. In step S520, the CPU 2 determines, as the correction unit 210, whether or not the feature amount extracted from at least one of the input image and the template image satisfies a predetermined condition. Typically, the CPU 2 determines that a predetermined condition is satisfied when the determination unit 200 described later determines that negative / positive inversion processing is required for the input image and the template image. When CPU 2 determines that the predetermined condition is satisfied (YES in step S520), CPU 2 switches control to step S522. If not (NO in step S520), CPU 2 switches control to step S524.

ステップS522において、CPU2は、補正部210として、入力画像およびテンプレート画像の両方に対して、ネガポジ反転処理を行なう。ステップS524において、CPU2は、窓関数処理部220として、入力画像と、テンプレート画像との各々に窓関数処理を行う。ステップS526において、CPU2は、照合部230として、窓関数処理後の入力画像およびテンプレート画像の各々についてフーリエ変換などの周波数変換を行なう。   In step S522, the CPU 2 performs a negative / positive inversion process on the input image and the template image as the correction unit 210. In step S524, the CPU 2 performs window function processing on each of the input image and the template image as the window function processing unit 220. In step S526, the CPU 2 performs frequency transformation such as Fourier transformation for each of the input image and the template image after the window function processing as the collation unit 230.

ステップS528において、CPU2は、照合部230として、入力画像およびテンプレート画像の各々から抽出した周波数成分を用いて、入力画像およびテンプレート画像をマッチングする。典型的には、CPU2は、周波数変換した画像に対して、POC法や、RIPOC法を用いてマッチング処理を行う。ステップS530において、CPU2は、照合部230として、テンプレートマッチングの結果から、入力画像とテンプレート画像との類似度を算出する。   In step S528, the CPU 2 uses the frequency component extracted from each of the input image and the template image as the matching unit 230 to match the input image and the template image. Typically, the CPU 2 performs matching processing on the frequency-converted image using the POC method or the RIPOC method. In step S530, the CPU 2 calculates the similarity between the input image and the template image from the template matching result as the matching unit 230.

[利点]
周波数成分を用いたテンプレートマッチングを行う場合において、非ワーク領域において画素値の大きい画素が多く含まれるような画像を用いたときには、窓関数処理を実施した際に、窓関数起因のノイズが残ってしまうことがある。画像処理装置100は、その状態で周波数変換すると、テンプレート画像または入力画像の信号成分を劣化させてしまい、テンプレートマッチングの精度が低下する。画素値の小さい画素が窓関数の影響を受けにくい点に着目して、画像処理装置100は、テンプレート画像および入力画像をネガポジ反転することで、窓関数の影響を受けない画像を作成する。これにより、画像処理装置100は、窓関数処理を実行した際に生じる信号劣化を抑制でき、さらには、テンプレートマッチング処理の精度を向上できる。
[advantage]
When performing template matching using frequency components, when using an image that contains many pixels with large pixel values in the non-work area, noise caused by the window function remains when window function processing is performed. May end up. If frequency conversion is performed in this state, the image processing apparatus 100 deteriorates the signal component of the template image or the input image, and the accuracy of template matching decreases. Focusing on the fact that pixels with small pixel values are not easily affected by the window function, the image processing apparatus 100 creates an image that is not affected by the window function by negative / positive inversion of the template image and the input image. Thereby, the image processing apparatus 100 can suppress signal deterioration that occurs when the window function process is executed, and can further improve the accuracy of the template matching process.

<第2の実施の形態>
[概要]
以下、第2の実施の形態に従う画像処理装置100Aの概要について説明する。本実施の形態に従う画像処理装置100Aは、入力画像およびテンプレート画像に対して補正処理(すなわち、ネガポジ反転処理)を実行するか否かを判定する機能を有する点で画像処理装置100と異なる。ハードウェア構成については第1の実施の形態に従う画像処理装置100と同じであるので説明を繰り返さない。
<Second Embodiment>
[Overview]
Hereinafter, an overview of image processing apparatus 100A according to the second embodiment will be described. Image processing apparatus 100A according to the present embodiment is different from image processing apparatus 100 in that it has a function of determining whether or not to perform correction processing (that is, negative / positive inversion processing) on an input image and a template image. Since the hardware configuration is the same as that of image processing apparatus 100 according to the first embodiment, description thereof will not be repeated.

本実施の形態に従う画像処理装置100Aは、入力画像およびテンプレート画像の少なくとも一方を用いて、入力画像およびテンプレート画像に対する補正処理(すなわち、ネガポジ反転処理)が必要であるか否かを判定する。画像処理装置100Aは、補正が必要であると判定した場合には、入力画像およびテンプレート画像に対してネガポジ反転処理を行なう。画像処理装置100Aは、補正が不必要であると判定した場合には、入力画像およびテンプレート画像に対してネガポジ反転処理を行なわない。   Image processing apparatus 100A according to the present embodiment uses at least one of the input image and the template image to determine whether correction processing (that is, negative / positive inversion processing) for the input image and the template image is necessary. When it is determined that correction is necessary, the image processing apparatus 100A performs negative / positive inversion processing on the input image and the template image. If it is determined that correction is unnecessary, the image processing apparatus 100A does not perform negative / positive inversion processing on the input image and the template image.

画像処理装置100Aは、ラインを流れるワークを順次撮影して得た入力画像に対して、補正の判定処理を行なうことで、環境が変わった場合などに適応して、補正を行なうことが可能になる。すなわち、画像処理装置100Aは、環境変動に強いテンプレートマッチング処理を実行することが可能になる。   The image processing apparatus 100A performs correction determination processing on an input image obtained by sequentially photographing the workpieces flowing through the line, thereby making it possible to perform correction in accordance with a change in the environment. Become. That is, the image processing apparatus 100A can execute a template matching process that is resistant to environmental changes.

[機能構成]
図8を参照して、第2の実施の形態に従う画像処理装置100Aの機能構成について説明する。図8は、画像処理装置100Aの機能構成の一例を示すブロック図である。画像処理装置100Aは、判定部200と、補正部210と、窓関数処理部220と、照合部230とを備える。補正部210と、窓関数処理部220と、照合部230とについては上述と同様であるので説明を繰り返さない。
[Function configuration]
With reference to FIG. 8, the functional configuration of image processing apparatus 100A according to the second embodiment will be described. FIG. 8 is a block diagram illustrating an example of a functional configuration of the image processing apparatus 100A. The image processing apparatus 100A includes a determination unit 200, a correction unit 210, a window function processing unit 220, and a collation unit 230. Since correction unit 210, window function processing unit 220, and collation unit 230 are the same as described above, description thereof will not be repeated.

判定部200は、テンプレート画像を判定画像として用いて補正判定を行なう。なお、判定部200は、判定画像として、テンプレート画像の代わりに、入力画像、入力画像をネガポジ反転した画像、および、テンプレート画像をネガポジ反転した画像のいずれかを用いることもできる。判定部200は、たとえば、テンプレート画像が最初に入力された際に補正判定を1回だけ行ない、その結果を2枚目以降の入力画像に適用してもよいし、入力画像が入力される度に補正判定を行なってもよい。判定部200における、補正判定の方法については様々な方法が考えられる。これらの方法の詳細については後述する。   The determination unit 200 performs correction determination using the template image as a determination image. Note that the determination unit 200 may use any of an input image, an image obtained by inverting the input image with negative and positive images, and an image obtained by inverting the negative and positive images instead of the template image. For example, the determination unit 200 may perform correction determination only once when a template image is first input, and apply the result to the second and subsequent input images, or each time an input image is input. Correction determination may be performed. Various methods can be considered for the correction determination method in the determination unit 200. Details of these methods will be described later.

[フローチャート]
図9を参照して、画像処理装置100Aの制御構造について説明する。図9は、画像処理装置100Aが実行する処理の一部を表わすフローチャートである。図9の処理は、CPU2がプログラムを実行することにより実現される。他の局面において、処理の一部又は全部が、回路素子その他のハードウェアによって実行されてもよい。なお、ステップS600以外の各ステップについては上述の通りであるので説明を繰り返さない。
[flowchart]
A control structure of the image processing apparatus 100A will be described with reference to FIG. FIG. 9 is a flowchart showing a part of processing executed by image processing apparatus 100A. The processing in FIG. 9 is realized by the CPU 2 executing a program. In other aspects, some or all of the processing may be performed by circuit elements or other hardware. Since each step other than step S600 is as described above, description thereof will not be repeated.

ステップS600において、CPU2は、判定部200として、窓関数処理の前に、判定画像を用いて、入力画像およびテンプレート画像に対する補正(すなわち、ネガポジ反転処理)が必要であるか否かを判定する。補正の判定方法の詳細については後述する。   In step S600, the CPU 2 uses the determination image as the determination unit 200 to determine whether correction (that is, negative / positive inversion processing) for the input image and the template image is necessary using the determination image. Details of the correction determination method will be described later.

[判定部200の補正の判定方法の詳細]
(補正の判定方法の具体例1)
図10〜図12を参照して、判定部200の処理の一例について説明する。図10は、具体例1に従う判定部200の処理の一例を示すフローチャートである。図11は、判定画像36をワーク領域および非ワーク領域に分割している様子を示している図である。図12は、判定画像36を複数のブロックに分割している様子を示している図である。
[Details of Correction Determination Method of Determination Unit 200]
(Specific example 1 of correction determination method)
With reference to FIGS. 10-12, an example of the process of the determination part 200 is demonstrated. FIG. 10 is a flowchart illustrating an example of processing of the determination unit 200 according to the first specific example. FIG. 11 is a diagram illustrating a state in which the determination image 36 is divided into a work area and a non-work area. FIG. 12 is a diagram illustrating a state in which the determination image 36 is divided into a plurality of blocks.

上述したように、窓関数に起因するノイズは、画像領域内にワークを含まない非ワーク領域における各画像値が大きい(白い)場合に生じる。すなわち、当該ノイズは、画像の非ワーク領域における画像値が小さい(黒い)場合には生じない。この点に着目して、判定部200は、判定画像の非ワーク領域における画素値が大きい場合に、補正処理が必要であると判定する。   As described above, the noise caused by the window function occurs when each image value in a non-work area that does not include a work in the image area is large (white). That is, the noise does not occur when the image value in the non-work area of the image is small (black). Focusing on this point, the determination unit 200 determines that correction processing is necessary when the pixel value in the non-work area of the determination image is large.

より具体的な処理手順としては、ステップS602において、判定部200は、判定画像を取得する。判定部200は、判定画像36として、入力画像、テンプレート画像、入力画像に対してネガポジ反転処理を行なった画像、および、テンプレート画像に対してネガポジ反転処理を行なった画像のうちの少なくとも1つを用いることができる。   As a more specific processing procedure, in step S602, the determination unit 200 acquires a determination image. The determination unit 200 selects, as the determination image 36, at least one of an input image, a template image, an image obtained by performing negative / positive inversion processing on the input image, and an image obtained by performing negative / positive reversal processing on the template image. Can be used.

ステップS604において、判定部200は、取得した判定画像から少なくとも非ワーク領域を特定する。たとえば、図11に示されるように、判定部200は、ワーク領域と非ワーク領域とに分割する。具体的な領域分割方法としては、たとえば、判定部200は、判定画像36において、エッジが最も強い画素を特定し、その画素を中心としてワーク領域を設定し、それ以外の領域を非ワーク領域として設定する。このように、エッジ情報を用いて領域を自動的に分割することで画像が入力される度にワーク領域と非ワーク領域とを適応的に設定することが可能になる。   In step S604, the determination unit 200 specifies at least a non-work area from the acquired determination image. For example, as illustrated in FIG. 11, the determination unit 200 divides a work area and a non-work area. As a specific area dividing method, for example, the determination unit 200 identifies a pixel having the strongest edge in the determination image 36, sets a work area around the pixel, and sets other areas as non-work areas. Set. Thus, by automatically dividing an area using edge information, it is possible to adaptively set a work area and a non-work area each time an image is input.

また、判定部200は、予め定められた領域をワーク領域として設定してもよい。たとえば、判定部200は、縦横3分の1ずつの9ブロックに分割した領域のうち中央のブロックをワーク領域として設定し、それ以外のブロックを非ワーク領域として設定する。他にも、図12に示されるように、判定部200は、入力画像を縦横5分の1ずつの25ブロックに分割した領域のうち、中央のブロックと中央のブロックに対して上下左右斜めに位置するブロックをワーク領域として設定し、それ以外の口の字型の領域を非ワーク領域として設定する。なお、判定部200が分割するブロック数は任意である。   The determination unit 200 may set a predetermined area as a work area. For example, the determination unit 200 sets a central block as a work area among areas divided into nine blocks of 1/3 vertical and horizontal, and sets other blocks as non-work areas. In addition, as illustrated in FIG. 12, the determination unit 200, in an area obtained by dividing the input image into 25 blocks of 1/5 vertical and horizontal directions, is inclined vertically and horizontally with respect to the central block and the central block. The block located is set as a work area, and the other square-shaped area is set as a non-work area. Note that the number of blocks that the determination unit 200 divides is arbitrary.

ステップS606において、判定部200は、ワーク領域および非ワーク領域のうちの少なくとも非ワーク領域における画像値を用いて補正判定を行なう。判定部200は、非ワーク領域における画素値が比較的大きい(白い)場合に、補正処理が必要であると判定する。すなわち、判定部200は、非ワーク領域における画素値が比較的小さい(黒い)場合には、補正処理が不必要であると判定する。   In step S606, the determination unit 200 performs correction determination using an image value in at least the non-work area of the work area and the non-work area. The determination unit 200 determines that correction processing is necessary when the pixel value in the non-work area is relatively large (white). That is, the determination unit 200 determines that the correction process is unnecessary when the pixel value in the non-work area is relatively small (black).

より具体的には、判定部200は、非ワーク領域の各画素値の大きさに応じた統計値を算出し、統計値が所定の値よりも大きい場合には、補正処理(すなわち、ネガポジ反転処理)を行なうと判定する。また、判定部200は、非ワーク領域における当該統計値が所定の値よりも小さい場合には、ネガポジ反転処理を行なわないと判定してもよい。なお、ここでいう統計値は、たとえば、非ワーク領域における各画素値の、平均値と、中央値と、最頻値と、非ワーク領域における画素数に対する所定値以上を有する画素の数の割合とを含む。当該割合は、たとえば、以下の式(1)で示される。   More specifically, the determination unit 200 calculates a statistical value corresponding to the size of each pixel value in the non-work area, and when the statistical value is larger than a predetermined value, correction processing (that is, negative / positive inversion) Process). Further, the determination unit 200 may determine that the negative / positive inversion process is not performed when the statistical value in the non-work area is smaller than a predetermined value. Note that the statistical values here are, for example, the average value, median value, mode, and ratio of the number of pixels having a predetermined value or more with respect to the number of pixels in the non-work area. Including. The said ratio is shown by the following formula | equation (1), for example.

統計値(画素の割合)=非ワーク領域において所定値以上の画素値を有する画素数/非ワーク領域における画素数・・式(1)
判定部200は、判定画像として、入力画像またはテンプレート画像を用いた場合において、式(1)に示される画素の割合が、以下の式(2)を満たすときに、ネガポジ反転処理を行なうと判定する。
Statistical value (pixel ratio) = number of pixels having a pixel value greater than or equal to a predetermined value in the non-work area / number of pixels in the non-work area (1)
The determination unit 200 determines to perform the negative / positive inversion process when the input image or the template image is used as the determination image and the ratio of the pixels shown in the equation (1) satisfies the following equation (2). To do.

統計値(画素の割合)≧閾値・・・式(2)
たとえば、非ワーク領域の画素数が500であり、非ワーク領域に含まれる画素のうち画素値が128以上の画素数が400であり、閾値が0.5である場合においては、以下の式(3)のようになる。この場合、以下の式(3)が満たされるので判定部200は、補正が必要であると判定する。
Statistical value (pixel ratio) ≧ threshold value (2)
For example, when the number of pixels in the non-work area is 500, the number of pixels having a pixel value of 128 or more among the pixels included in the non-work area is 400, and the threshold value is 0.5, the following formula ( It becomes like 3). In this case, since the following equation (3) is satisfied, the determination unit 200 determines that correction is necessary.

統計値(画素の割合)=400/500=0.8≧0.5・・・式(3)
ステップS520において、判定部200は、非ワーク領域から算出した統計値を用いて、入力画像およびテンプレート画像に対する補正が必要であるか否かを判定する。典型的には、判定部200は、統計値が上記式(2)を満たした場合に、補正が必要であると判定する。判定部200は、補正が必要であると判定した場合には(ステップS520においてYES)、制御をステップS522に切り替える。そうでない場合には(ステップS520においてNO)、判定部200は、制御をステップS524に切り替える。
Statistical value (pixel ratio) = 400/500 = 0.8 ≧ 0.5 Expression (3)
In step S520, the determination unit 200 determines whether correction for the input image and the template image is necessary using the statistical value calculated from the non-work area. Typically, the determination unit 200 determines that correction is necessary when the statistical value satisfies the above equation (2). When determining unit 200 determines that correction is necessary (YES in step S520), control is switched to step S522. Otherwise (NO in step S520), determination unit 200 switches control to step S524.

なお、判定部200は、入力画像をネガポジ反転処理した画像、または、テンプレート画像をネガポジ反転処理した画像を判定画像として用いた場合には、式(2)およびその他の判定条件の大小関係が反転する。また、図11においては、ワーク領域および非ワーク領域が矩形で示されているが、ワーク領域および非ワーク領域の形状は任意である。たとえば、ワーク領域および非ワーク領域は、円形、楕円形、六角形、ワークを含むように囲んだ領域、その他の形状であってもよい。また、非ワーク領域は、ワーク領域以外の領域の全部であってもよく一部であってもよい。   The determination unit 200 inverts the magnitude relationship between the expression (2) and other determination conditions when an image obtained by performing negative / positive reversal processing on the input image or an image obtained by performing negative / positive reversal processing on the template image is used as the determination image. To do. In FIG. 11, the work area and the non-work area are indicated by rectangles, but the shapes of the work area and the non-work area are arbitrary. For example, the work area and the non-work area may be a circle, an ellipse, a hexagon, an area surrounded to include a work, or other shapes. Further, the non-work area may be all or a part of the area other than the work area.

(判定部200の処理の具体例2)
以下では、図13のフローチャートを参照しながら、判定部200の処理の他の例について説明する。図13は、具体例2に従う判定部200の処理の一例を示すフローチャートである。
(Specific example 2 of processing of determination unit 200)
Hereinafter, another example of the process of the determination unit 200 will be described with reference to the flowchart of FIG. FIG. 13 is a flowchart illustrating an example of processing of the determination unit 200 according to the second specific example.

判定部200は、上記の具体例1のように非ワーク領域の画素値だけでなく、ワーク領域の画素値をさらに用いて補正判定を行なってもよい。この場合、ワーク領域に対する非ワーク領域における画素値が相対的に大きい場合に、判定部200は、補正処理を行なう必要があると判断する。   The determination unit 200 may perform the correction determination using not only the pixel value of the non-work area but also the pixel value of the work area as in the specific example 1 described above. In this case, when the pixel value in the non-work area relative to the work area is relatively large, the determination unit 200 determines that correction processing needs to be performed.

より具体的な処理手順としては、ステップS602において、判定部200は、判定画像を取得する。ステップS604Aにおいて、判定部200は、取得した判定画像をワーク領域および非ワーク領域に分割する。領域の分割方法については上述した通りであるので説明を繰り返さない。   As a more specific processing procedure, in step S602, the determination unit 200 acquires a determination image. In step S604A, the determination unit 200 divides the acquired determination image into a work area and a non-work area. Since the region dividing method is as described above, description thereof will not be repeated.

ステップS606Aにおいて、判定部200は、特定したワーク領域および非ワーク領域内の画素値の大きさに応じた統計値を算出する。当該統計値は、ワーク領域および非対ワーク領域の各々の領域における各画素値の、平均値、中央値、および、最頻値の少なくとも1つを含む。判定部200は、非ワーク領域における統計値が、ワーク領域における統計値よりも相対的に大きい場合に、ネガポジ反転処理を行なうと判定する。より具体的には、判定部200は、以下の式(4)を満たすときに、ネガポジ反転処理を行なうと判定する。   In step S606A, the determination unit 200 calculates a statistical value corresponding to the size of the pixel value in the identified work area and non-work area. The statistical value includes at least one of an average value, a median value, and a mode value of each pixel value in each of the work area and the non-work area. The determination unit 200 determines to perform the negative / positive inversion process when the statistical value in the non-work area is relatively larger than the statistical value in the work area. More specifically, the determination unit 200 determines to perform negative / positive inversion processing when the following expression (4) is satisfied.

(非ワーク領域における統計値)−(ワーク領域における統計値)≧閾値・・・式(4)
たとえば、ワーク領域における画素値の平均値が20であり、非ワーク領域における画素値の平均値が240であり、閾値が200である場合においては、式(4)は、以下の式(5)のようになる。この場合、上記式(4)が満たされるので判定部200は、補正が必要であると判定する。
(Statistical value in non-work area) − (Statistical value in work area) ≧ threshold value (4)
For example, when the average value of the pixel values in the work area is 20, the average value of the pixel values in the non-work area is 240, and the threshold value is 200, the expression (4) is expressed by the following expression (5): become that way. In this case, since the above equation (4) is satisfied, the determination unit 200 determines that correction is necessary.

240−20=220≧200・・・式(5)
なお、判定部200は、判定画像として、入力画像をネガポジ反転処理した画像、または、テンプレート画像をネガポジ反転処理した画像を用いた場合には、式(4)およびその他の判定条件の大小関係が反転する。
240−20 = 220 ≧ 200 Formula (5)
In addition, when the determination unit 200 uses an image obtained by performing negative / positive inversion processing on the input image or an image obtained by performing negative / positive reversal processing on the template image as the determination image, there is a magnitude relationship between Expression (4) and other determination conditions. Invert.

ステップS520において、判定部200は、ワーク領域および非ワーク領域から算出した統計値を用いて、入力画像およびテンプレート画像に対する補正が必要であるか否かを判定する。典型的には、判定部200は、統計値が上記式(4)を満たした場合に、補正が必要であると判定する。判定部200は、補正が必要であると判定した場合には(ステップS520においてYES)、制御をステップS522に切り替える。そうでない場合には(ステップS520においてNO)、判定部200は、制御をステップS524に切り替える。   In step S520, the determination unit 200 determines whether correction for the input image and the template image is necessary using the statistical values calculated from the work area and the non-work area. Typically, the determination unit 200 determines that correction is necessary when the statistical value satisfies the above equation (4). When determining unit 200 determines that correction is necessary (YES in step S520), control is switched to step S522. Otherwise (NO in step S520), determination unit 200 switches control to step S524.

(判定部200の処理の具体例3)
以下では、図14および図15を参照して、判定部200の処理のさらに他の例について説明する。図14は、具体例3に従う判定部200の処理の一例を示すフローチャートである。図15は、具体例3に従う判定部200の処理の概略を表した概念図である。
(Specific example 3 of processing of determination unit 200)
Below, with reference to FIG. 14 and FIG. 15, the further another example of the process of the determination part 200 is demonstrated. FIG. 14 is a flowchart illustrating an example of processing of the determination unit 200 according to the third specific example. FIG. 15 is a conceptual diagram illustrating an outline of processing of the determination unit 200 according to the third specific example.

入力画像に窓関数を掛けた後の画像が、入力画像と類似していない場合には、補正を行なう必要があると考えられる(図2(A)参照)。逆に、入力画像に窓関数を掛けた後の画像が、入力画像と類似している場合には、補正を行なわなくてよいと考えられる(図2(B)参照)。   If the image after the window function is multiplied with the input image is not similar to the input image, it is considered that correction is necessary (see FIG. 2A). On the other hand, if the image after the window function is multiplied by the input image is similar to the input image, it is considered that no correction is required (see FIG. 2B).

この点に着目して、具体例3における補正判定処理については、判定部200は、判定画像と、判定画像に対して窓関数処理を行なった画像(以下、「窓関数画像」ともいう)とを比較して補正判定を行なう。このように、判定部200が窓関数画像を用いて補正判定を行なうことで、画像処理装置100Aは、窓関数起因のノイズが現れるか否かを、より確実に突き止めることが可能になる。これにより、画像処理装置100Aは、照合部230によるテンプレートマッチング処理の精度をさらに向上することができる。   Focusing on this point, for the correction determination processing in the specific example 3, the determination unit 200 is a determination image and an image obtained by performing window function processing on the determination image (hereinafter also referred to as “window function image”). To make correction judgment. As described above, when the determination unit 200 performs correction determination using the window function image, the image processing apparatus 100A can more reliably determine whether noise due to the window function appears. Accordingly, the image processing apparatus 100A can further improve the accuracy of the template matching process performed by the collation unit 230.

より具体的な処理手順としては、ステップS610において、判定部200は、判定画像36に対して窓関数処理を実行して窓関数画像38(図15参照)を取得する。ステップS612において、判定部200は、判定画像36と窓関数画像38と用いて、画素値のばらつきに応じた統計値を算出する。当該統計値とは、たとえば、判定画像36および窓関数画像38の各々についての周波数空間での信号強度の最大値と最小値との差を含む。あるいは、当該統計値は、判定画像36および窓関数画像38の各々について画素値の分散値であってもよい。   As a more specific processing procedure, in step S610, the determination unit 200 performs window function processing on the determination image 36 to obtain a window function image 38 (see FIG. 15). In step S <b> 612, the determination unit 200 uses the determination image 36 and the window function image 38 to calculate a statistical value corresponding to pixel value variation. The statistical value includes, for example, a difference between the maximum value and the minimum value of the signal strength in the frequency space for each of the determination image 36 and the window function image 38. Alternatively, the statistical value may be a variance value of pixel values for each of the determination image 36 and the window function image 38.

ステップS520において、判定部200は、判定画像36および窓関数画像38の各々から算出した統計値を比較する。すなわち、判定部200は、以下の式(6)を満たすか否かを判定する。   In step S520, the determination unit 200 compares the statistical values calculated from each of the determination image 36 and the window function image 38. That is, the determination unit 200 determines whether or not the following expression (6) is satisfied.

(窓関数画像における統計値)−(入力画像における統計値)≧閾値・・・式(6)
たとえば、窓関数画像から算出された分散値(統計値)が5.2であり、入力画像から算出された分散値(統計値)が0.8であり、閾値が3.0の場合には、以下の式(7)のようになる。この場合、上記式(6)が満たされるので判定部200は、補正が必要であると判定する。
(Statistical value in window function image) − (Statistical value in input image) ≧ threshold value (6)
For example, when the variance value (statistical value) calculated from the window function image is 5.2, the variance value (statistical value) calculated from the input image is 0.8, and the threshold value is 3.0 The following equation (7) is obtained. In this case, since the formula (6) is satisfied, the determination unit 200 determines that correction is necessary.

5.2−0.8≧3.0・・・式(7)
ステップS520において、判定部200は、判定画像36および窓関数画像38の各々から算出した各統計値を用いて、入力画像およびテンプレート画像に対する補正が必要であるか否かを判定する。典型的には、判定部200は、統計値が上記式(6)を満たした場合に、補正が必要であると判定する。判定部200は、補正が必要であると判定した場合には(ステップS520においてYES)、制御をステップS522に切り替える。そうでない場合には(ステップS520においてNO)、判定部200は、制御をステップS524に切り替える。
5.2-0.8 ≧ 3.0 Formula (7)
In step S520, the determination unit 200 determines whether correction for the input image and the template image is necessary using each statistical value calculated from each of the determination image 36 and the window function image 38. Typically, the determination unit 200 determines that correction is necessary when the statistical value satisfies the above equation (6). When determining unit 200 determines that correction is necessary (YES in step S520), control is switched to step S522. Otherwise (NO in step S520), determination unit 200 switches control to step S524.

(判定部200の処理の具体例4)
以下では、図16および図17を参照して、判定部200の処理のさらに他の例について説明する。図16は、具体例4に従う判定部200の処理の一例を示すフローチャートである。図17は、具体例4に従う判定部200の処理の概略を表した概念図である。
(Specific example 4 of processing of determination unit 200)
Hereinafter, still another example of the process of the determination unit 200 will be described with reference to FIGS. 16 and 17. FIG. 16 is a flowchart illustrating an example of processing of the determination unit 200 according to the fourth specific example. FIG. 17 is a conceptual diagram illustrating an outline of processing of the determination unit 200 according to the fourth specific example.

判定部200は、上記具体例3の判定画像および窓関数画像を比較する他の方法として、判定画像と窓関数画像との差分画像を用いてもよい。判定部200は、差分画像を用いることで、具体例3のように判定画像および窓関数画像の両方について統計値を算出する必要がなくなり、差分画像のみから統計値を算出すればよいため、処理時間を短縮することが可能になる。   The determination unit 200 may use a difference image between the determination image and the window function image as another method for comparing the determination image of the specific example 3 and the window function image. By using the difference image, the determination unit 200 does not need to calculate statistical values for both the determination image and the window function image as in the specific example 3, and only needs to calculate the statistical values from the difference image. Time can be shortened.

より具体的な処理手順としては、ステップS610において、判定部200は、判定画像36に対して窓関数処理を実行して窓関数画像38を取得する。ステップS620において、図17に示されるように、判定部200は、判定画像36と窓関数画像38と用いて差分画像を作成する。   As a more specific processing procedure, in step S <b> 610, the determination unit 200 performs window function processing on the determination image 36 to obtain a window function image 38. In step S620, the determination unit 200 creates a difference image using the determination image 36 and the window function image 38, as shown in FIG.

ステップS622において、判定部200は、差分画像を用いて統計値を算出する。上述のように、補正処理が必要無い場合には、判定画像と窓関数画像とが類似する画像となるため、差分画像における各画素値がほぼ0になる。これに着目して、判定部200は、判定画像と窓関数画像との類似性を示す統計値を算出する。より具体的には、判定部200は、類似性を示す統計値として、差分画像の画素値の大きさに応じた統計値、または、差分画像の画素値のばらつきに応じた統計値を算出する。   In step S622, the determination unit 200 calculates a statistical value using the difference image. As described above, when the correction process is not necessary, the determination image and the window function image are similar to each other, so that each pixel value in the difference image is almost zero. Focusing on this, the determination unit 200 calculates a statistical value indicating the similarity between the determination image and the window function image. More specifically, the determination unit 200 calculates a statistical value corresponding to the size of the pixel value of the difference image or a statistical value corresponding to the variation in the pixel value of the difference image as the statistical value indicating similarity. .

たとえば、当該統計値としては、差分画像の各画素値の、平均値、中央値、および最頻値などが挙げられる。他にも、統計値としては、差分画像内の画素数に対する所定の値以上を有する画素の数の割合が挙げられる。他にも、統計値としては、差分画像における周波数空間での信号強度の最大値と最小値との差が挙げられる。他にも、統計値としては、差分画像における各画素値から算出された分散値が挙げられる。   For example, the statistical value includes an average value, a median value, a mode value, and the like of each pixel value of the difference image. In addition, the statistical value includes a ratio of the number of pixels having a predetermined value or more to the number of pixels in the difference image. In addition, the statistical value includes a difference between the maximum value and the minimum value of the signal intensity in the frequency space in the difference image. In addition, the statistical value includes a variance value calculated from each pixel value in the difference image.

ステップS520において、判定部200は、差分画像が所定の値よりも大きいか否かを判定する。すなわち、判定部200は、以下の式(8)を満たすか否かを判定する。   In step S520, the determination unit 200 determines whether the difference image is larger than a predetermined value. That is, the determination unit 200 determines whether or not the following formula (8) is satisfied.

(差分画像における統計値)≧閾値・・・式(8)
たとえば、差分画像の各画素値から算出された平均値(統計値)が200であり、閾値が128の場合には、以下の式(9)のようになる。この場合、上記式(8)が満たされるので判定部200は、補正が必要であると判定する。
(Statistical value in difference image) ≧ threshold value (8)
For example, when the average value (statistical value) calculated from each pixel value of the difference image is 200 and the threshold value is 128, the following equation (9) is obtained. In this case, since the formula (8) is satisfied, the determination unit 200 determines that correction is necessary.

200≧128・・・式(9)
ステップS520において、判定部200は、差分画像から算出した統計値を用いて、入力画像およびテンプレート画像に対する補正が必要であるか否かを判定する。典型的には、判定部200は、統計値が上記式(8)を満たした場合に、補正が必要であると判定する。判定部200は、補正が必要であると判定した場合には(ステップS520においてYES)、制御をステップS522に切り替える。そうでない場合には(ステップS520においてNO)、判定部200は、制御をステップS524に切り替える。
200 ≧ 128 (9)
In step S520, the determination unit 200 determines whether correction for the input image and the template image is necessary using the statistical value calculated from the difference image. Typically, the determination unit 200 determines that correction is necessary when the statistical value satisfies the above equation (8). When determining unit 200 determines that correction is necessary (YES in step S520), control is switched to step S522. Otherwise (NO in step S520), determination unit 200 switches control to step S524.

(判定部200の処理の具体例5)
なお、具体例3および具体例4においては、判定部200は、判定画像と、窓関数画像との両方を用いて補正判定を行なったが、窓関数画像のみを用いて補正判定を行なってもよい。窓関数画像における非ワーク領域において画素値が大きい(白い)場合には(図2(A)参照)、判定部200は、窓関数起因のノイズが発生したと判定できる。この点に着目して、判定部200は、窓関数画像における非ワーク領域の画素値に応じた統計値が所定値よりも大きい場合に補正を行なうと判定してもよい。
(Specific example 5 of processing of determination unit 200)
In the specific example 3 and the specific example 4, the determination unit 200 performs the correction determination using both the determination image and the window function image. However, the determination unit 200 may perform the correction determination using only the window function image. Good. When the pixel value is large (white) in the non-work area in the window function image (see FIG. 2A), the determination unit 200 can determine that noise due to the window function has occurred. Focusing on this point, the determination unit 200 may determine that correction is performed when a statistical value corresponding to the pixel value of the non-work area in the window function image is larger than a predetermined value.

(判定部200の処理の具体例6)
以下では、図18および図19を参照して、判定部200の処理のさらに他の例について説明する。図18は、具体例6に従う判定部200の処理の一例を示すフローチャートである。図19は、具体例6に従う判定部200の処理の概略を表した概念図である。
(Specific example 6 of processing of determination unit 200)
Below, with reference to FIG. 18 and FIG. 19, the further another example of the process of the determination part 200 is demonstrated. FIG. 18 is a flowchart illustrating an example of processing of the determination unit 200 according to the sixth specific example. FIG. 19 is a conceptual diagram illustrating an outline of the process of the determination unit 200 according to the sixth specific example.

具体例6における補正判定処理については、判定部200は、判定画像に対して窓関数処理を行なった画像と、判定画像に対して補正処理(すなわち、ネガポジ反転処理)を行ない、さらに、窓関数処理を行なった画像とを比較して補正判定を行う。このように、判定部200が、実際に補正処理を行なった画像を用いて補正判定を行なうことで、画像処理装置100Aは、窓関数起因のノイズが現れるか否かを、より確実に突き止めることが可能になる。これにより、画像処理装置100Aは、照合部230によるテンプレートマッチング処理の精度をさらに向上することができる。   Regarding the correction determination process in the specific example 6, the determination unit 200 performs a correction process (that is, a negative / positive inversion process) on the image obtained by performing the window function process on the determination image, and the window function. The correction is determined by comparing the processed image. As described above, when the determination unit 200 performs correction determination using an image that has actually been subjected to correction processing, the image processing apparatus 100A can more reliably determine whether noise due to the window function appears. Is possible. Accordingly, the image processing apparatus 100A can further improve the accuracy of the template matching process performed by the collation unit 230.

より具体的な処理手順としては、図18に示されるように、ステップS630において、判定部200は、判定画像36に対してネガポジ反転処理を行って反転画像40(図19参照)を取得する。ステップS632において、判定部200は、判定画像36と、反転画像40との各々について窓関数処理を行ない、窓関数画像38と、反転窓関数画像42とを作成する。   As a more specific processing procedure, as shown in FIG. 18, in step S <b> 630, the determination unit 200 performs a negative / positive reversal process on the determination image 36 to obtain a reversed image 40 (see FIG. 19). In step S632, the determination unit 200 performs window function processing on each of the determination image 36 and the inverted image 40, and creates a window function image 38 and an inverted window function image 42.

ステップS634において、判定部200は、窓関数画像38と反転窓関数画像42と用いて、画素値のばらつきに応じた統計値を算出する。当該統計値とは、たとえば、窓関数画像38と反転窓関数画像42との各々についての周波数空間での信号強度の最大値と最小値との差を含む。あるいは、当該統計値は、窓関数画像38と反転窓関数画像42との各々について画素値の分散値であってもよい。あるいは、当該統計値は、画素値が所定の範囲にある画素の数であってもよい。   In step S634, the determination unit 200 uses the window function image 38 and the inverted window function image 42 to calculate a statistical value corresponding to the variation in pixel values. The statistical value includes, for example, the difference between the maximum value and the minimum value of the signal strength in the frequency space for each of the window function image 38 and the inverted window function image 42. Alternatively, the statistical value may be a variance value of pixel values for each of the window function image 38 and the inverted window function image 42. Alternatively, the statistical value may be the number of pixels whose pixel values are within a predetermined range.

ステップS520において、判定部200は、窓関数画像38と反転窓関数画像42の各々から算出した統計値を比較する。すなわち、判定部200は、以下の式(10)を満たすか否かを判定する。   In step S520, the determination unit 200 compares the statistical values calculated from each of the window function image 38 and the inverted window function image 42. That is, the determination unit 200 determines whether or not the following formula (10) is satisfied.

(窓関数画像における統計値)−(反転窓関数画像における統計値)≧閾値・・・式(10)
たとえば、窓関数画像38の各画素の画素値が所定の範囲(100〜156)にある画素数が150であり、反転窓関数画像42の各画素の画素値が所定の範囲(100〜156)にある画素数が20であり、閾値が50の場合には、以下の式(11)のようになる。この場合、上記式(10)が満たされるので判定部200は、補正が必要であると判定する。
(Statistical value in window function image) − (Statistical value in inverted window function image) ≧ threshold value (10)
For example, the pixel number of each pixel of the window function image 38 is 150 within a predetermined range (100 to 156), and the pixel value of each pixel of the inverted window function image 42 is within a predetermined range (100 to 156). When the number of pixels in is 20 and the threshold is 50, the following equation (11) is obtained. In this case, since the formula (10) is satisfied, the determination unit 200 determines that correction is necessary.

150−20≧50・・・式(11)
ステップS520において、判定部200は、窓関数画像38および反転窓関数画像42の各々から算出した各統計値を用いて、入力画像およびテンプレート画像に対する補正が必要であるか否かを判定する。典型的には、判定部200は、統計値が上記式(10)を満たした場合に、補正が必要であると判定する。判定部200は、補正が必要であると判定した場合には(ステップS520においてYES)、制御をステップS522に切り替える。そうでない場合には(ステップS520においてNO)、判定部200は、制御をステップS524に切り替える。
150-20 ≧ 50 Formula (11)
In step S520, the determination unit 200 determines whether correction for the input image and the template image is necessary using each statistical value calculated from each of the window function image 38 and the inverted window function image 42. Typically, the determination unit 200 determines that correction is necessary when the statistical value satisfies the above equation (10). When determining unit 200 determines that correction is necessary (YES in step S520), control is switched to step S522. Otherwise (NO in step S520), determination unit 200 switches control to step S524.

(判定部200の処理の具体例7)
以下では、図20を参照して、判定部200の処理のさらに他の例について説明する。図20は、画像処理装置100Aの機能構成の一例を示すブロック図である。
(Specific example 7 of processing of determination unit 200)
Hereinafter, still another example of the process of the determination unit 200 will be described with reference to FIG. FIG. 20 is a block diagram illustrating an example of a functional configuration of the image processing apparatus 100A.

判定部200は、図8に示されるように、テンプレート画像だけでなく、図20に示されるように、入力画像も判定画像として用いることができる。判定部200は、入力画像を判定画像として用いても、上記の具体例1〜6と同様の効果を得ることができる。   The determination unit 200 can use not only a template image as shown in FIG. 8 but also an input image as a determination image as shown in FIG. The determination unit 200 can obtain the same effects as those of the first to sixth specific examples even when the input image is used as the determination image.

(判定部200の処理の具体例8)
以下では、図21および図22を参照して、判定部200の処理のさらに他の例について説明する。図21は、画像処理装置100Aの機能構成の一例を示すブロック図である。図22は、具体例8に従う判定部200の処理の一例を示すフローチャートである。
(Specific example 8 of processing of determination unit 200)
Hereinafter, still another example of the process of the determination unit 200 will be described with reference to FIGS. 21 and 22. FIG. 21 is a block diagram illustrating an example of a functional configuration of the image processing apparatus 100A. FIG. 22 is a flowchart illustrating an example of processing of the determination unit 200 according to the eighth specific example.

図21に示されるように、判定部200は、入力画像およびテンプレート画像のいずれを判定画像として用いるかを選択してもよい。判定部200が補正判定に適した画像を選択することで、画像処理装置100Aは、窓関数起因のノイズが現れるか否かを、さらに確実に突き止めることが可能になる。これにより、画像処理装置100Aは、照合部230によるテンプレートマッチング処理の精度をさらに向上することができる。   As illustrated in FIG. 21, the determination unit 200 may select which of the input image and the template image is used as the determination image. When the determination unit 200 selects an image suitable for correction determination, the image processing apparatus 100A can more reliably determine whether noise due to the window function appears. Accordingly, the image processing apparatus 100A can further improve the accuracy of the template matching process performed by the collation unit 230.

より具体的な処理手順としては、図22に示されるように、ステップS600において、判定部200は、上記具体例1〜7のいずれかの方法を用いて、入力画像およびテンプレート画像の各々について統計値を算出する。たとえば、判定部200は、具体例2のように、入力画像について、非ワーク領域における画素値の平均から、ワーク領域における画素値の平均を引いた値を統計値として算出する。また、判定部200は、テンプレート画像についても同様の方法で統計値を算出する。   As a more specific processing procedure, as shown in FIG. 22, in step S600, the determination unit 200 uses the method of any one of the above specific examples 1 to 7 for each of the input image and the template image. Calculate the value. For example, as in the second specific example, the determination unit 200 calculates a value obtained by subtracting the average of the pixel values in the work area from the average of the pixel values in the non-work area for the input image. The determination unit 200 calculates a statistical value for the template image in the same manner.

ステップS640において、判定部200は、算出した、入力画像における統計値と、テンプレート画像における統計値とを比較する。典型的には、判定部200は、入力画像およびテンプレート画像のうち、統計値が大きい方を補正判定に用いる判定画像として決定する。たとえば、テンプレート画像に対するワーク領域と非ワーク領域との各々の領域における画素値の平均値の差分値(統計値)が60であり、入力画像に対するワーク領域と非ワーク領域との各々の領域における画素値の平均値の差分値が190(統計値)の場合、入力画像の統計値の方がテンプレート画像の統計値よりも大きいので、判定部は入力画像を判定画像として用いる。   In step S640, the determination unit 200 compares the calculated statistical value in the input image with the statistical value in the template image. Typically, the determination unit 200 determines the input image and the template image having a larger statistical value as a determination image used for correction determination. For example, the difference value (statistical value) of the average value of the pixel values in each of the work area and the non-work area for the template image is 60, and the pixels in each of the work area and the non-work area for the input image When the difference value of the average value of the values is 190 (statistical value), the determination unit uses the input image as the determination image because the statistical value of the input image is larger than the statistical value of the template image.

(判定部200の処理の具体例9)
以下では、図23を参照して、判定部200の処理のさらに他の例について説明する。図23は、具体例9に従う判定部200の処理の一例を示すフローチャートである。
(Specific example 9 of processing of determination unit 200)
Hereinafter, still another example of the process of the determination unit 200 will be described with reference to FIG. FIG. 23 is a flowchart illustrating an example of processing of the determination unit 200 according to the ninth specific example.

図23に示されるように、判定部200は、入力画像およびテンプレート画像の両方に対する補正判定の結果を用いて補正判定を行なってもよい。これにより、画像処理装置100Aは、窓関数起因のノイズが現れるか否かを、さらに確実に突き止めることが可能になる。これにより、画像処理装置100Aは、照合部230によるテンプレートマッチング処理の精度をさらに向上することができる。   As illustrated in FIG. 23, the determination unit 200 may perform correction determination using the correction determination result for both the input image and the template image. As a result, the image processing apparatus 100A can more reliably determine whether or not noise due to the window function appears. Accordingly, the image processing apparatus 100A can further improve the accuracy of the template matching process performed by the collation unit 230.

より具体的な処理手順としては、図23に示されるように、ステップS650において、判定部200は、上記具体例1〜7のいずれかの方法を用いて、入力画像について補正を行なうべきか否かを示した判定結果を得る。同様に、判定部200は、テンプレート画像についても補正を行なうべきか否かを示した判定結果を得る。   As a more specific processing procedure, as shown in FIG. 23, in step S650, the determination unit 200 should use the method in any one of the specific examples 1 to 7 to correct an input image. A determination result indicating that is obtained. Similarly, the determination unit 200 obtains a determination result indicating whether or not the template image should be corrected.

ステップS652において、判定部200は、入力画像およびテンプレート画像に対する判定結果のいずれかにおいて補正が必要であると示された場合には、補正部210は、入力画像およびテンプレート画像に対して補正処理を実行する。また、判定部200は、入力画像およびテンプレート画像に対する判定結果の両方で補正が不要であると示された場合には、補正部210は、入力画像およびテンプレート画像に対して補正処理を実行しない。   In step S652, if the determination unit 200 indicates that correction is necessary in any of the determination results for the input image and the template image, the correction unit 210 performs a correction process on the input image and the template image. Run. In addition, when the determination unit 200 indicates that correction is unnecessary in both the determination result for the input image and the template image, the correction unit 210 does not perform the correction process on the input image and the template image.

[利点]
以上のようにして、本実施の形態に従う画像処理装置100Aは、入力画像およびテンプレート画像を用いて補正判定処理を行なうことで、比較的容易な処理で、補正処理が必要か否かを容易に判定できる。また、画像処理装置100Aは、反転画像を用いて補正判定を行なう場合には、入力画像およびテンプレート画像のネガポジ反転処理前後の画像における画素値から算出される統計値の変化幅を比較できるようになるため、補正が必要であるか否かを容易に判定できる。
[advantage]
As described above, image processing apparatus 100A according to the present embodiment performs correction determination processing using an input image and a template image, thereby easily determining whether correction processing is necessary or not with relatively easy processing. Can be judged. In addition, when performing correction determination using an inverted image, the image processing apparatus 100A can compare the change width of the statistical value calculated from the pixel values in the images before and after the negative / positive inversion processing of the input image and the template image. Therefore, it can be easily determined whether or not correction is necessary.

さらに、画像処理装置100Aは、判定画像をワーク領域と非ワーク領域に分割して補正判定を行なう場合には、ワーク領域と非ワーク領域で算出した画素の統計値を比較するという簡単な処理で補正判定を行なうことができる。これにより、画像処理装置100Aは、処理時間がそれほど増加させずに、テンプレートマッチング処理の精度を向上させることが可能になる。   Furthermore, when dividing the determination image into a work area and a non-work area and performing correction determination, the image processing apparatus 100A performs a simple process of comparing the statistical values of pixels calculated in the work area and the non-work area. Correction determination can be made. As a result, the image processing apparatus 100A can improve the accuracy of the template matching process without significantly increasing the processing time.

さらに、画像処理装置100Aは、判定画像をワーク領域および非ワーク領域のいずれか一方の統計値を用いて補正判定を行なう場合であっても、判定画像における画素値のうち、窓関数の影響により画素値の変動幅が大きくなる画素がどの程度含まれているかを算出することができる。これにより、ワーク領域および非ワーク領域の両方を用いた場合に比べて、処理時間を短縮して判定処理を行なうことが可能になる。   Furthermore, even when the image processing apparatus 100A performs correction determination on the determination image using one of the statistical values of the work area and the non-work area, due to the influence of the window function among the pixel values in the determination image. It is possible to calculate how many pixels in which the fluctuation range of the pixel value is large are included. This makes it possible to perform the determination process with a shorter processing time than when both the work area and the non-work area are used.

さらに、画像処理装置100Aは、判定画像と窓関数画像とを判定に用いることで、窓関数処理前後の画像における画素値から算出される統計値の変化幅を確認することができるため、より確実な補正判定結果を得ることができる。   Furthermore, the image processing apparatus 100A can confirm the change width of the statistical value calculated from the pixel values in the images before and after the window function processing by using the determination image and the window function image for the determination. Correction correction results can be obtained.

さらに、画像処理装置100Aは、判定画像と窓関数画像との差分画像を用いることで、窓関数処理を行う前後の差分画像における画素値から算出される統計値の変化幅を確認することが出来るため、より確実な判定結果を得ることができる。   Furthermore, the image processing apparatus 100A can confirm the change width of the statistical value calculated from the pixel value in the difference image before and after performing the window function processing by using the difference image between the determination image and the window function image. Therefore, a more reliable determination result can be obtained.

さらに、画像処理装置100Aは、窓関数画像と反転窓関数画像とを用いて算出した統計値を用いることで、窓関数画像および反転窓関数画像のうち、窓関数の影響が発生しない画像を選択することができる。これにより、画像処理装置100Aは、より確実な判定結果を得ることができる。   Further, the image processing apparatus 100A uses the statistical value calculated using the window function image and the inverted window function image to select an image in which the influence of the window function does not occur among the window function image and the inverted window function image. can do. Thereby, the image processing apparatus 100A can obtain a more reliable determination result.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

1 ROM、2 CPU、3 RAM、4 カメラI/F、5 メモリーカードI/F、5A メモリーカード、6 ネットワークI/F、6A アンテナ、20 記憶装置、22 画像処理プログラム、24 入力画像、26 テンプレート画像、30A,30B,34A,34B 画像、32 窓関数、36 判定画像、38 窓関数画像、40 反転画像、42 反転窓関数画像、50 画像処理システム、100,100A 画像処理装置、110 カメラ、112 製造装置、114 搬送機構、116 ワーク、118,130 マウス、120 表示装置、200 判定部、210 補正部、220 窓関数処理部、230 照合部、231A,231B フーリエ変換部、232A,232B 対数化処理部、233A,233B 極座標変換部、234,236 POC処理部、235 回転量補正部。   1 ROM, 2 CPU, 3 RAM, 4 camera I / F, 5 memory card I / F, 5A memory card, 6 network I / F, 6A antenna, 20 storage device, 22 image processing program, 24 input image, 26 template Image, 30A, 30B, 34A, 34B image, 32 window function, 36 judgment image, 38 window function image, 40 inverted image, 42 inverted window function image, 50 image processing system, 100, 100A image processing apparatus, 110 camera, 112 Manufacturing device, 114 transport mechanism, 116 workpieces, 118, 130 mouse, 120 display device, 200 determination unit, 210 correction unit, 220 window function processing unit, 230 collation unit, 231A, 231B Fourier transform unit, 232A, 232B logarithmic processing Part, 233A, 233B polar coordinate conversion part, 34,236 POC processor, 235 rotation amount correction section.

Claims (12)

第1の画像と第2の画像との各々に窓関数処理を行うための窓関数処理部と、
前記窓関数処理後の前記第1の画像および前記第2の画像の各々を周波数変換して、周波数変換後の第1の画像および第2の画像をマッチングするための照合部と、
前記第1の画像および前記第2の画像の少なくとも一方に含まれる特徴量に依存して、前記第1の画像および前記第2の画像に対して、前記窓関数処理の前にネガポジ反転処理を選択的に行うための補正部とを備える、画像処理装置。
A window function processing unit for performing window function processing on each of the first image and the second image;
A matching unit for frequency-converting each of the first image and the second image after the window function processing to match the first image and the second image after the frequency conversion;
Depending on a feature amount included in at least one of the first image and the second image, a negative / positive inversion process is performed on the first image and the second image before the window function process. An image processing apparatus comprising: a correction unit for performing selectively.
前記画像処理装置は、前記第1の画像および前記第2の画像の少なくとも一方を判定画像として用いて、前記補正部でのネガポジ反転処理が必要であるか否かを判定するための判定部をさらに備える、請求項1に記載の画像処理装置。   The image processing apparatus includes a determination unit for determining whether or not a negative / positive inversion process in the correction unit is necessary, using at least one of the first image and the second image as a determination image. The image processing apparatus according to claim 1, further comprising: 前記判定画像は、検査対象となる対象物を含まない、前記判定画像内の非対象物領域を含み、
前記判定部は、前記非対象物領域における画素値を前記特徴量の抽出に用いる、請求項2に記載の画像処理装置。
The determination image does not include an object to be inspected, includes a non-object area in the determination image,
The image processing apparatus according to claim 2, wherein the determination unit uses a pixel value in the non-object region for extracting the feature amount.
前記特徴量は、画像領域内の各画素の大きさに応じる統計値を含み、
前記判定部は、前記非対象物領域における前記統計値が所定値よりも大きい場合に前記ネガポジ反転処理が必要であると判定する、請求項3に記載の画像処理装置。
The feature amount includes a statistical value corresponding to the size of each pixel in the image region,
The image processing apparatus according to claim 3, wherein the determination unit determines that the negative / positive inversion process is necessary when the statistical value in the non-object region is larger than a predetermined value.
前記統計値は、前記非対象物領域における各画素値の、平均値と、中央値と、最頻値と、前記非対象物領域における画素数に対する、所定の値以上を有する画素の数の割合とのうちの少なくとも1つを含む、請求項4に記載の画像処理装置。   The statistical value is an average value, a median value, a mode value of each pixel value in the non-object region, and a ratio of the number of pixels having a predetermined value or more to the number of pixels in the non-object region. The image processing apparatus according to claim 4, comprising at least one of: 前記判定画像は、検査対象となる対象物を含む、前記判定画像内の対象物領域をさらに含み、
前記判定部は、前記対象物領域における各画素値と、前非対象物領域における各画素値とを前記特徴量の抽出に用いる、請求項3〜5のいずれか1項に記載の画像処理装置。
The determination image further includes an object region in the determination image including an object to be inspected,
The image processing device according to claim 3, wherein the determination unit uses each pixel value in the object region and each pixel value in a previous non-object region for extraction of the feature amount. .
前記判定部は、前記判定画像と、当該判定画像に対して前記窓関数処理を行なった画像とを比較して、前記ネガポジ反転処理が必要であるか否かを判定する、請求項2〜6のいずれか1項に記載の画像処理装置。   The determination unit compares the determination image with an image obtained by performing the window function process on the determination image, and determines whether the negative / positive inversion process is necessary. The image processing apparatus according to any one of the above. 前記特徴量は、前記判定画像と、当該判定画像に対して前記窓関数処理を行なった画像との類似性を示した統計値を含み、
前記判定部は、前記統計値が所定の値よりも小さい場合に、前記ネガポジ反転処理が必要であると判定する、請求項7に記載の画像処理装置。
The feature amount includes a statistical value indicating similarity between the determination image and an image obtained by performing the window function processing on the determination image,
The image processing apparatus according to claim 7, wherein the determination unit determines that the negative / positive inversion process is necessary when the statistical value is smaller than a predetermined value.
前記判定部は、前記判定画像に対して前記窓関数処理を行なった画像と、前記判定画像に対して前記ネガポジ反転処理を行ない、さらに、前記窓関数処理を行なって得られた画像とを比較して、前記ネガポジ反転処理が必要であるか否かを判定する、請求項2〜8のいずれか1項に記載の画像処理装置。   The determination unit compares the image obtained by performing the window function processing on the determination image with the image obtained by performing the negative / positive inversion processing on the determination image and further performing the window function processing. The image processing apparatus according to claim 2, wherein it is determined whether the negative / positive inversion process is necessary. 前記判定画像は、前記第1の画像と、前記第2の画像とに加えて、前記第1の画像をネガポジ反転した画像と、前記第2の画像をネガポジ反転した画像とのうちから選択される、請求項2に記載の画像処理装置。   In addition to the first image and the second image, the determination image is selected from an image obtained by negative-positive reversal of the first image and an image obtained by negative-positive reversal of the second image. The image processing apparatus according to claim 2. 第1の画像と第2の画像との各々に窓関数処理を行うステップと、
前記窓関数処理後の前記第1の画像および前記第2の画像の各々を周波数変換して、周波数変換後の第1の画像および第2の画像をマッチングするステップと、
前記第1の画像および前記第2の画像の少なくとも一方に含まれる特徴量に依存して、前記第1の画像および前記第2の画像に対して、前記窓関数処理の前にネガポジ反転処理を選択的に行うステップとを備える、画像処理方法。
Performing window function processing on each of the first image and the second image;
Frequency-converting each of the first image and the second image after the window function processing, and matching the first image and the second image after the frequency conversion;
Depending on a feature amount included in at least one of the first image and the second image, a negative / positive inversion process is performed on the first image and the second image before the window function process. And an image processing method.
画像処理プログラムであって、
前記画像処理プログラムは、コンピュータに、
第1の画像と第2の画像との各々に窓関数処理を行うステップと、
前記窓関数処理後の前記第1の画像および前記第2の画像の各々を周波数変換して、周波数変換後の第1の画像および第2の画像をマッチングするステップと、
前記第1の画像および前記第2の画像の少なくとも一方に含まれる特徴量に依存して、前記第1の画像および前記第2の画像に対して、前記窓関数処理の前にネガポジ反転処理を選択的に行うステップとを実行させる、画像処理プログラム。
An image processing program,
The image processing program is stored in a computer.
Performing window function processing on each of the first image and the second image;
Frequency-converting each of the first image and the second image after the window function processing, and matching the first image and the second image after the frequency conversion;
Depending on a feature amount included in at least one of the first image and the second image, a negative / positive inversion process is performed on the first image and the second image before the window function process. An image processing program for executing the step of selectively performing.
JP2014053367A 2014-03-17 2014-03-17 Image processing apparatus, image processing method, and image processing program Expired - Fee Related JP6217479B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014053367A JP6217479B2 (en) 2014-03-17 2014-03-17 Image processing apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014053367A JP6217479B2 (en) 2014-03-17 2014-03-17 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2015176433A true JP2015176433A (en) 2015-10-05
JP6217479B2 JP6217479B2 (en) 2017-10-25

Family

ID=54255556

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014053367A Expired - Fee Related JP6217479B2 (en) 2014-03-17 2014-03-17 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP6217479B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020110309A1 (en) * 2018-11-30 2020-06-04 日本電気株式会社 Image collation device, image collation method, and program
US11088552B2 (en) 2016-11-03 2021-08-10 Huawei Technologies Co., Ltd. Charging method, terminal, and charging adapter

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008225764A (en) * 2007-03-12 2008-09-25 Nec Corp Device, method, and program for removing character noise

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008225764A (en) * 2007-03-12 2008-09-25 Nec Corp Device, method, and program for removing character noise

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佐々木慶文 外4名: "位相限定相関法に基づく高精度レジストレーション", 電子情報通信学会技術研究報告 IE2002−1〜10 画像工学, vol. 第102巻 第15号, JPN6017031919, 11 April 2002 (2002-04-11), pages 49 - 54, ISSN: 0003626103 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11088552B2 (en) 2016-11-03 2021-08-10 Huawei Technologies Co., Ltd. Charging method, terminal, and charging adapter
WO2020110309A1 (en) * 2018-11-30 2020-06-04 日本電気株式会社 Image collation device, image collation method, and program
JPWO2020110309A1 (en) * 2018-11-30 2021-09-27 日本電気株式会社 Image matching device, image matching method, program
JP7081685B2 (en) 2018-11-30 2022-06-07 日本電気株式会社 Image collation device, image collation method, program
US11748863B2 (en) 2018-11-30 2023-09-05 Nec Corporation Image matching apparatus, image matching method, and program

Also Published As

Publication number Publication date
JP6217479B2 (en) 2017-10-25

Similar Documents

Publication Publication Date Title
CN109035304B (en) Target tracking method, medium, computing device and apparatus
EP3050290B1 (en) Method and apparatus for video anti-shaking
JP5699788B2 (en) Screen area detection method and system
WO2016144431A1 (en) Systems and methods for object tracking
WO2016032735A1 (en) Systems and methods for determining a seam
EP3182067A1 (en) Method and apparatus for determining spacecraft attitude by tracking stars
CN107992790B (en) Target long-time tracking method and system, storage medium and electronic terminal
US8249387B2 (en) Image processing method and apparatus for detecting lines of images and start and end points of lines
TWI394097B (en) Detecting method and system for moving object
US9077926B2 (en) Image processing method and image processing apparatus
JP6217479B2 (en) Image processing apparatus, image processing method, and image processing program
US20150058579A1 (en) Systems and methods for memory utilization for object detection
JP6507843B2 (en) Image analysis method and image analysis apparatus
JP6558073B2 (en) Moving target detection method and moving target detection apparatus
CN112330618B (en) Image offset detection method, device and storage medium
CN109255797B (en) Image processing device and method, and electronic device
JP2015069410A (en) Attitude parameter estimation device, system, method and program
JP6163868B2 (en) Image processing method, image processing apparatus, and image processing program
CN105049706A (en) Image processing method and terminal
JP6388507B2 (en) Image processing device
CN112884803A (en) Real-time intelligent monitoring target detection method and device based on DSP
JP2009302731A (en) Image processing apparatus, image processing program, image processing method, and electronic device
US20140212050A1 (en) Systems and methods for processing an image
JP6716769B1 (en) Image inspection method, image inspection apparatus, and image inspection program
CN113033551A (en) Object detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170817

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170911

R150 Certificate of patent or registration of utility model

Ref document number: 6217479

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees