JP5665512B2 - Imaging apparatus and main subject detection method - Google Patents

Imaging apparatus and main subject detection method Download PDF

Info

Publication number
JP5665512B2
JP5665512B2 JP2010276101A JP2010276101A JP5665512B2 JP 5665512 B2 JP5665512 B2 JP 5665512B2 JP 2010276101 A JP2010276101 A JP 2010276101A JP 2010276101 A JP2010276101 A JP 2010276101A JP 5665512 B2 JP5665512 B2 JP 5665512B2
Authority
JP
Japan
Prior art keywords
main subject
area
distance
subject
detected
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.)
Expired - Fee Related
Application number
JP2010276101A
Other languages
Japanese (ja)
Other versions
JP2012123324A (en
Inventor
杉本 雅彦
雅彦 杉本
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.)
Fujifilm Corp
Original Assignee
Fujifilm 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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2010276101A priority Critical patent/JP5665512B2/en
Publication of JP2012123324A publication Critical patent/JP2012123324A/en
Application granted granted Critical
Publication of JP5665512B2 publication Critical patent/JP5665512B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、撮像装置及び主要被写体検出方法に係り、特に多点測距の結果を利用して、主要被写体を検出する撮像装置及び主要被写体検出方法に関する。   The present invention relates to an imaging device and a main subject detection method, and more particularly to an imaging device and a main subject detection method for detecting a main subject using a result of multipoint distance measurement.

画面内の主要被写体を検出する方法の一つとして、画面内を多点測距し、その結果を利用して、主要被写体を検出する方法が知られている(たとえば、特許文献1、2等)。この方法は、たとえば、画面内を複数のエリアに分割し、エリアごとに測距し、得られた各エリアの被写体距離の情報と各エリアの位置の情報とを利用して、主要被写体と推定される位置を特定する。   As one of methods for detecting the main subject in the screen, a method is known in which the main subject is detected using multipoint distance measurement in the screen and the result (for example, Patent Documents 1 and 2, etc.). ). This method, for example, divides the screen into a plurality of areas, measures the distance for each area, and uses the obtained object distance information and position information to estimate the main subject. Specify the position to be performed.

特開2010−66378号公報JP 2010-66378 A 特開平11−25263号公報JP 11-25263 A

しかしながら、多点測距による主要被写体の検出精度は、測距するエリアのサンプリング間隔レベルに留まるため、正確な被写体位置の検出が難しいという欠点がある。   However, since the detection accuracy of the main subject by multi-point distance measurement is limited to the sampling interval level of the area to be measured, there is a drawback that it is difficult to accurately detect the subject position.

本発明は、このような事情に鑑みてなされたもので、精度よく主要被写体の位置を検出できる撮像装置及び主要被写体検出方法を提供することを目的とする。   The present invention has been made in view of such circumstances, and an object thereof is to provide an imaging apparatus and a main subject detection method that can detect the position of a main subject with high accuracy.

請求項1に係る発明は、前記目的を達成するために、撮像光学系と、前記撮像光学系を介して画像を撮像する撮像手段と、前記撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距手段と、前記多点測距手段の測定結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出する主要被写体候補エリア検出手段であって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定する主要被写体候補エリア検出手段と、前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定する詳細サーチ範囲設定手段と、前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出する主要被写体位置検出手段と、前記主要被写体位置検出手段によって検出された主要被写体の位置にフォーカスエリアを設定するフォーカスエリア設定手段と、前記主要被写体候補エリアの合焦位置を基準に一定範囲で検出範囲を設定し、該検出範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定する測距手段と、前記測距手段で測定された被写体距離と前記主要被写体候補エリアの被写体距離との差を求め、その差が閾値を超えている場合に前記主要被写体の位置を前記主要被写体候補エリアの中心に修正する主要被写体位置修正手段と、を備えたことを特徴とする撮像装置を提供する。 In order to achieve the above object, the invention according to claim 1 divides an imaging optical system, an imaging unit that captures an image through the imaging optical system, and an imaging area of the imaging unit into a plurality of ranging areas. and a multi-point distance measuring means for measuring a subject distance in each ranging area based on the measurement result of the multi-point distance measuring device, a distance measuring area as the main subject candidate area main subject is estimated to belong Main subject candidate area detection means to detect, wherein the subject distance of each distance measurement area is weighted with a greater weight for the distance measurement area closer to the center of the screen, and the subject distance of each distance measurement area is a greater weight for a shorter distance in and adds the weighted values, and to quantify the main subject likeness of each ranging area, a main object candidate area detection means for selecting a ranging area the number is maximized main object candidate area, before Detailed search range setting means for setting a specific range centered on the center of the main subject candidate area as a detailed search range, and an image captured by the imaging means is analyzed within the detailed search range to determine the position of the main subject. A main subject position detecting means for detecting the focus, a focus area setting means for setting a focus area at the position of the main subject detected by the main subject position detecting means, and a fixed range based on the in-focus position of the main subject candidate area In the focus area, the position at which the contrast of the image obtained from the imaging means is maximized is detected by setting a detection range in, and changing the focal position of the imaging optical system in the detection range. Ranging means for measuring the subject distance of the subject, the subject distance measured by the ranging means and the main subject Obtains the difference between the subject distance of the area, and further comprising a, a main object position correction means for correcting the center of the main subject candidate area the position of the main object when the difference exceeds the threshold value An imaging device is provided.

本発明によれば、まず、多点測距によって主要被写体の位置がラフに検出され、その後、ラフに検出された主要被写体の位置を基準に画像解析が行われて、主要被写体の位置が検出される。これにより、中央以外に主要被写体が存在している場合であっても、精度よく主要被写体の位置を検出することができる。また、最初に主要被写体の位置をラフに決定し、その後、詳細に検出することにより、効率よく主要被写体の位置を検出することができる。
また、本発明によれば、多点測距の結果からラフに求めた主要被写体の位置(主要被写体候補エリアの位置)を基準にして、画像解析によって主要被写体を詳細に検出するための範囲(詳細サーチ範囲)が設定される。これにより、画像解析を行う範囲が限定され、効率よく主要被写体を検出することができる。
また、本発明によれば、多点測距の結果からラフに求めた主要被写体の位置(主要被写体候補エリアの位置)を中心とした所定範囲が詳細サーチ範囲に設定される。ラフに求めた主要被写体の位置の周囲に詳細サーチ範囲を限定することにより、効率よく主要被写体を検出することができる。
また、本発明によれば、画像解析により主要被写体の詳細な位置が検出されると、検出された主要被写体の位置にフォーカスエリアが設定されて、いわゆるコントラスト方式の測距が行われる。この際、主要被写体候補エリアの合焦位置を基準に検出範囲(撮像光学系の焦点変化させる範囲)が設定され、その検出範囲で画像のコントラストが極大となる位置が検出される。そして、測距の結果から得られた被写体距離と主要被写体候補エリアの被写体距離との差が求められる。この結果、求めた差が、あらかじめ設定された閾値以下の場合は、そのまま画像解析により求めた主要被写体の位置が、主要被写体の位置とされる。一方、求めたさが閾値を超えている場合は、主要被写体候補エリアの中心が主要被写体の位置とされる。これにより、画像解析により求めた主要被写体の位置が、ラフに求めた主要被写体の位置(主要被写体候補エリアの位置)からズレてしまった場合であっても、主要被写体の位置が大きく外れるのを防止することができる。
請求項2に係る発明は、前記目的を達成するために、前記主要被写体位置修正手段は、前記測距手段で前記コントラストが最大となる位置が検出できない場合も前記主要被写体の位置を前記主要被写体候補エリアの中心に修正することを特徴とする請求項1に記載の撮像装置。
本発明によれば、画像解析によって求めた主要被写体の詳細な位置をフォーカスエリアに設定してコントラスト方式で測距した場合にコントラストが極大となる位置が検出されない場合も、主要被写体候補エリアの中心が主要被写体の位置とされる。これにより、画像解析により求めた主要被写体の位置が、ラフに求めた主要被写体の位置(主要被写体候補エリアの位置)からズレてしまった場合であっても、主要被写体の位置が大きく外れるのを防止することができる。
請求項3に係る発明は、前記目的を達成するために、撮像光学系と、前記撮像光学系を介して画像を撮像する撮像手段と、前記撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距手段と、前記多点測距手段の測定結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出する主要被写体候補エリア検出手段であって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定する主要被写体候補エリア検出手段と、前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定する詳細サーチ範囲設定手段と、前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出する主要被写体位置検出手段と、前記主要被写体位置検出手段によって検出された主要被写体の位置にフォーカスエリアを設定するフォーカスエリア設定手段と、前記主要被写体候補エリアの合焦位置の前後所定範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定する測距手段と、前記測距手段による測定の結果、前記コントラストが最大となる位置が検出されない場合、前記主要被写体の位置を前記主要被写体候補エリアの中心に修正する主要被写体位置修正手段と、を備えたことを特徴とする撮像装置を提供する。
本発明によれば、まず、多点測距によって主要被写体の位置がラフに検出され、その後、ラフに検出された主要被写体の位置を基準に画像解析が行われて、主要被写体の位置が検出される。これにより、中央以外に主要被写体が存在している場合であっても、精度よく主要被写体の位置を検出することができる。また、最初に主要被写体の位置をラフに決定し、その後、詳細に検出することにより、効率よく主要被写体の位置を検出することができる。
また、本発明によれば、多点測距の結果からラフに求めた主要被写体の位置(主要被写体候補エリアの位置)を基準にして、画像解析によって主要被写体を詳細に検出するための範囲(詳細サーチ範囲)が設定される。これにより、画像解析を行う範囲が限定され、効率よく主要被写体を検出することができる。
また、本発明によれば、多点測距の結果からラフに求めた主要被写体の位置(主要被写体候補エリアの位置)を中心とした所定範囲が詳細サーチ範囲に設定される。ラフに求めた主要被写体の位置の周囲に詳細サーチ範囲を限定することにより、効率よく主要被写体を検出することができる。
また、本発明によれば、画像解析により主要被写体の詳細な位置が検出されると、検出された主要被写体の位置にフォーカスエリアが設定されて、いわゆるコントラスト方式の測距が行われる。この際、主要被写体候補エリアの合焦位置を基準に検出範囲(撮像光学系の焦点変化させる範囲)が設定され、その検出範囲で画像のコントラストが極大となる位置が検出される。この検出によって、コントラストが極大となる位置が検出されない場合、主要被写体候補エリアの中心が主要被写体の位置とされる。これにより、画像解析により求めた主要被写体の位置が、ラフに求めた主要被写体の位置(主要被写体候補エリアの位置)からズレてしまった場合であっても、主要被写体の位置が大きく外れるのを防止することができる。
According to the present invention, first, the position of the main subject is roughly detected by multi-point distance measurement, and then the image analysis is performed based on the position of the main subject roughly detected to detect the position of the main subject. Is done. As a result, even when the main subject exists outside the center, the position of the main subject can be accurately detected. Further, the position of the main subject can be efficiently detected by first determining the position of the main subject roughly and then detecting in detail.
In addition, according to the present invention, the range for detecting the main subject in detail by image analysis based on the position of the main subject (position of the main subject candidate area) roughly obtained from the result of multipoint ranging (reference) Detailed search range) is set. As a result, the range of image analysis is limited, and the main subject can be detected efficiently.
Further, according to the present invention, a predetermined range centered on the position of the main subject (position of the main subject candidate area) roughly obtained from the result of multipoint ranging is set as the detailed search range. By limiting the detailed search range around the position of the main subject obtained roughly, the main subject can be detected efficiently.
Further, according to the present invention, when the detailed position of the main subject is detected by image analysis, a focus area is set at the detected position of the main subject, and so-called contrast-type distance measurement is performed. At this time, a detection range (a range in which the focus of the imaging optical system is changed) is set based on the in-focus position of the main subject candidate area, and a position where the contrast of the image is maximized is detected in the detection range. Then, the difference between the subject distance obtained from the distance measurement result and the subject distance of the main subject candidate area is obtained. As a result, when the obtained difference is equal to or smaller than a preset threshold value, the position of the main subject obtained by image analysis as it is is set as the position of the main subject. On the other hand, if the obtained value exceeds the threshold value, the center of the main subject candidate area is set as the position of the main subject. As a result, even if the position of the main subject obtained by image analysis deviates from the position of the main subject roughly obtained (position of the main subject candidate area), the position of the main subject is greatly deviated. Can be prevented.
According to a second aspect of the present invention, in order to achieve the object, the main subject position correcting means determines the position of the main subject even when the distance measuring means cannot detect the position where the contrast is maximum. The imaging apparatus according to claim 1, wherein the imaging apparatus is corrected to the center of the candidate area.
According to the present invention, the center of the main subject candidate area can be obtained even when the position where the contrast becomes maximum when the detailed position of the main subject obtained by image analysis is set as the focus area and the distance is measured by the contrast method is not detected. Is the position of the main subject. As a result, even if the position of the main subject obtained by image analysis deviates from the position of the main subject roughly obtained (position of the main subject candidate area), the position of the main subject is greatly deviated. Can be prevented.
In order to achieve the above object, the invention according to claim 3 divides an imaging optical system, an imaging unit that captures an image through the imaging optical system, and an imaging area of the imaging unit into a plurality of ranging areas. And a multi-point distance measuring means for measuring a subject distance in each distance measuring area, and a distance measuring area estimated to belong to the main subject is detected as a main subject candidate area based on the measurement result of the multi-point distance measuring means. The main subject candidate area detection means for detecting the subject distance of each distance measurement area with a greater weight for the distance measurement area closer to the center of the screen and the subject distance of each distance measurement area with a greater weight for the shorter distance. The main subject candidate area detecting means for adding the weighted value to the numerical value to determine the main subject-likeness of each distance measurement area and selecting the distance measurement area having the maximum value as the main subject candidate area; Detailed search range setting means for setting a specific range centered on the center of the main subject candidate area as a detailed search range, and an image captured by the imaging means is analyzed within the detailed search range to determine the position of the main subject. A main subject position detecting means for detecting the focus, a focus area setting means for setting a focus area at the position of the main subject detected by the main subject position detecting means, and a predetermined range before and after the focus position of the main subject candidate area. A distance measuring unit that detects a position where the contrast of an image obtained from the imaging unit is maximized in the focus area by changing a focal position of the imaging optical system, and measures a subject distance in the focus area; If the position where the contrast is maximum is not detected as a result of the measurement by the distance measuring means, To provide an imaging apparatus characterized by comprising a, a main object position correction means for correcting the center of the main subject candidate area the position of the main subject.
According to the present invention, first, the position of the main subject is roughly detected by multi-point distance measurement, and then the image analysis is performed based on the position of the main subject roughly detected to detect the position of the main subject. Is done. As a result, even when the main subject exists outside the center, the position of the main subject can be accurately detected. Further, the position of the main subject can be efficiently detected by first determining the position of the main subject roughly and then detecting in detail.
In addition, according to the present invention, the range for detecting the main subject in detail by image analysis based on the position of the main subject (position of the main subject candidate area) roughly obtained from the result of multipoint ranging (reference) Detailed search range) is set. As a result, the range of image analysis is limited, and the main subject can be detected efficiently.
Further, according to the present invention, a predetermined range centered on the position of the main subject (position of the main subject candidate area) roughly obtained from the result of multipoint ranging is set as the detailed search range. By limiting the detailed search range around the position of the main subject obtained roughly, the main subject can be detected efficiently.
Further, according to the present invention, when the detailed position of the main subject is detected by image analysis, a focus area is set at the detected position of the main subject, and so-called contrast-type distance measurement is performed. At this time, a detection range (a range in which the focus of the imaging optical system is changed) is set based on the in-focus position of the main subject candidate area, and a position where the contrast of the image is maximized is detected in the detection range. If the position where the contrast is maximized is not detected by this detection, the center of the main subject candidate area is set as the position of the main subject. As a result, even if the position of the main subject obtained by image analysis deviates from the position of the main subject roughly obtained (position of the main subject candidate area), the position of the main subject is greatly deviated. Can be prevented.

なお、被写体距離の情報は、必ずしも距離情報そのものである必要はなく、画面内に存在する被写体の光軸方向の前後の位置関係が分かる情報、すなわち、被写体距離に相当する量の情報が取得できればよい。したがって、たとえば、コントラスト方式で測距した場合には、コントラストが極大になったとき(焦点評価値が極大(ピーク)になったとき)のフォーカスレンズの位置情報や、コントラストが極大になったときのフォーカスレンズの基準点からの移動量(パルス駆動時にはパルス数)等を被写体距離の情報(被写体距離に相当する量の情報)として利用することができ、この情報を利用して、主要被写体候補を推定することができる。   Note that the subject distance information does not necessarily need to be the distance information itself, and can be obtained as long as the information indicating the positional relationship of the subject existing in the screen in the optical axis direction, that is, the amount of information corresponding to the subject distance can be acquired. Good. Therefore, for example, when the distance is measured by the contrast method, the position information of the focus lens when the contrast becomes maximum (when the focus evaluation value becomes maximum (peak)) or the contrast becomes maximum The amount of movement of the focus lens from the reference point (number of pulses when driving a pulse) can be used as subject distance information (amount information corresponding to subject distance). Can be estimated.

請求項2に係る発明は、前記目的を達成するために、前記主要被写体候補エリア検出手段は、各測距エリアの被写体距離若しくは被写体距離に相当する量と画面内の位置とに対して、それぞれ重み付けして加算することにより、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定することを特徴とする請求項1に記載の撮像装置を提供する。
請求項3に係る発明は、前記目的を達成するために、前記主要被写体候補エリア検出手段は、「画面の中心に近いほど主要被写体らしい」、「近距離であるほど主要被写体らしい」という2つの仮説をベースに、各測距エリアの被写体距離若しくは被写体距離に相当する量と画面内の位置とに対して、それぞれ重み付けして加算することにより、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定することを特徴とする請求項2に記載の撮像装置を提供する。
請求項4に係る発明は、前記目的を達成するために、前記主要被写体位置検出手段は、前記詳細サーチ範囲内で、主要被写体らしさの最も大きいところを主要被写体の位置として検出する請求項1から3のいずれか1項に記載の撮像装置を提供する。
請求項5に係る発明は、前記目的を達成するために、前記主要被写体位置検出手段は、前記詳細サーチ範囲内を中央から外側に向かってサーチし、主要被写体らしさの評価値が、閾値を超えた時点の位置を主要被写体の位置として検出する請求項1から3のいずれか1項に記載の撮像装置を提供する。
In the invention according to claim 2, in order to achieve the object , the main subject candidate area detecting means is configured so that the subject distance in each distance measuring area or the amount corresponding to the subject distance and the position in the screen are respectively 2. The imaging apparatus according to claim 1, wherein the main subject likelihood of each ranging area is digitized by weighting and adding, and the ranging area having the maximum numeric value is selected as the main subject candidate area. provide.
In order to achieve the above object, the main subject candidate area detecting means has two main subjects: “the closer to the center of the screen, the more likely the main subject” and “the closer the distance, the more likely the main subject”. Based on the hypothesis, the object distance of each distance measurement area or the amount corresponding to the object distance and the position in the screen are weighted and added, respectively, to quantify the main object-likeness of each distance measurement area, 3. The imaging apparatus according to claim 2, wherein a distance measuring area having a maximum numerical value is selected as a main subject candidate area.
According to a fourth aspect of the present invention, in order to achieve the above object, the main subject position detecting means detects a position where the main subject is most likely as the position of the main subject within the detailed search range. An imaging apparatus according to any one of 3 is provided.
In the invention according to claim 5, in order to achieve the object, the main subject position detecting means searches the detailed search range from the center toward the outside, and the evaluation value of the main subjectness exceeds a threshold value. The imaging device according to any one of claims 1 to 3, wherein a position at a certain time point is detected as a position of a main subject.

