JP2008282031A - Imaging apparatus and imaging apparatus control method, and computer program - Google Patents

Imaging apparatus and imaging apparatus control method, and computer program Download PDF

Info

Publication number
JP2008282031A
JP2008282031A JP2008163410A JP2008163410A JP2008282031A JP 2008282031 A JP2008282031 A JP 2008282031A JP 2008163410 A JP2008163410 A JP 2008163410A JP 2008163410 A JP2008163410 A JP 2008163410A JP 2008282031 A JP2008282031 A JP 2008282031A
Authority
JP
Japan
Prior art keywords
face
focus
subject
subject distance
lens
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
JP2008163410A
Other languages
Japanese (ja)
Inventor
Yoshito Terajima
義人 寺島
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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2008163410A priority Critical patent/JP2008282031A/en
Publication of JP2008282031A publication Critical patent/JP2008282031A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a constitution to perform efficient and accurate focus control. <P>SOLUTION: A focus set position is decided by detecting a face area from an input image, calculating a subject distance based on the size of the detected face, estimating a focus position based on the calculated subject distance information, setting a short focus lens operation range and moving a lens in the set range. By such an arrangement, a distance of the lens to be moved is shortened, and high-speed focus control is achieved. Since the imaging apparatus has a constitution to perform subject distance calculation processing applying the reference value of the size of the face corresponding to the subject based on subject information such as race, gender, age and physique, the more accurate focus control adapted to the subject is achieved. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、撮像装置、および撮像装置制御方法、並びにコンピュータ・プログラムに関する。さらに、詳細には、目的とする被写体に対する迅速で正確なオートフォーカス処理を行なうことを可能とした撮像装置、および撮像装置制御方法、並びにコンピュータ・プログラムに関する。   The present invention relates to an imaging apparatus, an imaging apparatus control method, and a computer program. More specifically, the present invention relates to an imaging apparatus, an imaging apparatus control method, and a computer program that can perform a quick and accurate autofocus process on a target subject.

昨今の多くのスチルカメラやビデオカメラなどの撮像装置には、被写体に対するフォーカスを自動的に合わせるオートフォーカス(AF)機構が搭載されている。さらに、近年、オートフォーカス(AF)機能を備えたカメラにおいて、画面内の複数のエリアを測距し、その中から最も撮影者に近いもの、画面の中央に近いものといった様々な優先順付けの結果として最適なエリア選び出し、そのエリアに対してピントが合うようにレンズを駆動する機能、いわゆる「マルチAF」、「多点測距AF」が広く採用されている。この機能を適用することで主要被写体が必ずしも画面の中央に存在しない場合においても、撮影者が特別な操作をすることなしに主要被写体に対する適切なピント合わせが可能となる。なお、オートフォーカス制御構成については、例えば特許文献1に記載がある。   Many recent imaging apparatuses such as a still camera and a video camera are equipped with an autofocus (AF) mechanism that automatically adjusts a focus on a subject. Furthermore, in recent years, in a camera equipped with an autofocus (AF) function, a plurality of areas in the screen are measured, and various priorities such as the one closest to the photographer and the one closest to the center of the screen are selected. As a result, an optimum area is selected and a function of driving the lens so that the area is in focus, so-called “multi AF” and “multi-point AF” are widely used. By applying this function, even when the main subject does not necessarily exist at the center of the screen, it is possible to properly focus on the main subject without the photographer performing a special operation. The autofocus control configuration is described in, for example, Patent Document 1.

しかし、このようなマルチAFや多点測距AFも万能ではなく、特定の構図に対してのみ有効な構成である。一般的なカメラの撮影においては人間が主要被写体になるケースが非常に多いが、撮影画像における人物の位置は多様であり様々な構図がある。そもそも撮像装置における測距エリアが設定されていない位置に目的被写体がいるケースもある。このような場合、マルチAFや多点測距AFを適用しても人物に対するフォーカスは適切に行われない。   However, such multi-AF and multi-point ranging AF are not universal and are effective only for a specific composition. In general camera shooting, a human being is a main subject in many cases, but the position of a person in a shot image is various and has various compositions. In the first place, there is a case where the target subject is located at a position where no distance measuring area is set in the imaging apparatus. In such a case, even if multi-AF or multi-point ranging AF is applied, the person is not properly focused.

このような問題を解決するため、撮像装置において画像から顔を認識し、測距エリアを認識された顔の位置に設定することで、どのような構図でも顔にピントを合わせることを可能とした構成が提案されている。例えば、特許文献2にこのような顔認識に基づくフォーカス制御構成が開示されている。この顔認識に基づくフォーカス制御によって様々な構図の撮影において適切なフォーカス制御(ピント合わせ)が可能になる。   In order to solve such problems, it is possible to focus on the face in any composition by recognizing the face from the image in the imaging device and setting the distance measurement area to the recognized face position. A configuration is proposed. For example, Patent Document 2 discloses a focus control configuration based on such face recognition. The focus control based on the face recognition enables appropriate focus control (focusing) in photographing with various compositions.

しかし、シャッターチャンスを逃さないためには、時間のかかる処理は不適当である。すなわち、単に顔に測距エリアを合わせるだけのAFでは不十分であり、AF高速化に向けた工夫が必要となる。素早くフォーカス制御を行い、シャッターチャンスを逃さないという観点からフォーカス制御処理を提案した構成としては、例えば特許文献3がある。特許文献3では、特定の被写体を認識し追尾しながら測距を実行してフォーカス制御を迅速に実行してシャッターチャンスを逃さない撮影を可能とする装置を提案している。   However, in order not to miss a photo opportunity, time-consuming processing is inappropriate. That is, AF that simply adjusts the distance measurement area to the face is insufficient, and a device for increasing the AF speed is required. As a configuration that proposes focus control processing from the viewpoint of performing quick focus control and not missing a photo opportunity, there is, for example, Patent Document 3. Patent Document 3 proposes an apparatus that enables shooting without missing a photo opportunity by performing distance measurement while recognizing and tracking a specific subject and quickly executing focus control.

しかしながら、このような主要被写体を追尾するAFにおいては、撮影者にとっての主要被写体は何か?ということが課題になる。この課題の1つの解決手法として、画像から顔を認識して、顔を主要被写体と判定する方法があると考えられる。しかしながら、この方法においては、複数の人物が存在するシーンでは、どの人物を主要被写体に設定するかということが問題となる。   However, in AF that tracks such a main subject, what is the main subject for the photographer? That is a challenge. One solution to this problem is a method of recognizing a face from an image and determining the face as a main subject. However, in this method, in a scene where a plurality of persons exist, it becomes a problem which person is set as a main subject.

このように、オートフォーカス(AF)には様々な解決すべき問題があるが、理想的なオートフォーカス(AF)を実現するために要求される基本的な機能としては、次の3点が最重要項目であると考えられる。
1.主要被写体に確実にピントを合わせる
2.短時間でピントを合わせる
3.複数の主要被写体候補からピントを合わせるべき被写体を確実にかつ迅速に選択する。
また、もう1つの基本的な要求としてコストダウンがある。上記の機能を実現するために価格が高くなることは好ましくない。例えば、高価な測距センサーなどの外部測距装置などを用いないで確実に素早くフォーカス制御を実現させる構成が望まれる。
特開平04−000421号公報 特開2003−107335号公報 特開昭60−254207号公報
As described above, autofocus (AF) has various problems to be solved, but the following three points are the most basic functions required to realize ideal autofocus (AF). It is considered an important item.
1. Make sure to focus on the main subject. 2. Focus in a short time. A subject to be focused is selected reliably and quickly from a plurality of main subject candidates.
Another basic requirement is cost reduction. It is not preferable that the price increases in order to realize the above function. For example, there is a demand for a configuration that reliably and quickly realizes focus control without using an external distance measuring device such as an expensive distance measuring sensor.
Japanese Patent Laid-Open No. 04-000421 JP 2003-107335 A JP 60-254207 A

本発明は、このような状況に鑑みてなされたものであり、目的とする被写体に対する迅速で正確なオートフォーカス処理を行なうことを可能とした撮像装置、および撮像装置制御方法、並びにコンピュータ・プログラムを提供することを目的とする。   The present invention has been made in view of such a situation, and provides an imaging apparatus, an imaging apparatus control method, and a computer program capable of performing quick and accurate autofocus processing on a target subject. The purpose is to provide.

本発明の第1の側面は、
撮像装置において入力する入力画像から、テンプレートマッチング処理によって顔領域を検出する顔検出部と、
顔検出部の検出した顔の大きさに基づいて被写体距離を算出する被写体距離算出部と、
前記被写体距離算出部の算出した被写体距離に基づいてフォーカス位置を推定し、該推定したフォーカス位置を中心として、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定するレンズ動作範囲算出部と、
前記レンズ動作範囲算出部の設定したレンズ動作範囲内において、フォーカスレンズを移動させて、コントラストの高低を判定してフォーカスレンズ設定位置を決定するフォーカス制御部とを有し、
前記被写体距離算出部は、
前記被写体距離として、前記テンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出する撮像装置にある。
The first aspect of the present invention is:
A face detection unit that detects a face area by template matching processing from an input image input in the imaging apparatus;
A subject distance calculation unit that calculates a subject distance based on the size of the face detected by the face detection unit;
A lens operating range calculating unit that estimates a focus position based on the subject distance calculated by the subject distance calculating unit, and sets a focus lens operating range shorter than the entire operating range of the focus lens around the estimated focus position;
A focus control unit that determines a focus lens setting position by moving a focus lens within a lens operation range set by the lens operation range calculation unit and determining a contrast level;
The subject distance calculation unit
In the imaging apparatus, the range of the subject distance is calculated as the subject distance in consideration of an error generated in the template matching process.

さらに、本発明の撮像装置の一実施態様において、前記レンズ動作範囲算出部は、前記撮像装置のデバイスに起因する誤差を考慮して前記フォーカスレンズ動作範囲を設定する構成であるものとする。 Further, in the imaging apparatus according to an embodiment of the present invention, the lens operating range calculation unit is intended in consideration of an error caused by the device of the imaging device is configured to set the focus lens operation range.

さらに、本発明の撮像装置の一実施態様において、前記被写体距離算出部は、顔検出部の検出した顔の大きさに基づく被写体距離算出処理において、人種、性別、年齢、体格の少なくともいずれかの被写体情報を入力し、入力した被写体情報に基づいて、被写体に応じた顔の大きさの基準値を適用した被写体距離算出処理を実行する構成であるものとする。   Furthermore, in one embodiment of the imaging apparatus of the present invention, the subject distance calculation unit is configured to perform at least one of race, sex, age, and physique in the subject distance calculation process based on the face size detected by the face detection unit. It is assumed that the subject distance calculation process is executed by applying the reference value of the face size corresponding to the subject based on the entered subject information.

さらに、本発明の撮像装置の一実施態様において、前記人種、性別、年齢、体格の少なくともいずれかの被写体情報は、撮像装置において入力する入力画像の画像解析部における解析結果として前記被写体距離算出部に入力される情報であるものとする。   Furthermore, in one embodiment of the imaging device of the present invention, the subject information of at least one of race, sex, age, and physique is calculated as the subject distance as an analysis result in an image analysis unit of an input image input in the imaging device. It is assumed that the information is input to the section.

さらに、本発明の撮像装置の一実施態様において、前記人種、性別、年齢、体格の少なくともいずれかの被写体情報は、撮像装置におけるユーザ入力部を介して前記被写体距離算出部に入力される情報であるものとする。   Furthermore, in one embodiment of the imaging device of the present invention, the subject information of at least one of race, sex, age, and physique is information input to the subject distance calculation unit via a user input unit in the imaging device. Suppose that

さらに、本発明の撮像装置の一実施態様において、前記被写体距離算出部は、被写体に応じた顔の大きさの基準値を適用した被写体距離算出処理を実行する構成であり、顔の大きさの基準値を、一つの値ではなく、ある値の範囲を持つ基準値として算出し、範囲を持つ基準値を適用して、範囲を持つ被写体距離を算出する処理を実行する構成であるものとする。   Furthermore, in an embodiment of the imaging apparatus of the present invention, the subject distance calculation unit is configured to execute a subject distance calculation process to which a reference value of the face size according to the subject is applied. The reference value is calculated not as a single value but as a reference value having a range of a certain value, and a process for calculating a subject distance having the range by applying the reference value having a range is executed. .

さらに、本発明の撮像装置の一実施態様において、前記撮像装置は、さらに、前記顔検出部の検出した複数の顔の優先順位を設定する優先順位解析部を有し、前記優先順位解析部は、顔の大きさ、または、顔の中央への近さ、または人種、性別、年齢、体格の少なくともいずれかの被写体情報を指標として顔の優先順位決定処理を実行する構成であり、前記レンズ動作範囲算出部は、前記優先順位解析部の決定した顔の優先順位情報に基づいてフォーカスレンズ動作範囲を設定する処理を実行する構成であるものとする。   Furthermore, in an embodiment of the imaging apparatus of the present invention, the imaging apparatus further includes a priority analysis unit that sets priority orders of a plurality of faces detected by the face detection unit, and the priority analysis unit includes: , The size of the face, the proximity to the center of the face, or subject information of at least one of race, gender, age, and physique is used as an index to execute face priority determination processing, and the lens The operation range calculation unit is configured to execute processing for setting a focus lens operation range based on the face priority information determined by the priority analysis unit.

さらに、本発明の撮像装置の一実施態様において、前記レンズ動作範囲算出部は、前記優先順位解析部の決定した最も優先度の高い顔に対応する被写体距離情報に基づいてフォーカスレンズ動作範囲を設定する処理を実行する構成であるものとする。   Furthermore, in an embodiment of the imaging apparatus of the present invention, the lens movement range calculation unit sets a focus lens movement range based on subject distance information corresponding to the face with the highest priority determined by the priority order analysis unit. It is assumed that the processing is executed.

さらに、本発明の撮像装置の一実施態様において、前記レンズ動作範囲算出部は、前記優先順位解析部の決定した優先度順の複数の顔に対応する被写体距離情報に基づいて算出される複数のフォーカスレンズ動作範囲を含む範囲を最終的なフォーカスレンズ動作範囲として設定する処理を実行する構成であるものとする。   Furthermore, in an embodiment of the imaging apparatus according to the present invention, the lens movement range calculation unit is calculated based on subject distance information corresponding to a plurality of faces in order of priority determined by the priority analysis unit. It is assumed that the processing for setting the range including the focus lens operation range as the final focus lens operation range is executed.

さらに、本発明の撮像装置の一実施態様において、前記撮像装置は、さらに、前記フォーカス制御部におけるフォーカスレンズ設定位置の決定に基づいて合焦成功と判断されたモニタ出力画像中の顔領域に合焦成功を示す合焦表示を行なう表示制御部を有するものとする。   Furthermore, in an embodiment of the imaging apparatus of the present invention, the imaging apparatus further matches the face area in the monitor output image determined to be in focus successfully based on the determination of the focus lens setting position in the focus control unit. It is assumed that a display control unit that performs focus display indicating successful focus is provided.

さらに、本発明の第2の側面は、
撮像装置において、オートフォーカス制御を実行する撮像装置制御方法であり、
顔検出部において、撮像装置において入力する入力画像から、テンプレートマッチング処理によって顔領域を検出する顔検出ステップと、
被写体距離算出部において、顔検出部の検出した顔の大きさに基づいて被写体距離を算出する被写体距離算出ステップと、
レンズ動作範囲算出部において、前記被写体距離算出部の算出した被写体距離情報に基づいてフォーカス位置を推定し、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定するレンズ動作範囲算出ステップと、
フォーカス制御部において、前記レンズ動作範囲算出部の設定したレンズ動作範囲内において、フォーカスレンズを移動させて、コントラストの高低を判定してフォーカスレンズ設定位置を決定するフォーカス制御ステップとを有し、
前記被写体距離算出ステップは、
前記被写体距離として、前記テンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出する撮像装置制御方法にある。
Furthermore, the second aspect of the present invention provides
An imaging apparatus control method for executing autofocus control in an imaging apparatus,
In the face detection unit, a face detection step of detecting a face region by template matching processing from an input image input in the imaging device;
A subject distance calculation step of calculating a subject distance based on the size of the face detected by the face detection unit in the subject distance calculation unit;
A lens operating range calculating step for estimating a focus position based on the subject distance information calculated by the subject distance calculating unit and setting a focus lens operating range shorter than the entire operating range of the focus lens in the lens operating range calculating unit;
A focus control step in which the focus control unit moves the focus lens within the lens operation range set by the lens operation range calculation unit and determines the focus lens setting position by determining the level of contrast;
The subject distance calculating step includes:
In the imaging apparatus control method, a range of the subject distance is calculated as the subject distance in consideration of an error generated in the template matching process.

