JP2007280088A - Specific object detection device, specific object detection method, and specific object detection program - Google Patents

Specific object detection device, specific object detection method, and specific object detection program Download PDF

Info

Publication number
JP2007280088A
JP2007280088A JP2006106067A JP2006106067A JP2007280088A JP 2007280088 A JP2007280088 A JP 2007280088A JP 2006106067 A JP2006106067 A JP 2006106067A JP 2006106067 A JP2006106067 A JP 2006106067A JP 2007280088 A JP2007280088 A JP 2007280088A
Authority
JP
Japan
Prior art keywords
detection
specific object
distance
value
feature amount
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
JP2006106067A
Other languages
Japanese (ja)
Inventor
Hironori Sumitomo
博則 墨友
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2006106067A priority Critical patent/JP2007280088A/en
Publication of JP2007280088A publication Critical patent/JP2007280088A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To more accurately and more efficiently detect a position and a size of a specific object in an image, by utilizing not only the relation between a distance and the size of an area for detection but a wider range of distance information to detect the specific object in an image and its size. <P>SOLUTION: A specific object in an image and its size are detected, by setting a suitable detection area according to distance, and analyzing not only the relation with size of an area for detection but also the spatial distribution of distance information in the detection area or extending the utilization of distance information to a periphery of the detection area. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、撮影された画像における被写体としての特定物体の存在とその位置を検出する特定物体検出装置、特定物体検出方法、及び特定物体検出プログラムに関する。   The present invention relates to a specific object detection device, a specific object detection method, and a specific object detection program for detecting the presence and position of a specific object as a subject in a captured image.

従来より、撮影画像などから被写体として特定の物体を検知する技術が開発されてきた。特に近年は、セキュリティ等の分野で、画像による人物の検知、特に特定の個人の認証などの要求が高まってきている。   Conventionally, a technique for detecting a specific object as a subject from a photographed image or the like has been developed. Particularly in recent years, in the field of security and the like, there has been an increasing demand for detection of a person using an image, particularly authentication of a specific individual.

いわゆるバイオメトリクス認証への要求の高まりの中で、ユーザビリティの優れた顔認証のアルゴリズム提案などが増加しつつあるが、例えば顔の認証を行うにしても、その前段階として顔の存在する位置と大きさを特定する必要がある。   In the growing demand for so-called biometrics authentication, face recognition algorithm proposals with excellent usability are increasing.For example, even when face authentication is performed, It is necessary to specify the size.

すなわち、特定物体(代表的には人物の顔)を検知し、画像中での位置と範囲を特定する技術が必須の技術ともいえる。   That is, it can be said that a technique for detecting a specific object (typically a human face) and specifying a position and a range in an image is an essential technique.

しかしながら、撮影された画像中に被写体として存在する顔領域の大きさは、被写体としての顔と撮影装置との距離によって大きさが変動するため、従来のテンプレートマッチングでは、テンプレートのサイズをさまざまに変えて、照合を行う必要があり、多大な時間と手間をかけることになっていた。   However, since the size of the face area that exists as a subject in the captured image varies depending on the distance between the face as the subject and the photographing device, the template size is changed in various ways in the conventional template matching. Therefore, it is necessary to perform collation, which is time-consuming and time-consuming.

また、検出精度面でもテンプレートマッチングのように画像情報だけの利用では、誤検出も多く、まだまだ十分な精度を得られるものではなかった。   Also, in terms of detection accuracy, use of only image information as in template matching has resulted in many false detections, and sufficient accuracy has not yet been obtained.

そういった点を解消するために、画像入力装置としてステレオカメラなどを用いて、撮影画像中の被写体に関する距離情報を手に入れ、距離と検知したい特定物体の大きさとの関係を利用することで、検出精度を上げたり、検出を効率化しようという技術が開発されてきた(例えば特許文献1、2及び3参照)。   To solve this problem, use a stereo camera as an image input device to obtain distance information about the subject in the captured image, and use the relationship between the distance and the size of the specific object to be detected. Techniques have been developed to increase accuracy and improve detection efficiency (see, for example, Patent Documents 1, 2, and 3).

特許文献1に記載の技術では、ステレオカメラを使用し、通常に画像から顔とその大きさを検出した後、検知した顔のサイズが適正であるかどうかを距離情報と照らし合わせて判定している。これにより通常の顔検出に対して精度面での向上を図ることができる。   In the technique described in Patent Document 1, a stereo camera is used to detect a face and its size from an image, and then determine whether the detected face size is appropriate by comparing it with distance information. Yes. Thereby, it is possible to improve the accuracy with respect to the normal face detection.

特許文献2に記載の技術では、ステレオカメラを使用し、得られた距離情報から適切な顔領域のサイズを限定し、その顔領域サイズに基づいて、顔領域の検出を行っている。これにより、検出前に顔のサイズが限定されるため、検出の速度、効率向上が図れる。   In the technique described in Patent Document 2, a stereo camera is used, the size of an appropriate face area is limited from the obtained distance information, and the face area is detected based on the face area size. Thereby, since the size of the face is limited before detection, the detection speed and efficiency can be improved.

また特許文献3に記載の技術では、やはりステレオカメラを使用し、得られた距離情報から顔領域のサイズを限定するとともに、それにより設定した検出領域内におけるその距離に該当する被写体の大きさがどの程度であるかによって、顔かどうかの判定を行っている。これにより、精度面と効率面での向上を図っている。
特開2000−222576号公報 特開2002−216129号公報 特開2005−301833号公報
The technique described in Patent Document 3 also uses a stereo camera, limits the size of the face area from the obtained distance information, and determines the size of the subject corresponding to the distance in the set detection area. Whether it is a face or not is determined depending on how much it is. As a result, improvements are made in accuracy and efficiency.
JP 2000-222576 A JP 2002-216129 A JP 2005-301833 A

上記した特許文献1、2及び3に記載の技術は、何れもステレオカメラなどを用いた視点の異なる複数の入力画像から、画像中の被写体の距離情報を算出し、その距離情報を利用することで、主として人物の顔である特定の物体の大きさとの関係から、検出の速さと精度を向上しようとするものである。   The techniques described in Patent Documents 1, 2, and 3 described above all calculate distance information of a subject in an image from a plurality of input images with different viewpoints using a stereo camera or the like, and use the distance information. Thus, the detection speed and accuracy are intended to be improved mainly from the relationship with the size of a specific object that is a human face.

しかしながら、これらの方法は距離情報を利用しているものの、距離と大きさとの関係だけから、従来の検出方法を補足的に支援するような利用方法であり、精度面でも、効率面でも十分に満足できるものではない。   However, although these methods use distance information, they are supplementary support methods for conventional detection methods based only on the relationship between distance and size, and they are sufficiently accurate and efficient. It is not satisfactory.

本発明の目的は、上記の課題を解決し、画像中の特定物体の位置と大きさを検出するのに距離情報を利用するに当たり、検出する領域のサイズとの関係だけでなく、より広範に距離情報を利用することにより、より精度よく、かつより効率的に画像中の特定物体とその大きさを検出できる特定物体検出装置、特定物体検出方法、及び特定物体検出プログラムを提供することである。   The object of the present invention is to solve the above-mentioned problems, and in using distance information to detect the position and size of a specific object in an image, not only the relationship with the size of the area to be detected, but also a wider range. To provide a specific object detection device, a specific object detection method, and a specific object detection program capable of detecting a specific object and its size in an image more accurately and more efficiently by using distance information .

上記の課題を解決するために、本発明は以下の特徴を有するものである。   In order to solve the above problems, the present invention has the following features.

1. 視点の異なる複数の入力画像を取得する入力画像取得手段と、前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段と、検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段と、前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段と、前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段と、前記検出領域設定手段により設定された前記検出領域の周辺に補助領域を設定し、該補助領域と前記検出領域の距離値の関係から第2の特徴量を算出する第2の特徴量算出手段と、前記第1の特徴量と前記第2の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段と、を有することを特徴とする特定物体検出装置。   1. Based on input image acquisition means for acquiring a plurality of input images from different viewpoints, distance image generation means for generating a distance image from the plurality of input images acquired by the input image acquisition means, and a predetermined specific object to be detected Based on the correspondence set by the correspondence setting means and the correspondence setting means for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object, the distance image A detection area setting means for setting a detection area of a size corresponding to the distance value, and for the detection area set by the detection area setting means, based on a size of an area satisfying the distance value corresponding to the size An auxiliary area is set around the detection area set by the first feature quantity calculating means for calculating the first feature quantity and the detection area setting means, and the auxiliary A second feature amount calculating means for calculating a second feature amount from a relationship between a distance value between the area and the detection region, and the detection region based on the first feature amount and the second feature amount. A specific object detection device for determining whether or not the predetermined specific object is detected.

2. 前記第1の特徴量算出手段は、前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、前記第2の特徴量算出手段は、前記検出領域の上部に前記補助領域を設定し、該補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を前記検出領域に対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する、ことを特徴とする1に記載の特定物体検出装置。   2. In the detection area, the first feature amount calculation means uses, as the first feature amount, a ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection region within a predetermined range to the total number of pixels. The second feature amount calculating means sets the auxiliary area above the detection area, and has the largest number of pixels having the average value, the median value, or the same distance value of the distance values in the auxiliary area. 2. The specific object detection device according to 1, wherein a distance value is compared with a distance value corresponding to the detection region, and an absolute value of the difference is calculated as a second feature amount.

3. 前記特定物体検出判定手段は、前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第2の特徴量が所定の第2の閾値より大きい場合に、前記特定物体を検出したと判定する、ことを特徴とする1または2に記載の特定物体検出装置。   3. The specific object detection determination unit detects the specific object when the first feature value is larger than a predetermined first threshold value and the second feature value is larger than a predetermined second threshold value. 3. The specific object detection device according to 1 or 2, wherein the determination is performed.

4. 視点の異なる複数の入力画像を取得する入力画像取得手段と、前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段と、検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段と、前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段と、前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段と、前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の空間分布に基づき第3の特徴量を算出する第3の特徴量算出手段と、前記第1の特徴量と前記第3の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段と、を有することを特徴とする特定物体検出装置。   4). Based on input image acquisition means for acquiring a plurality of input images from different viewpoints, distance image generation means for generating a distance image from the plurality of input images acquired by the input image acquisition means, and a predetermined specific object to be detected Based on the correspondence set by the correspondence setting means and the correspondence setting means for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object, the distance image A detection area setting means for setting a detection area of a size corresponding to the distance value, and for the detection area set by the detection area setting means, based on a size of an area satisfying the distance value corresponding to the size A distance corresponding to the size of the first feature value calculating means for calculating the first feature value and the detection area set by the detection area setting means. A third feature amount calculating unit configured to calculate a third feature amount based on a spatial distribution of a region satisfying the value; and the predetermined feature in the detection region based on the first feature amount and the third feature amount. And a specific object detection judging means for judging whether or not a specific object is detected.

5. 前記第1の特徴量算出手段は、前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、前記第3の特徴量算出手段は、前記検出領域を水平方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、または前記検出領域を垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった垂直方向差分値、を第3の特徴量として算出する、ことを特徴とする4に記載の特定物体検出装置。   5. In the detection area, the first feature amount calculation means uses, as the first feature amount, a ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection region within a predetermined range to the total number of pixels. And the third feature amount calculating means calculates a sum of distance values in each region obtained by dividing the detection region into two in the horizontal direction, and takes a horizontal difference value obtained by taking an absolute value of the difference of each sum, Alternatively, the sum of the distance values is calculated in each region obtained by dividing the detection region into two in the vertical direction, and the vertical direction difference value obtained by taking the absolute value of the difference of each sum is calculated as the third feature amount. 5. The specific object detection device according to 4,

6. 前記特定物体検出判定手段は、前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第3の特徴量が所定の第3の閾値より小さい場合に、前記特定物体を検出したと判定する、ことを特徴とする4または5に記載の特定物体検出装置。   6). The specific object detection determination unit detects the specific object when the first feature value is larger than a predetermined first threshold value and the third feature value is smaller than a predetermined third threshold value. 4. The specific object detection device according to 4 or 5, wherein the determination is performed.

7. 前記距離画像の生成に用いた複数の入力画像の一つである第1の画像に対して、前記検出領域設定手段により前記距離画像内に設定された前記検出領域の位置と対応する前記第1の入力画像内の位置に第2の検出領域を設定する第2の検出領域設定手段と、前記第2の検出領域に対して、前記特定物体の検出を行い、検出したかどうかを判定する入力画像判定手段とを有し、前記特定物体検出判定手段は、前記入力画像判定手段による判定結果に基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する、ことを特徴とする1乃至6の何れか1項に記載の特定物体検出装置。   7). The first image corresponding to the position of the detection area set in the distance image by the detection area setting means with respect to a first image that is one of a plurality of input images used for generating the distance image. A second detection area setting means for setting a second detection area at a position in the input image, and an input for detecting whether or not the specific object is detected in the second detection area. An image determination unit, and the specific object detection determination unit determines whether the predetermined specific object is detected in the detection region based on a determination result by the input image determination unit. The specific object detection device according to any one of 1 to 6.

8. 前記特定物体検出判定手段によって検出判定される特定物体は顔である、ことを特徴とする1乃至7の何れか1項に記載の特定物体検出装置。   8). The specific object detection apparatus according to any one of 1 to 7, wherein the specific object detected and determined by the specific object detection determination unit is a face.

9. 視点の異なる複数の入力画像を取得する入力画像取得工程と、前記入力画像取得工程において取得された複数の入力画像から距離画像を生成する距離画像生成工程と、検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定工程と、前記対応関係設定工程において設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定工程と、前記検出領域設定工程において設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出工程と、前記検出領域設定工程において設定された前記検出領域の周辺に補助領域を設定し、該補助領域と前記検出領域の距離値の関係から第2の特徴量を算出する第2の特徴量算出工程と、前記第1の特徴量と前記第2の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定工程と、を有することを特徴とする特定物体検出方法。   9. Based on an input image acquisition step of acquiring a plurality of input images with different viewpoints, a distance image generation step of generating a distance image from the plurality of input images acquired in the input image acquisition step, and a predetermined specific object to be detected Based on the correspondence set in the correspondence setting step, the correspondence setting step for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object, the distance image A detection region setting step for setting a detection region having a size corresponding to the distance value in the detection region, and for the detection region set in the detection region setting step, based on a size of a region satisfying the distance value corresponding to the size An auxiliary region is set around the detection region set in the first feature amount calculation step for calculating the first feature amount and the detection region setting step. Based on the second feature value calculating step for calculating the second feature value from the relationship between the distance value between the auxiliary region and the detection region, and the detection based on the first feature value and the second feature value. And a specific object detection determining step for determining whether or not the predetermined specific object is detected in a region.

10. 前記第1の特徴量算出工程では、前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、前記第2の特徴量算出工程では、前記検出領域の上部に前記補助領域を設定し、該補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を前記検出領域に対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する、ことを特徴とする9に記載の特定物体検出方法。   10. In the first feature amount calculating step, in the detection region, a ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection region within a predetermined range to the total number of pixels is used as the first feature amount. In the second feature amount calculation step, the auxiliary region is set above the detection region, and the average value, median value, or the same distance value of the distance values in the auxiliary region is the largest. 10. The specific object detection method according to 9, wherein a distance value is compared with a distance value corresponding to the detection area, and an absolute value of the difference is calculated as a second feature amount.

11. 前記特定物体検出判定工程では、前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第2の特徴量が所定の第2の閾値より大きい場合に、前記特定物体を検出したと判定する、ことを特徴とする9または10に記載の特定物体検出方法。   11. In the specific object detection determination step, the specific object is detected when the first feature amount is larger than a predetermined first threshold value and the second feature amount is larger than a predetermined second threshold value. 11. The specific object detection method according to 9 or 10, wherein the determination is performed.

12. 視点の異なる複数の入力画像を取得する入力画像取得工程と、前記入力画像取得工程において取得された複数の入力画像から距離画像を生成する距離画像生成工程と、検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定工程と、前記対応関係設定工程において設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定工程と、前記検出領域設定工程において設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出工程と、前記検出領域設定工程において設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の空間分布に基づき第3の特徴量を算出する第3の特徴量算出工程と、前記第1の特徴量と前記第3の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定工程と、を有することを特徴とする特定物体検出方法。   12 Based on an input image acquisition step of acquiring a plurality of input images with different viewpoints, a distance image generation step of generating a distance image from the plurality of input images acquired in the input image acquisition step, and a predetermined specific object to be detected Based on the correspondence set in the correspondence setting step, the correspondence setting step for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object, the distance image A detection region setting step for setting a detection region having a size corresponding to the distance value in the detection region, and for the detection region set in the detection region setting step, based on a size of a region satisfying the distance value corresponding to the size The first feature value calculating step for calculating the first feature value and the size of the detection region set in the detection region setting step In the detection region based on the third feature amount calculating step for calculating the third feature amount based on the spatial distribution of the region satisfying the distance value to be performed, and on the first feature amount and the third feature amount. A specific object detection determination step for determining whether or not the predetermined specific object has been detected.

13. 前記第1の特徴量算出工程では、前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、前記第3の特徴量算出工程では、前記検出領域を水平方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、または前記検出領域を垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった垂直方向差分値、を第3の特徴量として算出する、ことを特徴とする12に記載の特定物体検出方法。   13. In the first feature amount calculating step, in the detection region, a ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection region within a predetermined range to the total number of pixels is used as the first feature amount. And in the third feature amount calculating step, a total sum of distance values is calculated in each region obtained by dividing the detection region into two in the horizontal direction, and a horizontal direction difference value obtained by taking an absolute value of each sum difference, Alternatively, the sum of the distance values is calculated in each region obtained by dividing the detection region into two in the vertical direction, and the vertical direction difference value obtained by taking the absolute value of the difference of each sum is calculated as the third feature amount. 13. The specific object detection method according to 12,

14. 前記特定物体検出判定工程では、前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第3の特徴量が所定の第3の閾値より小さい場合に、前記特定物体を検出したと判定する、ことを特徴とする12または13に記載の特定物体検出方法。   14 In the specific object detection determining step, the specific object is detected when the first feature value is larger than a predetermined first threshold value and the third feature value is smaller than a predetermined third threshold value. 14. The specific object detection method according to 12 or 13, wherein the determination is performed.

