JP2005339389A - Picture processing method and picture processor - Google Patents

Picture processing method and picture processor Download PDF

Info

Publication number
JP2005339389A
JP2005339389A JP2004160025A JP2004160025A JP2005339389A JP 2005339389 A JP2005339389 A JP 2005339389A JP 2004160025 A JP2004160025 A JP 2004160025A JP 2004160025 A JP2004160025 A JP 2004160025A JP 2005339389 A JP2005339389 A JP 2005339389A
Authority
JP
Japan
Prior art keywords
image
template
determination
correlation value
respect
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2004160025A
Other languages
Japanese (ja)
Inventor
Atsuyuki Hirono
淳之 広野
Satoshi Furukawa
聡 古川
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP2004160025A priority Critical patent/JP2005339389A/en
Publication of JP2005339389A publication Critical patent/JP2005339389A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a picture processing method and a picture processor, with which existence of an object can surely be detected by a simple processing even if a gray scale picture including the object is image-picked up in a state where an illumination condition is nonuniform. <P>SOLUTION: A holding means 3 previously obtains the gray scale picture including the object of judgment and holds a template picture created by extracting a region including a feature of the object from the gray scale picture. A judging means 4 performs a correlation value operation of the gray scale picture for judgment, which is inputted from an A/D conversion means 2, and the template picture, and judges existence of the object in the gray scale picture for judgment from an operation result. When a shape of the object is almost symmetrical with a symmetrical element, the judging means 4 creates the gray scale picture which is almost symmetrical with the symmetrical element based on a reversed picture obtained by rotating the picture to a symmetrical position with the symmetrical element as a center and on the picture before reverse, and performs the correlation value operation by using the gray scale picture in a process for obtaining at least the template picture or the gray scale picture for judgment. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、テンプレートマッチングを利用して入力濃淡画像中における対象物の存否を判定する画像処理方法並びに画像処理装置に関するものである。   The present invention relates to an image processing method and an image processing apparatus for determining the presence or absence of an object in an input grayscale image using template matching.

従来より、テンプレートマッチングを利用して入力濃淡画像中における対象物の存否を判定する画像処理方法並びに画像処理装置が様々な分野で利用されている(特許文献1参照)。一般的なテンプレートマッチングにおいては、テンプレート画像と入力濃淡画像の各画素毎の濃度値I(i,j)、T(i,j)から、下記の(式1)で示す残差Rや(式2)で示す相互相関係数C(これらを総称して「相関値」と呼ぶ)を求め、該相関値から両画像の一致度を判定している。   Conventionally, an image processing method and an image processing apparatus for determining the presence or absence of an object in an input grayscale image using template matching have been used in various fields (see Patent Document 1). In general template matching, from the density values I (i, j) and T (i, j) for each pixel of the template image and the input grayscale image, the residual R and (formula 1) shown below (formula 1) The cross-correlation coefficient C shown in 2) (collectively referred to as “correlation value”) is obtained, and the degree of coincidence between both images is determined from the correlation value.

ところで、近年では上述のようなテンプレートマッチングを利用して個人認証を行う方法や装置がセキュリティ分野で用いられている。例えば、図7(a)に示すように入室が許可された人物の顔の濃淡画像(以下、単に「顔画像」と呼ぶ)を予めテンプレート画像TPとして登録しておき、入室を希望する希望者の顔画像Vが入力されると、図7(b)に示すようにテンプレート画像TPと顔画像Vとのパターンマッチングを行って相関値を演算し、その相関値に基づいて当該希望者が入出を許可されている人物と一致しているか否かを判定するものである。
特開平11−284997号公報
Incidentally, in recent years, methods and apparatuses for performing personal authentication using template matching as described above have been used in the security field. For example, as shown in FIG. 7A, a grayscale image (hereinafter simply referred to as “face image”) of a person who is permitted to enter a room is registered in advance as a template image TP, and a person who wishes to enter the room. When the face image V is input, the template image TP and the face image V are subjected to pattern matching to calculate a correlation value as shown in FIG. 7B, and the desired person enters and exits based on the correlation value. It is determined whether or not it matches with the person who is permitted.
JP-A-11-284997

しかしながら、濃淡画像をそのまま用いてテンプレートマッチングを行うと、テンプレート画像TPを作成するための濃淡画像を撮像したときと、判定用の入力濃淡画像を撮像したときとで、局所的なスポット光の照射や照明状況の不均一な変化が顔画像の濃度値に加わって、正確なパターンマッチングを行い難くなる。   However, if template matching is performed using the grayscale image as it is, local spot light irradiation is performed when the grayscale image for creating the template image TP is captured and when the input grayscale image for determination is captured. And non-uniform changes in lighting conditions are added to the density value of the face image, making accurate pattern matching difficult.

例えば、図8(a)に示すように判定対象である人物の顔に照明光が均一に照射されている場合は、人物の顔画像Vが鼻を通る顔の中心線(対称軸)Lに対して線対称な画像となっているが、同図(b)に示すように人物の顔に局所的なスポット光が照射されたり、照明状況が不均一になると、この時の顔画像V’の濃淡分布が顔の対称軸Lに対して非対称になるため、判定対象の顔の特徴が失われてしまう。したがって、このような顔画像V’とテンプレート画像TPとを比較したとしても、対象物の存否を正確に判断することができなかった。   For example, as shown in FIG. 8A, when the illumination light is uniformly applied to the face of the person to be determined, the face image V of the person is placed on the center line (symmetric axis) L of the face passing through the nose. The image is axisymmetric with respect to the image, but as shown in FIG. 5B, when a local spot light is irradiated on the face of the person or the lighting condition becomes uneven, the face image V ′ at this time , The characteristics of the face to be determined are lost. Therefore, even if such a face image V ′ is compared with the template image TP, it is impossible to accurately determine whether or not the object exists.

ここで、照射光に偏りがあって、照明状況が不均一な状態とは、顔の片側から強い光を浴びている場合を想定しており、通常、強い光を浴びている側は明るい画像となり、反対側は顔の凹凸などに遮られて照射光が届かない部位が発生するため、暗い画像になる。   Here, the irradiation light is biased and the illumination condition is uneven is assumed to be a case where a strong light is exposed from one side of the face, and usually a side where the strong light is exposed is a bright image. On the other side, a portion where the irradiation light does not reach due to being blocked by the unevenness of the face or the like is generated, so that a dark image is obtained.

このような照明光が不均一に照射されている顔画像をもとに、照明光が均一に照射されている状態の画像を復元する方法としては、照明光の照射されている方向を検出し、対象物の凹凸によって影となっている部分の濃度値を補正する方法があるが(例えば情報処理学会研究報告 2003-CVIM-139、P61「3D物体表面上での見えモデル構築による姿勢と照明の変動に頑強な顔照合」参照)、補正のための計算処理が過大で、高性能のコンピュータを使用する必要があり、また計算処理に長時間を要するため、対象物の存否の判定に時間がかかるという問題があった。   Based on such a face image that is illuminated unevenly, a method for restoring an image that is illuminated uniformly is to detect the direction in which the illumination light is illuminated. Although there is a method of correcting the density value of the shadowed part due to the unevenness of the object (for example, Information Processing Society of Japan 2003-CVIM-139, P61 “Attitude and illumination by the appearance model construction on the 3D object surface Face matching that is robust to fluctuations)), the calculation process for correction is excessive, it is necessary to use a high-performance computer, and the calculation process takes a long time. There was a problem that it took.

本発明は上記問題点に鑑みて為されたものであり、その目的とするところは、照明条件が不均一な状態で対象物を含む入力濃淡画像が撮像された場合でも対象物の存否を簡単な処理で確実に検出できる画像処理方法および画像処理装置を提供することにある。   The present invention has been made in view of the above problems, and its object is to easily determine whether or not an object exists even when an input grayscale image including the object is captured under non-uniform illumination conditions. It is an object to provide an image processing method and an image processing apparatus that can be reliably detected by simple processing.

上記目的を達成するために、請求項1の発明は、判定対象となる対象物を含む濃淡画像を得て、該濃淡画像から対象物の特徴を含む領域を抽出して作成したテンプレート画像を予め保持しておき、対象物を含むか否かを判定するための判定用の濃淡画像を得て、該濃淡画像とテンプレート画像との相関値演算を行い、この演算結果から判定用の濃淡画像中における対象物の存否を判定するにあたり、対象物の形状が対称要素に対して略対称な形状である場合に、テンプレート画像又は判定用の濃淡画像の内少なくとも何れか一方の画像を得る過程において、少なくとも何れか一方の画像が対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて相関値演算を行うことを特徴とする。   In order to achieve the above object, the invention of claim 1 obtains a grayscale image including an object to be determined and extracts a template image created by extracting a region including the characteristics of the object from the grayscale image in advance. A grayscale image for determination for determining whether or not the object is included is obtained, and a correlation value calculation is performed between the grayscale image and the template image. In the process of obtaining at least one of the template image and the grayscale image for determination when the shape of the target object is substantially symmetric with respect to the symmetry element in determining whether or not the target object exists in Correction processing is performed so that at least one of the images becomes a gray image that is substantially symmetric with respect to the symmetry element, and a correlation value calculation is performed using the gray image after correction.

請求項2の発明は、請求項1の発明において、補正処理が、少なくとも何れか一方の画像において、対称要素に対して略対称な位置にある2つの画素の濃度平均値を求め、この濃度平均値を2つの画素の濃度値とする処理であることを特徴とする。   According to a second aspect of the present invention, in the first aspect of the present invention, the correction processing obtains a density average value of two pixels at substantially symmetrical positions with respect to a symmetric element in at least one of the images, and this density average The process is characterized in that the value is a density value of two pixels.

請求項3の発明は、請求項1の発明において、均一な照明条件下で対象物を撮像して得た濃淡画像において各画素の濃度値の統計計算を行って得た基準値を予め求めておき、補正処理が、少なくとも何れか一方の画像において、対称要素に対して略対称な2つの領域で統計計算を行い、統計計算の結果が基準値に近い方の領域の各画素の濃度値で、他方の領域の各画素の濃度値を置きかえる処理であることを特徴とする。   According to a third aspect of the present invention, in the first aspect of the invention, a reference value obtained by performing statistical calculation of the density value of each pixel in a grayscale image obtained by imaging an object under uniform illumination conditions is obtained in advance. In addition, the correction processing performs statistical calculation in two regions that are substantially symmetrical with respect to the symmetric element in at least one of the images, and the result of the statistical calculation is the density value of each pixel in the region closer to the reference value. The processing is to replace the density value of each pixel in the other region.

請求項4の発明は、請求項1〜3の何れか1つの発明において、判定用の濃淡画像中をテンプレート画像で走査して、テンプレート画像と最も相関値の高い相似領域を求め、相似領域で判定用の濃淡画像からテンプレート画像に相当する大きさの画像を切り出して、切り出された画像を対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像とテンプレート画像とで相関値演算を行って演算結果をもとに対象物の存否を判定することを特徴とする。   According to a fourth aspect of the present invention, in the invention according to any one of the first to third aspects, the determination image is scanned with the template image to obtain a similarity region having the highest correlation value with the template image. An image having a size corresponding to the template image is cut out from the gray image for determination, and the cut image is corrected so as to become a gray image that is substantially symmetrical with respect to the symmetric element. Then, a correlation value calculation is performed, and the existence of an object is determined based on the calculation result.