さらに、本発明の第3の側面は、撮像装置において、オートフォーカス制御を実行させるコンピュータ・プログラムであり、
顔検出部において、撮像装置において入力する入力画像から、テンプレートマッチング処理によって顔領域を検出させる顔検出ステップと、
被写体距離算出部において、顔検出部の検出した顔の大きさに基づいて被写体距離を算出させる被写体距離算出ステップと、
レンズ動作範囲算出部において、前記被写体距離算出部の算出した被写体距離情報に基づいてフォーカス位置を推定し、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定させるレンズ動作範囲算出ステップと、
フォーカス制御部において、前記レンズ動作範囲算出部の設定したレンズ動作範囲内において、フォーカスレンズを移動させて、コントラストの高低を判定してフォーカスレンズ設定位置を決定させるフォーカス制御ステップとを有し、
前記被写体距離算出ステップは、
前記被写体距離として、前記テンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出させるコンピュータ・プログラムにある。
Furthermore, a third aspect of the present invention is a computer program that executes autofocus control in an imaging apparatus,
In the face detection unit, a face detection step of detecting a face region by template matching processing from an input image input in the imaging device;
A subject distance calculation step in which the subject distance calculation unit calculates the subject distance based on the size of the face detected by the face detection unit;
A lens operating range calculating step for estimating a focus position based on the subject distance information calculated by the subject distance calculating unit and setting a focus lens operating range shorter than the entire operating range of the focus lens in the lens operating range calculating unit;
A focus control step in which the focus control unit moves the focus lens within the lens operation range set by the lens operation range calculation unit, determines the contrast level and determines the focus lens setting position;
The subject distance calculating step includes:
A computer program for calculating a range of a subject distance in consideration of an error generated in the template matching process as the subject distance.

なお、本発明のコンピュータ・プログラムは、例えば、様々なプログラム・コードを実行可能な汎用コンピュータ・システムに対して、コンピュータ可読な形式で提供する記憶媒体、通信媒体、例えば、CDやFD、MOなどの記憶媒体、あるいは、ネットワークなどの通信媒体によって提供可能なコンピュータ・プログラムである。このようなプログラムをコンピュータ可読な形式で提供することにより、コンピュータ・システム上でプログラムに応じた処理が実現される。   The computer program of the present invention is, for example, a storage medium or communication medium provided in a computer-readable format to a general-purpose computer system capable of executing various program codes, such as a CD, FD, MO, etc. Or a computer program that can be provided by a communication medium such as a network. By providing such a program in a computer-readable format, processing corresponding to the program is realized on the computer system.

本発明のさらに他の目的、特徴や利点は、後述する本発明の実施例や添付する図面に基づくより詳細な説明によって明らかになるであろう。なお、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   Other objects, features, and advantages of the present invention will become apparent from a more detailed description based on embodiments of the present invention described later and the accompanying drawings. In this specification, the system is a logical set configuration of a plurality of devices, and is not limited to one in which the devices of each configuration are in the same casing.

本発明の一実施例の構成では、撮像装置におけるオートフォーカス処理において、入力画像から顔領域を検出し、検出した顔の大きさに基づいて被写体距離を算出して、算出した被写体距離情報に基づいてフォーカス位置を推定する。さらに、この推定したフォーカス位置を基準として、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定し、設定したレンズ動作範囲内において、フォーカスレンズを移動させてフォーカスレンズ設定位置を決定する。また、被写体距離として、顔のテンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出を算出する。このため、フォーカス制御において移動させるレンズの距離を短く設定することが可能となり、高速なフォーカス制御が実現される。   In the configuration of an embodiment of the present invention, a face area is detected from an input image in an autofocus process in the imaging apparatus, a subject distance is calculated based on the detected face size, and the calculated subject distance information is used. To estimate the focus position. Further, a focus lens operating range shorter than the entire operating range of the focus lens is set on the basis of the estimated focus position, and the focus lens is moved within the set lens operating range to determine the focus lens setting position. The subject distance range is calculated by taking into account errors that occur in the face template matching process as the subject distance. For this reason, the distance of the lens to be moved in the focus control can be set short, and high-speed focus control is realized.

以下、図面を参照しながら本発明の撮像装置、および撮像装置制御方法、並びにコンピュータ・プログラムの詳細について説明する。   The details of the imaging apparatus, imaging apparatus control method, and computer program of the present invention will be described below with reference to the drawings.

本発明は、目的とする被写体に対する迅速で正確なオートフォーカスを可能とした構成を開示するものである。本発明の撮像装置では、フォーカス制御の手法として、レンズを介して取得された撮像データのコントラストの高低を判断する手法を基本として用いる。撮像画像の特定領域をフォーカス制御用の信号取得領域(空間周波数抽出エリア)として設定し、この特定領域のコントラストが高いほどフォーカスが合っており、コントラストが低いとフォーカスがずれていると判定し、コントラストをより高くする位置にレンズを駆動して調整する方式である。   The present invention discloses a configuration that enables quick and accurate autofocus on a target subject. In the image pickup apparatus of the present invention, as a focus control method, a method for determining the level of contrast of image data acquired through a lens is basically used. A specific area of the captured image is set as a signal acquisition area (spatial frequency extraction area) for focus control, and the higher the contrast of this specific area, the more focused, and if the contrast is low, it is determined that the focus is shifted, In this method, the lens is driven and adjusted to a position where the contrast is higher.

具体的には、特定領域の高周波成分を抽出して、抽出した高周波成分の積分データを生成し、生成した高周波成分積分データに基づいてコントラストの高低を判定する方法が適用される。すなわち、コントラストの高低判定のために特定領域の高周波成分積分値を算出して、これを評価値(AF評価値)として利用する。評価値が最大となるようにフォーカスレンズを駆動することでオートフォーカスが実現される。オートフォーカスを行なうためには、上述の評価値を指針としてレンズを駆動させることが必要となる。レンズ駆動機構としては例えばボイスコイルモータなどが利用される。   Specifically, a method of extracting high-frequency components in a specific region, generating integrated data of the extracted high-frequency components, and determining the level of contrast based on the generated high-frequency component integrated data is applied. That is, a high-frequency component integral value in a specific region is calculated for contrast level determination and used as an evaluation value (AF evaluation value). Autofocus is realized by driving the focus lens so that the evaluation value is maximized. In order to perform autofocus, it is necessary to drive the lens using the above-described evaluation value as a guide. For example, a voice coil motor is used as the lens driving mechanism.

本発明は、このようなコントラスト識別処理を用いたフォーカス制御において、さらに、目的被写体としての人物の顔の大きさを判定し、その大きさに基づいて被写体の距離を推定し、この推定情報を適用してフォーカス制御範囲を狭めて迅速なフォーカス制御を可能とする。さらに、本発明は、顔の大きさの個人差、人種差、年齢差、性別差などを考慮して、顔の大きさに基づく被写体の距離推定をより正確に実行することを可能とするものである。   In the focus control using such contrast identification processing, the present invention further determines the size of a person's face as a target subject, estimates the distance of the subject based on the size, and calculates the estimated information as Apply to narrow the focus control range and enable quick focus control. Furthermore, the present invention makes it possible to more accurately execute subject distance estimation based on face size in consideration of individual differences, race differences, age differences, gender differences, and the like of face sizes. It is.

まず、図を参照して、本発明の撮像装置の構成について説明する。図1は、本発明の撮像装置10の外観を示す図である。図1(a)は、撮像装置10の上面図、(b)は正面図、(c)は背面図である。(a)上面図のレンズ部分は断面図として示してある。撮像装置10は、電源スイッチ11、画像取り込みタイミングを設定するトリガ手段、すなわちシャッターとして機能するレリーズスイッチ12、撮像装置によって撮影される画像(スルー画像)や操作情報などを表示するモニタ13、撮像素子(CCD)としてのイメージャ14、ズーム制御を行うためのズームボタン15、各種の操作情報を入力する操作ボタン16、撮像装置によって撮影される画像(スルー画像)を確認するためのビューファインダ17、フォーカス調整において駆動されるフォーカスレンズ18、ズーム調整に際して駆動されるズームレンズ19、撮影モードを設定するためのモードダイアル20、フォーカスレンズ18を駆動するためのフォーカスレンズモータ(M1)21、ズームレンズ19を駆動するためのズームレンズモータ(M2)22を有する。   First, the configuration of the imaging apparatus of the present invention will be described with reference to the drawings. FIG. 1 is a diagram illustrating an appearance of an imaging apparatus 10 according to the present invention. 1A is a top view of the imaging apparatus 10, FIG. 1B is a front view, and FIG. 1C is a rear view. (A) The lens portion of the top view is shown as a cross-sectional view. The imaging apparatus 10 includes a power switch 11, trigger means for setting image capture timing, that is, a release switch 12 that functions as a shutter, a monitor 13 that displays an image (through image) photographed by the imaging apparatus, operation information, and the like, an imaging element An imager 14 (CCD), a zoom button 15 for performing zoom control, an operation button 16 for inputting various operation information, a viewfinder 17 for confirming an image (through image) photographed by the imaging device, and a focus A focus lens 18 driven for adjustment, a zoom lens 19 driven for zoom adjustment, a mode dial 20 for setting a photographing mode, a focus lens motor (M1) 21 for driving the focus lens 18, and a zoom lens 19 For driving Having over zoom lens motor (M2) 22.

被写体画像は、ビューファインダ17およびモニタ13に表示される。ビューファインダ17およびモニタ13は例えばLCDによって構成され、レンズを介する被写体画像が動画像として映し出される。この動画像はスルー画と呼ばれる。ユーザは、ビューファインダ17またはモニタ13を確認して、撮影する目標被写体を確認して、シャッターとしてのレリーズスイッチ12を押すことで画像の記録処理が実行されることになる。   The subject image is displayed on the viewfinder 17 and the monitor 13. The viewfinder 17 and the monitor 13 are configured by, for example, an LCD, and a subject image through the lens is displayed as a moving image. This moving image is called a through image. The user confirms the viewfinder 17 or the monitor 13, confirms the target subject to be photographed, and presses the release switch 12 as a shutter, thereby executing image recording processing.

図2を参照して本発明の撮像装置100の内部構成について説明する。本発明の撮像装置は、オートフォーカス機能を持つ撮像装置である。フォーカスレンズ101、ズームレンズ102を介する入射光は、例えばCCD(Charge Coupled Device)などの撮像素子103に入力し、撮像素子103において光電変換される。光電変換データは、アナログ信号処理部104に入力され、アナログ信号処理部104においてノイズ除去等の処理がなされ、A/D変換部105においてデジタル信号に変換される。A/D変換部105においてデジタル変換されたデータは、例えばフラッシュメモリなどによって構成される記録デバイス115に記録される。さらに、モニタ117、ビューファインダ(EVF)116に表示される。モニタ117、ビューファインダ(EVF)116には撮影の有無に関わらず、レンズを介する画像がスルー画として表示される。   With reference to FIG. 2, an internal configuration of the imaging apparatus 100 of the present invention will be described. The imaging device of the present invention is an imaging device having an autofocus function. Incident light that passes through the focus lens 101 and the zoom lens 102 is input to an image sensor 103 such as a CCD (Charge Coupled Device), for example, and is photoelectrically converted by the image sensor 103. The photoelectric conversion data is input to the analog signal processing unit 104, subjected to processing such as noise removal in the analog signal processing unit 104, and converted into a digital signal in the A / D conversion unit 105. The data digitally converted by the A / D conversion unit 105 is recorded in a recording device 115 configured by, for example, a flash memory. Further, it is displayed on the monitor 117 and the viewfinder (EVF) 116. An image through the lens is displayed as a through image on the monitor 117 and the viewfinder (EVF) 116 regardless of whether or not shooting is performed.

操作部118は、図1を参照して説明したカメラ本体にあるレリーズスイッチ12、ズームボタン15、各種の操作情報を入力する操作ボタン16、撮影モードを設定するためのモードダイアル20等を含む操作部である。制御部110は、CPUを有し、撮像装置の実行する各種の処理の制御を予めメモリ(ROM)120などに格納されたプログラムに従って実行する。メモリ(EEPROM)119は不揮発性メモリであり、画像データ、各種の補助情報、プログラムなどが格納される。メモリ(ROM)120は、制御部(CPU)110が使用するプログラムや演算パラメータ等を格納する。メモリ(RAM)121は、制御部(CPU)110において使用するプログラムや、その実行において適宜変化するパラメータ等を格納する。ジャイロ111は、撮像装置の傾き、揺れなどを検出する。検出情報は、制御部(CPU)110に入力され手ぶれ防止などの処理が実行される。   The operation unit 118 includes operations such as a release switch 12, a zoom button 15, an operation button 16 for inputting various operation information, a mode dial 20 for setting a shooting mode, and the like in the camera body described with reference to FIG. Part. The control unit 110 includes a CPU and executes control of various processes executed by the imaging apparatus according to a program stored in advance in a memory (ROM) 120 or the like. A memory (EEPROM) 119 is a non-volatile memory, and stores image data, various auxiliary information, programs, and the like. The memory (ROM) 120 stores programs, calculation parameters, and the like used by the control unit (CPU) 110. The memory (RAM) 121 stores programs used in the control unit (CPU) 110, parameters that change as appropriate during the execution, and the like. The gyro 111 detects the tilt and shake of the imaging device. The detection information is input to the control unit (CPU) 110, and processing such as camera shake prevention is executed.

モータドライバ112は、フォーカスレンズ101に対応して設定されたフォーカスレンズ駆動モータ113、ズームレンズ102に対応して設定されたズームレンズ駆動モータ114を駆動する。垂直ドラバ107は、撮像素子(CCD)103を駆動する。タイミングジェネレータ106は、撮像素子103およびアナログ信号処理部104の処理タイミングの制御信号を生成して、これらの各処理部の処理タイミングを制御する。   The motor driver 112 drives a focus lens drive motor 113 set corresponding to the focus lens 101 and a zoom lens drive motor 114 set corresponding to the zoom lens 102. The vertical driver 107 drives the image sensor (CCD) 103. The timing generator 106 generates control signals for the processing timing of the image sensor 103 and the analog signal processing unit 104, and controls the processing timing of each of these processing units.

顔検出部130は、レンズを介して入力される画像データの解析を行い、画像データ中の人物の顔を検出する。顔検出情報は、制御部110に送られ、制御部110では、検出された顔情報に基づいて、目的被写体としての人物の顔の大きさを判定し、その大きさに基づいて被写体の距離を推定する。さらに、この推定情報を適用してフォーカス制御範囲を狭めて迅速なフォーカス制御を行なう。さらに、顔の大きさに基づく被写体距離の推定処理に際して、顔の大きさの個人差、人種差、年齢差、性別差などを考慮した処理を行うことで正確な距離推定を実現する。   The face detection unit 130 analyzes image data input via the lens, and detects a human face in the image data. The face detection information is sent to the control unit 110. The control unit 110 determines the size of the face of the person as the target subject based on the detected face information, and determines the distance of the subject based on the size. presume. Furthermore, this focus information is applied to narrow the focus control range and perform quick focus control. Further, when the subject distance is estimated based on the size of the face, accurate distance estimation is realized by performing processing in consideration of individual differences, race differences, age differences, sex differences, and the like of the face size.

本発明の撮像装置では、前述したように、フォーカス制御において、レンズを介して取得された撮像データのコントラストの高低を判断する手法を基本として用いるが、このコントラスト識別処理を用いたフォーカス制御において、さらに、目的被写体としての人物の顔の大きさを判定し、その大きさに基づいて被写体の距離を推定し、この推定情報を適用してフォーカス制御範囲を狭めて迅速なフォーカス制御を可能とする。   In the imaging apparatus of the present invention, as described above, in the focus control, a technique for determining the level of contrast of imaging data acquired via the lens is basically used. In the focus control using the contrast identification process, Further, the size of the face of the person as the target subject is determined, the distance of the subject is estimated based on the size, and this estimation information is applied to narrow the focus control range and enable quick focus control. .

コントラストに基づくフォーカス位置の判定処理においては、特定領域の高周波成分積分値を算出して、これを評価値(AF評価値)として利用する。評価値が最大となるようにフォーカスレンズを駆動することでオートフォーカスが実現される。具体的なオートフォーカス制御処理には、AF評価値が頂点をキープするようにフォーカスレンズにサーボをかける方法(山登り法)や、特定の領域を特定の間隔の評価値データを取ってそれらの評価値の最大値をとったフォーカス位置にフォーカスレンズを移動させる方法(候補範囲サーチ法)などがある。   In the focus position determination process based on contrast, a high-frequency component integral value of a specific area is calculated and used as an evaluation value (AF evaluation value). Autofocus is realized by driving the focus lens so that the evaluation value is maximized. Specific autofocus control processing includes a method of applying servo to the focus lens so that the AF evaluation value keeps the vertex (mountain climbing method), and taking evaluation value data of specific areas at specific intervals and evaluating them. There is a method of moving the focus lens to the focus position where the maximum value is taken (candidate range search method).

AF評価値が頂点をキープするようにフォーカスレンズにサーボをかける山登り法は、常に最適なピントを提供するが場合によってはピントが合うまでの時間がかかる、また、特定の領域を特定の間隔の評価値データを取ってそれらの評価値の最大値をとったフォーカス位置にフォーカスレンズを移動させる候補範囲サーチ法はおよそどのようなシーンでも短時間でピントが合うが、ピントが合うのはある特定の瞬間に限られ被写体が動けばピントがずれてしまうという問題がある。   The hill-climbing method that servos the focus lens so that the AF evaluation value keeps the apex always provides the best focus, but sometimes it takes time to focus, and a specific area at a specific interval The candidate range search method that takes evaluation value data and moves the focus lens to the focus position that takes the maximum value of those evaluation values can be focused in a short time in almost any scene, but it is possible to focus There is a problem that the subject is out of focus if the subject moves only in the moment.

