JP5615756B2 - Imaging apparatus and imaging program - Google Patents

Imaging apparatus and imaging program Download PDF

Info

Publication number
JP5615756B2
JP5615756B2 JP2011080968A JP2011080968A JP5615756B2 JP 5615756 B2 JP5615756 B2 JP 5615756B2 JP 2011080968 A JP2011080968 A JP 2011080968A JP 2011080968 A JP2011080968 A JP 2011080968A JP 5615756 B2 JP5615756 B2 JP 5615756B2
Authority
JP
Japan
Prior art keywords
area
subject
phase difference
inclusion
spatial frequency
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
JP2011080968A
Other languages
Japanese (ja)
Other versions
JP2012215700A (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 JP2011080968A priority Critical patent/JP5615756B2/en
Publication of JP2012215700A publication Critical patent/JP2012215700A/en
Application granted granted Critical
Publication of JP5615756B2 publication Critical patent/JP5615756B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、撮像装置及び撮像プログラムに係り、特に、被写体までの距離を検出し撮像レンズの焦点位置制御を行う撮像装置及び撮像プログラムに関する。   The present invention relates to an imaging apparatus and an imaging program, and more particularly, to an imaging apparatus and an imaging program that detect a distance to a subject and control a focal position of an imaging lens.

主要な被写体までの距離を検出する合焦位置検出には、コントラスト方式や位相差オートフォーカス(以下、位相差AFという)方式が知られている。位相差AF方式は、コントラスト方式に比べて合焦位置の検出を高速,高精度に行うことができるため、一眼レフカメラで多く採用されている。   Contrast methods and phase difference autofocus (hereinafter referred to as phase difference AF) methods are known for focus position detection for detecting the distance to a main subject. The phase difference AF method is often used in single-lens reflex cameras because it can detect the in-focus position at a higher speed and with higher accuracy than the contrast method.

特許文献1には、撮影画像の輝度分布から、撮影シーンを判定し、判定したシーンに応じたフィルタ処理を行った後、位相差AFの評価値の演算を行う技術が開示されている。   Japanese Patent Application Laid-Open No. 2004-228561 discloses a technique for determining a shooting scene from the luminance distribution of a shot image, performing filter processing according to the determined scene, and then calculating an evaluation value of phase difference AF.

また、特許文献2には、撮影画像の周波数分布に応じて、位相差AF方式とコントラスト方式とを切り替える技術が開示されている。   Patent Document 2 discloses a technique for switching between a phase difference AF method and a contrast method according to the frequency distribution of a captured image.

さらに、特許文献3には、顔特徴量抽出処理によって撮影画像から被写体を検出し、合焦動作前に予め検出された被写体の種類等に応じてAF評価値演算阻害領域を決定し、マルチエリアAFの各AFエリアからその領域を除外した後の残存領域を用いてAF評価値の演算を行う技術が開示されている。   Further, in Patent Document 3, a subject is detected from a captured image by face feature amount extraction processing, an AF evaluation value calculation inhibition region is determined according to the type of subject detected in advance before the focusing operation, and the like. A technique is disclosed in which an AF evaluation value is calculated using a remaining area after the area is excluded from each AF area of AF.

特開2003―215434号公報JP 2003-215434 A 特開2009―63921号公報JP 2009-63922 A 特開2010―160297号公報JP 2010-160297 A

しかしながら、被写体に対する合焦位置を検出するためにはある程度の領域(画角)が必要であり、被写体のみならず、その背景を含む領域を、検出対象の領域とする場合がある。例えば、顔などの主要被写体に合焦を希望する場合、顔の背景を含む一定の領域を合焦の検出対象としたときには、その背景に対して合焦される場合がある。   However, in order to detect the in-focus position with respect to the subject, a certain area (view angle) is required, and not only the subject but also the area including the background may be the detection target area. For example, when it is desired to focus on a main subject such as a face, when a certain region including the background of the face is a focus detection target, the background may be focused.

本発明は上記事実を考慮してなされたものであり、位相差AFにより被写体に合焦するときに、被写体に対して忠実に合焦することができる撮像装置及び撮像プログラムを提供することを目的とする。   The present invention has been made in view of the above facts, and an object thereof is to provide an imaging apparatus and an imaging program capable of faithfully focusing on a subject when the subject is focused by phase difference AF. And

上記目的を達成するため、請求項1記載の発明の撮像装置は、被写体の画像を撮像する受光面に設けられた位相差検出エリア内に、瞳分割した第1の位相差検出画素及び第2の位相差検出画素で構成されるペア画素が配列形成された撮像素子と、前記撮像素子の前段に置かれ、前記被写体の合焦した光学像を前記受光面に結像させる合焦位置に制御される撮像レンズと、合焦する被写体を特定し、該合焦する被写体の領域及び背景エリアを含む包含エリアと、該合焦する被写体の領域の内部の一部からなり、背景エリアを含まない内包エリアの各々を設定するエリア設定手段と、前記設定した包含エリア及び内包エリアの各々の空間周波数分布を演算し、演算した空間周波数分布の各々に基づいて前記被写体の領域に対応する周波数域の空間周波数を除去するフィルタを作成するフィルタ作成手段と、前記作成したフィルタを用いて前記被写体の領域に対応する周波数域の空間周波数に該当する前記第1の位相差検出画素の第1検出情報と前記第2の位相差検出画素の第2検出情報とを生成する生成手段と、前記生成した第1検出情報と第2検出情報との相関関係を示す被写体の相関演算曲線を求め、該相関演算曲線から前記撮像レンズを前記合焦位置に制御する位相差を求める位相差演算手段と、前記求めた位相差に基づき前記撮像レンズを前記合焦位置に制御する位置制御手段と、を備えている。 In order to achieve the above object, an imaging apparatus according to a first aspect of the present invention includes a first phase difference detection pixel and a second phase division pixel divided into pupils in a phase difference detection area provided on a light receiving surface for capturing an image of a subject. An image sensor in which paired pixels composed of phase difference detection pixels are arrayed and a focus position that is placed in front of the image sensor and forms a focused optical image of the subject on the light receiving surface It includes an imaging lens which is to identify the object to be focused, and encompasses the area including the area and the background area of the subject to be focused該合, Ri Do from part of the internal region of the subject to be focused 該合, the background area An area setting means for setting each of the non- included areas , a spatial frequency distribution of each of the set inclusion area and the included area, and a frequency corresponding to the subject area based on each of the calculated spatial frequency distributions Area sky Wherein a filter creation unit for creating a filter for removing frequency, the first detection information of the first phase difference detection pixels corresponding to the spatial frequency of the frequency range corresponding to the region of the subject using a filter that the created A generating unit that generates second detection information of the second phase difference detection pixel, a correlation calculation curve of a subject indicating a correlation between the generated first detection information and the second detection information, and the correlation calculation curve comprises said imaging lens phase difference computation means for obtaining the phase difference to control the focus position, and position control means for controlling the imaging lens based on the phase difference the calculated to the case Asei location, from .

本発明によれば、合焦する被写体を全て含む包含エリアと、被写体の一部領域からなる内包エリアとを設定し、これらの包含エリア及び内包エリアの空間周波数分布に基づいて、被写体の空間周波数を通過させるフィルタを作成する。このフィルタを用いて被写体の領域に対応する第1検出情報と第2検出情報を生成して、これらの相関関係から撮像レンズを合焦位置に制御する位相差を求めて撮像レンズを合焦する。これにより、被写体のみによる空間周波数(帯域)を得るフィルタ作成が可能となり、この被写体のみによる空間周波数帯域を通過させるフィルタを用いて位相差検出画素の検出情報をフィルタ演算することで、背景を含む包含エリアであっても精度良く被写体に合焦させることができる。   According to the present invention, an inclusion area that includes all of the subjects to be focused and an inclusion area that is a partial area of the subject are set, and the spatial frequency of the subject is determined based on the spatial frequency distribution of these inclusion areas and inclusion areas. Create a filter that passes. Using this filter, first detection information and second detection information corresponding to the region of the subject are generated, and a phase difference for controlling the imaging lens to the in-focus position is obtained from these correlations, and the imaging lens is focused. . This makes it possible to create a filter that obtains a spatial frequency (band) based only on the subject. By filtering the detection information of the phase difference detection pixels using a filter that passes the spatial frequency band based only on the subject, the background is included. Even in the inclusion area, the subject can be focused with high accuracy.

なお、前記撮像素子は、水平方向及び垂直方向に配列された複数の光電変換素子を含むことができる。また、撮像素子は、半導体基板に二次元アレイ状に配列形成された複数の画素を備えかつ、前記複数画素のうち一部の画素が位相差検出画素として形成された固体撮像素子を採用することができる。   Note that the imaging element can include a plurality of photoelectric conversion elements arranged in a horizontal direction and a vertical direction. In addition, the imaging device includes a solid-state imaging device that includes a plurality of pixels arranged in a two-dimensional array on a semiconductor substrate and in which some of the plurality of pixels are formed as phase difference detection pixels. Can do.

請求項2の発明では、前記フィルタ作成手段は、前記包含エリア及び内包エリアの空間周波数分布のうち類似した空間周波数分布の周波域に対応する前記包含エリアの周波域を、前記被写体の領域としてフィルタを作成する。作成したフィルタ、例えば、空間周波数分布のうち低周波帯域を通過させるフィルタにより、被写体のみの空間周波数による演算が可能となり、合焦精度が向上する。 In the invention of claim 2, wherein the filter creation means, the frequency range of the inclusion area corresponding to the frequency band of the spatial frequency distribution similar to one of the spatial frequency distribution of the inclusion area and enclosed areas, areas of the subject Create a filter as With the created filter, for example, a filter that passes a low frequency band in the spatial frequency distribution, calculation based on the spatial frequency of only the subject becomes possible, and focusing accuracy is improved.

請求項3の発明では、前記フィルタ作成手段は、前記包含エリア及び内包エリアの空間周波数分布に基づいて、前記包含エリアの空間周波数分布について前記被写体の領域と背景領域との各々に対応する周波域に分離し、分離した前記被写体の領域に対応する周波域を、前記被写体の領域としてフィルタを作成する。例えば、空間周波数の低周波帯域側で変曲点を分離ポイントとすることで、被写体と背景との空間周波数に分離することができ、合焦精度が向上する。 In the invention of claim 3, wherein the filter creation means, based on the spatial frequency distribution of the inclusion area and enclosed areas, frequency corresponding to each of said object regions and background regions on the spatial frequency distribution of the inclusion area separating the band, the frequency band corresponding to a region separate the object, to create a filter as an area of the subject. For example, by using the inflection point as the separation point on the low frequency band side of the spatial frequency, it is possible to separate the subject and the background into the spatial frequency, and the focusing accuracy is improved.

請求項4の発明では、前記エリア設定手段は、前記被写体領域の周囲を少なくとも含みかつ前記被写体領域の外周に外接する外接エリアを包含エリアに設定し、前記被写体領域のみからなり前記被写体領域の外周に内接する内接エリアを内包エリアに設定する。このように、内接エリアと外接エリアを設定することで、合焦演算するための画素数を増加でき、合焦精度が向上する。 In the invention of claim 4, wherein the area setting means sets a circumscribed area circumscribing the periphery of at least contain and region of the subject around the area of the subject to the inclusion area, the subject comprises only region of the subject setting the inscribed area inscribing the outer periphery of the area containing the area. In this way, by setting the inscribed area and the circumscribed area, the number of pixels for performing the in-focus calculation can be increased, and the in-focus accuracy is improved.

請求項5の発明では、前記エリア設定手段は、前記包含エリア及び内包エリアを四角形とし、前記合焦する被写体の中心から四角形を徐々に拡大して前記被写体領域の外周に内接した内包エリアを設定すると共に、前記被写体領域の周囲から四角形を徐々に縮小して前記被写体領域の外周に外接した包含エリアを設定する。このように、四角形例えば、長方形によってエリア設定が容易となる。 In the invention of claim 5, wherein the area setting means, the inclusion area and enclosed area is a square, enclosed area inscribed in the outer peripheral region of the gradually expanding to the subject a rectangle from the center of the object to focus the alloy it sets a set inclusion area gradually reduced rectangle from ambient circumscribes the outer peripheral region of the subject region of the subject. Thus, the area setting is facilitated by a quadrangle, for example, a rectangle.

請求項6の発明では、前記エリア設定手段は、前記四角形を徐々に拡大して前記内包エリアを設定する場合、前記被写体領域の外周に内接した内包エリアから予め定めた拡大設定量だけ拡大した拡大エリアを内包エリアとして設定する。例えば、エリアが極小の場合、そのエリアを拡大できるので、合焦演算するための画素数を増加でき、合焦精度が向上する。 Enlarge the invention of claim 6, wherein the area setting means, when setting the contained area gradually expanding the square, only larger set amount determined in advance from the inscribed enclosed area on the outer peripheral region of the subject Set the enlarged area as the inclusion area. For example, when the area is extremely small, the area can be enlarged, so that the number of pixels for performing the focusing calculation can be increased, and the focusing accuracy is improved.

請求項7の発明では、前記撮像レンズは、絞りを具備し、前記エリア設定手段は、前記撮像レンズの焦点距離及び絞り値に基づいて焦点深度を求め、求めた焦点深度に基づいて前記拡大設定量を設定する。焦点深度等の撮影条件に応じてエリアを拡大でき、合焦精度が向上する。   According to a seventh aspect of the present invention, the imaging lens includes an aperture, and the area setting unit obtains a focal depth based on a focal length and an aperture value of the imaging lens, and the enlargement setting based on the obtained focal depth. Set the amount. The area can be enlarged according to the photographing conditions such as the depth of focus, and the focusing accuracy is improved.

請求項8の発明では、前記エリア設定手段は、前記包含エリア及び内包エリアを四角形とし、前記四角形を徐々に拡大して前記内包エリアを設定する場合、前記四角形に含まれる画素数による面積及び前記四角形の縦横比について、予め定めた閾値を超える面積及び縦横比の拡大エリアを内包エリアとして設定する。従って、画素面積や縦横比(アスペクト比)でエリアを正弦できるので、合焦処理に必要な画素数を確保できる。   In the invention of claim 8, when the area setting means sets the inclusion area and the inclusion area to a rectangle and gradually sets the rectangle to set the inclusion area, the area setting unit and the area according to the number of pixels included in the rectangle For the rectangular aspect ratio, an area exceeding a predetermined threshold and an enlarged area with an aspect ratio are set as an inclusion area. Therefore, since the area can be sine by the pixel area and the aspect ratio (aspect ratio), the number of pixels necessary for the focusing process can be ensured.

請求項9の発明では、前記エリア設定手段は、前記被写体領域の重心を求め、求めた重心から四角形を徐々に拡大して内包エリアを設定する。これにより、被写体に忠実なエリア設定のための起点を設定できる。 In the invention of claim 9, wherein the area setting means determines a center of gravity of area of the object, it sets the encapsulated area gradually expanded heavy heart square was determined. Thereby, a starting point for setting an area faithful to the subject can be set.

請求項10の発明は、被写体の画像を撮像する受光面に設けられた位相差検出エリア内に、瞳分割した第1の位相差検出画素及び第2の位相差検出画素で構成されるペア画素が配列形成された撮像素子と、前記撮像素子の前段に置かれ、前記被写体の合焦した光学像を前記受光面に結像させる合焦位置に制御される撮像レンズと、を備えた撮像装置において実行させる撮像プログラムであって、合焦する被写体を特定し、該合焦する被写体の領域及び背景エリアを含む包含エリアと、該合焦する被写体の領域の内部の一部からなり、背景エリアを含まない内包エリアの各々を設定するエリア設定ステップと、前記設定した包含エリア及び内包エリアの各々の空間周波数分布を演算し、演算した空間周波数分布の各々に基づいて前記被写体の領域に対応する周波数域の空間周波数を除去するフィルタを作成するフィルタ作成ステップと、前記作成したフィルタを用いて前記被写体の領域に対応する周波数域の空間周波数に該当する前記第1の位相差検出画素の第1検出情報と前記第2の位相差検出画素の第2検出情報とを生成する生成ステップと、前記生成した第1検出情報と第2検出情報との相関関係を示す被写体の相関演算曲線を求め、該相関演算曲線から前記撮像レンズを前記合焦位置に制御する位相差を求める位相差演算ステップと、前記求めた位相差に基づき前記撮像レンズを前記合焦位置に制御する位置制御ステップと、の各ステップをコンピュータによって実行させる。 According to a tenth aspect of the present invention, a pair pixel composed of a first phase difference detection pixel and a second phase difference detection pixel obtained by dividing a pupil in a phase difference detection area provided on a light receiving surface for picking up an image of a subject. And an imaging lens that is placed in front of the imaging element and controlled to a focus position that forms an optical image focused on the subject on the light receiving surface. an imaging program to be executed in, to identify the object to be focused, and encompasses the area including the area and the background area of the subject to be focused該合, Ri Do from part of the internal region of the subject to be focused該合background an area setting step of setting each of the enclosed area without the area, calculates the spatial frequency distribution of each of the inclusion area and enclosed area for which the setting of the object based on each computed spatial frequency distribution A filter creation step of creating a filter for removing spatial frequency of the frequency band corresponding to frequency, the first phase difference detection corresponding to the spatial frequency of the frequency range corresponding to the region of the subject using a filter that the created A generation step of generating first detection information of a pixel and second detection information of the second phase difference detection pixel, and a subject correlation calculation indicating a correlation between the generated first detection information and second detection information calculated curves, a phase difference calculating step for obtaining the phase difference controlling the correlation operation curve the imaging lens to the focus position, a position for controlling the imaging lens based on the phase difference the calculated on the alloy Asei location The control steps are executed by a computer.

本発明によれば、被写体のみによる空間周波数を得るフィルタを用いて位相差検出画素の検出情報をフィルタ演算することで、背景を含む包含エリアであっても精度良く被写体に合焦させることができる、という効果を有する。   According to the present invention, by filtering the detection information of the phase difference detection pixels using a filter that obtains a spatial frequency based only on the subject, it is possible to focus on the subject with high accuracy even in the inclusion area including the background. Has the effect.

撮像装置の概略ブロック図である。It is a schematic block diagram of an imaging device. 位相差検出エリア40内の一部分の表面拡大模式図である。FIG. 4 is a schematic enlarged view of a part of a surface within a phase difference detection area 40. 位相差検出画素1x,1yの模式図である。It is a schematic diagram of the phase difference detection pixels 1x and 1y. 第1実施形態に係る撮像処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the imaging process which concerns on 1st Embodiment. 合焦処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a focusing process. エリアの模式図であり、(A)は被写体内エリア、(B)は被写体包含エリアを示す。It is a schematic diagram of an area, (A) shows an in-subject area and (B) shows a subject inclusion area. 被写体エリアの空間周波数分布を示す線図である。It is a diagram which shows the spatial frequency distribution of a to-be-photographed area. 第2実施形態に係る外接エリア設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the circumscribed area setting process which concerns on 2nd Embodiment. 第2実施形態に係る内接エリア設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the inscribed area setting process which concerns on 2nd Embodiment. 内接エリアの設定処理の流れについての説明図である。It is explanatory drawing about the flow of a setting process of an inscribed area. 外接エリアの設定処理の流れについての説明図である。It is explanatory drawing about the flow of a setting process of circumscribed area. 第3実施形態に係る内接エリア設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the inscribed area setting process which concerns on 3rd Embodiment. 内接エリアの設定処理の流れについての説明図である。It is explanatory drawing about the flow of a setting process of an inscribed area. 撮影条件で定まる焦点深度に対する拡大設定値の関係を示す線図である。It is a diagram which shows the relationship of the expansion setting value with respect to the focal depth determined by imaging | photography conditions. 第4実施形態に係る形状判定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the shape determination process which concerns on 4th Embodiment. 被写体エリアの形状に関する閾値を設定処理の説明図である。It is explanatory drawing of the threshold value setting process regarding the shape of a to-be-photographed area. 第5実施形態に係る重心設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the gravity center setting process which concerns on 5th Embodiment. 重心設定処理の流れについての説明図である。It is explanatory drawing about the flow of a gravity center setting process. 第6実施形態に係る被写体内エリアの設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the setting process of the to-be-photographed area based on 6th Embodiment.

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

(第1実施形態)
図1には、本発明の一実施形態に係る撮像装置10の概略ブロック図を示した。撮像装置10は、被写体の静止画像或いは動画像を撮影し撮像装置10内で撮像画像信号をデジタル処理する機能を有し、望遠レンズ及びフォーカスレンズを備える撮像レンズ20と、撮像レンズ20の背部に置かれその結像面に配置された固体撮像素子21と、固体撮像素子21の各画素から出力されるアナログの画像データを自動利得調整(AGC)や相関二重サンプリング処理等のアナログ処理するアナログ信号処理部22と、アナログ信号処理部22から出力されるアナログ画像データをデジタル画像データに変換するアナログデジタル変換部(A/D)23と、後述のシステム制御部(CPU)29からの指示によってA/D23,アナログ信号処理部22,固体撮像素子21,撮像レンズ20の駆動制御を行う駆動制御部24と、CPU29からの指示によって発光するフラッシュ25とを含んで構成されている。
(First embodiment)
FIG. 1 shows a schematic block diagram of an imaging apparatus 10 according to an embodiment of the present invention. The imaging device 10 has a function of capturing a still image or a moving image of a subject and digitally processing the captured image signal in the imaging device 10, and an imaging lens 20 including a telephoto lens and a focus lens, and a back of the imaging lens 20. The solid-state image sensor 21 placed on the imaging plane and analog image data output from each pixel of the solid-state image sensor 21 are subjected to analog processing such as automatic gain adjustment (AGC) and correlated double sampling processing. In response to an instruction from the signal processing unit 22, an analog / digital conversion unit (A / D) 23 that converts analog image data output from the analog signal processing unit 22 into digital image data, and a system control unit (CPU) 29 described later. A drive control unit 24 that performs drive control of the A / D 23, the analog signal processing unit 22, the solid-state imaging device 21, and the imaging lens 20; It is configured to include a flash 25 that emits light in response to an instruction from the CPU 29.

また、撮像装置10は、A/D23から出力されるデジタル画像データを取り込み補間処理やホワイトバランス補正,RGB/YC変換処理等を行うデジタル信号処理部26と、画像データをJPEG形式などの画像データに圧縮したり逆に伸長したりする圧縮/伸長処理部27と、メニューなどを表示したりスルー画像や撮像画像を表示する表示部28と、撮像装置全体を統括制御するシステム制御部(CPU)29と、フレームメモリ等の内部メモリ30と、JPEG画像データ等を格納する記録メディア32との間のインタフェース処理を行うメディアインタフェース(I/F)部31と、これらを相互に接続するバス40とを備えており、また、システム制御部29には、ユーザからの指示入力を行う操作部33が接続されている。   In addition, the imaging apparatus 10 includes a digital signal processing unit 26 that takes in digital image data output from the A / D 23 and performs interpolation processing, white balance correction, RGB / YC conversion processing, and the like. A compression / decompression processing unit 27 that compresses or decompresses the image in a reverse direction, a display unit 28 that displays a menu or the like, displays a through image or a captured image, and a system control unit (CPU) that performs overall control of the entire imaging apparatus. 29, an internal memory 30 such as a frame memory, and a media interface (I / F) unit 31 that performs an interface process between a recording medium 32 that stores JPEG image data and the like, and a bus 40 that interconnects them. The system control unit 29 is connected to an operation unit 33 for inputting instructions from the user.

システム制御部29は、固体撮像素子21から動画状態で出力されデジタル信号処理部26で処理された撮像画像データ(スルー画像)を配下のデジタル信号処理部26等を用いて後述するように解析して評価曲線(相関演算曲線)を求め、主要被写体までの距離を検出する。そして、システム制御部29は、駆動部24を介し、撮像レンズ20のうちのフォーカスレンズの位置制御を行い、被写体に合焦した光学像が固体撮像素子21の受光面に結像するようにする。   The system control unit 29 analyzes the captured image data (through image) output from the solid-state imaging device 21 in a moving image state and processed by the digital signal processing unit 26 using the subordinate digital signal processing unit 26 and the like as described later. To obtain an evaluation curve (correlation calculation curve) and detect the distance to the main subject. Then, the system control unit 29 controls the position of the focus lens of the imaging lens 20 via the driving unit 24 so that the optical image focused on the subject is formed on the light receiving surface of the solid-state imaging device 21. .

固体撮像素子21は、本実施形態ではCMOS(Complementary Metal Oxide Semiconductor)型であり、固体撮像素子21の出力信号をアナログ信号処理部(AFE:アナログフロントエンド)22で処理するが、このAFE部分(相関二重サンプリング処理やクランプを行う回路、利得制御を行う信号増幅回路等)は固体撮像素子チップ上に周辺回路として設けられるのが普通である。また、固体撮像素子21のチップ上には、その他にも、水平走査回路や垂直走査回路、雑音低減回路,同期信号発生回路等が周辺回路として受光部周りに形成され、A/D変換部23も形成される場合がある。なお、固体撮像素子21は、CCD(Charge Coupled Device)型でも、以下の実施形態に適用可能である。   In this embodiment, the solid-state imaging device 21 is a CMOS (Complementary Metal Oxide Semiconductor) type, and an output signal of the solid-state imaging device 21 is processed by an analog signal processing unit (AFE: analog front end) 22. A circuit that performs correlated double sampling processing and clamping, a signal amplifier circuit that performs gain control, and the like) are generally provided as a peripheral circuit on a solid-state imaging device chip. In addition, a horizontal scanning circuit, a vertical scanning circuit, a noise reduction circuit, a synchronization signal generation circuit, and the like are also formed as peripheral circuits around the light receiving unit on the chip of the solid-state imaging device 21, and the A / D conversion unit 23. May also be formed. The solid-state imaging device 21 may be a CCD (Charge Coupled Device) type and can be applied to the following embodiments.