請求項5の発明は、請求項1〜4の何れか1つの発明において、テンプレート画像は、濃淡画像から対象物の特徴を含む領域を抽出した画像が、対称要素に対して略対称な濃淡画像となるように補正して得られた画像であることを特徴とする。   According to a fifth aspect of the present invention, in the invention according to any one of the first to fourth aspects, the template image is a grayscale image in which an image obtained by extracting a region including the characteristics of an object from a grayscale image is substantially symmetrical with respect to a symmetric element. It is an image obtained by correcting so that

請求項6の発明は、請求項1〜5の何れか1つの発明において、判定用の濃淡画像中をテンプレート画像で走査して、テンプレート画像と最も相関値の高い第1相似領域を求め、この第1相似領域で相関値演算を行う処理と、第1相似領域で判定用の濃淡画像からテンプレート画像に相当する大きさの画像を切り出して、切り出された画像を対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像とテンプレート画像とで相関値演算を行う処理と、テンプレート画像を対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像を新たなテンプレート画像とし、判定用の濃淡画像中を変更後のテンプレート画像で走査して、変更後のテンプレート画像と最も相関値の高い第2相似領域を求め、この第2相似領域で相関値演算を行う処理と、第2相似領域で判定用の濃淡画像から変更後のテンプレート画像に相当する大きさの画像を切り出して、切り出された画像を対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像と変更後のテンプレート画像とで相関値演算を行う処理とを行い、少なくとも何れか1つの相関値演算の結果が所定のしきい値を超えると、対象物が存在すると判断することを特徴とする。   According to a sixth aspect of the present invention, in the invention according to any one of the first to fifth aspects, a grayscale image for determination is scanned with a template image to obtain a first similarity region having the highest correlation value with the template image. A process of performing correlation value calculation in the first similarity region, and an image having a size corresponding to the template image is cut out from the grayscale image for determination in the first similarity region, and the cut-out image is substantially symmetrical with respect to the symmetric element. The correction is performed so that the image becomes a grayscale image, the correlation value is calculated between the corrected grayscale image and the template image, and the template image is corrected so as to become a grayscale image that is substantially symmetrical with respect to the symmetric element. The gray image is used as a new template image, and the inside of the gray image for determination is scanned with the changed template image to obtain a second similar region having the highest correlation value with the changed template image. Processing for performing correlation value calculation in the region, and cutting out an image having a size corresponding to the template image after the change from the grayscale image for determination in the second similar region, and the cut-out image is substantially symmetrical with respect to the symmetric element Correction is performed so as to obtain a grayscale image, and a correlation value calculation is performed on the corrected grayscale image and the modified template image, and the result of at least one correlation value calculation exceeds a predetermined threshold value. And determining that the object is present.

請求項7の発明は、予め判定対象となる対象物を含む濃淡画像を得て、該濃淡画像から対象物の特徴を含む領域を抽出して作成したテンプレート画像を保持する保持手段と、対象物の存否を判定するための判定用の濃淡画像を入力する画像入力手段と、判定用の濃淡画像とテンプレート画像との相関値演算を行い、この演算結果から判定用の濃淡画像中における対象物の存否を判定する判定手段とを備え、対象物の形状が対称要素に対して略対称な形状である場合に、判定手段が、テンプレート画像又は判定用の濃淡画像の内少なくとも何れか一方の画像を得る過程において、該画像が対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて相関値演算を行うことを特徴とする。   The invention according to claim 7 is a holding means for obtaining a grayscale image including a target object to be determined in advance, extracting a region including the characteristics of the target object from the grayscale image, and holding the template image; An image input means for inputting a gray image for determination for determining the presence or absence of the image, and a correlation value calculation between the gray image for determination and the template image are performed, and from the calculation result, the object in the gray image for determination is calculated. Determining means for determining presence / absence, and when the shape of the object is substantially symmetrical with respect to the symmetrical element, the determining means selects at least one of the template image and the gray image for determination. In the obtaining process, correction processing is performed so that the image becomes a gray image that is substantially symmetric with respect to the symmetric element, and correlation value calculation is performed using the gray image after correction.

請求項1の発明によれば、対象物の形状が対称要素に対して略対称な形状であるにも関わらず、照明条件が不均一なために対象物を含むテンプレート画像或いは判定用の濃淡画像が対称要素に対して非対称な画像となって、対象物の特徴が失われている場合でも、テンプレート画像又は判定用の濃淡画像の内少なくとも何れか一方の画像を対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて相関値演算を行っているので、濃淡画像に含まれる対象物の特徴を復元することで、対象物の存否を確実に判定可能な画像処理方法を提供することができる。   According to the first aspect of the present invention, the template image including the object or the grayscale image for determination is provided because the illumination condition is not uniform even though the shape of the object is substantially symmetrical with respect to the symmetry element. Becomes an asymmetric image with respect to the symmetric element, and even if the feature of the object is lost, at least one of the template image and the grayscale image for determination is substantially symmetric with respect to the symmetric element. Since correction processing is performed to obtain a grayscale image, and the correlation value calculation is performed using the corrected grayscale image, the feature of the target object included in the grayscale image is restored to ensure the presence or absence of the target object. An image processing method that can be determined can be provided.

請求項2の発明によれば、少なくとも何れか一方の画像において、対称要素に対して略対称な位置にある2つの画素の濃度平均値を求め、この濃度平均値を2つの画素の濃度値とすることによって、対称要素に対して略対称な濃淡画像を作成しているので、簡単な処理で対称要素に対して略対称な画像を作成可能な画像処理方法を提供することができる。   According to the second aspect of the present invention, in at least one of the images, the average density value of two pixels located substantially symmetrically with respect to the symmetrical element is obtained, and the average density value is obtained as the density value of the two pixels. By doing so, since a gray image that is substantially symmetric with respect to the symmetric element is created, it is possible to provide an image processing method capable of creating a substantially symmetric image with respect to the symmetric element with a simple process.

請求項3の発明によれば、均一な照明条件下で対象物を撮像して得た濃淡画像中の任意の比較領域において各画素の濃度値の統計計算を行って得た基準値を予め求めておき、少なくとも何れか一方の画像において、対称要素に対して略対称な2つの領域で統計計算を行い、統計計算の結果が基準値に近い方の領域の各画素の濃度値で、他方の領域の各画素の濃度値を置きかえることによって、対称要素に対して略対称な濃淡画像を作成しているので、簡単な処理で対称要素に対して略対称な画像を作成可能な画像処理方法を提供することができる。   According to the invention of claim 3, a reference value obtained by performing statistical calculation of the density value of each pixel in an arbitrary comparison region in a grayscale image obtained by imaging an object under uniform illumination conditions is obtained in advance. In at least one of the images, statistical calculation is performed in two regions that are substantially symmetric with respect to the symmetric element, and the result of the statistical calculation is the density value of each pixel in the region closer to the reference value. By replacing the density value of each pixel in the region, a gray image that is substantially symmetric with respect to the symmetric element is created. Therefore, an image processing method that can create a substantially symmetric image with respect to the symmetric element with simple processing. Can be provided.

請求項4の発明によれば、判定用の濃淡画像中をテンプレート画像で走査して、最も相関値の高い相似領域を求め、この相似領域の画像を対称要素に対して略対称な濃淡画像に補正して、補正後の濃淡画像とテンプレート画像とで相関値演算を行って、その演算結果をもとに対象物の存否を判定しているので、判定用の濃淡画像を撮像した時の照明条件が不均一であっても、対象物の存否を確実に判定可能な画像処理方法を提供することができる。   According to the fourth aspect of the present invention, the density image for determination is scanned with the template image to obtain a similar region having the highest correlation value, and the image in the similar region is converted into a gray image that is substantially symmetric with respect to the symmetric element. Since the correlation value is calculated between the corrected gray image and the template image and the presence or absence of the target is determined based on the calculation result, the illumination when the gray image for determination is captured It is possible to provide an image processing method capable of reliably determining the presence or absence of an object even if the conditions are not uniform.

請求項5の発明によれば、テンプレート画像は、濃淡画像から対象物の特徴を含む領域を抽出した画像を、対称要素に対して略対称な濃淡画像となるように補正して得られた画像であり、テンプレート作成用の濃淡画像が不均一な照明条件下で撮像されたために対象物の特徴が損なわれた場合でも、対称要素に対して略対称な濃淡画像となるように補正することで、対象物の特徴を復元することができ、対象物の存否を確実に判定可能な画像処理方法を提供することができる。   According to the invention of claim 5, the template image is an image obtained by correcting an image obtained by extracting a region including the characteristics of the object from the grayscale image so as to become a grayscale image substantially symmetric with respect to the symmetric element. Even if the characteristics of the object are impaired because the gray image for template creation is captured under non-uniform illumination conditions, the gray image for the template is corrected so that it becomes a substantially symmetric gray image with respect to the symmetric element. Thus, it is possible to provide an image processing method that can restore the characteristics of an object and can reliably determine the presence or absence of the object.

請求項6の発明によれば、第1相似領域の濃淡画像とテンプレート画像との相関値演算を行う処理と、第1相似領域の画像を対称要素に対して略対称な濃淡画像となるように補正した画像とテンプレート画像との相関値演算を行う処理と、対称要素に対して略対称な画像となるように補正された補正後のテンプレート画像と第2相似領域の濃淡画像との相関値演算を行う処理と、補正後のテンプレート画像と第2相似領域の画像を対称要素に対して略対称な濃淡画像となるように補正した画像との相関値演算を行う処理とを行い、以上4つの処理の演算結果の内、少なくとも1つの演算結果が所定のしきい値を超えると、対象物が存在すると判断しているので、判定用の濃淡画像あるいはテンプレート画像を撮像した時の照明条件が均一であっても不均一であっても、対象物の存否を確実に判定可能な画像処理方法を提供することができる。   According to the invention of claim 6, the processing for performing the correlation value calculation between the gray image of the first similar region and the template image, and the image of the first similar region so as to become a gray image substantially symmetrical with respect to the symmetric element. Processing for calculating a correlation value between the corrected image and the template image, and calculating a correlation value between the corrected template image corrected to become a substantially symmetric image with respect to the symmetric element and the grayscale image of the second similar region And a process of calculating a correlation value between the corrected template image and the image of the second similar region corrected so as to become a gray image that is substantially symmetric with respect to the symmetric element. Among the calculation results of processing, if at least one calculation result exceeds a predetermined threshold value, it is determined that an object is present, so that the illumination conditions when capturing a grayscale image or template image for determination are uniform. In Also be nonuniform, it is possible to provide a reliably determinable image processing method the presence or absence of the object.

請求項7の発明によれば、対象物の形状が対称要素に対して略対称な形状であるにも関わらず、照明条件が不均一なために対象物を含むテンプレート画像或いは判定用の濃淡画像が対称要素に対して非対称な画像となって、対象物の特徴が失われている場合でも、判定手段が、テンプレート画像又は判定用の濃淡画像の内少なくとも何れか一方の画像を対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて相関値演算を行っているので、濃淡画像に含まれる対象物の特徴を復元することで、対象物の存否を確実に判定可能な画像処理装置を提供することができる。   According to the invention of claim 7, the template image including the object or the gradation image for determination is included because the illumination condition is not uniform although the shape of the object is substantially symmetrical with respect to the symmetry element. Even if the image becomes asymmetric with respect to the symmetric element and the characteristics of the target object are lost, the determination means selects at least one of the template image and the grayscale image for determination with respect to the symmetric element. Therefore, the correlation value calculation is performed using the corrected grayscale image, and the feature of the target object included in the grayscale image is restored. It is possible to provide an image processing apparatus capable of reliably determining the presence or absence.