本発明の撮像装置では、顔検出部130において、画像データ中の人物の顔を検出し、制御部110において検出された顔情報に基づいて、目的被写体としての人物の顔の大きさを判定し、その大きさに基づいて被写体の距離を推定し、上述の山登りAF法、端点間サーチAF法に基づくフォーカス位置探索処理の動作範囲を狭めて設定して、その設定領域内で山登りAF法、端点間サーチAF法のいずれかの手法に基づくフォーカス位置探索処理を実行して迅速なフォーカス制御を行なうものである。さらに、顔の大きさに基づく被写体の距離の推定に際して、顔の大きさの個人差、人種差、年齢差、性別差などを考慮した被写体の距離推定を行い、正確な距離推定を実現する。   In the imaging apparatus of the present invention, the face detection unit 130 detects a human face in the image data, and determines the size of the human face as the target subject based on the face information detected by the control unit 110. The distance of the subject is estimated based on the size, and the operation range of the focus position search process based on the above-described hill-climbing AF method and the end-point search AF method is set to be narrow, and the hill-climbing AF method is set within the setting region. A focus position search process based on any of the end point search AF methods is executed to perform quick focus control. Further, when estimating the distance of the subject based on the size of the face, the distance of the subject is estimated in consideration of individual differences, race differences, age differences, gender differences, etc. of the face size, thereby realizing accurate distance estimation.

図3に、(a)従来のフォーカス制御におけるフォーカスレンズ動作範囲と、(b)本発明に従った顔検出に基づく推定距離情報を適用したフォーカス制御におけるフォーカスレンズ動作範囲を示す。一般的なオートフォーカス制御を行う場合、図3(a)に示すように、フォーカスレンズ201の動作範囲を至近側リミットから無限側リミットの全範囲に設定し、この範囲でフォーカスレンズ201を移動させて、レンズを介して取得された撮像データの特定領域のコントラストの高低を判定する。すなわち、コントラストの高低判定のために特定領域の高周波成分積分値を算出して、これを評価値(AF評価値)とし、AF評価値が最大となる位置をフォーカス位置とする。このような処理を行なうと、フォーカスレンズ201の動作範囲が大きく、フォーカス制御の実行時間が長くなるという問題がある。   FIG. 3 shows (a) a focus lens operating range in conventional focus control, and (b) a focus lens operating range in focus control to which estimated distance information based on face detection according to the present invention is applied. When performing general autofocus control, as shown in FIG. 3A, the operating range of the focus lens 201 is set to the entire range from the near limit to the infinite limit, and the focus lens 201 is moved within this range. Then, the contrast level of the specific area of the imaging data acquired through the lens is determined. That is, a high-frequency component integrated value of a specific region is calculated for determining the contrast level, and this is used as the evaluation value (AF evaluation value), and the position where the AF evaluation value is maximized is set as the focus position. When such processing is performed, there is a problem that the operating range of the focus lens 201 is large and the execution time of focus control becomes long.

一方、図3(b)本発明に従った顔検出に基づく推定距離情報を適用したフォーカス制御においては、目的被写体としての人物の顔の大きさを判定し、その大きさに基づいて被写体の距離を推定し、この推定情報を適用してフォーカス制御範囲を狭めて迅速なフォーカス制御を実行する。すなわち、図3(b)に示すように、目的被写体としての人物の顔の大きさに基づいて被写体の距離を推定し、この距離(DF)を中心として、予め設定された誤差範囲を含む領域をフォーカスレンズ201の動作範囲(Rf)として設定し、この動作範囲(Rf)のみにおいて、フォーカスレンズ201を移動させて、コントラストの高低を判定してフォーカス位置を決定する。この処理においては、フォーカスレンズ201の動作範囲が狭められ、フォーカス位置の特定に要する時間を短縮することが可能となる。   On the other hand, in the focus control using the estimated distance information based on face detection according to the present invention in FIG. 3B, the size of the face of the person as the target subject is determined, and the subject distance is determined based on the size. , And applying this estimation information narrows the focus control range and executes quick focus control. That is, as shown in FIG. 3B, the distance of the subject is estimated based on the size of the face of the person as the target subject, and an area including a preset error range around this distance (DF). Is set as the operating range (Rf) of the focus lens 201, and the focus lens 201 is moved only in this operating range (Rf), and the focus position is determined by determining the level of contrast. In this process, the operating range of the focus lens 201 is narrowed, and the time required for specifying the focus position can be shortened.

具体的な処理シーケンスは、以下の通りである。なお、撮像素子のコントラスト信号差を求める領域、すなわちコントラストの高低判定のために設定する特定領域は、スルー画から検出される顔領域を含む領域とする。この領域から得られるコントラスト信号に基づいて、次のような動作を実施することでAFの高速化を実現する。
1.シャッターを押される前においては、コントラスト信号が最大となる位置にサーボをかける。この時のフォーカス制御におけるレンズ動作範囲は、Rfと限定する。
2.シャッターを押された時、コントラスト信号が最大値近傍を保っていたら、すなわちコントラストが、予め設定した閾値以上であり、かつ、コントラストの変動がフォーカスポジション変化によってほとんど変化しない領域にいる時は、そのままキャプチャーする。半押しならば、ロックする。
3.シャッターを押された時に、コントラスト信号が最大値付近にない場合、レンズ動作範囲Rfを「候補範囲サーチ法」によって、コントラストが最大になる位置を検出し、その位置にフォーカスポジションを移動させた後、キャプチャーする。半押しならば、ロックする。
4.顔の検出結果が変更するたびにレンズの動作範囲Rfを更新する。
A specific processing sequence is as follows. Note that the region for obtaining the contrast signal difference of the image sensor, that is, the specific region set for determining the contrast level is a region including the face region detected from the through image. Based on the contrast signal obtained from this region, the following operation is performed to achieve high speed AF.
1. Before pressing the shutter, the servo is applied to the position where the contrast signal becomes maximum. The lens operating range in focus control at this time is limited to Rf.
2. If the contrast signal is kept close to the maximum value when the shutter is pressed, that is, if the contrast is equal to or greater than a preset threshold value and the contrast fluctuation is in an area where it hardly changes due to a change in the focus position, it remains as it is. Capture. If half pressed, lock.
3. If the contrast signal is not near the maximum value when the shutter button is pressed, the lens operating range Rf is detected by the “candidate range search method” after the position where the contrast is maximized is detected and the focus position is moved to that position. , Capture. If half pressed, lock.
4). Each time the face detection result changes, the lens operating range Rf is updated.

以上の説明に対応する具体的なフォーカス制御処理シーケンスについて、図4に示すフローチャートを参照して説明する。まず、ステップS101において、撮像装置によって取得される被写体画像(スルー画)から目的被写体の顔領域を検出し、検出した目的被写体としての人物の顔の大きさを判定し、その大きさに基づいて被写体の距離を推定する。   A specific focus control processing sequence corresponding to the above description will be described with reference to the flowchart shown in FIG. First, in step S101, the face area of the target subject is detected from the subject image (through image) acquired by the imaging device, the size of the face of the person as the detected target subject is determined, and based on the size. Estimate the distance of the subject.

ステップS102において、図3(b)に示すように、目的被写体としての人物の顔の大きさに基づいて推定した距離(DF)を中心として、予め設定された誤差範囲を含む領域をフォーカスレンズの動作範囲、すなわちAF動作範囲として設定する。ステップS103では、動画用のオートフォーカス処理、すなわち、モニタに表示される画像を目的被写体としての人物の顔にピント合わせした画像として表示するためのオートフォーカス制御を実行する。ステップS104においてシャッター押下が検出されない限り、ステップS101〜S103の処理は継続して実行される。   In step S102, as shown in FIG. 3B, an area including a preset error range is centered on the distance (DF) estimated based on the size of the face of the person as the target subject. The operating range, that is, the AF operating range is set. In step S103, autofocus processing for moving images, that is, autofocus control for displaying an image displayed on the monitor as an image focused on the face of a person as a target subject is executed. Unless the shutter press is detected in step S104, the processing in steps S101 to S103 is continued.

ステップS104において、シャッター押下が検出されると、ステップS105に進み、コントラスト信号が最大値近傍を保っているか否か、すなわちコントラストが、予め設定した閾値以上であるかを判定する。   If it is detected in step S104 that the shutter has been pressed, the process proceeds to step S105, in which it is determined whether or not the contrast signal is in the vicinity of the maximum value, that is, whether the contrast is equal to or greater than a preset threshold value.

ステップS105において、コントラストが予め設定した閾値以上であると判定された場合は、正しいフォーカス制御がなされているものと判断して、ステップS107に進み、フォーカス制御を完了し、ステップS108において画像の撮影(キャプチャ)処理を行なう。一方、ステップS105において、コントラストが予め設定した閾値以上であると判定されなかった場合は、正しいフォーカス制御がなされていないと判断して、ステップS106に進み、静止画撮影のためのオートフォーカス制御を実行する。この場合のフォーカスレンズの移動範囲は、先に図3(b)を参照して説明した目的被写体としての人物の顔の大きさに基づく推定距離(Df)を中心として、予め設定された誤差範囲を含む動作範囲(Rf)である。この処理において、顔領域を含む特定領域のコントラストの高低に基づいてフォーカス位置を特定し、ステップS108に進み、フォーカス制御を完了し、ステップS108において画像の撮影(キャプチャ)処理を行なう。   If it is determined in step S105 that the contrast is equal to or greater than a preset threshold value, it is determined that correct focus control is being performed, the process proceeds to step S107, focus control is completed, and an image is captured in step S108. Perform (capture) processing. On the other hand, if it is not determined in step S105 that the contrast is equal to or greater than a preset threshold value, it is determined that correct focus control is not performed, and the process proceeds to step S106, where autofocus control for still image shooting is performed. Execute. The moving range of the focus lens in this case is a preset error range centered on the estimated distance (Df) based on the size of the face of the person as the target subject described above with reference to FIG. Is an operating range (Rf). In this process, the focus position is specified based on the contrast level of the specific area including the face area, the process proceeds to step S108, the focus control is completed, and an image capturing (capture) process is performed in step S108.

本発明の最大のポイントは、顔の大きさによって顔までの距離を求める場合において、距離の誤差情報を用いて、極力狭いAF範囲を決定する方法にある。これにより短時間でのAFが実現できる。   The greatest point of the present invention lies in a method of determining an AF range that is as narrow as possible using distance error information when the distance to the face is determined by the size of the face. Thereby, AF in a short time can be realized.

本発明の撮像装置によって撮影される画像データから目的被写体の人物の顔を特定し、その顔による距離推定を実行する。以下、この処理の具体的な処理構成について説明する。説明は、以下の項目順に行なう。
(1)顔の認識処理
(2)顔までの距離算出およびフォーカスレンズの動作範囲(Rf)設定手法
(3)複数の顔が存在する場合のオートフォーカス処理
A face of a person as a target subject is specified from image data photographed by the imaging apparatus of the present invention, and distance estimation using the face is executed. Hereinafter, a specific processing configuration of this processing will be described. The description will be made in the order of the following items.
(1) Face recognition processing (2) Distance to face calculation and focus lens operating range (Rf) setting method (3) Autofocus processing when there are multiple faces

(1)顔の認識処理
まず、撮像装置によって取得される画像データから人物の顔を特定する手法について説明する。顔の認識、追尾技術としては、既に様々な技術が開示されており、この既存技術を適用することが可能である。例えば特開2004−133637に示されるような、顔の輝度分布情報を記録したテンプレートの実画像へのマッチングによって実現できる。まず実画像に縮小処理をかけた画像を複数種類用意する。そこに顔を傾けた時に得られる顔の輝度分布情報テンプレート群を用意しておき、それらを順次マッチングさせていく。このテンプレートは、顔3次元直交座標系のXYZ軸の各々に対して傾いたものであり、このテンプレートとのマッチングにより実際の顔の傾きを判定するものである。
(1) Face Recognition Processing First, a method for identifying a person's face from image data acquired by the imaging apparatus will be described. Various techniques have already been disclosed as face recognition and tracking techniques, and these existing techniques can be applied. For example, as shown in Japanese Patent Application Laid-Open No. 2004-133637, it can be realized by matching a template that records facial luminance distribution information with an actual image. First, a plurality of types of images obtained by reducing the actual image are prepared. A face luminance distribution information template group obtained when the face is tilted is prepared, and these are sequentially matched. This template is inclined with respect to each of the XYZ axes of the face three-dimensional orthogonal coordinate system, and the actual inclination of the face is determined by matching with this template.

縮小された画像に対して2次元平面上をずらしながら順次マッチングさせた時に、ある領域がテンプレートにマッチすれば、その領域が顔の存在する位置ということになり、大きさは、実画像の縮小率から求めることができる。またそのときに用いたテンプレートから直交3軸周りの回転角、ヨー、ピッチ、ロール角を求めることができる。このようにして得られた、顔の大きさ、位置、回転角度を用いて、顔の距離の推定を実行してオートフォーカス制御を行うことで、先に図3(b)を参照して説明したフォーカスレンズの動作範囲(Rf)を小さく設定することが可能となる。   When the reduced image is sequentially matched while shifting on the two-dimensional plane, if a certain area matches the template, that area is the position where the face exists, and the size is reduced to the actual image. It can be calculated from the rate. Further, the rotation angle, yaw, pitch, and roll angle around three orthogonal axes can be obtained from the template used at that time. By using the face size, position, and rotation angle obtained in this way to estimate the face distance and perform autofocus control, the explanation will be given with reference to FIG. The operating range (Rf) of the focus lens can be set small.

(2)顔までの距離算出およびフォーカスレンズの動作範囲(Rf)設定手法
以下、具体的な顔までの距離の算出手法と、フォーカスレンズの動作範囲(Rf)の設定手法について説明する。本発明が提案する顔の大きさに基づく距離算出方法においては、求めた距離(図3(b)に示す(Df))に距離誤差情報を含ませてフォーカスレンズの動作範囲(Rf)を設定する構成としている。
(2) Method for calculating distance to face and setting method for focus lens operating range (Rf) Hereinafter, a specific method for calculating the distance to the face and a method for setting the focus lens operating range (Rf) will be described. In the distance calculation method based on the face size proposed by the present invention, the focus lens operating range (Rf) is set by including distance error information in the obtained distance ((Df) shown in FIG. 3B). It is configured to do.

本発明の撮像装置では、撮像装置によって撮影される画像に含まれる顔の大きさによって顔までの距離を求める。この処理について、図5を参照して説明する。図5には、被写***置301、フォーカスレンズ302、撮像素子303を示している。被写***置301には人物の顔が存在する。顔の大きさ(顔の幅)はWfである。   In the imaging apparatus according to the present invention, the distance to the face is obtained based on the size of the face included in the image photographed by the imaging apparatus. This process will be described with reference to FIG. FIG. 5 shows a subject position 301, a focus lens 302, and an image sensor 303. A human face exists at the subject position 301. The face size (face width) is Wf.

顔の実際の大きさ(Wf)が分ればレンズの基本的な物理法則から、顔までの距離、すなわち被写体距離(Df)、すなわち、フォーカスレンズ302から被写***置301までの被写体距離(Df)は以下の式で求めることができる。 Df=Wref
×(f/Wi)×(Ww/Wf)・・・(式1.1)
上記式における各記号の説明を以下に示す。
If the actual size (Wf) of the face is known, the distance to the face, that is, the subject distance (Df), that is, the subject distance (Df) from the focus lens 302 to the subject position 301, from the basic physical law of the lens. Can be calculated by the following equation. Df = Wref
X (f / Wi) x (Ww / Wf) (Formula 1.1)
The explanation of each symbol in the above formula is shown below.

人間の顔の大きさ基準値:Wref
撮像素子の幅:Wi
焦点距離:f
撮像画像における人の顔の大きさのピクセル数(撮像素子検出値):Wf
人の顔検出に使用した画像の大きさのピクセル数(撮像素子検出値):Ww
人間の顔の大きさ基準値(Wref)は、予め定めた固定値を利用することができる。なお、この顔大きさ基準値(Wref)を、個人差、人種差、年齢差、性別差などを考慮した値に設定した処理を行うことが可能であり、この処理によって、さらに正確な距離推定を実現することが可能となる。この処理構成については、後段で説明する。
Human face size reference value: Wref
Image sensor width: Wi
Focal length: f
Number of pixels of human face size in the captured image (imaging element detection value): Wf
Number of pixels of image size used for human face detection (imaging element detection value): Ww
A predetermined fixed value can be used as the human face size reference value (Wref). It is possible to perform processing in which this face size reference value (Wref) is set to a value that takes into account individual differences, race differences, age differences, gender differences, and the like, and this process enables more accurate distance estimation. Can be realized. This processing configuration will be described later.

撮像装置は、撮影される画像(スルー画)に基づいて、上述の式(式1.1)を適用して被写体距離(Df)を算出し、算出した被写体距離(Df)を中心として、あらかじめ設定した誤差範囲を含めてフォーカスレンズの動作範囲(Rf)を設定する。   The imaging apparatus calculates the subject distance (Df) based on the photographed image (through image) by applying the above-described formula (formula 1.1), and uses the calculated subject distance (Df) as a center in advance. The operating range (Rf) of the focus lens is set including the set error range.