固体撮像素子21の受光面には、図示しない多数の画素(受光素子:フォトダイオード)が二次元アレイ状に配列形成されている。本実施形態では、複数の画素が正方格子状に配列形成されている。なお、画素配列は正方格子配列に限るものではなく、奇数行の画素行に対して偶数行の画素行が1/2画素ピッチづつずらして配列された、所謂、ハニカム画素配列でも良い。   On the light receiving surface of the solid-state image sensor 21, a large number of pixels (light receiving elements: photodiodes) (not shown) are arranged in a two-dimensional array. In the present embodiment, a plurality of pixels are arranged in a square lattice pattern. Note that the pixel arrangement is not limited to a square lattice arrangement, and may be a so-called honeycomb pixel arrangement in which even-numbered pixel rows are shifted by 1/2 pixel pitch with respect to odd-numbered pixel rows.

受光面の任意の一部領域位置(例えば中央位置)に、矩形の位相差検出エリア40が設けられている。この例では、位相差検出エリア40は受光面に対して1箇所だけ設けているが、撮影画面内のどこでも合焦できるよう複数箇所に設けても良い。受光面の全領域を位相差検出エリアとすることでも良い。この位相差検出エリア40により、位相差検出方向(この例では左右方向つまりx方向を位相差検出方向としている。)で被写体までの合焦位置を検出する。   A rectangular phase difference detection area 40 is provided at an arbitrary partial region position (for example, the center position) of the light receiving surface. In this example, the phase difference detection area 40 is provided only at one location with respect to the light receiving surface, but may be provided at a plurality of locations so that it can be focused anywhere in the imaging screen. The entire area of the light receiving surface may be used as a phase difference detection area. The phase difference detection area 40 detects the in-focus position up to the subject in the phase difference detection direction (in this example, the left-right direction, that is, the x direction is the phase difference detection direction).