請求項6に係る発明は、前記目的を達成するために、前記詳細サーチ範囲設定手段は、前記多点測距手段によって得られる前記各測距エリアの被写体距離を比較したときに、前記主要被写体候補エリアの被写体距離との差が閾値以上の測距エリアを除外して、前記詳細サーチ範囲を設定することを特徴とする請求項1から5のいずれか1項に記載の撮像装置を提供する。 The invention according to claim 6, in order to achieve the above object, the detailed search range setting means, when comparing the object distance of each ranging area obtained by the multi-point distance measuring means, the primary subject difference of the subject distance Metropolitan candidate areas by excluding or more ranging areas threshold, the imaging apparatus according to any one of claims 1 to 5, characterized in that setting the fine search range provide.

詳細サーチ範囲内で主要被写体の位置を詳細に検出する際、たとえば、エッジ成分の多さを指標として主要被写体の位置を検出すると、背景のエッジ成分につられて、背景のオブジェクトの位置が主被写体と認識されてしまう場合がある。そこで、多点測距の結果を利用し、主要被写体候補エリアの被写体距離と被写体距離の遠いエリアを詳細サーチ範囲の対象外とする。これにより、さらに正確に主要被写体の位置を検出することができる。   When detecting the position of the main subject in detail within the detailed search range, for example, if the position of the main subject is detected using the number of edge components as an index, the position of the background object is determined by the background edge component. May be recognized. Therefore, by using the result of multipoint distance measurement, the subject distance of the main subject candidate area and the area with a far subject distance are excluded from the detailed search range. Thereby, the position of the main subject can be detected more accurately.

請求項7に係る発明は、前記目的を達成するために、前記多点測距手段は、前記撮像光学系の焦点位置を変化させて、前記測距エリアごとに前記撮像手段から得られる画像のコントラストが極大となる位置を検出することにより、前記各測距エリアにおける被写体距離を測定し、前記詳細サーチ範囲設定手段は、前記コントラストが極大となる位置が2以上検出された測距エリアを除外して、前記詳細サーチ範囲を設定することを特徴とする請求項1から6のいずれか1項に記載の撮像装置を提供する。 In the invention according to claim 7, in order to achieve the object, the multipoint ranging means changes the focal position of the imaging optical system, and the image obtained from the imaging means for each ranging area. by detecting the position at which the contrast becomes the maximum, the measured subject distance in each ranging area, the detailed search range setting means, a distance measurement area whose position is detected two or more of the contrast becomes the maximum The imaging apparatus according to claim 1, wherein the detailed search range is set by excluding the imaging apparatus.

いわゆるコントラスト方式で多点測距すると、コントラストが極大となる位置が2以上検出される場合がある。このようにコントラストが極大となる位置が2以上検出されたエリアに対して、たとえば、エッジ成分の多さを指標として主要被写体の位置を検出すると、背景のエッジ成分につられて、背景のオブジェクトの位置が主被写体と認識されてしまう場合がある。そこで、多点測距の結果、コントラストが極大となる位置が2以上検出されたエリアを詳細サーチ範囲の対象外とする。これにより、さらに正確に主要被写体の位置を検出することができる。   When multipoint distance measurement is performed using a so-called contrast method, two or more positions where the contrast becomes maximum may be detected. For example, when the position of the main subject is detected using the number of edge components as an index in an area in which two or more positions where the contrast is maximized is detected, the background edge component causes the background object to be detected. The position may be recognized as the main subject. Therefore, an area in which two or more positions where the contrast becomes maximum is detected as a result of multipoint distance measurement is excluded from the detailed search range. Thereby, the position of the main subject can be detected more accurately.

請求項8に係る発明は、前記目的を達成するために、前記詳細サーチ範囲設定手段は、前記主要被写体候補エリアの被写体距離に応じて前記詳細サーチ範囲の大きさを拡縮して設定することを特徴とする請求項1から5のいずれか1項に記載の撮像装置を提供する。 The invention according to claim 8, in order to achieve the above object, the detailed search range setting means may be set by scaling the magnitude of the detailed search range according to the object distance of the main subject candidate areas An imaging device according to any one of claims 1 to 5 is provided.

本発明によれば、主要被写体候補エリアの被写体距離に応じて詳細サーチ範囲の大きさが拡縮して設定される。一般に、主要被写体は、その位置が撮像装置に近いほど、画面内に大きく写されていると考えられる。したがって、主要被写体候補エリアの被写体距離が近距離側であるほど詳細サーチ範囲の大きさが大きくなるように設定される。すなわち、画面内に写っている主要被写体の大きさに応じて詳細サーチ範囲が設定される。これにより、正確で無駄のない詳細サーチを行うことができる。   According to the present invention, the size of the detailed search range is set to be enlarged or reduced according to the subject distance of the main subject candidate area. In general, it is considered that the main subject is shown larger on the screen as its position is closer to the imaging device. Therefore, the detail search range is set to be larger as the subject distance of the main subject candidate area is closer. That is, the detailed search range is set according to the size of the main subject shown in the screen. As a result, an accurate and lean detailed search can be performed.

請求項に係る発明は、前記目的を達成するために、前記撮像光学系は、変倍光学系を備え、前記詳細サーチ範囲設定手段は、前記撮像光学系の焦点距離に応じて前記詳細サーチ範囲の大きさを拡縮して設定することを特徴とする請求項1から5のいずれか1項に記載の撮像装置を提供する。 According to a ninth aspect of the invention, in order to achieve the object, the imaging optical system includes a variable magnification optical system, and the detailed search range setting means is configured to perform the detailed search according to a focal length of the imaging optical system. It is set by scaling a range of a size to provide an imaging apparatus according to any one of claims 1 to 5, characterized in.

本発明によれば、主要被写体候補エリアの焦点距離(ズーム倍率)に応じて詳細サーチ範囲の大きさが拡縮して設定される。一般に、主要被写体は、ズームがテレ側(望遠側)に設定されているほど、画面内に大きく写されていると考えられる。したがって、焦点距離が長いほど(ズームがテレ側(望遠側))であるほど詳細サーチ範囲の大きさが大きくなるように設定される。すなわち、画面内に写っている主要被写体の大きさに応じて詳細サーチ範囲が設定される。これにより、正確で無駄のない詳細サーチを行うことができる。   According to the present invention, the size of the detailed search range is set to be enlarged or reduced in accordance with the focal length (zoom magnification) of the main subject candidate area. In general, it is considered that the main subject is shown larger on the screen as the zoom is set to the tele side (telephoto side). Accordingly, the size of the detailed search range is set to be larger as the focal length is longer (zoom is on the telephoto side (telephoto side)). That is, the detailed search range is set according to the size of the main subject shown in the screen. As a result, an accurate and lean detailed search can be performed.

請求項10に係る発明は、前記目的を達成するために、前記主要被写体位置検出手段は、画像特性として、エッジ成分の多さ、又は、同色系の塊の大きさの少なくとも一方の情報を利用して、主要被写体を検出することを特徴とする請求項1からのいずれか1項に記載の撮像装置を提供する。 According to a tenth aspect of the present invention, in order to achieve the object, the main subject position detecting means uses at least one of information on the number of edge components or the size of a lump of the same color system as an image characteristic. Then, the main subject is detected, and the imaging apparatus according to any one of claims 1 to 9 is provided.

本発明によれば、画像特性として、エッジ成分の多さ、又は、同色系の塊の大きさの少なくとも一方の情報を利用して、主要被写体が検出される。すなわち、エッジ成分の多さや、同色系のかたまり大きさなどが、主被写体らしさの評価の指標とされる。   According to the present invention, the main subject is detected using information on at least one of the number of edge components and the size of the same color system as the image characteristics. That is, the number of edge components, the size of the same color system, and the like are used as indices for evaluating the main subjectness.

請求項11に係る発明は、前記目的を達成するために、撮像光学系を介して画像を撮像する撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距するステップと、前記多点測距の結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出するステップであって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定するステップと、前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定するステップと、前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出するステップと、検出された主要被写体の位置にフォーカスエリアを設定するステップと、前記主要被写体候補エリアの合焦位置を基準に一定範囲で検出範囲を設定し、該検出範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定するステップと、測定された被写体距離と前記主要被写体候補エリアの被写体距離との差を求め、その差が閾値を超えている場合に前記主要被写体の位置を前記主要被写体候補エリアの中心に修正するステップと、からなることを特徴とする主要被写体検出方法を提供する。
請求項12に係る発明は、前記目的を達成するために、撮像光学系を介して画像を撮像する撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距するステップと、前記多点測距の結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出するステップであって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定するステップと、前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定するステップと、前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出するステップと、検出された主要被写体の位置にフォーカスエリアを設定するステップと、前記主要被写体候補エリアの合焦位置の前後所定範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定するステップと、測定の結果、前記コントラストが最大となる位置が検出されない場合、前記主要被写体の位置を前記主要被写体候補エリアの中心に修正するステップと、からなることを特徴とする主要被写体検出方法を提供する。
The invention according to claim 11, in order to achieve the object, dividing the imaging region of the imaging means for capturing an image into a plurality of distance measurement areas through the imaging optical system, the object distance in each ranging area A step of measuring multiple points, and a step of detecting, as a main subject candidate area, a range finding area estimated to belong to a main subject based on the result of the multipoint ranging, Add the value weighted with greater weight to the distance measurement area closer to the center of the screen and the value weighted with greater weight to the subject distance in each distance measurement area. Quantify the subject likeness, select the distance measurement area with the maximum value as the main subject candidate area, and set a certain range centered on the center of the main subject candidate area as the detailed search range That the method analyzes the image captured in the detailed search range by the imaging means, and detecting a position of the main subject, and setting a focus area on the detected position of the main subject, the By setting a detection range within a certain range with reference to the in-focus position of the main subject candidate area, and changing the focal position of the imaging optical system within the detection range, the image obtained from the imaging means in the focus area The step of detecting the position where the contrast is maximized and measuring the subject distance of the focus area and the difference between the measured subject distance and the subject distance of the main subject candidate area are obtained, and the difference exceeds the threshold value. and correcting the position of the main object in the center of the main subject candidate area when mainly characterized in that it consists Providing an object detection method.
In order to achieve the above object, the invention according to claim 12 divides the imaging area of the imaging means for imaging an image via an imaging optical system into a plurality of ranging areas, and measures the subject distance in each ranging area. A step of performing multipoint ranging, and a step of detecting, as a main subject candidate area, a ranging area estimated to belong to a main subject based on a result of the multipoint ranging, wherein the subject of each ranging area Add the value weighted with a greater weight to the distance measurement area closer to the center of the screen and the value weighted with the greater weight the subject distance of each distance measurement area to the main subject of each distance measurement area. Quantifying the likelihood, selecting the ranging area with the maximum numerical value as the main subject candidate area, and setting a certain range centered on the center of the main subject candidate area as the detailed search range Analyzing the image captured by the imaging means within the detailed search range to detect the position of the main subject; setting the focus area at the detected position of the main subject; By changing the focal position of the imaging optical system within a predetermined range before and after the in-focus position of the main subject candidate area, the position where the contrast of the image obtained from the imaging means is maximized is detected in the focus area, Measuring the subject distance of the focus area, and correcting the position of the main subject to the center of the main subject candidate area when the position where the contrast is maximized is not detected as a result of the measurement. A main subject detection method is provided.

本発明によれば、中央以外に主要被写体が存在している場合であっても、精度よく主要被写体の位置を検出できる。   According to the present invention, the position of the main subject can be detected with high accuracy even when the main subject exists outside the center.

本発明が適用されたデジタルカメラの一例を示す外観図1 is an external view showing an example of a digital camera to which the present invention is applied. 本発明が適用されたデジタルカメラの一例を示す外観図1 is an external view showing an example of a digital camera to which the present invention is applied. デジタルカメラの機能構成を示すブロック図Block diagram showing functional configuration of digital camera AF処理部の機能構成を示すブロック図Block diagram showing functional configuration of AF processing unit 測距エリアの分割例を示す図Figure showing an example of dividing the ranging area コンティニュアスAFの概念図Conceptual diagram of continuous AF 第1の方法による主要被写体の検出処理の概念図Conceptual diagram of main subject detection processing by the first method 第1の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects the main subject by the 1st method. 第2の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects a main subject by the 2nd method. エッジ成分の多さを指標として主要被写体を検出する場合の説明図Explanatory drawing when detecting the main subject using the number of edge components as an index 第3の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects a main subject by the 3rd method. 第3の方法により主要被写体を検出する場合の説明図Explanatory drawing when a main subject is detected by the third method 焦点評価値が距離情報に対して二重のピークを持つ場合の説明図Explanatory drawing when focus evaluation value has double peak for distance information 第4の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects the main subject by the 4th method. 第4の方法により主要被写体を検出する場合の説明図Explanatory drawing when a main subject is detected by the fourth method 第5の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects the main subject by the 5th method. 第5の方法により主要被写体を検出する場合の説明図Explanatory drawing when a main subject is detected by the fifth method 第6の方法により主要被写体を検出する場合の説明図Explanatory drawing when a main subject is detected by the sixth method 第6の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects a main subject by the 6th method. 第7の方法により主要被写体を検出する場合の説明図Explanatory drawing when a main subject is detected by the seventh method 第7の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects a main subject by the 7th method. 第8の方法により主要被写体を検出する処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which detects the main subject by the 8th method. 第8の方法により主要被写体を検出する場合の説明図Explanatory drawing when a main subject is detected by the eighth method 本撮影前に行われるコンティニュアスAFの状態遷移図State transition diagram of continuous AF performed before actual shooting 本撮影前に行われるコンティニュアスAFの処理の手順を示すフローチャートFlowchart showing the procedure of continuous AF processing performed before the main photographing 主要被写体検出時のモニタの表示例の説明図Illustration of monitor display example when main subject is detected ライブビュー中に検出した主要被写体にフォーカスエリアを設定する処理の手順を示すフローチャートFlow chart showing the procedure for setting the focus area for the main subject detected during live view 本撮影までの処理の手順を示すフローチャートFlow chart showing the procedure of processing up to the actual shooting 自動追尾機能の説明図Illustration of automatic tracking function ライブビュー中に検出した主要被写体の位置を自動追尾の対象に設定する処理の手順を示すフローチャートFlow chart showing the procedure of processing for setting the position of the main subject detected during live view as the target of automatic tracking

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

≪全体構成≫
図1、2は、本発明が適用されたデジタルカメラの一例を示す外観図である。
≪Overall structure≫
1 and 2 are external views showing an example of a digital camera to which the present invention is applied.

同図に示すように、このデジタルカメラ10は、いわゆるコンパクトタイプのデジタルカメラである。   As shown in the figure, the digital camera 10 is a so-called compact type digital camera.

前後方向の厚みの薄い矩形の箱状に形成されたカメラボディ12の正面には、撮影レンズ14、フラッシュ16等が配置されている。また、上面には、レリーズボタン18、ズームレバー20、電源ボタン22等が配置されており、背面には、モニタ24、メニュー/OKボタン26、十字ボタン28、Backボタン30、再生ボタン32等が配置されている。   On the front surface of the camera body 12 formed in a rectangular box shape with a small thickness in the front-rear direction, a photographing lens 14, a flash 16, and the like are arranged. Also, a release button 18, a zoom lever 20, a power button 22 and the like are arranged on the top surface, and a monitor 24, a menu / OK button 26, a cross button 28, a Back button 30, a playback button 32 and the like are arranged on the back surface. Has been placed.

撮影レンズ14は、沈胴式のズームレンズで構成され、デジタルカメラ10の電源をONすると、カメラボディ12から繰り出される。   The photographic lens 14 is a retractable zoom lens, and is fed out from the camera body 12 when the digital camera 10 is turned on.

フラッシュ16は、たとえば、キセノン管で構成され、必要に応じて発光される。   The flash 16 is composed of, for example, a xenon tube, and emits light as necessary.

レリーズボタン18は、いわゆる「半押し」と「全押し」が可能な2段階式の押下ボタンで構成される。このレリーズボタン18が半押しされると、デジタルカメラ10に撮影準備の指示(S1)が入力され、全押しされると、本撮影の指示(S2)が入力される。   The release button 18 is constituted by a two-stage press button that can perform so-called “half press” and “full press”. When the release button 18 is half-pressed, a shooting preparation instruction (S1) is input to the digital camera 10, and when it is fully pressed, a main shooting instruction (S2) is input.

ズームレバー20は、レリーズボタン18の周りを左右に揺動可能に設けられている。このズームレバー20が、一方に操作されると、デジタルカメラ10にテレ方向のズーム指示が入力され、他向に操作されると、ワイド方向のズーム指示が入力される。   The zoom lever 20 is provided so as to be swingable left and right around the release button 18. When the zoom lever 20 is operated in one direction, a zoom instruction in the tele direction is input to the digital camera 10, and when it is operated in the other direction, a zoom instruction in the wide direction is input.

電源ボタン22は、押下ボタンで構成される。デジタルカメラ10の電源がOFFの状態で、この電源ボタン22が押下されると、デジタルカメラ10の電源がONになる。また、デジタルカメラ10の電源がONの状態で、この電源ボタン22が一定時間押下されると、デジタルカメラ10の電源がOFFになる。   The power button 22 is a push button. When the power button 22 is pressed while the digital camera 10 is turned off, the digital camera 10 is turned on. In addition, when the power button 22 is pressed for a predetermined time while the power of the digital camera 10 is on, the power of the digital camera 10 is turned off.

モニタ24は、たとえば、液晶ディスプレイで構成される。本実施の形態のデジタルカメラ10は、光学ファインダを備えていないため、このモニタ24が電子ファインダ(ライブビューモニタ)として使用される。すなわち、撮影時には、このモニタ24に撮像素子で捉えた画像がリアルタイムに表示される。撮影者は、このモニタ24にリアルタイムに表示される画像(スルー画像)を見て、ピント状態や構図等を確認する。また、このモニタ24は、撮影された画像(撮影済み画像)の再生に使用されるほか、デジタルカメラ10の各種設定時には、設定画面として使用される。   The monitor 24 is composed of a liquid crystal display, for example. Since the digital camera 10 of the present embodiment does not include an optical viewfinder, the monitor 24 is used as an electronic viewfinder (live view monitor). That is, at the time of photographing, an image captured by the image sensor is displayed on the monitor 24 in real time. The photographer looks at an image (through image) displayed in real time on the monitor 24 and confirms the focus state, composition, and the like. The monitor 24 is used for reproducing a captured image (photographed image), and is used as a setting screen for various settings of the digital camera 10.

メニュー/OKボタン26は、メニュー画面の呼び出しを指示する操作ボタンとして機能するとともに、確定を指示するボタンとして機能する。   The menu / OK button 26 functions as an operation button for instructing to call a menu screen and also functions as a button for instructing confirmation.