仮に顔の大きさから求めた誤差がゼロというモデルを想定すると、この位置にフォーカスレンズを移動させた時にピントが外れる要因は、各種デバイスの個体差、製造における誤差に限定される。すなわちこれらの誤差を調整によって除去することができれば、原理的には、山登りAFや特定範囲サーチAFを用いずとも、顔の大きさだけで良好なピントの写真が得られることになる。   Assuming a model in which the error obtained from the size of the face is zero, the factors that cause the focus to be lost when the focus lens is moved to this position are limited to individual differences of various devices and manufacturing errors. That is, if these errors can be removed by adjustment, in principle, a good focus photograph can be obtained only by the size of the face without using the hill-climbing AF or the specific range search AF.

しかしながら、実際はそれらの誤差を完全に除去することはできない。具体的には、焦点距離方向に非線系なピント移動、デバイスの温度特性によるピント位置の移動、各種のデバイス間に存在するヒステリシスによるものである。それらの大きさを、ズームの位置、フォーカスの位置ごとにデータテーブルとして持ち、テーブル間のデータを線形補完する形で、誤差範囲を至近側にσn,無限側にσfとして設定すると、フォーカスレンズの動作範囲(Rf)は、顔までの距離を:Dfとしたときに、
Rf=Df−σn〜Df+σf・・・(式1.2)
として設定される。すなわち、図6に示すようにフォーカスレンズ302の動作範囲(Rf)が設定される。
However, in practice, these errors cannot be completely removed. Specifically, this is due to non-linear focus movement in the focal length direction, movement of the focus position due to the temperature characteristics of the device, and hysteresis existing between various devices. When the error range is set as σn on the near side and σf on the infinite side in the form of having a data table for each zoom position and focus position and linearly complementing the data between the tables, the size of the focus lens The operating range (Rf) is the distance to the face: Df
Rf = Df−σn to Df + σf (Formula 1.2)
Set as That is, the operating range (Rf) of the focus lens 302 is set as shown in FIG.

したがって、例えばコントラスト判定に基づくフォーカス制御の1つの手法である山登り方でコントラスト信号の最大値を探すべき範囲は動作範囲(Rf)として設定することができ、シャッターを押された時にサーチすべき範囲の最大値も上記範囲として設定可能となり、従来と比較して短い距離のレンズ移動範囲が設定されて短時間でのフォーカス制御が可能となる。   Accordingly, for example, the range in which the maximum value of the contrast signal should be searched for in the hill climbing method, which is one method of focus control based on contrast determination, can be set as the operation range (Rf), and the range to be searched when the shutter is pressed. The maximum value of can be set as the above range, and a lens movement range with a shorter distance than that in the prior art is set, and focus control can be performed in a short time.

しかし、このような顔の大きさに基づく距離推定処理には、以下のような問題がある。
問題点1.人種差、性別差、年齢差、体格差による顔の大きさばらつきがある。
問題点2.テンプレートマッチングの能力限界(実画像縮小率の分解能など)。
However, such a distance estimation process based on the face size has the following problems.
Problems 1. There are variations in face size due to race, gender, age, and physique.
Problem 2. Template matching capability limit (resolution of actual image reduction ratio, etc.).

[問題点1の解決方法]
1つ目の問題の解決策は、顔大きさ基準値:Wrefを、被写体に対応する人種、性別、年齢、体格に応じた適切な値に設定することであり、このために、様々な人種、性別、年齢、体格に対応する基準値Wrefを算出して利用する構成である。例えば、様々な人種、性別、年齢、体格に対応する基準値Wrefを算出するためのテーブルデータを保持し、画像解析結果またはユーザ入力情報に基づいて被写体に対応する人種、性別、年齢、体格情報を取得して、これらの取得情報に基づいてテーブルから、被写体に応じた顔大きさ基準値:Wrefを求める構成である。
[Solution for Problem 1]
The solution to the first problem is to set the face size reference value: Wref to an appropriate value according to the race, gender, age, and physique corresponding to the subject. The reference value Wref corresponding to the race, sex, age, and physique is calculated and used. For example, it holds table data for calculating reference values Wref corresponding to various races, genders, ages, and physiques, and the races, genders, ages, In this configuration, physique information is acquired, and a face size reference value: Wref corresponding to the subject is obtained from a table based on the acquired information.

撮像装置によって撮影される画像に含まれる顔画像の解析によって、その顔を持つ人物の人種、性別、年齢、体格を推定することが可能である。すなわち、顔のパーツを識別して、予め登録された人種、性別、年齢、体格に対応するパーツ情報とのマッチングを実行して、被写体の人種、性別、年齢、体格を推定する。あるいは、撮影者などのユーザが、被写体情報として人種、性別、年齢、体格に関する被写体情報を入力し、この入力情報を適用する構成としてもよい。   It is possible to estimate the race, gender, age, and physique of a person having the face by analyzing the face image included in the image photographed by the imaging device. That is, the face parts are identified, and matching with parts information corresponding to the race, sex, age, and physique registered in advance is performed to estimate the race, gender, age, and physique of the subject. Alternatively, a user such as a photographer may input subject information related to race, sex, age, and physique as subject information and apply the input information.

このように画像解析またはユーザ入力情報として被写体の人種、性別、年齢、体格情報を取得して、被写体に応じた適正な顔大きさ基準値:Wrefを求める。図7を参照して、この処理例について説明する。   In this way, the race, sex, age, and physique information of the subject are acquired as image analysis or user input information, and an appropriate face size reference value: Wref corresponding to the subject is obtained. This processing example will be described with reference to FIG.

図7に示すように、撮像装置は、顔の大きさ基準値(Wref)算出部310を有し、顔の大きさ基準値(Wref)算出部310は、人種別基準値算出テーブル311、性別基準値算出テーブル312、年齢別基準値算出テーブル313、体格別基準値算出テーブル314と、データ処理部320を有する。   As illustrated in FIG. 7, the imaging apparatus includes a face size reference value (Wref) calculation unit 310, and the face size reference value (Wref) calculation unit 310 includes a personal type reference value calculation table 311, a gender, and the like. It has a reference value calculation table 312, a reference value calculation table 313 classified by age, a reference value calculation table 314 classified by physique, and a data processing unit 320.

画像解析部331は、撮像装置によって撮影される画像に含まれる顔画像の解析によって、その顔を持つ人物の人種、性別、年齢、体格を推定する。すなわち、顔のパーツを識別して、予め登録された人種、性別、年齢、体格に対応するパーツ情報とのマッチングを実行して、被写体の人種、性別、年齢、体格を推定し、その推定情報を顔の大きさ基準値(Wref)算出部310に入力する。あるいは、ユーザ入力部332を介して撮影者などのユーザが、被写体情報としての人種、性別、年齢、体格に関する被写体情報を入力し、この入力情報を顔の大きさ基準値(Wref)算出部310に入力する。   The image analysis unit 331 estimates the race, sex, age, and physique of a person having the face by analyzing a face image included in the image captured by the imaging device. That is, by identifying facial parts and performing matching with parts information corresponding to pre-registered race, gender, age, and physique, estimating the race, gender, age, and physique of the subject, The estimation information is input to the face size reference value (Wref) calculation unit 310. Alternatively, a user such as a photographer inputs subject information regarding race, sex, age, and physique as subject information via the user input unit 332, and this input information is used as a face size reference value (Wref) calculation unit. Input to 310.

顔の大きさ基準値(Wref)算出部310は、画像解析部331または、ユーザ入力部332を介して入力した被写体情報に基づいて、被写体に応じた最適な基準値(Wref)を、各テーブルを適用して算出する。実際の出力は、ある程度のばらつきを考慮した基準値範囲Wref=(Wref+ΔWrefb)〜(Wref−ΔWrerfs)を算出する。想定される大きい方へのずれをΔWrefb、想定される小さい方へのずれをΔWrefsとして考慮した結果を出力する。   The face size reference value (Wref) calculation unit 310 calculates an optimal reference value (Wref) corresponding to the subject based on the subject information input via the image analysis unit 331 or the user input unit 332 in each table. Calculate by applying. For the actual output, a reference value range Wref = (Wref + ΔWrefb) to (Wref−ΔWreffs) is calculated in consideration of some variation. A result of considering an assumed deviation toward the larger side as ΔWrefb and an assumed deviation toward the smaller side as ΔWrefs is output.

テーブルのデータ構成例を図8〜図10を参照して説明する。図8(a)は、人種別基準値算出テーブル、図8(b)は、人種、性別基準値算出テーブル、図9(c)は、人種、性別、年齢別基準値算出テーブル、図10(d)は人種、性別、年齢、体格別基準値算出テーブルである。図7に示す構成例においては、人種、性別、年齢、体格の個別のテーブルを設定した例を説明したが、テーブル構成は、個別のテーブルとするばかりでなく、図8〜図10に示す態様のような各種の設定が可能である。   An example of the data structure of the table will be described with reference to FIGS. 8A is a race type reference value calculation table, FIG. 8B is a race and gender reference value calculation table, FIG. 9C is a race, gender and age reference value calculation table, and FIG. Reference numeral 10 (d) is a reference value calculation table by race, gender, age, and physique. In the configuration example shown in FIG. 7, an example in which individual tables of race, sex, age, and physique are set has been described. However, the table configuration is not only an individual table, but also shown in FIGS. 8 to 10. Various settings as in the embodiment are possible.

例えば、画像解析部331または、ユーザ入力部332を介して入力した被写体情報に基づいて、人種のみが推定/断定できる時には、図8(a)に示す人種別基準値算出テーブルを用いる。仮に人種の判断ができない場合。「共通」のデータが用いられることとなる。   For example, when only the race can be estimated / determined based on the subject information input via the image analysis unit 331 or the user input unit 332, the personal type reference value calculation table shown in FIG. 8A is used. If you cannot determine your race. "Common" data will be used.

画像解析部331または、ユーザ入力部332を介して入力した被写体情報に基づいて、人種と性別が推定/判断できる場合には、図8(b)に示す人種、性別基準値算出テーブルが用いられる。仮にアジア系人種であり、男性ということになれば、図8(b)に示すA列のデータが用いられることになる。一方で、例えば人種は判別できないが性別は女性と推定/断定できる場合、人種は共通、性別は女性という図8(b)に示すB列のデータを用いることとなる。   If the race and gender can be estimated / determined based on the subject information input via the image analysis unit 331 or the user input unit 332, the race / gender reference value calculation table shown in FIG. Used. If it is an Asian race and it is a male, the data of A column shown in FIG.8 (b) will be used. On the other hand, for example, when the race cannot be discriminated but the gender can be estimated / determined as female, the data in the B column shown in FIG. 8B is used, where the race is common and the gender is female.

同様にして、年代まで推定/断定できるならば、図9(c)に示す人種、性別、年齢別基準値算出テーブルが用いられることになり、仮にアジア系人種の男性であり、12歳以上ということが分れば、図9(c)に示すC列のデータを用いればよいし、何らかの理由で年代が推定できなかった場合は、図9(c)に示すD列のデータを用いればよい。同様にして、体格まで推定/断定できるならば、図10(d)に示す人種、性別、年齢、体格別基準値算出テーブルを用いて最適な基準値Wref=(Wref+ΔWrefb)〜(Wref−ΔWrerfs)を算出する。   Similarly, if it is possible to estimate / determine until the age, the reference value calculation table by race, gender, and age shown in FIG. 9C will be used. If the above is understood, the data in column C shown in FIG. 9 (c) may be used. If the age cannot be estimated for some reason, the data in column D shown in FIG. 9 (c) is used. That's fine. Similarly, if the physique can be estimated / determined, the optimum reference values Wref = (Wref + ΔWrefb) to (Wref−ΔWreffs) using the race, sex, age, and physique reference value calculation table shown in FIG. ) Is calculated.

このように、画像解析またはユーザ入力情報として被写体の人種、性別、年齢、体格情報を取得して、被写体に応じた適正な顔大きさ基準値:Wrefを求めることが可能であり、算出した基準値:Wrefを適用することで、より正確な被写体までの距離(Df)を算出することが可能となる。なお、基準値:Wrefの適用処理および被写体までの距離(Df)の算出処理に際しては、顔の横幅、顔の縦の長さのいずれかを適用する構成、さらに、両者を併用する処理構成が可能である。さらに、傾きを考慮した処理構成としてもよい。   In this way, it is possible to obtain and calculate the appropriate face size reference value: Wref according to the subject by acquiring the race, sex, age, and physique information of the subject as image analysis or user input information. By applying the reference value: Wref, it is possible to calculate a more accurate distance (Df) to the subject. In addition, in the process of applying the reference value: Wref and the process of calculating the distance to the subject (Df), there is a configuration in which either the width of the face or the length of the face is applied, and a processing configuration in which both are used together. Is possible. Furthermore, it is good also as a processing structure which considered inclination.

[問題点2の解決方法]
次に、前述の問題点2、すなわち、テンプレートマッチングの能力限界(実画像縮小率の分解能など)についての解決方法について説明する。前述したように、撮影画像から顔料粋を特定するためにテンプレートマッチングが実行される。すなわち、顔の様々な傾きに対応する顔の輝度分布情報テンプレート群を用意しておき、撮影画像に縮小処理をかけた縮小画像とのマッチングを行なう処理である。縮小された画像に対して2次元平面上をずらしながら順次マッチングさせた時に、ある領域がテンプレートにマッチすれば、その領域が顔の存在する位置ということになり、大きさは、実画像の縮小率から求めることができる。
[Solution for Problem 2]
Next, a solution for the above-described problem 2, that is, a capability limit of template matching (such as resolution of the actual image reduction ratio) will be described. As described above, template matching is performed in order to specify the pigment color from the captured image. In other words, this is a process of preparing face luminance distribution information template groups corresponding to various inclinations of the face and performing matching with a reduced image obtained by reducing the captured image. When the reduced image is sequentially matched while shifting on the two-dimensional plane, if a certain area matches the template, that area is the position where the face exists, and the size is reduced to the actual image. It can be calculated from the rate.

しかし、テンプレートマッチングの能力限界(実画像縮小率の分解能など)という問題が存在する。この問題に対する対策としては、これらの誤差を予め考慮した処理を行なうことが有効な対策である。検出誤差は、人種差や性別差、年齢差といったものとは独立に発生しうる問題である。顔のテンプレートに様々な顔のデータを記録させること、およびマッチングを確認する位置の数を増すことで精度を上げることが期待できるものの、どうしても限界がある。例えば、撮影された画像中の顔が暗い場合には誤差が大きくなり、また顔が傾くと誤差が大きくなる。検出誤差は、そもそもの性能の限界、検出に不利な明るさ、顔の傾き、これらの状況によって発生するものであり、このような状況に応じた誤差を考慮した処理を行なう。   However, there is a problem of the capability limit of template matching (resolution of actual image reduction rate, etc.). As a countermeasure against this problem, it is an effective countermeasure to perform processing in consideration of these errors in advance. The detection error is a problem that may occur independently of race differences, gender differences, age differences, and the like. Although it can be expected to increase the accuracy by recording various face data in the face template and increasing the number of positions where matching is confirmed, there is a limit. For example, the error increases when the face in the captured image is dark, and the error increases when the face is tilted. The detection error is caused by the limit of performance, brightness unfavorable for detection, face inclination, and these situations, and processing is performed in consideration of such an error.

具体的な処理例について説明する。撮影画像から検出された顔の大きさWfに対して、明るさ検出装置による明るさ情報などを用いて、テンプレートマッチングにおいて、最も小さく判定してしまう時の顔の大きさ:Ws、最も大きく判定してしまう時の顔の大きさ:Wbを求める。これらは、検出誤差の発生要因、すなわち、検出処理性能の限界、検出に不利な明るさ、顔の傾き、これらの状況によって発生する誤差要因を考慮して決定する。   A specific processing example will be described. The size of the face when it is determined to be the smallest in template matching using the brightness information by the brightness detection device, etc. with respect to the face size Wf detected from the captured image: Ws, the largest The size of the face at the time of the end: Wb is obtained. These are determined in consideration of factors that generate detection errors, that is, the limit of detection processing performance, brightness unfavorable for detection, face tilt, and error factors that occur due to these situations.

次に、先に、図7〜図10を参照して説明した人種、性別、年齢、体格の基準値算出テーブルを適用した処理によって、顔の大きさ基準値Wref=(Wref+ΔWrefb)〜(Wref−ΔWrerfs)を算出する。これは、想定される大きい方向へのずれをΔWrefb、小さい方向へのずれをΔWrefsとして被写体までの距離を一定の範囲に設定した例である。   Next, the face size reference values Wref = (Wref + ΔWrefb) to (Wrefb) are obtained by processing using the race, sex, age, and physique reference value calculation tables described above with reference to FIGS. -ΔWerrfs) is calculated. This is an example in which the distance to the subject is set within a certain range, where ΔWrefb is the deviation in the large direction and ΔWrefs is the deviation in the small direction.

このとき、顔の大きさ基準値(Wref)、撮像画像における人の顔の大きさのピクセル数(撮像素子検出値)(Wf)について、
Wref=Wref+ΔWrefb、
Wr=Ws
として設定して、先に説明した被写体距離(Df)算出式、すなわち、 Df=Wref×(f/Wi)×(Ww/Wf)・・・(式1.1)