15. 前記距離画像の生成に用いた複数の入力画像の一つである第1の画像に対して、前記検出領域設定工程において前記距離画像内に設定された前記検出領域の位置と対応する前記第1の入力画像内の位置に第2の検出領域を設定する第2の検出領域設定工程と、前記第2の検出領域に対して、前記特定物体の検出を行い、検出したかどうかを判定する入力画像判定工程とを有し、前記特定物体検出判定工程では、前記入力画像判定工程における判定結果に基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する、ことを特徴とする9乃至14の何れか1項に記載の特定物体検出方法。   15. The first image corresponding to the position of the detection area set in the distance image in the detection area setting step with respect to a first image that is one of a plurality of input images used for generation of the distance image. A second detection region setting step for setting a second detection region at a position in the input image of the input, and an input for detecting whether or not the specific object is detected in the second detection region. An image determination step, wherein the specific object detection determination step determines whether or not the predetermined specific object is detected in the detection region based on a determination result in the input image determination step. The specific object detection method according to any one of 9 to 14.

16. 前記特定物体検出判定工程において検出判定される特定物体は顔である、ことを特徴とする9乃至15の何れか1項に記載の特定物体検出方法。   16. 16. The specific object detection method according to claim 9, wherein the specific object detected and determined in the specific object detection determination step is a face.

17. 特定物体の検出処理を制御するコンピュータを、視点の異なる複数の入力画像を取得する入力画像取得手段、前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段、検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段、前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段、前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段、前記検出領域設定手段により設定された前記検出領域の周辺に補助領域を設定し、該補助領域と前記検出領域の距離値の関係から第2の特徴量を算出する第2の特徴量算出手段、前記第1の特徴量と前記第2の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段、として機能させることを特徴とする特定物体検出プログラム。   17. A computer that controls the detection processing of the specific object; an input image acquisition unit that acquires a plurality of input images from different viewpoints; a distance image generation unit that generates a distance image from the plurality of input images acquired by the input image acquisition unit; Based on a predetermined specific object to be detected, the correspondence setting means for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object, the correspondence setting means is set. Based on the correspondence, a detection area setting means for setting a detection area having a size corresponding to the distance value in the distance image, and a distance value corresponding to the size for the detection area set by the detection area setting means. A first feature amount calculating means for calculating a first feature amount based on a size of a region to be filled, and the detection region set by the detection region setting means. A second feature amount calculating means for calculating a second feature amount from a relationship between a distance value between the assist region and the detection region, and the first feature amount and the second feature. A specific object detection program that functions as specific object detection determination means for determining whether or not the predetermined specific object is detected in the detection region based on the amount.

18. 前記第1の特徴量算出手段は、前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、前記第2の特徴量算出手段は、前記検出領域の上部に前記補助領域を設定し、該補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を前記検出領域に対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する、ことを特徴とする17に記載の特定物体検出プログラム。   18. In the detection area, the first feature amount calculation means uses, as the first feature amount, a ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection region within a predetermined range to the total number of pixels. The second feature amount calculating means sets the auxiliary area above the detection area, and has the largest number of pixels having the average value, the median value, or the same distance value of the distance values in the auxiliary area. 18. The specific object detection program according to 17, wherein a distance value is compared with a distance value corresponding to the detection area, and an absolute value of the difference is calculated as a second feature amount.

19. 前記特定物体検出判定手段は、前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第2の特徴量が所定の第2の閾値より大きい場合に、前記特定物体を検出したと判定する、ことを特徴とする17または18に記載の特定物体検出プログラム。   19. The specific object detection determination unit detects the specific object when the first feature value is larger than a predetermined first threshold value and the second feature value is larger than a predetermined second threshold value. The specific object detection program according to 17 or 18, wherein the determination is performed.

20. 特定物体の検出処理を制御するコンピュータを、視点の異なる複数の入力画像を取得する入力画像取得手段、前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段、検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段、前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段、前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段、前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の空間分布に基づき第3の特徴量を算出する第3の特徴量算出手段、前記第1の特徴量と前記第3の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段、として機能させることを特徴とする特定物体検出プログラム。   20. A computer that controls the detection processing of the specific object; an input image acquisition unit that acquires a plurality of input images from different viewpoints; a distance image generation unit that generates a distance image from the plurality of input images acquired by the input image acquisition unit; Based on a predetermined specific object to be detected, the correspondence setting means for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object, the correspondence setting means is set. Based on the correspondence, a detection area setting means for setting a detection area having a size corresponding to the distance value in the distance image, and a distance value corresponding to the size for the detection area set by the detection area setting means. A first feature amount calculating means for calculating a first feature amount based on a size of a region to be filled, and the detection region set by the detection region setting means. A third feature amount calculating means for calculating a third feature amount based on a spatial distribution of a region satisfying a distance value corresponding to the size, the first feature amount and the third feature amount; Based on this, a specific object detection program that functions as specific object detection determination means for determining whether or not the predetermined specific object has been detected in the detection region.

21. 前記第1の特徴量算出手段は、前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、前記第3の特徴量算出手段は、前記検出領域を水平方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、または前記検出領域を垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった垂直方向差分値、を第3の特徴量として算出する、ことを特徴とする20に記載の特定物体検出プログラム。   21. In the detection area, the first feature amount calculation means uses, as the first feature amount, a ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection region within a predetermined range to the total number of pixels. And the third feature amount calculating means calculates a sum of distance values in each region obtained by dividing the detection region into two in the horizontal direction, and takes a horizontal difference value obtained by taking an absolute value of the difference of each sum, Alternatively, the sum of the distance values is calculated in each region obtained by dividing the detection region into two in the vertical direction, and the vertical direction difference value obtained by taking the absolute value of the difference of each sum is calculated as the third feature amount. 21. The specific object detection program according to 20,

22. 前記特定物体検出判定手段は、前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第3の特徴量が所定の第3の閾値より小さい場合に、前記特定物体を検出したと判定する、ことを特徴とする20または21に記載の特定物体検出プログラム。   22. The specific object detection determination unit detects the specific object when the first feature value is larger than a predetermined first threshold value and the third feature value is smaller than a predetermined third threshold value. The specific object detection program according to 20 or 21, wherein the determination is performed.

23. 前記コンピュータを、前記距離画像の生成に用いた複数の入力画像の一つである第1の画像に対して、前記検出領域設定手段により前記距離画像内に設定された前記検出領域の位置と対応する前記第1の入力画像内の位置に第2の検出領域を設定する第2の検出領域設定手段、前記第2の検出領域に対して、前記特定物体の検出を行い、検出したかどうかを判定する入力画像判定手段、として機能させ、前記特定物体検出判定手段は、前記入力画像判定手段による判定結果に基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する、ことを特徴とする17乃至22の何れか1項に記載の特定物体検出プログラム。   23. The computer corresponds to the position of the detection area set in the distance image by the detection area setting means with respect to a first image that is one of a plurality of input images used to generate the distance image. Second detection area setting means for setting a second detection area at a position in the first input image, detecting the specific object with respect to the second detection area, and determining whether or not it has been detected. Functioning as an input image determination unit for determining, wherein the specific object detection determination unit determines whether the predetermined specific object has been detected in the detection region based on a determination result by the input image determination unit. The specific object detection program according to any one of 17 to 22, characterized by:

24. 前記特定物体検出判定手段によって検出判定される特定物体は顔である、ことを特徴とする17乃至23の何れか1項に記載の特定物体検出プログラム。   24. The specific object detection program according to any one of claims 17 to 23, wherein the specific object detected and determined by the specific object detection determination means is a face.

本発明によれば、画像中の特定物体の位置と大きさを検出するのに距離情報を利用するに当たり、距離に応じた適切な検出領域を設定するとともに、検出する領域のサイズとの関係だけでなく、検出領域での距離情報の空間分布を解析する、あるいは検出領域周辺部まで距離情報利用を拡張することにより、より精度よく、かつより効率的に画像中の特定物体とその大きさを検出できる特定物体検出装置、特定物体検出方法、及び特定物体検出プログラムを提供することができる。   According to the present invention, in using distance information to detect the position and size of a specific object in an image, an appropriate detection area corresponding to the distance is set and only the relationship with the size of the area to be detected is set. Rather than analyzing the spatial distribution of distance information in the detection area or extending the use of distance information to the periphery of the detection area, the specific object and its size in the image can be more accurately and more efficiently A specific object detection apparatus, a specific object detection method, and a specific object detection program that can be detected can be provided.

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

(特定物体検出装置の機能構成)
図1は、本発明に係る特定物体検出装置の一実施形態について、その機能構成を示すブロック図である。図1を用いて特定物体検出装置の一実施形態を説明する。
(Functional configuration of specific object detection device)
FIG. 1 is a block diagram showing a functional configuration of a specific object detection device according to an embodiment of the present invention. An embodiment of the specific object detection apparatus will be described with reference to FIG.

本発明に係る特定物体検出装置は、一般的にコンピュータなどによる画像情報処理機能を中心として機能構成される。   The specific object detection apparatus according to the present invention is generally configured mainly with an image information processing function by a computer or the like.

図1において、10は特定物体検出処理部であり、特定物体を検出するためのさまざまな画像情報処理機能を有しており、具体的にはコンピュータが各処理プログラムを実行することにより、その機能が実現される。101の入力部、102の操作部、103の記憶部、104の表示部、そして105の出力部は、特定物体検出処理部10の機能を動作させるための付帯装置、あるいはインタフェイス装置などである。   In FIG. 1, reference numeral 10 denotes a specific object detection processing unit, which has various image information processing functions for detecting a specific object. Specifically, the function is executed by the computer executing each processing program. Is realized. An input unit 101, an operation unit 102, a storage unit 103, a display unit 104, and an output unit 105 are auxiliary devices or interface devices for operating the functions of the specific object detection processing unit 10. .

入力部101は、特定物体を検出する対象となる画像を特定物体検出処理部10に入力する。撮影装置を内蔵、あるいは接続していてもよいし、外部から画像データを受信するような形態であってもよい。   The input unit 101 inputs an image that is a target for detecting a specific object to the specific object detection processing unit 10. An imaging device may be built in or connected, or image data may be received from the outside.

操作部102は、特定物体検出処理部10がその機能を実行するに際して、必要な指示やパラメータなどを入力するための装置である。一般的にはキーボードなどが用いられる。   The operation unit 102 is a device for inputting necessary instructions and parameters when the specific object detection processing unit 10 executes the function. In general, a keyboard or the like is used.

記憶部103は、処理プログラムや画像データそのもの以外に、特定物体検出処理部10が処理実行中に一時保存しておくべき各種データを記憶する。例えば、最終検出結果が出る前の途中段階での検出判定結果などを一時保存しておく。   In addition to the processing program and the image data itself, the storage unit 103 stores various types of data that the specific object detection processing unit 10 should temporarily store while executing the processing. For example, the detection determination result in the middle stage before the final detection result is obtained is temporarily stored.

表示部104は、特定物体検出処理部10が処理実行中にその途中状況や、指示を出すために必要な結果などを知らせるための表示を行う。具体的には、液晶パネルなどの表示装置が一般に用いられる。   The display unit 104 performs a display for informing the situation during execution of the specific object detection processing unit 10 and a result necessary for issuing an instruction. Specifically, a display device such as a liquid crystal panel is generally used.

出力部105は、特定物体検出処理部10による処理結果を出力する装置であり、具体的にはプリンタであったり、外部機器への送信装置であったり、あるいは、認証など再利用のために整理された状態で記憶部に送る装置であったりする。   The output unit 105 is a device that outputs the processing result of the specific object detection processing unit 10, specifically, a printer, a transmission device to an external device, or arranged for reuse such as authentication. It may be a device that sends it to the storage unit in a state that has been done.

特定物体検出処理部10は、以下のような機能要素から構成される。   The specific object detection processing unit 10 includes the following functional elements.

11は入力画像取得部であり、入力部101から入力画像を取得する。すなわち、入力画像取得手段として機能する。   Reference numeral 11 denotes an input image acquisition unit that acquires an input image from the input unit 101. That is, it functions as an input image acquisition unit.

本実施形態では、入力画像は視点の異なる複数の入力画像からなる。一般にはステレオ画像を生成するための複数画像である。すなわち本発明は、画像における距離情報を利用することにより、より効率的な特定物体検出を行おうとするものである。   In the present embodiment, the input image is composed of a plurality of input images having different viewpoints. Generally, it is a plurality of images for generating a stereo image. That is, the present invention intends to perform more efficient specific object detection by using distance information in an image.

なお、特定物体としては、種々のものを想定することができるが、近年盛んに行われているのは、人物を特定するために画像、特に顔画像を用いることである。セキュリティ、その他の観点から個人に負担の少ない簡便な個人認証方法として開発が進められており、そのためにもまず画像中の顔の存在とその位置を簡単に精度よく特定することが求められている。本実施形態では、特定物体として顔を例にとり、以下の説明を進めることにする。   Various objects can be assumed as the specific object, but what has been actively performed in recent years is to use an image, particularly a face image, in order to specify a person. Development is being promoted as a simple personal authentication method that places little burden on individuals from security and other viewpoints. To this end, it is first required to easily and accurately identify the presence and position of a face in an image. . In the present embodiment, the following description will be given by taking a face as an example of the specific object.

12は距離画像生成部であり、入力画像取得部11から受け取った複数の入力画像を用いて、各画素が距離情報を有する距離画像を生成する。すなわち、距離画像生成手段として機能する。距離画像生成の詳細については、後で図3を参照して詳細に説明する。   A distance image generation unit 12 generates a distance image in which each pixel has distance information using a plurality of input images received from the input image acquisition unit 11. That is, it functions as a distance image generation means. Details of the distance image generation will be described later in detail with reference to FIG.

13は対応関係設定部であり、検出すべき所定の特定物体(本実施形態では顔)に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する。すなわち、対応関係設定手段として機能する。   Reference numeral 13 denotes a correspondence setting unit, which determines the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object based on a predetermined specific object to be detected (a face in the present embodiment). Set. That is, it functions as correspondence setting means.

特定物体、つまり顔は、距離に応じて画像中でのサイズが変化する。しかし効率的に検出するには、顔のサイズに合わせた検出領域サイズ設定が望ましい。距離と画像中での顔サイズの関係を予め設定できれば、距離情報を利用して顔のサイズに合った検出領域のサイズ設定が可能になる。   The size of the specific object, that is, the face, changes in the image according to the distance. However, for efficient detection, it is desirable to set the detection area size according to the face size. If the relationship between the distance and the face size in the image can be set in advance, it is possible to set the size of the detection region that matches the face size using the distance information.

撮影条件などから距離と一般的な顔サイズ、すなわち検出領域サイズの関係を求める。設定した対応関係は、特定物体検出処理中に頻繁に利用するので、データテーブルなどの形態で記憶部103に記憶しておくことが望ましい。   The relationship between the distance and the general face size, that is, the detection area size is obtained from the imaging conditions. Since the set correspondence is frequently used during the specific object detection process, it is desirable to store it in the storage unit 103 in the form of a data table or the like.

20は検出領域処理部であり、対応関係設定部13の対応関係に基づき検出領域を設定し、検出領域毎に特定物体検出処理を行う。検出領域処理部20を構成する各機能要素については、後述する。   Reference numeral 20 denotes a detection region processing unit, which sets a detection region based on the correspondence relationship of the correspondence relationship setting unit 13 and performs a specific object detection process for each detection region. Each functional element constituting the detection area processing unit 20 will be described later.

14は特定物体検出処理制御部であり、特定物体検出処理部10で行われる特定物体検出処理全体の制御を行う。動作フローの詳細は図2を参照して後述するが、上述した検出領域処理部20で行われる処理、すなわち検出領域を設定して行う検出処理を、画像全体に渡って検出領域をスキャンさせながら反復し、検出判定を繰り返しながら、最終的に全体の結果を提出するという流れを制御する。   A specific object detection processing control unit 14 controls the entire specific object detection process performed by the specific object detection processing unit 10. The details of the operation flow will be described later with reference to FIG. 2, but the processing performed by the detection region processing unit 20 described above, that is, the detection processing performed by setting the detection region is performed while scanning the detection region over the entire image. It repeats and controls the flow of finally submitting the entire result while repeating the detection determination.

15は特定物体検出処理出力部であり、検出領域処理部20で繰り返し行われる検出領域処理、すなわち検出領域毎の検出結果をまとめ、特定物体検出処理部10で行われる特定物体検出処理全体の最終検出結果として、出力部105へ送り出す機能を有する。   Reference numeral 15 denotes a specific object detection processing output unit. The detection region processing repeatedly performed by the detection region processing unit 20, that is, the detection results for each detection region are collected, and the final specific object detection processing performed by the specific object detection processing unit 10 is finalized. As a detection result, it has a function of sending it to the output unit 105.

特定物体検出処理部10を構成する機能要素は以上であるが、検出領域処理部20については、以下のような機能要素から構成される。   The functional elements constituting the specific object detection processing unit 10 are as described above, but the detection area processing unit 20 includes the following functional elements.

21は検出領域設定部であり、対応関係設定部13の対応関係に基づき、距離画像生成部12で生成された距離画像中の位置に応じて、その位置での距離値に対応するサイズの検出領域を設定する。すなわち、検出領域設定手段として機能する。詳細は図5を参照して、後述する。   Reference numeral 21 denotes a detection area setting unit. Based on the correspondence relationship of the correspondence relationship setting unit 13, according to the position in the distance image generated by the distance image generation unit 12, the size corresponding to the distance value at that position is detected. Set the area. That is, it functions as detection area setting means. Details will be described later with reference to FIG.

23は第1の特徴量算出部であり、検出領域設定部21で設定された検出領域に対して、そのサイズに対応する距離値と同等の距離値を有する画素領域の、全領域に対する比率を第1の特徴量として算出する。すなわち、第1の特徴量算出手段として機能する。   Reference numeral 23 denotes a first feature amount calculation unit. For the detection region set by the detection region setting unit 21, the ratio of the pixel region having a distance value equivalent to the distance value corresponding to the size to the entire region is calculated. Calculated as the first feature amount. That is, it functions as a first feature amount calculation unit.

第1の特徴量は、検出領域のサイズに対して、顔であるとすればその大きさが妥当であるかを判断する基準となる。詳細は、図8を参照して後述する。   The first feature amount is a reference for determining whether the size of the detection area is appropriate if it is a face with respect to the size of the detection region. Details will be described later with reference to FIG.