十字ボタン28は、上下左右の4方向に押下操作可能に設けられており、そのときのデジタルカメラ10の状態に応じた機能が割り当てられる。たとえば、撮影モード時には、右ボタンにマクロ機能の切り替えが割り当てられ、左ボタンにストロボモードの切り替えの機能が割り当てられる。また、再生モード時には、右ボタンに1コマ送りの機能が割り当てられ、左ボタンに1コマ戻しの機能が割り当てられる。   The cross button 28 is provided so that it can be pressed in four directions, up, down, left, and right, and a function corresponding to the state of the digital camera 10 at that time is assigned. For example, in the shooting mode, a macro function switching is assigned to the right button, and a strobe mode switching function is assigned to the left button. In the playback mode, the right button is assigned a frame advance function, and the left button is assigned a frame reverse function.

Backボタン30は、入力した操作情報等のキャンセルを指示するボタンとして機能し、再生ボタン32は、再生モードへ切り替えを指示するボタンとして機能する。   The Back button 30 functions as a button for instructing cancellation of input operation information and the like, and the playback button 32 functions as a button for instructing switching to the playback mode.

図3は、デジタルカメラ10の機能構成を示すブロック図である。   FIG. 3 is a block diagram illustrating a functional configuration of the digital camera 10.

同図に示すように、デジタルカメラ10は、撮影レンズ14、レンズ駆動部50、フラッシュ16、フラッシュ制御部52、撮像素子54、CCD制御部56、アナログ信号処理部58、タイミングジェネレータ60、画像入力コントローラ62、AF処理部64、AE/AWB処理部66、画像処理部68、顔検出部70、圧縮/伸張処理部72、フレームメモリ74、メディア制御部76、記録メディア78、表示制御部80、モニタ24、操作部(レリーズボタン18、ズームレバー20、電源ボタン22、メニュー/OKボタン26、十字ボタン28、Backボタン30、再生ボタン32等)82、操作系制御部84、主要被写体候補エリア検出部86、主要被写体検出部88、CPU90、EEPROM92等を備えて構成される。   As shown in the figure, the digital camera 10 includes a photographing lens 14, a lens driving unit 50, a flash 16, a flash control unit 52, an image sensor 54, a CCD control unit 56, an analog signal processing unit 58, a timing generator 60, an image input. Controller 62, AF processing unit 64, AE / AWB processing unit 66, image processing unit 68, face detection unit 70, compression / decompression processing unit 72, frame memory 74, media control unit 76, recording medium 78, display control unit 80, Monitor 24, operation unit (release button 18, zoom lever 20, power button 22, menu / OK button 26, cross button 28, back button 30, play button 32, etc.) 82, operation system control unit 84, main subject candidate area detection Unit 86, main subject detection unit 88, CPU 90, EEPROM 92, and the like. .

撮影レンズ14は、フォーカスレンズ110、ズームレンズ112、絞り114、シャッタ116を備えて構成される。フォーカスレンズ110とズームレンズ112は、互いに光軸に沿って前後移動可能に設けられている。フォーカスレンズ110を移動させることにより焦点調節(フォーカシング)が行われ、ズームレンズ112を移動させることにより変倍調整(ズーミング)が行われる。   The photographing lens 14 includes a focus lens 110, a zoom lens 112, a diaphragm 114, and a shutter 116. The focus lens 110 and the zoom lens 112 are provided to be movable back and forth along the optical axis. The focus adjustment (focusing) is performed by moving the focus lens 110, and the zooming adjustment (zooming) is performed by moving the zoom lens 112.

絞り114は、たとえば、光彩絞りで構成され、撮像素子54への入射光量を調整する。   The diaphragm 114 is composed of, for example, a luminous diaphragm, and adjusts the amount of light incident on the image sensor 54.

シャッタ116は、メカニカルシャッタで構成され、撮像素子54への光の入射を遮光する。   The shutter 116 is configured by a mechanical shutter, and blocks light from entering the image sensor 54.

レンズ駆動部50は、フォーカスレンズ110を駆動するフォーカスレンズ駆動部120、ズームレンズ112を駆動するズームレンズ駆動部122、絞り114を駆動する絞り駆動部124、シャッタ116を駆動するシャッタ駆動部126とで構成される。   The lens driving unit 50 includes a focus lens driving unit 120 that drives the focus lens 110, a zoom lens driving unit 122 that drives the zoom lens 112, an aperture driving unit 124 that drives the diaphragm 114, and a shutter driving unit 126 that drives the shutter 116. Consists of.

フォーカスレンズ駆動部120は、モータとモータドライバからなり、CPU90からの指令に応じて、フォーカスレンズ110をステップ駆動し、フォーカスレンズ110を光軸に沿って前後移動させる。   The focus lens driving unit 120 includes a motor and a motor driver, and step-drives the focus lens 110 in accordance with a command from the CPU 90 to move the focus lens 110 back and forth along the optical axis.

ズームレンズ駆動部122は、モータとモータドライバからなり、CPU90からの指令に応じて、ズームレンズ112をステップ駆動し、ズームレンズ112を光軸に沿って前後移動させる。   The zoom lens driving unit 122 includes a motor and a motor driver. The zoom lens driving unit 122 drives the zoom lens 112 stepwise in accordance with a command from the CPU 90 and moves the zoom lens 112 back and forth along the optical axis.

絞り駆動部124は、モータとモータドライバとからなり、CPU90からの指令に応じて、絞り114をステップ駆動し、その絞り径を拡縮させる。   The aperture driving unit 124 includes a motor and a motor driver, and step-drives the aperture 114 in accordance with a command from the CPU 90 to expand or contract the aperture diameter.

シャッタ駆動部126は、モータとモータドライバとからなり、CPU90からの指令に応じて、シャッタ116を開閉させる。   The shutter driving unit 126 includes a motor and a motor driver, and opens and closes the shutter 116 according to a command from the CPU 90.

フラッシュ制御部52は、CPU90からの指令に応じて、フラッシュ16の発光動作を制御する。   The flash controller 52 controls the light emission operation of the flash 16 in accordance with a command from the CPU 90.

撮像素子54は、撮影レンズ14の後方に配置され、撮影レンズ14で捉えた画像を撮像する。撮像素子54は、たとえば、所定のカラーフィルタ配列のカラーCCDで構成される(以下、CCDという)。CCD54は、CCD制御部56から供給される垂直転送クロック信号及び水平転送クロック信号に同期して、各画素に蓄積された電荷を1ラインずつシリアルのアナログ画像データとして出力する。   The imaging element 54 is disposed behind the photographing lens 14 and captures an image captured by the photographing lens 14. The image sensor 54 is constituted by, for example, a color CCD having a predetermined color filter array (hereinafter referred to as a CCD). The CCD 54 outputs the charges accumulated in each pixel as serial analog image data line by line in synchronization with the vertical transfer clock signal and horizontal transfer clock signal supplied from the CCD controller 56.

CCD制御部56は、CPU90からの指令に応じて、CCD54の駆動を制御する。   The CCD controller 56 controls the drive of the CCD 54 in accordance with a command from the CPU 90.

アナログ信号処理部58は、CCD54から出力されるアナログの画像データを取り込み、所要のアナログ信号処理(相関二重サンプリング処理、ゲイン調整等)を施したのち、デジタルの画像データ(画素ごとにRGBの濃度値を持つCCD−RAWデータ)に変換して出力する。   The analog signal processing unit 58 takes in analog image data output from the CCD 54, performs necessary analog signal processing (correlated double sampling processing, gain adjustment, etc.), and then performs digital image data (RGB for each pixel). CCD-RAW data having density values) and output.

タイミングジェネレータ60は、CPU90からの指令に応じて、所定のタイミング信号を発生させ、シャッタ駆動部126、CCD制御部56、アナログ信号処理部58に出力する。各部は、このタイミングジェネレータ60から出力されるタイミング信号によって処理の同期が図られる。   The timing generator 60 generates a predetermined timing signal in response to a command from the CPU 90 and outputs it to the shutter driving unit 126, the CCD control unit 56, and the analog signal processing unit 58. Processing of each unit is synchronized by a timing signal output from the timing generator 60.

画像入力コントローラ62は、アナログ信号処理部58から出力されたデジタルの画像データ(CCD−RAWデータ)を取り込み、フレームメモリ74に書き込む。   The image input controller 62 takes in digital image data (CCD-RAW data) output from the analog signal processing unit 58 and writes it into the frame memory 74.

フレームメモリ74は、CCD54から取り込んだ画像データ(CCD−RAWデータ)の格納領域として使用されるほか、各種処理を行う際の作業領域として使用される。   The frame memory 74 is used as a storage area for image data (CCD-RAW data) captured from the CCD 54, and is also used as a work area when performing various processes.

AF処理部64は、CCD54で撮像された画像データ(CCD−RAWデータ)に基づいて、焦点位置を検出する。このAF処理部64については、のちに詳述する。   The AF processing unit 64 detects a focal position based on image data (CCD-RAW data) captured by the CCD 54. The AF processing unit 64 will be described in detail later.

AE/AWB処理部66は、CCD54で撮像された画像データ(CCD−RAWデータ)に基づいて、被写体輝度を測定し、露出値(絞り値、シャッタ速度、ISO感度等)を決定する。また、CCD54で撮像された画像に基づいて、光源種を検出し、ホワイトバランス補正値を決定する。   The AE / AWB processing unit 66 measures subject brightness based on image data (CCD-RAW data) captured by the CCD 54, and determines an exposure value (aperture value, shutter speed, ISO sensitivity, etc.). Further, based on the image captured by the CCD 54, the light source type is detected and the white balance correction value is determined.

画像処理部68は、CCD54で撮像された画像(CCD−RAWデータ)に対して、所要のデジタル信号処理を施し、輝度データと色差データとからなるYCrCbの画像データを生成する。生成されたYCrCbの画像データは、フレームメモリ74に格納される。   The image processing unit 68 performs necessary digital signal processing on the image captured by the CCD 54 (CCD-RAW data) to generate YCrCb image data composed of luminance data and color difference data. The generated YCrCb image data is stored in the frame memory 74.

顔検出部70は、画像処理部68で生成されたYCrCbの画像データを解析して、人物の顔領域を検出する。   The face detection unit 70 analyzes the YCrCb image data generated by the image processing unit 68 and detects a human face area.

圧縮/伸張処理部72は、画像処理部68で生成されたYCrCbの画像データに対して、所定の圧縮処理(たとえば、JPEG方式による圧縮処理)を施し、圧縮画像データを生成する。また、圧縮画像データに対して所定の伸張処理を施して、非圧縮の画像データ(YCrCbの画像データ)を生成する。   The compression / decompression processing unit 72 performs predetermined compression processing (for example, compression processing by the JPEG method) on the YCrCb image data generated by the image processing unit 68 to generate compressed image data. The compressed image data is subjected to a predetermined expansion process to generate non-compressed image data (YCrCb image data).

メディア制御部76は、CPU90からの指令に応じて、記録メディア78に対してデータの読み出し、書き込みを行う。   The media control unit 76 reads and writes data from and to the recording medium 78 in response to a command from the CPU 90.

記録メディア78は、たとえば、メモリカードで構成され、カメラボディ12に備えられたカードスロットに着脱自在に装着される。なお、記録メディア78は、カメラボディ12に内蔵することもできる。   The recording medium 78 is composed of, for example, a memory card, and is detachably attached to a card slot provided in the camera body 12. The recording medium 78 can also be built in the camera body 12.

表示制御部80は、CPU90からの指令に応じて、モニタ24への表示を制御する。上記のように、本実施の形態のデジタルカメラ10は、撮影時にモニタ24にスルー画像が表示される。表示制御部80は、CCD54から取り込まれ、所要の信号処理が施されて生成されたYCrCbの画像データを取り込み、表示用の信号形式に変換して、モニタ24に出力する。これにより、モニタ24にスルー画像が表示される。また、再生時には、記録メディア78から読み出され、所定の伸張処理が施された画像データを取り込み、表示用の信号形式に変換して、モニタ24に出力する。これにより、撮影済み画像がモニタ24に表示される。   The display control unit 80 controls display on the monitor 24 in response to a command from the CPU 90. As described above, in the digital camera 10 of the present embodiment, a through image is displayed on the monitor 24 at the time of shooting. The display control unit 80 takes in the YCrCb image data taken from the CCD 54 and subjected to necessary signal processing, converts it into a display signal format, and outputs it to the monitor 24. As a result, a through image is displayed on the monitor 24. At the time of reproduction, the image data read from the recording medium 78 and subjected to a predetermined expansion process is taken in, converted into a display signal format, and output to the monitor 24. As a result, the captured image is displayed on the monitor 24.

操作系制御部84は、操作部(レリーズボタン18、ズームレバー20、電源ボタン22、メニュー/OKボタン26、十字ボタン28、Backボタン30、再生ボタン32等)82の操作内容に応じた操作信号をCPU90に出力する。   The operation system control unit 84 is an operation signal corresponding to the operation content of the operation unit (release button 18, zoom lever 20, power button 22, menu / OK button 26, cross button 28, back button 30, play button 32, etc.). Is output to the CPU 90.

主要被写体候補エリア検出部86は、多点測距の結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出する。具体的には、「画面の中心に近いほど主要被写体らしい」、「近距離であるほど主要被写体らしい」という2つの仮説をベースに、各測距エリアの被写体距離と画面内の位置に対して、それぞれ重み付け加算をし、主要被写体らしさを数値化する。そして、その数値が最大となるエリアを主要被写体が属するエリアと認識する。   The main subject candidate area detection unit 86 detects, as a main subject candidate area, a distance measurement area estimated to belong to the main subject based on the result of multipoint ranging. Specifically, based on the two hypotheses: “The closer to the center of the screen, the more likely it is to be the main subject” and “The closer the distance is, the more likely the subject is to be the main subject”. , Each is weighted and added, and the likelihood of the main subject is digitized. Then, the area having the maximum value is recognized as the area to which the main subject belongs.

主要被写体検出部88は、主要被写体候補エリアとして検出された測距エリアの位置を基準に詳細サーチ範囲を設定し、その詳細サーチ範囲内のCCD54から得られる画像を解析し、画像から主要被写体を検出する。具体的には、エッジ成分の多さや、同色系のかたまり大きさなどを主被写体らしさの評価の指標として、画像解析により主要被写体を検出する。   The main subject detection unit 88 sets a detailed search range based on the position of the ranging area detected as the main subject candidate area, analyzes an image obtained from the CCD 54 in the detailed search range, and detects a main subject from the image. To detect. Specifically, the main subject is detected by image analysis using the number of edge components and the size of the same color system as an index for evaluating the likelihood of the main subject.

この主要被写体検出部88による主要被写体の検出処理の手順については、のちに詳述する。   The procedure of main subject detection processing by the main subject detection unit 88 will be described in detail later.

CPU90は、デジタルカメラ10の動作を統括制御する制御手段であり、所定の制御プログラムに従って、デジタルカメラ10の各部を制御する。また、所定の演算処理プログラムに従って、所定の演算処理を実行する。   The CPU 90 is a control unit that performs overall control of the operation of the digital camera 10 and controls each unit of the digital camera 10 according to a predetermined control program. Further, predetermined calculation processing is executed according to a predetermined calculation processing program.

EEPROM92には、CPU90が実行する各種プログラムや制御に必要なデータ等が格納される。   The EEPROM 92 stores various programs executed by the CPU 90, data necessary for control, and the like.

≪基本動作≫
次に、デジタルカメラ10の基本的な撮影、再生動作について説明する。
≪Basic operation≫
Next, basic shooting and playback operations of the digital camera 10 will be described.

デジタルカメラ10は、電源OFFの状態で電源ボタン22を押下すると、撮影モードの状態で起動する。また、電源OFFの状態で再生ボタン32を一定時間押下すると、再生モードの状態で起動する。   When the power button 22 is pressed while the power is off, the digital camera 10 is activated in the shooting mode. Further, when the playback button 32 is pressed for a certain period of time while the power is off, the playback mode is activated.

撮影モードの状態で起動したデジタルカメラ10は、撮影モード中に再生ボタン32を押下すると、再生モードに移行する。また、再生モード中にレリーズボタン18を半押しすると、撮影モードに移行する。   When the digital camera 10 activated in the shooting mode is pressed in the shooting mode, the digital camera 10 shifts to the playback mode. If the release button 18 is pressed halfway during the playback mode, the mode is changed to the shooting mode.

撮影モードに設定されると、スルー画像の表示処理が開始される。スルー画像の表示は、一定のフレームレートで連続的に画像を撮像することにより行われる。この連続的に撮像された画像を連続的に処理して、モニタ24に出力することにより、CCD54で捉えている画像がモニタ24にリアルタイムに表示される。撮影者は、このモニタ24にリアルタイムに表示されるスルー画像を見て、ピント状態や構図等を確認する。   When the shooting mode is set, a through image display process is started. The through image is displayed by continuously capturing images at a constant frame rate. The continuously captured images are continuously processed and output to the monitor 24, whereby the image captured by the CCD 54 is displayed on the monitor 24 in real time. The photographer looks at the through image displayed in real time on the monitor 24 and confirms the focus state, composition, and the like.

本撮影(画像を記録メディア78に記録するための撮影)は、まず、レリーズボタン18を半押しし、その後、レリーズボタン18を全押しすることにより実行される。   The main shooting (shooting for recording an image on the recording medium 78) is performed by first pressing the release button 18 halfway and then pressing the release button 18 fully.

レリーズボタン18を半押しすると、撮影準備が行われ、AE、AF、AWBの各処理が行われる。すなわち、被写体輝度が測定され、露出値(絞り値、シャッタ速度、ISO感度等)が決定されるとともに、光源種が検出され、ホワイトバランス補正値が決定される。また、主要被写体に合焦するように焦点調節が行われる。   When the release button 18 is pressed halfway, preparation for shooting is performed, and AE, AF, and AWB processes are performed. That is, the subject brightness is measured, the exposure value (aperture value, shutter speed, ISO sensitivity, etc.) is determined, the light source type is detected, and the white balance correction value is determined. In addition, focus adjustment is performed so as to focus on the main subject.

この撮影準備後、レリーズボタン18を全押しすると、本撮影が実行される。すなわち、上記のAE処理にて決定した露出値で記録用の撮影が行われる。得られた画像データは、所要の信号処理が施されて、記録メディア78に記録される。   After the preparation for shooting, when the release button 18 is fully pressed, actual shooting is executed. That is, recording for recording is performed with the exposure value determined by the AE process. The obtained image data is subjected to required signal processing and recorded on the recording medium 78.

記録メディア78に記録された画像データは、デジタルカメラ10のモードを再生モードに設定することにより、モニタ24に再生表示することができる。   The image data recorded on the recording medium 78 can be reproduced and displayed on the monitor 24 by setting the mode of the digital camera 10 to the reproduction mode.

再生モードに設定されると、記録メディア78に最後に記録された画像データが読み出され、所要の信号処理が施されて、モニタ24に再生表示される。この後、操作部82において、コマ送り/コマ戻しの操作が行われると、その操作に応じて、順に撮影済み画像が再生表示される。   When the reproduction mode is set, the image data recorded last on the recording medium 78 is read out, subjected to necessary signal processing, and reproduced and displayed on the monitor 24. Thereafter, when an operation for frame advance / frame return is performed on the operation unit 82, captured images are reproduced and displayed in order according to the operations.