(実施形態1)
図1は本発明の画像処理方法を実施するための画像処理装置を、認証された人物のみに入室を許可する入室管理装置に適用した一実施形態を示しており、対象物(例えば、人物H)を含めた画像を撮像するCCDカメラのような撮像手段1と、撮像手段1で撮像されたアナログの画像信号をデジタル信号に変換するA/D変換手段2と、予め判定対象となる対象物(例えば、入室が許可されている人物)を含む濃淡画像を得て該濃淡画像から対象物の特徴を含む領域を抽出して作成したテンプレート画像を保持する保持手段3と、A/D変換手段2から入力される判定用の濃淡画像とテンプレート画像との相関値演算を行い、この演算結果から判定用の濃淡画像中における対象物の存否、言い換えれば、撮像された人物Hの顔がテンプレート画像として予め登録された人物の顔に一致するか否かを判定する判定手段4とを備えている。なお、少なくとも保持手段3並びに判定手段4は、例えば汎用のコンピュータに各手段における処理を実行させるためのソフトウェア(プログラム)を搭載して構成される。
(Embodiment 1)
FIG. 1 shows an embodiment in which an image processing apparatus for carrying out the image processing method of the present invention is applied to an entrance management apparatus that permits entry only to an authenticated person. ) Including an image pickup means 1 such as a CCD camera, an A / D conversion means 2 for converting an analog image signal picked up by the image pickup means 1 into a digital signal, and an object to be determined in advance. A holding unit 3 for holding a template image created by obtaining a grayscale image including (for example, a person permitted to enter the room) and extracting a region including the feature of the object from the grayscale image, and an A / D conversion unit 2 is used to calculate a correlation value between the grayscale image for determination input from 2 and the template image, and based on the calculation result, the presence or absence of an object in the grayscale image for determination, in other words, the face of the imaged person H is a template. And a determining means 4 or not it matches the face of pre-registered person as an image. Note that at least the holding unit 3 and the determination unit 4 are configured by mounting software (program) for causing a general-purpose computer to execute processing in each unit, for example.

撮像手段1により対象物を含めた画像が撮像され、撮像手段1で撮像されたアナログの画像信号がA/D変換手段2によりデジタル信号に変換されて判定手段4に入力されると、判定手段4は、A/D変換手段2から入力された判定用の入力濃淡画像と保持手段3に保持されたテンプレート画像との相関値演算を行い、判定対象である人物の顔の一致度を判定する。   When an image including an object is picked up by the image pickup means 1 and an analog image signal picked up by the image pickup means 1 is converted into a digital signal by the A / D conversion means 2 and inputted to the determination means 4, the determination means 4 calculates a correlation value between the input grayscale image for determination input from the A / D conversion means 2 and the template image held in the holding means 3, and determines the degree of coincidence of the face of the person to be determined. .

まず判定手段4は、判定用の入力濃淡画像の初期位置(例えば、画像の左上隅の位置)にテンプレート画像をおき、テンプレート画像の各画素と、これに重なる入力濃淡画像(以下、「部分画像」と呼ぶ)の各画素との間で画素値(濃度値)の差分を求め、この差分の絶対値を相関値aとする。そして、判定手段5は部分画像中の全ての画素について相関値aを求めたら、これらの相関値aの総和を、部分画像に含まれる全ての画素数で除算したものを新たに相関値bと定義する。   First, the determination unit 4 places a template image at the initial position of the input grayscale image for determination (for example, the position of the upper left corner of the image), and each pixel of the template image and the input grayscale image (hereinafter referred to as “partial image”). The difference between the pixel values (density values) is obtained from each pixel of the pixel and the absolute value of the difference is set as the correlation value a. Then, when the determination unit 5 obtains the correlation value a for all the pixels in the partial image, a new value obtained by dividing the sum of the correlation values a by the number of all pixels included in the partial image is newly set as the correlation value b. Define.

このようにして求めた相関値bは一致度が高くなるにつれて値が小さくなり、一致度が低くなるにしたがって値が大きくなる。したがって、判定手段4は、相関値bが所定のしきい値以下であれば、部分画像がテンプレート画像に一致したと判断し、対象の人物Hが予め登録されている人物と一致した旨の判定結果を出力して処理を終了する。また、相関値bが所定のしきい値よりも大きいために部分画像がテンプレート画像に一致しなかった場合、判定手段4はその部分画像の端が入力画像における水平方向の端に一致しているか否か、すなわち、垂直方向における同一位置において水平方向の全ての画素についての上記判定処理が完了しているか否かを判断し、一致していなければ、テンプレート画像を入力画像に対して水平方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う。また、部分画像の端が入力画像における水平方向の端に一致している場合、判定手段4はその部分画像の端が入力画像における垂直方向の端に一致しているか否か、すなわち、水平方向における同一位置において垂直方向の全ての画素についての上記判定処理が完了しているか否かを判断し、一致していなければ、テンプレート画像を入力画像に対して垂直方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う。そして、部分画像の端が入力画像における垂直方向の端に一致している場合、判定手段4は入力画像中にテンプレート画像に一致する画像が存在しなかった、すなわち、対象の人物Hが予め登録されている人物と一致しなかった旨の判定結果を出力して処理を終了する。   The correlation value b obtained in this way decreases as the degree of coincidence increases, and increases as the degree of coincidence decreases. Therefore, if the correlation value b is equal to or smaller than the predetermined threshold value, the determination unit 4 determines that the partial image matches the template image, and determines that the target person H matches the person registered in advance. The result is output and the process is terminated. If the partial image does not match the template image because the correlation value b is larger than the predetermined threshold value, the determination unit 4 determines whether the edge of the partial image matches the horizontal edge of the input image. In other words, it is determined whether or not the above determination processing is completed for all the pixels in the horizontal direction at the same position in the vertical direction. If they do not match, the template image is set in the horizontal direction with respect to the input image. The determination process is performed with respect to a new partial image with a shift of one pixel. When the edge of the partial image matches the edge of the input image in the horizontal direction, the determination unit 4 determines whether the edge of the partial image matches the edge of the input image in the vertical direction, that is, in the horizontal direction. It is determined whether or not the above determination processing has been completed for all the pixels in the vertical direction at the same position in FIG. 3. If they do not match, the template image is shifted by one pixel in the vertical direction with respect to the input image to newly The above determination processing is performed with respect to a partial image. If the edge of the partial image coincides with the edge of the input image in the vertical direction, the determination unit 4 does not have an image that matches the template image in the input image, that is, the target person H is registered in advance. A determination result indicating that the person does not match is output, and the process ends.

ところで、判定対象である人物の顔は左右対称性を有しており、鼻を通る顔の中心線(対称軸)に対して線対称であるが、図2(a)に示すようにテンプレート画像TPにおいて局所的なスポット光の照射や照明条件の不均一な変化が濃度値に加わると、顔画像の左右対称性が崩れて、対象物の特徴が失われてしまい、パターンマッチングが正確に行えなくなる可能性がある。同様に、判定用の入力濃淡画像を撮像する際に局所的なスポット光の照射や照明条件の不均一な変化が顔画像の濃度値に加わると、顔画像の左右対称性が崩れて、対象物の特徴が失われてしまうため、やはりパターンマッチングが正確に行えなくなる可能性がある。   By the way, the face of the person to be determined has left-right symmetry and is line symmetric with respect to the center line (symmetry axis) of the face passing through the nose. As shown in FIG. If local spot light irradiation or non-uniform changes in illumination conditions are added to the density value in TP, the symmetry of the face image will be lost, the characteristics of the target will be lost, and pattern matching can be performed accurately. There is a possibility of disappearing. Similarly, if a local spotlight or nonuniform change in illumination conditions is added to the density value of the face image when capturing an input grayscale image for determination, the symmetry of the face image is lost and the target image is lost. Since the feature of the object is lost, there is a possibility that pattern matching cannot be performed accurately.

そこで、本実施形態では判定手段4が、テンプレート画像及び判定用の濃淡画像を得る過程において、テンプレート画像及び判定用の濃淡画像を対称要素を中心に対称な位置まで回転させた反転画像をそれぞれ作成し、これら反転画像と元の画像とをもとに、元の画像が対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて対象物の存否を判定するようにしている。   Therefore, in the present embodiment, in the process of obtaining the template image and the gradation image for determination, the determination unit 4 creates inverted images obtained by rotating the template image and the gradation image for determination to symmetrical positions around the symmetric elements. Then, based on the inverted image and the original image, correction processing is performed so that the original image becomes a gray image that is substantially symmetric with respect to the symmetry element, and the presence / absence of the object is determined using the corrected gray image. Is determined.

図2(a)はテンプレート画像TPの例図であり、このテンプレート画像TPは、撮像時に人物の顔の左側から光が照射されたために、対称軸Lを挟んで左側の領域に比べ右側の領域の方が暗くなっている。このとき判定手段4では、テンプレート画像TPを対称軸Lの周りに180度回転させることで対称軸Lに対して対称な濃淡画像を求め、この濃淡画像と反転前の濃淡画像V1とを用いて対称軸Lに対して略対称な濃淡画像を作成するのであるが、例えば反転画像の各画素の濃度値と、反転前のテンプレート画像TPの対応する画素の濃度値との平均値を、実際の相関値演算に用いるテンプレート画像TP’の対応する画素の濃度値としている。すなわちテンプレート画像TP中の対称軸に対して対称な2つの画素の画素値をa1,b1とすると、実際の相関値演算に用いるテンプレート画像TP’の対応する2つの画素の画素値A1,B2は以下の(式3)で示される。   FIG. 2A is an example of a template image TP. Since the template image TP is irradiated with light from the left side of the person's face at the time of imaging, the template image TP is a region on the right side compared to the region on the left side across the symmetry axis L. Is darker. At this time, the determination means 4 obtains a gray image symmetric with respect to the symmetry axis L by rotating the template image TP around the symmetry axis L by 180 degrees, and uses this gray image and the gray image V1 before inversion. A grayscale image that is substantially symmetric with respect to the symmetry axis L is created. For example, the average value of the density value of each pixel of the inverted image and the density value of the corresponding pixel of the template image TP before the inversion is actually calculated. The density value of the corresponding pixel of the template image TP ′ used for the correlation value calculation is used. That is, assuming that the pixel values of two pixels symmetrical with respect to the symmetry axis in the template image TP are a1 and b1, the pixel values A1 and B2 of the corresponding two pixels of the template image TP ′ used for the actual correlation value calculation are It is shown by the following (Formula 3).

A1=A2=(a1+b1)/2 …(式3)
このように、判定手段4では、テンプレート画像TP中の対称軸Lを挟んで対称な位置にある2つの画素の平均値を、実際の相関値演算に用いるテンプレート画像TP’中の2つの画素の画素値(濃度値)としているので、予め保持されたテンプレート画像TPが、顔の片側のみにスポット光が照射されるなどして、各画素の濃度値が対称軸に対して非対称となった場合でも、テンプレート画像TP中で明るい領域と暗い領域の画素値を略平均化して、明るさに偏りのないテンプレート画像TP’を作成することができ、このテンプレート画像TP’を実際の判定に用いることによって、対象物の存否の判定を正確に行うことができる。
A1 = A2 = (a1 + b1) / 2 (Formula 3)
As described above, in the determination unit 4, the average value of two pixels located symmetrically with respect to the symmetry axis L in the template image TP is used as the average value of the two pixels in the template image TP ′ used for the actual correlation value calculation. Since the pixel value (density value) is used, when the template image TP held in advance is irradiated with spot light only on one side of the face, the density value of each pixel becomes asymmetric with respect to the symmetry axis. However, it is possible to create a template image TP ′ with no bias in brightness by substantially averaging the pixel values of the bright and dark regions in the template image TP, and use this template image TP ′ for actual determination. Thus, the presence / absence of the object can be accurately determined.