上記式に上記、Wref=Wref+ΔWrefb、Wr=Wsを代入して得られる結果(Dff)が、最も遠方に誤差が広がるケースである。
At this time, for the face size reference value (Wref) and the number of pixels of the human face size (imaging element detection value) (Wf) in the captured image,
Wref = Wref + ΔWrefb,
Wr = Ws
The subject distance (Df) calculation formula described above, that is, Df = Wref × (f / Wi) × (Ww / Wf) (Formula 1.1)

The result (Dff) obtained by substituting Wref = Wref + ΔWrefb and Wr = Ws into the above equation is the case where the error spreads farthest away.

一方、Wref、Wfについて、
Wref=Wref−ΔWrefs、
Wr=Wb
として設定して、被写体距離(Df)算出式、すなわち、 Df=Wref×(f/Wi)×(Ww/Wf)・・・(式1.1)

上記式に、Wref=Wref−ΔWrefs、Wr=Wbを代入して得られる結果(Dfn)が、最も至近方向に誤差が広がるケースである。
On the other hand, about Wref and Wf,
Wref = Wref−ΔWrefs,
Wr = Wb
And the subject distance (Df) calculation formula, that is, Df = Wref × (f / Wi) × (Ww / Wf) (Formula 1.1)

The result (Dfn) obtained by substituting Wref = Wref−ΔWrefs and Wr = Wb into the above equation is the case where the error spreads in the closest direction.

すなわち、図11に示すように、被写体画像の顔の大きさから算出する被写体距離(Df)を一点とするのではなく、テンプレートマッチング等の画像解析における誤差と、人による誤差とを考慮した範囲として設定する。すなわち、図11に示すように、
Dfn〜Dffとして設定する。
That is, as shown in FIG. 11, the subject distance (Df) calculated from the size of the face of the subject image is not a single point, but a range that takes into account errors in image analysis such as template matching and human errors. Set as. That is, as shown in FIG.
Set as Dfn to Dff.

この被写体距離(Dfn〜Dff)に対して、さらに、あらかじめ算出される誤差範囲を含めてフォーカスレンズの動作範囲(Rf)を設定する。先に説明したように、焦点距離方向に非線系なピント移動、デバイスの温度特性によるピント位置の移動、各種のデバイス間に存在するヒステリシスなどを考慮した誤差範囲を至近側にσn,無限側にσfとして設定すると、フォーカスレンズの動作範囲(Rf)は、
Rf=(Dfn−σn)〜(Dff+σf)・・・(式1.3)
上記式(式1.3)によって算出される。
For this subject distance (Dfn to Dff), an operating range (Rf) of the focus lens is set including an error range calculated in advance. As explained earlier, the error range considering the nonlinear focus movement in the focal length direction, the movement of the focus position due to the temperature characteristics of the device, and the hysteresis existing between various devices is σn on the near side, infinity side Is set as σf, the operating range (Rf) of the focus lens is
Rf = (Dfn−σn) to (Dff + σf) (formula 1.3)
It is calculated by the above formula (Formula 1.3).

本発明の構成では、このように、被写体画像の顔の大きさから算出する被写体距離(Df)を一点とするのではなく、テンプレートマッチング等の画像解析における誤差と、人による誤差とを考慮した特定の「範囲:Dfn〜Dff」で捉え、誤差を考慮した設定となっている。これが、本発明の重要な特徴の一つである。   In the configuration of the present invention, the subject distance (Df) calculated from the face size of the subject image is not set as one point in this way, but an error in image analysis such as template matching and a human error are considered. It is set in consideration of a specific “range: Dfn to Dff” and taking into account errors. This is one of the important features of the present invention.

(3)複数の顔が存在する場合のオートフォーカス処理
次に、画像中に複数の顔が存在する場合のオートフォーカス処理の詳細について説明する。画像中に顔が複数存在する時は,全ての顔について以上と同様の処理を実行して、それらの各顔に対応するフォーカスレンズの動作範囲(Rf)を求める。
(3) Autofocus processing when there are a plurality of faces Next, details of the autofocus processing when there are a plurality of faces in the image will be described. When there are a plurality of faces in the image, the same processing as described above is executed for all the faces, and the operating range (Rf) of the focus lens corresponding to each face is obtained.

ここで重要になるのが顔の選択方法であるが、1つの指標は顔の大きさ、すなわちカメラに対する近さである。もう1つの指標は、中央への近さである。これらを適応的に変化させる必要がある。   What is important here is the face selection method, but one index is the size of the face, that is, the proximity to the camera. Another indicator is the proximity to the center. These need to be changed adaptively.

そこで、顔の大きさが、予め定めた閾値(Flim)よりも大きい場合、それを最優先し、かつ閾値(Flim)を超えた顔が複数存在する場合には大きい順に優先順位をつける。同じ大きさの顔が存在する場合には、中央に近い順に優先度を高くする。すべての顔の大きさが閾値(Flim)以下のときは、中央に近いほど優先順位を上げることとし、中心から同じ距離にあるときは顔の大きさが大きい順にする。これにより、最も優先順位の高い1つの顔を選択する。この処理について、図12、図13に示すフローチャートを参照して説明する。   Therefore, when the face size is larger than a predetermined threshold value (Flim), the highest priority is given, and when there are a plurality of faces exceeding the threshold value (Flim), priorities are given in descending order. If faces of the same size exist, the priority is increased in the order from the closest to the center. When the size of all the faces is equal to or smaller than the threshold (Flim), the priority is increased as it is closer to the center, and when the distance is the same distance from the center, the order of the size of the face is increased. Thereby, one face with the highest priority is selected. This process will be described with reference to the flowcharts shown in FIGS.

図12、図13に示す処理は、図2に示す撮像装置の制御部110の制御の下に実行される。まず、ステップS201において、被写体指定情報(人種,年齢,性別,体格情報)が存在するか否かを判定する。被写体指定情報は、ユーザ入力部としての操作部から入力される。   The processing illustrated in FIGS. 12 and 13 is executed under the control of the control unit 110 of the imaging apparatus illustrated in FIG. First, in step S201, it is determined whether or not subject designation information (race, age, sex, physique information) exists. The subject designation information is input from an operation unit as a user input unit.

被写体指定情報(人種,年齢,性別,体格情報)が存在しない場合は、ステップS204に進む。被写体指定情報(人種,年齢,性別,体格情報)が存在する場合、ステップS202に進み、被写体指定情報に合致する顔のみを選択し、ステップS203に進み、選択された顔について被写体優先順位設定処理を実行する。被写体優先順位設定処理の詳細については、図13のフローを参照して後段で説明する。   If there is no subject designation information (race, age, sex, physique information), the process proceeds to step S204. If the subject designation information (race, age, gender, physique information) exists, the process proceeds to step S202, and only the face that matches the subject designation information is selected, and the process proceeds to step S203, where the subject priority is set for the selected face. Execute the process. Details of the subject priority setting process will be described later with reference to the flowchart of FIG.

ステップS203において、被写体指定情報に合致する顔の優先順位設定処理が完了すると、ステップS204に進み、優先順位の設定されていない顔のみを選択し、ステップS205に進み、選択された顔について被写体優先順位設定処理を実行する。被写体優先順位設定処理の詳細については、図13のフローを参照して後段で説明する。   In step S203, when the priority order setting process for the face that matches the subject designation information is completed, the process proceeds to step S204, where only the face for which priority order is not set is selected, and the process proceeds to step S205, where subject priority is selected for the selected face. Execute the rank setting process. Details of the subject priority setting process will be described later with reference to the flowchart of FIG.

最後に、ステップS206に進み、ステップS203において決定された被写体指定情報に対応する顔の優先順位と、ステップS205において決定された優先順位とを統合して総合的な優先順位の設定処理を実行する。被写体指定情報に対応する顔の優先順位を被写体指定情報に対応しない顔の優先順位より高くする優先順位設定処理が実行される。   Finally, the process proceeds to step S206, where the priority order of the face corresponding to the subject designation information determined in step S203 and the priority order determined in step S205 are integrated to execute a comprehensive priority setting process. . A priority setting process is performed for setting the priority of the face corresponding to the subject designation information higher than the priority of the face not corresponding to the subject designation information.

次に、ステップS203、およびS205において実行される優先順位設定処理の詳細処理について、図13に示すフローチャートを参照して説明する。まず、ステップS301において、処理対象とする撮影画像(スルー画)中に顔が複数あるか否かを判定する。複数無い場合は、優先順位の設定は不要であるので、処理を終了する。   Next, detailed processing of the priority order setting processing executed in steps S203 and S205 will be described with reference to the flowchart shown in FIG. First, in step S301, it is determined whether there are a plurality of faces in the captured image (through image) to be processed. If there are no more than one, the priority setting is unnecessary and the process is terminated.

処理対象とする撮影画像(スルー画)中に顔が複数ある場合は、ステップsx302に進み、複数ある顔から1つの処理対象としての顔を選択する。次に、ステップS303において、選択した顔の大きさが予め設定された閾値(Flim)より大きいか否かを判定する。大きい場合、ステップS304に進み、その顔を優先順位の高いグループ(A)に分類する。小さい場合、ステップS305に進み、その顔を優先順位の低いグループ(B)に分類する。   If there are a plurality of faces in the captured image (through image) to be processed, the process proceeds to step sx302, and a face as one processing target is selected from the plurality of faces. Next, in step S303, it is determined whether or not the size of the selected face is larger than a preset threshold value (Flim). If larger, the process proceeds to step S304, and the face is classified into a group (A) having a higher priority. If it is smaller, the process proceeds to step S305, and the face is classified into a group (B) having a low priority.

次に、ステップS306において、すべての顔のグルーピングが終了したか否かを判定し、未処理の顔がある場合は、ステップS302に戻り、同様の処理を繰り返す。ステップS306において、すべての顔のグルーピングが終了したと判定すると、ステップS307に進み、優先順位の高いグループ(A)の顔を大きい順に優先順位設定する。同じ大きさなら中央に近い順に優先順位を設定する。次に、ステップS308に進み、優先順位の低いグループ(B)の顔を中央に近い順に優先順位設定する。等距離にある場合は、大きい順に優先順位を設定する。このような処理によって、画像に含まれる顔の優先順位を設定する。   Next, in step S306, it is determined whether or not all face groups have been grouped. If there is an unprocessed face, the process returns to step S302, and the same process is repeated. If it is determined in step S306 that all face groups have been grouped, the process advances to step S307 to set the priority order of the faces of the group (A) having a higher priority in descending order. If they are the same size, priorities are set in the order from the center. Next, proceeding to step S308, the priority order of the faces of the group (B) having a low priority order is set in the order from the center. If they are equidistant, priorities are set in descending order. By such processing, the priority order of the faces included in the image is set.

なお、優先順位の設定手法は、この手法に限らず、様々な手法が適用可能である。例えば、図14に示すフローに従った処理として実行してもよい。図14に示すフローは、人種、年齢、性別の各々について、指定情報に合致する顔のみを選択して、選択された顔に対して個別に優先順位を設定して、これらの個別の優先順位情報に基づいて最後に総合的な優先順位を設定する方法である。   Note that the priority setting method is not limited to this method, and various methods can be applied. For example, you may perform as a process according to the flow shown in FIG. The flow shown in FIG. 14 selects only faces that match the specified information for each race, age, and gender, and sets priorities for the selected faces individually, and sets these individual priorities. This is a method of finally setting a comprehensive priority based on the rank information.

図14に示すフローについて説明する。まず、ステップS401において、被写体指定情報としての人種指定情報が存在するか否かを判定する。人種指定情報が存在しない場合は、ステップS404に進む。人種指定情報が存在する場合、ステップS402に進み、指定情報に合致する顔のみを選択し、ステップS403において選択された顔について被写体優先順位設定処理を実行する。被写体優先順位設定処理は、先に図13のフローを参照して説明した処理となる。   The flow shown in FIG. 14 will be described. First, in step S401, it is determined whether or not race designation information as subject designation information exists. If no race designation information exists, the process proceeds to step S404. If race designation information exists, the process proceeds to step S402, where only faces that match the designation information are selected, and subject priority setting processing is executed for the face selected in step S403. The subject priority order setting process is the process described above with reference to the flow of FIG.

さらに、ステップS404において、被写体指定情報としての年齢指定情報が存在するか否かを判定する。年齢指定情報が存在しない場合は、ステップS407に進む。年齢指定情報が存在する場合、ステップS405に進み、指定情報に合致する顔のみを選択し、ステップS406において選択された顔について被写体優先順位設定処理を実行する。被写体優先順位設定処理は、先に図13のフローを参照して説明した処理となる。   In step S404, it is determined whether or not age designation information as subject designation information exists. If there is no age designation information, the process proceeds to step S407. If age designation information exists, the process proceeds to step S405, where only faces that match the designation information are selected, and subject priority setting processing is executed for the face selected in step S406. The subject priority order setting process is the process described above with reference to the flow of FIG.

さらに、ステップS407において、被写体指定情報としての性別指定情報が存在するか否かを判定する。性別指定情報が存在しない場合は、ステップS410に進む。性別指定情報が存在する場合、ステップS408に進み、指定情報に合致する顔のみを選択し、ステップS409において選択された顔について被写体優先順位設定処理を実行する。被写体優先順位設定処理は、先に図13のフローを参照して説明した処理となる。次に、ステップS410において、優先順位の設定されていない顔のみを選択し、ステップS411に進み、選択された顔について被写体優先順位設定処理を実行する。この処理も図13に示すフローに従った処理となる。   Furthermore, in step S407, it is determined whether or not there is gender designation information as subject designation information. If no gender designation information exists, the process proceeds to step S410. If gender designation information exists, the process proceeds to step S408, where only faces that match the designation information are selected, and subject priority setting processing is executed for the face selected in step S409. The subject priority order setting process is the process described above with reference to the flow of FIG. Next, in step S410, only faces for which priority order is not set are selected, and the process proceeds to step S411, where subject priority order setting processing is executed for the selected face. This processing is also processing according to the flow shown in FIG.

最後に、ステップS412に進み、ステップS403,S406,S409,S411において決定された優先順位を統合して総合的な優先順位の設定処理を実行する。この統合的な優先順位設定ルールは、ユーザ設定によって様々なルールが適用可能である。   Finally, the process proceeds to step S412, and the priority order determined in steps S403, S406, S409, and S411 is integrated to execute a comprehensive priority setting process. As this integrated priority setting rule, various rules can be applied depending on user settings.

このような優先順位設定処理によって、優先順位が最も高くなった顔を顔1とし、異化、顔2,3,4,として優先順位が設定された場合のオートフォーカス処理について、図15、図16を参照して説明する。このように複数の顔を含む画像を撮影する場合のオートフォーカス制御においては、何を重要とするかによって制御手法が異なってくる。すなわち、
(a)高速化を重視する場合、
(b)多くの顔に対する合焦判定を行なうことを重視する場合、
(c)高速かつ、できるだけ多くの顔に合焦させることを重視する場合、
これらのどの方向とするかは、ユーザが選択できると合理的であり、具体的な実現方法は以下のとおりである。
15A, 15B, 16A, and 16B, the autofocus process when the priority is set as the face 1 and the priority is set as the different face 2, 3, 4, by the priority setting process as described above. Will be described with reference to FIG. Thus, in autofocus control in the case of shooting an image including a plurality of faces, the control method differs depending on what is important. That is,
(A) When high speed is important,
(B) When it is important to perform in-focus determination for many faces,
(C) When it is important to focus on as many faces as possible at high speed,
It is reasonable that the user can select any of these directions, and a specific implementation method is as follows.

(a)高速化を重視する場合
高速化を重視する場合、最も優先度の高い[顔1]に対応してオートフォーカスにおけるレンズ動作範囲(Rf)を設定する。すなわち、最も優先度の高い[顔1]の被写体距離(Dfn〜Dff)を算出し、フォーカスレンズの動作範囲(Rf)を設定する。すなわち、先に説明したように、フォーカスレンズの動作範囲(Rf)は、最も優先度の高い[顔1]の被写体距離(Dfn〜Dff)を適用して、
Rf=(Dfn−σn)〜(Dff+σf)
として設定し、この範囲のみをAFし、結果的に他の顔2,3・・・が、予め設定された許容焦点深度内にあると判定されれば、その顔に合焦表示を行なう。合焦表示とは、モニタやビューファインダに表示される画像中に提示する合焦が完了したことを示す識別情報であり、例えば、顔1を囲む枠を合焦枠として表示する。ユーザはこの合焦表示を確認してシャッターを押して撮影することで確実な撮影が可能となる。
(A) When high speed is important When high speed is important, the lens operating range (Rf) in autofocus is set corresponding to [Face 1] having the highest priority. That is, the subject distance (Dfn to Dff) of [Face 1] having the highest priority is calculated, and the operating range (Rf) of the focus lens is set. That is, as described above, the operating range (Rf) of the focus lens is obtained by applying the subject distance (Dfn to Dff) of [Face 1] having the highest priority,
Rf = (Dfn−σn) to (Dff + σf)
As a result, only this range is AFed. As a result, when it is determined that the other faces 2, 3... Are within the preset allowable depth of focus, the face is displayed in focus. The in-focus display is identification information indicating that the in-focus presented in the image displayed on the monitor or the viewfinder is completed. For example, a frame surrounding the face 1 is displayed as the in-focus frame. The user confirms the in-focus display and presses the shutter to shoot, so that reliable shooting is possible.