24は第2の特徴量算出部であり、検出領域設定部21で設定された検出領域に対して、その上部に補助領域を設定し、補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を検出領域サイズに対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する。すなわち、第2の特徴量算出手段として機能する。   Reference numeral 24 denotes a second feature amount calculation unit, which sets an auxiliary region above the detection region set by the detection region setting unit 21, and calculates an average value, a median value, or a distance value in the auxiliary region. The distance value having the largest number of pixels having the same distance value is compared with the distance value corresponding to the detection area size, and the absolute value of the difference is calculated as the second feature amount. That is, it functions as a second feature amount calculation means.

第2の特徴量は、検出領域の位置の上部に同等距離の物体があるかどうかを示し、検出領域の位置における被写体が顔であるかどうかを判断する基準となる。詳細は、図10を参照して後述する。   The second feature amount indicates whether or not there is an object of the same distance above the position of the detection area, and serves as a reference for determining whether or not the subject at the position of the detection area is a face. Details will be described later with reference to FIG.

25は第3の特徴量算出部であり、検出領域設定部21で設定された検出領域に対して、水平方向または垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、または垂直方向差分値を第3の特徴量として算出する。すなわち、第3の特徴量算出手段として機能する。   Reference numeral 25 denotes a third feature amount calculation unit, which calculates the sum of distance values in each region divided into two in the horizontal direction or the vertical direction with respect to the detection region set by the detection region setting unit 21, and calculates each sum. A horizontal direction difference value or a vertical direction difference value obtained by taking the absolute value of the difference is calculated as the third feature amount. That is, it functions as a third feature amount calculation unit.

第3の特徴量は、もちろん水平方向差分値と垂直方向差分値の両方であってもよい。それらは検出領域の位置における被写体が上下、左右がほぼ均等な大きさを有する物体、例えば顔であるかどうかを判断する基準となる。詳細は、図12を参照して後述する。   Of course, the third feature amount may be both a horizontal direction difference value and a vertical direction difference value. They serve as a reference for determining whether or not the subject at the position of the detection area is an object having a substantially equal size in the vertical and horizontal directions, for example, a face. Details will be described later with reference to FIG.

27は特定物体検出判定部であり、第1の特徴量算出部23による第1の特徴量、第2の特徴量算出部24による第2の特徴量、そして第3の特徴量算出部25による第3の特徴量などに基づいて、対象となる検出領域において特定物体、すなわち顔が検出されたかどうかの判定を行う。すなわち、特定物体検出判定手段として機能する。   A specific object detection determination unit 27 includes a first feature amount by the first feature amount calculation unit 23, a second feature amount by the second feature amount calculation unit 24, and a third feature amount calculation unit 25. Based on the third feature amount or the like, it is determined whether or not a specific object, that is, a face is detected in the target detection area. That is, it functions as specific object detection determination means.

判定に利用するのは、第1の特徴量と第2の特徴量だけであってもよいし、第1の特徴量と第3の特徴量だけであってもよい。また、それらの判定に加えて後述の入力画像判定部26の判定結果を加えて、判定を下すようにしてもよい。   Only the first feature value and the second feature value may be used for the determination, or only the first feature value and the third feature value may be used. Further, in addition to these determinations, a determination result of an input image determination unit 26 described later may be added to make the determination.

第1の特徴量は所定の第1の閾値より大きいことが検出判定の基準であり、第2の特徴量は所定の第2の閾値より大きいことが検出判定の基準であり、第3の特徴量は所定の第3の閾値より小さいことが検出判定の基準である。もちろんこれらの基準は、特徴量の定義によって変わる。すべての検出判定の基準を満たし、入力画像判定部26の判定結果も加味する場合はそれも含めて、すべて検出判定である場合に、最終的にその検出領域で特定物体、すなわち顔が検出されたと判定される。以上の検出判定の詳細については、図14を参照して後述する。   The criterion for detection determination is that the first feature amount is greater than a predetermined first threshold, and the criterion for detection determination is that the second feature amount is greater than a predetermined second threshold. The third feature The criterion for detection determination is that the amount is smaller than a predetermined third threshold. Of course, these criteria vary depending on the definition of the feature amount. When all the detection determination criteria are satisfied and the determination result of the input image determination unit 26 is taken into account, all the detection determinations are made, and in the event that all detection determinations are made, a specific object, that is, a face is finally detected in the detection region It is determined that Details of the above detection determination will be described later with reference to FIG.

22は第2の検出領域設定部であり、入力画像取得部11で取得し、距離画像生成部12での距離画像生成に利用した複数の入力画像の一つである第1の画像に対して、検出領域設定部21で距離画像内に設定した検出領域の位置に対応する第1の入力画像内の位置に第2の検出領域を設定する。すなわち、第2の検出領域設定手段として機能する。   Reference numeral 22 denotes a second detection area setting unit, which is obtained by the input image acquisition unit 11 and is used for the first image that is one of the plurality of input images used for the distance image generation by the distance image generation unit 12. Then, the second detection area is set at a position in the first input image corresponding to the position of the detection area set in the distance image by the detection area setting unit 21. That is, it functions as second detection area setting means.

第2の検出領域を設定する意図は、距離画像に対して、顔の大きさと距離の関係、そして距離情報の分布だけから顔を判断するのでなく、通常の入力画像に対して行われる通常の顔判定と合わせることで判定の精度を上げることである。顔判定の速度と精度との兼ね合いで、これらを任意に組み合わせることもできる。   The purpose of setting the second detection area is not to judge the face based on the relationship between the size of the face and the distance and the distribution of the distance information, but to the normal input image. It is to improve the accuracy of determination by combining with face determination. These can be arbitrarily combined in consideration of the speed and accuracy of face determination.

26は入力画像判定部であり、第2の検出領域設定部22で第1の入力画像に設定された第2の検出領域に対して、特定物体、すなわち顔の検出を行い、検出されたかどうかの判定を行う。すなわち、入力画像判定手段として機能する。   Reference numeral 26 denotes an input image determination unit, which detects whether a specific object, that is, a face is detected in the second detection region set in the first input image by the second detection region setting unit 22 and is detected. Judgment is made. That is, it functions as an input image determination unit.

特定物体の検出判定は、テンプレートマッチングなどの公知の認証技術を用いて行えばよい。検出結果は、特定物体検出判定部27に送られ、距離情報を用いての判定と合わせて、最終的な特定物体検出判定が行われる。   The detection determination of the specific object may be performed using a known authentication technique such as template matching. The detection result is sent to the specific object detection determination unit 27, and the final specific object detection determination is performed together with the determination using the distance information.

以下に上記特定物体検出装置を用いての特定物体検出処理の動作について説明する。   The operation of the specific object detection process using the specific object detection apparatus will be described below.

(特定物体検出処理の動作フロー)
図2は、本実施形態の特定物体検出装置による特定物体検出処理の全体動作フローを示すフローチャートである。図1を用いて特定物体検出装置を用いた特定物体検出処理方法を説明する。
(Operation flow of specific object detection processing)
FIG. 2 is a flowchart showing an overall operation flow of the specific object detection process by the specific object detection apparatus of the present embodiment. A specific object detection processing method using the specific object detection apparatus will be described with reference to FIG.

特定物体検出処理は、一般的にコンピュータなどによる画像情報処理により実現され、以下に説明する各工程は、特定物体検出処理部10において、具体的にはコンピュータが各処理手段に相当する処理プログラムを実行することにより、その機能が実現される。   The specific object detection process is generally realized by image information processing by a computer or the like, and each process described below is performed by the specific object detection processing unit 10, specifically, the computer executes a processing program corresponding to each processing means. By executing, the function is realized.

まず入力画像取得工程であるステップS11において、入力画像が取得されることから、特定物体検出処理は始まる。入力画像は、入力部101から提供され、入力画像取得部11により取得される。   First, in step S11, which is an input image acquisition process, an input image is acquired, and thus the specific object detection process starts. The input image is provided from the input unit 101 and acquired by the input image acquisition unit 11.

入力画像は視点の異なる複数の入力画像からなり、距離画像を生成するために用いられることは既に述べたとおりである。本実施形態の特定物体検出処理においては、通常の画像だけから、特定物体、つまり顔の検出を行うのではなく、距離画像の情報を用いて顔の検出精度を向上するものであり、かつその効率をも向上させる。   As described above, the input image includes a plurality of input images having different viewpoints and is used to generate a distance image. In the specific object detection processing of this embodiment, the detection accuracy of the face is improved by using the information of the distance image, instead of detecting the specific object, that is, the face from only the normal image. Increase efficiency as well.

次に距離画像生成工程であるステップS12では、距離画像生成部12が、入力画像取得部11から受け取った複数の入力画像を用いて、各画素が距離情報を有する距離画像を生成する。   Next, in step S12 which is a distance image generation step, the distance image generation unit 12 generates a distance image in which each pixel has distance information using a plurality of input images received from the input image acquisition unit 11.

通常は、観察者の右目と左目に相当する視点の、視差の異なった第1及び第2画像からステレオ画像を生成する。その段階で、例えば第1画像の画素毎に距離情報を算出することができ、例えばその距離値を0から255の輝度値で表現した距離画像を作成することができる。距離画像生成工程の詳細フローについては後述する。   Usually, a stereo image is generated from first and second images having different parallaxes from viewpoints corresponding to the right eye and left eye of the observer. At that stage, distance information can be calculated for each pixel of the first image, for example, and a distance image in which the distance value is expressed by a luminance value from 0 to 255 can be created. A detailed flow of the distance image generation process will be described later.

次の対応関係設定工程として機能するステップS13では、検出領域のスキャン処理に対する初期化を行う。特に距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する。   In step S13, which functions as the next correspondence setting process, initialization for the scan process of the detection area is performed. In particular, the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object is set.

以下の特定物体検出処理において特定物体検出処理制御部14は、検出領域処理部20での検出領域の設定と検出判定とを距離画像全体に検出領域をスキャンさせ、反復することで、距離画像における特定物体検出処理を行う。そのための初期設定として、対応関係設定部13が上記対応関係を設定し、記憶部103に記憶しておく。また特定物体検出処理制御部14は距離画像における検出領域のスキャンの初期位置を設定しておく。   In the following specific object detection processing, the specific object detection processing control unit 14 scans the detection region over the entire distance image and repeats the detection region setting and detection determination in the detection region processing unit 20 to repeat the detection in the distance image. A specific object detection process is performed. As an initial setting for this, the correspondence setting unit 13 sets the correspondence and stores it in the storage unit 103. In addition, the specific object detection processing control unit 14 sets an initial scan position of the detection area in the distance image.

次にステップS14では、スキャンを制御する特定物体検出処理制御部14が、検出領域のスキャンが終了したかどうか、すなわち距離画像全体をスキャンし終えたかどうかを判定する。通常のスキャン方向としては、左上を初期位置とし、水平方向右へスキャンし、水平方向スキャンを終えると、順次垂直下方向へずれながら水平方向スキャンを反復し、右下の最終位置を通過し終えるとスキャン終了である。   Next, in step S14, the specific object detection processing control unit 14 that controls scanning determines whether scanning of the detection area is completed, that is, whether the entire distance image has been scanned. As the normal scan direction, the upper left is the initial position, the scan is performed to the right in the horizontal direction, and when the horizontal scan is completed, the scan in the horizontal direction is repeated while sequentially shifting downward in the vertical direction, and the final position at the lower right is finished And the scan is over.

ステップS14で、スキャンが終了している場合(ステップS14:YES)は、特定物体検出処理についての、検出領域処理部20による検出判定は終了しており、ステップS33が実行される。   If the scan is finished in step S14 (step S14: YES), the detection determination by the detection area processing unit 20 for the specific object detection process is finished, and step S33 is executed.

ステップS33では、特定物体検出処理出力部15によって、記憶部103に一時保存されている検出結果が読み出され、特定物体検出結果としてまとめられ、出力部105へ出力する、あるいは指示を受けて出力可能な状態で待機する。これで特定物体検出処理は終了する。   In step S33, the specific object detection processing output unit 15 reads out the detection results temporarily stored in the storage unit 103, collects the detection results as specific object detection results, and outputs them to the output unit 105 or receives an instruction and outputs them. Wait in a possible state. This completes the specific object detection process.

一方ステップS14で、スキャンが終了していない場合(ステップS14:NO)は、検出領域処理部20での処理を繰り返すため、次のステップS15を実行する。   On the other hand, if the scan is not completed in step S14 (step S14: NO), the next step S15 is executed in order to repeat the process in the detection area processing unit 20.

検出領域設定工程であるステップS15では、検出領域設定部21が、ステップS13で設定した距離値と検出領域サイズの対応関係に応じて、スキャン位置での検出領域サイズを設定する。具体的には、スキャン位置の画素の距離値に対応する検出領域サイズを記憶部103から読みだし、距離画像のスキャン位置画素を中心として当該サイズの検出領域を設定する。検出領域設定工程の詳細フローは後述する。   In step S15, which is a detection area setting step, the detection area setting unit 21 sets the detection area size at the scan position according to the correspondence between the distance value set in step S13 and the detection area size. Specifically, the detection area size corresponding to the distance value of the pixel at the scan position is read from the storage unit 103, and the detection area of the size is set around the scan position pixel of the distance image. A detailed flow of the detection area setting step will be described later.

ここからのステップは、ステップS16、ステップS17、そしてステップS18の距離画像に対する処理と、ステップS21及びステップS22の入力画像に対する処理とに分かれる。図2のフローにおいては、ステップS25で統合して判定処理されるまで、両者は互いに独立して処理してかまわないような手順としている。しかしながら、処理の効率を考慮するならば、何れかを優先処理するようなフローであってもかまわない。入力画像を優先処理する場合は図15を参照して、距離画像を優先する場合は図16を参照して、何れも後述する。   Steps from here are divided into processing for the distance image in steps S16, S17, and S18 and processing for the input image in steps S21 and S22. In the flow of FIG. 2, the procedure is such that both can be processed independently until they are integrated and determined in step S25. However, if the processing efficiency is taken into consideration, a flow in which any one is preferentially processed may be used. When priority is given to the input image, refer to FIG. 15, and when priority is given to the distance image, refer to FIG.

第1の特徴量算出工程であるステップS16では、第1の特徴量算出部23が、設定された検出領域に対して、そのサイズに対応する距離値と同等の距離値を有する画素領域の、全領域に対する比率を第1の特徴量として算出する。第1の特徴量算出工程の詳細フローは、後述する。   In step S16, which is the first feature amount calculation step, the first feature amount calculation unit 23 calculates a pixel area having a distance value equivalent to the distance value corresponding to the size of the set detection area. The ratio to the entire area is calculated as the first feature amount. A detailed flow of the first feature amount calculation step will be described later.

第2の特徴量算出工程であるステップS17では、第2の特徴量算出部24が、設定された検出領域に対して、その上部に補助領域を設定し、補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を検出領域サイズに対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する。第2の特徴量算出工程の詳細フローは、後述する。   In step S17, which is the second feature amount calculation step, the second feature amount calculation unit 24 sets an auxiliary region above the set detection region, and averages the distance values in the auxiliary region. The median value or the distance value with the largest number of pixels having the same distance value is compared with the distance value corresponding to the detection area size, and the absolute value of the difference is calculated as the second feature amount. A detailed flow of the second feature amount calculation step will be described later.

第3の特徴量算出工程であるステップS18では、第3の特徴量算出部25が、設定された検出領域に対して、水平方向または垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、または垂直方向差分値を第3の特徴量として算出する。第3の特徴量算出工程の詳細フローは、後述する。   In step S18, which is the third feature amount calculation step, the third feature amount calculation unit 25 calculates the sum of the distance values in each region divided into two in the horizontal direction or the vertical direction with respect to the set detection region. The horizontal direction difference value or the vertical direction difference value obtained by calculating and taking the absolute value of the difference of each sum is calculated as the third feature amount. A detailed flow of the third feature amount calculation step will be described later.

一方、第2の検出領域設定工程であるステップS21では、第2の検出領域設定部22が、距離画像生成に利用した複数の入力画像の一つである第1の画像に対して、第2の検出領域を設定する。第2の検出領域の設定位置は、検出領域設定部21で距離画像内に設定した検出領域の位置に対応する第1の入力画像内の位置であり、その設定サイズは検出領域サイズと同じである。   On the other hand, in step S21 which is the second detection area setting step, the second detection area setting unit 22 performs the second operation on the first image which is one of the plurality of input images used for the distance image generation. Set the detection area. The setting position of the second detection area is a position in the first input image corresponding to the position of the detection area set in the distance image by the detection area setting unit 21, and the setting size is the same as the detection area size. is there.

次に入力画像判定工程であるステップS22では、入力画像判定部26が、入力画像に設定された第2の検出領域に対して、特定物体、すなわち顔の検出を行い、検出されたかどうかの判定を行う。検出判定は、既に述べたように、テンプレートマッチングなどの公知の認証技術を用いて行えばよい。   Next, in step S22, which is an input image determination step, the input image determination unit 26 detects a specific object, that is, a face, in the second detection region set in the input image, and determines whether or not it has been detected. I do. As described above, the detection determination may be performed using a known authentication technique such as template matching.

特定物体検出判定工程であるステップS25では、特定物体検出判定部27が、距離画像の検出領域に対して算出された第1、第2、及び第3の特徴量による判定と、そして入力画像の第2の検出領域に対して下された検出判定とを総合して、最終的な特定物体、つまり顔の検出判定を行う。   In step S25, which is a specific object detection determination step, the specific object detection determination unit 27 performs determination based on the first, second, and third feature amounts calculated for the detection region of the distance image, and the input image In combination with the detection determination made for the second detection area, the final specific object, that is, the face detection determination is performed.

距離画像の検出領域に対して各特徴量がすべて検出判定の基準を満たし、入力画像の第2の検出領域に対する判定結果も含めて、すべて検出と判定された場合に、最終的にその検出領域で特定物体、すなわち顔が検出されたと判定されるのは、既に述べたとおりである。この特定物体検出判定工程の詳細フローについては、後述する。   When all the feature quantities satisfy the detection determination criteria for the detection area of the distance image, and all the determination results including the determination result for the second detection area of the input image are finally detected, the detection area As described above, it is determined that the specific object, that is, the face is detected. A detailed flow of this specific object detection determination step will be described later.