≪AF処理部の構成≫
AF処理部64は、画像入力コントローラ62から取り込まれた画像データ(CCD−RAWデータ)に所要の信号処理を施して、焦点評価値を算出する。
≪Configuration of AF processing section≫
The AF processing unit 64 performs necessary signal processing on the image data (CCD-RAW data) captured from the image input controller 62 to calculate a focus evaluation value.

図4は、AF処理部の機能構成を示すブロック図である。同図に示すように、AF処理部64は、ハイパスフィルタ(HPF)64A、ゲート64B、加算器64Cを備えて構成される。   FIG. 4 is a block diagram illustrating a functional configuration of the AF processing unit. As shown in the figure, the AF processing unit 64 includes a high pass filter (HPF) 64A, a gate 64B, and an adder 64C.

ハイパスフィルタ64Aは、画像データに含まれる高周波成分を抽出する。画像の高周波成分は、画像の鮮鋭度(コントラスト)が高いほど、輝度信号に多く含まれる。したがって、この高周波成分を積分することによって、その範囲での平均的な画像の鮮鋭度の高低を数値化することができる。この画像の鮮鋭度を数値化したものを焦点評価値という。   The high pass filter 64A extracts high frequency components included in the image data. The higher the image sharpness (contrast), the more high frequency components of the image are contained in the luminance signal. Therefore, by integrating this high frequency component, it is possible to quantify the level of average image sharpness in that range. The numerical value of the sharpness of this image is called a focus evaluation value.

ハイパスフィルタ64Aで高周波成分が抽出された画像データは、ゲート64Bに入力される。ゲート64Bは、画像データを縦横n×mに分割して、加算器64Cに出力する。本例では、図5に示すように、縦横5×7に分割して、加算器64Cに出力する。   The image data from which the high frequency component has been extracted by the high pass filter 64A is input to the gate 64B. The gate 64B divides the image data into vertical and horizontal n × m and outputs it to the adder 64C. In this example, as shown in FIG. 5, it is divided into 5 × 7 vertical and horizontal and output to the adder 64C.

加算器64Cは、分割されたエリアごとに画像データの高周波成分を積算し、エリアごとの焦点評価値を算出する。   The adder 64C integrates high-frequency components of the image data for each divided area, and calculates a focus evaluation value for each area.

算出されたエリアごとの焦点評価値の情報は、CPU90に出力される。CPU90は、このエリアごとの焦点評価値の情報に基づいて、焦点調節、及び、主要被写体の認識処理を実行する。   Information on the calculated focus evaluation value for each area is output to the CPU 90. The CPU 90 executes focus adjustment and main subject recognition processing based on the focus evaluation value information for each area.

≪焦点調節≫
まず、焦点調節動作について説明する。
≪Focus adjustment≫
First, the focus adjustment operation will be described.

焦点調節の方式には、ワンショットAFとコンティニュアスAFとがある。ワンショットAFは、特定のフォーカスエリア内の被写体に合焦するように、1度だけサーチ動作を行って合焦位置を検出し、焦点合わせを行う。一方、コンティニュアスAFは、特定のフォーカスエリア内の被写体に合焦し続けるように、焦点調節を繰り返し行う。   There are one-shot AF and continuous AF as focus adjustment methods. In the one-shot AF, a search operation is performed only once so as to focus on a subject in a specific focus area, a focus position is detected, and focusing is performed. On the other hand, the continuous AF repeatedly performs focus adjustment so as to keep focusing on a subject in a specific focus area.

〈ワンショットAF〉
まず、ワンショットAFについて説明する。
<One-shot AF>
First, one-shot AF will be described.

上記のように、ワンショットAFは、特定のフォーカスエリア内の被写体に合焦するように、1度だけサーチ動作を行って合焦位置を検出する。   As described above, the one-shot AF detects a focus position by performing a search operation only once so that a subject in a specific focus area is focused.

フォーカシング指令(たとえば、レリーズボタンの半押し)が入力されると、CPU90は、フォーカスレンズ110を至近端から無限遠端に移動させる。このフォーカスレンズ110が至近端から無限遠端まで移動する過程で順次画像の取り込みが行われ、AF処理部64で順次焦点評価値が算出される。   When a focusing command (for example, half-pressing the release button) is input, the CPU 90 moves the focus lens 110 from the closest end to the infinity end. Images are sequentially captured while the focus lens 110 moves from the closest end to the infinite end, and the AF processing unit 64 sequentially calculates focus evaluation values.

CPU90は、AF処理部64で順次算出される焦点評価値の情報を取得する。   The CPU 90 acquires information on focus evaluation values sequentially calculated by the AF processing unit 64.

ここで、AF処理部64から取得される焦点評価値の情報は、エリアごとの焦点評価値の情報であるので、CPU90は、得られたエリアごとの焦点評価値の情報から、あらかじめ設定されたフォーカスエリアに相当するエリアの焦点評価値の情報を抽出する。そして、抽出したフォーカスエリアの焦点評価値が極大(ピーク)となる位置を検出する。   Here, since the information on the focus evaluation value acquired from the AF processing unit 64 is information on the focus evaluation value for each area, the CPU 90 is set in advance from the obtained information on the focus evaluation value for each area. Information on the focus evaluation value of the area corresponding to the focus area is extracted. And the position where the focus evaluation value of the extracted focus area becomes maximum (peak) is detected.

上記のように、焦点評価値は、画像の鮮鋭度(コントラスト)を数値化したものであるので、その値が極大となる位置は、被写体像が最も鮮鋭に撮影される位置であり、合焦位置とみなすことができる。したがって、CPU90は、至近端から無限遠端の範囲(焦点評価値サーチ範囲)で焦点評価値が極大となる位置を検出して、これを合焦位置とする。   As described above, since the focus evaluation value is a numerical value of the sharpness (contrast) of the image, the position where the value is maximized is the position where the subject image is most sharply captured and is in focus. It can be regarded as a position. Therefore, the CPU 90 detects a position where the focus evaluation value is maximized in the range from the closest end to the infinity end (focus evaluation value search range), and sets this as the focus position.

CPU90は、合焦位置として検出された位置にフォーカスレンズ110を移動させて、焦点調節処理を終了する。   The CPU 90 moves the focus lens 110 to the position detected as the in-focus position, and ends the focus adjustment process.

このように、ワンショットAFでは、1回のサーチで焦点評価値が極大となる位置を検出し、検出した位置にフォーカスレンズ110を移動させて、焦点合わせを行う。   As described above, in the one-shot AF, a position where the focus evaluation value is maximized is detected by one search, and the focus lens 110 is moved to the detected position to perform focusing.

〈コンティニュアスAF〉
コンティニュアスAFでは、特定のフォーカスエリア内の被写体に合焦し続けるように、焦点調節を繰り返し行う。
<Continuous AF>
In continuous AF, focus adjustment is repeatedly performed so that a subject in a specific focus area continues to be focused.

CPU90は、フォーカシング指令が入力されると、山登り制御でフォーカスレンズ110を合焦位置に設定する。すなわち、図6に示すように、フォーカスレンズ110を微小に前後移動(ウォブリング)させて、特定のフォーカスエリアの焦点評価値の増減方向をチェックし、焦点評価値が極大となる位置までフォーカスレンズ110を徐々に移動させる。焦点評価値が極大となる位置が検出された後も継続してフォーカスレンズ110をウォブリングさせ、焦点評価値の増減をチェックして、焦点評価値が極大となる位置を検出し、その位置にフォーカスレンズ110を移動させる。   When the focusing command is input, the CPU 90 sets the focus lens 110 to the in-focus position by hill climbing control. That is, as shown in FIG. 6, the focus lens 110 is slightly moved back and forth (wobbling) to check the increase / decrease direction of the focus evaluation value in a specific focus area, and the focus lens 110 reaches a position where the focus evaluation value becomes maximum. Move gradually. The focus lens 110 is continuously wobbled after the position at which the focus evaluation value is maximized, the increase / decrease of the focus evaluation value is checked, the position at which the focus evaluation value is maximized is detected, and the focus is set at that position. The lens 110 is moved.

このように、コンティニュアスAFでは、合焦位置の検出後も焦点評価値の増減を常にチェックすることにより、合焦状態が維持されるようにする。   As described above, in the continuous AF, the focus state is constantly checked even after the focus position is detected, so that the focus state is maintained.

≪主要被写体の検出≫
〈第1の方法〉
図7は、第1の方法による主要被写体の検出処理の概念図である。
≪Detection of main subject≫
<First method>
FIG. 7 is a conceptual diagram of main subject detection processing according to the first method.

本例では、まず、多点測距を行い、その測定結果を利用して、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして特定する(同図(a))。次に、その主要被写体候補エリアの中心位置を主要被写体ラフ位置に設定する(同図(a))。次に、その主要被写体ラフ位置を中心にした所定範囲を詳細サーチエリアに設定する(同図(b))。次に、詳細サーチ範囲内で画像解析を実施し、主要被写体を検出する(同図(c))。   In this example, first, multipoint distance measurement is performed, and using the measurement result, a distance measurement area that is estimated to belong to the main subject is specified as a main subject candidate area ((a) in the figure). Next, the center position of the main subject candidate area is set to the main subject rough position ((a) in the figure). Next, a predetermined range centered on the rough position of the main subject is set as a detailed search area ((b) in the figure). Next, image analysis is performed within the detailed search range to detect a main subject ((c) in the figure).

このように、本実施の形態では、まず、多点測距の結果から主要被写体のラフな位置を検出し、検出されたラフな位置を基準にして、画像解析により主要被写体の位置を詳細に検出する。   As described above, in the present embodiment, first, the rough position of the main subject is detected from the result of multipoint ranging, and the position of the main subject is determined in detail by image analysis based on the detected rough position. To detect.

これにより、正確な主要被写体の位置を効率よく検出することができる。   Thereby, it is possible to efficiently detect the accurate position of the main subject.

図8は、本方法(第1の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 8 is a flowchart showing a procedure of processing for detecting a main subject by this method (first method).

まず、多点測距が行われる(ステップS10)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS11)。   First, multipoint ranging is performed (step S10). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S11).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合(あらかじめ設定された閾値以上のピークが検出されない場合を含む)は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   When there is no distance measurement area where the position where the focus evaluation value is maximized is detected (including a case where a peak greater than a preset threshold is not detected), the main subject candidate detection process cannot be performed. Therefore, the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS12)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, if there is a ranging area where the position where the focus evaluation value is maximized is detected, a main subject candidate area detection process is performed based on the detection result of the multipoint ranging (step S12). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリア検出部86は、多点測距の結果を取得し、所定の演算処理を行って、主要被写体候補エリアを決定する。具体的には、「画面の中心に近いほど主要被写体らしい」、「近距離であるほど主要被写体らしい」という2つの仮説をベースに、各測距エリアの被写体距離と画面内の位置に対して、それぞれ重み付け加算をし、主要被写体らしさを数値化する。そして、その数値が最大となる測距エリアを主要被写体候補エリアに選定する。   The main subject candidate area detection unit 86 acquires the result of multipoint distance measurement, performs predetermined calculation processing, and determines the main subject candidate area. Specifically, based on the two hypotheses: “The closer to the center of the screen, the more likely it is to be the main subject” and “The closer the distance is, the more likely the subject is to be the main subject”. , Each is weighted and added, and the likelihood of the main subject is digitized. Then, the distance measuring area having the maximum value is selected as the main subject candidate area.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS13)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S13).

そして、その主要被写体ラフ位置を中心に一定の範囲で詳細サーチ範囲を設定する(ステップS14)。この詳細サーチ範囲は、画像解析によって主要被写体を詳細に検出するための範囲であり、図7(b)に示す例では、主要被写体ラフ位置を中心に一定の矩形領域を詳細サーチ範囲に設定している。   Then, a detailed search range is set within a certain range around the rough position of the main subject (step S14). This detailed search range is a range for detecting the main subject in detail by image analysis. In the example shown in FIG. 7B, a fixed rectangular area around the main subject rough position is set as the detailed search range. ing.

詳細サーチ範囲を設定すると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS15)。このとき、エッジ成分の多さや、同色系の塊の大きさなどを主要被写体らしさの評価の指標として、画像から主要被写体を検出する。   When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S15). At this time, the main subject is detected from the image using the number of edge components, the size of the same color cluster, and the like as an index for evaluating the likelihood of the main subject.

そして、検出された主要被写体の位置を主要被写体詳細位置に決定する(ステップS16)。   Then, the detected position of the main subject is determined as the main subject detail position (step S16).

このように、本方法では、多点測距の結果から主要被写体のラフな位置を決定し、決定した主要被写体のラフな位置を基準に主要被写体を画像解析により詳細に検出する。これにより、主要被写体の位置を正確に検出することができる。   In this way, in this method, the rough position of the main subject is determined from the result of multipoint ranging, and the main subject is detected in detail by image analysis based on the determined rough position of the main subject. Thereby, the position of the main subject can be accurately detected.

なお、詳細サーチ範囲内で最終的に主要被写体の位置を決定する方法は、大きく分けて以下の2つの方法がある。   The method of finally determining the position of the main subject within the detailed search range is roughly divided into the following two methods.

(i)最大値優先:主要被写体詳細サーチ範囲内で、主要被写体らしさの最も大きいところを主要被写体の位置とする方法
(ii)中央優先:主要被写体詳細サーチ範囲内を中央から外側に向かってサーチし、主要被写体らしさの評価値が基準値(閾値)を超えた時点の位置を主要被写体の位置とする方法
最大値優先を使用するか中央優先を使用するかは、設計者が選択できるようにすることが好ましい。
(I) Maximum value priority: A method in which the main subject is located in the main subject detail search range where the main subject is the largest. (Ii) Center priority: Search in the main subject detail search range from the center toward the outside. The method of setting the position of the main subject to the position at which the evaluation value of the main subjectness exceeds the reference value (threshold) so that the designer can select whether to use the maximum priority or the center priority. It is preferable to do.

なお、本例では、いわゆるコントラスト方式で多点測距を実行しているが、測距の方式は、これに限定されるものではない。この他、たとえば、位相差方式や赤外線方式で測距する構成とすることもできる。   In this example, the multipoint distance measurement is performed by a so-called contrast method, but the distance measurement method is not limited to this. In addition, for example, it is possible to adopt a configuration in which distance measurement is performed by a phase difference method or an infrared method.

また、測距により求める被写体距離の情報は、必ずしも距離情報そのものである必要はなく、画面内に存在する被写体の光軸方向の前後の位置関係が分かる情報、すなわち、被写体距離に相当する量であればよい。したがって、たとえば、本例のようにコントラスト方式で測距した場合には、コントラストが極大になったとき(焦点評価値が極大(ピーク)になったとき)のフォーカスレンズの位置情報や、コントラストが極大になったときのフォーカスレンズの基準点からの移動量(パルス駆動時にはパルス数)等を被写体距離の情報(被写体距離に相当する量の情報)として利用することができる。   In addition, the subject distance information obtained by distance measurement does not necessarily need to be the distance information itself, but is information that shows the positional relationship of the subject existing in the screen in the optical axis direction, that is, an amount corresponding to the subject distance. I just need it. Therefore, for example, when the distance is measured by the contrast method as in this example, the position information of the focus lens when the contrast is maximized (when the focus evaluation value is maximized (peak)), and the contrast is The amount of movement of the focus lens from the reference point at the time of local maximum (the number of pulses during pulse driving) or the like can be used as subject distance information (amount information corresponding to the subject distance).

〈第2の方法〉
図9は、第2の方法により主要被写体を検出する処理の手順を示すフローチャートである。
<Second method>
FIG. 9 is a flowchart showing a procedure of processing for detecting a main subject by the second method.

本方法では、まず、CCD54から得られる画像から顔の検出が行われる(ステップS1)。そして、画面内の顔の有無が判定され(ステップS2)、画面内に顔がない場合についてのみ、上記第1の方法で説明した主要被写体の検出処理が行われる(ステップS10〜S16)。すなわち、顔が検出された場合は、検出された顔を主要被写体とし(ステップS3)、検出された顔を主要被写体詳細位置に設定する。   In this method, first, a face is detected from an image obtained from the CCD 54 (step S1). Then, the presence / absence of a face on the screen is determined (step S2), and the main subject detection process described in the first method is performed only when there is no face on the screen (steps S10 to S16). That is, when a face is detected, the detected face is set as a main subject (step S3), and the detected face is set as a main subject detailed position.

一般に画面内に人物が写されている場合、その人物が主要被写体と考えられるので、顔を優先して主要被写体に設定する。これにより、無駄なく主要被写体を検出することができる。   In general, when a person is photographed on the screen, the person is considered to be a main subject, so the face is set as the main subject with priority. Thereby, the main subject can be detected without waste.

〈第3の方法〉
画像解析によって主要被写体を詳細に検出する場合において、エッジ成分の多さを指標として主要被写体を決定すると、背景のエッジ成分につられて、背景のオブジェクトの位置を主要被写体と認識してしまう場合がある(図10参照)。
<Third method>
When the main subject is detected in detail by image analysis, if the main subject is determined using the number of edge components as an index, the position of the background object may be recognized as the main subject by the background edge component. Yes (see FIG. 10).

そこで、多点測距の結果を利用して、主要被写体候補エリアの被写体距離を基準とした距離マップを作成する。詳細サーチ範囲を設定する際、主要被写体候補エリアの被写体距離と近いエリアは、詳細サーチ範囲の対象とするが、遠いエリアは対象外として、詳細サーチ範囲を限定する。   Therefore, a distance map based on the subject distance of the main subject candidate area is created using the result of multipoint ranging. When setting the detailed search range, the area close to the subject distance of the main subject candidate area is set as the target of the detailed search range, but the area far away is excluded from the target and the detailed search range is limited.

これにより、画像解析により主要被写体を検出する際、より正確に検出することができる。また、詳細サーチ範囲が限定されることにより、より効率よく検出することができる。   Thereby, when detecting a main subject by image analysis, it can detect more correctly. Further, since the detailed search range is limited, detection can be performed more efficiently.

図11は、本方法(第3の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 11 is a flowchart showing a procedure of processing for detecting a main subject by this method (third method).

まず、多点測距が行われる(ステップS20)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS21)。   First, multipoint ranging is performed (step S20). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S21).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   If there is no distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate detection process cannot be performed, and the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS22)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, if there is a ranging area where the position where the focus evaluation value is maximized is detected, the main subject candidate area detection process is performed based on the detection result of the multipoint ranging (step S22). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS23)(図12(a)参照)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S23) (see FIG. 12A).

次に、多点測距の結果に基づき、主要被写体検出部88において、主要被写体候補エリアの被写体距離を基準とした距離マップ(主要被写体候補エリアの被写体距離を基準(0)とした各測距エリアの距離のマップ)が作成される(ステップS24)。   Next, based on the result of the multipoint distance measurement, the main subject detection unit 88 uses a distance map based on the subject distance of the main subject candidate area (each distance measurement based on the subject distance of the main subject candidate area as a reference (0)). An area distance map) is created (step S24).

図12では、色の濃淡で主要被写体候補エリアの被写体からの遠近を表している(焦点評価値がピークとなる位置が、無限遠側に離れるほど色が濃くなり、至近側に離れるほど色が薄くなるように表している)。   In FIG. 12, the shade of the color represents the distance from the subject in the main subject candidate area (the color becomes darker as the focus evaluation value reaches the peak at the infinity side, and the color moves away from the closest side. It is shown to be thin).