合焦表示の例を図15に示す。図15に示す例は、撮像装置のカメラのモニタに表示される画像に合焦表示を行なった例である。上記のオートフォーカス処理によって、最も優先度の高い[顔1]に対応してレンズ動作範囲(Rf)を設定してフォーカスレンズを駆動してフォーカスポイントを決定する。この場合、当然、顔1,421には、合焦枠431が設定されて表示される。さらに、このフォーカスポイントにおいて、顔2,422、顔3,423についても、予め設定された許容焦点深度内にあると判定されれば、その顔に合焦枠432,433の表示を行なう。ユーザはこの合焦表示を確認してシャッターを押して撮影することで確実な撮影が可能となる。   An example of in-focus display is shown in FIG. The example shown in FIG. 15 is an example in which focused display is performed on an image displayed on the monitor of the camera of the imaging apparatus. With the above autofocus process, the lens operating range (Rf) is set corresponding to [Face 1] having the highest priority, and the focus lens is driven to determine the focus point. In this case, of course, the focusing frame 431 is set and displayed on the faces 1 and 421. Furthermore, if it is determined that the face 2, 422 and the face 3, 423 are within a preset allowable depth of focus at this focus point, the focus frames 432, 433 are displayed on the face. The user confirms the in-focus display and presses the shutter to shoot, so that reliable shooting is possible.

(b)多くの顔に対する合焦判定を行なうことを重視する場合、
多くの顔に対する合焦判定を行なうことを重視する場合には、合焦させるべき被写体を逃さないために、各顔のAF範囲の和集合をAFの範囲としてのレンズ動作範囲(Rf)として設定し、このレンズ動作範囲(Rf)において、コントラスト判定に基づく合焦位置のサーチを実行して、主要被写体の深度内にある顔に合焦表示を行なう。
(B) When it is important to perform in-focus determination for many faces,
When it is important to perform in-focus determination for many faces, the union of the AF ranges of each face is set as the lens operation range (Rf) as the AF range so as not to miss the subject to be focused. Then, in this lens operating range (Rf), the focus position search based on the contrast determination is executed, and the face within the depth of the main subject is displayed in focus.

図16を参照してこのオートフォーカス制御処理について説明する。図16には、顔1,2,3のそれぞれについての被写体距離(Dfn〜Dff)を適用して算出されるフォーカスレンズ450の動作範囲(Rf)を示している。すなわち、
Rf=(Dfn−σn)〜(Dff+σf)
について、顔1,2,3のそれぞれについて個別に動作範囲(Rf)が設定される。
The autofocus control process will be described with reference to FIG. FIG. 16 shows the operating range (Rf) of the focus lens 450 calculated by applying the subject distance (Dfn to Dff) for each of the faces 1, 2, and 3. That is,
Rf = (Dfn−σn) to (Dff + σf)
For each of the faces 1, 2 and 3, an operating range (Rf) is set individually.

これらの多くの顔1,2,3に対する合焦判定を行なうことを重視する場合には、合焦させるべき被写体を逃さないために、顔1,2,3のそれぞれにおいて求められた動作範囲(Rf)をすべて含む範囲(和集合)、すなわち図に示すP1〜Q1間をAFの範囲としてのレンズ動作範囲(Rf)として設定し、このP1Q1間のレンズ動作範囲(Rf)において、コントラスト判定に基づく合焦位置のサーチを実行して、主要被写体の深度内にある顔に合焦表示を行なう。   When it is important to perform the focus determination on these many faces 1, 2, 3, in order not to miss the subject to be focused, the motion ranges ( A range including all Rf) (union set), that is, a range between P1 and Q1 shown in the figure is set as a lens operating range (Rf) as an AF range, and contrast determination is performed in the lens operating range (Rf) between P1Q1. Based on the in-focus position search, the in-focus display is performed on the face within the depth of the main subject.

(c)高速かつ、できるだけ多くの顔に合焦させることを重視する場合、
高速かつ、できるだけ多くの顔に合焦させることを重視する場合、各優先順位の設定された被写体顔1,2,3,・・・について、それぞれ、被写体距離(Dfn〜Dff)を適用して、AF動作範囲(レンズ動作範囲(Rf))
Rf=(Dfn−σn)〜(Dff+σf)
を算出する。
(C) When it is important to focus on as many faces as possible at high speed,
When it is important to focus on as many faces as possible at high speed, subject distances (Dfn to Dff) are applied to the subject faces 1, 2, 3,. AF operating range (Lens operating range (Rf))
Rf = (Dfn−σn) to (Dff + σf)
Is calculated.

次に、被写体顔2,3,・・・について設定されたAF動作範囲(レンズ動作範囲(Rf))が、最も重要な被写体である[顔1]の被写体距離(Dfn〜Dff)に重複する領域を持つか否かを判定する。[顔1]の被写体距離(Dfn〜Dff)に重複するAF動作範囲(レンズ動作範囲(Rf))を持つ顔2,3・・については、AF動作範囲(レンズ動作範囲(Rf))の拡張領域として、その和となる範囲をAF動作範囲(レンズ動作範囲(Rf))とする。一方、[顔1]の被写体距離(Dfn〜Dff)に重複するAF動作範囲(レンズ動作範囲(Rf))を持たない顔4,5・・があった時は、それらに対してAF範囲は拡大しない。さらに、各顔が顔1の被写界深度内にあるか否かを判定し、被写界深度内にあることが確認された場合は、これらの顔についても合焦枠を表示する。これにより(a)の方法では取り逃してしまう可能性がある顔に対しても合焦確認がなされるフォーカス制御処理が可能となる。   Next, the AF operation range (lens operation range (Rf)) set for the subject faces 2, 3,... Overlaps with the subject distance (Dfn to Dff) of [face 1], which is the most important subject. It is determined whether or not it has an area. For faces 2, 3,... Having an AF operation range (lens operation range (Rf)) overlapping the subject distance (Dfn to Dff) of [Face 1], the AF operation range (lens operation range (Rf)) is expanded. As a region, a range corresponding to the sum is defined as an AF operation range (lens operation range (Rf)). On the other hand, when there are faces 4, 5,... That do not have an AF operation range (lens operation range (Rf)) that overlaps the subject distance (Dfn to Dff) of [Face 1], the AF range corresponds to them. Do not enlarge. Furthermore, it is determined whether or not each face is within the depth of field of the face 1, and when it is confirmed that the face is within the depth of field, a focusing frame is also displayed for these faces. Accordingly, it is possible to perform a focus control process in which in-focus confirmation is performed even on a face that may be missed by the method (a).

図17を参照してこのオートフォーカス制御処理について説明する。図17には、顔1,2,3のそれぞれについての被写体距離(Dfn〜Dff)を適用して算出されるフォーカスレンズ450の動作範囲(Rf)を示している。すなわち、
Rf=(Dfn−σn)〜(Dff+σf)
について、顔1,2,3のそれぞれについて個別に動作範囲(Rf)が設定される。
The autofocus control process will be described with reference to FIG. FIG. 17 shows an operating range (Rf) of the focus lens 450 calculated by applying subject distances (Dfn to Dff) for each of the faces 1, 2, and 3. That is,
Rf = (Dfn−σn) to (Dff + σf)
For each of the faces 1, 2 and 3, an operating range (Rf) is set individually.

高速かつ、できるだけ多くの顔に合焦させることを重視する場合、各優先順位の設定された被写体顔1,2,3について、それぞれ、被写体距離(Dfn〜Dff)を適用して、AF動作範囲(レンズ動作範囲(Rf))
Rf=(Dfn−σn)〜(Dff+σf)
を算出する。
When it is important to focus on as many faces as possible at high speed, subject distances (Dfn to Dff) are applied to subject faces 1, 2, and 3 for which priority levels are set, respectively, and an AF operation range is applied. (Lens operating range (Rf))
Rf = (Dfn−σn) to (Dff + σf)
Is calculated.

次に、被写体顔2,3について設定されたAF動作範囲(レンズ動作範囲(Rf))が、最も重要な被写体である[顔1]の被写体距離(Dfn〜Dff)に重複する領域を持つか否かを判定する。[顔2]に対応するAF動作範囲(レンズ動作範囲(Rf))は、[顔1]の被写体距離(Dfn〜Dff)に重複するAF動作範囲(レンズ動作範囲(Rf))を持つ。従って、[顔2]については、AF動作範囲(レンズ動作範囲(Rf))の拡張領域として、その和となる範囲をAF動作範囲(レンズ動作範囲(Rf))とする。   Next, whether the AF operation range (lens operation range (Rf)) set for the subject faces 2 and 3 has a region that overlaps the subject distance (Dfn to Dff) of [face 1], which is the most important subject. Determine whether or not. The AF operation range (lens operation range (Rf)) corresponding to [Face 2] has an AF operation range (lens operation range (Rf)) overlapping the subject distance (Dfn to Dff) of [Face 1]. Therefore, for [Face 2], the sum of the AF operation range (lens operation range (Rf)) is set as the AF operation range (lens operation range (Rf)).

一方、[顔3]に対応するAF動作範囲(レンズ動作範囲(Rf))は、[顔1]の被写体距離(Dfn〜Dff)に重複するAF動作範囲(レンズ動作範囲(Rf))を持たない。従って、[顔3]については、AF動作範囲(レンズ動作範囲(Rf))の拡張領域としない。図17の構成の場合、[顔1]と[顔2]のAF動作範囲(レンズ動作範囲(Rf))の和集合として設定される図に示すP2〜Q2間をAFの範囲としてのレンズ動作範囲(Rf)として設定し、このP2Q2間のレンズ動作範囲(Rf)において、コントラスト判定に基づく合焦位置のサーチを実行して、主要被写体の深度内にある顔に合焦表示を行なう。すなわち各顔が顔1の被写界深度内にあるか否かを判定し、被写界深度内にあることが確認された場合は、これらの顔についても合焦枠を表示する。   On the other hand, the AF operation range (lens operation range (Rf)) corresponding to [Face 3] has an AF operation range (lens operation range (Rf)) overlapping the subject distance (Dfn to Dff) of [Face 1]. Absent. Therefore, [Face 3] is not set as an extension region of the AF operation range (lens operation range (Rf)). In the case of the configuration of FIG. 17, the lens operation with AF between P2 and Q2 shown in the figure set as the union of the AF operation range (lens operation range (Rf)) of [Face 1] and [Face 2]. A range (Rf) is set, and in this lens operating range (Rf) between P2Q2, a focus position search based on contrast determination is executed, and a face within the depth of the main subject is displayed in focus. That is, it is determined whether or not each face is within the depth of field of the face 1, and when it is confirmed that the face is within the depth of field, a focusing frame is also displayed for these faces.

上述したようなオートフォーカス制御処理を実行することで、最も重要な顔に対して被写界深度内にいる顔には合焦マークを出せることになり、よりユーザにとって使い勝手のよい写真が得られることになる。これは、例えば仲間同士の集合写真や、母親と赤ん坊の写真など、ピントを合わせたい被写体が複数あるシーンで特に有効である。なお、AFの速度よりも、より多くの顔に合焦させようとする場合、焦点深度換算で1深度分をAF動作範囲に上乗せし、その範囲内にある顔については全て合焦枠を出すという方法を実行してもよい。   By executing the autofocus control process as described above, a focus mark can be put on the face within the depth of field with respect to the most important face, and a user-friendly photograph can be obtained. It will be. This is particularly effective in a scene where there are a plurality of subjects to be focused, such as group photos of friends or a photograph of a mother and a baby. When focusing on more faces than the AF speed, one depth is added to the AF operation range in terms of the focal depth, and the focus frame is displayed for all faces within the range. The method may be executed.

最後に、図18を参照して本発明の撮像装置において実行される処理を行なうための機能構成について説明する。上述した処理は、先に図2を参照して説明したハードウェア構成を適用して、主に制御部110の制御の下に実行されるプログラムに従って実行される。図18は、この処理を実行する際に適用する機能を中心として説明するためのブロック図である。   Finally, a functional configuration for performing processing executed in the imaging apparatus of the present invention will be described with reference to FIG. The above-described processing is executed according to a program executed mainly under the control of the control unit 110 by applying the hardware configuration described above with reference to FIG. FIG. 18 is a block diagram for explaining mainly the functions applied when executing this processing.

撮像装置において取得された画像情報500は、図2を参照して説明した撮像素子、デジタル信号処理部等を介して顔検出部502に入力される。顔検出部502では、前述したように、例えば顔の輝度分布情報を記録したテンプレートの実画像へのマッチング処理によって、画像情報500から顔領域を特定して検出する。   Image information 500 acquired by the imaging apparatus is input to the face detection unit 502 via the imaging device, the digital signal processing unit, and the like described with reference to FIG. As described above, the face detection unit 502 identifies and detects a face area from the image information 500 by, for example, matching processing of a template in which the luminance distribution information of the face is recorded to an actual image.

顔検出部502の検出した顔検出情報を含む画像情報は、画像解析部503、被写体距離算出部520の顔の大きさ基準値[Wref]算出部504、顔の推定距離[Df]算出部505、さらに、優先順位解析部508に出力される。画像解析部503は、先に、図7を参照して説明した画像解析処理を実行する。すなわち、画像解析部503は、撮像装置によって撮影される画像に含まれる顔画像の解析によって、その顔を持つ人物の人種、性別、年齢、体格を推定する。すなわち、顔のパーツを識別して、予め登録された人種、性別、年齢、体格に対応するパーツ情報とのマッチングを実行して、被写体の人種、性別、年齢、体格を推定し、その推定情報を顔の大きさ基準値[Wref]算出部504に入力する。なお、これらの被写体情報は、ユーザ入力部501を介してユーザが入力する構成としてもよい。   The image information including the face detection information detected by the face detection unit 502 includes an image analysis unit 503, a face size reference value [Wref] calculation unit 504 of the subject distance calculation unit 520, and an estimated face distance [Df] calculation unit 505. Further, it is output to the priority order analysis unit 508. The image analysis unit 503 executes the image analysis process described above with reference to FIG. That is, the image analysis unit 503 estimates the race, gender, age, and physique of a person having the face by analyzing a face image included in the image captured by the imaging device. That is, by identifying facial parts and performing matching with parts information corresponding to pre-registered race, gender, age, and physique, estimating the race, gender, age, and physique of the subject, The estimation information is input to the face size reference value [Wref] calculation unit 504. The subject information may be input by the user via the user input unit 501.

被写体距離算出部520の顔の大きさ基準値[Wref]算出部504は、画像解析部503または、ユーザ入力部501を介して入力された被写体情報に基づいて、被写体に応じた最適な基準値(Wref)を、各テーブルを適用して算出する。算出処理は、先に、図7〜図10を参照して説明したように、テーブルを参照してある程度のばらつきを考慮した基準値範囲Wref=(Wref+ΔWrefb)〜(Wref−ΔWrerfs)を算出する。すなわち、想定される大きい方へのずれをΔWrefb、想定される小さい方へのずれをΔWrefsとして考慮した結果を出力する。   The face size reference value [Wref] calculation unit 504 of the subject distance calculation unit 520 is based on the subject information input via the image analysis unit 503 or the user input unit 501, and the optimal reference value according to the subject. (Wref) is calculated by applying each table. As described above with reference to FIGS. 7 to 10, the calculation process calculates reference value ranges Wref = (Wref + ΔWrefb) to (Wref−ΔWreffs) in consideration of a certain amount of variation with reference to the table. In other words, a result is considered in which the assumed deviation to the larger side is ΔWrefb and the assumed deviation to the smaller side is taken as ΔWrefs.

被写体距離算出部520の顔の推定距離[Df]算出部505では、顔のテンプレートマッチング処理において発生する誤差、すなわち、検出性能、明るさ、顔の傾きなどに基づく誤差を考慮して、被写体距離の範囲Dfn〜Dffを算出する。この被写体距離の算出の基本式は、先に説明した式、すなわち、
Df=Wref×(f/Wi)×(Ww/Wf)・・・(式1.1)
である。上記式における各記号の説明を以下に示す。
The estimated face distance [Df] calculation unit 505 of the subject distance calculation unit 520 takes into account errors that occur in face template matching processing, that is, errors based on detection performance, brightness, face inclination, and the like. A range Dfn to Dff is calculated. The basic formula for calculating the subject distance is the formula described above, that is,
Df = Wref × (f / Wi) × (Ww / Wf) (Formula 1.1)
It is. The explanation of each symbol in the above formula is shown below.

人間の顔の大きさ基準値:Wref
撮像素子の幅:Wi
焦点距離:f
撮像画像における人の顔の大きさのピクセル数(撮像素子検出値):Wf
人の顔検出に使用した画像の大きさのピクセル数(撮像素子検出値):Ww
上記式において、テンプレートマッチングにおいて、最も小さく判定してしまう時の顔の大きさ:Ws、最も大きく判定してしまう時の顔の大きさ:Wbを算出し、顔の大きさ基準値Wref=(Wref+ΔWrefb)〜(Wref−ΔWrerfs)を考慮して、上記式(式1.1)を適用して、被写体距離の範囲Dfn〜Dffを算出する。
Human face size reference value: Wref
Image sensor width: Wi
Focal length: f
Number of pixels of human face size in the captured image (imaging element detection value): Wf
Number of pixels of image size used for human face detection (imaging element detection value): Ww
In the above formula, in the template matching, the face size when the smallest judgment is made: Ws, the face size when the largest judgment is made: Wb is calculated, and the face size reference value Wref = ( The range (Dfn to Dff) of the subject distance is calculated by applying the above formula (formula 1.1) in consideration of Wref + ΔWrefb) to (Wref−ΔWreffs).