ステップS25での判定結果が「検出された」である場合(ステップS25:YES)は、ステップS31を実行する。判定結果が「検出されない」である場合(ステップS25:NO)は、ステップS31を省略し、ステップS32を実行する。   When the determination result in step S25 is “detected” (step S25: YES), step S31 is executed. If the determination result is “not detected” (step S25: NO), step S31 is omitted and step S32 is executed.

ステップS31では、検出結果、すなわち、検出されたという事実と検出領域の位置、サイズが記憶部103に一時記憶される。これらは後で検出領域のスキャン終了後に、特定物体検出処理出力部15により、画像全体の結果がまとめられる。   In step S <b> 31, the detection result, that is, the fact that it has been detected and the position and size of the detection area are temporarily stored in the storage unit 103. After the scanning of the detection area is completed later, the specific object detection processing output unit 15 summarizes the results of the entire image.

ステップS32では、特定物体検出処理制御部14により、スキャン位置が更新される。スキャン位置の更新順は、既に述べたとおりである。スキャン位置を更新した後、ステップS14に戻り、ステップS14以後の検出領域に対する処理が、検出領域をスキャンしながら繰り返されることになる。   In step S <b> 32, the scan position is updated by the specific object detection processing control unit 14. The update order of scan positions is as already described. After updating the scan position, the process returns to step S14, and the processing for the detection area after step S14 is repeated while scanning the detection area.

繰り返しは、スキャンが終了して、ステップS14で終了判定がなされ、ステップS33の実行に移るまで、特定物体検出処理制御部14の制御により継続する。   The repetition is continued under the control of the specific object detection processing control unit 14 until the scan is completed, the end determination is made in step S14, and the process proceeds to step S33.

既述したようにステップS33で、特定物体検出処理出力部15によって、記憶部103に一時保存されているすべての検出結果が読み出され、特定物体検出結果としてまとめられ、出力部105へ出力される状態になると、特定物体検出処理部10での特定物体検出処理は終了する。   As described above, in step S33, the specific object detection processing output unit 15 reads all detection results temporarily stored in the storage unit 103, collects them as specific object detection results, and outputs them to the output unit 105. In this state, the specific object detection processing in the specific object detection processing unit 10 ends.

<距離画像生成>
図2のステップS12、すなわち距離画像生成工程の詳細フローについて、図3を用いて説明する。図3は距離画像生成工程を示すフローチャートである。
<Distance image generation>
The detailed flow of step S12 in FIG. 2, that is, the distance image generation process will be described with reference to FIG. FIG. 3 is a flowchart showing the distance image generation process.

図3の距離画像生成は、入力画像取得部11から受け取る複数の入力画像を用いて距離画像生成部12で実行される。   The distance image generation in FIG. 3 is executed by the distance image generation unit 12 using a plurality of input images received from the input image acquisition unit 11.

入力画像は、観察者の右目と左目に相当する視点の、視差の異なった第1及び第2画像からなるとする。図4に入力画像の例を示す。31aは第1の入力画像(右目相当視点)であり、31bは第2の入力画像(左目相当視点)である。異なった距離に立っている3人の人物A(手前)、B(中)、C(奥)を左右の異なった視点から撮影したものであり、この二つの画像には視差が生じている。   It is assumed that the input image includes first and second images with different parallaxes from viewpoints corresponding to the right eye and the left eye of the observer. FIG. 4 shows an example of the input image. 31a is a first input image (right eye equivalent viewpoint), and 31b is a second input image (left eye equivalent viewpoint). Three persons A (front), B (middle), and C (back) standing at different distances are taken from different left and right viewpoints, and parallax is generated between these two images.

30は上記第1、第2の入力画像から生成される視差画像、すなわち距離画像を示す。第1の入力画像の各画素について視差を求め、距離に置き換えた上で、0から255の輝度値で表現したものである。手前にいる人物Aが輝度が高く、奥にいる人物Cが輝度が低く表現されている。   Reference numeral 30 denotes a parallax image generated from the first and second input images, that is, a distance image. The parallax is obtained for each pixel of the first input image and replaced with a distance, and is expressed by a luminance value from 0 to 255. The person A in the foreground is expressed with high brightness, and the person C in the back is expressed with low brightness.

図3を用いて、入力画像31a、31bから距離画像30を求めるフローを説明する。   A flow for obtaining the distance image 30 from the input images 31a and 31b will be described with reference to FIG.

まずステップS41で、距離検知スキャンのための初期化を行う。距離検知スキャン(あるいは距離スキャン)は、第1の入力画像を距離画像化するため、第1の入力画像をスキャンし、第1の入力画像の全画素について距離情報を求めていく動作である。スキャン位置の更新の順序は検出領域のスキャンの場合と同じでよい。従ってここでは左上の画素をスキャンの初期位置として設定する。   First, in step S41, initialization for distance detection scanning is performed. The distance detection scan (or distance scan) is an operation of scanning the first input image and obtaining distance information for all pixels of the first input image in order to convert the first input image into a distance image. The order of updating the scan position may be the same as in the case of scanning the detection area. Therefore, here, the upper left pixel is set as the initial scan position.

次にステップS42では、距離検知スキャンが終了したかどうかの判定を行う。第1の入力画像の全画素を距離検知スキャン位置として通過し終えたかどうかで判定する。   Next, in step S42, it is determined whether or not the distance detection scan is completed. Judgment is made based on whether or not all pixels of the first input image have been passed as distance detection scan positions.

距離検知スキャンが終了している場合(ステップS42:YES)は、第1の入力画像の全画素が距離情報を有するような距離画像が生成終了していることになるので、これで距離画像の生成工程は終了である。   If the distance detection scan has ended (step S42: YES), the generation of the distance image in which all the pixels of the first input image have distance information has been completed. The generation process is complete.

一方、距離検知スキャンが終了していない場合(ステップS42:NO)は、ステップS43を実行する。   On the other hand, when the distance detection scan is not completed (step S42: NO), step S43 is executed.

ステップS43では、そのスキャン位置での視差(距離)を求めるための距離検知ウィンドゥを設定する。距離検知ウィンドゥは視差を求めるための領域で、適宜設定すればよいが、ここではw×wのサイズを有するものとする。従ってスキャン位置の画素を中心としてw×wの領域を設定する。   In step S43, a distance detection window for obtaining the parallax (distance) at the scan position is set. The distance detection window is an area for obtaining parallax, and may be set as appropriate, but here it is assumed to have a size of w × w. Accordingly, a w × w region is set around the pixel at the scan position.

次にステップS44では、視差スキャンのために視差設定を初期化する。視差スキャンとは、以下に述べるように視差を変更しながら、最も妥当な視差を探索するものであり、その視差変更の初期値を設定する。   In step S44, the parallax setting is initialized for parallax scanning. The parallax scan is a search for the most appropriate parallax while changing the parallax as described below, and sets an initial value of the parallax change.

距離検知ウィンドゥでの視差を求めるためには、視差を順次変更(視差スキャン)していきながら、第1の入力画像と第2の入力画像の対応する距離検知ウィンドゥをその視差だけずらせて重ねる。そして、両者が最も合致するような視差をその距離検知ウィンドウにおける両者の視差とする。視差の変更は0からmax_disp(その入力画像の撮影で生じ得る視差の上限)まで変更するので、ここでは初期値を0とする。   In order to obtain the parallax in the distance detection window, the parallax is sequentially changed (parallax scan), and the distance detection windows corresponding to the first input image and the second input image are shifted by the parallax and overlapped. Then, the parallax that best matches both is set as the parallax between the two in the distance detection window. Since the parallax is changed from 0 to max_disp (upper limit of parallax that can be generated by shooting the input image), the initial value is set to 0 here.

また、合わせて後述するSAD最小値(合致したかどうかの判断基準)の記憶をクリアしておく。   In addition, the storage of the SAD minimum value (determination criteria for whether or not they match), which will be described later, is cleared.

次にステップS45から視差スキャンのループに入る。ステップS45では、視差スキャンが終了したかどうかを判定する。設定した視差が上限値であるmax_dispを越えていれば終了であり、越えていなければ終了していない。   Next, a parallax scanning loop is entered from step S45. In step S45, it is determined whether the parallax scan is completed. If the set parallax exceeds max_disp which is the upper limit value, the process ends. If not, the process does not end.

視差スキャンが終了している場合(ステップS45:YES)は、視差スキャンのループを抜け、ステップS51に移り、実行する。終了していない場合(ステップS45:NO)は、次のステップS46を実行する。   If the parallax scan has been completed (step S45: YES), the process exits the parallax scan loop, moves to step S51, and executes it. If not completed (step S45: NO), the next step S46 is executed.

ステップS46では、第1の入力画像と第2の入力画像間で設定視差だけずらした距離検知ウィンドウ間のSAD(差の絶対値の和:Sum_of_Absolute_Difference)を算出する。このSADは、次のような式で求められる。   In step S46, SAD (sum of absolute values of differences: Sum_of_Absolute_Difference) between the distance detection windows shifted by the set parallax between the first input image and the second input image is calculated. This SAD is obtained by the following equation.

SAD=ΣΣ|Img1(i,j)−Img2(i,j+p)|
但し、(i,j)は距離検知ウィンドウ(w×w)内の画素位置であり、ΣΣはすべての(i,j)、すなわち距離検知ウィンドウ(w×w)内のすべての画素位置に関する総和を表す。Img1及びImg2は、それぞれ第1及び第2の入力画像の画素値であり、pは設定された視差である。
SAD = ΣΣ | Img1 (i, j) −Img2 (i, j + p) |
However, (i, j) is a pixel position in the distance detection window (w × w), and ΣΣ is a sum total of all the pixel positions in all (i, j), that is, the distance detection window (w × w). Represents. Img1 and Img2 are the pixel values of the first and second input images, respectively, and p is the set parallax.

このSADが最小となるような視差pを求め、その距離検知ウィンドウにおける最も妥当な視差と考える。   The parallax p that minimizes the SAD is obtained and considered as the most appropriate parallax in the distance detection window.

次にステップS47では、ステップS46で算出したSADを記憶部103に一時記憶してあるSAD最小値と比較し、どちらが小さいかを判定する。算出したSADの方が小さい場合、あるいは一時記憶したSAD最小値がまだない場合(ステップS47:YES)は、ステップS48を実行する。   In step S47, the SAD calculated in step S46 is compared with the SAD minimum value temporarily stored in the storage unit 103 to determine which is smaller. If the calculated SAD is smaller, or if there is no temporarily stored SAD minimum value (step S47: YES), step S48 is executed.

ステップS48では、算出したSADをSAD最小値として更新し、対応する視差pとともに更新記憶し、ステップS49に進む。   In step S48, the calculated SAD is updated as the SAD minimum value, updated and stored together with the corresponding parallax p, and the process proceeds to step S49.

ステップS47で、一時記憶してあるSAD最小値の方が小さい場合(ステップS47:NO)は、SAD最小値とそのときの視差pの更新記憶は行わない。ステップS48は省略し、ステップS49を実行する。   In step S47, if the temporarily stored SAD minimum value is smaller (step S47: NO), the SAD minimum value and the parallax p at that time are not updated and stored. Step S48 is omitted, and step S49 is executed.

ステップS49では、視差スキャンの設定視差を更新し、ステップS45へ戻る。設定視差は初期値0から開始しており、上限max_dispを越えるまで1画素ずつ増やしていき、ステップS45以後の視差スキャンを反復する。   In step S49, the set parallax of the parallax scan is updated, and the process returns to step S45. The set parallax starts from the initial value 0, increases by one pixel until the upper limit max_disp is exceeded, and repeats the parallax scan after step S45.

上限max_dispを越えると、ステップS45で視差スキャン終了の場合に相当し、ステップS51へと進むことになる。   If the upper limit max_disp is exceeded, this corresponds to the case where the parallax scan ends in step S45, and the process proceeds to step S51.

ステップS51では、SAD最小値に対応する視差、すなわちその時点での距離検知ウィンドゥに対する妥当な視差が決定される。視差の大きさは対象物の距離に対応しているため、視差から距離値を求めることができる。この対応も予めデータテーブルとして記憶部103に記憶しておいてもよい。   In step S51, a parallax corresponding to the SAD minimum value, that is, an appropriate parallax for the distance detection window at that time is determined. Since the magnitude of the parallax corresponds to the distance of the object, the distance value can be obtained from the parallax. This correspondence may also be stored in advance in the storage unit 103 as a data table.

次にステップS52では、距離画像のデータを順次書き込んで記憶していく。距離検知ウィンドウの位置、つまり距離画像内の画素位置と、算出した距離値を0から255の輝度値に変換した画素値とを、距離情報として記憶部103に記憶していく。これが全画素について終了すると、図4の30に示したような距離画像のデータができあがることになる。   In step S52, the distance image data is sequentially written and stored. The position of the distance detection window, that is, the pixel position in the distance image, and the pixel value obtained by converting the calculated distance value into a luminance value from 0 to 255 are stored in the storage unit 103 as distance information. When this is finished for all the pixels, the distance image data as shown at 30 in FIG. 4 is completed.

次にステップS53では、距離検知スキャン位置を更新し、次の画素位置へと進める。その後ステップS42へ戻り、第1の入力画像の全画素をスキャン位置として通過し終えるまで、ステップS42以後の距離検知スキャンを反復する。   In step S53, the distance detection scan position is updated and advanced to the next pixel position. Thereafter, the process returns to step S42, and the distance detection scan after step S42 is repeated until all the pixels of the first input image have been passed as scan positions.

前述のように、ステップS42での判定において、第1の入力画像の全画素をスキャンし終えた場合に、距離検知スキャンのループを抜け、距離画像の生成は終了する。   As described above, in the determination in step S42, when all the pixels of the first input image have been scanned, the distance detection scan loop is exited, and the generation of the distance image ends.

<検出領域設定>
図2のステップS15、すなわち検出領域設定工程の詳細フローについて、図5を用いて説明する。図5は検出領域設定工程を示すフローチャートである。
<Detection area setting>
The detailed flow of step S15 in FIG. 2, that is, the detection region setting step will be described with reference to FIG. FIG. 5 is a flowchart showing the detection area setting step.

図5の検出領域設定は、距離画像生成部12から受け取った距離画像を対象として検出領域設定部21で実行される。   The detection area setting in FIG. 5 is executed by the detection area setting unit 21 for the distance image received from the distance image generation unit 12.

検出領域は、特定物体である顔を検出するための領域であり、距離画像全体に対して検出領域をスキャンさせることで、画像中の顔とその位置を検出する。従って検出領域での検出処理については、特定物体である顔のサイズに合わせて検出領域のサイズを決定することが望ましい。しかしながら画像中の顔のサイズは、その距離によって異なってくる。そのため通常は、検出領域のサイズを変えてスキャンを反復することが行われる。   The detection area is an area for detecting a face that is a specific object, and the face in the image and its position are detected by scanning the detection area for the entire distance image. Therefore, for the detection process in the detection region, it is desirable to determine the size of the detection region in accordance with the size of the face that is the specific object. However, the size of the face in the image varies depending on the distance. For this reason, scanning is usually repeated while changing the size of the detection area.

本実施形態において距離画像を用いる意図は、その距離情報を利用することにより、検出領域のサイズを効率的に設定することである。そのために、図2のステップS13で、対応関係設定部13が、距離値と顔のサイズ、すなわち顔の検出に適切な検出領域サイズとの対応関係を設定し、データテーブルなどの形態で記憶してある。   The intention of using the distance image in this embodiment is to set the size of the detection region efficiently by using the distance information. For this purpose, in step S13 of FIG. 2, the correspondence setting unit 13 sets the correspondence between the distance value and the face size, that is, the detection area size suitable for face detection, and stores it in the form of a data table or the like. It is.

図5を用いて、この対応関係を元にスキャン位置での検出領域を設定するフローを説明する。   A flow for setting a detection area at a scan position based on this correspondence will be described with reference to FIG.

まずステップS61で、スキャン位置での距離値を取得する。距離画像をスキャンするがそのスキャン位置は、図2のステップS13もしくはステップS32で、既に設定されている。距離画像中の当該画素位置に対して、その画素値を取得する。画素値は距離画像生成のフローで述べたように0から255の輝度値で表現されるが、これはその画素位置における被写体の距離値に対応している。   First, in step S61, a distance value at the scan position is acquired. The distance image is scanned, but the scan position has already been set in step S13 or step S32 in FIG. The pixel value is acquired for the pixel position in the distance image. As described in the distance image generation flow, the pixel value is expressed by a luminance value from 0 to 255, which corresponds to the distance value of the subject at the pixel position.

次にステップS62では、ステップS61で取得した距離値に対応する検出領域サイズを設定する。これは、上述した距離値と顔のサイズ、すなわち顔の検出に適切な検出領域サイズとの対応関係を参照し、スキャン位置における距離値に対応する検出領域サイズを求めるものである。従って、スキャン位置がスキャンによって変化すれば、距離値が変化し、対応する顔のサイズ、すなわち顔検出に適切な検出領域サイズも変化することになる。   In step S62, a detection area size corresponding to the distance value acquired in step S61 is set. This is to obtain the detection area size corresponding to the distance value at the scan position by referring to the correspondence relationship between the distance value and the face size, that is, the detection area size suitable for face detection. Therefore, if the scan position changes due to scanning, the distance value changes, and the corresponding face size, that is, the detection area size suitable for face detection also changes.

図6には、視差、すなわち距離値と検出領域サイズとの対応関係を示す。視差は0から上限がmax_dispであり、ここでは0から255の範囲の輝度値で表現されているものとする。この視差の大きさは、被写体との距離値を表しており、視差が大きいほど距離は近くなる。すなわち0は無限遠、視差が上限値に相当する255は最近接撮影距離となる。   FIG. 6 shows the correspondence between the parallax, that is, the distance value and the detection area size. It is assumed that the parallax has an upper limit from 0 to max_disp and is represented by a luminance value in the range of 0 to 255 here. The magnitude of this parallax represents a distance value from the subject, and the distance becomes closer as the parallax increases. That is, 0 is infinity, and 255, the parallax corresponding to the upper limit, is the closest shooting distance.