ところで上記の説明ではテンプレート画像TPを対称軸に対して略対称なテンプレート画像TP’に補正する場合を例に説明を行ったが、判定用の濃淡画像を得る場合にも上述と同様の処理を行うことで、判定用の濃淡画像を対称軸に対して略対称な濃淡画像に変更することができる。なお濃淡画像の全ての画素について、反転画像中の対応する画素との間で濃度値の平均値を求めて、この平均値を補正後の濃淡画像の画素値とする必要はなく、濃淡画像中で対象物を同定するのに特徴的な領域(例えば人の顔の場合には目、眉、口、鼻などの領域)のみで相関値演算を行うのであれば、この特徴領域のみで対称軸に対して略対象な画像となるよう上述と同様の補正処理を行い、補正後の濃淡画像について相関値演算を行えば良い。   In the above description, the case where the template image TP is corrected to the template image TP ′ substantially symmetric with respect to the symmetry axis has been described as an example. However, the same processing as described above is performed when obtaining a grayscale image for determination. By doing so, the grayscale image for determination can be changed to a grayscale image that is substantially symmetrical with respect to the symmetry axis. Note that it is not necessary to obtain an average value of density values for all pixels of the grayscale image with the corresponding pixels in the inverted image, and this average value need not be used as the pixel value of the grayscale image after correction. If the correlation value calculation is performed only in the characteristic area (for example, the area of eyes, eyebrows, mouth, nose, etc. in the case of a human face) to identify the target object, the symmetry axis only in this characteristic area The correction processing similar to that described above may be performed so as to obtain a substantially target image, and the correlation value calculation may be performed on the corrected grayscale image.

(実施形態2)
本発明の実施形態2を図3に基づいて説明する。なお画像処理装置の基本的な構成は実施形態1と同様であるので、共通する構成要素には同一の符号を付して、その説明は省略する。
(Embodiment 2)
A second embodiment of the present invention will be described with reference to FIG. Since the basic configuration of the image processing apparatus is the same as that of the first embodiment, common components are denoted by the same reference numerals, and description thereof is omitted.

上述の実施形態1では、対象物の形状が対称軸に対して線対称な形状である場合に、テンプレート画像及び判定用の濃淡画像を対称軸に対して対称な位置に反転させることによって得られた反転画像の各画素の濃度値と、反転前の画像の対応する画素の濃度値との平均値を、実際の相関値演算に用いる濃淡画像の各画素の濃度値としているが、本実施形態では、相関値演算に用いる濃淡画像の各画素の濃度値を、反転画像の対応する画素の濃度値、または、反転前の濃淡画像の対応する画素の濃度値の何れかの濃度値としている。   In Embodiment 1 described above, when the shape of the object is a line-symmetric shape with respect to the symmetry axis, the template image and the grayscale image for determination are obtained by inverting them to positions that are symmetric with respect to the symmetry axis. The average value of the density value of each pixel of the inverted image and the density value of the corresponding pixel of the image before inversion is used as the density value of each pixel of the grayscale image used for actual correlation value calculation. In this case, the density value of each pixel of the grayscale image used for the correlation value calculation is the density value of the corresponding pixel of the inverted image or the density value of the corresponding pixel of the grayscale image before inversion.

すなわち、判定手段4では、明るさに偏りがない均一な照明条件下で撮像して得た顔画像を得て、この顔画像の対称軸を境界として分割された左右2つの比較領域の各々について、各比較領域に含まれる全ての画素の画素値の統計計算を行い、その計算結果(例えば平均値や分散)を基準値として予め保持している。   That is, the determination unit 4 obtains a face image obtained by imaging under uniform illumination conditions with no bias in brightness, and each of the two left and right comparison regions divided with the symmetry axis of the face image as a boundary. The statistical calculation of the pixel values of all the pixels included in each comparison area is performed, and the calculation results (for example, average value and variance) are stored in advance as reference values.

そして、判定手段4では、テンプレート画像及び判定用の濃淡画像を得る過程においてテンプレート画像及び判定用の濃淡画像を対称要素に対して対称な位置に反転させて得た反転画像と反転前の画像の対応する比較領域でそれぞれ各画素の濃度値の統計計算を行い、その計算結果が基準値に近い方の画像の当該比較領域における各画素の濃度値を、相関値演算に用いる濃淡画像の比較領域における各画素の濃度値としている。例えば判定手段4は、各画像の対称軸(対称要素)に対して略対称な2つの領域、この場合は対称軸を境界として分割された左右2つの領域(比較領域)の各々で、各領域に含まれる全ての画素の画素値の統計計算(平均値の算出)を行い、この統計計算の結果(平均値)が予め求めた基準値に近いほうの領域を採用し、この領域内の各画素の画素値で、他方の領域内の対応する画素の画素値を置きかえる補正処理を行うことで、実際の相関値演算に使用する濃度画像を得ている。   Then, in the determination unit 4, in the process of obtaining the template image and the grayscale image for determination, the template image and the grayscale image for determination are inverted to a symmetrical position with respect to the symmetric element, and the reverse image obtained before the reverse image The density value of each pixel is statistically calculated in the corresponding comparison area, and the density value of each pixel in the comparison area of the image whose calculation result is closer to the reference value is used for the correlation value calculation. The density value of each pixel in FIG. For example, the determination unit 4 includes two regions that are substantially symmetric with respect to the symmetry axis (symmetric element) of each image, in this case, each of the two regions (comparison regions) divided right and left with the symmetry axis as a boundary. Statistical calculation of the pixel values of all pixels included in (average value calculation) is performed, and the area where the result of this statistical calculation (average value) is closer to the reference value obtained in advance is adopted. A density image used for actual correlation value calculation is obtained by performing correction processing that replaces the pixel value of the corresponding pixel in the other region with the pixel value of the pixel.

図3(a)はテンプレート画像TPの例図であり、このテンプレート画像TPは、撮像時に人物の顔の左側から光が照射されたために、対称軸Lを挟んで左側の領域W1に比べ右側の領域W2の方が暗くなっている。このとき判定手段4では、テンプレート画像TPを対称軸Lを境界として左右2つの領域W1,W2に分割し、左右2つの領域W1,W2でそれぞれ領域内の全画素の画素値の平均値を求め、予め求めておいた基準値に近い方の領域を採用し、採用した領域内の全ての画素の画素値で、反対側の領域の各画素の画素値を置きかえている。例えば対称軸Lに対して左側の領域W1の画素値の平均の方が基準値に近ければ、右側の領域W2の各画素の画素値を、左側の領域W1の対応する画素の画素値で置きかえて、相関値演算に用いる濃淡画像を得ている。すなわち変更後のテンプレート画像TP’中の対称軸Lに対して対称な2つの画素の画素値をA2,B2とし、この2つの画素に対応する元のテンプレート画像TP中の2つの画素の画素値をa2,b2とすると、この場合はA2=B2=a2となる。また対称軸Lに対して右側の領域W2の画素値の平均の方が基準値に近ければ、左側の領域W1の各画素の画素値を、右側の領域W1の対応する画素の画素値で置きかえて、相関値演算に用いる濃淡画像を求めており、この場合はA2=B2=b2となる。   FIG. 3A is an example of the template image TP. Since the template image TP is irradiated with light from the left side of the person's face at the time of imaging, the template image TP is on the right side of the left side region W1 with the symmetry axis L in between. The area W2 is darker. At this time, the determination unit 4 divides the template image TP into two left and right regions W1 and W2 with the symmetry axis L as a boundary, and obtains an average value of the pixel values of all the pixels in each of the two left and right regions W1 and W2. The area closer to the reference value obtained in advance is adopted, and the pixel value of each pixel in the opposite area is replaced with the pixel value of all the pixels in the adopted area. For example, if the average pixel value of the left region W1 with respect to the symmetry axis L is closer to the reference value, the pixel value of each pixel in the right region W2 is replaced with the pixel value of the corresponding pixel in the left region W1. Thus, a grayscale image used for correlation value calculation is obtained. That is, the pixel values of two pixels that are symmetric with respect to the symmetry axis L in the template image TP ′ after the change are A2 and B2, and the pixel values of the two pixels in the original template image TP corresponding to these two pixels. In this case, A2 = B2 = a2. If the average pixel value of the right region W2 with respect to the symmetry axis L is closer to the reference value, the pixel value of each pixel in the left region W1 is replaced with the pixel value of the corresponding pixel in the right region W1. Thus, a grayscale image used for correlation value calculation is obtained. In this case, A2 = B2 = b2.

このように、判定手段4では、理想的な照明条件下で撮像された濃淡画像中の任意の比較領域で画素値の平均値を求め、この平均値を基準値として予め把握しておき、その後テンプレート画像が入力された際に、このテンプレート画像とテンプレート画像を対称要素に対して反転させた反転画像の各々について対応する比較領域の画素値の平均値を求め、予め求めた基準値に近い方の画像の比較領域における各画素の画素値を、実際の相関値演算に用いる画像の比較領域における各画素の画素値としているので、顔画像の片側のみにスポット光が照射されるなどして、各画素の濃度値が対称軸に対して非対称となった場合でも、テンプレート画像TP中の明るい領域と暗い領域の画素値を略平均化して、明るさに偏りのないテンプレート画像TP’を作成することができ、このテンプレート画像TP’を実際の相関値演算に用いることで、対象物の存否の判定を正確に行うことができる。   As described above, the determination unit 4 obtains an average value of pixel values in an arbitrary comparison region in a grayscale image captured under ideal illumination conditions, grasps this average value in advance as a reference value, and then When a template image is input, the average value of the pixel values in the corresponding comparison area is obtained for each of the template image and the inverted image obtained by inverting the template image with respect to the symmetrical element, and the one closer to the previously obtained reference value Since the pixel value of each pixel in the comparison area of the image is the pixel value of each pixel in the comparison area of the image used for the actual correlation value calculation, spot light is irradiated only on one side of the face image, etc. Even when the density value of each pixel is asymmetric with respect to the symmetry axis, the pixel values of the bright area and the dark area in the template image TP are approximately averaged, so that the template image has no bias in brightness. 'Can be created, the template image TP' P by using the actual correlation value calculation, it is possible to determine presence or absence of the object accurately.

ところで上記の説明ではテンプレート画像TPを対称軸に対して略対称なテンプレート画像TP’に補正する場合を例に説明を行ったが、判定用の濃淡画像を得る場合にも上述と同様の補正処理を行うことで、判定用の濃淡画像を対称軸に対して略対称な濃淡画像に変更することができる。   In the above description, the case where the template image TP is corrected to the template image TP ′ that is substantially symmetric with respect to the symmetry axis has been described as an example. However, the same correction processing as described above is performed when obtaining a grayscale image for determination. By performing the above, it is possible to change the grayscale image for determination into a grayscale image that is substantially symmetric with respect to the symmetry axis.