図2は、位相差検出エリア40内の一部分の表面拡大模式図である。固体撮像素子21の受光面には、多数の画素が正方格子配列されており、位相差検出エリア40内でも同様である。   FIG. 2 is a schematic enlarged view of a portion of the surface within the phase difference detection area 40. A large number of pixels are arranged in a square lattice on the light receiving surface of the solid-state imaging device 21, and the same applies to the phase difference detection area 40.

図示する例では、各画素をR(赤),G(緑),B(青)で示している。R,G,Bは各画素上に積層したカラーフィルタの色を表し、カラーフィルタ配列は、この例ではベイヤ配列となっているが、ベイヤ配列に限るものではなく、ストライプ等の他のカラーフィルタ配列でも良い。   In the illustrated example, each pixel is indicated by R (red), G (green), and B (blue). R, G, and B represent colors of the color filters stacked on each pixel, and the color filter array is a Bayer array in this example, but is not limited to the Bayer array, and other color filters such as stripes. An array may be used.

位相差検出エリア40内の画素配列,カラーフィルタ配列は、位相差検出エリア40外の受光面の画素配列,カラーフィルタ配列と同じであるが、位相差検出エリア40内では、ペアを構成する斜めに隣接する同色画素を、位相差検出画素1x,1yとしている。位相差検出用のペア画素は、本実施形態では、エリア40内の離散的,周期的な位置、図示する例では市松位置に設けられている。   The pixel array and the color filter array in the phase difference detection area 40 are the same as the pixel array and the color filter array on the light receiving surface outside the phase difference detection area 40. Pixels of the same color adjacent to are designated as phase difference detection pixels 1x and 1y. In the present embodiment, paired pixels for phase difference detection are provided at discrete and periodic positions in the area 40, in the illustrated example, at checkered positions.

なお、図示する例では、カラーフィルタ配列がベイヤ配列のため同色画素が斜めに隣接するのであって、横ストライプ配列の場合には同色画素は水平方向に並ぶため、ペアを構成する2画素は横に隣接することになる。あるいは、横ストライプ配列で同じ色フィルタ行内にペアを構成する2画素を設けるのではなく、縦方向に最近接する同色のフィルタ行の夫々にペアを構成する各画素を離して設けることでも良い。縦ストライプ配列の場合も同様である。   In the illustrated example, the same color pixels are diagonally adjacent because the color filter array is a Bayer array, and in the case of a horizontal stripe array, the same color pixels are arranged in the horizontal direction. Will be adjacent to. Alternatively, instead of providing two pixels constituting a pair in the same color filter row in the horizontal stripe arrangement, each pixel constituting the pair may be provided separately in each filter row of the same color closest in the vertical direction. The same applies to the vertical stripe arrangement.

本実施形態では、位相差検出画素1x,1yを、R,G,Bのうち最も多いGフィルタ搭載画素に設けており、水平方向(x方向)に8画素置き、垂直方向(y方向)に8画素置き、かつ全体的に市松位置となるように配置されている。従って、位相差検出方向(左右方向)で見たとき、位相差検出画素1xは4画素置きに配置されることになる。   In the present embodiment, the phase difference detection pixels 1x and 1y are provided in the most G filter mounted pixels among R, G, and B, and 8 pixels are arranged in the horizontal direction (x direction) and in the vertical direction (y direction). It is arranged so that every eight pixels and the entire checkered position. Accordingly, when viewed in the phase difference detection direction (left-right direction), the phase difference detection pixels 1x are arranged every four pixels.

図3は、図2の位相差検出画素1x,1yだけを抜き出して模式的に表示した図である。ペア画素を構成する位相差検出画素1x,1yは、例えば、その遮光膜開口2x,2yが他の画素(位相差検出画素以外の画素)より小さく形成され、かつ、画素1xの遮光膜開口2xは左方向に偏心して設けられ、画素1yの遮光膜開口2yは右方向(位相差検出方向)に偏心して設けられている。   FIG. 3 is a diagram schematically showing only the phase difference detection pixels 1x and 1y in FIG. For example, the phase difference detection pixels 1x and 1y constituting the pair pixel are formed such that the light shielding film openings 2x and 2y are smaller than the other pixels (pixels other than the phase difference detection pixels), and the light shielding film opening 2x of the pixel 1x. Is provided eccentrically in the left direction, and the light shielding film opening 2y of the pixel 1y is provided eccentrically in the right direction (phase difference detection direction).

図3の下段に示す曲線Xは、横一行に並ぶ位相差検出画素1xの検出信号量をプロットしたグラフであり、曲線Yは、これら画素1xとペアを構成する位相差検出画素1yの検出信号量をプロットしたグラフである。   A curve X shown in the lower part of FIG. 3 is a graph in which detection signal amounts of the phase difference detection pixels 1x arranged in a horizontal row are plotted, and a curve Y is a detection signal of the phase difference detection pixel 1y that forms a pair with these pixels 1x. It is the graph which plotted quantity.

ペア画素1x,1yは隣接画素であり極めて近接しているため、同一被写体からの光を受光していると考えられる。このため、曲線Xと曲線Yとは同一形状になると考えられ、その左右方向(位相差検出方向)のずれが、瞳分割したペア画素の一方の画素1xで見た画像と、他方の画素1yで見た画像との位相差量となる。   Since the pair pixels 1x and 1y are adjacent pixels and are very close to each other, it is considered that light from the same subject is received. For this reason, it is considered that the curve X and the curve Y have the same shape, and the shift in the left-right direction (phase difference detection direction) is caused by the difference between the image seen by one pixel 1x of the paired pixel divided by the pupil and the other pixel 1y. This is the amount of phase difference from the image seen in.

この曲線Xと曲線Yの相関演算を行うことで、位相差量(横ズレ量)を求めることができ、この位相差量から被写体までの距離を算出することが可能となる。曲線Xと曲線Yの相関量の評価値を求める方法は、公知の方法(例えば、特開2010―8443号公報
特開2010―91991号公報参照)を用いることができる。例えば、曲線Xを構成する各点X(i)と、曲線Yを構成する各点Y(i+j)の差分の絶対値の積算値を評価値とし、最大評価値を与えるj値を、位相差量(横ズレ量)とする。
By performing the correlation calculation between the curve X and the curve Y, the phase difference amount (lateral deviation amount) can be obtained, and the distance to the subject can be calculated from the phase difference amount. As a method for obtaining the evaluation value of the correlation amount between the curve X and the curve Y, a known method (for example, see Japanese Patent Application Laid-Open Nos. 2010-8443 and 2010-91991) can be used. For example, the integrated value of the absolute value of the difference between each point X (i) constituting the curve X and each point Y (i + j) constituting the curve Y is used as the evaluation value, and the j value giving the maximum evaluation value is expressed as the phase difference. The amount (lateral deviation).

ところで、1画素1画素の受光面積が小さい場合、個々の信号量は小さくなってノイズの割合が増えるため、相関演算を行っても精度良く位相差量を検出することが困難となる。そこで、位相差検出エリア40内の画素数を増加させたり、位相差検出エリア40それ自体を,拡大したりすることで、ノイズの影響を低減して合焦位置の検出精度(AF精度)を向上させることが可能となる。   By the way, when the light receiving area of each pixel is small, the amount of each signal is small and the ratio of noise is increased. Therefore, it is difficult to detect the phase difference with high accuracy even if correlation calculation is performed. Therefore, by increasing the number of pixels in the phase difference detection area 40 or enlarging the phase difference detection area 40 itself, the influence of noise is reduced and the detection accuracy (AF accuracy) of the in-focus position is increased. It becomes possible to improve.

ところが、位相差検出エリア40内の画素数を増加させたり、位相差検出エリア40それ自体を拡大したりすると、位相差検出画素の配置領域が上下方向(垂直方向)や左右方向(水平方向)に延びることになる。これによって、本来合焦すべき被写体に対する位相差検出をする領域(実際の位相差検出エリア)には、本来合焦すべき被写体パターンに加え、背景などの周囲パターンを含んだものとなり、位相差を求める評価値が下がってしまう場合がある。例えば、背景などの周囲パターンに合焦される、所謂後ピン状態が生じる場合がある。   However, when the number of pixels in the phase difference detection area 40 is increased or the phase difference detection area 40 itself is enlarged, the arrangement area of the phase difference detection pixels is changed in the vertical direction (vertical direction) or the horizontal direction (horizontal direction). It will extend to. As a result, the phase difference detection area (actual phase difference detection area) for the subject that should be focused will include the surrounding pattern such as the background in addition to the subject pattern that should be focused. The evaluation value for obtaining may decrease. For example, there may be a so-called rear pin state that is focused on a surrounding pattern such as the background.