図6に示すように、視差が小さい(距離が遠い)と顔サイズ、つまり検出領域サイズは小さく、視差が大きい(距離が近い)と検出領域サイズは大きくなる関係にある。図6の下部の40は視差(距離値)により検出領域サイズが変化してくることを示したものである。その具体的な数値が対応関係として記憶されており、参照されることになる。   As shown in FIG. 6, when the parallax is small (distance is long), the face size, that is, the detection area size is small, and when the parallax is large (distance is short), the detection area size is large. A lower part 40 in FIG. 6 indicates that the detection area size changes depending on the parallax (distance value). The specific numerical values are stored as correspondences and are referred to.

次にステップS63では、対応関係を参照して求めた検出領域サイズに応じて、距離画像中のスキャン位置に当該サイズの検出領域を設定する。スキャン位置の画素を中心に設定すればよい。   In step S63, a detection area of that size is set at the scan position in the distance image according to the detection area size obtained by referring to the correspondence. What is necessary is just to set centering on the pixel of a scanning position.

以上でスキャン位置に対する検出領域の設定は終了である。   This completes the setting of the detection area for the scan position.

前述したように、検出領域スキャンが進むにつれて、具体的な検出領域のサイズは変化することになる。図7(a)には距離画像30をスキャン(図では左上から右上へ)していくにつれて、検出領域40のサイズが変化する様子を示す。このように本実施形態では、距離画像内の各位置に応じた適切な検出領域を設定できるため、検出領域サイズを変化させながらスキャンを繰り返す必要もなく、良好な精度での検出を効率よく行うことができる。   As described above, as the detection area scan progresses, the specific detection area size changes. FIG. 7A shows how the size of the detection region 40 changes as the distance image 30 is scanned (from the upper left to the upper right in the figure). As described above, in the present embodiment, an appropriate detection area can be set according to each position in the distance image, so that it is not necessary to repeat scanning while changing the detection area size, and detection with good accuracy is performed efficiently. be able to.

図7(b)には検出領域のサイズを変化させながら、スキャンを繰り返す方法を示す。まず30aに示すように、画像を一定サイズの検出領域40aでスキャンする。それを反復し、例えば30bに示すスキャンでは、画像を異なるサイズの検出領域40bでスキャンしている。こうして、スキャンを何度も繰り返すため、検出の効率は悪くなる。   FIG. 7B shows a method of repeating scanning while changing the size of the detection area. First, as shown at 30a, an image is scanned with a detection area 40a having a certain size. For example, in the scan shown in 30b, the image is scanned with the detection areas 40b having different sizes. Thus, since the scan is repeated many times, the detection efficiency is deteriorated.

しかしながら、この場合も、本実施形態と同様に対応関係を参照し、そのスキャン位置での距離値と検出領域サイズが対応していない場合は、以後の検出処理を省略するようにすれば、効率を上げることができる。   However, in this case as well, the correspondence relationship is referred to in the same manner as in the present embodiment, and if the distance value at the scan position does not correspond to the detection area size, the efficiency can be improved by omitting the subsequent detection processing. Can be raised.

<第1の特徴量算出>
図2のステップS16、すなわち第1の特徴量算出工程の詳細フローについて、図8を用いて説明する。図8は第1の特徴量算出工程を示すフローチャートである。
<First feature amount calculation>
A detailed flow of step S16 of FIG. 2, that is, the first feature amount calculation step will be described with reference to FIG. FIG. 8 is a flowchart showing the first feature amount calculation step.

図8の第1の特徴量算出は、検出領域設定部21で設定された検出領域を対象として第1の特徴量算出部23で実行される。   The first feature amount calculation in FIG. 8 is executed by the first feature amount calculation unit 23 for the detection region set by the detection region setting unit 21.

第1の特徴量は、検出領域内の被写体が距離に見合ったサイズの顔であるかどうかを判断するための、その距離にある被写体の検出領域内での大きさを示す特徴量である。   The first feature amount is a feature amount indicating the size of the subject at the distance in the detection region for determining whether or not the subject in the detection region is a face having a size corresponding to the distance.

まずステップS71では、検出領域サイズに見合った距離値を取得する。これは距離値と検出領域サイズの対応関係から、元のスキャン位置での距離値を逆算して得ていることになる。後でこの距離値と同等の距離値を有する画素をカウントし、その被写体の大きさを求めるのである。   First, in step S71, a distance value corresponding to the detection area size is acquired. This is obtained by back-calculating the distance value at the original scan position from the correspondence between the distance value and the detection area size. Later, pixels having a distance value equivalent to this distance value are counted, and the size of the subject is obtained.

次にステップS72では、検出領域内の全画素をスキャンするに際しての初期設定を行う。ここでは検出領域左上の画素をスキャン開始の画素位置として設定する。スキャン方向は既述したスキャンと同様である。また全画素数C1及び対応画素数C2を初期値0に設定する。   Next, in step S72, initial settings for scanning all the pixels in the detection area are performed. Here, the upper left pixel of the detection area is set as the pixel position for starting scanning. The scan direction is the same as the scan described above. Also, the total number of pixels C1 and the corresponding number of pixels C2 are set to an initial value of 0.

ステップS73では、検出領域内の全画素をスキャンし終えたかどうかを判定する。スキャン位置が検出領域右下画素を通過していれば、スキャン終了と判定すればよい。スキャン終了している場合(ステップS73:YES)は、ステップS78に進む。スキャン終了していない場合(ステップS73:NO)は、次のステップS74を実行する。   In step S73, it is determined whether or not all the pixels in the detection area have been scanned. If the scan position passes the lower right pixel of the detection area, it may be determined that the scan is finished. If the scan has been completed (step S73: YES), the process proceeds to step S78. If the scan has not ended (step S73: NO), the next step S74 is executed.

ステップS74では、全画素数C1に1画素加える。スキャンした全画素の総和を求めるため、スキャンの度に1を加える。   In step S74, one pixel is added to the total number of pixels C1. In order to obtain the sum of all scanned pixels, 1 is added for each scan.

ステップS75では、スキャン位置での画素値、すなわち距離値を取得し、ステップS71で取得した対応距離値と同等であるかどうかを判定する。同等であるかどうかは、予め判定範囲を定めておき、両者の差分が判定範囲内である場合に同等と判定するようにすればよい。   In step S75, the pixel value at the scan position, that is, the distance value is acquired, and it is determined whether or not it is equivalent to the corresponding distance value acquired in step S71. Whether or not they are equivalent may be determined in advance by determining a determination range and determining that the difference between the two is within the determination range.

ステップS75で、対応距離値と同等である場合は、次のステップS76を実行する。対応距離値と同等でない場合は、ステップS76を省略し、ステップS77に進む。   If it is equal to the corresponding distance value in step S75, the next step S76 is executed. If it is not equal to the corresponding distance value, step S76 is omitted and the process proceeds to step S77.

次のステップS76では、対応画素数C2に1画素加える。スキャンした全画素のうち、上記した対応距離値と距離値が同等である画素の総和を求めるため、スキャンした画素が対応画素であると判定される度に1を加える。   In the next step S76, one pixel is added to the corresponding pixel number C2. In order to obtain the sum of the pixels having the same distance value as the corresponding distance value among all the scanned pixels, 1 is added every time it is determined that the scanned pixel is the corresponding pixel.

ステップS77では、検出領域内のスキャン位置を更新する。次の画素位置に移動する。その後、ステップS73に戻り、スキャン終了判定になるまで、ステップS73以下の検出領域内の各画素に対する処理を繰り返す。   In step S77, the scan position in the detection area is updated. Move to the next pixel position. Thereafter, the process returns to step S73, and the process for each pixel in the detection area in step S73 and subsequent steps is repeated until it is determined that the scan is completed.

前述したように、ステップS73でスキャン終了判定になった場合に、検出領域内の各画素の処理ループを抜けて、ステップS78を実行する。ステップS78では、第1の特徴量C2/C1を算出する。   As described above, when the scan end determination is made in step S73, the process loop of each pixel in the detection area is exited, and step S78 is executed. In step S78, a first feature amount C2 / C1 is calculated.

この時点でC1は検出領域の全画素数であり、C2は検出領域の、対応距離と同等の距離値を有する全画素数である。従って第1の特徴量C2/C1は、検出領域内の被写体の大きさが検出領域のサイズと見合っているかどうか、すなわちその大きさによって、その検出領域内でのその対応距離における顔であると見なせるかどうか、を判断する基準として用いることができる。   At this time, C1 is the total number of pixels in the detection area, and C2 is the total number of pixels having a distance value equivalent to the corresponding distance in the detection area. Therefore, the first feature amount C2 / C1 is a face at the corresponding distance in the detection region depending on whether or not the size of the subject in the detection region is commensurate with the size of the detection region. It can be used as a criterion for judging whether or not it can be considered.

図9にその判断の実例を示す。図9(a)は、距離画像30内の検出領域40において、その対応距離値と同等の距離値を有する画素からなる被写体領域50が、検出領域40の大部分を占めている例である。検出領域にある被写体が顔であるとすればこのように、第1の特徴量は1に近い大きな値となる。   FIG. 9 shows an example of the determination. FIG. 9A is an example in which the subject area 50 composed of pixels having a distance value equivalent to the corresponding distance value occupies most of the detection area 40 in the detection area 40 in the distance image 30. If the subject in the detection area is a face, the first feature value is a large value close to 1.

図9(b)は、距離画像30内の検出領域40において、その対応距離値と同等の距離値を有する画素からなる被写体領域50が、検出領域40の小さな部分を占めている例である。この例では実は被写体領域50は顔であるのだが、検出領域40と顔である被写体領域50の位置がずれているため、この検出領域に対しては顔として検出判定するのは適当ではない。従って第1の特徴量が1よりもかなり小さい場合は、顔であるという判断は下すべきではない。   FIG. 9B is an example in which the subject area 50 composed of pixels having a distance value equivalent to the corresponding distance value occupies a small portion of the detection area 40 in the detection area 40 in the distance image 30. In this example, the subject area 50 is actually a face, but since the positions of the detection area 40 and the subject area 50 that is a face are shifted, it is not appropriate to detect and determine the detection area as a face. Therefore, if the first feature amount is considerably smaller than 1, it should not be determined that the face is a face.

判定方法については後述するが、第1の特徴量による判定としては、所定の第1の閾値より大きいかどうかで判定すればよい。   Although the determination method will be described later, as the determination based on the first feature amount, it may be determined whether it is larger than a predetermined first threshold value.

以上で、第1の特徴量算出処理は終了する。   Thus, the first feature amount calculation process ends.

<第2の特徴量算出>
図2のステップS17、すなわち第2の特徴量算出工程の詳細フローについて、図10を用いて説明する。図10は第2の特徴量算出工程を示すフローチャートである。
<Second feature amount calculation>
A detailed flow of step S17 in FIG. 2, that is, the second feature amount calculation step will be described with reference to FIG. FIG. 10 is a flowchart showing the second feature amount calculation step.

図10の第2の特徴量算出は、検出領域設定部21で設定された検出領域を対象として第2の特徴量算出部24で実行される。   The second feature amount calculation in FIG. 10 is executed by the second feature amount calculation unit 24 for the detection region set by the detection region setting unit 21.

第2の特徴量は、検出領域内の被写体が距離に見合ったサイズの顔であるかどうかを判断するための、その検出領域の周辺、特に上部に設定した補助領域において、検出領域の顔と見なせる被写体の距離と同等の距離にある被写体が存在するかどうかを示す特徴量である。   The second feature amount is a region around the detection region for determining whether or not the subject in the detection region is a face corresponding to the distance, particularly in the auxiliary region set at the top, This is a feature amount indicating whether or not there is a subject at a distance equivalent to the distance of the viewable subject.

まずステップS81では、検出領域サイズに見合った距離値を取得する。これは距離値と検出領域サイズの対応関係から、元のスキャン位置での距離値を逆算して得ていることになる。後で別途設定した補助領域において、この距離値と同等の距離値を有する画素を調べ、補助領域での被写体の存否を参照するのである。   First, in step S81, a distance value corresponding to the detection area size is acquired. This is obtained by back-calculating the distance value at the original scan position from the correspondence between the distance value and the detection area size. A pixel having a distance value equivalent to this distance value is examined in an auxiliary area set separately later, and the presence or absence of a subject in the auxiliary area is referred to.

次にステップS82では、補助領域の設定を行う。具体的には、例えば、検出領域のスキャン位置を(i,j)、それを中心とした検出領域のサイズをm×mとした場合、補助領域の中心位置を(i−1.5m,j)とし、補助領域のサイズをm×mとすればよい。図11に検出領域40に対して補助領域41を設定した例を図示している。   Next, in step S82, an auxiliary area is set. Specifically, for example, when the scan position of the detection area is (i, j) and the size of the detection area centered on it is m × m, the center position of the auxiliary area is (i−1.5 m, j ) And the size of the auxiliary area may be m × m. FIG. 11 shows an example in which the auxiliary area 41 is set for the detection area 40.

次にステップS83では、補助領域内の全画素をスキャンするに際しての初期設定を行う。ここでは補助領域左上の画素をスキャン開始の画素位置として設定する。スキャン方向は既述した検出領域内スキャンと同様である。また後で距離値の平均値、中央値、または最頻出値などを算出するための初期値を設定しておく。   Next, in step S83, initial settings for scanning all the pixels in the auxiliary area are performed. Here, the upper left pixel of the auxiliary area is set as the scan start pixel position. The scan direction is the same as the scan in the detection area described above. Further, an initial value for calculating an average value, median value, or most frequent value of distance values later is set.

ステップS84では、補助領域内の全画素をスキャンし終えたかどうかを判定する。スキャン位置が補助領域右下画素を通過していれば、スキャン終了と判定すればよい。スキャン終了している場合(ステップS84:YES)は、ステップS88に進む。スキャン終了していない場合(ステップS84:NO)は、次のステップS85を実行する。   In step S84, it is determined whether or not all the pixels in the auxiliary area have been scanned. If the scan position passes through the lower right pixel of the auxiliary area, it may be determined that the scan has ended. If the scan has been completed (step S84: YES), the process proceeds to step S88. If the scan has not ended (step S84: NO), the next step S85 is executed.

ステップS85では、補助領域内のスキャン位置の画素値から距離値を取得する。   In step S85, the distance value is acquired from the pixel value at the scan position in the auxiliary region.

次にステップS86では、ステップS85で取得した各画素での距離値を、後での平均値、中央値、または最頻出値などの演算に備えて記憶保存しておく。あるいは可能であれば、順次演算処理を進めていってもよい。   Next, in step S86, the distance value at each pixel acquired in step S85 is stored and saved in preparation for later calculations such as an average value, median value, or most frequent value. Alternatively, if possible, the arithmetic processing may be performed sequentially.

ステップS87では、補助領域内のスキャン位置を更新する。次の画素位置に移動する。その後、ステップS84に戻り、スキャン終了判定になるまで、ステップS84以下の補助領域内の各画素に対する処理を繰り返す。前述したように、ステップS84でスキャン終了判定になった場合に、補助領域内の各画素の処理ループを抜けて、ステップS88を実行する。   In step S87, the scan position in the auxiliary area is updated. Move to the next pixel position. Thereafter, the process returns to step S84, and the process for each pixel in the auxiliary area after step S84 is repeated until it is determined that the scan is completed. As described above, when it is determined in step S84 that scanning has ended, the processing loop of each pixel in the auxiliary region is exited, and step S88 is executed.

ステップS88では、補助領域内のスキャン処理中にステップS86で記憶保存した距離値、あるいは既に演算を進めているデータに基づいて、補助領域内の距離値の平均値、中央値、または最頻出値を、代表距離値として算出する。   In step S88, the average value, median value, or most frequent value of the distance values in the auxiliary region based on the distance value stored and saved in step S86 during the scan processing in the auxiliary region or the data that has already been calculated. Is calculated as a representative distance value.

ステップS89では、第2の特徴量として、ステップS88で算出した補助領域の代表距離値と、ステップS81で取得した検出領域対応距離値との差分の絶対値を算出する。これは次の式で表現できる。   In step S89, the absolute value of the difference between the representative distance value of the auxiliary area calculated in step S88 and the detected area corresponding distance value acquired in step S81 is calculated as the second feature amount. This can be expressed as:

第2の特徴量=|代表距離値−対応距離値|
この時点で、検出領域の被写体が顔として判断を行う対象であり、対応距離値はその被写体の距離を表している。その距離に顔があるとすれば、その上部、つまり補助領域の被写体は、それよりかなり遠方にあるのが通常である。一方検出領域の被写体が顔以外(例えば胴体など)であれば、その上部の被写体がほぼ同等の距離にあってもおかしくない。
Second feature amount = | representative distance value−corresponding distance value |
At this time, the subject in the detection area is a target to be determined as a face, and the corresponding distance value represents the distance of the subject. If there is a face at that distance, the upper part, that is, the subject in the auxiliary area is usually far away. On the other hand, if the subject in the detection area is other than a face (for example, a torso), it is possible that the subject in the upper part is approximately the same distance.

代表距離値は補助領域の被写体に対する代表距離値であり、検出領域の被写体の対応距離値との距離関係を、上述した考え方に従って判断の基準とすることができる。すなわち、第2の特徴量が大きい場合は、顔である可能性も大きく、第2の特徴量が小さい場合は、顔である可能性も小さい。   The representative distance value is a representative distance value with respect to the subject in the auxiliary region, and the distance relationship with the corresponding distance value of the subject in the detection region can be used as a criterion for determination according to the above-described concept. That is, when the second feature amount is large, the possibility of being a face is high, and when the second feature amount is small, the possibility of being a face is small.

図11にその判断の実例を示す。図11(a)は、距離画像30内の検出領域40における被写体が人物の顔50である場合を示す。検出領域40の上部に相当する補助領域41においては、顔50と同等の距離には被写体は存在せず、写っている被写体はかなり遠方の背景物になる。このような場合、補助領域41の被写体は通常、検出領域40の対応距離値と同等の距離値を有することはない。検出領域40にある被写体が顔50であるとすればこのように、第2の特徴量は比較的大きな値となる。   FIG. 11 shows an actual example of the determination. FIG. 11A shows a case where the subject in the detection area 40 in the distance image 30 is a human face 50. In the auxiliary area 41 corresponding to the upper part of the detection area 40, no subject exists at the same distance as the face 50, and the photographed subject becomes a background object far away. In such a case, the subject in the auxiliary area 41 usually does not have a distance value equivalent to the corresponding distance value in the detection area 40. Assuming that the subject in the detection area 40 is the face 50, the second feature amount is a relatively large value.