すなわち、
Wref=Wref+ΔWrefb、
Wr=Ws
として設定して、式:Df=Wref×(f/Wi)×(Ww/Wf)を計算して、最も遠方に誤差が広がる場合の結果(Dff)を算出し、
さらに、
Wref=Wref−ΔWrefs、
Wr=Wb
を設定して、式:Df=Wref×(f/Wi)×(Ww/Wf)を計算して、最も至近方向に誤差が広がる場合の結果(Dfn)を算出して、
被写体距離の範囲Dfn〜Dffを算出する。
That is,
Wref = Wref + ΔWrefb,
Wr = Ws
And calculate the formula: Df = Wref × (f / Wi) × (Ww / Wf), and calculate the result (Dff) when the error spreads farthest away,
further,
Wref = Wref−ΔWrefs,
Wr = Wb
And calculate the formula: Df = Wref × (f / Wi) × (Ww / Wf), and calculate the result (Dfn) when the error spreads in the closest direction,
A subject distance range Dfn to Dff is calculated.

この被写体距離情報:Dfn〜Dffは、AF動作範囲(レンズ動作範囲(Rf)算出部)507に入力される。AF動作範囲(レンズ動作範囲(Rf)算出部)507は、さらに、被写体距離(Dfn〜Dff)に対して、デバイス起因誤差算出部506の算出する誤差範囲を含めてフォーカスレンズの動作範囲(Rf)を設定する。デバイス起因誤差算出部506は、焦点距離方向に非線系なピント移動、デバイスの温度特性によるピント位置の移動、各種のデバイス間に存在するヒステリシスなどを考慮した誤差範囲を算出する。この誤差を至近側にσn,無限側にσfとする。   The subject distance information: Dfn to Dff is input to the AF operation range (lens operation range (Rf) calculation unit) 507. The AF operation range (lens operation range (Rf) calculation unit) 507 further includes the error range calculated by the device-derived error calculation unit 506 with respect to the subject distance (Dfn to Dff) (Rf ) Is set. The device-derived error calculation unit 506 calculates an error range that takes into account non-linear focus movement in the focal length direction, focus position movement due to the temperature characteristics of the device, hysteresis existing between various devices, and the like. Let this error be σn on the closest side and σf on the infinite side.

AF動作範囲(レンズ動作範囲(Rf)算出部)507は、至近側にσn,無限側にσfの誤差を加算し、フォーカスレンズの動作範囲(Rf)を、
Rf=(Dfn−σn)〜(Dff+σf)
として設定する。このフォーカスレンズの動作範囲(Rf)情報が、フォーカス制御部509に入力されて、フォーカスレンズ駆動部510に対する駆動コマンドを出力して、フォーカスレンズの動作範囲(Rf)においてフォーカスレンズが移動され、各移動ポイントにおいて、コントラスト信号制生成部511の生成するコントラスト情報からAF評価値を算出し、AF評価値の高い位置にフォーカス位置を決定する処理が実行される。このフォーカス制御によって合焦がなされた被写体には、図15を参照して説明した合焦枠を表示するように表示制御部511が処理を行なう。
An AF operating range (lens operating range (Rf) calculation unit) 507 adds an error of σn on the close side and σf on the infinite side, and calculates the operating range (Rf) of the focus lens.
Rf = (Dfn−σn) to (Dff + σf)
Set as. The focus lens operating range (Rf) information is input to the focus control unit 509, and a drive command is output to the focus lens driving unit 510, and the focus lens is moved within the focus lens operating range (Rf). At the movement point, an AF evaluation value is calculated from the contrast information generated by the contrast signal generation unit 511, and processing for determining a focus position at a position with a high AF evaluation value is executed. The display control unit 511 performs processing so as to display the focusing frame described with reference to FIG. 15 on the subject focused by the focus control.

さらに、画像情報500に複数の顔が含まれる場合には、優先順位解析部508において各顔の優先順位の判定が実行される。優先順位の設定処理は、先に説明したように、顔の大きさや中央への近さなどを指標とした処理が実行される。また、ユーザ入力部501を介して入力された指定情報、例えば、人種、年齢、性別、体格などの指定情報に基づいて優先順位の設定が実行される。この処理は、先に、図12〜図14を参照して説明した処理である。   Further, when the image information 500 includes a plurality of faces, the priority order analysis unit 508 determines the priority order of each face. As described above, the priority setting process is performed by using the size of the face or the proximity to the center as an index. Further, priority setting is performed based on designation information input via the user input unit 501, for example, designation information such as race, age, sex, and physique. This process is the process described above with reference to FIGS.