そこで、本実施形態では、合焦すべき被写体に対する位相差検出をする領域について、被写体の一部エリア(内包エリア)と、被写体の周囲を含む全部エリア(包含エリア)とを定めて、各々のエリアについて空間周波数分布を求めて、合焦すべき被写体に関係性が希薄な検出信号、例えば背景を除去した検出信号によって合焦させることで、合焦位置の検出精度(AF精度)を向上させる。   Therefore, in the present embodiment, with respect to the region for detecting the phase difference with respect to the subject to be focused, a partial area (inclusive area) of the subject and an entire area (inclusive area) including the periphery of the subject are defined, By obtaining a spatial frequency distribution for the area and focusing with a detection signal that is rarely related to the subject to be focused, for example, a detection signal with the background removed, the detection accuracy (AF accuracy) of the focus position is improved. .

すなわち、被写体と、その被写体の背景とでは、各々の空間周波数分布が相違することが一般的である。このため、内包エリアでは被写体の空間周波数が顕著に表れた空間周波数分布となり、包含エリアでは、被写体とその背景等の被写体に関係性が希薄な物品との双方についての空間周波数が含まれる空間周波数分布となる。この包含エリアの空間周波数から背景等の被写体に関係性が希薄な物品の空間周波数を除去すれば、実際の位相差検出エリアとして被写体に忠実な空間周波数分布を採用できる。   That is, the spatial frequency distributions of the subject and the background of the subject are generally different. For this reason, the spatial frequency distribution in which the spatial frequency of the subject appears prominently in the inclusion area, and in the inclusion area, the spatial frequency includes the spatial frequency of both the subject and an article that is rarely related to the subject such as the background. Distribution. By removing the spatial frequency of an article that is rarely related to the subject such as the background from the spatial frequency of the inclusion area, a spatial frequency distribution faithful to the subject can be adopted as the actual phase difference detection area.

次に、本実施形態に係る撮像装置10の作用を説明する。まず、撮影時における撮像装置10の全体的な動作について簡単に説明する。   Next, the operation of the imaging device 10 according to the present embodiment will be described. First, the overall operation of the imaging apparatus 10 during shooting will be briefly described.

まず、固体撮像素子21により撮像レンズ20を介した撮像を行い、被写体像を示すR(赤)、G(緑)、B(青)の信号をアナログ信号処理部22に順次出力する。アナログ信号処理部22は、固体撮像素子21から入力された信号に対して相関二重サンプリング処理等のアナログ信号処理を施した後にA/D変換部23に順次出力する。A/D変換部23は、アナログ信号処理部22から入力されたR,G,Bの信号を例えば各々12ビットのR,G,Bの信号(デジタル画像データ)に変換してデジタル信号処理部26に順次出力する。デジタル信号処理部26は、内蔵しているラインバッファにA/D変換部23から順次出力されるデジタル画像データを蓄積して一旦内部メモリ30の所定領域に格納する。   First, imaging is performed via the imaging lens 20 by the solid-state imaging device 21, and R (red), G (green), and B (blue) signals indicating the subject image are sequentially output to the analog signal processing unit 22. The analog signal processing unit 22 performs analog signal processing such as correlated double sampling processing on the signal input from the solid-state imaging device 21 and then sequentially outputs the signal to the A / D conversion unit 23. The A / D conversion unit 23 converts the R, G, and B signals input from the analog signal processing unit 22 into, for example, 12-bit R, G, and B signals (digital image data), respectively. 26 are sequentially output. The digital signal processing unit 26 accumulates digital image data sequentially output from the A / D conversion unit 23 in a built-in line buffer and temporarily stores the digital image data in a predetermined area of the internal memory 30.

内部メモリ30の所定領域に格納されたデジタル画像データは、システム制御部29による制御によりデジタル信号処理部26によって読み出され、これらに所定の物理量に応じたデジタルゲインをかけることでホワイトバランス調整を行なうと共に、ガンマ処理及びシャープネス処理を行なって例えば8ビットのデジタル画像データを生成し、更にYC信号処理を施して輝度信号Yとクロマ信号Cr,Cb(以下、「YC信号」という。)を生成し、YC信号を内部メモリ30の上記所定領域とは異なる領域に格納する。   The digital image data stored in a predetermined area of the internal memory 30 is read by the digital signal processing unit 26 under the control of the system control unit 29, and white balance adjustment is performed by applying a digital gain corresponding to a predetermined physical quantity to these. In addition, gamma processing and sharpness processing are performed to generate, for example, 8-bit digital image data, and further YC signal processing is performed to generate a luminance signal Y and chroma signals Cr and Cb (hereinafter referred to as “YC signal”). Then, the YC signal is stored in an area different from the predetermined area of the internal memory 30.

なお、表示部28は、固体撮像素子21による連続的な撮像によって得られた動画像(スルー画像)を表示してファインダとして使用可能に構成されている。この場合には、生成したYC信号が順次表示部28に出力される。これによって表示部28にスルー画像が表示されることになる。   The display unit 28 is configured to display a moving image (through image) obtained by continuous imaging by the solid-state imaging device 21 and to be used as a finder. In this case, the generated YC signals are sequentially output to the display unit 28. As a result, a through image is displayed on the display unit 28.

次に、図4に示す撮像処理ルーチンを参照してシステム制御部29の処理概要を説明する。   Next, the outline of the process of the system control unit 29 will be described with reference to the imaging process routine shown in FIG.