図11(b)は、距離画像30内の検出領域40における被写体が、顔50ではなく人物の胴体51である場合を示す。この場合、検出領域40の上部に相当する補助領域41においては、胴体51と同等の距離に顔50などの被写体が存在することになる。従って、第2の特徴量が比較的小さな値のときは、検出領域40の被写体は顔50でない可能性が高い。   FIG. 11B shows a case where the subject in the detection area 40 in the distance image 30 is a human torso 51 instead of the face 50. In this case, in the auxiliary region 41 corresponding to the upper portion of the detection region 40, a subject such as the face 50 exists at a distance equivalent to the body 51. Therefore, when the second feature amount is a relatively small value, there is a high possibility that the subject in the detection area 40 is not the face 50.

判定方法については後述するが、第2の特徴量による判定としては、所定の第2の閾値より大きいかどうかで判定すればよい。   Although the determination method will be described later, the determination based on the second feature amount may be performed based on whether or not it is larger than a predetermined second threshold.

以上で、第2の特徴量算出処理は終了する。   Thus, the second feature amount calculation process ends.

<第3の特徴量算出>
図2のステップS18、すなわち第3の特徴量算出工程の詳細フローについて、図12を用いて説明する。図12は第3の特徴量算出工程を示すフローチャートである。
<Third feature amount calculation>
A detailed flow of step S18 of FIG. 2, that is, the third feature amount calculation step will be described with reference to FIG. FIG. 12 is a flowchart showing the third feature amount calculation step.

図12の第3の特徴量算出は、検出領域設定部21で設定された検出領域を対象として第3の特徴量算出部25で実行される。   The third feature amount calculation in FIG. 12 is executed by the third feature amount calculation unit 25 for the detection region set by the detection region setting unit 21.

第3の特徴量は、検出領域内の被写体が距離に見合ったサイズの顔であるかどうかを判断するための、検出領域内での被写体の距離の分布を示す特徴量である。被写体が顔であるならば、距離の分布は水平方向または垂直方向で偏りが小さいことを利用する。   The third feature amount is a feature amount indicating a distribution of the distance of the subject in the detection region for determining whether or not the subject in the detection region is a face having a size corresponding to the distance. If the subject is a face, the distance distribution uses a small deviation in the horizontal direction or the vertical direction.

まずステップS91では、検出領域を水平方向または垂直方向に二等分し、領域S1と領域S2に分割する。分割とこの後のスキャン、特徴量算出処理は、水平方向と垂直方向、その両方の分割について行うことが望ましい。   First, in step S91, the detection area is divided into two equal parts in the horizontal direction or the vertical direction, and is divided into areas S1 and S2. It is desirable to perform the division, the subsequent scan, and the feature amount calculation processing for both the horizontal direction and the vertical direction.

ステップS92では、スキャン領域としてまずS1を設定する。分割した領域S1とS2とをそれぞれスキャンするが、その順序について、ここではまず領域S1からスキャンを始める。   In step S92, S1 is first set as a scan area. Each of the divided areas S1 and S2 is scanned. In this order, scanning is first started from the area S1.

次にステップS93では、スキャンする分割領域(初期はS1)内の全画素をスキャンするに際しての初期設定を行う。ここでは分割領域左上の画素をスキャン開始の画素位置として設定する。スキャン方向は既述した検出領域内スキャンと同様である。また後で距離値の総和を算出するための初期値を設定しておく。   Next, in step S93, initial setting is performed when all the pixels in the divided region to be scanned (initially S1) are scanned. Here, the upper left pixel of the divided area is set as the pixel position at which scanning is started. The scan direction is the same as the scan in the detection area described above. In addition, an initial value for calculating the sum of distance values later is set.

ステップS94では、分割領域内の全画素をスキャンし終えたかどうかを判定する。スキャン位置が分割領域右下画素を通過していれば、スキャン終了と判定すればよい。スキャン終了している場合(ステップS94:YES)は、ステップS97に進む。スキャン終了していない場合(ステップS94:NO)は、次のステップS95を実行する。   In step S94, it is determined whether or not all the pixels in the divided area have been scanned. If the scan position passes through the lower right pixel of the divided area, it may be determined that the scan is finished. If the scan is complete (step S94: YES), the process proceeds to step S97. If the scan has not ended (step S94: NO), the next step S95 is executed.

ステップS95では、分割領域内のスキャン位置の画素値から距離値を取得し、距離値の総和を求めるための加算処理を行っていく。   In step S95, the distance value is acquired from the pixel value at the scan position in the divided area, and an addition process for obtaining the sum of the distance values is performed.

次にステップS96では、分割領域内のスキャン位置を更新する。次の画素位置に移動する。その後、ステップS94に戻り、スキャン終了判定になるまで、ステップS94以下の分割領域内の各画素に対する処理を繰り返す。前述したように、ステップS94でスキャン終了判定になった場合に、分割領域内の各画素の処理ループを抜けて、ステップS97を実行する。   In step S96, the scan position in the divided area is updated. Move to the next pixel position. Thereafter, the process returns to step S94, and the process for each pixel in the divided area in step S94 and subsequent steps is repeated until it is determined that the scan is completed. As described above, when the scan end determination is made in step S94, the process loop of each pixel in the divided area is exited, and step S97 is executed.

ステップS97では、分割領域が初期設定したS1であるかどうかを判定する。分割領域がS1である場合(ステップS97:YES)は、ステップS98を実行する。分割領域がS1でない場合、つまりS2である場合(ステップS97:NO)は、ステップS99へ進む。   In step S97, it is determined whether or not the divided area is initially set S1. If the divided area is S1 (step S97: YES), step S98 is executed. If the divided area is not S1, that is, if it is S2 (step S97: NO), the process proceeds to step S99.

ステップS98では、分割領域S1のスキャンを終了したことから、次にスキャン領域としてS2を設定する。その後ステップS93へ戻り、ステップS94でスキャン終了判定するまで、領域S1と同様の処理を分割領域S2に対しても行う。   In step S98, since the scan of the divided area S1 is completed, next, S2 is set as the scan area. Thereafter, the process returns to step S93, and the process similar to that in the area S1 is performed on the divided area S2 until the scan end is determined in step S94.

ステップS94でスキャン終了判定し、ステップS97ヘ進み、さらにS2なのでステップS99へ進むと、ステップS99では、各分割領域内のスキャン処理中にステップS95で総和演算した各分割領域に対応するそれぞれの総和距離値s1及びs2に基づいて、その差分の絶対値を算出する。   In step S94, the scan end is determined, and the process proceeds to step S97. Further, since it is S2, the process proceeds to step S99. In step S99, the total sum corresponding to each divided area calculated in step S95 during the scan process in each divided area. Based on the distance values s1 and s2, the absolute value of the difference is calculated.

水平方向に分割した場合、水平差分値=|s1−s2|
垂直方向に分割した場合、垂直差分値=|s1−s2|
それぞれの場合に従って、水平差分値、または垂直差分値を第3の特徴量とする。もちろん、両方を算出し、両方を第3の特徴量としてもよい。その場合は、ステップS91からステップS99に至るすべてのステップを水平方向と垂直方向とで二回繰り返す処理を行えばよい。
When divided in the horizontal direction, the horizontal difference value = | s1−s2 |
When divided in the vertical direction, the vertical difference value = | s1−s2 |
According to each case, the horizontal difference value or the vertical difference value is set as the third feature amount. Of course, both may be calculated and both may be used as the third feature amount. In that case, all the steps from step S91 to step S99 may be repeated twice in the horizontal and vertical directions.

第3の特徴量である水平差分値、垂直差分値は、それぞれ、検出領域の被写体の距離が水平方向、垂直方向に均等に分布しているかどうかを示している。検出領域の被写体が顔であれば、上下、左右に距離はほぼ均等に分布し、逆にその差分が大きくなるような分布であれば、顔でない可能性が高い。すなわち、第3の特徴量が小さい場合は、検出領域の被写体は顔であり、大きい場合は顔でない可能性が高いと判断することができる。   The horizontal difference value and the vertical difference value, which are the third feature amounts, indicate whether or not the distance of the subject in the detection area is evenly distributed in the horizontal direction and the vertical direction, respectively. If the subject in the detection area is a face, the distance is almost evenly distributed vertically and horizontally, and if the difference is large, the possibility of not being a face is high. That is, when the third feature amount is small, it can be determined that the subject in the detection region is a face, and when it is large, the possibility that the subject is not a face is high.

図13にその判断の実例を示す。図13(a)は、検出領域40における被写体が人物の顔50である場合を、図13(b)には顔50が検出領域40から外れている場合を示す。(a)の検出領域40においては、顔50が水平方向ほぼ均等であり、水平差分値はかなり小さくなり、顔検出と判定できるが、(b)では、顔50のずれのため水平差分値は大きくなる。従って顔を検出したと判定すべきではない。   FIG. 13 shows an example of the determination. FIG. 13A shows a case where the subject in the detection area 40 is a human face 50, and FIG. 13B shows a case where the face 50 is out of the detection area 40. In the detection area 40 of (a), the face 50 is substantially uniform in the horizontal direction, and the horizontal difference value becomes considerably small and can be determined as face detection. However, in (b), the horizontal difference value is growing. Therefore, it should not be determined that a face has been detected.

図13(c)と(d)も同様である。検出領域40における被写体が人物の顔50である場合(c)と、顔50が検出領域40から外れている場合(d)とを示す。(c)の検出領域40においては、顔50が垂直方向ほぼ均等であり、垂直差分値はかなり小さくなり、顔検出と判定できるが、(d)では、顔50のずれのため垂直差分値は大きくなる。   The same applies to FIGS. 13C and 13D. A case (c) where the subject in the detection area 40 is a human face 50 and a case (d) where the face 50 is out of the detection area 40 are shown. In the detection area 40 of (c), the face 50 is substantially uniform in the vertical direction, and the vertical difference value is considerably small and can be determined as face detection. However, in (d), the vertical difference value is growing.

判定方法については後述するが、第3の特徴量による判定としては、所定の第3の閾値より小さいかどうかで判定すればよい。第3の特徴量が水平差分値、垂直差分値両方であれば、所定の第3の閾値も水平方向と垂直方向、両者を定めておけばよい。   Although the determination method will be described later, the determination based on the third feature amount may be determined based on whether or not it is smaller than a predetermined third threshold. If the third feature amount is both the horizontal difference value and the vertical difference value, the predetermined third threshold value may be determined in both the horizontal direction and the vertical direction.

以上で、第3の特徴量算出処理は終了する。   Thus, the third feature amount calculation process ends.

<検出判定>
図2のステップS25、すなわち特定物体検出判定工程の詳細フローについて、図14を用いて説明する。図14は特定物体検出判定工程を示すフローチャートである。
<Detection judgment>
A detailed flow of step S25 of FIG. 2, that is, the specific object detection determination step will be described with reference to FIG. FIG. 14 is a flowchart showing the specific object detection determination step.

図14の特定物体検出判定は、検出領域設定部21で設定された検出領域を対象として特定物体検出判定部27で実行される。   The specific object detection determination in FIG. 14 is executed by the specific object detection determination unit 27 for the detection region set by the detection region setting unit 21.

判定に用いるのは、先行するステップで算出されている第1、第2、第3の特徴量、及び入力画像判定結果である。この特定物体検出判定工程では、それぞれの判定がすべて検出を示したときに、検出したと判定するものである。   What is used for the determination is the first, second, and third feature amounts calculated in the preceding step, and the input image determination result. In this specific object detection determination step, when all the determinations indicate detection, it is determined that they have been detected.

まず、ステップS101では、検出領域に対する第1、第2、第3の特徴量を取得する。第1、第2、第3の特徴量は、それぞれ図2のステップS16、ステップS17、ステップS18で算出されている。   First, in step S101, first, second, and third feature amounts for the detection region are acquired. The first, second, and third feature amounts are calculated in step S16, step S17, and step S18 in FIG. 2, respectively.

次にステップS102では、第1の特徴量に基づく検出判定が行われる。判定は予め定められた第1の閾値TH1を用いて、次の式を満たすときに検出したと判定する。満たさないときは、検出しないと判定する。   Next, in step S102, detection determination based on the first feature amount is performed. The determination is made using the first threshold value TH1 determined in advance, and it is determined that the detection is made when the following expression is satisfied. When not satisfying, it determines with not detecting.

第1の特徴量>TH1
検出したという判定の場合(ステップS102:YES)は、次のステップS103を実行する。検出しないという判定の場合(ステップS102:NO)は、ステップS108へ進み、実行する。ステップS108では、即、特定物体検出せずの検出結果を提出して、特定物体検出判定を終了する。
First feature amount> TH1
If it is determined that it has been detected (step S102: YES), the next step S103 is executed. If it is determined not to be detected (step S102: NO), the process proceeds to step S108 and is executed. In step S108, the detection result without detecting the specific object is immediately submitted, and the specific object detection determination is terminated.

ステップS103では、第2の特徴量に基づく検出判定が行われる。判定は予め定められた第2の閾値TH2を用いて、次の式を満たすときに検出したと判定する。満たさないときは、検出しないと判定する。   In step S103, detection determination based on the second feature amount is performed. The determination is made using the second threshold value TH2 determined in advance, and it is determined that the detection is made when the following expression is satisfied. When not satisfying, it determines with not detecting.

第2の特徴量>TH2
検出したという判定の場合(ステップS103:YES)は、次のステップS104を実行する。検出しないという判定の場合(ステップS103:NO)は、ステップS108へ進み、実行する。ステップS108では、即、特定物体検出せずの検出結果を提出して、特定物体検出判定を終了する。
Second feature amount> TH2
If it is determined that it has been detected (step S103: YES), the next step S104 is executed. If it is determined not to be detected (step S103: NO), the process proceeds to step S108 and is executed. In step S108, the detection result without detecting the specific object is immediately submitted, and the specific object detection determination is terminated.

ステップS104では、第3の特徴量に基づく検出判定が行われる。判定は予め定められた第3の閾値TH3(水平、垂直いずれか、もしくは両方)を用いて、次の式を満たすときに検出したと判定する。満たさないときは、検出しないと判定する。   In step S104, detection determination based on the third feature amount is performed. The determination is made using the third threshold value TH3 (either horizontal or vertical or both) determined in advance, and it is determined that the detection is made when the following expression is satisfied. When not satisfying, it determines with not detecting.

第3の特徴量(水平差分値)<TH3(水平)
第3の特徴量(垂直差分値)<TH3(垂直)
検出したという判定の場合(ステップS104:YES)は、次のステップS105を実行する。検出しないという判定の場合(ステップS104:NO)は、ステップS108へ進み、実行する。ステップS108では、即、特定物体検出せずの検出結果を提出して、特定物体検出判定を終了する。
Third feature value (horizontal difference value) <TH3 (horizontal)
Third feature amount (vertical difference value) <TH3 (vertical)
If it is determined that it has been detected (step S104: YES), the next step S105 is executed. If it is determined not to be detected (step S104: NO), the process proceeds to step S108 and is executed. In step S108, the detection result without detecting the specific object is immediately submitted, and the specific object detection determination is terminated.

ステップS105では、第2の検出領域に対する検出判定結果を取得する。第2の検出領域は、図2のステップS21で設定され、ステップS22で既に入力画像判定が行われている。そこで第2の検出領域に対する検出判定結果が出ている。   In step S105, a detection determination result for the second detection region is acquired. The second detection area is set in step S21 in FIG. 2, and the input image determination has already been performed in step S22. Therefore, the detection determination result for the second detection region is output.

次にステップS106では、入力画像判定結果に基づく判定が行われる。入力画像判定結果が検出したという判定の場合(ステップS106:YES)は、次のステップS107を実行する。検出しないという判定の場合(ステップS106:NO)は、ステップS108へ進み、実行する。ステップS108では、即、特定物体検出せずの検出結果を提出して、特定物体検出判定を終了する。   Next, in step S106, determination based on the input image determination result is performed. If it is determined that the input image determination result has been detected (step S106: YES), the next step S107 is executed. If it is determined not to be detected (step S106: NO), the process proceeds to step S108 and is executed. In step S108, the detection result without detecting the specific object is immediately submitted, and the specific object detection determination is terminated.

ステップS107では、特定物体を検出したという検出結果を提出し、結果を記憶部103に記憶保存する。   In step S <b> 107, a detection result indicating that the specific object has been detected is submitted, and the result is stored and saved in the storage unit 103.

以上で、特定物体検出判定を終了する。処理途中で行われる各判定については、一部省略することも可能であるし、また追加することもできる。また各判定を行う順序を適当に入れ替えることも可能である。しかし、すべての判定で検出された場合のみ、最終的に特定物体検出と判定されることは変わらない。   This completes the specific object detection determination. About each determination performed in the middle of a process, a part can be abbreviate | omitted and it can also add. It is also possible to appropriately change the order in which each determination is performed. However, only when all the determinations are detected, it is determined that the specific object is finally detected.

(特定物体検出処理の動作フロー:別例)
図2で特定物体検出処理の全体フロー説明の際に、ステップS16以降は、距離画像に対する処理と、入力画像に対する処理とに分かれる、と述べた。図2のフローにおいては、ステップS25で統合して判定処理されるまで、両者は互いに独立して処理してかまわないような手順としていたが、実際は処理の効率を考慮するならば、何れかを優先処理するようなフローであってもかまわない。入力画像を優先処理する場合(別例1)は図15を参照して、距離画像を優先する場合(別例2)は図16を参照して、そのフローを説明する。
(Operation flow of specific object detection processing: another example)
In the description of the entire flow of the specific object detection process in FIG. 2, it has been described that the process after step S <b> 16 is divided into a process for a distance image and a process for an input image. In the flow of FIG. 2, the procedure is such that both may be processed independently until the determination processing is integrated in step S25. A flow that performs priority processing may be used. The flow will be described with reference to FIG. 15 when the input image is prioritized (another example 1) and with reference to FIG. 16 when the distance image is prioritized (another example 2).

<別例1>
図2の特定物体検出処理のフロー別例1について、図15を用いて説明する。図15は、特定物体検出処理の動作フローの別例1を示すフローチャートである。このフローでは、入力画像に対する判定処理を優先して実行し、そこで検出された場合のみ、距離画像に対する判定処理を行う。
<Example 1>
A specific example 1 of the specific object detection process in FIG. 2 will be described with reference to FIG. FIG. 15 is a flowchart illustrating another example 1 of the operation flow of the specific object detection process. In this flow, the determination process for the input image is preferentially executed, and the determination process for the distance image is performed only when it is detected there.