距離マップが作成されると、その距離マップと主要被写体ラフ位置とに基づいて、主要被写体検出部88で詳細サーチ範囲が決定される(ステップS25)。   When the distance map is created, the detailed search range is determined by the main subject detection unit 88 based on the distance map and the rough position of the main subject (step S25).

主要被写体検出部88は、まず、主要被写体ラフ位置を中心に一定の範囲で仮の詳細サーチ範囲(仮詳細サーチ範囲)を設定する(図12(b)参照)。そして、その仮詳細サーチ範囲内で主要被写体候補エリアの被写体距離と大きく離れた被写体距離を有するエリアを除外して、詳細サーチ範囲を設定する。すなわち、主要被写体候補エリアの被写体距離との差(絶対値)が、あらかじめ設定された閾値を超える領域を除外して、詳細サーチ範囲を設定する(図12(c)参照)。   First, the main subject detection unit 88 sets a temporary detailed search range (temporary detailed search range) within a certain range around the main subject rough position (see FIG. 12B). Then, the detailed search range is set by excluding an area having a subject distance far away from the subject distance of the main subject candidate area in the temporary detailed search range. That is, the detailed search range is set by excluding a region where the difference (absolute value) from the subject distance of the main subject candidate area exceeds a preset threshold (see FIG. 12C).

詳細サーチ範囲が設定されると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS26)。このとき、エッジ成分の多さや、同色系の塊の大きさなどを主要被写体らしさの評価の指標として、画像から主要被写体を検出する。   When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S26). At this time, the main subject is detected from the image using the number of edge components, the size of the same color cluster, and the like as an index for evaluating the likelihood of the main subject.

そして、検出された主要被写体の位置を主要被写体詳細位置に決定する(ステップS27)(図12(d)参照)。   Then, the detected position of the main subject is determined as the main subject detail position (step S27) (see FIG. 12D).

このように、本方法では、詳細サーチ範囲を設定する際、主要被写体候補エリアの被写体距離と大きく離れた被写体距離を有するエリアを除外して、詳細サーチ範囲を設定する。これにより、背景のエッジ成分につられて、背景のオブジェクトを主要被写体と認識してしまうのを防止でき、より正確に主要被写体を検出することができる。また、サーチ範囲を限定することにより、より効率よく主要被写体を検出することができる。   Thus, in this method, when the detailed search range is set, the detailed search range is set by excluding an area having a subject distance far away from the subject distance of the main subject candidate area. As a result, it is possible to prevent the background object from being recognized as the main subject due to the edge component of the background, and to detect the main subject more accurately. Further, by limiting the search range, it is possible to detect the main subject more efficiently.

なお、本方法についても、まず、顔の検出を行い、顔が検出されない場合に限って、本方法で主要被写体の検出を行うようにすることができる(第2の方法参照)。   In this method as well, it is possible to detect a main subject by this method only when a face is detected first and no face is detected (see the second method).

また、本例では、いわゆるコントラスト方式で多点測距を実行しているが、測距の方式は、これに限定されるものではない。この他、たとえば、位相差方式や赤外線方式で測距する構成とすることもできる。   In this example, the multipoint distance measurement is executed by the so-called contrast method, but the distance measurement method is not limited to this. In addition, for example, it is possible to adopt a configuration in which distance measurement is performed by a phase difference method or an infrared method.

〈第4の方法〉
上記のように、コントラスト方式の多点測距を行うことにより、各測距エリアの距離情報を得ることができる。この際、焦点評価値が距離情報に対して二重のピークを持つ場合(図13参照)、詳細サーチをした副作用で背景につられてしまうおそれがある。
<Fourth method>
As described above, distance information of each ranging area can be obtained by performing contrast-based multipoint ranging. At this time, when the focus evaluation value has a double peak with respect to the distance information (see FIG. 13), there is a possibility that the side effect is caused by the side effect of the detailed search.

そこで、本方法では、詳細サーチ範囲を設定する際、二重ピークとなったエリアと、その付近を詳細サーチ範囲の対象から除外することのより、画像解析によって主要被写体を詳細に検出する際の副作用を抑制する。   Therefore, in this method, when the detailed search range is set, the area where the double peak is present and its vicinity are excluded from the target of the detailed search range, and the main subject is detected in detail by image analysis. Reduce side effects.

図14は、本方法(第4の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 14 is a flowchart showing a procedure of processing for detecting a main subject by this method (fourth method).

まず、多点測距が行われる(ステップS30)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS31)。   First, multipoint ranging is performed (step S30). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S31).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   If there is no distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate detection process cannot be performed, and the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS32)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, if there is a ranging area where the position where the focus evaluation value is maximized is detected, the main subject candidate area detection process is performed based on the detection result of the multipoint ranging (step S32). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS33)(図15(a)参照)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S33) (see FIG. 15A).

次に、多点測距の結果に基づき、主要被写体検出部88において、2以上の位置で焦点評価値が極大(ピーク)となった測距エリア(二重ピークの測距エリア)が検出される(ステップS34)。   Next, based on the result of the multipoint distance measurement, the main subject detection unit 88 detects a distance measurement area (double peak distance measurement area) in which the focus evaluation value reaches a maximum (peak) at two or more positions. (Step S34).

図15では、二重ピークの測距エリアを塗りつぶして表している。   In FIG. 15, the double peak ranging area is filled in.

次に、検出された二重ピークの測距エリアの情報と、主要被写体ラフ位置の情報とに基づいて、主要被写体検出部88で詳細サーチ範囲が決定される(ステップS35)。   Next, based on the detected information on the double peak ranging area and the information on the main subject rough position, the main subject detection unit 88 determines the detailed search range (step S35).

主要被写体検出部88は、まず、主要被写体ラフ位置を中心に一定の範囲で仮の詳細サーチ範囲(仮詳細サーチ範囲)を設定する(図15(b)参照)。そして、その仮詳細サーチ範囲内で二重ピークの測距エリアの領域を除外して、詳細サーチ範囲を設定する(図15(c)参照)。   First, the main subject detection unit 88 sets a temporary detailed search range (temporary detailed search range) within a certain range around the main subject rough position (see FIG. 15B). Then, the detailed search range is set by excluding the double peak ranging area within the temporary detailed search range (see FIG. 15C).

詳細サーチ範囲が設定されると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS36)。このとき、エッジ成分の多さや、同色系の塊の大きさなどを主要被写体らしさの評価の指標として、画像から主要被写体を検出する。   When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S36). At this time, the main subject is detected from the image using the number of edge components, the size of the same color cluster, and the like as an index for evaluating the likelihood of the main subject.

そして、検出された主要被写体の位置を主要被写体詳細位置に決定する(ステップS37)(図15(d)参照)。   Then, the detected position of the main subject is determined as the main subject detail position (step S37) (see FIG. 15D).

このように、本方法では、詳細サーチ範囲を設定する際、二重ピークの領域を除外して、詳細サーチ範囲を設定する。これにより、背景のエッジ成分につられて、背景のオブジェクトを主要被写体と認識してしまうのを防止でき、より正確に主要被写体を検出することができる。また、サーチ範囲を限定することにより、より効率よく主要被写体を検出することができる。   Thus, in this method, when setting the detailed search range, the detailed search range is set by excluding the double peak region. As a result, it is possible to prevent the background object from being recognized as the main subject due to the edge component of the background, and to detect the main subject more accurately. Further, by limiting the search range, it is possible to detect the main subject more efficiently.

なお、本方法についても、まず、顔の検出を行い、顔が検出されない場合に限って、本方法で主要被写体の検出を行うようにすることができる(第2の方法参照)。   In this method as well, it is possible to detect a main subject by this method only when a face is detected first and no face is detected (see the second method).

〈第5の方法〉
本方法では、主要被写体候補エリアの被写体距離と大きく離れた被写体距離を有するエリアを詳細サーチの対象から除外するとともに、二重ピークを有するエリアを詳細サーチの対象から除外する。
<Fifth method>
In this method, an area having a subject distance far away from the subject distance of the main subject candidate area is excluded from the detailed search target, and an area having a double peak is excluded from the detailed search target.

図16は、本方法(第5の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 16 is a flowchart showing a processing procedure for detecting a main subject by this method (fifth method).

まず、多点測距が行われる(ステップS40)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS41)。   First, multipoint ranging is performed (step S40). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S41).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   If there is no distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate detection process cannot be performed, and the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS42)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, if there is a ranging area where the position where the focus evaluation value is maximized is detected, the main subject candidate area detection process is performed based on the detection result of the multipoint ranging (step S42). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS43)(図17(a)参照)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S43) (see FIG. 17A).

次に、多点測距の結果に基づき、主要被写体検出部88において、主要被写体候補エリアの被写体距離を基準とした距離マップ(主要被写体候補エリアの被写体距離を基準(0)とした各測距エリアの距離のマップ)が作成される(ステップS44)。   Next, based on the result of the multipoint distance measurement, the main subject detection unit 88 uses a distance map based on the subject distance of the main subject candidate area (each distance measurement based on the subject distance of the main subject candidate area as a reference (0)). An area distance map) is created (step S44).

次に、多点測距の結果に基づき、主要被写体検出部88において、2以上の位置で焦点評価値が極大(ピーク)となった測距エリア(二重ピークの測距エリア)が検出される(ステップS45)。   Next, based on the result of the multipoint distance measurement, the main subject detection unit 88 detects a distance measurement area (double peak distance measurement area) in which the focus evaluation value reaches a maximum (peak) at two or more positions. (Step S45).

次に、距離マップの情報と、二重ピークの測距エリアの情報と、主要被写体ラフ位置の情報とに基づいて、主要被写体検出部88で詳細サーチ範囲が決定される(ステップS46)。   Next, based on the distance map information, the double peak ranging area information, and the main subject rough position information, the main subject detection unit 88 determines a detailed search range (step S46).

主要被写体検出部88は、まず、主要被写体ラフ位置を中心に一定の範囲で仮の詳細サーチ範囲(仮詳細サーチ範囲)を設定する(図17(b)参照)。そして、その仮詳細サーチ範囲内で主要被写体候補エリアの被写体距離と大きく離れた被写体距離を有するエリア(詳細サーチ範囲を設定する。すなわち、主要被写体候補エリアの被写体距離との差(絶対値)が、あらかじめ設定された閾値を超えるエリア)を除外するとともに、二重ピークの測距エリアを除外して、詳細サーチ範囲を設定する(図17(c)参照)。   First, the main subject detection unit 88 sets a temporary detailed search range (temporary detailed search range) within a certain range around the main subject rough position (see FIG. 17B). Then, within the temporary detailed search range, an area having a subject distance that is far away from the subject distance of the main subject candidate area (a detailed search range is set. That is, the difference (absolute value) from the subject distance of the main subject candidate area is , An area exceeding a preset threshold value) is excluded, and a double peak ranging area is excluded to set a detailed search range (see FIG. 17C).

なお、図17(c)では、二重ピークが検出されたエリアを斜格子で表し、主要被写体ラフ位置から遠いエリアを格子で表している。   In FIG. 17C, the area where the double peak is detected is represented by a diagonal lattice, and the area far from the main subject rough position is represented by a lattice.

詳細サーチ範囲が設定されると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS46)。このとき、エッジ成分の多さや、同色系の塊の大きさなどを主要被写体らしさの評価の指標として、画像から主要被写体を検出する。   When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S46). At this time, the main subject is detected from the image using the number of edge components, the size of the same color cluster, and the like as an index for evaluating the likelihood of the main subject.

そして、検出された主要被写体の位置を主要被写体詳細位置に決定する(ステップS47)(図17(d)参照)。   Then, the detected position of the main subject is determined as the main subject detail position (step S47) (see FIG. 17D).

このように、本方法では、詳細サーチ範囲を設定する際、主要被写体候補エリアの被写体距離から遠いエリア、及び、二重ピークのエリアを除外して、詳細サーチ範囲を設定し、詳細サーチを実施する。これにより、背景のエッジ成分につられて、背景のオブジェクトを主要被写体と認識してしまうのを防止でき、より正確に主要被写体を検出することができる。また、サーチ範囲を限定することにより、より効率よく主要被写体を検出することができる。   In this way, in this method, when setting the detailed search range, the area far from the subject distance of the main subject candidate area and the double peak area are excluded, the detailed search range is set, and the detailed search is performed. To do. As a result, it is possible to prevent the background object from being recognized as the main subject due to the edge component of the background, and to detect the main subject more accurately. Further, by limiting the search range, it is possible to detect the main subject more efficiently.

なお、本方法についても、まず、顔の検出を行い、顔が検出されない場合に限って、本方法で主要被写体の検出を行うようにすることができる(第2の方法参照)。   In this method as well, it is possible to detect a main subject by this method only when a face is detected first and no face is detected (see the second method).

〈第6の方法〉
画像解析によって主要被写体を検出する際、画面内の主要被写体の大きさに応じて詳細サーチ範囲を設定することにより、正確で無駄のない検出を行うことができる。
<Sixth method>
When a main subject is detected by image analysis, an accurate and lean detection can be performed by setting a detailed search range according to the size of the main subject in the screen.

一般に、主要被写体は、近距離(焦点評価値のピーク位置が至近側)に存在しているほど、画面内に大きく写されていると考えられる。   In general, it is considered that the main subject is larger in the screen as it is located at a shorter distance (the peak position of the focus evaluation value is closer).

そこで、図18に示すように、主要被写体候補エリアの被写体距離に応じて、詳細サーチ範囲の大きさを調整する。すなわち、主要被写体候補エリアの被写体距離が近距離であるほど詳細サーチ範囲を大きく設定し(同図(a))、遠距離である詳細サーチ範囲を小さく設定する(同図(b))。   Therefore, as shown in FIG. 18, the size of the detailed search range is adjusted according to the subject distance of the main subject candidate area. That is, the closer the subject distance of the main subject candidate area is, the larger the detailed search range is set ((a) in the same figure), and the smaller detailed search range is set (in the same figure (b)).

ここで、画面内における主要被写体詳細サーチ範囲の調整の方法としては、以下の2通りの方法が考えられる。   Here, as the method of adjusting the main subject detailed search range in the screen, the following two methods can be considered.

(i) 画像全体の大きさは変化させず、主要被写体詳細サーチ範囲を大きくする。   (i) Increase the main subject detail search range without changing the overall size of the image.

(ii) 画面全体の大きさを変化させ、主要被写体詳細サーチ範囲は固定にする。   (ii) Change the size of the entire screen and fix the main subject detail search range.

すなわち、相対的な大きさが調整される。いずれの方法を採用しても、同様の効果を得ることができる。   That is, the relative size is adjusted. Even if any method is adopted, the same effect can be obtained.

図19は、本方法(第6の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 19 is a flowchart showing a processing procedure for detecting a main subject by this method (sixth method).

まず、多点測距が行われる(ステップS50)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS51)。   First, multipoint ranging is performed (step S50). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S51).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   If there is no distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate detection process cannot be performed, and the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS52)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, when there is a distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate area detection process is performed based on the detection result of the multipoint distance measurement (step S52). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS53)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S53).

次に、主要被写体候補エリアの被写体距離の情報と、主要被写体ラフ位置の情報とに基づいて、主要被写体検出部88で詳細サーチ範囲が決定される(ステップS54)。主要被写体検出部88は、まず、主要被写体候補エリアの被写体距離に基づいて、詳細サーチ範囲の大きさを決定する。この際、上記のように、主要被写体候補エリアの被写体距離が近距離であるほど大きくなるように、詳細サーチ範囲の大きさが設定される。そして、決定した大きさに調整して、所定形状の詳細サーチ範囲を主要被写体ラフ位置を中心に設定する。図18に示す例では、詳細サーチ範囲を矩形状に設定している。   Next, the detailed search range is determined by the main subject detection unit 88 based on the subject distance information of the main subject candidate area and the main subject rough position information (step S54). First, the main subject detection unit 88 determines the size of the detailed search range based on the subject distance of the main subject candidate area. At this time, as described above, the size of the detailed search range is set so that the subject distance of the main subject candidate area increases as the subject distance decreases. Then, the detailed search range of a predetermined shape is set around the main subject rough position by adjusting to the determined size. In the example shown in FIG. 18, the detailed search range is set to a rectangular shape.

詳細サーチ範囲が設定されると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS55)。このとき、エッジ成分の多さや、同色系の塊の大きさなどを主要被写体らしさの評価の指標として、画像から主要被写体を検出する。   When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S55). At this time, the main subject is detected from the image using the number of edge components, the size of the same color cluster, and the like as an index for evaluating the likelihood of the main subject.

そして、検出された主要被写体の位置を主要被写体詳細位置に決定する(ステップS56)。   Then, the detected position of the main subject is determined as the main subject detailed position (step S56).

このように、本方法では、主要被写体候補エリアの被写体距離に応じて、詳細サーチ範囲の大きさが拡縮されて設定される。これにより、画面に写されている主要被写体の大きさに応じて、適切に詳細サーチ範囲を設定でき、無駄なく正確に主要被写体を検出することができる。   As described above, in this method, the size of the detailed search range is set to be enlarged or reduced according to the subject distance of the main subject candidate area. Accordingly, the detailed search range can be appropriately set according to the size of the main subject displayed on the screen, and the main subject can be accurately detected without waste.

なお、本方法についても、まず、顔の検出を行い、顔が検出されない場合に限って、本方法で主要被写体の検出を行うようにすることができる(第2の方法参照)。   In this method as well, it is possible to detect a main subject by this method only when a face is detected first and no face is detected (see the second method).

また、さらに主要被写体候補エリアの被写体距離から遠いエリア、及び/又は、二重ピークのエリアを除外して、詳細サーチ範囲を設定し、詳細サーチを実施するようにしてもよい(第3〜第5の方法参照)。   Further, an area far from the subject distance of the main subject candidate area and / or a double peak area may be excluded to set a detailed search range and perform a detailed search (third to third). See method 5).

〈第7の方法〉
上記第6の方法で述べたように、詳細サーチする際、画面に写されている主要被写体の大きさに応じて詳細サーチ範囲の大きさを調整することにより、無駄なく正確に主要被写体を検出することができる。
<Seventh method>
As described in the sixth method above, when performing a detailed search, the main subject can be accurately detected without waste by adjusting the size of the detailed search range according to the size of the main subject displayed on the screen. can do.

ズームして撮影している場合、一般にズームがテレ側(望遠側)に設定されているほど、主要被写体は画面内に大きく写されていると考えられる。   When shooting with zooming, it is generally considered that the larger the zoom is set to the telephoto side (telephoto side), the larger the main subject appears on the screen.