撮影者は、表示部28に表示されるスルー画像で被写体を確認しつつ構図を決定する。このとき、システム制御部29は、操作部33のレリーズボタンが撮影者によって半押し状態S1とされた場合に、スルー画像を確認できる程度に、AE(Automatic Exposure、自動露出)機能による露出状態(シャッタースピード、絞りの状態)の設定、及びAF(Auto Focus、自動合焦)機能による合焦制御を行わせ、そのスルー画像で被写体を認識する(ステップ100)。その後に、レリーズボタンが全押し状態S2とされた場合(ステップ102)、AE機能が働き最終的な露出状態が設定された後(ステップ104)、詳細を後述するAF機能が働いて合焦制御され(ステップ106)、引き続き撮像レンズ20による固体撮像素子21への露光がなされ(ステップ108)、固体撮像素子21からアナログ信号が読み出される(ステップ110)。次に、アナログ信号をデジタル画像データに変換させ(ステップ112)、ホワイトバランス調整やガンマ処理及びシャープネス処理等の画像処理を行わせ(ステップ114)、圧縮伸長処理部27によって所定の圧縮形式(例えばJPEG形式)で圧縮させた後に(ステップ116)、メディアインタフェース部31を介して記録メディア32に記録させる(ステップ118)。   The photographer determines the composition while confirming the subject on the through image displayed on the display unit 28. At this time, when the release button of the operation unit 33 is pressed halfway by the photographer, the system control unit 29 exposes the exposure state (AE (Automatic Exposure) function) to such an extent that a through image can be confirmed. Setting of the shutter speed and aperture state) and focusing control using an AF (Auto Focus) function are performed, and the subject is recognized with the through image (step 100). Thereafter, when the release button is fully depressed S2 (step 102), after the AE function is activated and the final exposure state is set (step 104), the AF function, which will be described in detail later, is activated and the focus control is performed. Then, the solid-state image sensor 21 is continuously exposed by the imaging lens 20 (step 108), and an analog signal is read from the solid-state image sensor 21 (step 110). Next, the analog signal is converted into digital image data (step 112), image processing such as white balance adjustment, gamma processing, and sharpness processing is performed (step 114), and the compression / decompression processing unit 27 performs a predetermined compression format (for example, After compression in the JPEG format (step 116), recording is performed on the recording medium 32 via the media interface unit 31 (step 118).

次に、図4のステップ106における合焦処理について、図5に示すフローチャートを参照して詳細に説明する。   Next, the focusing process in step 106 of FIG. 4 will be described in detail with reference to the flowchart shown in FIG.

AF処理が開始されると、ステップ120においてオブジェクト認識処理が実行される。このオブジェクト認識処理は、上記ステップ100において実行された、スルー画像で被写体を認識する処理の結果、撮影対象として判別された被写体を特定する処理である。このオブジェクトの一例には、人物の顔があり、ここでの処理は顔検出処理を実行させることができる。次のステップ122では、オブジェクト、例えば顔が検出されたか否かを判定する。なお、オブジェクト認識処理は、公知の方法(例えば、特開2006―270137号公報、特開2007―142525号公報等参照)を用いることができる。   When the AF process is started, an object recognition process is executed in step 120. This object recognition process is a process for specifying a subject that has been determined as a photographing target as a result of the process of recognizing a subject with a through image performed in step 100. An example of this object is a person's face, and the process here can execute a face detection process. In the next step 122, it is determined whether or not an object such as a face has been detected. Note that the object recognition process can use a known method (for example, see JP-A-2006-270137, JP-A-2007-142525, etc.).

オブジェクトが検出されなかった場合には、ステップ138へ進み、従来の位相差AFと同様に、位相差検出エリア40について、位相差検出画素1xから求めた曲線Xと位相差検出画素1yから求めた曲線Yとの相関演算を行う。そして、相関演算の結果として得られたエリア評価曲線に基づき、デフォーカス量を算出し(ステップ140)、次のステップ142においてAF判定する。このAF判定は、相関演算の結果が許容できる範囲内であるか否かを判定することや算出されたデフォーカス量が許容できる範囲内であるか否かを判定すること等により判断される。ステップ142で肯定判断されると、ステップ144において撮像レンズの合焦制御を行い、この処理を終了する。ステップ142で否定判断されると、ステップ146において予め定めたエラー処理が実行される。   When the object is not detected, the process proceeds to step 138, and the phase difference detection area 40 is obtained from the curve X obtained from the phase difference detection pixel 1x and the phase difference detection pixel 1y in the same manner as in the conventional phase difference AF. Correlation calculation with the curve Y is performed. Then, based on the area evaluation curve obtained as a result of the correlation calculation, a defocus amount is calculated (step 140), and AF determination is performed in the next step 142. This AF determination is determined by determining whether or not the result of the correlation calculation is within an allowable range, determining whether or not the calculated defocus amount is within an allowable range, and the like. If an affirmative determination is made in step 142, in step 144, focusing control of the imaging lens is performed, and this process is terminated. If a negative determination is made in step 142, a predetermined error process is executed in step 146.

一方、オブジェクトが検出された場合(ステップ122で肯定)、ステップ124へ進み、AF処理するための被写体エリアの数量(本実施形態では大小2個)を決定する。この被写体エリアの数量は、2個に限定されるものではなく、大中小の3個、またはそれ以上でもよい。   On the other hand, if an object is detected (Yes in step 122), the process proceeds to step 124, and the number of subject areas for AF processing (two in this embodiment, large and small) is determined. The number of subject areas is not limited to two, but may be three large, medium, and small, or more.

次のステップ126では、ステップ124で決定した被写体エリアのうち一方の被写体エリアとして、ステップ120で認識したオブジェクトの被写体を少なくとも全て含む被写体包含エリア(大エリア)を設定し、次のステップ128で被写体包含エリアの空間周波数分布を算出する。そして、次のステップ130では、他方の被写体エリアとして、オブジェクトである被写体内の領域となる被写体内エリア(小エリア)を設定し、次のステップ132で被写体内エリアの空間周波数分布を算出する。   In the next step 126, a subject inclusion area (large area) including at least all the subjects of the object recognized in step 120 is set as one of the subject areas determined in step 124. The spatial frequency distribution of the inclusion area is calculated. In the next step 130, an in-subject area (small area) that is an area in the subject that is the object is set as the other subject area, and in the next step 132, the spatial frequency distribution of the in-subject area is calculated.

図6には、ステップ126および130で設定する大小エリアを模式的に示し、(A)は被写体内エリア、(B)は被写体包含エリアを示す。図6では、被写体エリアに四角形状を採用した場合を示している。被写体エリアを四角形状に限定するものではない。図6(A)に示すように、被写体内エリア60は、被写体である顔50の内部の閉領域が設定され、被写体のみのエリア64内部になっている。図6(B)に示すように、被写体包含エリア62は、被写体である顔50の全領域が包含された閉領域が設定され、被写体のみのエリア64と背景エリア66から構成されることになる。被写体エリアを四角形状とした場合、面積確保の観点から、被写体内エリア60は顔50の輪郭に内接する内接エリアを設定することが好ましい。また、被写体包含エリア62は顔50の輪郭に外接する外接エリアを設定することが好ましい。   FIG. 6 schematically shows the large and small areas set in steps 126 and 130, where (A) shows the in-subject area and (B) shows the subject inclusion area. FIG. 6 shows a case where a rectangular shape is adopted for the subject area. The subject area is not limited to a rectangular shape. As shown in FIG. 6A, the in-subject area 60 is a closed area inside the face 50 that is the subject, and is within the subject-only area 64. As shown in FIG. 6B, the subject inclusion area 62 is set to a closed region that includes the entire region of the face 50 that is the subject, and is composed of a subject-only area 64 and a background area 66. . When the subject area is rectangular, it is preferable to set an inscribed area that is inscribed in the contour of the face 50 from the viewpoint of securing the area. The subject inclusion area 62 is preferably set as a circumscribed area circumscribing the outline of the face 50.

図7には、被写体エリアの空間周波数分布を示した。曲線70は、被写体内エリア60の空間周波数分布を示し、曲線72は、被写体包含エリア62の空間周波数分布を示している。曲線70は、低周波数側にピーク74を有する特性であり、曲線72は、低周波数側及び高周波数側の双方にピーク76,78を有する特性である。一方、被写体包含エリア62は、被写体のみのエリア64と背景エリア66から構成され、両方の空間周波数分布が重畳されたものである。一方、被写体内エリア60は、被写体の空間周波数分布である。このことから、低周波数側のピーク74とピーク76を含む周波数域は被写体に対応するもので、ピーク78を含む周波数域は背景エリア66によるものと推定できる。従って、曲線72についてピーク78を含む一定の周波数域を除去すれば、被写体のみによる空間周波数(帯域)を得ることができる。これによって、被写体のみによる空間周波数帯域を通過させるフィルタを用いて位相差検出信号をフィルタ演算すれば、背景を含むエリアを被写体エリアとして定めても精度良く被写体に合焦させることができる。   FIG. 7 shows the spatial frequency distribution of the subject area. A curve 70 shows the spatial frequency distribution of the in-subject area 60, and a curve 72 shows the spatial frequency distribution of the subject inclusion area 62. The curve 70 is a characteristic having a peak 74 on the low frequency side, and the curve 72 is a characteristic having peaks 76 and 78 on both the low frequency side and the high frequency side. On the other hand, the subject inclusion area 62 is composed of a subject-only area 64 and a background area 66, in which both spatial frequency distributions are superimposed. On the other hand, the in-subject area 60 is a spatial frequency distribution of the subject. From this, it can be estimated that the frequency region including the peak 74 and the peak 76 on the low frequency side corresponds to the subject, and the frequency region including the peak 78 is due to the background area 66. Therefore, if a certain frequency range including the peak 78 is removed from the curve 72, a spatial frequency (band) based only on the subject can be obtained. Thus, if the phase difference detection signal is subjected to filter calculation using a filter that passes through the spatial frequency band of only the subject, the subject can be accurately focused even if the area including the background is determined as the subject area.

そこで、ステップ134では、ステップ128および132で算出した空間周波数からフィルタを作成する。ここでは、曲線72についてピーク78を含む一定の周波数域を定めるために、曲線72の変曲点すなわちピーク76からピーク78に至るまでの最低度数分布となる点80を求め、その空間周波数fxを境界空間周波数に設定する。そして、ピーク76の空間周波数を含む空間周波数fxまでの周波数域Fをバンドパスするフィルタを作成する。   In step 134, a filter is created from the spatial frequencies calculated in steps 128 and 132. Here, in order to determine a certain frequency range including the peak 78 for the curve 72, the inflection point of the curve 72, that is, the point 80 having the lowest frequency distribution from the peak 76 to the peak 78 is obtained, and the spatial frequency fx is obtained. Set to the boundary spatial frequency. Then, a filter that band-passes the frequency band F up to the spatial frequency fx including the spatial frequency of the peak 76 is created.

次のステップ136では、ステップ134で作成したフィルタを用いて、位相差検出信号を信号処理する。この信号処理された信号は、背景エリアが除去されたものとなる。そして、上述のように、相関演算を行い、得られたエリア評価曲線に基づきデフォーカス量を算出して、撮像レンズの合焦制御を行うことで(ステップ138〜144)、背景を含むエリアを被写体エリアとして定めても精度良く被写体に合焦させることができる。   In the next step 136, the phase difference detection signal is signal-processed using the filter created in step 134. This signal-processed signal has the background area removed. Then, as described above, the correlation calculation is performed, the defocus amount is calculated based on the obtained area evaluation curve, and the focusing control of the imaging lens is performed (steps 138 to 144), so that the area including the background is determined. Even if the subject area is determined, the subject can be focused accurately.

(第2実施形態)
次に、本発明の第2実施形態について説明する。なお、上記実施形態と同一部分には同一符号を付し、その詳細な説明は省略する。
(Second Embodiment)
Next, a second embodiment of the present invention will be described. In addition, the same code | symbol is attached | subjected to the same part as the said embodiment, and the detailed description is abbreviate | omitted.

本実施形態は、被写体エリアの設定の一例を示すものであり、その他は第1実施形態と同様である。   The present embodiment shows an example of the setting of the subject area, and the others are the same as in the first embodiment.

本実施形態では、図5のステップ126の処理について、図8に示す外接エリア設定処理が実行される。また、図5のステップ130の処理では、図9に示す内接エリア設定処理が実行される。以下、図8及び図9のフローチャートを参照して詳細に説明する。   In the present embodiment, the circumscribed area setting process shown in FIG. 8 is executed for the process of step 126 in FIG. In the process of step 130 in FIG. 5, the inscribed area setting process shown in FIG. 9 is executed. Hereinafter, a detailed description will be given with reference to the flowcharts of FIGS.

被写体包含エリアの設定処理が実行されると(図5のステップ126)、図8のステップ150へ進み、前記認識したオブジェクトの被写体52の境界線(輪郭)54を求める。次に、境界線(輪郭)54について、横座標の最大値Xmaxと最小値Xminを求め(ステップ152)、縦座標の最大値Ymaxと最小値Yminを求める(ステップ154)。これらの座標から次のステップ156において被写体包含エリア(大エリア)として外接エリア63を設定する。外接エリア63の設定は、まず、対角座標点63A(Xmin,Ymin)と対角座標点63B(Xmax,Ymax)を求める。この対角座標点63A,63Bの線分対角線とする四角形を外接エリア63に設定する(図11参照)。   When the subject inclusion area setting process is executed (step 126 in FIG. 5), the process proceeds to step 150 in FIG. 8, and a boundary line (contour) 54 of the subject 52 of the recognized object is obtained. Next, the maximum value Xmax and the minimum value Xmin of the abscissa are determined for the boundary line (contour) 54 (step 152), and the maximum value Ymax and the minimum value Ymin of the ordinate are determined (step 154). From these coordinates, in the next step 156, the circumscribed area 63 is set as the subject inclusion area (large area). For setting the circumscribed area 63, first, a diagonal coordinate point 63A (Xmin, Ymin) and a diagonal coordinate point 63B (Xmax, Ymax) are obtained. A quadrangle that is a diagonal line of the diagonal coordinate points 63A and 63B is set in the circumscribed area 63 (see FIG. 11).

また、被写体内エリアの設定処理が実行されると(図5のステップ130)、図9のステップ158へ進み、前記認識したオブジェクトの被写体52の中心点61Pを求める。この中心点61Pは、オブジェクト認識時に求めた中心でもよく、ステップ156で求めた外接エリア63の対角線の交点を求めることでも良い。次のステップ160では、上記ステップ150と同様に被写体52の境界線(輪郭)54を設定する。次に、中心点61Pを中心とした所定の大きさ(例えば周囲8画素)を拡張エリア61Aとして設定する。そして拡張エリアの辺または角が境界線(輪郭)54に接触するまで拡張エリアを拡張する(図10参照。拡張エリア61A、61B、61Cの順序)。この辺または角が接触した拡張エリア(四角形)を内接エリア63に設定する(図10参照)。   When the subject area setting process is executed (step 130 in FIG. 5), the process proceeds to step 158 in FIG. 9 to obtain the center point 61P of the subject 52 of the recognized object. The center point 61P may be the center obtained at the time of object recognition, or may be the intersection of the diagonal lines of the circumscribed area 63 obtained in step 156. In the next step 160, the boundary line (outline) 54 of the subject 52 is set in the same manner as in step 150. Next, a predetermined size (for example, surrounding 8 pixels) around the center point 61P is set as the extension area 61A. Then, the expansion area is expanded until the side or corner of the expansion area touches the boundary line (contour) 54 (see FIG. 10, the order of the expansion areas 61A, 61B, and 61C). The extended area (rectangle) where the sides or corners are in contact is set as the inscribed area 63 (see FIG. 10).

なお、拡張エリアの拡張は、例えば1画素づつ周囲画素を増殖してもよいし、辺または角が接触していない方向の画素を増殖するようにしてもよい。   For the expansion of the expansion area, for example, surrounding pixels may be increased one by one, or pixels in a direction in which sides or corners are not in contact may be increased.

本実施形態では、被写体が複雑な輪郭であっても外接エリア及び内接エリアの各々について、迅速かつ最大面積となるように設定することができる。   In the present embodiment, even if the subject has a complicated outline, each of the circumscribed area and the inscribed area can be set to be quick and maximum area.

(第3実施形態)
次に、本発明の第3実施形態について説明する。なお、上記実施形態と同一部分には同一符号を付し、その詳細な説明は省略する。
(Third embodiment)
Next, a third embodiment of the present invention will be described. In addition, the same code | symbol is attached | subjected to the same part as the said embodiment, and the detailed description is abbreviate | omitted.

本実施形態は、被写体内エリアの設定について許容範囲を設けたものであり、構成は上記実施形態と同様である。   In the present embodiment, an allowable range is provided for setting the in-subject area, and the configuration is the same as that of the above-described embodiment.

被写体内エリアを設定した場合、その設定した被写体エリアたとえば内接エリアが極小である場合、その極小の内接エリアは合焦するために十分な画素数でないことがある。そこで本実施形態では、内接エリアが極小である場合に、予め定めた許容範囲まで内接エリアを拡大して設定することを可能にしたものである。この許容範囲の最大値は、設定済みの外接エリアである。すなわち、内接エリア61から外接エリア63までの間で、拡大した拡大エリア65を内接エリア61として設定することができるようにしたものである(図13参照)。   When an in-subject area is set, if the set subject area, for example, the inscribed area is extremely small, the minimum inscribed area may not have a sufficient number of pixels for focusing. Therefore, in this embodiment, when the inscribed area is minimal, the inscribed area can be set to be enlarged to a predetermined allowable range. The maximum value of this allowable range is the set circumscribed area. That is, the enlarged area 65 that is enlarged from the inscribed area 61 to the circumscribed area 63 can be set as the inscribed area 61 (see FIG. 13).

本実施形態は、図9のステップ168の処理で設定された内接エリアが、極小である場合に、図12に示す内接エリア設定処理が実行される。以下、図12のフローチャートを参照して詳細に説明する。   In the present embodiment, when the inscribed area set in step 168 in FIG. 9 is minimal, the inscribed area setting process shown in FIG. 12 is executed. Hereinafter, this will be described in detail with reference to the flowchart of FIG.

被写体内エリア(内接エリア)の設定が終了すると(図9)、図12のステップ170へ進み、設定された内接エリアが極小か否かを判断し、否定された場合には、内接エリアは合焦するために十分な画素数を確保できるため、そのまま処理を終了する。内接エリアが極小か否かの判断基準は、合焦するために十分な画素数として予め定めた画素数やその画素数による面積を用いることができる。   When the setting of the in-subject area (inscribed area) is completed (FIG. 9), the process proceeds to step 170 in FIG. 12 to determine whether or not the set inscribed area is minimal. Since the area can secure a sufficient number of pixels for focusing, the processing is terminated as it is. As a criterion for determining whether or not the inscribed area is extremely small, a predetermined number of pixels as the number of pixels sufficient for focusing or an area based on the number of pixels can be used.

ステップ170で肯定されると、ステップ172へ進み、拡大可能な内接エリアの許容範囲(拡大設定値)を設定する。次のステップ174では、拡張エリアを拡張、例えば1画素分だけ拡張し、拡大設定値になるまで(ステップ176で肯定されるまで)繰り返し実行する。そして、最終的な拡張エリアを(ステップ176で肯定)、被写体内エリアとして設定する(ステップ178)。   If the determination in step 170 is affirmative, the process proceeds to step 172, where an allowable range (enlargement setting value) of the inscribed area that can be enlarged is set. In the next step 174, the expansion area is expanded, for example, by one pixel, and is repeatedly executed until the expansion set value is reached (until affirmative in step 176). Then, the final extended area (Yes in step 176) is set as the in-subject area (step 178).

この拡大設定値は、上述のように、許容範囲(拡大設定値)の最大値として、設定済みの外接エリアが可能であるが(図13参照)、合焦するために必要とされる所定画素数となるエリアになれば十分である。また、外接エリア近傍まで拡張エリアを拡大したのでは、背景を多く含むことになり、合焦精度に支障を来す場合がある。そこで、この拡大設定値は、既に設定済みの外接エリアまでの値(例えば画素数や面積)を設定してもよいが、予め定めた指定値(例えば、合焦するために必要とされる予め定められた画素数)を設定することが好ましい。   As described above, the enlargement set value can be a circumscribed area that has been set as the maximum value of the allowable range (enlargement set value) (see FIG. 13), but is a predetermined pixel required for focusing. It will be enough if it becomes a number area. Further, if the extended area is enlarged to the vicinity of the circumscribed area, it will include a lot of background, which may hinder the focusing accuracy. Therefore, as the enlargement setting value, a value up to the circumscribed area that has already been set (for example, the number of pixels or the area) may be set, but a predetermined specified value (for example, a preliminarily required for focusing) It is preferable to set a predetermined number of pixels.

ところで、実際の撮影時は、撮影シーンに応じて撮影条件が異なるものである。例えば、マクロ撮影などの近距離撮影時では焦点距離及び絞り値等による撮影条件によって焦点深度(被写界深度)が浅くなる。一方、風景や集合写真のような近距離撮影時の撮影条件では比較的焦点深度が深くなる。このように、撮影条件によって焦点深度が変動するので、一律に拡大設定値を定めて拡張エリアを拡大可能としたのでは、被写体に合焦されず、背景に合焦され(所謂後ピン)、合焦精度が悪化する。   By the way, in actual shooting, shooting conditions differ depending on the shooting scene. For example, at the time of short-distance shooting such as macro shooting, the depth of focus (depth of field) becomes shallow depending on the shooting conditions such as the focal length and aperture value. On the other hand, the depth of focus is relatively deep under shooting conditions such as landscapes and group photos at close range shooting. As described above, since the depth of focus varies depending on the shooting conditions, if the enlargement setting value is uniformly determined and the expansion area can be enlarged, the subject is not focused but the background is focused (so-called rear pin). Focusing accuracy deteriorates.

そこで、ステップ172では、撮影条件に応じて拡大可能な内接エリアの許容範囲(拡大設定値)を設定することが好ましい。   Therefore, in step 172, it is preferable to set an allowable range (enlargement setting value) of the inscribed area that can be enlarged according to the photographing conditions.

図14には、焦点距離及び絞り値による撮影条件で定まる焦点深度(被写界深度)に対する拡大設定値の関係を示した。焦点深度(被写界深度)と拡大設定値は対応関係がある。すなわち、焦点深度が深ければ撮影軸方向の合焦距離が長くなるので、拡張エリアに多少背景を含んだとしても合焦に対する影響が少なくなり、拡大設定値を大きくすることができる。一方、焦点深度が浅ければ撮影軸方向の合焦距離が短くなるので、拡大設定値は小さくする必要がある。そこで、撮影時の焦点深度(被写界深度)を得れば、撮影条件に応じて拡大可能な内接エリアの許容範囲(拡大設定値)を設定することができる。図14では、一例として、撮像装置10に具備された、焦点距離に直接影響するズーム位置に応じて拡大可能な内接エリアの許容範囲(拡大設定値)を設定することができる特性曲線hを示した。すなわち、テレ側では焦点距離が短くなり、ワイド側では焦点距離が長くなる。この特性曲線hに、絞り等の撮影条件をさらに付加して許容範囲(拡大設定値)を設定するようにしてもよい。   FIG. 14 shows the relationship between the enlargement setting value and the focal depth (depth of field) determined by the photographing condition based on the focal length and the aperture value. There is a correspondence between the depth of focus (depth of field) and the enlargement setting value. That is, if the depth of focus is deep, the focusing distance in the photographing axis direction becomes long. Therefore, even if the expansion area includes some background, the influence on focusing is reduced, and the enlargement setting value can be increased. On the other hand, if the depth of focus is shallow, the focusing distance in the photographing axis direction is shortened, so the enlargement setting value needs to be small. Therefore, if the depth of focus (depth of field) at the time of shooting is obtained, the permissible range (enlargement setting value) of the inscribed area that can be expanded can be set according to the shooting conditions. In FIG. 14, as an example, a characteristic curve h that is provided in the imaging apparatus 10 and that can set an allowable range (enlargement setting value) of an inscribed area that can be enlarged according to a zoom position that directly affects the focal length is shown. Indicated. That is, the focal length becomes shorter on the tele side, and the focal length becomes longer on the wide side. An imaging range such as an aperture may be further added to the characteristic curve h to set an allowable range (enlarged setting value).

また、撮影条件に応じて拡大可能な内接エリアの許容範囲を定めるために、上述の空間周波数分布を利用することができる。図7に示したように、背景を含む被写体エリアの空間周波数分布の曲線72では、上述の処理によりピーク78を含む周波数域が背景エリア66と推定できる。一方、拡張エリアを拡大することは、その背景エリア66をより多く含むことになる。つまり、空間周波数fxが高周波側へシフトすることになる。そこで、拡張エリアを拡大したことにより空間周波数fxが高周波側へシフトしたときに、背景エリア66がどの程度影響するのかを、空間周波数fxからピーク78を含む空間周波数域の変動比率等を求めて、上記焦点距離(撮影条件)との予め定めた関係から許容範囲(拡大設定値)を設定するようにしてもよい。   In addition, the above-described spatial frequency distribution can be used to determine the allowable range of the inscribed area that can be expanded according to the imaging conditions. As shown in FIG. 7, in the curve 72 of the spatial frequency distribution of the subject area including the background, the frequency region including the peak 78 can be estimated as the background area 66 by the above-described processing. On the other hand, enlarging the extended area includes more of the background area 66. That is, the spatial frequency fx shifts to the high frequency side. Therefore, the extent of the influence of the background area 66 when the spatial frequency fx is shifted to the high frequency side by enlarging the expansion area is obtained by determining the variation ratio of the spatial frequency region including the peak 78 from the spatial frequency fx. The allowable range (enlargement setting value) may be set based on a predetermined relationship with the focal length (imaging condition).

本実施形態では、極小な被写体エリア(内接エリア)であっても、焦点距離や絞り値等による撮影条件で定めた値(例えば画素数や面積)により、その大きさを拡張できるので、合焦演算の画素数を増加でき、合焦精度を向上させることができる。   In this embodiment, even a very small subject area (inscribed area) can be expanded by the value (for example, the number of pixels and area) determined by the shooting conditions such as the focal length and aperture value. The number of pixels for the focus calculation can be increased, and the focusing accuracy can be improved.

なお、上記処理は、ステップ168の後に実行するとしたが、閾値を変更するようにしてもよい。すなわち、図9では拡張エリアが被写体の境界線(輪郭)に接触するときを閾値としているが、その閾値判断に、エリアの極小判断をするようにしてもよい。具体的には上述のステップ164の接触可否判断後に図12の処理を実行するようにしてもよい。   In addition, although the said process was performed after step 168, you may make it change a threshold value. That is, in FIG. 9, the threshold is set when the extended area contacts the boundary line (outline) of the subject. However, the minimum of the area may be determined for the threshold determination. Specifically, the processing of FIG. 12 may be executed after the above-described determination of whether or not contact is possible in step 164.

(第4実施形態)
次に、本発明の第4実施形態について説明する。なお、上記実施形態と同一部分には同一符号を付し、その詳細な説明は省略する。
(Fourth embodiment)
Next, a fourth embodiment of the present invention will be described. In addition, the same code | symbol is attached | subjected to the same part as the said embodiment, and the detailed description is abbreviate | omitted.

本実施形態は、合焦演算精度を維持するために、被写体エリアの形状に閾値を設けて被写体エリアを設定するものである。すなわち、本実施形態は、図9のステップ166の処理後に、図15に示す形状判定処理が実行される。以下、図15のフローチャートを参照して詳細に説明する。   In the present embodiment, in order to maintain focus calculation accuracy, a subject area is set by providing a threshold value for the shape of the subject area. That is, in the present embodiment, the shape determination process shown in FIG. 15 is executed after the process of step 166 of FIG. Hereinafter, this will be described in detail with reference to the flowchart of FIG.

拡張エリアを拡張すると(図9のステップ166)、図15のステップ180へ進み、合焦演算精度を維持するための被写体エリアの形状に関する閾値を設定する。この閾値は、画素数による面積の閾値と、エリアのアスペクト比(縦横比)の閾値である。次のステップ182では、上記ステップ166で設定された拡張エリアについての面積及びアスペクト比を算出し、設定された閾値以上であるか否かを判断する(ステップ184,186)。   When the extended area is expanded (step 166 in FIG. 9), the process proceeds to step 180 in FIG. 15, and a threshold relating to the shape of the subject area for maintaining the focus calculation accuracy is set. This threshold value is a threshold value of the area based on the number of pixels and a threshold value of an aspect ratio (aspect ratio) of the area. In the next step 182, the area and aspect ratio for the extended area set in step 166 are calculated, and it is determined whether or not the set threshold value is exceeded (steps 184 and 186).

ステップ184または186で否定された場合には、合焦演算精度が不充分として、継続処理する。すなわち、ステップ166へ戻り拡張エリアを再設定する。ここでは、拡張エリアの面積が閾値未満のとき、拡張エリアを拡張する処理を指示する。また、アスペクト比が閾値未満のとき、拡張エリアのアスペクト比が閾値以上となるよう拡張する処理を指示する。   If the result in step 184 or 186 is negative, the focusing calculation accuracy is insufficient and the process is continued. That is, the process returns to step 166 to reset the extended area. Here, when the area of the extension area is less than the threshold, a process for extending the extension area is instructed. Further, when the aspect ratio is less than the threshold value, an instruction to extend the aspect ratio of the extension area to be equal to or greater than the threshold value is instructed.

一方、ステップ184及び186で肯定された場合には、合焦するために十分な面積(画素数)及びエリア形状を確保できるため、本形状判定処理を終了しステップ164へ戻る。なお、この場合、ステップ164へ戻ることに限定されない。例えば、合焦するために十分な面積及びエリア形状を確保できる拡張エリアであるため、そのままステップ168へ進んでも良い。   On the other hand, if the result is affirmative in steps 184 and 186, a sufficient area (number of pixels) and area shape for focusing can be secured, and the shape determination process is terminated and the process returns to step 164. In this case, the process is not limited to returning to step 164. For example, since it is an extended area that can secure a sufficient area and area shape for focusing, the process may proceed to step 168 as it is.

これにより、本実施形態では、被写体52の大きさに拘わらず、合焦するために十分な面積及びエリア形状を確保できる(図16参照)。   Thereby, in the present embodiment, a sufficient area and area shape for focusing can be ensured regardless of the size of the subject 52 (see FIG. 16).

(第5実施形態)
次に、本発明の第5実施形態について説明する。なお、上記実施形態と同一部分には同一符号を付し、その詳細な説明は省略する。
(Fifth embodiment)
Next, a fifth embodiment of the present invention will be described. In addition, the same code | symbol is attached | subjected to the same part as the said embodiment, and the detailed description is abbreviate | omitted.

本実施形態は、被写体内エリアの設定時に基礎となる点を求める一例として被写体の重心を求めるものを示すものであり、その他は上記実施形態と同様である。   The present embodiment shows an example in which the center of gravity of a subject is obtained as an example of obtaining a base point when setting an in-subject area, and the rest is the same as the above embodiment.

本実施形態では、図9のステップ158の処理に代えて、図17に示す重心設定処理が実行される。以下、図17のフローチャートを参照して詳細に説明する。   In the present embodiment, the center-of-gravity setting process shown in FIG. 17 is executed instead of the process of step 158 in FIG. Hereinafter, this will be described in detail with reference to the flowchart of FIG.

被写体内エリアの設定処理が実行されると(図5のステップ130)、ステップ158(図9)の処理に代えて図17のステップ190へ進み、被写体エリアの面積(画素数)を算出する。この処理では、被写体の境界線を用いて、その境界線による閉領域内の画素数を求める。次のステップ192では、被写体の水平方向の一端から画素を敷き詰めて、ステップ190で求めた画素数の1/2の画素数になる画素位置を通過する垂直方向の直線を縦分割線52Vとする(図18参照)。次のステップ194では、被写体の垂直方向の一端から画素を敷き詰めて、ステップ190で求めた画素数の1/2の画素数になる画素位置を通過する水平方向の直線を横分割線52Hとする(図18参照)。そして、次のステップ196において、上記求めた縦分割線52Vと横分割線52Hとの交点52Gを重心として、上述の中心点に代えて設定する(図18参照)。   When the in-subject area setting process is executed (step 130 in FIG. 5), the process proceeds to step 190 in FIG. 17 instead of the process in step 158 (FIG. 9), and the area (number of pixels) of the subject area is calculated. In this process, the number of pixels in the closed region by the boundary line is obtained using the boundary line of the subject. In the next step 192, pixels are spread from one end in the horizontal direction of the subject, and the vertical straight line passing through the pixel position where the number of pixels is half the number of pixels obtained in step 190 is defined as the vertical dividing line 52V. (See FIG. 18). In the next step 194, pixels are laid out from one end of the subject in the vertical direction, and a horizontal straight line passing through the pixel position where the number of pixels obtained in step 190 is half the number of pixels is defined as a horizontal dividing line 52H. (See FIG. 18). Then, in the next step 196, the intersection 52G between the obtained vertical dividing line 52V and horizontal dividing line 52H is set as the center of gravity instead of the above-mentioned center point (see FIG. 18).

本実施形態では、被写体の重心を求めているので、被写体が複雑な輪郭であっても被写体内エリアの基点となる点がずれて、内接エリアの設定が偏ることを抑制できる。   In the present embodiment, since the center of gravity of the subject is obtained, it is possible to prevent the setting of the inscribed area from being biased by shifting the point serving as the base point of the in-subject area even if the subject has a complex outline.

(第6実施形態)
次に、本発明の第6実施形態について説明する。なお、上記実施形態と同一部分には同一符号を付し、その詳細な説明は省略する。
(Sixth embodiment)
Next, a sixth embodiment of the present invention will be described. In addition, the same code | symbol is attached | subjected to the same part as the said embodiment, and the detailed description is abbreviate | omitted.

本実施形態は、第2実施形態と第5実施形態とを組み合わせたものである。本実施形態では、図9のステップ158の処理に代えて、図19に示す処理が実行される。以下、図19のフローチャートを参照して詳細に説明する。   The present embodiment is a combination of the second embodiment and the fifth embodiment. In the present embodiment, the process shown in FIG. 19 is executed instead of the process in step 158 of FIG. Hereinafter, this will be described in detail with reference to the flowchart of FIG.

まず、被写体内エリアの設定処理が実行されると(図5のステップ130)、ステップ158(図9)の処理に代えて図19のステップ200へ進み、図9のステップ158と同様に、被写体の中心を算出する。次のステップ202では、被写体の重心を算出する(図17)。次のステップ204では、被写体中心による内接エリアを算出し、ステップ206において被写体重心による内接エリアを算出する。次のステップ208では、上記求めた被写体重心による内接エリアの面積が被写体中心による内接エリアの面積より大きいか否かを判断する。ステップ208で肯定された場合、被写体重心による内接エリアを採用し、否定された場合は被写体中心による内接エリアを採用する。   First, when the subject area setting process is executed (step 130 in FIG. 5), the process proceeds to step 200 in FIG. 19 instead of the process in step 158 (FIG. 9), and in the same manner as in step 158 in FIG. The center of is calculated. In the next step 202, the center of gravity of the subject is calculated (FIG. 17). In the next step 204, an inscribed area based on the subject center is calculated, and in step 206, an inscribed area based on the subject center of gravity is calculated. In the next step 208, it is determined whether or not the area of the inscribed area based on the determined subject center of gravity is larger than the area of the inscribed area based on the subject center. If the determination in step 208 is affirmative, the inscribed area based on the subject center of gravity is adopted, and if the result is negative, the inscribed area based on the subject center is adopted.

本実施形態では、被写体の重心または中心で定まる内接エリアについて面積が大きいエリアを採用するので、画素数増加によって合焦精度を向上させることができる。   In the present embodiment, an area having a large area is employed as the inscribed area determined by the center of gravity or the center of the subject, so that the focusing accuracy can be improved by increasing the number of pixels.

以上説明したように、本実施形態によれば、合焦時に、被写体の一部からなるエリアと全てを含んで背景をも含むエリアの空間周波数分布を各々求めて、被写体のみによる空間周波数帯域を通過させるフィルタを用いて位相差検出信号をフィルタ演算することで、背景を含むエリアを被写体エリアとして定めても精度良く被写体に合焦させることができる。   As described above, according to the present embodiment, at the time of focusing, the spatial frequency distribution of a part of the subject and the spatial frequency distribution of the area including all the background and including the background are obtained, and the spatial frequency band only by the subject is obtained. By filtering the phase difference detection signal using a filter that passes through, the subject can be accurately focused even if the area including the background is determined as the subject area.

なお、上記各実施形態では、位相差検出画素を構成する瞳分割したペア画素として、小さくした遮光膜開口を互いに反対方向にずらした例を用いて説明したが、瞳分割して位相差検出画素を構成する方法はこれに限るものではなく、例えばペア画素に一つのマイクロレンズを搭載して瞳分割することでも良い。   In each of the above embodiments, the pupil-divided pair pixels constituting the phase difference detection pixel have been described using an example in which the reduced light shielding film openings are shifted in opposite directions. The method of configuring is not limited to this, and for example, one microlens may be mounted on a pair of pixels to divide the pupil.

なお、上記各実施形態では、位相差を検出するペア画素を位相差検出エリア内の離散的,周期的な位置に設けた例について述べたが、必ずしも周期的,離散的位置に設ける必要はなく、ランダムな位置であっても良く、あるいは全画素を位相差検出画素とすることでも良い。   In each of the above embodiments, the example in which the pair pixels for detecting the phase difference are provided at discrete and periodic positions in the phase difference detection area has been described. However, the pixel need not necessarily be provided at the periodic and discrete positions. The position may be random, or all pixels may be phase difference detection pixels.

また、上記各実施形態では、RGBの3原色のカラーフィルタのカラーフィルタ配列について説明したが、カラーフィルタの種類は、これに限定されるものではない。   In each of the above embodiments, the color filter arrangement of the three primary color filters of RGB has been described, but the type of color filter is not limited to this.

また、上記各実施形態では、フィルタを作成する際、被写体内エリア及び被写体包含エリアの空間周波数を比較するが、この比較をするときに被写体と背景の空間周波数が同一であると判定される場合がある。この場合には、被写体内エリアを用いて相関演算を行えばよい。   Further, in each of the above embodiments, when creating a filter, the spatial frequencies of the in-subject area and the subject-inclusive area are compared. When the comparison is made, it is determined that the spatial frequency of the subject and the background are the same. There is. In this case, the correlation calculation may be performed using the in-subject area.

10 撮像装置
20 撮像レンズ
21 固体撮像素子
28 表示部
29 システム制御部
40 位相差検出エリア
60 被写体内エリア
62 被写体包含エリア
70 曲線
72 曲線
DESCRIPTION OF SYMBOLS 10 Imaging device 20 Imaging lens 21 Solid-state image sensor 28 Display part 29 System control part 40 Phase difference detection area 60 In-subject area 62 Subject inclusion area 70 Curve 72 Curve

Claims (10)

被写体の画像を撮像する受光面に設けられた位相差検出エリア内に、瞳分割した第1の位相差検出画素及び第2の位相差検出画素で構成されるペア画素が配列形成された撮像素子と、
前記撮像素子の前段に置かれ、前記被写体の合焦した光学像を前記受光面に結像させる合焦位置に制御される撮像レンズと、
合焦する被写体を特定し、該合焦する被写体の領域及び背景エリアを含む包含エリアと、該合焦する被写体の領域の内部の一部からなり、背景エリアを含まない内包エリアの各々を設定するエリア設定手段と、
前記設定した包含エリア及び内包エリアの各々の空間周波数分布を演算し、演算した空間周波数分布の各々に基づいて前記被写体の領域に対応する周波数域の空間周波数を除去するフィルタを作成するフィルタ作成手段と、
前記作成したフィルタを用いて前記被写体の領域に対応する周波数域の空間周波数に該当する前記第1の位相差検出画素の第1検出情報と前記第2の位相差検出画素の第2検出情報とを生成する生成手段と、
前記生成した第1検出情報と第2検出情報との相関関係を示す被写体の相関演算曲線を求め、該相関演算曲線から前記撮像レンズを前記合焦位置に制御する位相差を求める位相差演算手段と、
前記求めた位相差に基づき前記撮像レンズを前記合焦位置に制御する位置制御手段と、
を備えた撮像装置。
An imaging element in which a pair of pixels composed of a first phase difference detection pixel and a second phase difference detection pixel divided into pupils are arrayed in a phase difference detection area provided on a light receiving surface for picking up an image of a subject. When,
An imaging lens that is placed in front of the imaging device and controlled to a focus position that forms an optical image of the subject focused on the light receiving surface;
Identify the object to be focused, each of the inclusion area including the area and the background area of the subject to be focused該合, Ri Do from part of the internal region of the subject to be focused 該合, the encapsulated area that does not include the background area Area setting means for setting
Filter creation means for computing a spatial frequency distribution of each of the set inclusion area and inclusion area and creating a filter that removes the spatial frequency of the frequency range corresponding to the subject area based on each of the calculated spatial frequency distributions When,
First detection information of the first phase difference detection pixel and second detection information of the second phase difference detection pixel corresponding to a spatial frequency in a frequency range corresponding to the region of the subject using the created filter, Generating means for generating
Phase difference calculation means for obtaining a correlation calculation curve of a subject indicating a correlation between the generated first detection information and second detection information, and calculating a phase difference for controlling the imaging lens to the in-focus position from the correlation calculation curve When,
And position control means for controlling the imaging lens based on the calculated phase difference in the case Asei location,
An imaging apparatus comprising:
前記フィルタ作成手段は、前記包含エリア及び内包エリアの空間周波数分布のうち類似した空間周波数分布の周波域に対応する前記包含エリアの周波域を、前記被写体の領域としてフィルタを作成する
ことを特徴とする請求項1に記載の撮像装置。
The filter creation means, the frequency range of the inclusion area corresponding to the frequency band of the spatial frequency distribution similar to one of the spatial frequency distribution of the inclusion area and enclosed areas, to create a filter as a region of the subject The imaging apparatus according to claim 1, wherein the imaging apparatus is characterized.
前記フィルタ作成手段は、前記包含エリア及び内包エリアの空間周波数分布に基づいて、前記包含エリアの空間周波数分布について前記被写体の領域と背景領域との各々に対応する周波域に分離し、分離した前記被写体の領域に対応する周波域を、前記被写体の領域としてフィルタを作成する
ことを特徴とする請求項1または請求項2に記載の撮像装置。
It said filter producing means, the inclusion area and on the basis of the spatial frequency distribution of the encapsulated area, separated into frequency range corresponding to each of the region and the background region of the subject on a spatial frequency distribution of the inclusion area and separated the frequency range corresponding to a region of the subject, the imaging apparatus according to claim 1 or claim 2, characterized in that to create a filter as a region of the subject.
前記エリア設定手段は、前記被写体領域の周囲を少なくとも含みかつ前記被写体領域の外周に外接する外接エリアを包含エリアに設定し、前記被写体領域のみからなり前記被写体領域の外周に内接する内接エリアを内包エリアに設定する
ことを特徴とする請求項1〜請求項3の何れか1項に記載の撮像装置。
It said area setting means sets a circumscribed area circumscribing at least contain and the outer peripheral region of the subject around the area of the subject to the inclusion area, inscribing the outer periphery region of the object comprises only region of the subject The imaging apparatus according to claim 1, wherein the inscribed area is set as an inclusion area.
前記エリア設定手段は、前記包含エリア及び内包エリアを四角形とし、前記合焦する被写体の中心から四角形を徐々に拡大して前記被写体領域の外周に内接した内包エリアを設定すると共に、前記被写体領域の周囲から四角形を徐々に縮小して前記被写体領域の外周に外接した包含エリアを設定する
ことを特徴とする請求項4に記載の撮像装置。
Said area setting means, together with the a quadrangle inclusion area and enclosed areas, gradually expanding the square from the center of the object to focus the case to set the enclosed area that is inscribed in the outer peripheral region of the subject, the subject the imaging apparatus according to claim 4 from the surrounding area by reducing gradually the rectangle and sets the inclusion area circumscribes the outer peripheral region of the subject.
前記エリア設定手段は、前記四角形を徐々に拡大して前記内包エリアを設定する場合、前記被写体領域の外周に内接した内包エリアから予め定めた拡大設定量だけ拡大した拡大エリアを内包エリアとして設定する
ことを特徴とする請求項5に記載の撮像装置。
Said area setting means, when setting the contained area gradually expanding the square, the enlarged area enlarged by enlarging the set amount a predetermined from enclosed areas inscribed in the outer peripheral region of the subject as contained area The imaging device according to claim 5, wherein the imaging device is set.
前記撮像レンズは、絞りを具備し、
前記エリア設定手段は、前記撮像レンズの焦点距離及び絞り値に基づいて焦点深度を求め、求めた焦点深度に基づいて前記拡大設定量を設定する
ことを特徴とする請求項6に記載の撮像装置。
The imaging lens includes a diaphragm,
The imaging apparatus according to claim 6, wherein the area setting unit obtains a focal depth based on a focal length and an aperture value of the imaging lens, and sets the enlargement setting amount based on the obtained focal depth. .
前記エリア設定手段は、前記包含エリア及び内包エリアを四角形とし、前記四角形を徐々に拡大して前記内包エリアを設定する場合、前記四角形に含まれる画素数による面積及び前記四角形の縦横比について、予め定めた閾値を超える面積及び縦横比の拡大エリアを内包エリアとして設定する
ことを特徴とする請求項5〜請求項7の何れか1項に記載の撮像装置。
In the case where the area setting means sets the inclusion area and the inclusion area as a rectangle and sets the inclusion area by gradually expanding the rectangle, the area according to the number of pixels included in the rectangle and the aspect ratio of the rectangle are set in advance. The imaging device according to any one of claims 5 to 7, wherein an area that exceeds a predetermined threshold and an enlarged area with an aspect ratio are set as an inclusion area.
前記エリア設定手段は、前記被写体領域の重心を求め、求めた重心から四角形を徐々に拡大して内包エリアを設定する
ことを特徴とする請求項5〜請求項8の何れか1項に記載の撮像装置。
It said area setting means determines a center of gravity of area of the subject, according to any one of claims 5 to 8, characterized in that to set the enclosed area gradually expanded heavy heart square was determined Imaging device.
被写体の画像を撮像する受光面に設けられた位相差検出エリア内に、瞳分割した第1の位相差検出画素及び第2の位相差検出画素で構成されるペア画素が配列形成された撮像素子と、前記撮像素子の前段に置かれ、前記被写体の合焦した光学像を前記受光面に結像させる合焦位置に制御される撮像レンズと、を備えた撮像装置において実行させる撮像プログラムであって、
合焦する被写体を特定し、該合焦する被写体の領域及び背景エリアを含む包含エリアと、該合焦する被写体の領域の内部の一部からなり、背景エリアを含まない内包エリアの各々を設定するエリア設定ステップと、
前記設定した包含エリア及び内包エリアの各々の空間周波数分布を演算し、演算した空間周波数分布の各々に基づいて前記被写体の領域に対応する周波数域の空間周波数を除去するフィルタを作成するフィルタ作成ステップと、
前記作成したフィルタを用いて前記被写体の領域に対応する周波数域の空間周波数に該当する前記第1の位相差検出画素の第1検出情報と前記第2の位相差検出画素の第2検出情報とを生成する生成ステップと、
前記生成した第1検出情報と第2検出情報との相関関係を示す被写体の相関演算曲線を求め、該相関演算曲線から前記撮像レンズを前記合焦位置に制御する位相差を求める位相差演算ステップと、
前記求めた位相差に基づき前記撮像レンズを前記合焦位置に制御する位置制御ステップと、
の各ステップをコンピュータによって実行させる撮像プログラム。
An imaging element in which a pair of pixels composed of a first phase difference detection pixel and a second phase difference detection pixel divided into pupils are arrayed in a phase difference detection area provided on a light receiving surface for picking up an image of a subject. And an imaging lens that is placed in front of the imaging device and controlled to a focusing position that focuses the focused optical image of the subject on the light receiving surface. And
Identify the object to be focused, each of the inclusion area including the area and the background area of the subject to be focused該合, Ri Do from part of the internal region of the subject to be focused 該合, the encapsulated area that does not include the background area An area setting step to set
A filter creation step of calculating a spatial frequency distribution of each of the set inclusion area and inclusion area and creating a filter that removes a spatial frequency of a frequency range corresponding to the subject area based on each of the calculated spatial frequency distributions When,
First detection information of the first phase difference detection pixel and second detection information of the second phase difference detection pixel corresponding to a spatial frequency in a frequency range corresponding to the region of the subject using the created filter, A generation step for generating
A phase difference calculation step of obtaining a correlation calculation curve of a subject indicating a correlation between the generated first detection information and second detection information, and obtaining a phase difference for controlling the imaging lens to the in-focus position from the correlation calculation curve. When,
A position control step of controlling the imaging lens based on the calculated phase difference in the case Asei location,
An imaging program for causing a computer to execute the steps.
JP2011080968A 2011-03-31 2011-03-31 Imaging apparatus and imaging program Expired - Fee Related JP5615756B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011080968A JP5615756B2 (en) 2011-03-31 2011-03-31 Imaging apparatus and imaging program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011080968A JP5615756B2 (en) 2011-03-31 2011-03-31 Imaging apparatus and imaging program

Publications (2)

Publication Number Publication Date
JP2012215700A JP2012215700A (en) 2012-11-08
JP5615756B2 true JP5615756B2 (en) 2014-10-29

Family

ID=47268519

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011080968A Expired - Fee Related JP5615756B2 (en) 2011-03-31 2011-03-31 Imaging apparatus and imaging program

Country Status (1)

Country Link
JP (1) JP5615756B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10337861B2 (en) 2015-02-13 2019-07-02 Samsung Electronics Co., Ltd. Image generating device for generating depth map with phase detection pixel

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014029353A (en) * 2012-07-31 2014-02-13 Sony Corp Focus adjustment device, and focus adjustment method
JP6124564B2 (en) * 2012-11-21 2017-05-10 キヤノン株式会社 Focus detection apparatus and method, and imaging apparatus
JP6238581B2 (en) * 2013-06-10 2017-11-29 キヤノン株式会社 Imaging apparatus and focus detection method
JP6347581B2 (en) * 2013-07-17 2018-06-27 キヤノン株式会社 Focus detection apparatus and control method thereof
JP6476539B2 (en) * 2013-09-26 2019-03-06 株式会社ニコン Focus detection apparatus and imaging apparatus
CN112866549B (en) * 2019-11-12 2022-04-12 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2663452B2 (en) * 1987-09-11 1997-10-15 キヤノン株式会社 Automatic focusing device
JPH04176289A (en) * 1990-11-09 1992-06-23 Hitachi Ltd Picture transmitting method
JPH0875985A (en) * 1994-09-06 1996-03-22 Nikon Corp Focus detector
JP2003215434A (en) * 2002-01-18 2003-07-30 Olympus Optical Co Ltd Range-finding device
JP5374065B2 (en) * 2008-04-07 2013-12-25 キヤノン株式会社 Imaging apparatus and control method thereof
JP2010186098A (en) * 2009-02-13 2010-08-26 Panasonic Corp Imaging apparatus
JP5274307B2 (en) * 2009-03-02 2013-08-28 キヤノン株式会社 Imaging device
JP2010204304A (en) * 2009-03-02 2010-09-16 Panasonic Corp Image capturing device, operator monitoring device, method for measuring distance to face
JP5195660B2 (en) * 2009-06-15 2013-05-08 カシオ計算機株式会社 Imaging apparatus, focusing method, and program
JP5030308B2 (en) * 2009-08-18 2012-09-19 キヤノン株式会社 Automatic focusing device, control method therefor, and imaging device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10337861B2 (en) 2015-02-13 2019-07-02 Samsung Electronics Co., Ltd. Image generating device for generating depth map with phase detection pixel

Also Published As

Publication number Publication date
JP2012215700A (en) 2012-11-08

Similar Documents

Publication Publication Date Title
JP5493010B2 (en) Imaging apparatus and focus position detection method thereof
JP5615756B2 (en) Imaging apparatus and imaging program
JP5066851B2 (en) Imaging device
US9215389B2 (en) Image pickup device, digital photographing apparatus using the image pickup device, auto-focusing method, and computer-readable medium for performing the auto-focusing method
JP5493011B2 (en) Imaging apparatus and focus position detection method thereof
JP5331945B2 (en) Imaging apparatus and driving method thereof
JP6789833B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP5603506B2 (en) Imaging apparatus and image processing method
JP2010020758A (en) Image processing apparatus, imaging apparatus, image processing method and program
US20180184013A1 (en) Image processing apparatus, image processing method, program, and storage medium
JP2003061105A (en) Image processing method, image processing program, image processing apparatus, and digital still camera using the image processing apparatus
JP2011124712A (en) Image processing device, method, and program
WO2012073727A1 (en) Imaging device and focal position detection method
KR101983047B1 (en) Image processing method, image processing apparatus and image capturing apparatus
JP5348258B2 (en) Imaging device
US20210019899A1 (en) Imaging device, distance measurement method, distance measurement program, and recording medium
JP2013160991A (en) Imaging apparatus
JP6833405B2 (en) Focus detection device, focus adjustment device, imaging device and focus detection method
JP5786355B2 (en) Defocus amount detection device and electronic camera
JP6482247B2 (en) FOCUS ADJUSTMENT DEVICE, IMAGING DEVICE, FOCUS ADJUSTMENT DEVICE CONTROL METHOD, AND PROGRAM
US11323689B2 (en) Image processing device, imaging device, image processing method, and recording medium
JP6600162B2 (en) Imaging apparatus and control method thereof
JP5597942B2 (en) Electronic camera
JP2006285094A (en) Auto-focus camera and auto-focus device
US9113027B2 (en) Imaging device, method for controlling imaging device, and storage medium storing a control program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130614

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140319

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140408

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140605

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140910

R150 Certificate of patent or registration of utility model

Ref document number: 5615756

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