ステップS11からステップS15までは、図2と同様であり、説明は略す。   Steps S11 to S15 are the same as those in FIG.

引き続いて、ステップS21とステップS22の入力画像に対する判定処理を行う。処理内容は既述したとおりである。その後ステップS27で入力画像判定による検出判定を行う。ここでの検出判定は、図14における(S27)で示した各ステップに相当する。   Subsequently, determination processing for the input image in step S21 and step S22 is performed. The processing contents are as described above. In step S27, detection determination by input image determination is performed. The detection determination here corresponds to each step shown in (S27) in FIG.

ここで検出しないと判定された場合(ステップS27:NO)は、ステップS32へ進む。すなわち、検出しないという判定が確定し、検出領域のスキャンが進行する。検出すると判定された場合(ステップS27:YES)のみ、次のステップS16へ進む。   When it determines with not detecting here (step S27: NO), it progresses to step S32. That is, it is determined that the detection is not performed, and the scanning of the detection area proceeds. Only when it is determined to be detected (step S27: YES), the process proceeds to the next step S16.

次には、ステップS16からステップS18の距離画像に対する特徴量算出処理を行う。処理内容は既述したとおりである。その後ステップS26で第1から第3の特徴量による検出判定を行う。ここでの検出判定は、図14における(S26)で示した各ステップに相当する。   Next, a feature amount calculation process is performed on the distance image in steps S16 to S18. The processing contents are as described above. Thereafter, in step S26, detection determination based on the first to third feature amounts is performed. The detection determination here corresponds to each step shown in (S26) in FIG.

ここで検出しないと判定された場合(ステップS26:NO)は、ステップS32へ進む。すなわち、検出しないという判定が確定し、検出領域のスキャンが進行する。検出すると判定された場合(ステップS26:YES)のみ、次のステップS31へ進む。   When it determines with not detecting here (step S26: NO), it progresses to step S32. That is, it is determined that the detection is not performed, and the scanning of the detection area proceeds. Only when it is determined to be detected (step S26: YES), the process proceeds to the next step S31.

ステップS31では、特定物体検出判定結果を記憶部103に記憶保存する。   In step S <b> 31, the specific object detection determination result is stored and saved in the storage unit 103.

次のステップS32で検出領域のスキャン位置を更新し、ステップS14へ戻り、スキャン継続するのは、図2で述べたと同様であり、説明は省略する。   In the next step S32, the scan position of the detection area is updated, the process returns to step S14, and the scan continues, as described with reference to FIG.

以上のようにして、特定物体検出処理のフロー別例1を終了するが、入力画像に対する判定処理を優先して実行し、そこで検出された場合のみ、距離画像に対する判定処理を行うので、入力画像に対する判定処理の方がより効率的、あるいは精度のよい場合などに適したフローである。   As described above, the specific object detection process by flow example 1 is completed. However, the determination process for the input image is performed with priority, and the determination process for the distance image is performed only when the input image is detected. This is a flow suitable for the case where the determination process is more efficient or more accurate.

<別例2>
図2の特定物体検出処理のフロー別例2について、図16を用いて説明する。図16は、特定物体検出処理の動作フローの別例2を示すフローチャートである。このフローでは、距離画像に対する判定処理を優先して実行し、そこで検出された場合のみ、入力画像に対する判定処理を行う。
<Another example 2>
A specific example 2 of the specific object detection process in FIG. 2 will be described with reference to FIG. FIG. 16 is a flowchart illustrating another example 2 of the operation flow of the specific object detection process. In this flow, the determination process for the distance image is preferentially executed, and the determination process for the input image is performed only when it is detected there.

ステップS11からステップS15までは、図2と同様であり、説明は略す。   Steps S11 to S15 are the same as those in FIG.

引き続いて、ステップS16からステップS18の距離画像に対する特徴量算出処理を行う。処理内容は既述したとおりである。その後ステップS26で第1から第3の特徴量による検出判定を行う。ここでの検出判定は、図14における(S26)で示した各ステップに相当する。   Subsequently, a feature amount calculation process for the distance image in steps S16 to S18 is performed. The processing contents are as described above. Thereafter, in step S26, detection determination based on the first to third feature amounts is performed. The detection determination here corresponds to each step shown in (S26) in FIG.

ここで検出しないと判定された場合(ステップS26:NO)は、ステップS32へ進む。すなわち、検出しないという判定が確定し、検出領域のスキャンが進行する。検出すると判定された場合(ステップS26:YES)のみ、次のステップS21へ進む。   When it determines with not detecting here (step S26: NO), it progresses to step S32. That is, it is determined that the detection is not performed, and the scanning of the detection area proceeds. Only when it is determined to be detected (step S26: YES), the process proceeds to the next step S21.

次には、ステップS21とステップS22の入力画像に対する判定処理を行う。処理内容は既述したとおりである。その後ステップS27で入力画像判定による検出判定を行う。ここでの検出判定は、図14における(S27)で示した各ステップに相当する。   Next, determination processing for the input image in step S21 and step S22 is performed. The processing contents are as described above. In step S27, detection determination by input image determination is performed. The detection determination here corresponds to each step shown in (S27) in FIG.

ここで検出しないと判定された場合(ステップS27:NO)は、ステップS32へ進む。すなわち、検出しないという判定が確定し、検出領域のスキャンが進行する。検出すると判定された場合(ステップS27:YES)のみ、次のステップS31へ進む。   When it determines with not detecting here (step S27: NO), it progresses to step S32. That is, it is determined that the detection is not performed, and the scanning of the detection area proceeds. Only when it is determined to be detected (step S27: YES), the process proceeds to the next step S31.

ステップS31では、特定物体検出判定結果を記憶部103に記憶保存する。   In step S <b> 31, the specific object detection determination result is stored and saved in the storage unit 103.

次のステップS32で検出領域のスキャン位置を更新し、ステップS14へ戻り、スキャン継続するのは、図2で述べたと同様であり、説明は省略する。   In the next step S32, the scan position of the detection area is updated, the process returns to step S14, and the scan continues, as described with reference to FIG.

以上のようにして、特定物体検出処理のフロー別例2を終了するが、距離画像に対する判定処理を優先して実行し、そこで検出された場合のみ、入力画像に対する判定処理を行うので、距離画像に対する判定処理の方がより効率的、あるいは精度のよい場合などに適したフローである。   As described above, the specific object detection process by flow example 2 ends. However, the determination process for the distance image is performed with priority, and the determination process for the input image is performed only when it is detected there. This is a flow suitable for the case where the determination process is more efficient or more accurate.

このように本実施形態によれば、画像中の特定物体の位置と大きさを検出するのに距離情報を利用するに当たり、距離に応じた適切な検出領域を設定するとともに、検出する領域のサイズとの関係だけでなく、検出領域での距離情報の空間分布を解析する、あるいは検出領域周辺部まで距離情報利用を拡張することにより、より精度よく、かつより効率的に画像中の特定物体とその大きさを検出できる特定物体検出装置、特定物体検出方法、及び特定物体検出プログラムを提供することができる。   As described above, according to this embodiment, when using distance information to detect the position and size of a specific object in an image, an appropriate detection area is set according to the distance, and the size of the area to be detected is set. Analysis of the spatial distribution of the distance information in the detection area, or by extending the use of the distance information to the periphery of the detection area, the specific object in the image can be more accurately and more efficiently It is possible to provide a specific object detection apparatus, a specific object detection method, and a specific object detection program capable of detecting the size.

また本発明の範囲は、上記実施形態に限定されるものではない。本発明の趣旨を逸脱しない限り、それらの変更された形態もその範囲に含むものである。   Further, the scope of the present invention is not limited to the above embodiment. Unless it deviates from the meaning of this invention, those changed forms are also included in the range.

本発明に係る特定物体検出装置の一実施形態について、その機能構成を示すブロック図である。It is a block diagram which shows the function structure about one Embodiment of the specific object detection apparatus which concerns on this invention. 特定物体検出装置による特定物体検出処理の全体動作フローを示すフローチャートである。It is a flowchart which shows the whole operation | movement flow of the specific object detection process by a specific object detection apparatus. 距離画像生成工程を示すフローチャートである。It is a flowchart which shows a distance image generation process. 入力画像とそれに基づき生成された距離画像の例を示す図である。It is a figure which shows the example of the distance image produced | generated based on the input image and it. 検出領域設定工程を示すフローチャートである。It is a flowchart which shows a detection area setting process. 視差、すなわち距離値と検出領域サイズとの対応関係を示す図である。It is a figure which shows the correspondence of parallax, ie, a distance value, and a detection area size. 検出領域のスキャンによる検出領域サイズの変化(a)、及び検出領域サイズを変化させてのスキャン反復(b)、を示す図である。It is a figure which shows the change (a) of the detection area size by the scan of a detection area, and the scanning repetition (b) by changing a detection area size. 第1の特徴量算出工程を示すフローチャートである。It is a flowchart which shows a 1st feature-value calculation process. 第1の特徴量による判定の具体例を示す図である。It is a figure which shows the specific example of the determination by a 1st feature-value. 第2の特徴量算出工程を示すフローチャートである。It is a flowchart which shows a 2nd feature-value calculation process. 第2の特徴量による判定の具体例を示す図である。It is a figure which shows the specific example of the determination by a 2nd feature-value. 第3の特徴量算出工程を示すフローチャートである。It is a flowchart which shows a 3rd feature-value calculation process. 第3の特徴量による判定の具体例を示す図である。It is a figure which shows the specific example of the determination by a 3rd feature-value. 特定物体検出判定工程を示すフローチャートである。It is a flowchart which shows a specific object detection determination process. 特定物体検出処理の全体フロー別例1を示すフローチャートである。It is a flowchart which shows the example 1 according to the whole flow of a specific object detection process. 特定物体検出処理の全体フロー別例2を示すフローチャートである。It is a flowchart which shows the example 2 according to the whole flow of a specific object detection process.

符号の説明Explanation of symbols

10 特定物体検出処理部
11 入力画像取得部
12 距離画像生成部
13 対応関係設定部
14 特定物体検出処理制御部
15 特定物体検出処理出力部
20 検出領域処理部
21 検出領域設定部
22 第2の検出領域設定部
23 第1の特徴量算出部
24 第2の特徴量算出部
25 第3の特徴量算出部
26 入力画像判定部
27 特定物体検出判定部
30、30a、30b 距離画像
31a、31b 入力画像
40、40a、40b 検出領域
41 補助領域
50 被写体(顔)
51 被写体(胴体)
101 入力部
102 操作部
103 記憶部
104 表示部
105 出力部
DESCRIPTION OF SYMBOLS 10 Specific object detection process part 11 Input image acquisition part 12 Distance image generation part 13 Correspondence relationship setting part 14 Specific object detection process control part 15 Specific object detection process output part 20 Detection area process part 21 Detection area setting part 22 2nd detection Area setting unit 23 First feature value calculation unit 24 Second feature value calculation unit 25 Third feature value calculation unit 26 Input image determination unit 27 Specific object detection determination unit 30, 30a, 30b Distance image 31a, 31b Input image 40, 40a, 40b Detection area 41 Auxiliary area 50 Subject (face)
51 Subject (torso)
101 Input unit 102 Operation unit 103 Storage unit 104 Display unit 105 Output unit

Claims (24)