そこで、図20に示すように、ズーム位置(焦点距離)に応じて、主要被写体詳細サーチ範囲を調整する。すなわち、ズーム位置がテレ側(望遠側)であるほど詳細サーチ範囲が大きくなるように設定する(同図(a))(ズーム位置が、ワイド側(広角側)であるほど詳細サーチ範囲が小さくなるように設定する(同図(b))。   Therefore, as shown in FIG. 20, the main subject detail search range is adjusted according to the zoom position (focal length). That is, the detailed search range is set to be larger as the zoom position is at the telephoto side (telephoto side) ((a) in the figure) (the detailed search range is smaller as the zoom position is at the wide side (wide angle side)) It sets so that it may become (the figure (b)).

ここで、画面内における主要被写体詳細サーチ範囲の調整の方法としては、以下の2通りの方法が考えられる。   Here, as the method of adjusting the main subject detailed search range in the screen, the following two methods can be considered.

(i) 画像全体の大きさは変化させず、主要被写体詳細サーチ範囲を大きくする。   (i) Increase the main subject detail search range without changing the overall size of the image.

(ii) 画面全体の大きさを変化させ、主要被写体詳細サーチ範囲は固定にする。   (ii) Change the size of the entire screen and fix the main subject detail search range.

すなわち、相対的な大きさを調整する。いずれの方法を採用しても、同様の効果を得ることができる。   That is, the relative size is adjusted. Even if any method is adopted, the same effect can be obtained.

図21は、本方法(第7の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 21 is a flowchart showing a procedure of processing for detecting a main subject by this method (seventh method).

まず、多点測距が行われる(ステップS60)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS61)。   First, multipoint ranging is performed (step S60). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S61).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   If there is no distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate detection process cannot be performed, and the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS62)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, when there is a distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate area detection process is performed based on the detection result of the multipoint distance measurement (step S62). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS63)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S63).

次に、ズームの位置情報と、主要被写体ラフ位置の情報とに基づいて、主要被写体検出部88で詳細サーチ範囲が決定される(ステップS64)。主要被写体検出部88は、まず、現在のズームの位置の情報を取得し、取得したズームの位置に応じて、詳細サーチ範囲の大きさを決定する。この際、上記のように、ズームの位置がテレ側であるほど大きくなるように、詳細サーチ範囲の大きさが設定される。そして、決定した大きさに調整して、所定形状の詳細サーチ範囲を主要被写体ラフ位置を中心に設定する。図20に示す例では、詳細サーチ範囲を矩形状に設定している。   Next, based on the zoom position information and the main subject rough position information, the main subject detector 88 determines a detailed search range (step S64). First, the main subject detection unit 88 acquires information on the current zoom position, and determines the size of the detailed search range according to the acquired zoom position. At this time, as described above, the size of the detailed search range is set so that the zoom position becomes larger as it is on the telephoto side. Then, the detailed search range of a predetermined shape is set around the main subject rough position by adjusting to the determined size. In the example shown in FIG. 20, the detailed search range is set to a rectangular shape.

詳細サーチ範囲が設定されると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS65)。このとき、エッジ成分の多さや、同色系の塊の大きさなどを主要被写体らしさの評価の指標として、画像から主要被写体を検出する。   When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S65). At this time, the main subject is detected from the image using the number of edge components, the size of the same color cluster, and the like as an index for evaluating the likelihood of the main subject.

そして、検出された主要被写体の位置を主要被写体詳細位置に決定する(ステップS66)。   Then, the detected position of the main subject is determined as the main subject detailed position (step S66).

このように、本方法では、ズーム位置に応じて、詳細サーチ範囲の大きさが拡縮されて設定される。これにより、画面に写されている主要被写体の大きさに応じて、適切に詳細サーチ範囲を設定でき、無駄なく正確に主要被写体を検出することができる。   Thus, in this method, the size of the detailed search range is set to be enlarged or reduced according to the zoom position. Accordingly, the detailed search range can be appropriately set according to the size of the main subject displayed on the screen, and the main subject can be accurately detected without waste.

なお、本方法についても、まず、顔の検出を行い、顔が検出されない場合に限って、本方法で主要被写体の検出を行うようにすることができる(第2の方法参照)。   In this method as well, it is possible to detect a main subject by this method only when a face is detected first and no face is detected (see the second method).

また、さらに主要被写体候補エリアの被写体距離から遠いエリア、及び/又は、二重ピークのエリアを除外して、詳細サーチ範囲を設定し、詳細サーチを実施するようにしてもよい(第3〜第5の方法参照)。   Further, an area far from the subject distance of the main subject candidate area and / or a double peak area may be excluded to set a detailed search range and perform a detailed search (third to third). See method 5).

〈第8の方法〉
本方法では、画像解析によって検出された主要被写体の位置(主要被写体詳細位置)が主要被写体ラフ位置からずれた場合に、主要被写体の位置を大外しするのを防止する。
<Eighth method>
In this method, when the position of the main subject (main subject detailed position) detected by the image analysis is deviated from the main subject rough position, the position of the main subject is prevented from being greatly removed.

図22は、本方法(第8の方法)により主要被写体を検出する処理の手順を示すフローチャートである。   FIG. 22 is a flowchart showing a procedure of processing for detecting a main subject by this method (eighth method).

まず、多点測距が行われる(ステップS70)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS71)。   First, multipoint ranging is performed (step S70). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S71).

焦点評価値が極大となる位置が検出された測距エリアが、まったく存在しない場合は、主要被写体候補の検出処理を行うことができないので、処理を終了する。   If there is no distance measurement area where the position where the focus evaluation value is maximized is detected, the main subject candidate detection process cannot be performed, and the process ends.

一方、焦点評価値が極大となる位置が検出された測距エリアがある場合は、多点測距の検出結果に基づいて、主要被写体候補エリアの検出処理が行われる(ステップS72)。この処理は、主要被写体候補エリア検出部86で行われる。   On the other hand, when there is a distance measurement area where the position where the focus evaluation value is maximized is detected, a main subject candidate area detection process is performed based on the detection result of the multipoint distance measurement (step S72). This processing is performed by the main subject candidate area detection unit 86.

主要被写体候補エリアが検出されると、その情報が主要被写体検出部88に出力される。主要被写体検出部88は、得られた主要被写体候補エリアの中心を主要被写体ラフ位置に設定する(ステップS73)。   When the main subject candidate area is detected, the information is output to the main subject detection unit 88. The main subject detection unit 88 sets the center of the obtained main subject candidate area as the main subject rough position (step S73).

次に、主要被写体検出部88で詳細サーチ範囲が決定される(ステップS74)。詳細サーチ範囲が設定されると、主要被写体検出部88は、その設定した詳細サーチ範囲内でCCD54から得られた画像を解析し、主要被写体を検出する(ステップS75)。そして、検出された主要被写体の位置を主要被写体仮詳細位置に決定する(ステップS76)。   Next, the detailed search range is determined by the main subject detection unit 88 (step S74). When the detailed search range is set, the main subject detection unit 88 analyzes the image obtained from the CCD 54 within the set detailed search range, and detects the main subject (step S75). Then, the detected position of the main subject is determined as the main subject temporary detailed position (step S76).

次に、主要被写体仮詳細位置を中心に所定の大きさでフォーカスエリアに設定する。そして、所定範囲でフォーカスレンズ110を移動させて、設定したフォーカスエリアの焦点評価値を取得する(ステップS77)。   Next, the focus area is set to a predetermined size centered on the main subject temporary detailed position. Then, the focus lens 110 is moved within a predetermined range, and the focus evaluation value of the set focus area is acquired (step S77).

ここで、フォーカスレンズ110を移動させる範囲(焦点評価値サーチ範囲)は、多点測距の結果、主要被写体候補エリアの焦点評価値が極大となる位置(主要被写体候補エリアの合焦位置)を基準として、その前後所定範囲に設定される(図23参照)。   Here, the range in which the focus lens 110 is moved (focus evaluation value search range) is a position where the focus evaluation value of the main subject candidate area is maximized as a result of multipoint distance measurement (the focus position of the main subject candidate area). As a reference, a predetermined range is set before and after that (see FIG. 23).

次に、取得した焦点評価値に極大点(ピーク)があるか否かを判定する(ステップS78)。この判定の結果、図23(a)に示すように、極大点(ピーク)がないと判定すると、主要被写体ラフ位置を主要被写体詳細位置に決定する(ステップS81)。   Next, it is determined whether or not the acquired focus evaluation value has a maximum point (peak) (step S78). As a result of this determination, if it is determined that there is no maximum point (peak) as shown in FIG. 23A, the main subject rough position is determined as the main subject detailed position (step S81).

一方、極大点がある場合は、その極大点の位置が許容範囲内か否かを判定する(ステップS79)。   On the other hand, if there is a local maximum point, it is determined whether or not the position of the local maximum point is within an allowable range (step S79).

ここで、許容範囲は、多点測距の結果、主要被写体候補エリアの焦点評価値が極大となる位置(主要被写体候補エリアの合焦位置)を基準として、その前後所定範囲に設定される(図23参照)。   Here, the allowable range is set to a predetermined range before and after the position where the focus evaluation value of the main subject candidate area becomes the maximum as a result of the multipoint distance measurement (the focus position of the main subject candidate area) (see FIG. (See FIG. 23).

極大点の位置が、許容範囲内にあるか否かは、取得した焦点評価値が極大となる位置と、主要被写体候補エリアの焦点評価値が極大となる位置(主要被写体候補エリアの合焦位置)との差(絶対値)を求め、その差が、あらかじめ設定された閾値内であるか否かを判定することにより行われる。   Whether or not the position of the maximum point is within the allowable range is determined based on the position where the acquired focus evaluation value is maximum and the position where the focus evaluation value of the main subject candidate area is maximum (the focus position of the main subject candidate area). ) Is determined (absolute value), and it is determined whether or not the difference is within a preset threshold value.

この判定の結果、図23(b)に示すように、差が閾値を超えている判定すると、主要被写体ラフ位置を主要被写体詳細位置に決定する(ステップS81)。   As a result of this determination, as shown in FIG. 23B, if it is determined that the difference exceeds the threshold, the main subject rough position is determined as the main subject detail position (step S81).

一方、差が閾値以内であると判定すると、主要被写体仮詳細位置を主要被写体詳細位置に設定する(ステップS80)。   On the other hand, if it is determined that the difference is within the threshold, the main subject temporary detailed position is set to the main subject detailed position (step S80).

このように、画像解析によって検出された主要被写体の位置(主要被写体仮詳細位置)を基準に一定のサーチ範囲(焦点評価値サーチ範囲)で再度測距し、多点測距により求めた主要被写体候補エリアの主要被写体の位置とのズレ(光軸方向)を比較することにより、主要被写体の位置を大外しするのを防止することができる。   In this way, the main subject obtained by multi-point ranging is measured again in a fixed search range (focus evaluation value search range) based on the position of the main subject (main subject temporary detailed position) detected by image analysis. By comparing the deviation (in the optical axis direction) of the candidate area with the position of the main subject, it is possible to prevent the position of the main subject from being greatly changed.

≪主要被写体の検出処理を伴う撮影前処理≫
次に、上記の主要被写体の検出技術を利用した本撮影前の処理について説明する。
≪Pre-shooting process with main subject detection process≫
Next, a process before the main photographing using the main subject detection technique will be described.

上記の主要被写体の検出技術を使用することにより、画面に写されている主要被写体の位置を検出することができる。   By using the main subject detection technique described above, the position of the main subject on the screen can be detected.

そこで、ライブビュー中のスルー画像を利用して、主要被写体の検出を行い、その検出結果を利用して各種処理を行う。   Therefore, the main subject is detected using the through image in the live view, and various processes are performed using the detection result.

〈第1の実施の形態〉
本実施の形態では、ライブビュー中に主要被写体の検出処理を行い、検出した主要被写体にフォーカスエリアを設定して、コンティニュアスAFを実行する。
<First Embodiment>
In the present embodiment, main subject detection processing is performed during live view, a focus area is set for the detected main subject, and continuous AF is executed.

図24は、本撮影前に行われるコンティニュアスAFの状態遷移図である。   FIG. 24 is a state transition diagram of continuous AF performed before the actual photographing.

同図に示すように、スルー画像中に顔が検出された場合は、顔コンティニュアスAFに移行し、検出された顔にフォーカスエリアを設定して、顔コンティニュアスAFを行う。   As shown in the figure, when a face is detected in a through image, the process proceeds to face continuous AF, a focus area is set for the detected face, and face continuous AF is performed.

一方、顔が検出されない場合は、中央コンティニュアスAFに移行する。そして、中央コンティニュアスAFで合焦し(あるいは、合焦に近い状態になり)、かつ、撮影シーンが変動すると、多点測距に移行する。   On the other hand, if no face is detected, the process proceeds to the central continuous AF. Then, when focusing is performed with the central continuous AF (or close to focusing) and the shooting scene is changed, the multi-point distance measurement is started.

多点測距の結果、ピークが検出された測距エリアが存在しない場合は、中央コンティニュアスAFに移行する。この場合、顔が検出されている場合は、顔コンティニュアスAFに移行する。   As a result of the multipoint distance measurement, when there is no distance measurement area where a peak is detected, the process proceeds to the central continuous AF. In this case, when a face is detected, the process proceeds to face continuous AF.

一方、多点測距の結果、ピークが検出された測距エリアが存在する場合は、その多点測距の結果に基づいて、主要被写体の検出処理が行われる。そして、検出した主要被写体にフォーカスエリアを設定し、コンティニュアスAF(主要被写体コンティニュアス)を行う。この後、顔検出された場合は、検出された顔にフォーカスエリアを設定して、顔コンティニュアスAFを行う。また、シーンが変動した場合は、中央コンティニュアスAFに移行する。   On the other hand, when there is a ranging area where a peak is detected as a result of multipoint ranging, main subject detection processing is performed based on the multipoint ranging result. Then, a focus area is set for the detected main subject, and continuous AF (main subject continuous) is performed. Thereafter, when a face is detected, a focus area is set for the detected face and face continuous AF is performed. If the scene changes, the process proceeds to the central continuous AF.

図25は、本撮影前に行われるコンティニュアスAFの処理の手順を示すフローチャートである。   FIG. 25 is a flowchart showing a procedure of continuous AF processing performed before the actual photographing.

まず、顔検出の処理が行われ(ステップS111)、顔が検出されたか否かが判定される(ステップS112)。   First, face detection processing is performed (step S111), and it is determined whether a face is detected (step S112).

顔が検出された場合は、検出された顔の位置にフォーカスエリアが設定され、顔コンティニュアスAFが行われる(ステップS113)。顔コンティニュアスAFは、顔が検出されなくなるまで行われる。   If a face is detected, a focus area is set at the detected face position, and face continuous AF is performed (step S113). The face continuous AF is performed until no face is detected.

一方、顔が検出されない場合は、画面中央にフォーカスエリアが設定され、中央コンティニュアスAFが行われる(ステップS120)。その後、中央コンティニュアスAFが合焦したか否か(あるいは、合焦に近い状態になったか否か)が判定される(ステップS121)。   On the other hand, when a face is not detected, a focus area is set at the center of the screen, and central continuous AF is performed (step S120). Thereafter, it is determined whether or not the central continuous AF is in focus (or whether or not the focus is close to the focus) (step S121).

コンティニュアスAFが合焦していない場合は、ステップS111に戻り、再度、顔検出が行われる。   If the continuous AF is not in focus, the process returns to step S111, and face detection is performed again.

一方、コンティニュアスAFが合焦した場合(あるいは、合焦に近い状態になった場合)は、撮影シーンが変動したか否かが判定される(ステップS122)。   On the other hand, if the continuous AF is in focus (or close to the focus), it is determined whether or not the shooting scene has changed (step S122).

ここでのシーン変動の検出は、あらかじめ登録された画像と現在撮影されている画像とを比較し、シーンに変動が生じているか否かが判定される。   In this case, the scene change is detected by comparing a pre-registered image with the currently captured image to determine whether or not the scene has changed.

なお、比較対象とする画像は、本例では主要被写体を検出した際の画像である。したがって、初回はシーン変動の有無は判別せずに多点測距が実行される。   The image to be compared is an image when the main subject is detected in this example. Therefore, multipoint ranging is executed for the first time without determining whether or not there is a scene change.

シーン変動がない場合は、ステップS111に戻り、再度、顔検出が行われる。   If there is no scene change, the process returns to step S111, and face detection is performed again.

一方、シーンが変動した場合は、中央コンティニュアスAFを停止し、多点測距が行われる(ステップS123)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS124)。   On the other hand, if the scene changes, the central continuous AF is stopped and multipoint distance measurement is performed (step S123). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S124).

この判定の結果、ピークが検出された測距エリアがないと判定されると、ステップS111に戻り、再度、顔検出が行われる。   As a result of this determination, if it is determined that there is no ranging area in which the peak is detected, the process returns to step S111, and face detection is performed again.

一方、ピークが検出された測距エリアがあると判定されると、画像の取り込みが行われる。そして、その取り込まれた画像が、比較用の基準画像として登録される(ステップS125)。この処理は、たとえば、比較用の基準画像をフレームメモリ74に記録することにより行われる。    On the other hand, when it is determined that there is a ranging area where the peak is detected, an image is captured. The captured image is registered as a reference image for comparison (step S125). This process is performed, for example, by recording a reference image for comparison in the frame memory 74.

比較用の基準画像の登録後、上記の主要被写体の検出技術を利用して、主要被写体の検出処理が行われる(ステップS126)。そして、検出された主要被写体にフォーカスエリアが設定され、主要被写体コンティニュアスAFが行われる(ステップS127)。   After registration of the reference image for comparison, main subject detection processing is performed using the main subject detection technique described above (step S126). Then, a focus area is set for the detected main subject, and main subject continuous AF is performed (step S127).

この後、撮影シーンが変動したか否かが判定される(ステップS128)。撮影シーンに変動がない場合は、引き続き主要被写体コンティニュアスAFが行われる。一方、撮影シーンに変動がある場合は、ステップS111に戻り、再度、顔検出が行われる。   Thereafter, it is determined whether or not the shooting scene has changed (step S128). If there is no change in the shooting scene, the main subject continuous AF is continued. On the other hand, if there is a change in the shooting scene, the process returns to step S111, and face detection is performed again.

このように、本実施の形態では、スルー画像中に顔が検出された場合は、顔にフォーカスエリアを設定して顔コンティニュアスAFを行い、顔が検出されない場合は、主要被写体の検出処理を行って、主要被写体コンティニュアスAFを行う。これにより、画面中に顔がない場合であっても、その主要被写体にピントがあったスルー画像を表示することができる。   As described above, in the present embodiment, when a face is detected in the through image, the focus area is set to the face and the face continuous AF is performed. When the face is not detected, the main subject detection process is performed. To perform main subject continuous AF. Thereby, even if there is no face on the screen, a through image in which the main subject is in focus can be displayed.

また、主要被写体の検出処理を行う際は、まず、中央コンティニュアスAFを行い、その中央コンティニュアスAFが合焦し、かつ、撮影シーンが変動した場合に限って、多点測距を行う。これにより、多点測距の実行回数を抑制でき、モニタ24に表示されるスルー画像の画角変動を抑えることができる。これにより、スルー画像表示中も見やすい画面とすることができる。   When performing the main subject detection process, first, the central continuous AF is performed, and the multipoint distance measurement is performed only when the central continuous AF is in focus and the shooting scene changes. Do. Thereby, the frequency | count of execution of multipoint ranging can be suppressed, and the view angle fluctuation | variation of the through image displayed on the monitor 24 can be suppressed. Thereby, it is possible to make the screen easy to see even during the through image display.