優先順位解析部508において決定された優先順位情報は、AF動作範囲(レンズ動作範囲(Rf)算出部)507に入力され、この場合、AF動作範囲(レンズ動作範囲(Rf)算出部)507は優先順位情報に基づいて、AF動作範囲(レンズ動作範囲(Rf)を算出する。具体的には、先に説明したように、
(a)高速化を重視する場合、
(b)多くの顔に対する合焦判定を行なうことを重視する場合(図16)、
(c)高速かつ、できるだけ多くの顔に合焦させることを重視する場合(図17)、
これらのケースによって異なる処理が実行される。
The priority order information determined by the priority order analysis unit 508 is input to the AF operation range (lens operation range (Rf) calculation unit) 507. In this case, the AF operation range (lens operation range (Rf) calculation unit) 507 is Based on the priority information, the AF operation range (the lens operation range (Rf) is calculated. Specifically, as described above,
(A) When high speed is important,
(B) When importance is attached to performing in-focus determination on many faces (FIG. 16),
(C) When it is important to focus on as many faces as possible at high speed (FIG. 17),
Different processes are executed depending on these cases.

この処理によってフォーカスレンズの動作範囲(Rf)を決定し、決定情報をフォーカス制御部509に入力して、フォーカスレンズ駆動部510に対する駆動コマンドを出力して、フォーカスレンズの動作範囲(Rf)においてコントラストに基づくフォーカス位置設定が実行される。フォーカス制御によって合焦がなされた被写体には、図15を参照して説明した合焦枠を表示するように表示制御部511が処理を行なう。   By this processing, the operating range (Rf) of the focus lens is determined, the determination information is input to the focus control unit 509, a driving command is output to the focus lens driving unit 510, and the contrast in the operating range (Rf) of the focus lens is output. Focus position setting based on is performed. The display control unit 511 performs processing so as to display the focusing frame described with reference to FIG. 15 on the subject focused by the focus control.

以上、特定の実施例を参照しながら、本発明について詳解してきた。しかしながら、本発明の要旨を逸脱しない範囲で当業者が該実施例の修正や代用を成し得ることは自明である。すなわち、例示という形態で本発明を開示してきたのであり、限定的に解釈されるべきではない。本発明の要旨を判断するためには、特許請求の範囲の欄を参酌すべきである。   The present invention has been described in detail above with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiments without departing from the gist of the present invention. In other words, the present invention has been disclosed in the form of exemplification, and should not be interpreted in a limited manner. In order to determine the gist of the present invention, the claims should be taken into consideration.

また、明細書中において説明した一連の処理はハードウェア、またはソフトウェア、あるいは両者の複合構成によって実行することが可能である。ソフトウェアによる処理を実行する場合は、処理シーケンスを記録したプログラムを、専用のハードウェアに組み込まれたコンピュータ内のメモリにインストールして実行させるか、あるいは、各種処理が実行可能な汎用コンピュータにプログラムをインストールして実行させることが可能である。   The series of processing described in the specification can be executed by hardware, software, or a combined configuration of both. When executing processing by software, the program recording the processing sequence is installed in a memory in a computer incorporated in dedicated hardware and executed, or the program is executed on a general-purpose computer capable of executing various processing. It can be installed and run.

例えば、プログラムは記録媒体としてのハードディスクやROM(Read Only Memory)に予め記録しておくことができる。あるいは、プログラムはフレキシブルディスク、CD−ROM(Compact Disc Read Only Memory),MO(Magneto optical)ディスク,DVD(Digital Versatile Disc)、磁気ディスク、半導体メモリなどのリムーバブル記録媒体に、一時的あるいは永続的に格納(記録)しておくことができる。このようなリムーバブル記録媒体は、いわゆるパッケージソフトウエアとして提供することができる。   For example, the program can be recorded in advance on a hard disk or ROM (Read Only Memory) as a recording medium. Alternatively, the program is temporarily or permanently stored on a removable recording medium such as a flexible disk, a CD-ROM (Compact Disc Read Only Memory), an MO (Magneto optical) disk, a DVD (Digital Versatile Disc), a magnetic disk, or a semiconductor memory. It can be stored (recorded). Such a removable recording medium can be provided as so-called package software.

なお、プログラムは、上述したようなリムーバブル記録媒体からコンピュータにインストールする他、ダウンロードサイトから、コンピュータに無線転送したり、LAN(Local Area Network)、インターネットといったネットワークを介して、コンピュータに有線で転送し、コンピュータでは、そのようにして転送されてくるプログラムを受信し、内蔵するハードディスク等の記録媒体にインストールすることができる。   The program is installed on the computer from the removable recording medium as described above, or is wirelessly transferred from the download site to the computer, or is wired to the computer via a network such as a LAN (Local Area Network) or the Internet. The computer can receive the program transferred in this manner and install it on a recording medium such as a built-in hard disk.

なお、明細書に記載された各種の処理は、記載に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。また、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   Note that the various processes described in the specification are not only executed in time series according to the description, but may be executed in parallel or individually according to the processing capability of the apparatus that executes the processes or as necessary. Further, in this specification, the system is a logical set configuration of a plurality of devices, and the devices of each configuration are not limited to being in the same casing.

以上、説明したように、本発明の一実施例の構成では、撮像装置におけるオートフォーカス処理において、入力画像から顔領域を検出し、検出した顔の大きさに基づいて被写体距離を算出して、算出した被写体距離情報に基づいてフォーカス位置を推定する。さらに、この推定したフォーカス位置に基づいて、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定し、設定したレンズ動作範囲内において、フォーカスレンズを移動させてフォーカスレンズ設定位置を決定する。本構成によれば、フォーカス制御において移動させるレンズの距離を短く設定することが可能となり、高速なフォーカス制御が実現される。   As described above, in the configuration of an embodiment of the present invention, in the autofocus process in the imaging device, the face area is detected from the input image, the subject distance is calculated based on the detected face size, A focus position is estimated based on the calculated subject distance information. Further, based on the estimated focus position, a focus lens operating range shorter than the entire operating range of the focus lens is set, and the focus lens is moved within the set lens operating range to determine the focus lens setting position. According to this configuration, the distance of the lens to be moved in the focus control can be set short, and high-speed focus control is realized.

さらに、本発明の一実施例の構成によれば、被写体距離算出処理において、人種、性別、年齢、体格の少なくともいずれかの被写体情報を入力し、入力した被写体情報に基づいて、被写体に応じた顔の大きさの基準値を適用した被写体距離算出処理を実行する構成としたので、被写体に適応したより正確な被写体距離を算出可能となり、正確なフォーカス制御が実現される。   Furthermore, according to the configuration of one embodiment of the present invention, in the subject distance calculation process, subject information of at least one of race, gender, age, and physique is input, and the subject distance is determined based on the input subject information. Since the subject distance calculation process is executed by applying the reference value of the face size, a more accurate subject distance adapted to the subject can be calculated, and accurate focus control is realized.

さらに、本発明の一実施例の構成によれば、優先順位解析部において、顔検出部の検出した複数の顔の優先順位を、例えば、顔の大きさ、または、顔の中央への近さ、または人種、性別、年齢、体格などの被写体情報などを指標として決定し、決定した顔の優先順位情報に基づいてフォーカスレンズ動作範囲を設定する処理を実行する構成としたので、複数の顔が検出された場合であっても、より優先度の高い顔に対するフォーカス制御を効率的に行うことができる。   Furthermore, according to the configuration of the embodiment of the present invention, the priority analysis unit determines the priority order of the plurality of faces detected by the face detection unit, for example, the size of the face or the proximity to the center of the face. Or subject information such as race, gender, age, physique, etc. is determined as an index, and the processing for setting the focus lens operating range is executed based on the determined face priority information. Even when detected, it is possible to efficiently perform focus control on a face with higher priority.

本発明の撮像装置の外観構成例について説明する図である。It is a figure explaining the external appearance structural example of the imaging device of this invention. 本発明の撮像装置のハードウェア構成例について説明する図である。It is a figure explaining the hardware structural example of the imaging device of this invention. フォーカス制御におけるレンズ駆動例について説明する図である。It is a figure explaining the example of a lens drive in focus control. 本発明の撮像装置のオートフォーカス制御シーケンスについて説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining the autofocus control sequence of the imaging device of this invention. 顔の大きさに基づく被写体距離算出処理について説明する図である。It is a figure explaining the object distance calculation process based on the size of a face. 顔の大きさに基づいて算出した被写体距離情報とフォーカスレンズの動作範囲の設定例について説明する図である。It is a figure explaining the example of a setting of the object distance information calculated based on the size of the face, and the operating range of a focus lens. 顔の大きさ基準値算出部の構成および処理について説明する図である。It is a figure explaining the structure and process of a face size reference value calculation part. 顔の大きさ基準値算出部において適用する基準値算出テーブルの例について説明する図である。It is a figure explaining the example of the reference value calculation table applied in a face size reference value calculation part. 顔の大きさ基準値算出部において適用する基準値算出テーブルの例について説明する図である。It is a figure explaining the example of the reference value calculation table applied in a face size reference value calculation part. 顔の大きさ基準値算出部において適用する基準値算出テーブルの例について説明する図である。It is a figure explaining the example of the reference value calculation table applied in a face size reference value calculation part. 顔の大きさに基づいて算出した被写体距離情報とフォーカスレンズの動作範囲の設定例について説明する図である。It is a figure explaining the example of a setting of the object distance information calculated based on the size of the face, and the operating range of a focus lens. 被写体の優先順位設定処理シーケンスの一例について説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining an example of the priority order setting process sequence of a to-be-photographed object. 被写体の優先順位設定処理シーケンスの一例について説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining an example of the priority order setting process sequence of a to-be-photographed object. 被写体の優先順位設定処理シーケンスの一例について説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining an example of the priority order setting process sequence of a to-be-photographed object. 合焦表示例について説明する図である。It is a figure explaining the example of a focusing display. 優先順位が設定された被写体に対するフォーカス制御処理例について説明する図である。It is a figure explaining the example of a focus control process with respect to the to-be-set subject. 優先順位が設定された被写体に対するフォーカス制御処理例について説明する図である。It is a figure explaining the example of a focus control process with respect to the to-be-set subject. 本発明の撮像装置における処理および機能を説明するブロック図である。It is a block diagram explaining the process and function in the imaging device of this invention.

符号の説明Explanation of symbols

10 撮像装置
11 電源スイッチ
12 レリーズスイッチ
13 モニタ
14 イメージャ
15 ズームボタン
16 操作ボタン
17 ビューファインダ
18 フォーカスレンズ
19 ズームレンズ
20 モードダイアル
21 フォーカスレンズモータ(M1)
22 ズームレンズモータ(M2)
100 撮像装置
101 フォーカスレンズ
102 ズームレンズ
103 撮像素子
104 アナログ信号処理部
105 A/D変換部
106 タイミングジェネレータ(TA)
107 垂直ドライバ
108 デジタル信号処理部
110 制御部
111 ジャイロ
112 モータドライバ
113,114 モータ
115記録デバイス115
116 ビューファインダ(EVF)
117 モニタ
118 操作部
119 メモリ(EEPROM)
120 メモリ(ROM)
121 メモリ(RAM)
201 フォーカスレンズ
301 被写***置
302 フォーカスレンズ
303 撮像素子
310 顔の大きさ基準値(Wref)算出部
311 人種別基準値算出テーブル
312 性別基準値算出テーブル
313 年齢別基準値算出テーブル
314 体格別基準値算出テーブル
320 データ処理部
331 画像解析部
332 ユーザ入力部
401 フォーカスレンズ
421,422,423 顔(画像)
431,432,433 合焦枠
450 フォーカスレンズ
500 画像情報
501 ユーザ入力部
502 顔検出部
503 画像解析部
504 顔の大きさ基準値[Wref]算出部
505 顔の推定距離[Df]算出部
506 デバイス起因誤差算出部
507 AF動作範囲(レンズ動作範囲(Rf)算出部)
508 優先順位解析部
509 フォーカス制御部
510 コントラスト信号生成部
511 フォーカスレンズ駆動部
512 表示制御部
520 被写体距離算出部
DESCRIPTION OF SYMBOLS 10 Imaging device 11 Power switch 12 Release switch 13 Monitor 14 Imager 15 Zoom button 16 Operation button 17 Viewfinder 18 Focus lens 19 Zoom lens 20 Mode dial 21 Focus lens motor (M1)
22 Zoom lens motor (M2)
DESCRIPTION OF SYMBOLS 100 Image pick-up apparatus 101 Focus lens 102 Zoom lens 103 Image pick-up element 104 Analog signal processing part 105 A / D conversion part 106 Timing generator (TA)
Reference Signs List 107 vertical driver 108 digital signal processor 110 control unit 111 gyro 112 motor driver 113, 114 motor 115 recording device 115
116 Viewfinder (EVF)
117 Monitor 118 Operation unit 119 Memory (EEPROM)
120 memory (ROM)
121 Memory (RAM)
DESCRIPTION OF SYMBOLS 201 Focus lens 301 Subject position 302 Focus lens 303 Image pick-up element 310 Face size reference value (Wref) calculation unit 311 Person type reference value calculation table 312 Gender reference value calculation table 313 Age reference value calculation table 314 Body size reference value calculation Table 320 Data processing unit 331 Image analysis unit 332 User input unit 401 Focus lens 421, 422, 423 Face (image)
431, 432, 433 In-focus frame 450 Focus lens 500 Image information 501 User input unit 502 Face detection unit 503 Image analysis unit 504 Face size reference value [Wref] calculation unit 505 Estimated face distance [Df] calculation unit 506 Device Cause error calculation unit 507 AF operation range (lens operation range (Rf) calculation unit)
508 Priority order analysis unit 509 Focus control unit 510 Contrast signal generation unit 511 Focus lens drive unit 512 Display control unit 520 Subject distance calculation unit

Claims (12)

撮像装置において入力する入力画像から、テンプレートマッチング処理によって顔領域を検出する顔検出部と、
顔検出部の検出した顔の大きさに基づいて被写体距離を算出する被写体距離算出部と、
前記被写体距離算出部の算出した被写体距離に基づいてフォーカス位置を推定し、該推定したフォーカス位置を基準として、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定するレンズ動作範囲算出部と、
前記レンズ動作範囲算出部の設定したレンズ動作範囲内において、フォーカスレンズを移動させて、コントラストの高低を判定してフォーカスレンズ設定位置を決定するフォーカス制御部とを有し、
前記被写体距離算出部は、
前記被写体距離として、前記テンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出する撮像装置。
A face detection unit that detects a face area by template matching processing from an input image input in the imaging apparatus;
A subject distance calculation unit that calculates a subject distance based on the size of the face detected by the face detection unit;
A lens operating range calculating unit that estimates a focus position based on the subject distance calculated by the subject distance calculating unit, and sets a focus lens operating range shorter than the entire operating range of the focus lens based on the estimated focus position;
A focus control unit that determines a focus lens setting position by moving a focus lens within a lens operation range set by the lens operation range calculation unit and determining a contrast level;
The subject distance calculation unit
An imaging apparatus that calculates a range of a subject distance in consideration of an error that occurs in the template matching process as the subject distance.
前記レンズ動作範囲算出部は、さらに、
前記撮像装置のデバイスに起因する誤差を考慮して前記フォーカスレンズ動作範囲を設定する構成である請求項1に記載の撮像装置。
The lens operating range calculation unit further includes:
The imaging apparatus according to claim 1, wherein the focus lens operating range is set in consideration of an error caused by a device of the imaging apparatus.
前記被写体距離算出部は、
顔検出部の検出した顔の大きさに基づく被写体距離算出処理において、人種、性別、年齢、体格の少なくともいずれかの被写体情報を入力し、入力した被写体情報に基づいて、被写体に応じた顔の大きさの基準値を適用した被写体距離算出処理を実行する構成である請求項2に記載の撮像装置。
The subject distance calculation unit
In subject distance calculation processing based on the face size detected by the face detection unit, subject information of at least one of race, gender, age, and physique is input, and the face corresponding to the subject is input based on the input subject information. The imaging apparatus according to claim 2, wherein the imaging apparatus is configured to execute subject distance calculation processing to which a reference value of the size of the subject is applied.
前記人種、性別、年齢、体格の少なくともいずれかの被写体情報は、撮像装置において入力する入力画像の画像解析部における解析結果として前記被写体距離算出部に入力される情報である請求項3に記載の撮像装置。   The subject information of at least one of the race, sex, age, and physique is information input to the subject distance calculation unit as an analysis result in an image analysis unit of an input image input in the imaging apparatus. Imaging device. 前記人種、性別、年齢、体格の少なくともいずれかの被写体情報は、撮像装置におけるユーザ入力部を介して前記被写体距離算出部に入力される情報である請求項3に記載の撮像装置。   The imaging device according to claim 3, wherein the subject information of at least one of race, sex, age, and physique is information input to the subject distance calculation unit via a user input unit in the imaging device. 前記被写体距離算出部は、
被写体に応じた顔の大きさの基準値を適用した被写体距離算出処理を実行する構成であり、顔の大きさの基準値を、一つの値ではなく、ある値の範囲を持つ基準値として算出し、範囲を持つ基準値を適用して、範囲を持つ被写体距離を算出する処理を実行する構成である請求項2に記載の撮像装置。
The subject distance calculation unit
It is a configuration that executes subject distance calculation processing that applies a reference value of the face size according to the subject, and calculates the reference value of the face size as a reference value having a certain value range instead of a single value The imaging apparatus according to claim 2, wherein a process for calculating a subject distance having a range is executed by applying a reference value having a range.
前記撮像装置は、さらに、
前記顔検出部の検出した複数の顔の優先順位を設定する優先順位解析部を有し、
前記優先順位解析部は、
顔の大きさ、または、顔の中央への近さ、または人種、性別、年齢、体格の少なくともいずれかの被写体情報を指標として顔の優先順位決定処理を実行する構成であり、
前記レンズ動作範囲算出部は、
前記優先順位解析部の決定した顔の優先順位情報に基づいてフォーカスレンズ動作範囲を設定する処理を実行する構成である請求項3に記載の撮像装置。
The imaging device further includes:
A priority analysis unit that sets priority of a plurality of faces detected by the face detection unit;
The priority analysis unit
It is a configuration that executes face priority determination processing using as an index subject information of at least one of face size, proximity to the center of the face, race, gender, age, and physique,
The lens operating range calculation unit
The imaging apparatus according to claim 3, wherein the imaging apparatus is configured to execute a process of setting a focus lens operating range based on face priority information determined by the priority analysis unit.
前記レンズ動作範囲算出部は、
前記優先順位解析部の決定した最も優先度の高い顔に対応する被写体距離情報に基づいてフォーカスレンズ動作範囲を設定する処理を実行する構成である請求項7に記載の撮像装置。
The lens operating range calculation unit
The imaging apparatus according to claim 7, wherein the imaging apparatus is configured to execute a process of setting a focus lens operation range based on subject distance information corresponding to a face with the highest priority determined by the priority analysis unit.
前記レンズ動作範囲算出部は、
前記優先順位解析部の決定した優先度順の複数の顔に対応する被写体距離情報に基づいて算出される複数のフォーカスレンズ動作範囲を含む範囲を最終的なフォーカスレンズ動作範囲として設定する処理を実行する構成である請求項7に記載の撮像装置。
The lens operating range calculation unit
A process of setting a range including a plurality of focus lens operation ranges calculated based on subject distance information corresponding to a plurality of faces in priority order determined by the priority analysis unit as a final focus lens operation range is executed. The imaging device according to claim 7, wherein the imaging device is configured to perform.
前記撮像装置は、
さらに、前記フォーカス制御部におけるフォーカスレンズ設定位置の決定に基づいて合焦成功と判断されたモニタ出力画像中の顔領域に合焦成功を示す合焦表示を行なう表示制御部を有する請求項2に記載の撮像装置。
The imaging device
3. The display control unit according to claim 2, further comprising: a display control unit configured to perform a focus display indicating a successful focus on a face area in a monitor output image determined to be a successful focus based on the determination of a focus lens setting position in the focus control unit. The imaging device described.
撮像装置において、オートフォーカス制御を実行する撮像装置制御方法であり、
顔検出部において、撮像装置において入力する入力画像から、テンプレートマッチング処理によって顔領域を検出する顔検出ステップと、
被写体距離算出部において、顔検出部の検出した顔の大きさに基づいて被写体距離を算出する被写体距離算出ステップと、
レンズ動作範囲算出部において、前記被写体距離算出部の算出した被写体距離情報に基づいてフォーカス位置を推定し、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定するレンズ動作範囲算出ステップと、
フォーカス制御部において、前記レンズ動作範囲算出部の設定したレンズ動作範囲内において、フォーカスレンズを移動させて、コントラストの高低を判定してフォーカスレンズ設定位置を決定するフォーカス制御ステップとを有し、
前記被写体距離算出ステップは、
前記被写体距離として、前記テンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出する撮像装置制御方法。
An imaging apparatus control method for executing autofocus control in an imaging apparatus,
In the face detection unit, a face detection step of detecting a face region by template matching processing from an input image input in the imaging device;
A subject distance calculation step of calculating a subject distance based on the size of the face detected by the face detection unit in the subject distance calculation unit;
A lens operating range calculating step for estimating a focus position based on the subject distance information calculated by the subject distance calculating unit and setting a focus lens operating range shorter than the entire operating range of the focus lens in the lens operating range calculating unit;
A focus control step in which the focus control unit moves the focus lens within the lens operation range set by the lens operation range calculation unit and determines the focus lens setting position by determining the level of contrast;
The subject distance calculating step includes:
An imaging apparatus control method for calculating a range of a subject distance in consideration of an error generated in the template matching process as the subject distance.
撮像装置において、オートフォーカス制御を実行させるコンピュータ・プログラムであり、
顔検出部において、撮像装置において入力する入力画像から、テンプレートマッチング処理によって顔領域を検出させる顔検出ステップと、
被写体距離算出部において、顔検出部の検出した顔の大きさに基づいて被写体距離を算出させる被写体距離算出ステップと、
レンズ動作範囲算出部において、前記被写体距離算出部の算出した被写体距離情報に基づいてフォーカス位置を推定し、フォーカスレンズの全稼動範囲より短いフォーカスレンズ動作範囲を設定させるレンズ動作範囲算出ステップと、
フォーカス制御部において、前記レンズ動作範囲算出部の設定したレンズ動作範囲内において、フォーカスレンズを移動させて、コントラストの高低を判定してフォーカスレンズ設定位置を決定させるフォーカス制御ステップとを有し、
前記被写体距離算出ステップは、
前記被写体距離として、前記テンプレートマッチング処理において発生する誤差を考慮して、被写体距離の範囲を算出させるコンピュータ・プログラム。
A computer program for executing autofocus control in an imaging apparatus,
In the face detection unit, a face detection step of detecting a face region by template matching processing from an input image input in the imaging device;
A subject distance calculation step in which the subject distance calculation unit calculates the subject distance based on the size of the face detected by the face detection unit;
A lens operating range calculating step for estimating a focus position based on the subject distance information calculated by the subject distance calculating unit and setting a focus lens operating range shorter than the entire operating range of the focus lens in the lens operating range calculating unit;
A focus control step in which the focus control unit moves the focus lens within the lens operation range set by the lens operation range calculation unit, determines the contrast level and determines the focus lens setting position;
The subject distance calculating step includes:
A computer program for calculating a range of a subject distance in consideration of an error occurring in the template matching process as the subject distance.
JP2008163410A 2008-06-23 2008-06-23 Imaging apparatus and imaging apparatus control method, and computer program Pending JP2008282031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008163410A JP2008282031A (en) 2008-06-23 2008-06-23 Imaging apparatus and imaging apparatus control method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008163410A JP2008282031A (en) 2008-06-23 2008-06-23 Imaging apparatus and imaging apparatus control method, and computer program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2006160451A Division JP4207980B2 (en) 2006-06-09 2006-06-09 IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM

Publications (1)

Publication Number Publication Date
JP2008282031A true JP2008282031A (en) 2008-11-20

Family

ID=40142830

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008163410A Pending JP2008282031A (en) 2008-06-23 2008-06-23 Imaging apparatus and imaging apparatus control method, and computer program

Country Status (1)

Country Link
JP (1) JP2008282031A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010266699A (en) * 2009-05-15 2010-11-25 Hoya Corp Image capturing apparatus
JP2011027846A (en) * 2009-07-22 2011-02-10 Fujifilm Corp Automatic af frame tracking system
JP2011027847A (en) * 2009-07-22 2011-02-10 Fujifilm Corp Af frame automatic tracking system
WO2011086636A1 (en) * 2010-01-13 2011-07-21 パナソニック株式会社 Stereo image capturing device, stereo image capturing method, stereo image display device, and program
JP2013201764A (en) * 2013-05-14 2013-10-03 Olympus Imaging Corp Camera and camera system
JP2015529856A (en) * 2012-09-06 2015-10-08 エシロール エンテルナショナル (コンパニ ジェネラル ドプチック) Method for adapting the optical function of an adaptive ophthalmic lens system
CN112788231A (en) * 2019-11-08 2021-05-11 佳能株式会社 Image processing apparatus, image processing method, and storage medium
CN114339021A (en) * 2020-09-30 2022-04-12 北京小米移动软件有限公司 Focusing method and device based on face recognition, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004222118A (en) * 2003-01-17 2004-08-05 Omron Corp Photographing equipment
JP2004317699A (en) * 2003-04-15 2004-11-11 Nikon Gijutsu Kobo:Kk Digital camera
JP2006018246A (en) * 2004-06-03 2006-01-19 Canon Inc Imaging apparatus and imaging method
JP2006201282A (en) * 2005-01-18 2006-08-03 Nikon Corp Digital camera
JP2007178543A (en) * 2005-12-27 2007-07-12 Samsung Techwin Co Ltd Imaging apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004222118A (en) * 2003-01-17 2004-08-05 Omron Corp Photographing equipment
JP2004317699A (en) * 2003-04-15 2004-11-11 Nikon Gijutsu Kobo:Kk Digital camera
JP2006018246A (en) * 2004-06-03 2006-01-19 Canon Inc Imaging apparatus and imaging method
JP2006201282A (en) * 2005-01-18 2006-08-03 Nikon Corp Digital camera
JP2007178543A (en) * 2005-12-27 2007-07-12 Samsung Techwin Co Ltd Imaging apparatus

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010266699A (en) * 2009-05-15 2010-11-25 Hoya Corp Image capturing apparatus
JP2011027846A (en) * 2009-07-22 2011-02-10 Fujifilm Corp Automatic af frame tracking system
JP2011027847A (en) * 2009-07-22 2011-02-10 Fujifilm Corp Af frame automatic tracking system
WO2011086636A1 (en) * 2010-01-13 2011-07-21 パナソニック株式会社 Stereo image capturing device, stereo image capturing method, stereo image display device, and program
JPWO2011086636A1 (en) * 2010-01-13 2013-05-16 パナソニック株式会社 Stereo image pickup device, stereo image pickup method, stereo image display device, and program
JP2015529856A (en) * 2012-09-06 2015-10-08 エシロール エンテルナショナル (コンパニ ジェネラル ドプチック) Method for adapting the optical function of an adaptive ophthalmic lens system
US10788684B2 (en) 2012-09-06 2020-09-29 Essilor International Method for adapting the optical function of an adaptive ophthalmic lenses system
JP2013201764A (en) * 2013-05-14 2013-10-03 Olympus Imaging Corp Camera and camera system
CN112788231A (en) * 2019-11-08 2021-05-11 佳能株式会社 Image processing apparatus, image processing method, and storage medium
US11557050B2 (en) 2019-11-08 2023-01-17 Canon Kabushiki Kaisha Image processing apparatus, image capturing apparatus, image processing method and storage medium
CN112788231B (en) * 2019-11-08 2023-08-15 佳能株式会社 Image processing apparatus, image processing method, and storage medium
CN114339021A (en) * 2020-09-30 2022-04-12 北京小米移动软件有限公司 Focusing method and device based on face recognition, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
JP4207980B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM
JP4127296B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM
JP4127297B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM
JP4172507B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM
JP4218720B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM
JP4264660B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND COMPUTER PROGRAM
JP6271990B2 (en) Image processing apparatus and image processing method
US8831282B2 (en) Imaging device including a face detector
US9489747B2 (en) Image processing apparatus for performing object recognition focusing on object motion, and image processing method therefor
JP2008282031A (en) Imaging apparatus and imaging apparatus control method, and computer program
JP5713055B2 (en) Imaging apparatus, imaging method, and program
JP5453573B2 (en) Imaging apparatus, imaging method, and program
JP2009199049A (en) Imaging apparatus and imaging apparatus control method, and computer program
JP2009141475A (en) Camera
JP2015012482A (en) Image processing apparatus and image processing method
JP2010091669A (en) Imaging device
JP2007133301A (en) Autofocus camera
JP2009105851A (en) Imaging apparatus, control method and program thereof
JP4996568B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP6486453B2 (en) Image processing apparatus, image processing method, and program
JP2007328213A (en) Imaging apparatus, imaging apparatus control method, and computer program
JP2009092747A (en) Imaging device and method
JP2014116789A (en) Photographing device, control method therefor, and program
JP2018042092A (en) Image processing apparatus, imaging apparatus, control method, and program
JP2010072537A (en) Imaging device and control method therefor

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110329

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110517

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110809