視点の異なる複数の入力画像を取得する入力画像取得手段と、
前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段と、
検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段と、
前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段と、
前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段と、
前記検出領域設定手段により設定された前記検出領域の周辺に補助領域を設定し、該補助領域と前記検出領域の距離値の関係から第2の特徴量を算出する第2の特徴量算出手段と、
前記第1の特徴量と前記第2の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段と、
を有することを特徴とする特定物体検出装置。
Input image acquisition means for acquiring a plurality of input images from different viewpoints;
Distance image generating means for generating a distance image from a plurality of input images acquired by the input image acquiring means;
Correspondence setting means for setting a correspondence between the distance value in the distance image and the size of the detection region for detecting the specific object based on a predetermined specific object to be detected;
Detection area setting means for setting a detection area having a size corresponding to a distance value in the distance image based on the correspondence set by the correspondence setting means;
A first feature amount calculating means for calculating a first feature amount based on a size of a region satisfying a distance value corresponding to the size of the detection region set by the detection region setting means;
A second feature amount calculating unit that sets an auxiliary region around the detection region set by the detection region setting unit, and calculates a second feature amount from a relationship between a distance value between the auxiliary region and the detection region; ,
Specific object detection determination means for determining whether the predetermined specific object is detected in the detection region based on the first feature amount and the second feature amount;
A specific object detection device comprising:
前記第1の特徴量算出手段は、
前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、
前記第2の特徴量算出手段は、
前記検出領域の上部に前記補助領域を設定し、該補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を前記検出領域に対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する、
ことを特徴とする請求項1に記載の特定物体検出装置。
The first feature amount calculating means includes:
In the detection area, the ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection area within a predetermined range to the total number of pixels is calculated as a first feature amount,
The second feature amount calculating means includes:
The auxiliary region is set above the detection region, and an average value, a median value, or a distance value with the largest number of pixels having the same distance value in the auxiliary region, and a distance value corresponding to the detection region Comparing, and calculating the absolute value of the difference as the second feature amount,
The specific object detection device according to claim 1.
前記特定物体検出判定手段は、
前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第2の特徴量が所定の第2の閾値より大きい場合に、前記特定物体を検出したと判定する、
ことを特徴とする請求項1または2に記載の特定物体検出装置。
The specific object detection determination means includes
Determining that the specific object has been detected when the first feature value is greater than a predetermined first threshold value and the second feature value is greater than a predetermined second threshold value;
The specific object detection device according to claim 1, wherein
視点の異なる複数の入力画像を取得する入力画像取得手段と、
前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段と、
検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段と、
前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段と、
前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段と、
前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の空間分布に基づき第3の特徴量を算出する第3の特徴量算出手段と、
前記第1の特徴量と前記第3の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段と、
を有することを特徴とする特定物体検出装置。
Input image acquisition means for acquiring a plurality of input images from different viewpoints;
Distance image generating means for generating a distance image from a plurality of input images acquired by the input image acquiring means;
Correspondence setting means for setting a correspondence between the distance value in the distance image and the size of the detection region for detecting the specific object based on a predetermined specific object to be detected;
Detection area setting means for setting a detection area having a size corresponding to a distance value in the distance image based on the correspondence set by the correspondence setting means;
A first feature amount calculating means for calculating a first feature amount based on a size of a region satisfying a distance value corresponding to the size of the detection region set by the detection region setting means;
Third feature quantity calculating means for calculating a third feature quantity based on a spatial distribution of an area satisfying a distance value corresponding to the size of the detection area set by the detection area setting means;
Specific object detection determination means for determining whether the predetermined specific object is detected in the detection region based on the first feature amount and the third feature amount;
A specific object detection device comprising:
前記第1の特徴量算出手段は、
前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、
前記第3の特徴量算出手段は、
前記検出領域を水平方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、
または前記検出領域を垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった垂直方向差分値、
を第3の特徴量として算出する、
ことを特徴とする請求項4に記載の特定物体検出装置。
The first feature amount calculating means includes:
In the detection area, the ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection area within a predetermined range to the total number of pixels is calculated as a first feature amount,
The third feature amount calculating means includes:
A horizontal direction difference value obtained by calculating a sum of distance values in each region obtained by dividing the detection region into two in the horizontal direction, and taking an absolute value of a difference of each sum,
Alternatively, the sum of distance values is calculated in each region obtained by dividing the detection region into two in the vertical direction, and the vertical direction difference value obtained by taking the absolute value of the difference of each sum,
Is calculated as the third feature amount,
The specific object detection apparatus according to claim 4.
前記特定物体検出判定手段は、
前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第3の特徴量が所定の第3の閾値より小さい場合に、前記特定物体を検出したと判定する、
ことを特徴とする請求項4または5に記載の特定物体検出装置。
The specific object detection determination means includes
Determining that the specific object has been detected when the first feature value is greater than a predetermined first threshold value and the third feature value is less than a predetermined third threshold value;
The specific object detection device according to claim 4 or 5, wherein
前記距離画像の生成に用いた複数の入力画像の一つである第1の画像に対して、
前記検出領域設定手段により前記距離画像内に設定された前記検出領域の位置と対応する前記第1の入力画像内の位置に第2の検出領域を設定する第2の検出領域設定手段と、
前記第2の検出領域に対して、前記特定物体の検出を行い、検出したかどうかを判定する入力画像判定手段とを有し、
前記特定物体検出判定手段は、
前記入力画像判定手段による判定結果に基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する、
ことを特徴とする請求項1乃至6の何れか1項に記載の特定物体検出装置。
For a first image that is one of a plurality of input images used to generate the distance image,
Second detection area setting means for setting a second detection area at a position in the first input image corresponding to the position of the detection area set in the distance image by the detection area setting means;
An input image determination unit that detects the specific object with respect to the second detection region and determines whether the specific object is detected;
The specific object detection determination means includes
Based on the determination result by the input image determination means, it is determined whether or not the predetermined specific object is detected in the detection region;
The specific object detection apparatus according to claim 1, wherein the specific object detection apparatus is a single object detection apparatus.
前記特定物体検出判定手段によって検出判定される特定物体は顔である、
ことを特徴とする請求項1乃至7の何れか1項に記載の特定物体検出装置。
The specific object detected and determined by the specific object detection determination means is a face;
The specific object detection apparatus according to claim 1, wherein the specific object detection apparatus is a single object detection apparatus.
視点の異なる複数の入力画像を取得する入力画像取得工程と、
前記入力画像取得工程において取得された複数の入力画像から距離画像を生成する距離画像生成工程と、
検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定工程と、
前記対応関係設定工程において設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定工程と、
前記検出領域設定工程において設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出工程と、
前記検出領域設定工程において設定された前記検出領域の周辺に補助領域を設定し、該補助領域と前記検出領域の距離値の関係から第2の特徴量を算出する第2の特徴量算出工程と、
前記第1の特徴量と前記第2の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定工程と、
を有することを特徴とする特定物体検出方法。
An input image acquisition step of acquiring a plurality of input images from different viewpoints;
A distance image generation step of generating a distance image from a plurality of input images acquired in the input image acquisition step;
A correspondence setting step for setting a correspondence between a distance value in the distance image and a size of a detection region for detecting the specific object based on a predetermined specific object to be detected;
A detection region setting step of setting a detection region of a size corresponding to a distance value in the distance image based on the correspondence set in the correspondence relationship setting step;
A first feature amount calculating step of calculating a first feature amount based on a width of a region satisfying a distance value corresponding to the size of the detection region set in the detection region setting step;
A second feature amount calculating step of setting an auxiliary region around the detection region set in the detection region setting step and calculating a second feature amount from a relationship between a distance value between the auxiliary region and the detection region; ,
A specific object detection determination step of determining whether or not the predetermined specific object is detected in the detection region based on the first feature value and the second feature value;
A specific object detection method characterized by comprising:
前記第1の特徴量算出工程では、
前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、
前記第2の特徴量算出工程では、
前記検出領域の上部に前記補助領域を設定し、該補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を前記検出領域に対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する、
ことを特徴とする請求項9に記載の特定物体検出方法。
In the first feature amount calculating step,
In the detection area, the ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection area within a predetermined range to the total number of pixels is calculated as a first feature amount,
In the second feature amount calculating step,
The auxiliary region is set above the detection region, and an average value, a median value, or a distance value with the largest number of pixels having the same distance value in the auxiliary region, and a distance value corresponding to the detection region Comparing, and calculating the absolute value of the difference as the second feature amount,
The specific object detection method according to claim 9.
前記特定物体検出判定工程では、
前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第2の特徴量が所定の第2の閾値より大きい場合に、前記特定物体を検出したと判定する、
ことを特徴とする請求項9または10に記載の特定物体検出方法。
In the specific object detection determination step,
Determining that the specific object has been detected when the first feature value is greater than a predetermined first threshold value and the second feature value is greater than a predetermined second threshold value;
The specific object detection method according to claim 9 or 10, wherein:
視点の異なる複数の入力画像を取得する入力画像取得工程と、
前記入力画像取得工程において取得された複数の入力画像から距離画像を生成する距離画像生成工程と、
検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定工程と、
前記対応関係設定工程において設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定工程と、
前記検出領域設定工程において設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出工程と、
前記検出領域設定工程において設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の空間分布に基づき第3の特徴量を算出する第3の特徴量算出工程と、
前記第1の特徴量と前記第3の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定工程と、
を有することを特徴とする特定物体検出方法。
An input image acquisition step of acquiring a plurality of input images from different viewpoints;
A distance image generation step of generating a distance image from a plurality of input images acquired in the input image acquisition step;
A correspondence setting step for setting a correspondence between a distance value in the distance image and a size of a detection region for detecting the specific object based on a predetermined specific object to be detected;
A detection region setting step of setting a detection region of a size corresponding to a distance value in the distance image based on the correspondence set in the correspondence relationship setting step;
A first feature amount calculating step of calculating a first feature amount based on a width of a region satisfying a distance value corresponding to the size of the detection region set in the detection region setting step;
A third feature amount calculating step of calculating a third feature amount based on a spatial distribution of a region satisfying a distance value corresponding to the size of the detection region set in the detection region setting step;
A specific object detection determination step of determining whether the predetermined specific object is detected in the detection region based on the first feature amount and the third feature amount;
A specific object detection method characterized by comprising:
前記第1の特徴量算出工程では、
前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、
前記第3の特徴量算出工程では、
前記検出領域を水平方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、
または前記検出領域を垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった垂直方向差分値、
を第3の特徴量として算出する、
ことを特徴とする請求項12に記載の特定物体検出方法。
In the first feature amount calculating step,
In the detection area, the ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection area within a predetermined range to the total number of pixels is calculated as a first feature amount,
In the third feature amount calculating step,
A horizontal direction difference value obtained by calculating a sum of distance values in each region obtained by dividing the detection region into two in the horizontal direction, and taking an absolute value of a difference of each sum,
Alternatively, the sum of distance values is calculated in each region obtained by dividing the detection region into two in the vertical direction, and the vertical direction difference value obtained by taking the absolute value of the difference of each sum,
Is calculated as the third feature amount,
The specific object detection method according to claim 12.
前記特定物体検出判定工程では、
前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第3の特徴量が所定の第3の閾値より小さい場合に、前記特定物体を検出したと判定する、
ことを特徴とする請求項12または13に記載の特定物体検出方法。
In the specific object detection determination step,
Determining that the specific object has been detected when the first feature value is greater than a predetermined first threshold value and the third feature value is less than a predetermined third threshold value;
The specific object detection method according to claim 12 or 13, characterized in that:
前記距離画像の生成に用いた複数の入力画像の一つである第1の画像に対して、
前記検出領域設定工程において前記距離画像内に設定された前記検出領域の位置と対応する前記第1の入力画像内の位置に第2の検出領域を設定する第2の検出領域設定工程と、
前記第2の検出領域に対して、前記特定物体の検出を行い、検出したかどうかを判定する入力画像判定工程とを有し、
前記特定物体検出判定工程では、
前記入力画像判定工程における判定結果に基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する、
ことを特徴とする請求項9乃至14の何れか1項に記載の特定物体検出方法。
For a first image that is one of a plurality of input images used to generate the distance image,
A second detection region setting step of setting a second detection region at a position in the first input image corresponding to the position of the detection region set in the distance image in the detection region setting step;
An input image determination step for detecting the specific object with respect to the second detection region and determining whether the specific object has been detected;
In the specific object detection determination step,
Based on the determination result in the input image determination step, it is determined whether the predetermined specific object is detected in the detection region,
The method for detecting a specific object according to claim 9, wherein the specific object is detected.
前記特定物体検出判定工程において検出判定される特定物体は顔である、
ことを特徴とする請求項9乃至15の何れか1項に記載の特定物体検出方法。
The specific object detected and determined in the specific object detection determination step is a face;
The specific object detection method according to any one of claims 9 to 15, wherein
特定物体の検出処理を制御するコンピュータを、
視点の異なる複数の入力画像を取得する入力画像取得手段、
前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段、
検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段、
前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段、
前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段、
前記検出領域設定手段により設定された前記検出領域の周辺に補助領域を設定し、該補助領域と前記検出領域の距離値の関係から第2の特徴量を算出する第2の特徴量算出手段、
前記第1の特徴量と前記第2の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段、
として機能させることを特徴とする特定物体検出プログラム。
A computer that controls the detection process of a specific object,
Input image acquisition means for acquiring a plurality of input images from different viewpoints;
Distance image generation means for generating a distance image from a plurality of input images acquired by the input image acquisition means;
Correspondence setting means for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object based on a predetermined specific object to be detected;
Detection area setting means for setting a detection area of a size corresponding to a distance value in the distance image based on the correspondence set by the correspondence setting means;
A first feature amount calculating means for calculating a first feature amount based on a size of a region satisfying a distance value corresponding to the size of the detection region set by the detection region setting means;
A second feature quantity calculating means for setting an auxiliary area around the detection area set by the detection area setting means and calculating a second feature quantity from a relationship between a distance value between the auxiliary area and the detection area;
Specific object detection determination means for determining whether or not the predetermined specific object is detected in the detection region based on the first feature value and the second feature value;
A specific object detection program characterized by causing it to function as
前記第1の特徴量算出手段は、
前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、
前記第2の特徴量算出手段は、
前記検出領域の上部に前記補助領域を設定し、該補助領域内の距離値の平均値、中央値、または同じ距離値を有する画素の最も多い距離値、を前記検出領域に対応する距離値と比較し、その差分の絶対値を第2の特徴量として算出する、
ことを特徴とする請求項17に記載の特定物体検出プログラム。
The first feature amount calculating means includes:
In the detection area, the ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection area within a predetermined range to the total number of pixels is calculated as a first feature amount,
The second feature amount calculating means includes:
The auxiliary region is set above the detection region, and an average value, a median value, or a distance value with the largest number of pixels having the same distance value in the auxiliary region, and a distance value corresponding to the detection region Comparing, and calculating the absolute value of the difference as the second feature amount,
The specific object detection program according to claim 17.
前記特定物体検出判定手段は、
前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第2の特徴量が所定の第2の閾値より大きい場合に、前記特定物体を検出したと判定する、
ことを特徴とする請求項17または18に記載の特定物体検出プログラム。
The specific object detection determination means includes
Determining that the specific object has been detected when the first feature value is greater than a predetermined first threshold value and the second feature value is greater than a predetermined second threshold value;
The specific object detection program according to claim 17 or 18, characterized in that:
特定物体の検出処理を制御するコンピュータを、
視点の異なる複数の入力画像を取得する入力画像取得手段、
前記入力画像取得手段により取得された複数の入力画像から距離画像を生成する距離画像生成手段、
検出すべき所定の特定物体に基づいて、前記距離画像における距離値と前記特定物体検出のための検出領域のサイズとの対応関係を設定する対応関係設定手段、
前記対応関係設定手段により設定された対応関係に基づき、前記距離画像において距離値に対応したサイズの検出領域を設定する検出領域設定手段、
前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の広さに基づき第1の特徴量を算出する第1の特徴量算出手段、
前記検出領域設定手段により設定された前記検出領域に対して、そのサイズに対応する距離値を満たす領域の空間分布に基づき第3の特徴量を算出する第3の特徴量算出手段、
前記第1の特徴量と前記第3の特徴量とに基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する特定物体検出判定手段、
として機能させることを特徴とする特定物体検出プログラム。
A computer that controls the detection process of a specific object,
Input image acquisition means for acquiring a plurality of input images from different viewpoints;
Distance image generation means for generating a distance image from a plurality of input images acquired by the input image acquisition means;
Correspondence setting means for setting the correspondence between the distance value in the distance image and the size of the detection area for detecting the specific object based on a predetermined specific object to be detected;
Detection area setting means for setting a detection area of a size corresponding to a distance value in the distance image based on the correspondence set by the correspondence setting means;
A first feature amount calculating means for calculating a first feature amount based on a size of a region satisfying a distance value corresponding to the size of the detection region set by the detection region setting means;
A third feature amount calculating unit that calculates a third feature amount based on a spatial distribution of a region that satisfies a distance value corresponding to the size of the detection region set by the detection region setting unit;
Specific object detection determination means for determining whether or not the predetermined specific object is detected in the detection region based on the first feature value and the third feature value;
A specific object detection program characterized by causing it to function as
前記第1の特徴量算出手段は、
前記検出領域において、前記検出領域に対応する距離値と所定範囲内で同等の距離値を有する画素数の、全画素数に対する比率を第1の特徴量として算出し、
前記第3の特徴量算出手段は、
前記検出領域を水平方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった水平方向差分値、
または前記検出領域を垂直方向に2分割した各領域内で距離値の総和を算出し、各総和の差分の絶対値をとった垂直方向差分値、
を第3の特徴量として算出する、
ことを特徴とする請求項20に記載の特定物体検出プログラム。
The first feature amount calculating means includes:
In the detection area, the ratio of the number of pixels having a distance value equivalent to the distance value corresponding to the detection area within a predetermined range to the total number of pixels is calculated as a first feature amount,
The third feature amount calculating means includes:
A horizontal direction difference value obtained by calculating a sum of distance values in each region obtained by dividing the detection region into two in the horizontal direction, and taking an absolute value of a difference of each sum,
Alternatively, the sum of distance values is calculated in each region obtained by dividing the detection region into two in the vertical direction, and the vertical direction difference value obtained by taking the absolute value of the difference of each sum,
Is calculated as the third feature amount,
The specific object detection program according to claim 20.
前記特定物体検出判定手段は、
前記第1の特徴量が所定の第1の閾値より大きく、かつ前記第3の特徴量が所定の第3の閾値より小さい場合に、前記特定物体を検出したと判定する、
ことを特徴とする請求項20または21に記載の特定物体検出プログラム。
The specific object detection determination means includes
Determining that the specific object has been detected when the first feature value is greater than a predetermined first threshold value and the third feature value is less than a predetermined third threshold value;
The specific object detection program according to claim 20 or 21, wherein:
前記コンピュータを、
前記距離画像の生成に用いた複数の入力画像の一つである第1の画像に対して、
前記検出領域設定手段により前記距離画像内に設定された前記検出領域の位置と対応する前記第1の入力画像内の位置に第2の検出領域を設定する第2の検出領域設定手段、
前記第2の検出領域に対して、前記特定物体の検出を行い、検出したかどうかを判定する入力画像判定手段、
として機能させ、
前記特定物体検出判定手段は、
前記入力画像判定手段による判定結果に基づいて、前記検出領域において前記所定の特定物体が検出されたかどうかを判定する、
ことを特徴とする請求項17乃至22の何れか1項に記載の特定物体検出プログラム。
The computer,
For a first image that is one of a plurality of input images used to generate the distance image,
Second detection area setting means for setting a second detection area at a position in the first input image corresponding to the position of the detection area set in the distance image by the detection area setting means;
An input image determination unit that detects the specific object with respect to the second detection region and determines whether or not the specific object is detected.
Function as
The specific object detection determination means includes
Based on the determination result by the input image determination means, it is determined whether or not the predetermined specific object is detected in the detection region;
The specific object detection program according to any one of claims 17 to 22, wherein
前記特定物体検出判定手段によって検出判定される特定物体は顔である、
ことを特徴とする請求項17乃至23の何れか1項に記載の特定物体検出プログラム。
The specific object detected and determined by the specific object detection determination means is a face;
The specific object detection program according to any one of claims 17 to 23, wherein:
JP2006106067A 2006-04-07 2006-04-07 Specific object detection device, specific object detection method, and specific object detection program Pending JP2007280088A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006106067A JP2007280088A (en) 2006-04-07 2006-04-07 Specific object detection device, specific object detection method, and specific object detection program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006106067A JP2007280088A (en) 2006-04-07 2006-04-07 Specific object detection device, specific object detection method, and specific object detection program

Publications (1)

Publication Number Publication Date
JP2007280088A true JP2007280088A (en) 2007-10-25

Family

ID=38681469

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006106067A Pending JP2007280088A (en) 2006-04-07 2006-04-07 Specific object detection device, specific object detection method, and specific object detection program

Country Status (1)

Country Link
JP (1) JP2007280088A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011134117A (en) * 2009-12-24 2011-07-07 Canon Inc Object region extraction apparatus, method for controlling the same, object tracking apparatus, and program
JP2011138226A (en) * 2009-12-25 2011-07-14 Canon Inc Object tracking device, method for controlling the same and program
JP2013030183A (en) * 2012-09-28 2013-02-07 Toyota Central R&D Labs Inc Environment recognition device, and program
WO2014064870A1 (en) * 2012-10-22 2014-05-01 株式会社ソニー・コンピュータエンタテインメント Image processing device and image processing method
EP2919159A2 (en) 2014-03-12 2015-09-16 Toyota Jidosha Kabushiki Kaisha Image processing device and image processing method
JP2016213744A (en) * 2015-05-12 2016-12-15 キヤノン株式会社 Subject tracking device, optical device, imaging device, control method of object tracking device, and program
EP3477544A1 (en) 2017-10-30 2019-05-01 Canon Kabushiki Kaisha Information processing apparatus, information processing method, imaging apparatus, network camera system, and program

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011134117A (en) * 2009-12-24 2011-07-07 Canon Inc Object region extraction apparatus, method for controlling the same, object tracking apparatus, and program
JP2011138226A (en) * 2009-12-25 2011-07-14 Canon Inc Object tracking device, method for controlling the same and program
JP2013030183A (en) * 2012-09-28 2013-02-07 Toyota Central R&D Labs Inc Environment recognition device, and program
WO2014064870A1 (en) * 2012-10-22 2014-05-01 株式会社ソニー・コンピュータエンタテインメント Image processing device and image processing method
US20150287215A1 (en) * 2012-10-22 2015-10-08 Sony Computer Entertainment Inc. Image processor and image processing method
US9542755B2 (en) * 2012-10-22 2017-01-10 Sony Corporation Image processor and image processing method
EP2919159A2 (en) 2014-03-12 2015-09-16 Toyota Jidosha Kabushiki Kaisha Image processing device and image processing method
JP2016213744A (en) * 2015-05-12 2016-12-15 キヤノン株式会社 Subject tracking device, optical device, imaging device, control method of object tracking device, and program
EP3477544A1 (en) 2017-10-30 2019-05-01 Canon Kabushiki Kaisha Information processing apparatus, information processing method, imaging apparatus, network camera system, and program
JP2019082795A (en) * 2017-10-30 2019-05-30 キヤノン株式会社 Information processing device, information processing method and program
JP7123545B2 (en) 2017-10-30 2022-08-23 キヤノン株式会社 Information processing device, information processing method and program

Similar Documents

Publication Publication Date Title
US10043313B2 (en) Information processing apparatus, information processing method, information processing system, and storage medium
JP7176965B2 (en) Image inspection equipment
JP2007280088A (en) Specific object detection device, specific object detection method, and specific object detection program
US20180211138A1 (en) Information processing device, information processing method, and storage medium
JP5949314B2 (en) Parallax map generator and program for parallax map generator
US8055016B2 (en) Apparatus and method for normalizing face image used for detecting drowsy driving
JP5517504B2 (en) Image processing apparatus, image processing method, and program
JP6242563B2 (en) Object detection device
JP7287791B2 (en) Image inspection device
JP5613741B2 (en) Image processing apparatus, method, and program
JP6020471B2 (en) Image processing method, image processing apparatus, and image processing program
WO2014108976A1 (en) Object detecting device
JP4978227B2 (en) Image detection device
KR20120107483A (en) Textile article identification device and textile article gripping system
JP2011089784A (en) Device for estimating direction of object
JP2014142832A (en) Image processing apparatus, control method of image processing apparatus, and program
JP2010267257A (en) Apparatus, method and program for processing image
JP5020920B2 (en) Pedestrian detection device and program
JP2008140107A (en) Image processor, image processing method, control program, and recording medium
JP2009187204A (en) Image processing apparatus
JP5838948B2 (en) Object identification device
CN112036319B (en) Picture processing method, device, equipment and storage medium
JP2008027275A (en) Object detection apparatus, object detection method, and control program
JP2015215235A (en) Object detection device and object detection method
US20230017607A1 (en) Imaging apparatus