なお、主要被写体が検出されると、図26(a)に示すように、モニタ24の画面には、主要被写体に設定したフォーカスエリアの位置を示す枠が表示される。同図(b)に示すように、顔が検出された場合も同様に、モニタ24の画面には、顔に設定したフォーカスエリアの位置を示す枠が表示される。   When the main subject is detected, a frame indicating the position of the focus area set for the main subject is displayed on the screen of the monitor 24 as shown in FIG. As shown in FIG. 5B, similarly, when a face is detected, a frame indicating the position of the focus area set for the face is displayed on the screen of the monitor 24.

なお、本例では、主要被写体の検出処理を行う際、中央コンティニュアスAFが合焦し、かつ、撮影シーンに変動があった場合に限って多点測距を実行しているが、中央コンティニュアスAFが合焦した場合に限って多点測距を実行する構成や、撮影シーンが変動した場合に限って多点測距を実行する構成、前回の多点測距から一定時間が経過した場合に限って多点測距を実行する構成とすることもできる。あるいは、これらを適宜組み合わせて、全ての条件を満足した場合に限って多点測距を実行する構成とすることもできる。   In this example, when the main subject detection process is performed, the multipoint ranging is executed only when the central continuous AF is in focus and the shooting scene is changed. A configuration that performs multipoint ranging only when continuous AF is in focus, a configuration that performs multipoint ranging only when the shooting scene changes, and a fixed time from the previous multipoint ranging It is also possible to adopt a configuration in which multipoint ranging is executed only when it has elapsed. Alternatively, these may be combined as appropriate, and the multipoint ranging may be executed only when all the conditions are satisfied.

また、本例では、撮影シーンが変動したか否かを判定する際、主要被写体を検出した際の画像を基準画像として登録し、この基準画像との比較で撮影シーンが変動したか否かを判定しているが、一定間隔(一定フレーム間隔)で撮影シーンの変動を検出する構成とすることもできる(たとえば、Nフレーム前の画像を基準画像として登録し、その基準画像と比較して、撮影シーンの変動を検出する。)。   Further, in this example, when determining whether or not the shooting scene has changed, an image when the main subject is detected is registered as a reference image, and whether or not the shooting scene has changed in comparison with the reference image is determined. Although it is determined, it is also possible to adopt a configuration in which a change in the shooting scene is detected at a constant interval (a constant frame interval) (for example, an image before N frames is registered as a reference image, Detect scene changes.)

また、比較用の情報は、必ずしも画像データそのものである必要はなく、比較用の特徴点を抽出し、その特徴点の情報を基準情報として登録するようにしてもよい。この場合、シーン変動も現在の画像から特徴点を抽出し、抽出した特徴点の比較により行われる。   Further, the comparison information does not necessarily have to be the image data itself, and a feature point for comparison may be extracted and the feature point information may be registered as reference information. In this case, scene variation is also performed by extracting feature points from the current image and comparing the extracted feature points.

また、本例では、顔検出を行い、顔が検出されない場合に限って、主要被写体の検出処理を行っているが、顔検出については、必ずしも行う必要はない。また、顔が検出された場合であっても、多点測距による主要被写体の検出処理を実行するようにしてもよい。   In this example, the main subject detection process is performed only when face detection is performed and no face is detected. However, face detection is not necessarily performed. Further, even when a face is detected, main subject detection processing by multipoint distance measurement may be executed.

〈第2の実施の形態〉
本実施の形態では、ライブビュー中に主要被写体の検出処理を行い、検出した主要被写体をレリーズボタン18の半押し時(フォーカシング指示時(S1))のフォーカスエリアに設定する。
<Second Embodiment>
In the present embodiment, main subject detection processing is performed during live view, and the detected main subject is set as a focus area when the release button 18 is half-pressed (when focusing is instructed (S1)).

図27は、ライブビュー中に検出した主要被写体にフォーカスエリアを設定する処理の手順を示すフローチャートである。   FIG. 27 is a flowchart illustrating a processing procedure for setting a focus area for a main subject detected during live view.

まず、顔検出が行われ(ステップS131)、顔が検出されたか否かが判定される(ステップS132)。   First, face detection is performed (step S131), and it is determined whether a face is detected (step S132).

顔が検出された場合は、検出された顔の位置にフォーカスエリアが設定され、顔コンティニュアスAFが行われる(ステップS133)。顔コンティニュアスAFは、顔が検出されなくなるまで行われる。   If a face is detected, a focus area is set at the detected face position, and face continuous AF is performed (step S133). The face continuous AF is performed until no face is detected.

一方、顔が検出されない場合は、画面中央にフォーカスエリアが設定されて、中央コンティニュアスAFが行われる(ステップS140)。この後、中央コンティニュアスAFが合焦したか否か(あるいは、合焦に近い状態になったか否か)が判定される(ステップS141)。   On the other hand, if a face is not detected, a focus area is set at the center of the screen, and central continuous AF is performed (step S140). Thereafter, it is determined whether or not the central continuous AF is in focus (or whether or not the state is close to the focus) (step S141).

コンティニュアスAFが合焦していない場合は、ステップS131に戻り、再度、顔検出が行われる。   If the continuous AF is not in focus, the process returns to step S131, and face detection is performed again.

一方、コンティニュアスAFが合焦した場合(あるいは、合焦に近い状態になった場合)は、撮影シーンが変動したか否かが判定される(ステップS142)。   On the other hand, if the continuous AF is in focus (or close to the focus), it is determined whether or not the shooting scene has changed (step S142).

ここでのシーン変動の検出は、あらかじめ登録された画像と現在撮影されている画像とを比較し、シーンに変動が生じているか否かを判定する。比較対象とする画像は、主要被写体を検出した際の画像である。したがって、初回はシーン変動の有無は判別せずに多点測距が実行される。   In this case, the scene change is detected by comparing a pre-registered image with the currently captured image to determine whether or not the scene has changed. The image to be compared is an image when the main subject is detected. Therefore, multipoint ranging is executed for the first time without determining whether or not there is a scene change.

シーン変動がない場合は、ステップS131に戻り、再度、顔検出が行われる。   If there is no scene change, the process returns to step S131, and face detection is performed again.

一方、シーンが変動した場合は、中央コンティニュアスAFが停止され、多点測距が行われる(ステップS143)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS144)。   On the other hand, when the scene changes, the central continuous AF is stopped and multipoint distance measurement is performed (step S143). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S144).

この判定の結果、ピークが検出された測距エリアがないと判定されると、ステップS131に戻り、再度、顔検出が行われる。   As a result of this determination, if it is determined that there is no ranging area where a peak is detected, the process returns to step S131 and face detection is performed again.

一方、ピークが検出された測距エリアがあると判定されると、画像の取り込みが行われる。そして、取り込まれた画像が、比較用の基準画像として登録される(ステップS145)。この処理は、たとえば、比較用の基準画像をフレームメモリ74に記録することにより行われる。    On the other hand, when it is determined that there is a ranging area where the peak is detected, an image is captured. Then, the captured image is registered as a reference image for comparison (step S145). This process is performed, for example, by recording a reference image for comparison in the frame memory 74.

比較用の基準画像の登録後、上記の主要被写体の検出処理の技術を利用して、主要被写体の検出が行われる(ステップS146)。そして、検出された主要被写体の位置にS1時のフォーカスエリアが設定される(ステップS147)。   After registration of the reference image for comparison, the main subject is detected using the technique for detecting the main subject (step S146). Then, the focus area at S1 is set at the position of the detected main subject (step S147).

このように、本実施の形態では、スルー画像の表示中に主要被写体の検出処理を行い、検出した主要被写体にS1時のフォーカスエリアを設定する。   As described above, in the present embodiment, the main subject is detected while the through image is displayed, and the focus area at S1 is set for the detected main subject.

図28は、本撮影までの処理の手順を示すフローチャートである。   FIG. 28 is a flowchart illustrating a processing procedure up to the actual photographing.

撮影モードに設定されると、本撮影前の処理が実行される(ステップS151)。すなわち、モニタ24にスルー画像の表示が行われるとともに、上記の主要被写体の検出処理が行われる。   When the photographing mode is set, processing before the main photographing is executed (step S151). That is, the through image is displayed on the monitor 24 and the main subject detection process is performed.

CPU90は、操作系制御部84からの入力に基づいて、レリーズボタン18が半押されたか否かを判定する(ステップS152)。なお、レリーズボタン18が半押しされると、撮影準備指示信号として、S1ON信号がCPU90に入力される(半押しが解除されていると、S1OFF)。CPU90は、このS1ON信号の入力の有無に基づいて、レリーズボタン18が半押しされているか否かを判定する。   The CPU 90 determines whether or not the release button 18 is half-pressed based on the input from the operation system control unit 84 (step S152). When the release button 18 is half-pressed, an S1 ON signal is input to the CPU 90 as a shooting preparation instruction signal (S1 OFF when the half-press is released). The CPU 90 determines whether or not the release button 18 is half-pressed based on whether or not the S1 ON signal is input.

レリーズボタン18が半押しされると、CPU90は撮影準備処理を実行する。   When the release button 18 is half-pressed, the CPU 90 executes shooting preparation processing.

まず、本撮影用のAE処理を実行し、本撮影時の露出条件を決定する(ステップS153)。すなわち、AE用の画像を取り込み、被写体の明るさを検出し、適正露出となるような露出条件(シャッタスピード、絞り値、ISO感度等)を決定する。   First, AE processing for main photographing is executed, and exposure conditions for main photographing are determined (step S153). That is, an AE image is taken in, the brightness of the subject is detected, and exposure conditions (shutter speed, aperture value, ISO sensitivity, etc.) that achieve proper exposure are determined.

次に、AF処理を実行する(ステップS154)。すなわち、フォーカスレンズ110を至近端から無限遠端に移動させて、あらかじめ設定されたフォーカスエリアの焦点評価値が極大となる位置を検出する。そして、検出した位置にフォーカスレンズを移動させる。   Next, AF processing is executed (step S154). That is, the focus lens 110 is moved from the closest end to the infinity end, and a position where the focus evaluation value in a preset focus area is maximized is detected. Then, the focus lens is moved to the detected position.

この際、主要被写体が検出されている場合には、検出した主要被写体にフォーカスエリアが設定され、焦点合わせが行われる。   At this time, when a main subject is detected, a focus area is set for the detected main subject, and focusing is performed.

この後、CPU90は、操作系制御部84からの入力に基づいて、レリーズボタン18が全押されたか否かを判定する(ステップS155)。なお、レリーズボタン18が全押しされると、本撮影指示信号として、S2ON信号がCPU90に入力される(全押しが解除されていると、S2OFF)。CPU90は、このS2ON信号の入力の有無に基づいて、レリーズボタン18が全押しされているか否かを判定する。   Thereafter, the CPU 90 determines whether or not the release button 18 has been fully pressed based on an input from the operation system control unit 84 (step S155). When the release button 18 is fully pressed, an S2 ON signal is input to the CPU 90 as a main shooting instruction signal (S2 OFF when the full press is released). The CPU 90 determines whether or not the release button 18 is fully pressed based on whether or not the S2ON signal is input.

ここで、レリーズボタン18が全押しされていないと判定すると、CPU90は、操作系制御部84からの入力に基づいて、レリーズボタン18の半押しが解除されたか否かを判定する(ステップS158)。そして、レリーズボタン18の半押しが解除されていると判定すると、ステップS151に戻り、再度、撮影前処理を実行する。   If it is determined that the release button 18 has not been fully pressed, the CPU 90 determines whether or not the half-press of the release button 18 has been released based on the input from the operation system control unit 84 (step S158). . If it is determined that the half-press of the release button 18 is released, the process returns to step S151 and the pre-shooting process is executed again.

一方、レリーズボタン18が全押しされていると判定すると、CPU90は、本撮影の処理を実行する(ステップS156)。すなわち、上記のAE処理により求めた露出条件でCCD54を露光し、記録用の画像の取り込みを行う。そして、得られた画像を記録メディア78に記録する(ステップS157)。   On the other hand, when determining that the release button 18 is fully pressed, the CPU 90 executes a process of actual photographing (step S156). That is, the CCD 54 is exposed under the exposure conditions obtained by the AE process, and a recording image is captured. Then, the obtained image is recorded on the recording medium 78 (step S157).

このように、本撮影前に主要被写体の検出処理を行い、本撮影時は、検出した主要被写体にピントを合わせて撮影することにより、中央以外の領域に主要被写体が存在している場合であっても、主要被写体にピントがあった画像を撮影することができる。   In this way, the main subject is detected before the main shooting, and the main shooting is performed when the main subject is present in a region other than the center by focusing on the detected main subject. However, it is possible to take an image in which the main subject is in focus.

なお、上記の例では、本撮影前に主要被写体の検出処理を行い、検出された主要被写体にS1時のフォーカスエリアを設定しているが、顔が検出された場合は、検出した顔にS1時のフォーカスエリアを設定する構成としてもよい。   In the above example, the main subject detection process is performed before the main photographing, and the focus area at S1 is set for the detected main subject. However, when a face is detected, the detected face is set to S1. It may be configured to set the current focus area.

また、上記の例では、S1後のAF処理時にフォーカスレンズを至近端から無限遠端まで移動させて、焦点評価値が極大となる位置を検出しているが、主要被写体を検出している場合は、その主要被写体を検出した時のフォーカスレンズの位置を基準とし、その前後所定範囲に焦点評価値サーチ範囲を限定して、AF処理を行うようにしてもよい。これにより、より迅速にピント合わせを行うことができる。   In the above example, the focus lens is moved from the closest end to the infinity end during AF processing after S1, and the position where the focus evaluation value is maximized is detected, but the main subject is detected. In this case, the AF processing may be performed by limiting the focus evaluation value search range to a predetermined range before and after the position of the focus lens when the main subject is detected. Thereby, focusing can be performed more quickly.

〈第3の実施の形態〉
コンティニュアスAFの一形態として、自動追尾機能が知られている。自動追尾機能は、図29に示すように、ピントを合わせたい被写体を指定すると、その被写体の移動に合わせてフォーカスエリアを自動的に移動させ、指定した被写体にピントを合わせ続けるものである。
<Third Embodiment>
As one form of continuous AF, an automatic tracking function is known. As shown in FIG. 29, in the automatic tracking function, when a subject to be focused is designated, the focus area is automatically moved in accordance with the movement of the subject, and the designated subject is continuously focused.

本実施の形態では、ライブビュー中に主要被写体の検出処理を行い、検出した主要被写体を自動追尾の対象に自動的に設定する。   In the present embodiment, main subject detection processing is performed during live view, and the detected main subject is automatically set as an automatic tracking target.

図30は、ライブビュー中に検出した主要被写体の位置を自動追尾の対象に設定する処理の手順を示すフローチャートである。   FIG. 30 is a flowchart illustrating a processing procedure for setting the position of the main subject detected during live view as a target for automatic tracking.

まず、顔検出が行われ(ステップS171)、顔が検出されたか否かが判定される(ステップS172)。   First, face detection is performed (step S171), and it is determined whether a face is detected (step S172).

顔が検出された場合は、検出された顔の位置にフォーカスエリアが設定され、顔コンティニュアスAFが行われる(ステップS173)。顔コンティニュアスAFは、顔が検出されなくなるまで行われる。   If a face is detected, a focus area is set at the position of the detected face, and face continuous AF is performed (step S173). The face continuous AF is performed until no face is detected.

一方、顔が検出されない場合は、画面中央にフォーカスエリアが設定され、中央コンティニュアスAFが行われる(ステップS180)。この後、中央コンティニュアスAFが合焦したか否か(あるいは、合焦に近い状態になったか否か)が判定される(ステップS181)。   On the other hand, when a face is not detected, a focus area is set at the center of the screen, and central continuous AF is performed (step S180). Thereafter, it is determined whether or not the central continuous AF is in focus (or whether or not the focus is close to the focus) (step S181).

中央コンティニュアスAFが合焦していない場合は、ステップS171に戻り、再度、顔検出が行われる。   If the central continuous AF is not in focus, the process returns to step S171 and face detection is performed again.

一方、コンティニュアスAFが合焦した場合(あるいは、合焦に近い状態になった場合)は、撮影シーンが変動したか否かが判定される(ステップS182)。   On the other hand, when the continuous AF is in focus (or when it is close to the focus), it is determined whether or not the shooting scene has changed (step S182).

ここでのシーン変動の検出は、あらかじめ登録された画像と現在撮影されている画像とを比較し、シーンに変動が生じているか否かを判定する。比較対象とする画像は、主要被写体を検出した際の画像である。したがって、初回はシーン変動の有無は判別せずに多点測距が実行される。   In this case, the scene change is detected by comparing a pre-registered image with the currently captured image to determine whether or not the scene has changed. The image to be compared is an image when the main subject is detected. Therefore, multipoint ranging is executed for the first time without determining whether or not there is a scene change.

シーン変動がない場合は、ステップS171に戻り、再度、顔検出が行われる。   If there is no scene change, the process returns to step S171, and face detection is performed again.

一方、シーンが変動した場合は、中央コンティニュアスAFが停止され、多点測距が行われる(ステップS183)。そして、その多点測距の結果に基づいて、焦点評価値が極大(ピーク)となる位置が検出された測距エリアの有無が判定される(ステップS184)。   On the other hand, when the scene changes, the central continuous AF is stopped and multipoint distance measurement is performed (step S183). Then, based on the result of the multipoint distance measurement, it is determined whether or not there is a distance measurement area where the position where the focus evaluation value is maximized (peak) is detected (step S184).

この判定の結果、ピークが検出された測距エリアがないと判定されると、ステップS171に戻り、再度、顔検出が行われる。   As a result of this determination, if it is determined that there is no ranging area in which the peak is detected, the process returns to step S171 and face detection is performed again.

一方、ピークが検出された測距エリアがあると判定されると、画像の取り込みが行われる。そして、取り込まれた画像が、比較用の基準画像として登録される(ステップS185)。この処理は、たとえば、比較用の基準画像をフレームメモリ74に記録することにより行われる。    On the other hand, when it is determined that there is a ranging area where the peak is detected, an image is captured. Then, the captured image is registered as a reference image for comparison (step S185). This process is performed, for example, by recording a reference image for comparison in the frame memory 74.

比較用の基準画像の登録後、上記の主要被写体の検出処理の技術を利用して、主要被写体の検出が行われる(ステップS186)。そして、検出された主要被写体の位置が自動追尾の初期位置に設定される(ステップS187)。   After registration of the reference image for comparison, main subject detection is performed using the above-described main subject detection processing technique (step S186). Then, the detected position of the main subject is set to the initial position for automatic tracking (step S187).

このように、本実施の形態では、ライブビュー中に主要被写体の検出処理を行い、検出した主要被写体の位置を自動追尾の初期位置に自動的に設定する。これにより、自動追尾を行う際、撮影者が初期位置の指定処理を行う必要がなくなり、デジタルカメラの使い勝手を向上させることができる。   As described above, in the present embodiment, the main subject is detected during the live view, and the detected position of the main subject is automatically set as the initial position for automatic tracking. This eliminates the need for the photographer to specify the initial position when performing automatic tracking, thereby improving the usability of the digital camera.