なお本実施形態では濃淡画像を対称軸Lを挟んだ左右2つの領域に分割し、各々の領域について領域中の各画素の平均値を求め、予め求めた基準値に近い方の領域を採択し、採択された領域の画素で反対側の領域の画素を置きかえているが、濃淡画像中で対象物を同定するのに特徴的な領域(例えば人の顔の場合には目、眉、口、鼻などの領域)のみで相関値演算を行うのであれば、この特徴領域のみで上記の処理を実行しても良い。すなわち理想的な照明環境下で撮像された濃淡画像の中で、目の部分に対応する領域中の各画素の濃度値の平均値を予め求めておき、テンプレート画像又は判定用の入力濃淡画像を得る過程でこれらの画像中で目の部分に対応し、且つ、対称軸に対して対称な2つの領域中の各画素の濃度値の平均値をそれぞれ求め、予め求めた平均値に近い領域を採用し、この領域中の各画素の濃度値で反対側の領域中の各画素の濃度値を置きかえるようにしても良い。   In the present embodiment, the grayscale image is divided into two left and right regions sandwiching the symmetry axis L, the average value of each pixel in the region is obtained for each region, and the region closer to the previously obtained reference value is adopted. The pixels in the opposite area are replaced with the pixels in the selected area, but the characteristic areas for identifying the object in the grayscale image (for example, eyes, eyebrows, mouths, If the correlation value calculation is performed only in the region such as the nose, the above processing may be executed only in the feature region. That is, in a grayscale image captured in an ideal illumination environment, an average value of density values of each pixel in a region corresponding to the eye portion is obtained in advance, and a template image or an input grayscale image for determination is obtained. In the process of obtaining, the average value of the density value of each pixel in the two areas corresponding to the eye portion in these images and symmetrical with respect to the symmetry axis is obtained, and an area close to the previously obtained average value is obtained. Alternatively, the density value of each pixel in this region may be replaced with the density value of each pixel in this region.

また上述の各実施形態では判定手段4が、テンプレート画像TPおよび判定用の濃淡画像の両方について、対称要素に対して対称な位置に反転させた反転画像と反転前の画像とから対称要素に対して略対称な画像を作成し、この画像を用いて相関値演算を行っているが、テンプレート画像TP又は判定用の濃淡画像の内、不均一な照明条件下で撮像された何れかの画像について反転画像と反転前の画像とから対称要素に対して略対称な画像を作成し、この画像を用いて相関値演算を行うようにしても良い。   Further, in each of the above-described embodiments, the determination unit 4 applies the symmetric element to the symmetric element from the inverted image obtained by inverting both the template image TP and the grayscale image for determination to a symmetric position with respect to the symmetric element and the image before the inversion. Image, and the correlation value calculation is performed using this image. However, any one of the template image TP or the grayscale image for determination taken under non-uniform illumination conditions An image that is substantially symmetric with respect to the symmetric element is created from the inverted image and the image before being inverted, and the correlation value calculation may be performed using this image.

(実施形態3)
本発明の実施形態3を図4に基づいて説明する。なお画像処理装置の基本的な構成は実施形態1と同様であるので、共通する構成要素には同一の符号を付して、その説明は省略する。
(Embodiment 3)
A third embodiment of the present invention will be described with reference to FIG. Since the basic configuration of the image processing apparatus is the same as that of the first embodiment, common components are denoted by the same reference numerals, and description thereof is omitted.

従来のテンプレートマッチングでは予め用意したテンプレート画像で入力濃淡画像を走査して、各々の位置で相関値演算を行い、相関値が最大となる位置に対象物が存在すると仮定し、この位置での相関値を用いて対象物の存否を判定していた。   In conventional template matching, the input grayscale image is scanned with a template image prepared in advance, the correlation value is calculated at each position, and it is assumed that there is an object at the position where the correlation value is maximized. The presence / absence of the object was determined using the value.

ここで、判定用の入力濃淡画像、又は、テンプレート画像が不均一な照明条件下で撮像された場合にテンプレートマッチングを行って最大の相関値を用いて対象物の存否を判断すると、不均一な照明条件下で撮像された濃淡画像では対称軸に対する対称性が損なわれているために、相関値が低めにでる傾向があり、対象物が存在するにも関わらず、対象物が存在しないという誤った判断を行う可能性があった。   Here, when the input grayscale image for determination or the template image is captured under non-uniform illumination conditions, template matching is performed and the presence or absence of an object is determined using the maximum correlation value. In a grayscale image captured under illumination conditions, the symmetry with respect to the symmetry axis is lost, so the correlation value tends to be low, and there is an error that the object does not exist even though the object exists. There was a possibility of making a judgment.

そこで本実施形態では、判定手段4が保持手段3に保持されたテンプレート画像を用いて判定用の入力濃淡画像を走査して相関値の最も高い第1相似領域を探索し、この相似領域で相関値演算を行った後、テンプレート画像を実施形態1で説明した方法で対称要素に対して略対称な濃淡画像に変換し、変換後のテンプレート画像を用いて判定用の入力濃淡画像を再度走査して相関値が最も高い第2相似領域を探索し、この第2相似領域で再度相関値を演算しており、2回の相関値演算の演算結果に基づいて対象物の存否を判断している。   Therefore, in the present embodiment, the determination unit 4 scans the input grayscale image for determination using the template image held in the holding unit 3 to search for the first similar region having the highest correlation value, and the correlation is performed in this similar region. After performing the value calculation, the template image is converted into a gray image that is substantially symmetric with respect to the symmetrical element by the method described in the first embodiment, and the input gray image for determination is scanned again using the converted template image. The second similar region having the highest correlation value is searched, the correlation value is calculated again in the second similar region, and the presence / absence of the object is determined based on the calculation result of the two correlation value calculations. .

ここで、判定手段4による判定処理を図4のフローチャートに基づいて説明する。まず判定手段4は、入力画像の初期位置(例えば、左上隅の位置)にテンプレート画像をおき(S1)、テンプレート画像の各画素と、これに重なる入力画像(部分画像)の各画素との間で画素値(濃度値)の差分を求めるとともに、差分の絶対値を各画素毎の相関値aとする。そして、部分画像中の全ての画素について相関値aを求めたら、これらの相関値aの総和を、部分画像に含まれる全ての画素数で除算したものを新たに相関値bと定義し、この位置での相関値bとして記憶する(S2)。相関値bの演算が終了すると、判定手段4は、部分画像の端が入力画像における水平方向の端に一致しているか否か、すなわち、垂直方向における同一位置において水平方向の全ての画素についての上記判定処理が完了しているか否かを判断し(S3)、一致していなければ、テンプレート画像を入力画像に対して水平方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う(S4)。また、部分画像の端が入力画像における水平方向の端に一致している場合、判定手段4はその部分画像の端が入力画像における垂直方向の端に一致しているか否か、すなわち、水平方向における同一位置において垂直方向の全ての画素についての上記判定処理が完了しているか否かを判断し(S5)、一致していなければ、テンプレート画像を入力画像に対して垂直方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う(S6)。そして、部分画像の端が入力画像における垂直方向の端に一致している場合、判定手段4は、入力画像の全ての位置でテンプレート画像と部分画像との間で判定処理を終了したと判断し、全ての位置での相関値bの内、最も大きな相関値Aとその時のテンプレート画像の位置とを記憶する(S7)。   Here, the determination process by the determination means 4 is demonstrated based on the flowchart of FIG. First, the determination unit 4 places a template image at an initial position (for example, the position of the upper left corner) of the input image (S1), and between each pixel of the template image and each pixel of the input image (partial image) that overlaps the template image. To obtain the difference between the pixel values (density values) and set the absolute value of the difference as the correlation value a for each pixel. Then, when the correlation value a is obtained for all the pixels in the partial image, a sum of these correlation values a divided by the total number of pixels included in the partial image is newly defined as a correlation value b. The correlation value b at the position is stored (S2). When the calculation of the correlation value b is completed, the determination unit 4 determines whether or not the edge of the partial image coincides with the edge of the input image in the horizontal direction, that is, for all the pixels in the horizontal direction at the same position in the vertical direction. It is determined whether or not the determination process has been completed (S3). If they do not match, the template image is shifted by one pixel in the horizontal direction with respect to the input image, and the determination is performed with a new partial image. Processing is performed (S4). When the edge of the partial image matches the edge of the input image in the horizontal direction, the determination unit 4 determines whether the edge of the partial image matches the edge of the input image in the vertical direction, that is, in the horizontal direction. In step S5, it is determined whether or not the above-described determination processing has been completed for all the pixels in the vertical direction at the same position in FIG. The determination process is performed with respect to a new partial image by shifting (S6). If the edge of the partial image matches the edge of the input image in the vertical direction, the determination unit 4 determines that the determination process has been completed between the template image and the partial image at all positions of the input image. Among the correlation values b at all positions, the largest correlation value A and the position of the template image at that time are stored (S7).

その後、判定手段4は、実施形態1で説明した方法を用いてテンプレート画像を、対称要素に対して略対称な濃淡画像に変換して、この濃淡画像を新たなテンプレート画像とし(S8)、上述したS1〜S6と同様の処理を行って、入力画像の全ての位置で新たなテンプレート画像と部分画像との間の相関値を求め(S9〜S14)、全ての位置での相関値の内、最も大きな相関値Bとその時のテンプレート画像の位置とを記憶する(S15)。   Thereafter, the determination unit 4 converts the template image into a gray image that is substantially symmetrical with respect to the symmetric element using the method described in the first embodiment, and uses this gray image as a new template image (S8). The correlation values between the new template image and the partial image are obtained at all positions of the input image by performing the same processing as S1 to S6 (S9 to S14), and among the correlation values at all positions, The largest correlation value B and the position of the template image at that time are stored (S15).

そして、変換前と変換後のテンプレート画像を用いたテンプレートマッチングが終了すると、判定手段4は、2つの相関値A、Bと所定のしきい値との高低を比較し、何れか一方の相関値A、Bがしきい値を超えると対象物が存在すると判断し、判断結果と、一致したテンプレート画像が変換前のものか変換後のものかを示すテンプレート情報とを出力する(S16)。なお判定手段4では、2つの相関値A、Bが両方ともにしきい値を超えた場合のみ対象物が存在すると判断しても良く、対象物の存否を確実に判定できる。   When the template matching using the pre-conversion and post-conversion template images is completed, the determination unit 4 compares the two correlation values A and B with a predetermined threshold value, and either one of the correlation values When A and B exceed the threshold value, it is determined that there is an object, and the determination result and template information indicating whether the matched template image is before conversion or after conversion are output (S16). Note that the determination unit 4 may determine that the object exists only when both of the two correlation values A and B exceed the threshold value, and can reliably determine whether the object exists.

なお本実施形態では、保持手段3に保持されたテンプレート画像を、実施形態1で説明した方法により対称軸に対して略対称な画像に変換して新たなテンプレート画像としているが、実施形態2で説明した方法により対称軸に対して略対称な画像に変換しても良い。   In the present embodiment, the template image held in the holding unit 3 is converted into an image that is substantially symmetric with respect to the symmetry axis by the method described in the first embodiment to obtain a new template image. The image may be converted into a substantially symmetric image with respect to the symmetry axis by the method described above.

(実施形態4)
本発明の実施形態4を図5に基づいて説明する。なお画像処理装置の基本的な構成は実施形態1と同様であるので、共通する構成要素には同一の符号を付して、その説明は省略する。
(Embodiment 4)
A fourth embodiment of the present invention will be described with reference to FIG. Since the basic configuration of the image processing apparatus is the same as that of the first embodiment, common components are denoted by the same reference numerals, and description thereof is omitted.

実施形態3で説明したように、判定用の入力濃淡画像又はテンプレート画像が不均一な照明条件下で撮像された場合にテンプレートマッチングを行って最大の相関値を用いて対象物の存否を判断すると、不均一な照明条件下で撮像された濃淡画像では対称軸に対する対称性が損なわれているために、相関値が低めにでる傾向があり、対象物が存在するにも関わらず、対象物が存在しないという誤った判断を行う可能性があった。   As described in the third embodiment, when an input grayscale image or template image for determination is captured under non-uniform illumination conditions, template matching is performed and the presence or absence of an object is determined using the maximum correlation value. In contrast, in a grayscale image captured under non-uniform illumination conditions, since the symmetry with respect to the symmetry axis is impaired, the correlation value tends to be low, and the object is present despite the presence of the object. There was a possibility of making a false judgment that it did not exist.

そこで本実施形態では、判定手段4が、テンプレート画像で判定用の入力濃淡画像を走査して相関値が最も高い相似領域を探索し、この相似領域で相関値演算を行った後、この相似領域でテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で対称要素に対して略対称な濃淡画像に変換し、この濃淡画像とテンプレート画像とで再度相関値演算を行っており、2回の相関値演算の演算結果に基づいて対象物の存否を判断している。   Therefore, in the present embodiment, the determination unit 4 scans the input grayscale image for determination with the template image to search for a similar region having the highest correlation value, performs a correlation value calculation in this similar region, and then performs the similar region. Then, an image having a size corresponding to the template image is cut out, and the cut image is converted into a gray image that is substantially symmetric with respect to the symmetric element by the method described in the first embodiment, and the gray image and the template image are correlated again. Value calculation is performed, and the presence or absence of an object is determined based on the calculation result of two correlation value calculations.

ここで、判定手段4による判定処理を図5のフローチャートに基づいて説明する。まず判定手段4は、入力画像の初期位置(例えば、左上隅の位置)にテンプレート画像をおき(S21)、テンプレート画像の各画素と、これに重なる入力画像(部分画像)の各画素との間で画素値(濃度値)の差分を求めるとともに、差分の絶対値を各画素毎の相関値Aとする。そして、部分画像中の全ての画素について相関値aを求めたら、これらの相関値aの総和を、部分画像に含まれる全ての画素数で除算したものを新たに相関値bと定義し、この位置での相関値bとして記憶する(S22)。相関値bの演算が終了すると、判定手段4は、部分画像の端が入力画像における水平方向の端に一致しているか否か、すなわち、垂直方向における同一位置において水平方向の全ての画素についての上記判定処理が完了しているか否かを判断し(S23)、一致していなければ、テンプレート画像を入力画像に対して水平方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う(S24)。また、部分画像の端が入力画像における水平方向の端に一致している場合、判定手段4はその部分画像の端が入力画像における垂直方向の端に一致しているか否か、すなわち、水平方向における同一位置において垂直方向の全ての画素についての上記判定処理が完了しているか否かを判断し(S25)、一致していなければ、テンプレート画像を入力画像に対して垂直方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う(S26)。そして、部分画像の端が入力画像における垂直方向の端に一致している場合、判定手段4は、入力画像の全ての位置でテンプレート画像と部分画像との間で判定処理を終了したと判断し、全ての位置での相関値の内、最も大きな相関値Cとその時のテンプレート画像の位置とを記憶する(S27)。   Here, the determination process by the determination means 4 is demonstrated based on the flowchart of FIG. First, the determination unit 4 places a template image at an initial position (for example, the position of the upper left corner) of the input image (S21), and between each pixel of the template image and each pixel of the input image (partial image) overlapping therewith. To obtain the difference between the pixel values (density values) and set the absolute value of the difference as the correlation value A for each pixel. Then, when the correlation value a is obtained for all the pixels in the partial image, a sum of these correlation values a divided by the total number of pixels included in the partial image is newly defined as a correlation value b. The correlation value b at the position is stored (S22). When the calculation of the correlation value b is completed, the determination unit 4 determines whether or not the edge of the partial image coincides with the edge of the input image in the horizontal direction, that is, for all the pixels in the horizontal direction at the same position in the vertical direction. It is determined whether or not the determination process has been completed (S23). If they do not match, the determination is performed with respect to a new partial image by shifting the template image by one pixel in the horizontal direction with respect to the input image. Processing is performed (S24). When the edge of the partial image matches the edge of the input image in the horizontal direction, the determination unit 4 determines whether the edge of the partial image matches the edge of the input image in the vertical direction, that is, in the horizontal direction. In step S25, it is determined whether or not the above-described determination processing has been completed for all the pixels in the vertical direction at the same position in FIG. The determination process is performed with respect to a new partial image by shifting (S26). If the edge of the partial image matches the edge of the input image in the vertical direction, the determination unit 4 determines that the determination process has been completed between the template image and the partial image at all positions of the input image. Of the correlation values at all positions, the largest correlation value C and the position of the template image at that time are stored (S27).

次に判定手段4は、相関値が最大の相似領域で入力画像からテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で対称要素に対して略対称な濃淡画像に変換した後(S28)、変換後の濃淡画像とテンプレート画像との間で再度相関値演算を行って、相関値Dを求める(S29)。   Next, the determination unit 4 cuts out an image having a size corresponding to the template image from the input image in the similar region having the maximum correlation value, and the cut image is substantially symmetric with respect to the symmetric element by the method described in the first embodiment. After the conversion to a clear gray image (S28), the correlation value calculation is performed again between the converted gray image and the template image to obtain the correlation value D (S29).

そして、上記の処理が終了すると、判定手段4は、2つの相関値C、Dと所定のしきい値との高低を比較し、何れか一方の相関値C,Dがしきい値を超えると対象物が存在すると判断し、判断結果と、一致した入力画像が変換前のものか変換後のものかを示す入力画像情報情報を出力する(S30)。なお判定手段4では、2つの相関値C,Dが両方ともにしきい値を超えた場合のみ対象物が存在すると判断しても良く、対象物の存否を確実に判定できる。   When the above processing is completed, the determination unit 4 compares the two correlation values C and D with a predetermined threshold value, and if any one of the correlation values C and D exceeds the threshold value, It is determined that there is an object, and input image information information indicating the determination result and whether the matched input image is the one before conversion or after conversion is output (S30). Note that the determination means 4 may determine that the object exists only when both of the two correlation values C and D exceed the threshold value, and can reliably determine whether the object exists.

なお本実施形態では2回の相関値演算の結果から対象物の存否を判断しているが、相関値演算を1回のみとし、判定手段4が、テンプレート画像で判定用の入力濃淡画像を走査して相関値が最も高い相似領域を探索し、この相似領域でテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で対称要素に対して略対称な濃淡画像に変換し、この濃淡画像とテンプレート画像とで相関値演算を行って、その演算結果に基づいて対象物の存否を判断するようにしても良い。   In this embodiment, the presence / absence of the object is determined from the result of the correlation value calculation twice. However, the correlation value calculation is performed only once, and the determination unit 4 scans the input grayscale image for determination with the template image. Then, a similar region having the highest correlation value is searched, an image having a size corresponding to the template image is cut out in the similar region, and the cut-out image is substantially symmetric with respect to a symmetric element by the method described in the first embodiment. It may be converted into a grayscale image, a correlation value calculation is performed between the grayscale image and the template image, and the presence or absence of an object may be determined based on the calculation result.

また本実施形態では、判定用の濃淡画像を、実施形態1で説明した方法により対称軸に対して略対称な画像に変換し、変換後の画像とテンプレート画像とで相関値演算を行っているが、実施形態2で説明した方法により対称軸に対して略対称な画像に変換しても良い。   In the present embodiment, the grayscale image for determination is converted into an image that is substantially symmetric with respect to the symmetry axis by the method described in the first embodiment, and the correlation value is calculated between the converted image and the template image. However, the image may be converted into a substantially symmetric image with respect to the symmetry axis by the method described in the second embodiment.

(実施形態5)
本発明の実施形態5を図6に基づいて説明する。なお画像処理装置の基本的な構成は実施形態1と同様であるので、共通する構成要素には同一の符号を付して、その説明は省略する。
(Embodiment 5)
A fifth embodiment of the present invention will be described with reference to FIG. Since the basic configuration of the image processing apparatus is the same as that of the first embodiment, common components are denoted by the same reference numerals, and description thereof is omitted.

実施形態3で説明したように、判定用の入力濃淡画像又はテンプレート画像がそれぞれ不均一な照明条件下で撮像された場合にテンプレートマッチングを行い、最大の相関値を用いて対象物の存否を判断すると、不均一な照明条件下で撮像された濃淡画像では対称軸に対する対称性が損なわれているために、相関値が低めにでる傾向があり、対象物が存在するにも関わらず、対象物が存在しないという誤った判断を行う可能性があった。   As described in the third embodiment, template matching is performed when an input grayscale image or template image for determination is captured under non-uniform illumination conditions, and the presence or absence of an object is determined using the maximum correlation value. Then, in a grayscale image captured under non-uniform illumination conditions, since the symmetry with respect to the symmetry axis is lost, the correlation value tends to be low, and the target object exists despite the presence of the target object. There was a possibility of making a false judgment that there was no.

そこで本実施形態では、判定手段4が、テンプレート画像で判定用の入力濃淡画像を走査して相関値が最も高い第1相似領域を探索し、この第1相似領域で相関値を演算するとともに、この第1相似領域でテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で変換した濃淡画像を得て、変換後の濃淡画像とテンプレート画像との相関値演算を行った後、テンプレート画像を実施形態1で説明した方法で変換し、変換後のテンプレート画像を用いて判定用の入力濃淡画像を走査して相関値が最も高い第2相似領域を探索し、この第2相似領域で相関値を演算するとともに、この第2相似領域で変更後のテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で変換した濃淡画像を得て、変換後の濃淡画像と変更後のテンプレート画像との相関値演算を行っており、計4回の相関値演算の演算結果に基づいて対象物の存否を判断している。   Therefore, in the present embodiment, the determination unit 4 scans the input grayscale image for determination with the template image, searches for the first similar region having the highest correlation value, calculates the correlation value in the first similar region, An image having a size corresponding to the template image is cut out in the first similarity region, a grayscale image obtained by converting the cutout image by the method described in the first embodiment is obtained, and the correlation between the converted grayscale image and the template image is obtained. After performing the value calculation, the template image is converted by the method described in the first embodiment, and the input gradation image for determination is scanned using the converted template image to search for the second similar region having the highest correlation value. Then, the correlation value is calculated in the second similar region, and an image having a size corresponding to the template image after the change is cut out in the second similar region, and the cut out image is described in the first embodiment. The grayscale image converted by the above method is obtained, and the correlation value calculation between the converted grayscale image and the modified template image is performed. Based on the calculation result of the correlation value calculation four times in total, the presence / absence of the object is determined. Deciding.

ここで、判定手段4による判定処理を図6のフローチャートに基づいて説明する。まず判定手段4は、入力画像の初期位置(例えば、左上隅の位置)にテンプレート画像をおき(S31)、テンプレート画像の各画素と、これに重なる入力画像(部分画像)の各画素との間で画素値(濃度値)の差分を求めるとともに、差分の絶対値を各画素毎の相関値aとする。そして、部分画像中の全ての画素について相関値aを求めたら、これらの相関値aの総和を、部分画像に含まれる全ての画素数で除算したものを新たに相関値bと定義し、この位置での相関値bとして記憶する(S32)。相関値bの演算が終了すると、判定手段4は、部分画像の端が入力画像における水平方向の端に一致しているか否か、すなわち、垂直方向における同一位置において水平方向の全ての画素についての上記判定処理が完了しているか否かを判断し(S33)、一致していなければ、テンプレート画像を入力画像に対して水平方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う(S34)。また、部分画像の端が入力画像における水平方向の端に一致している場合、判定手段4はその部分画像の端が入力画像における垂直方向の端に一致しているか否か、すなわち、水平方向における同一位置において垂直方向の全ての画素についての上記判定処理が完了しているか否かを判断し(S35)、一致していなければ、テンプレート画像を入力画像に対して垂直方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う(S36)。そして、部分画像の端が入力画像における垂直方向の端に一致している場合、判定手段4は、入力画像の全ての位置でテンプレート画像と部分画像との間で判定処理を終了したと判断し、全ての位置での相関値の内、最も大きな相関値Eとその時のテンプレート画像の位置とを記憶する(S37)。   Here, the determination process by the determination means 4 is demonstrated based on the flowchart of FIG. First, the determination unit 4 places a template image at an initial position (for example, the position of the upper left corner) of the input image (S31), and between each pixel of the template image and each pixel of the input image (partial image) overlapping therewith. To obtain the difference between the pixel values (density values) and set the absolute value of the difference as the correlation value a for each pixel. Then, when the correlation value a is obtained for all the pixels in the partial image, a sum of these correlation values a divided by the total number of pixels included in the partial image is newly defined as a correlation value b. The correlation value b at the position is stored (S32). When the calculation of the correlation value b is completed, the determination unit 4 determines whether or not the edge of the partial image coincides with the edge of the input image in the horizontal direction, that is, for all the pixels in the horizontal direction at the same position in the vertical direction. It is determined whether or not the determination process has been completed (S33). If they do not match, the template image is shifted by one pixel in the horizontal direction with respect to the input image, and the determination is performed with a new partial image. Processing is performed (S34). When the edge of the partial image matches the edge of the input image in the horizontal direction, the determination unit 4 determines whether the edge of the partial image matches the edge of the input image in the vertical direction, that is, in the horizontal direction. In step S35, it is determined whether or not the above-described determination processing has been completed for all pixels in the vertical direction at the same position in FIG. The determination process is performed with respect to a new partial image by shifting (S36). If the edge of the partial image matches the edge of the input image in the vertical direction, the determination unit 4 determines that the determination process has been completed between the template image and the partial image at all positions of the input image. Of the correlation values at all positions, the largest correlation value E and the position of the template image at that time are stored (S37).

次に判定手段4は、相関値が最大の第1相似領域で入力画像からテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で変換した濃淡画像を得て(S38)、変換後の濃淡画像とテンプレート画像との間で相関値演算を行って、相関値Fを求める(S39)。   Next, the determination unit 4 cuts out an image having a size corresponding to the template image from the input image in the first similar region having the maximum correlation value, and converts the grayscale image obtained by converting the cut-out image by the method described in the first embodiment. Obtaining (S38), the correlation value is calculated between the converted gray image and the template image to obtain the correlation value F (S39).

そして上記の処理が終了すると、判定手段4は、実施形態1で説明した方法を用いてテンプレート画像を対称要素に対して略対称な画像に変換し、この画像を新たなテンプレート画像として(S40)、上述したS31〜S36と同様の処理を行って、入力画像の全ての位置で変更後のテンプレート画像と部分画像との間の相関値を求め(S41〜S46)、全ての位置での相関値の内、最も大きな相関値Gとその時の新たなテンプレート画像の位置(第2相似領域)を記憶する(S47)。   When the above processing is completed, the determination unit 4 converts the template image into a substantially symmetric image with respect to the symmetric element using the method described in the first embodiment, and uses this image as a new template image (S40). The same processing as in S31 to S36 described above is performed to obtain correlation values between the changed template image and partial images at all positions of the input image (S41 to S46), and correlation values at all positions Among them, the largest correlation value G and the position (second similarity region) of the new template image at that time are stored (S47).

その後判定手段4は、相関値が最大となる第2相似領域で入力画像からテンプレート画像に相当する大きさの画像を切り出して、切り出した画像を実施形態1で説明した方法で変換した濃淡画像を得て(S48)、変換後の濃淡画像とテンプレート画像との間で相関値演算を行って、相関値Hを求める(S49)。   Thereafter, the determination unit 4 cuts out an image having a size corresponding to the template image from the input image in the second similar region where the correlation value is maximized, and converts the grayscale image obtained by converting the cut-out image by the method described in the first embodiment. Obtaining (S48), the correlation value is calculated between the converted gray image and the template image to obtain the correlation value H (S49).

そして、以上4回の相関値演算が終了すると、判定手段4は、4つの相関値E〜Hと所定のしきい値との高低を比較し、何れか一つの相関値がしきい値を超えると対象物が存在すると判断し、判断結果と、一致した入力画像およびテンプレート画像が変換前のものか変換後のものかを示す入力画像情報およびテンプレート情報を出力する(S50)。なお判定手段4では、4つの相関値E〜Hが全てしきい値を超えた場合のみ対象物が存在すると判断しても良く、対象物の存否を確実に判定できる。   When the four correlation value operations are completed, the determination unit 4 compares the four correlation values E to H with a predetermined threshold value, and any one correlation value exceeds the threshold value. And the determination result and input image information and template information indicating whether the matched input image and template image are before conversion or after conversion are output (S50). Note that the determination unit 4 may determine that the object exists only when all of the four correlation values E to H exceed the threshold value, and can reliably determine whether the object exists.

なお本実施形態では、判定用の濃淡画像およびテンプレート画像を、実施形態1で説明した方法により対称軸に対して略対称な画像に変換し、変更前および変更後の濃淡画像について、それぞれ変更前および変更後のテンプレート画像との間で相関値演算を行っているが、判定用の濃淡画像およびテンプレート画像を実施形態2で説明した方法により対称軸に対して略対称な画像に変換しても良い。   In the present embodiment, the grayscale image and template image for determination are converted into an image that is substantially symmetric with respect to the symmetry axis by the method described in the first embodiment. Although the correlation value calculation is performed between the template image after the change and the template image after the change, the grayscale image for determination and the template image may be converted into an image substantially symmetric with respect to the symmetry axis by the method described in the second embodiment. good.

また上述の各実施形態では判定対象の対象物が、対称軸に対して線対称な形状をしている人物の顔の場合について説明を行ったが、対象物の形状を対称軸に対して線対称な形状に限定する趣旨のものではなく、対象物の形状が対称の中心に対して点対称な形状である場合(例えば菱形状の対象物)にも、照明条件が不均一な場合には対象物の画像の一部分を、対称の中心に対して対称な位置まで回転させることで反転画像を作成し、この反転画像と反転前の画像とから対称の中心に対して略点対称な濃淡画像を作成し、この濃淡画像を用いて相関値演算を行うようにしても良い。   In each of the above-described embodiments, the case where the object to be determined is a human face having a line-symmetric shape with respect to the symmetry axis has been described. However, the shape of the object is linear with respect to the symmetry axis. It is not intended to be limited to a symmetric shape, and when the object is in a point-symmetric shape with respect to the center of symmetry (for example, a diamond-shaped object), if the illumination conditions are not uniform A reversed image is created by rotating a part of the image of the object to a position symmetric with respect to the center of symmetry, and a grayscale image that is substantially point-symmetric with respect to the center of symmetry from this reversed image and the image before the reversal. And a correlation value calculation may be performed using this grayscale image.

実施形態1の画像処理装置を示すブロック図である。1 is a block diagram illustrating an image processing apparatus according to a first embodiment. (a)(b)は同上に用いる濃淡画像の説明図である。(A) (b) is explanatory drawing of the grayscale image used for the same as the above. (a)(b)は実施形態2に用いる濃淡画像の説明図である。(A) (b) is explanatory drawing of the grayscale image used for Embodiment 2. FIG. 実施形態3の画像処理装置の動作を説明するフローチャートである。10 is a flowchart for explaining the operation of the image processing apparatus according to the third embodiment. 実施形態4の画像処理装置の動作を説明するフローチャートである。10 is a flowchart for explaining the operation of the image processing apparatus according to the fourth embodiment. 実施形態5の画像処理装置の動作を説明するフローチャートである。10 is a flowchart for explaining the operation of the image processing apparatus according to the fifth embodiment. (a)(b)は従来のパターンマッチングを説明する説明図である。(A) (b) is explanatory drawing explaining the conventional pattern matching. (a)は均一な照明条件下で撮像された濃淡画像の例図、(b)は不均一な照明条件下で撮像された濃淡画像の例図である。(A) is an example figure of the grayscale image imaged on uniform illumination conditions, (b) is an example figure of the grayscale image imaged on nonuniform illumination conditions.

符号の説明Explanation of symbols

1 撮像手段
2 A/D変換手段
3 保持手段
4 判定手段
DESCRIPTION OF SYMBOLS 1 Imaging means 2 A / D conversion means 3 Holding means 4 Judgment means

Claims (7)

判定対象となる対象物を含む濃淡画像を得て、該濃淡画像から前記対象物の特徴を含む領域を抽出して作成したテンプレート画像を予め保持しておき、前記対象物を含むか否かを判定するための判定用の濃淡画像を得て、該濃淡画像と前記テンプレート画像との相関値演算を行い、この演算結果から前記判定用の濃淡画像中における前記対象物の存否を判定するにあたり、前記対象物の形状が対称要素に対して略対称な形状である場合に、前記テンプレート画像又は前記判定用の濃淡画像の内少なくとも何れか一方の画像を得る過程において、前記少なくとも何れか一方の画像が前記対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて相関値演算を行うことを特徴とする画像処理方法。   Obtaining a grayscale image including the target object to be determined, extracting a region including the characteristics of the target object from the grayscale image, holding in advance a template image, and whether or not the target object is included Obtaining a grayscale image for determination for determination, performing a correlation value calculation between the grayscale image and the template image, and determining the presence or absence of the object in the grayscale image for determination from this calculation result, In the process of obtaining at least one of the template image and the gray image for determination when the shape of the object is substantially symmetrical with respect to a symmetric element, the at least one image is obtained. An image processing method comprising: performing correction processing so that a gray image is substantially symmetric with respect to the symmetric element, and performing correlation value calculation using the corrected gray image. 前記補正処理が、前記少なくとも何れか一方の画像において、前記対称要素に対して略対称な位置にある2つの画素の濃度平均値を求め、この濃度平均値を前記2つの画素の濃度値とする処理であることを特徴とする請求項1記載の画像処理方法。   In the correction process, in at least one of the images, a density average value of two pixels located substantially symmetrical with respect to the symmetry element is obtained, and this density average value is set as the density value of the two pixels. The image processing method according to claim 1, wherein the image processing method is processing. 均一な照明条件下で前記対象物を撮像して得た濃淡画像において各画素の濃度値の統計計算を行って得た基準値を予め求めておき、前記補正処理が、前記少なくとも何れか一方の画像において、前記対称要素に対して略対称な2つの領域で統計計算を行い、統計計算の結果が前記基準値に近い方の領域の各画素の濃度値で、他方の領域の各画素の濃度値を置きかえる処理であることを特徴とする請求項1記載の画像処理方法。   A reference value obtained by performing a statistical calculation of the density value of each pixel in a grayscale image obtained by imaging the object under uniform illumination conditions is obtained in advance, and the correction process is performed by the at least one of the above correction processes. In the image, statistical calculation is performed in two areas that are substantially symmetric with respect to the symmetric element, and the result of the statistical calculation is the density value of each pixel in the area closer to the reference value, and the density of each pixel in the other area The image processing method according to claim 1, wherein the process is a process of replacing a value. 前記判定用の濃淡画像中を前記テンプレート画像で走査して、前記テンプレート画像と最も相関値の高い相似領域を求め、前記相似領域で前記判定用の濃淡画像から前記テンプレート画像に相当する大きさの画像を切り出して、切り出された画像を前記対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像と前記テンプレート画像とで相関値演算を行って演算結果をもとに前記対象物の存否を判定することを特徴とする請求項1〜3の何れか1つに記載の画像処理方法   The determination image is scanned with the template image to obtain a similar region having the highest correlation value with the template image, and the similarity region has a size corresponding to the template image from the determination gray image. The image is cut out, the cut out image is corrected so as to be a gray image that is substantially symmetric with respect to the symmetric element, and a correlation value calculation is performed between the corrected gray image and the template image to obtain a calculation result. The image processing method according to claim 1, wherein the presence or absence of the object is determined. 前記テンプレート画像は、前記濃淡画像から前記対象物の特徴を含む領域を抽出した画像を、前記対称要素に対して略対称な濃淡画像となるように補正して得られた画像であることを特徴とする請求項1〜4の何れか1つに記載の画像処理方法。   The template image is an image obtained by correcting an image obtained by extracting a region including the feature of the object from the grayscale image so as to become a grayscale image substantially symmetric with respect to the symmetric element. The image processing method according to any one of claims 1 to 4. 前記判定用の濃淡画像中を前記テンプレート画像で走査して、前記テンプレート画像と最も相関値の高い第1相似領域を求め、この第1相似領域で相関値演算を行う処理と、前記第1相似領域で前記判定用の濃淡画像から前記テンプレート画像に相当する大きさの画像を切り出して、切り出された画像を前記対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像と前記テンプレート画像とで相関値演算を行う処理と、前記テンプレート画像を対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像を新たなテンプレート画像とし、前記判定用の濃淡画像中を変更後の前記テンプレート画像で走査して、変更後の前記テンプレート画像と最も相関値の高い第2相似領域を求め、この第2相似領域で相関値演算を行う処理と、前記第2相似領域で前記判定用の濃淡画像から変更後の前記テンプレート画像に相当する大きさの画像を切り出して、切り出された画像を前記対称要素に対して略対称な濃淡画像となるように補正し、補正後の濃淡画像と変更後の前記テンプレート画像とで相関値演算を行う処理とを行い、少なくとも何れか1つの相関値演算の結果が所定のしきい値を超えると、対象物が存在すると判断することを特徴とする請求項1〜5の何れか1つに記載の画像処理方法   Scanning the gray image for determination with the template image, obtaining a first similarity region having the highest correlation value with the template image, and performing a correlation value calculation in the first similarity region; and the first similarity An image having a size corresponding to the template image is cut out from the gray image for determination in the region, and the cut image is corrected so as to become a gray image substantially symmetric with respect to the symmetric element. Processing for calculating a correlation value between the image and the template image, correcting the template image so as to become a gray image that is substantially symmetrical with respect to a symmetric element, setting the corrected gray image as a new template image, and performing the determination The gray image for scanning is scanned with the template image after the change, and the second similar region having the highest correlation value with the template image after the change is obtained, and the correlation is performed in the second similar region. A process of performing an operation, and an image having a size corresponding to the template image after change is cut out from the grayscale image for determination in the second similar region, and the cut-out image is substantially symmetrical with respect to the symmetric element. A correction is performed so that a grayscale image is obtained, and a correlation value calculation is performed on the corrected grayscale image and the modified template image, and at least one of the correlation value calculation results in a predetermined threshold value. The image processing method according to any one of claims 1 to 5, wherein if it exceeds, it is determined that the object exists. 予め判定対象となる対象物を含む濃淡画像を得て、該濃淡画像から前記対象物の特徴を含む領域を抽出して作成したテンプレート画像を保持する保持手段と、前記対象物の存否を判定するための判定用の濃淡画像を入力する画像入力手段と、判定用の前記濃淡画像と前記テンプレート画像との相関値演算を行い、この演算結果から判定用の前記濃淡画像中における前記対象物の存否を判定する判定手段とを備え、
前記対象物の形状が対称要素に対して略対称な形状である場合に、前記判定手段が、前記テンプレート画像又は前記判定用の濃淡画像の内少なくとも何れか一方の画像を得る過程において、該画像が前記対称要素に対して略対称な濃淡画像となるような補正処理を行い、補正後の濃淡画像を用いて相関値演算を行うことを特徴とする画像処理装置。
Obtaining a grayscale image including a target object to be determined in advance, extracting a region including the characteristics of the target object from the grayscale image, holding means for holding a template image, and determining whether the target object exists Image input means for inputting a grayscale image for determination, and a correlation value calculation between the grayscale image for determination and the template image, and the presence or absence of the object in the grayscale image for determination is calculated from the calculation result Determining means for determining
When the shape of the object is substantially symmetric with respect to a symmetric element, the determination means obtains at least one of the template image and the gradation image for determination in the process of obtaining the image. An image processing apparatus that performs a correction process so as to form a gray image that is substantially symmetric with respect to the symmetric element, and performs a correlation value calculation using the gray image after correction.
JP2004160025A 2004-05-28 2004-05-28 Picture processing method and picture processor Pending JP2005339389A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004160025A JP2005339389A (en) 2004-05-28 2004-05-28 Picture processing method and picture processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004160025A JP2005339389A (en) 2004-05-28 2004-05-28 Picture processing method and picture processor

Publications (1)

Publication Number Publication Date
JP2005339389A true JP2005339389A (en) 2005-12-08

Family

ID=35492861

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004160025A Pending JP2005339389A (en) 2004-05-28 2004-05-28 Picture processing method and picture processor

Country Status (1)

Country Link
JP (1) JP2005339389A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008065729A1 (en) * 2006-11-29 2008-06-05 Fujitsu Limited Object detecting system, and object detecting method
JP2010108138A (en) * 2008-10-29 2010-05-13 Toyota Central R&D Labs Inc Person detection device and program
JP4829966B2 (en) * 2006-11-29 2011-12-07 富士通株式会社 Object detection system and object detection method
JP2012146182A (en) * 2011-01-13 2012-08-02 Kddi Corp Nail area detecting device and nail art simulator
JP2013235582A (en) * 2012-05-02 2013-11-21 Samsung Electronics Co Ltd Apparatus and method of controlling mobile terminal according to analysis of user's face
CN111563850A (en) * 2020-03-20 2020-08-21 维沃移动通信有限公司 Image processing method and electronic equipment
CN114881954A (en) * 2022-04-28 2022-08-09 南通奥尔嘉橡塑有限公司 Data transmission method for remote monitoring of rubber production

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11185025A (en) * 1997-12-22 1999-07-09 Victor Co Of Japan Ltd Face image normalization device
JPH11306325A (en) * 1998-04-24 1999-11-05 Toshiba Tec Corp Method and device for object detection
JP2000242768A (en) * 1999-02-19 2000-09-08 Fuji Photo Film Co Ltd Method and device for detecting position, and recording medium
US20030223623A1 (en) * 2002-06-03 2003-12-04 Srinivas Gutta Face-recognition using half-face images
JP2005084824A (en) * 2003-09-05 2005-03-31 Toshiba Corp Face image collation apparatus and face image collation method and passage controller
JP2005084883A (en) * 2003-09-08 2005-03-31 Matsushita Electric Works Ltd Image processing method and image processor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11185025A (en) * 1997-12-22 1999-07-09 Victor Co Of Japan Ltd Face image normalization device
JPH11306325A (en) * 1998-04-24 1999-11-05 Toshiba Tec Corp Method and device for object detection
JP2000242768A (en) * 1999-02-19 2000-09-08 Fuji Photo Film Co Ltd Method and device for detecting position, and recording medium
US20030223623A1 (en) * 2002-06-03 2003-12-04 Srinivas Gutta Face-recognition using half-face images
JP2005084824A (en) * 2003-09-05 2005-03-31 Toshiba Corp Face image collation apparatus and face image collation method and passage controller
JP2005084883A (en) * 2003-09-08 2005-03-31 Matsushita Electric Works Ltd Image processing method and image processor

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008065729A1 (en) * 2006-11-29 2008-06-05 Fujitsu Limited Object detecting system, and object detecting method
WO2008065717A1 (en) * 2006-11-29 2008-06-05 Fujitsu Limited Pedestrian detecting system, and pedestrian detecting method
US8045759B2 (en) 2006-11-29 2011-10-25 Fujitsu Limited Object detection system and method
JP4829966B2 (en) * 2006-11-29 2011-12-07 富士通株式会社 Object detection system and object detection method
JP2010108138A (en) * 2008-10-29 2010-05-13 Toyota Central R&D Labs Inc Person detection device and program
JP2012146182A (en) * 2011-01-13 2012-08-02 Kddi Corp Nail area detecting device and nail art simulator
JP2013235582A (en) * 2012-05-02 2013-11-21 Samsung Electronics Co Ltd Apparatus and method of controlling mobile terminal according to analysis of user's face
US10114458B2 (en) 2012-05-02 2018-10-30 Samsung Electronics Co., Ltd Apparatus and method of controlling mobile terminal based on analysis of user's face
CN111563850A (en) * 2020-03-20 2020-08-21 维沃移动通信有限公司 Image processing method and electronic equipment
CN111563850B (en) * 2020-03-20 2023-12-05 维沃移动通信有限公司 Image processing method and electronic equipment
CN114881954A (en) * 2022-04-28 2022-08-09 南通奥尔嘉橡塑有限公司 Data transmission method for remote monitoring of rubber production

Similar Documents

Publication Publication Date Title
KR100617390B1 (en) Face identification apparatus, face identification method, and medium for recording face identification program
US20210281748A1 (en) Information processing apparatus
JP2019012426A5 (en)
JP2013522754A (en) Iris recognition apparatus and method using a plurality of iris templates
JP4912206B2 (en) Image processing method, image processing apparatus, image processing system, and computer program
JP6529315B2 (en) Main subject detection method, main subject detection device and program
JP3926507B2 (en) Eye position and face position detection device
JPWO2008120321A1 (en) Image processing apparatus, image processing method, and image processing program
JP2004094491A (en) Face orientation estimation device and method and its program
US9600871B2 (en) Image correcting apparatus, image correcting method and computer readable recording medium recording program thereon
JP2007258869A (en) Image trimming method and apparatus, and program
JP5937823B2 (en) Image collation processing apparatus, image collation processing method, and image collation processing program
JP7387261B2 (en) Information processing device, information processing method and program
JP4728795B2 (en) Person object determination apparatus and person object determination program
JP5264457B2 (en) Object detection device
JP2005339389A (en) Picture processing method and picture processor
KR101302601B1 (en) Image processing apparatus for iris authentication and method thereof
JPH11306348A (en) Method and device for object detection
JP2014116033A (en) Personal authentication device, personal authentication method, camera, program, and storage medium
JP4165350B2 (en) Image processing method and image processing apparatus
JP2018160024A (en) Image processing device, image processing method and program
JP2007048108A (en) Image evaluation system, image evaluation method and image evaluation program
JPH11283036A (en) Object detector and object detection method
JPH03291776A (en) Fingerprint picture processor
JP4872895B2 (en) Face centerline detection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060913

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090908

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091109

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20091222