10…デジタルカメラ、12…カメラボディ、14…撮影レンズ、16…フラッシュ、18…レリーズボタン、20…ズームレバー、22…電源ボタン、24…モニタ、26…メニュー/OKボタン、28…十字ボタン、30…Backボタン、32…再生ボタン、50…レンズ駆動部、52…フラッシュ制御部、54…撮像素子(CCD)、56…CCD制御部、58…アナログ信号処理部、60…タイミングジェネレータ、62…画像入力コントローラ、64…AF処理部、64A…ハイパスフィルタ(HPF)、64B…ゲート、64C…加算器、66…AE/AWB処理部、68…画像処理部、70…顔検出部、72…圧縮/伸張処理部、74…フレームメモリ、76…メディア制御部、78…記録メディア、80…表示制御部、82…操作部、84…操作系制御部、86…主要被写体候補エリア検出部、88…主要被写体検出部、90…CPU、92…EEPROM、110…フォーカスレンズ、112…ズームレンズ、114…絞り、116…シャッタ、120…フォーカスレンズ駆動部、122…ズームレンズ駆動部、124…絞り駆動部、126…シャッタ駆動部   DESCRIPTION OF SYMBOLS 10 ... Digital camera, 12 ... Camera body, 14 ... Shooting lens, 16 ... Flash, 18 ... Release button, 20 ... Zoom lever, 22 ... Power button, 24 ... Monitor, 26 ... Menu / OK button, 28 ... Cross button, DESCRIPTION OF SYMBOLS 30 ... Back button, 32 ... Playback button, 50 ... Lens drive part, 52 ... Flash control part, 54 ... Imaging device (CCD), 56 ... CCD control part, 58 ... Analog signal processing part, 60 ... Timing generator, 62 ... Image input controller, 64 ... AF processing unit, 64A ... high pass filter (HPF), 64B ... gate, 64C ... adder, 66 ... AE / AWB processing unit, 68 ... image processing unit, 70 ... face detection unit, 72 ... compression / Decompression processing unit, 74 ... Frame memory, 76 ... Media control unit, 78 ... Recording media, 80 ... Display control unit, 8 DESCRIPTION OF SYMBOLS ... Operation part, 84 ... Operation system control part, 86 ... Main subject candidate area detection part, 88 ... Main subject detection part, 90 ... CPU, 92 ... EEPROM, 110 ... Focus lens, 112 ... Zoom lens, 114 ... Aperture, 116 ... Shutter, 120 ... Focus lens drive unit, 122 ... Zoom lens drive unit, 124 ... Aperture drive unit, 126 ... Shutter drive unit

Claims (12)

撮像光学系と、
前記撮像光学系を介して画像を撮像する撮像手段と、
前記撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距手段と、
前記多点測距手段の測定結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出する主要被写体候補エリア検出手段であって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定する主要被写体候補エリア検出手段と、
前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定する詳細サーチ範囲設定手段と、
前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出する主要被写体位置検出手段と、
前記主要被写体位置検出手段によって検出された主要被写体の位置にフォーカスエリアを設定するフォーカスエリア設定手段と、
前記主要被写体候補エリアの合焦位置を基準に一定範囲で検出範囲を設定し、該検出範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定する測距手段と、
前記測距手段で測定された被写体距離と前記主要被写体候補エリアの被写体距離との差を求め、その差が閾値を超えている場合に前記主要被写体の位置を前記主要被写体候補エリアの中心に修正する主要被写体位置修正手段と、
を備えたことを特徴とする撮像装置。
An imaging optical system;
Imaging means for imaging an image via the imaging optical system;
Dividing the imaging region of the imaging unit into a plurality of distance measurement areas, and multi-point distance measuring means for measuring a subject distance in each ranging area,
A main subject candidate area detecting unit that detects, as a main subject candidate area, a ranging area estimated to belong to a main subject based on a measurement result of the multipoint ranging unit, and calculates a subject distance of each ranging area. Add the value weighted with a greater weight to the distance measurement area closer to the center of the screen and the value weighted with a greater weight to the subject distance of each distance measurement area to obtain the characteristics of the main subject in each distance measurement area. A main subject candidate area detecting means for digitizing and selecting a distance measuring area having a maximum value as a main subject candidate area;
Detailed search range setting means for setting a specific range centered on the center of the main subject candidate area as a detailed search range;
A main subject position detecting means for analyzing an image captured by the imaging means within the detailed search range and detecting a position of a main subject;
Focus area setting means for setting a focus area at the position of the main subject detected by the main subject position detecting means;
An image obtained from the imaging means in the focus area by setting a detection range within a certain range with reference to the focus position of the main subject candidate area and changing the focal position of the imaging optical system within the detection range. Ranging means for detecting the position where the contrast of the maximum is detected and measuring the subject distance of the focus area;
The difference between the subject distance measured by the distance measuring means and the subject distance of the main subject candidate area is obtained, and when the difference exceeds a threshold, the position of the main subject is corrected to the center of the main subject candidate area. Main subject position correcting means for
An imaging apparatus comprising:
前記主要被写体位置修正手段は、前記測距手段で前記コントラストが最大となる位置が検出できない場合も前記主要被写体の位置を前記主要被写体候補エリアの中心に修正することを特徴とする請求項に記載の撮像装置。 The main subject position correcting means, to claim 1, characterized in that to correct the position of the main subject even when the contrast can not be detected by the position with the maximum in the distance measuring means in the center of the main subject candidate areas The imaging device described. 撮像光学系と、
前記撮像光学系を介して画像を撮像する撮像手段と、
前記撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距手段と、
前記多点測距手段の測定結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出する主要被写体候補エリア検出手段であって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定する主要被写体候補エリア検出手段と、
前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定する詳細サーチ範囲設定手段と、
前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出する主要被写体位置検出手段と、
前記主要被写体位置検出手段によって検出された主要被写体の位置にフォーカスエリアを設定するフォーカスエリア設定手段と、
前記主要被写体候補エリアの合焦位置の前後所定範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定する測距手段と、
前記測距手段による測定の結果、前記コントラストが最大となる位置が検出されない場合、前記主要被写体の位置を前記主要被写体候補エリアの中心に修正する主要被写体位置修正手段と、
を備えたことを特徴とする撮像装置。
An imaging optical system;
Imaging means for imaging an image via the imaging optical system;
Dividing the imaging region of the imaging unit into a plurality of distance measurement areas, and multi-point distance measuring means for measuring a subject distance in each ranging area,
A main subject candidate area detecting unit that detects, as a main subject candidate area, a ranging area estimated to belong to a main subject based on a measurement result of the multipoint ranging unit, and calculates a subject distance of each ranging area. Add the value weighted with a greater weight to the distance measurement area closer to the center of the screen and the value weighted with a greater weight to the subject distance of each distance measurement area to obtain the characteristics of the main subject in each distance measurement area. A main subject candidate area detecting means for digitizing and selecting a distance measuring area having a maximum value as a main subject candidate area;
Detailed search range setting means for setting a specific range centered on the center of the main subject candidate area as a detailed search range;
A main subject position detecting means for analyzing an image captured by the imaging means within the detailed search range and detecting a position of a main subject;
Focus area setting means for setting a focus area at the position of the main subject detected by the main subject position detecting means;
By changing the focal position of the imaging optical system within a predetermined range before and after the in-focus position of the main subject candidate area, a position where the contrast of the image obtained from the imaging unit is maximized in the focus area is detected. Ranging means for measuring the subject distance of the focus area;
As a result of the measurement by the distance measuring means, when the position where the contrast is maximum is not detected, main subject position correcting means for correcting the position of the main subject to the center of the main subject candidate area;
An imaging apparatus comprising:
前記主要被写体位置検出手段は、前記詳細サーチ範囲内で、主要被写体らしさの最も大きいところを主要被写体の位置として検出する請求項1から3のいずれか1項に記載の撮像装置。   The imaging apparatus according to any one of claims 1 to 3, wherein the main subject position detection unit detects a position where the main subject is most likely to be a main subject position within the detailed search range. 前記主要被写体位置検出手段は、前記詳細サーチ範囲内を中央から外側に向かってサーチし、主要被写体らしさの評価値が、閾値を超えた時点の位置を主要被写体の位置として検出する請求項1から3のいずれか1項に記載の撮像装置。   The main subject position detecting means searches the detailed search range from the center to the outside, and detects the position at the time when the evaluation value of the main subjectness exceeds a threshold as the position of the main subject. 4. The imaging device according to any one of 3. 前記詳細サーチ範囲設定手段は、前記多点測距手段によって得られる前記各測距エリアの被写体距離を比較したときに、前記主要被写体候補エリアの被写体距離との差が閾値以上の測距エリアを除外して、前記詳細サーチ範囲を設定することを特徴とする請求項1〜5のいずれか1項に記載の撮像装置。 The detailed search range setting means, wherein when comparing the object distance of each ranging area obtained by a multi-point distance measuring means, said distance measuring the difference of the subject distance Prefecture is not less than the threshold value of the main object candidate areas 6. The imaging apparatus according to claim 1, wherein the detailed search range is set excluding an area. 前記多点測距手段は、前記撮像光学系の焦点位置を変化させて、前記測距エリアごとに前記撮像手段から得られる画像のコントラストが極大となる位置を検出することにより、前記各測距エリアにおける被写体距離を測定し、
前記詳細サーチ範囲設定手段は、前記コントラストが極大となる位置が2以上検出された測距エリアを除外して、前記詳細サーチ範囲を設定することを特徴とする請求項1から6のいずれか1項に記載の撮像装置。
The multipoint distance measuring means changes the focal position of the imaging optical system, and detects the position where the contrast of the image obtained from the imaging means is maximized for each distance measurement area, thereby each of the distance measuring means. the subject distance is measured in the area,
7. The detailed search range setting means sets the detailed search range by excluding a ranging area where two or more positions where the contrast becomes maximum is detected. The imaging device according to item.
前記詳細サーチ範囲設定手段は、前記主要被写体候補エリアの被写体距離に応じて前記詳細サーチ範囲の大きさを拡縮して設定することを特徴とする請求項1〜5のいずれか1項に記載の撮像装置。 The detailed search range setting means, according to any one of claims 1 to 5, characterized in that set by scaling the magnitude of the detailed search range according to the object distance of the main subject candidate areas Imaging device. 前記撮像光学系は、変倍光学系を備え、
前記詳細サーチ範囲設定手段は、前記撮像光学系の焦点距離に応じて前記詳細サーチ範囲の大きさを拡縮して設定することを特徴とする請求項1〜5のいずれか1項に記載の撮像装置。
The imaging optical system includes a variable magnification optical system,
The imaging according to any one of claims 1 to 5, wherein the detailed search range setting means sets the size of the detailed search range in accordance with a focal length of the imaging optical system. apparatus.
前記主要被写体位置検出手段は、画像特性として、エッジ成分の多さ、又は、同色系の塊の大きさの少なくとも一方の情報を利用して、主要被写体を検出することを特徴とする請求項1からのいずれか1項に記載の撮像装置。 2. The main subject position detection unit detects a main subject by using at least one of information on the number of edge components or the size of a cluster of the same color system as an image characteristic. The imaging device according to any one of 1 to 9 . 撮像光学系を介して画像を撮像する撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距するステップと、
前記多点測距の結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出するステップであって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定するステップと、
前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定するステップと、
前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出するステップと、
検出された主要被写体の位置にフォーカスエリアを設定するステップと、
前記主要被写体候補エリアの合焦位置を基準に一定範囲で検出範囲を設定し、該検出範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定するステップと、
測定された被写体距離と前記主要被写体候補エリアの被写体距離との差を求め、その差が閾値を超えている場合に前記主要被写体の位置を前記主要被写体候補エリアの中心に修正するステップと、
からなることを特徴とする主要被写体検出方法。
A step of the imaging region of the imaging means into a plurality of distance measurement areas is ranging multipoint measuring the subject distance in each ranging area for capturing an image through an imaging optical system,
A step of detecting, as a main subject candidate area, a range finding area to which the main subject belongs based on the result of the multipoint ranging, and measuring the subject distance of each range finding area close to the center of the screen The value weighted with a larger weight for each area and the value weighted with a larger weight for the subject distance of each distance measurement area are added together to quantify the characteristics of the main subject in each distance measurement area. Selecting a target ranging area as a main subject candidate area,
Setting a specific range centered on the center of the main subject candidate area as a detailed search range;
Analyzing an image captured by the imaging means within the detailed search range, and detecting a position of a main subject;
Setting a focus area at the position of the detected main subject;
An image obtained from the imaging means in the focus area by setting a detection range within a certain range with reference to the focus position of the main subject candidate area and changing the focal position of the imaging optical system within the detection range. Detecting the position where the contrast of the maximum is detected and measuring the subject distance of the focus area;
Obtaining a difference between the measured subject distance and the subject distance of the main subject candidate area, and correcting the position of the main subject to the center of the main subject candidate area when the difference exceeds a threshold;
A main subject detection method characterized by comprising:
撮像光学系を介して画像を撮像する撮像手段の撮像領域を複数の測距エリアに分割し、各測距エリアにおける被写体距離を測定する多点測距するステップと、
前記多点測距の結果に基づいて、主要被写体が属すると推定される測距エリアを主要被写体候補エリアとして検出するステップであって、各測距エリアの被写体距離を画面の中心に近い測距エリアほど大きな重みで重み付けした値と、各測距エリアの被写体距離を近距離ほど大きな重みで重み付けした値と、を加算して、各測距エリアの主要被写体らしさを数値化し、数値が最大となる測距エリアを主要被写体候補エリアに選定するステップと、
前記主要被写体候補エリアの中心を中心とした一定の範囲を詳細サーチ範囲に設定するステップと、
前記撮像手段で撮像される画像を前記詳細サーチ範囲内で解析して、主要被写体の位置を検出するステップと、
検出された主要被写体の位置にフォーカスエリアを設定するステップと、
前記主要被写体候補エリアの合焦位置の前後所定範囲で前記撮像光学系の焦点位置を変化させることにより、前記フォーカスエリアにおいて、前記撮像手段から得られる画像のコントラストが極大となる位置を検出し、前記フォーカスエリアの被写体距離を測定するステップと、
測定の結果、前記コントラストが最大となる位置が検出されない場合、前記主要被写体の位置を前記主要被写体候補エリアの中心に修正するステップと、
からなることを特徴とする主要被写体検出方法。
A step of the imaging region of the imaging means into a plurality of distance measurement areas is ranging multipoint measuring the subject distance in each ranging area for capturing an image through an imaging optical system,
A step of detecting, as a main subject candidate area, a range finding area to which the main subject belongs based on the result of the multipoint ranging, and measuring the subject distance of each range finding area close to the center of the screen The value weighted with a larger weight for each area and the value weighted with a larger weight for the subject distance of each distance measurement area are added together to quantify the characteristics of the main subject in each distance measurement area. Selecting a target ranging area as a main subject candidate area,
Setting a specific range centered on the center of the main subject candidate area as a detailed search range;
Analyzing an image captured by the imaging means within the detailed search range, and detecting a position of a main subject;
Setting a focus area at the position of the detected main subject;
By changing the focal position of the imaging optical system within a predetermined range before and after the in-focus position of the main subject candidate area, a position where the contrast of the image obtained from the imaging unit is maximized in the focus area is detected. Measuring the subject distance of the focus area;
As a result of measurement, if the position where the contrast is maximum is not detected, correcting the position of the main subject to the center of the main subject candidate area;
A main subject detection method characterized by comprising:
JP2010276101A 2010-12-10 2010-12-10 Imaging apparatus and main subject detection method Expired - Fee Related JP5665512B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010276101A JP5665512B2 (en) 2010-12-10 2010-12-10 Imaging apparatus and main subject detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010276101A JP5665512B2 (en) 2010-12-10 2010-12-10 Imaging apparatus and main subject detection method

Publications (2)

Publication Number Publication Date
JP2012123324A JP2012123324A (en) 2012-06-28
JP5665512B2 true JP5665512B2 (en) 2015-02-04

Family

ID=46504796

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010276101A Expired - Fee Related JP5665512B2 (en) 2010-12-10 2010-12-10 Imaging apparatus and main subject detection method

Country Status (1)

Country Link
JP (1) JP5665512B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112601027A (en) * 2020-10-27 2021-04-02 浙江华创视讯科技有限公司 Automatic focusing method and device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6087617B2 (en) * 2012-12-21 2017-03-01 キヤノン株式会社 Imaging apparatus and control method thereof
JP6323314B2 (en) 2014-11-28 2018-05-16 富士通株式会社 Focus control device and focus control program
JP2016118634A (en) * 2014-12-19 2016-06-30 オリンパス株式会社 Imaging device and imaging method
KR101809211B1 (en) 2017-09-01 2017-12-14 한화시스템 주식회사 Infrared camera and method for optical alignment of the same
JP7095002B2 (en) * 2020-02-19 2022-07-04 キヤノン株式会社 Image processing equipment, imaging equipment, image processing methods, computer programs and storage media

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02109008A (en) * 1988-10-18 1990-04-20 Sony Corp Automatic focusing control method
JPH05196858A (en) * 1992-01-22 1993-08-06 Fuji Photo Film Co Ltd Camera
JP2005223658A (en) * 2004-02-06 2005-08-18 Nikon Gijutsu Kobo:Kk Digital camera
JP2007096437A (en) * 2005-09-27 2007-04-12 Seiko Epson Corp Determination of image creator's intention
JP2007199633A (en) * 2006-01-30 2007-08-09 Olympus Corp Focusing detector
JP5159515B2 (en) * 2008-08-26 2013-03-06 キヤノン株式会社 Image processing apparatus and control method thereof
JP5210843B2 (en) * 2008-12-12 2013-06-12 パナソニック株式会社 Imaging device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112601027A (en) * 2020-10-27 2021-04-02 浙江华创视讯科技有限公司 Automatic focusing method and device
CN112601027B (en) * 2020-10-27 2021-06-15 浙江华创视讯科技有限公司 Automatic focusing method and device

Also Published As

Publication number Publication date
JP2012123324A (en) 2012-06-28

Similar Documents

Publication Publication Date Title
JP5546646B2 (en) Imaging apparatus and main subject recognition method
US7791668B2 (en) Digital camera
JP4444927B2 (en) Ranging apparatus and method
JP5394296B2 (en) Imaging apparatus and image processing method
JP4518131B2 (en) Imaging method and apparatus
US8570422B2 (en) Apparatus, method, and recording medium containing program for photographing
JP6457776B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP3679693B2 (en) Auto focus camera
JP5665512B2 (en) Imaging apparatus and main subject detection method
US20100171871A1 (en) Image sensing apparatus and control method therefor
JP6116277B2 (en) Imaging apparatus and control method thereof
JP2009188490A (en) Image processing apparatus, and program
KR101542436B1 (en) Imaging apparatus and imaging method
JP5267609B2 (en) Imaging apparatus and program thereof
JP2018045102A (en) Focus adjustment device and imaging apparatus
JP2007101907A (en) Autofocus controller, image forming apparatus using same and autofocus control method
JP5045538B2 (en) Imaging apparatus and program
US9282234B2 (en) Focus adjustment apparatus and method, and image capturing apparatus
CN108780209A (en) Focusing position detection device and method for detecting state of focusing
JP2005233985A (en) Auto-focus camera
JP5030883B2 (en) Digital still camera and control method thereof
JP4771524B2 (en) Imaging apparatus and program thereof
JP2006039254A (en) Camera
JP2013213875A (en) Focus adjustment device, imaging device, and focus adjustment program
JP5069076B2 (en) Imaging apparatus and continuous imaging method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130605

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140312

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140401

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140527

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140820

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141016

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20141125

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141209

R150 Certificate of patent or registration of utility model

Ref document number: 5665512

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees