Nothing Special   »   [go: up one dir, main page]

JP5786355B2 - Defocus amount detection device and electronic camera - Google Patents

Defocus amount detection device and electronic camera Download PDF

Info

Publication number
JP5786355B2
JP5786355B2 JP2011032242A JP2011032242A JP5786355B2 JP 5786355 B2 JP5786355 B2 JP 5786355B2 JP 2011032242 A JP2011032242 A JP 2011032242A JP 2011032242 A JP2011032242 A JP 2011032242A JP 5786355 B2 JP5786355 B2 JP 5786355B2
Authority
JP
Japan
Prior art keywords
pupil
data
pixel
pixels
defocus amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2011032242A
Other languages
Japanese (ja)
Other versions
JP2012173334A (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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2011032242A priority Critical patent/JP5786355B2/en
Publication of JP2012173334A publication Critical patent/JP2012173334A/en
Application granted granted Critical
Publication of JP5786355B2 publication Critical patent/JP5786355B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Transforming Light Signals Into Electric Signals (AREA)
  • Studio Devices (AREA)
  • Focusing (AREA)

Description

本発明は、デフォーカス量検出装置および電子カメラに関する。   The present invention relates to a defocus amount detection device and an electronic camera.

従来、二次元状に撮像用画素が配置された撮像素子の一部の領域にデフォーカス量検出用の瞳分割像を受光する瞳分割画素を配置し、撮像用画素によって画像を撮像すると同時に、瞳分割方向が異なる瞳分割画素の画素データ同士の位置ズレを検出することによりデフォーカス量を検出する技術が知られている。さらに、撮像画像の画質劣化を低減するために、デフォーカス検出用データの画素密度を維持しつつ撮像用の全瞳データの画素密度の低下を抑制する技術が提案されている(例えば特許文献1参照)。   Conventionally, a pupil-divided pixel that receives a pupil-divided image for defocus amount detection is arranged in a partial area of an imaging element in which imaging pixels are arranged two-dimensionally, and at the same time an image is captured by the imaging pixel, A technique for detecting a defocus amount by detecting a positional shift between pixel data of pupil division pixels having different pupil division directions is known. Furthermore, in order to reduce the image quality degradation of the captured image, a technique has been proposed that suppresses the decrease in the pixel density of the entire pupil data for imaging while maintaining the pixel density of the defocus detection data (for example, Patent Document 1). reference).

特開2009−141390号公報JP 2009-141390 A

しかしながら、従来技術では瞳分割画素の瞳分割データと撮像用画素の全瞳データとを用いて被写体像の位置ズレを検出する処理において、瞳分割画素と同じ列に交互に配置された全瞳データだけを用いるので、空間周波数成分が高い被写体に対して充分な位置ズレ検出ができず、デフォーカス量の精度が低下して撮影画像のピントが甘くなってしまうという問題があった。   However, in the prior art, in the process of detecting the positional deviation of the subject image using the pupil division data of the pupil division pixels and the whole pupil data of the imaging pixels, all the pupil data alternately arranged in the same column as the pupil division pixels Therefore, there is a problem in that sufficient positional deviation detection cannot be performed on a subject having a high spatial frequency component, the accuracy of the defocus amount is lowered, and the captured image becomes unfocused.

本発明の目的は、瞳分割データと全瞳データとを用いた位置ズレ検出精度を向上することができるデフォーカス量検出装置および電子カメラを提供することである。   An object of the present invention is to provide a defocus amount detection apparatus and an electronic camera that can improve the positional deviation detection accuracy using pupil division data and whole pupil data.

本発明に係るデフォーカス量検出装置は、二次元状に配置された撮像用画素の一部に瞳分割画素が配列された撮像素子から前記瞳分割画素の瞳分割データおよび前記瞳分割画素周辺の前記撮像用画素の全瞳データを読み込む画像データ入力部と、前記画像データ入力部が読み込んだ前記撮像用画素の前記全瞳データから前記瞳分割画素位置の全瞳データを補間生成する全瞳データ生成部と、前記全瞳データ生成部により補間生成された前記瞳分割画素位置の前記全瞳データおよび前記撮像用画素の全瞳データと、前記瞳分割画素から読み込まれた前記瞳分割データとの位置ズレ量を検出する位置ズレ検出部と、前記位置ズレ検出部が検出した位置ズレ量に応じてデフォーカス量を求めるデフォーカス量算出部とを有することを特徴とする。
The defocus amount detection device according to the present invention includes a pupil division data of the pupil division pixel and an area around the pupil division pixel from an imaging element in which the pupil division pixel is arranged in a part of the two-dimensionally arranged imaging pixels . An image data input unit that reads all the pupil data of the imaging pixel, and all pupil data that interpolates and generates all the pupil data at the pupil division pixel position from the all pupil data of the imaging pixel that is read by the image data input unit A generation unit, the whole pupil data of the pupil division pixel position interpolated and generated by the whole pupil data generation unit, the whole pupil data of the imaging pixel, and the pupil division data read from the pupil division pixel A position shift detection unit that detects a position shift amount, and a defocus amount calculation unit that obtains a defocus amount according to the position shift amount detected by the position shift detection unit.

特に、前記全瞳データ生成部は、前記撮像用画素から読み込まれた前記全瞳データに基づいて画像構造の方向を判定し、該判定結果に応じて前記瞳分割画素位置の全瞳データを補間生成する際に参照する前記撮像用画素を選択することを特徴とする。   In particular, the whole pupil data generation unit determines the direction of the image structure based on the whole pupil data read from the imaging pixels, and interpolates all the pupil data at the pupil division pixel position according to the determination result. The imaging pixel to be referred to when generating is selected.

さらに、前記全瞳データ生成部は、前記画像構造の方向を判定する際に、前記瞳分割画素に隣接する上下の前記全瞳データの差分と左右の前記全瞳データの差分とを比較し、差分が小さい方の前記全瞳データ用いて前記瞳分割画素位置の全瞳データを補間生成することを特徴とする。 Furthermore, when determining the direction of the image structure, the whole pupil data generation unit compares the difference between the upper and lower whole pupil data adjacent to the pupil division pixel and the difference between the left and right whole pupil data, The whole pupil data at the pupil division pixel position is generated by interpolation using the whole pupil data having a smaller difference.

また、前記全瞳データ生成部は、画像構造の方向を判定するための全瞳データと、前記瞳分割画素位置の全瞳データを補間生成する際に参照する全瞳データとに、前記瞳分割画素周辺の同じ範囲の前記撮像用画素の全瞳データを使用することを特徴とする。   Further, the all-pupil data generating unit is configured to divide the pupil division into all-pupil data for determining the direction of the image structure and all-pupil data to be referred to when interpolating and generating all-pupil data at the pupil division pixel position. The whole pupil data of the imaging pixels in the same range around the pixel is used.

さらに、前記全瞳データ生成部は、前記瞳分割画素が配置された列の全画素位置に対して全瞳データを生成することを特徴とする。   Further, the all-pupil data generation unit generates all-pupil data for all pixel positions in a column in which the pupil division pixels are arranged.

また、前記画像データ入力部は、前記瞳分割画素が配置された列から前記瞳分割データおよび前記全瞳データを、前記瞳分割画素が配置された列の上下の列から前記全瞳データをそれぞれ読み込むことを特徴とする。   Further, the image data input unit receives the pupil division data and the whole pupil data from a column in which the pupil division pixels are arranged, and the whole pupil data from columns above and below the column in which the pupil division pixels are arranged. It is characterized by reading.

或いは、前記画像データ入力部は、前記瞳分割画素周辺の複数の前記撮像用画素の全瞳データを前記撮像素子内で加算平均したデータを前記瞳分割画素位置の全瞳データとして読み出すことを特徴とする。   Alternatively, the image data input unit reads data obtained by adding and averaging all pupil data of the plurality of imaging pixels around the pupil division pixel in the imaging element as all pupil data at the pupil division pixel position. And

本発明に係る電子カメラは、前記デフォーカス量検出装置を有することを特徴とする電子カメラ。   The electronic camera which concerns on this invention has the said defocus amount detection apparatus, The electronic camera characterized by the above-mentioned.

本発明に係るデフォーカス量検出装置および電子カメラは、瞳分割データと全瞳データを用いた位置ズレ量の検出精度を向上することができる。   The defocus amount detection device and the electronic camera according to the present invention can improve the detection accuracy of the positional deviation amount using the pupil division data and the whole pupil data.

本実施形態に係る電子カメラ101の構成例を示す図である。It is a figure which shows the structural example of the electronic camera 101 which concerns on this embodiment. 撮像素子104の画素配置例を示す図である。3 is a diagram illustrating an example of pixel arrangement of an image sensor 104. FIG. 瞳分割画素の配置例を示す図である。It is a figure which shows the example of arrangement | positioning of a pupil division pixel. 制御部108の構成例を示す図である。3 is a diagram illustrating a configuration example of a control unit 108. FIG. 全瞳データの補間生成処理の説明図である。It is explanatory drawing of the interpolation production | generation process of all the pupil data. 補間生成後の瞳分割画素のデータ例を示す図である。It is a figure which shows the example of data of the pupil division | segmentation pixel after the interpolation production | generation. 全瞳データと瞳分割データの様子を示す図である。It is a figure which shows the mode of all the pupil data and pupil division data. 従来の全瞳データと瞳分割データの様子を示す図である。It is a figure which shows the mode of the conventional whole pupil data and pupil division data. 位置ズレ検出処理の説明図である。It is explanatory drawing of a position shift detection process. 内挿法による位置ズレ量の求め方を示す図である。It is a figure which shows how to obtain | require the positional offset amount by the interpolation method. AF処理のフローチャートである。It is a flowchart of AF processing. 撮像素子104の画素配置の変形例1を示す図である。6 is a diagram illustrating a first modification of the pixel arrangement of the image sensor 104. FIG. 撮像素子104の画素配置の変形例2を示す図である。It is a figure which shows the modification 2 of pixel arrangement | positioning of the image pick-up element. 撮像素子104の変形例を示す図である。It is a figure which shows the modification of the image pick-up element 104. FIG.

以下、本発明に係るデフォーカス量検出装置および電子カメラの実施形態について図面を用いて詳しく説明する。尚、以下の実施形態では、本発明に係るデフォーカス量検出装置が搭載された電子カメラ101の例について説明するが、デフォーカス量検出を行う専用のデバイスに適用してもよい。   Hereinafter, embodiments of a defocus amount detection apparatus and an electronic camera according to the present invention will be described in detail with reference to the drawings. In the following embodiment, an example of the electronic camera 101 equipped with the defocus amount detection apparatus according to the present invention will be described. However, the present invention may be applied to a dedicated device that performs defocus amount detection.

[電子カメラ101の構成]
先ず、電子カメラ101の構成について説明する。図1は電子カメラ101の構成例を示すブロック図で、電子カメラ101は、光学系102と、メカニカルシャッタ103と、撮像素子104と、A/D変換部105と、画像バッファ106と、画像処理部107と、制御部108と、メモリ109と、表示部110と、操作部111と、メモリカードIF(インターフェース)112とで構成される。
[Configuration of Electronic Camera 101]
First, the configuration of the electronic camera 101 will be described. FIG. 1 is a block diagram illustrating a configuration example of an electronic camera 101. The electronic camera 101 includes an optical system 102, a mechanical shutter 103, an image sensor 104, an A / D converter 105, an image buffer 106, and image processing. A unit 107, a control unit 108, a memory 109, a display unit 110, an operation unit 111, and a memory card IF (interface) 112 are configured.

光学系102は、ズームレンズやフォーカスレンズなどの複数枚のレンズおよびレンズ位置駆動機構、絞りおよび絞り駆動機構などで構成される。そして、制御部108は、レンズ位置駆動機構および絞り駆動機構に指令してズームレンズやフォーカスレンズの位置制御および絞り制御などを行う。   The optical system 102 includes a plurality of lenses such as a zoom lens and a focus lens, a lens position driving mechanism, a diaphragm and a diaphragm driving mechanism, and the like. Then, the control unit 108 instructs the lens position driving mechanism and the aperture driving mechanism to perform position control and aperture control of the zoom lens and the focus lens.

メカニカルシャッタ103は、シャッタおよびシャッタ駆動機構とで構成される。そして、制御部108は、シャッタ速度に応じてシャッタ駆動機構を制御して所定時間だけシャッタを開閉し、光学系102の光束を撮像素子104に入射する。   The mechanical shutter 103 includes a shutter and a shutter driving mechanism. The control unit 108 controls the shutter driving mechanism according to the shutter speed to open and close the shutter for a predetermined time, and causes the light flux of the optical system 102 to enter the image sensor 104.

撮像素子104は、例えばCMOS型固体撮像素子で構成され、受光面に光電変換部を有する複数の画素が二次元状に配置されている。そして、制御部108の指令に応じて、各画素で光電変換された画像信号を読み出す。特に、本実施形態に係る電子カメラ101の撮像素子104は、デフォーカス量を求めるために、撮像素子104の撮像用画素の一部に瞳分割方式による焦点検出を行うための瞳分割画素が配置されている。   The image sensor 104 is configured by, for example, a CMOS solid-state image sensor, and a plurality of pixels having a photoelectric conversion unit on a light receiving surface are two-dimensionally arranged. Then, in response to a command from the control unit 108, an image signal photoelectrically converted by each pixel is read out. In particular, in the imaging device 104 of the electronic camera 101 according to the present embodiment, a pupil division pixel for performing focus detection by the pupil division method is arranged in a part of the imaging pixels of the imaging device 104 in order to obtain a defocus amount. Has been.

A/D変換部105は、撮像素子104が出力するアナログの画像信号をデジタルの画像データに変換し、撮影画像1枚分の画像データを画像バッファ106に記憶する。例えば、撮像素子104から読み出される画像の解像度が1000画素×1000画素である場合、100万画素分の画像データが画像バッファ106に取り込まれる。   The A / D conversion unit 105 converts the analog image signal output from the image sensor 104 into digital image data, and stores the image data for one captured image in the image buffer 106. For example, when the resolution of an image read from the image sensor 104 is 1000 pixels × 1000 pixels, image data for 1 million pixels is taken into the image buffer 106.

画像バッファ106は、例えば揮発性の高速メモリで構成される。そして、A/D変換部105が出力する画像データを取り込むだけでなく、画像処理部107が画像処理を行う際のバッファメモリとしても使用される。或いは、撮影画像およびメモリカードIF112に接続されたメモリカード112aに保存されている撮影済の画像を読み出して表示部110に表示するときの表示バッファとしても使用される。   The image buffer 106 is composed of, for example, a volatile high-speed memory. The image data output from the A / D conversion unit 105 is not only captured but also used as a buffer memory when the image processing unit 107 performs image processing. Alternatively, it is also used as a display buffer when a captured image and a captured image stored in the memory card 112 a connected to the memory card IF 112 are read and displayed on the display unit 110.

画像処理部107は、画像バッファ106に取り込まれた画像データに対して、ホワイトバランス処理,色補間処理,ガンマ補正処理,彩度強調処理,輪郭輪郭強調処理などの画像処理を施す。また、JPEG規格などに準拠した画像圧縮方法で画像処理後の画像データに画像圧縮処理を施す。   The image processing unit 107 performs image processing such as white balance processing, color interpolation processing, gamma correction processing, saturation enhancement processing, and contour outline enhancement processing on the image data captured in the image buffer 106. Further, image compression processing is performed on the image data after image processing by an image compression method compliant with the JPEG standard or the like.

制御部108は、例えば内部に記憶されたプログラムに従って動作するCPUで構成され、電子カメラ101全体の動作を制御する。例えば制御部108は、操作部111のレリーズボタン押下時に光学系102のフォーカスレンズの位置制御や絞り制御を行ってメカニカルシャッタ103を開閉し、撮像素子104で被写体画像を撮像する。そして、制御部108は、撮像素子104から読み出した画像信号をA/D変換部105で画像データに変換し、1画面分の画像データを画像バッファ106に取り込む。さらに、制御部108は、画像バッファ106に取り込まれた画像データに対して所定の画像処理を施すよう画像処理部107に指令する。そして、制御部108は、画像処理後の画像データに所定のファイル名やヘッダ情報を付加してメモリカードI/F112に装着されているメモリカード112aに保存する。或いは、画像処理後の画像データを撮影画像として表示部110に表示する。また、制御部108は、後に説明するオートフォーカス処理(AF処理)を実行する。   The control unit 108 is constituted by a CPU that operates according to a program stored therein, for example, and controls the overall operation of the electronic camera 101. For example, the control unit 108 performs position control and aperture control of the focus lens of the optical system 102 when the release button of the operation unit 111 is pressed, opens and closes the mechanical shutter 103, and captures a subject image with the image sensor 104. Then, the control unit 108 converts the image signal read from the image sensor 104 into image data by the A / D conversion unit 105, and captures image data for one screen into the image buffer 106. Furthermore, the control unit 108 instructs the image processing unit 107 to perform predetermined image processing on the image data captured in the image buffer 106. Then, the control unit 108 adds a predetermined file name and header information to the image data after the image processing, and saves it in the memory card 112a attached to the memory card I / F 112. Alternatively, the image data after image processing is displayed on the display unit 110 as a captured image. In addition, the control unit 108 executes an autofocus process (AF process) described later.

メモリ109は、例えばフラッシュメモリなどの不揮発性の半導体メモリで構成され、電子カメラ101の撮影モード、露出情報やフォーカス情報などのパラメータが記憶される。制御部108は、これらのパラメータを参照して電子カメラ101の動作を制御する。尚、これらのパラメータは、操作部111を介して行われるユーザー操作に応じて適宜更新される。特に本実施形態では、メモリ109には、フォーカス制御に用いられる被写体像の位置ズレ量をデフォーカス量に変換するためのテーブルまたは変換式が予め記憶されている。   The memory 109 is composed of, for example, a nonvolatile semiconductor memory such as a flash memory, and stores parameters such as a shooting mode, exposure information, and focus information of the electronic camera 101. The control unit 108 controls the operation of the electronic camera 101 with reference to these parameters. Note that these parameters are appropriately updated according to user operations performed via the operation unit 111. In particular, in the present embodiment, the memory 109 stores in advance a table or conversion formula for converting a positional deviation amount of a subject image used for focus control into a defocus amount.

表示部110は、液晶モニタなどで構成される。そして、制御部108は、撮影画像や電子カメラ101の動作設定に必要なメニュー画面などを表示する。   The display unit 110 includes a liquid crystal monitor or the like. Then, the control unit 108 displays a captured image, a menu screen necessary for operation setting of the electronic camera 101, and the like.

操作部111は、電源ボタン、レリーズボタン、撮影モード選択ダイヤル、メニュー画面操作用の十字ボタンなどで構成される。ユーザーは、これらの操作ボタンを操作して電子カメラ101を使用する。例えば撮影モード選択ダイヤルでは、撮影モードやフォーカスモードなどを選択する。そして、これらの操作ボタンの操作情報は制御部108に出力され、制御部108は操作情報に応じて電子カメラ101の動作を制御する。   The operation unit 111 includes a power button, a release button, a shooting mode selection dial, a cross button for menu screen operation, and the like. The user operates these operation buttons to use the electronic camera 101. For example, the shooting mode selection dial selects a shooting mode or a focus mode. The operation information of these operation buttons is output to the control unit 108, and the control unit 108 controls the operation of the electronic camera 101 according to the operation information.

メモリカードIF112は、電子カメラ101にメモリカード112aを接続するためのインターフェースである。そして、制御部108は、メモリカードIF112を介してメモリカード112aに画像データを読み書きする。   The memory card IF 112 is an interface for connecting the memory card 112 a to the electronic camera 101. Then, the control unit 108 reads and writes image data from and to the memory card 112a via the memory card IF 112.

以上が電子カメラ101の構成および基本動作である。   The above is the configuration and basic operation of the electronic camera 101.

[撮像素子104の画素配置]
次に、本実施形態に係る電子カメラ101で使用する撮像素子104の画素配置の一例について図2を用いて説明する。図2において、撮像素子104は、x軸方向およびy軸方向の二次元状に複数の画素が配置されている。尚、各画素はx座標とy座標とを用いて画素p(x,y)と表記する。例えば、x座標がx0、y座標がy0の位置の画素は、画素p(x0,y0)となる。
[Pixel Arrangement of Image Sensor 104]
Next, an example of the pixel arrangement of the image sensor 104 used in the electronic camera 101 according to the present embodiment will be described with reference to FIG. In FIG. 2, the imaging element 104 has a plurality of pixels arranged in a two-dimensional shape in the x-axis direction and the y-axis direction. Each pixel is expressed as a pixel p (x, y) using the x coordinate and the y coordinate. For example, the pixel at the position where the x coordinate is x0 and the y coordinate is y0 is the pixel p (x0, y0).

また、図2において、二次元状に配置された複数の画素は、R、G、B、Aの4種類の符号が付けられている。Rは赤色のフィルタを有する画素、Gは緑色のフィルタを有する画素、Bは青色のフィルタを有する画素をそれぞれ示し、これらのRGBの各画素は撮像用画素としてベイヤー配列に従って配置されている。そして、本実施形態に係る電子カメラ101の撮像素子104では、撮像用画素の一部の画素に瞳分割方式による被写体像の位置ズレ量を検出するための瞳分割画素が配置されている。図2において、符号Aで示された画素が瞳分割画素で、同図では画素p(x0−4,y0)、画素p(x0−2,y0)、画素p(x0,y0)、画素p(x0+2,y0)、画素p(x0+4,y0)の5つの画素が瞳分割画素に該当し、瞳分割方向に対応する行y0に1画素置きに配置されている。   In FIG. 2, a plurality of pixels arranged two-dimensionally are assigned four types of symbols, R, G, B, and A. R represents a pixel having a red filter, G represents a pixel having a green filter, and B represents a pixel having a blue filter. These RGB pixels are arranged in accordance with a Bayer array as imaging pixels. In the image sensor 104 of the electronic camera 101 according to the present embodiment, pupil division pixels for detecting a positional deviation amount of the subject image by the pupil division method are arranged in some of the pixels for imaging. In FIG. 2, the pixel indicated by the symbol A is a pupil-divided pixel, and in the same figure, the pixel p (x0-4, y0), the pixel p (x0-2, y0), the pixel p (x0, y0), and the pixel p Five pixels of (x0 + 2, y0) and pixel p (x0 + 4, y0) correspond to pupil division pixels, and are arranged every other pixel in row y0 corresponding to the pupil division direction.

尚、図2では5つの瞳分割画素しか描かれていないが、瞳分割方式による被写体像の位置ズレ量を検出可能な数の瞳分割画素が行y0に同様に配置されている。また、図2の例では、ベイヤー配列のB画素の位置に瞳分割画素を配置したが、行(y0+1)のR画素の位置に瞳分割画素を配置してもよい。或いは、他の行のG画素の位置に配置してもよい。また、瞳分割方向が列方向である場合も同様である。また、本実施形態では、後で説明するように、瞳分割画素位置の全瞳データをG画素から補間生成して、位置ズレ量を求めるので、瞳分割画素を覆うカラーフィルターの分光透過率はG画素と同じであるものとする。但し、異なる色成分の構造は類似する傾向があるので、分光透過率が異なっても画像構造の判定や位置ズレ量の検出を行うことができるので、瞳分割画素を覆うカラーフィルターの分光透過率は、全瞳画素と異なっていてもよい。   In FIG. 2, only five pupil-divided pixels are drawn, but the number of pupil-divided pixels that can detect the amount of positional deviation of the subject image by the pupil-dividing method is similarly arranged in the row y0. In the example of FIG. 2, the pupil division pixel is arranged at the position of the B pixel in the Bayer array, but the pupil division pixel may be arranged at the position of the R pixel in the row (y0 + 1). Or you may arrange | position in the position of G pixel of another row. The same applies when the pupil division direction is the column direction. Also, in this embodiment, as will be described later, all pupil data at the pupil division pixel position is generated by interpolation from the G pixel, and the amount of positional deviation is obtained, so the spectral transmittance of the color filter covering the pupil division pixel is Assume that it is the same as the G pixel. However, since the structures of different color components tend to be similar, it is possible to determine the image structure and detect the amount of misalignment even if the spectral transmittance is different, so the spectral transmittance of the color filter that covers the pupil-divided pixels May be different from all pupil pixels.

ここで、撮像用画素と瞳分割画素について説明する。図3(a)は、図2の行y0の各画素を光束の入射方向から見た図である。図3(a)において、行番号および列番号は図2に対応し、画素p(x0−4,y0)、画素p(x0−2,y0)、画素p(x0,y0)、画素p(x0+2,y0)、画素p(x0+4,y0)の5つの画素が瞳分割画素である。例えば瞳分割画素p(x0,y0)は、フォトダイオードなどで構成される光電変換部361と、マイクロレンズ362とを有し、光電変換部361は画素の左側に偏って配置されている。他の4つの瞳分割画素についても同様に光電変換部361は画素の左側に偏って配置されている。一方、瞳分割画素と交互に配置されている撮像用画素は、例えば撮像用画素p(x0+1,y0)のように、フォトダイオードなどで構成される光電変換部363と、マイクロレンズ364とを有し、光電変換部363は左右に偏ることなく画素全体に配置されている。これは、図4(b)に示すように、他の行の撮像用画素R、G、Bのそれぞれについても同様である。また、図4(a)および図4(b)の例では、瞳分割画素の光電変換部361は画素の左側に偏って配置されているが、図4(c)に示すように、画素の右側に偏って配置されてもよい。尚、瞳分割画素のように左側または右側に偏って配置された光電変換部から得られる画像データを瞳分割データと称する。また、左側または右側に偏って配置されることなく全画素に均等に配置された光電変換部から得られる画像データを全瞳データと称する。   Here, imaging pixels and pupil division pixels will be described. FIG. 3A is a diagram of each pixel in the row y0 in FIG. 2 viewed from the incident direction of the light beam. 3A, the row number and the column number correspond to those in FIG. 2, and the pixel p (x0-4, y0), the pixel p (x0-2, y0), the pixel p (x0, y0), and the pixel p ( Five pixels of x0 + 2, y0) and pixel p (x0 + 4, y0) are pupil division pixels. For example, the pupil-divided pixel p (x0, y0) includes a photoelectric conversion unit 361 configured by a photodiode or the like and a microlens 362, and the photoelectric conversion unit 361 is arranged to be biased to the left side of the pixel. Similarly, with respect to the other four pupil-divided pixels, the photoelectric conversion units 361 are arranged to be biased to the left side of the pixels. On the other hand, the imaging pixels arranged alternately with the pupil-divided pixels include a photoelectric conversion unit 363 configured by a photodiode or the like and a microlens 364, such as an imaging pixel p (x0 + 1, y0). The photoelectric conversion unit 363 is arranged on the entire pixel without being biased left and right. The same applies to each of the imaging pixels R, G, and B in the other rows as shown in FIG. 4A and 4B, the photoelectric conversion units 361 of the pupil-divided pixels are arranged on the left side of the pixels. However, as shown in FIG. It may be arranged to be biased to the right side. Note that image data obtained from a photoelectric conversion unit arranged on the left side or the right side like the pupil division pixels is referred to as pupil division data. In addition, image data obtained from photoelectric conversion units arranged evenly on all pixels without being biased to the left or right is referred to as all pupil data.

[オートフォーカス処理]
ここで、本実施形態に係る電子カメラ101は、オートフォーカス機能を有しており、制御部108により実行される。オートフォーカス機能を使用する場合、制御部108は、メカニカルシャッタ103を開放状態にして光学系102を介して入射する被写体像を撮像素子104で撮像し、デフォーカス量を検出する。そして、制御部108は、デフォーカス量に応じて光学系102のフォーカスレンズ位置を制御し、フォーカス位置に合わせる。
[Auto focus processing]
Here, the electronic camera 101 according to the present embodiment has an autofocus function and is executed by the control unit 108. When the autofocus function is used, the control unit 108 opens the mechanical shutter 103 and picks up a subject image incident via the optical system 102 with the image sensor 104 and detects the defocus amount. Then, the control unit 108 controls the focus lens position of the optical system 102 according to the defocus amount, and adjusts it to the focus position.

次に、制御部108のAF処理部200により実行されるオートフォーカス処理について詳しく説明する。図4は、制御部108のAF処理部200の構成を示すブロック図である。図4において、AF処理部200は、画像データ入力部201と、全瞳データ生成部202と、位置ズレ量検出部203と、デフォーカス量算出部204と、フォーカスレンズ制御部205とで構成される。尚、図4の例ではわかり易いように5つのブロックに分けたが、いずれかのブロックを1つにまとめてもよいし、1つのブロックの処理を複数のブロックに分けてもよい。例えば位置ズレ量検出部203とデフォーカス量算出部204とフォーカスレンズ制御部205とを1つのブロックにまとめてフォーカス制御部としてもよい。以下、図4の各ブロックについて説明する。   Next, the autofocus process executed by the AF processing unit 200 of the control unit 108 will be described in detail. FIG. 4 is a block diagram illustrating a configuration of the AF processing unit 200 of the control unit 108. In FIG. 4, the AF processing unit 200 includes an image data input unit 201, an all-pupil data generation unit 202, a positional deviation amount detection unit 203, a defocus amount calculation unit 204, and a focus lens control unit 205. The In the example of FIG. 4, the blocks are divided into five blocks for easy understanding. However, any of the blocks may be combined into one block, and the processing of one block may be divided into a plurality of blocks. For example, the positional deviation amount detection unit 203, the defocus amount calculation unit 204, and the focus lens control unit 205 may be combined into one block and used as a focus control unit. Hereinafter, each block of FIG. 4 will be described.

画像データ入力部201は、撮像素子104から読み出す画素の範囲を指定して読み出す処理を行う。例えば図2の場合、画像データ入力部201は、瞳分割画素を含む行y0を撮像素子104から読み出す。或いは、画像データ入力部201は、行y0の前後の行(y0−1)と行(y0+1)を含む3行分の画像信号を撮像素子104から読み出す。そして、撮像素子104から読み出された画像信号は、A/D変換部105で画像データに変換されて、画像バッファ106に取り込まれる。そして、画像データ入力部201は、画像バッファ106に取り込まれた瞳分割画素およびその周辺の撮像用画素の画像データを全瞳データ生成部202に出力する。   The image data input unit 201 performs a process of reading by designating a range of pixels to be read from the image sensor 104. For example, in the case of FIG. 2, the image data input unit 201 reads out the row y <b> 0 including the pupil-divided pixels from the image sensor 104. Alternatively, the image data input unit 201 reads out image signals for three rows including the row (y0-1) and the row (y0 + 1) before and after the row y0 from the image sensor 104. Then, the image signal read from the image sensor 104 is converted into image data by the A / D converter 105 and taken into the image buffer 106. Then, the image data input unit 201 outputs the image data of the pupil-divided pixels and the surrounding imaging pixels taken into the image buffer 106 to the all-pupil data generation unit 202.

全瞳データ生成部202は、デフォーカス量検出のために、画像データ入力部201が撮像素子104から読み込んだ撮像用画素の全瞳データから瞳分割画素位置の全瞳データを補間する。例えば図5に示すように、瞳分割画素p(x0,y0)の全瞳データDを周辺のG画素(画素p(x0,y0−1)、画素p(x0,y0+1)、画素p(x0−1,y0)、画素p(x0+1,y0))から補間する。特に本実施形態に係る電子カメラ101では、補間する際に画像の構造を判別して補間に使用する画素を決定する。ここで、画像の構造とは、画素値が変化する形を意味し、例えば縦線の場合は縦方向の変化が少なく、横方向の変化が大きくなる。逆に横線の場合は横方向の変化が少なく、縦方向の変化が大きくなる。   The whole pupil data generation unit 202 interpolates all the pupil data at the pupil division pixel position from all the pupil data of the imaging pixels read by the image data input unit 201 from the imaging element 104 in order to detect the defocus amount. For example, as shown in FIG. 5, the entire pupil data D of the pupil-divided pixel p (x0, y0) is converted into peripheral G pixels (pixel p (x0, y0-1), pixel p (x0, y0 + 1), pixel p (x0). -1, y0) and pixel p (x0 + 1, y0)). In particular, in the electronic camera 101 according to the present embodiment, when interpolating, the structure of the image is discriminated and the pixels used for the interpolation are determined. Here, the structure of the image means a shape in which the pixel value changes. For example, in the case of a vertical line, the change in the vertical direction is small and the change in the horizontal direction is large. Conversely, in the case of a horizontal line, the change in the horizontal direction is small and the change in the vertical direction is large.

これにより、被写体像が縦線の場合には瞳分割画素の上下のG画素を用い、被写体像が横線の場合には瞳分割画素の左右のG画素を用いて瞳分割画素位置の全瞳データを補間するので、補間精度が高くなり細い線構造を正しく再現できる。   Accordingly, when the subject image is a vertical line, the upper and lower G pixels of the pupil division pixel are used, and when the subject image is a horizontal line, the right and left G pixels of the pupil division pixel are used. Is interpolated, so that the interpolation accuracy is improved and the thin line structure can be correctly reproduced.

尚、本実施形態に係る電子カメラ101では、画像の構造を求める際に使用する撮像用画素に、補間生成に使用する撮像用画素と同じ範囲の画素を用いる。これにより、画像構造の判定のためだけに別に撮像素子104から画像データを読み出す必要がなくなり、処理負荷の低減と処理速度の向上を図ることができる。もちろん、画像構造をより正確に求めるために、処理速度に余裕がある場合は、瞳分割画素の行の上下2行の画素だけでなくさらに広い範囲の画素を読み出すようにしても構わない。また、補間に用いる画素についても上記には限定されず、さらに広い範囲の画素を参照して補間するようにしても良い。   In the electronic camera 101 according to the present embodiment, pixels in the same range as the imaging pixels used for interpolation generation are used as the imaging pixels used when obtaining the image structure. Thereby, it is not necessary to separately read out image data from the image sensor 104 only for the determination of the image structure, and the processing load can be reduced and the processing speed can be improved. Of course, in order to obtain the image structure more accurately, not only the pixels in the upper and lower two rows of the pupil-divided pixel row but also a wider range of pixels may be read if the processing speed is sufficient. Also, the pixels used for interpolation are not limited to the above, and interpolation may be performed with reference to a wider range of pixels.

次に、補間方法の一例について具体的に説明する。図5において、先ず、全瞳データ生成部202が瞳分割画素p(x0,y0)の全瞳データDを補間する際に、周辺のG画素(画素p(x0,y0−1)、画素p(x0,y0+1)、画素p(x0−1,y0)、画素p(x0+1,y0))から画像構造を判別する。画像構造の判別は、瞳分割画素p(x0,y0)の上下のG画素(画素p(x0,y0−1)および画素p(x0,y0+1))の差分の絶対値Dvと(式1)、瞳分割画素p(x0,y0)の左右のG画素(画素p(x0−1,y0)および画素p(x0+1,y0))の差分の絶対値Dhとを求め(式2)、差分の絶対値Dvと差分の絶対値Dhとを比較する。
Dv=|G(x0,y0-1)-G(x0,y0+1)| …(式1)
Dh=|G(x0-1,y0)-G(x0+1,y0)| …(式2)
・Dv≦Dhの場合は、(式3)により、瞳分割画素p(x0,y0)の全瞳データD(x0,y0)を求める。
D(x0,y0)=(G(x0,y0-1)+G(x0,y0+1))/2 …(式3)
・Dv>Dhの場合は、(式4)により、瞳分割画素p(x0,y0)の全瞳データD(x0,y0)を求める。
D(x0,y0)=(G(x0-1,y0)+G(x0+1,y0))/2 …(式4)
同様に、他の瞳分割画素p(x0−4,y0)、画素p(x0−2,y0)、画素p(x0+2,y0)、画素p(x0+4,y0)についても周辺のG画素から補間して各瞳分割画素位置の全瞳データDを求める。
Next, an example of an interpolation method will be specifically described. In FIG. 5, first, when the entire pupil data generation unit 202 interpolates the entire pupil data D of the pupil division pixel p (x0, y0), the peripheral G pixel (pixel p (x0, y0-1), pixel p The image structure is determined from (x0, y0 + 1), pixel p (x0-1, y0), pixel p (x0 + 1, y0)). The image structure is determined by calculating the absolute value Dv of the difference between the upper and lower G pixels (pixel p (x0, y0-1) and pixel p (x0, y0 + 1)) of the pupil division pixel p (x0, y0) (Formula 1). Then, the absolute value Dh of the difference between the left and right G pixels (pixel p (x0-1, y0) and pixel p (x0 + 1, y0)) of the pupil division pixel p (x0, y0) is obtained (formula 2), The absolute value Dv is compared with the absolute value Dh of the difference.
Dv = | G (x0, y0-1) -G (x0, y0 + 1) | (Formula 1)
Dh = | G (x0-1, y0) -G (x0 + 1, y0) | (Formula 2)
In the case of Dv ≦ Dh, all pupil data D (x0, y0) of the pupil division pixel p (x0, y0) is obtained by (Equation 3).
D (x0, y0) = (G (x0, y0-1) + G (x0, y0 + 1)) / 2 (Formula 3)
When Dv> Dh, the total pupil data D (x0, y0) of the pupil division pixel p (x0, y0) is obtained by (Equation 4).
D (x0, y0) = (G (x0-1, y0) + G (x0 + 1, y0)) / 2 (Formula 4)
Similarly, other pupil-divided pixels p (x0-4, y0), pixel p (x0-2, y0), pixel p (x0 + 2, y0), and pixel p (x0 + 4, y0) are also interpolated from the surrounding G pixels. Thus, the entire pupil data D at each pupil division pixel position is obtained.

また、瞳分割画素と同じ行の撮像用画素のG画素については、そのままG画素の画素データをそのG画素位置の全瞳データDとする。これにより、図6に示すような、瞳分割画素位置には、瞳分割データAと補間生成した全瞳データDの2つの画像データと、瞳分割画素の間にあるG画素位置の全瞳データDとを用いて、瞳分割方式による位置ズレ量の検出を行うことができる。   For the G pixel of the imaging pixel in the same row as the pupil division pixel, the pixel data of the G pixel is used as the whole pupil data D at the G pixel position as it is. As a result, as shown in FIG. 6, at the pupil division pixel position, two pieces of image data of pupil division data A and all pupil data D generated by interpolation, and all pupil data at the G pixel position between the pupil division pixels. Using D, it is possible to detect the amount of positional deviation by the pupil division method.

図7は、行y0の各画素の画素値の例を示すグラフである。図7において、実線は光学系102から入射する全瞳像の明るさの変化を示し、点線は光学系102から入射する瞳分割像の明るさの変化を示している。そして、黒丸印はG画素位置の全瞳データDまたは瞳分割画素位置の補間生成された全瞳データDを示し、白三角印は瞳分割画素位置の瞳分割データAを示している。尚、図3に示したように、瞳分割画素の受光面積は撮像用画素の受光面積の半分しかないので、撮像素子104から読み出される瞳分割画素の出力信号は撮像用画素の出力信号の1/2になるが、図7のグラフでは瞳分割データと全瞳データの値が同じになるように瞳分割データに約2倍の係数を掛けて出力レベルを調整している。但し、撮像用画素の全瞳データの大きさに対する瞳分割画素の瞳分割データの大きさの割合は、光学系102のF値、瞳距離、撮像素子104の受光面上の画素位置などに応じて変わる場合があるので、これらの光学条件に基づいて上記係数を調整してもよい。或いは、(近傍の撮像用画素の全瞳データの平均/近傍の瞳分割画素の瞳分割データの平均)を求めて、上記係数として用いてもよい。   FIG. 7 is a graph illustrating an example of the pixel value of each pixel in the row y0. In FIG. 7, the solid line indicates the change in the brightness of the whole pupil image incident from the optical system 102, and the dotted line indicates the change in the brightness of the pupil divided image incident from the optical system 102. A black circle mark indicates the entire pupil data D at the G pixel position or the entire pupil data D generated by interpolation at the pupil division pixel position, and a white triangle mark indicates the pupil division data A at the pupil division pixel position. As shown in FIG. 3, since the light reception area of the pupil division pixel is only half of the light reception area of the imaging pixel, the output signal of the pupil division pixel read from the imaging element 104 is 1 of the output signal of the imaging pixel. In the graph of FIG. 7, the output level is adjusted by multiplying the pupil division data by a factor of about 2 so that the pupil division data and the entire pupil data have the same value. However, the ratio of the size of the pupil division data of the pupil division pixel to the size of the whole pupil data of the imaging pixel depends on the F value of the optical system 102, the pupil distance, the pixel position on the light receiving surface of the image sensor 104, and the like. Therefore, the coefficient may be adjusted based on these optical conditions. Alternatively, (average of all pupil data of neighboring imaging pixels / average of pupil division data of neighboring pupil division pixels) may be obtained and used as the coefficient.

このようにして、瞳位置が異なる全瞳データと瞳分割データとの被写体像の位置ズレ量を検出することができ、位置ズレ量からデフォーカス量を求めてフォーカス制御を行うことができる。例えば図7の場合、x座標が4,5以外の画素値は約200の明るさで、中央部の谷が約70の明るさの画像構造を有している。図7において、実線で示した全瞳像と点線で示した瞳分割像との実際の位置ズレ量は、実線と点線の谷の位置に着目すると約0.5画素である。ここで、この位置ズレ量を正確に求められない場合、デフォーカス量に誤差が生じ、フォーカスが甘くなるなどの問題が生じるが、本実施形態に係る電子カメラ101の位置ズレ量検出部203は、正確な位置ズレ量を求めることができる。   In this way, it is possible to detect the positional deviation amount of the subject image between the entire pupil data and the pupil division data having different pupil positions, and focus control can be performed by obtaining the defocus amount from the positional deviation amount. For example, in the case of FIG. 7, the pixel value other than x coordinates of 4 and 5 has an image structure with a brightness of about 200 and a valley at the center of about 70. In FIG. 7, the actual positional deviation amount between the whole pupil image indicated by the solid line and the pupil divided image indicated by the dotted line is about 0.5 pixels when attention is paid to the position of the valley between the solid line and the dotted line. Here, when the amount of positional deviation cannot be obtained accurately, an error occurs in the amount of defocus and a problem such as poor focus occurs. However, the positional deviation amount detection unit 203 of the electronic camera 101 according to the present embodiment is An accurate positional deviation amount can be obtained.

次に、位置ズレ量検出部203の処理について説明する。位置ズレ量検出部203は全瞳データ生成部202が補間した瞳分割画素位置の全瞳データおよび瞳分割画素と交互に配置されている撮像用画素の全瞳データと、瞳分割画素位置の瞳分割データとを用いて被写体像の位置ズレ量を求める。   Next, processing of the positional deviation amount detection unit 203 will be described. The positional deviation amount detection unit 203 includes the whole pupil data at the pupil division pixel position interpolated by the whole pupil data generation unit 202, the whole pupil data of the imaging pixels alternately arranged with the pupil division pixel, and the pupil at the pupil division pixel position. The position deviation amount of the subject image is obtained using the divided data.

ここで、本実施形態に係る電子カメラ101の特徴がわかり易いように、従来の位置ズレ量の検出方法について、図8を用いて説明する。図8は、先に説明した図7に対応する図で、全瞳像の実線と瞳分割像の点線とで示された画像構造は図7と同じである。図8において、黒四角印は瞳分割画素と同じ行にあるG画素位置の全瞳データを示し、白三角印は図7と同様に瞳分割画素位置の瞳分割データを示している。尚、図8においても、図7と同様に、瞳分割データと全瞳データの値が同レベルになるように瞳分割データに約2倍の係数を掛けている。   Here, in order to make it easy to understand the characteristics of the electronic camera 101 according to the present embodiment, a conventional method of detecting a positional deviation amount will be described with reference to FIG. FIG. 8 is a diagram corresponding to FIG. 7 described above, and the image structure indicated by the solid line of the whole pupil image and the dotted line of the pupil division image is the same as FIG. In FIG. 8, black square marks indicate all pupil data at the G pixel position in the same row as the pupil division pixels, and white triangle marks indicate pupil division data at the pupil division pixel positions as in FIG. In FIG. 8, as in FIG. 7, the pupil division data is multiplied by a factor of about two so that the values of the pupil division data and the entire pupil data are the same level.

このように、従来は、全瞳データの画素位置と、瞳分割データの画素位置とが1画素毎に交互に得られるだけなので、全瞳データから得られる谷の位置はx座標が4の位置で、瞳分割データから得られる谷の位置はx座標の5の位置であるという情報しか得られない。このため、全瞳データと瞳分割データとの位置ズレ量は1画素と判定される。そして、1画素の位置ズレ量に応じたデフォーカス量が求められフォーカス制御が実行される。ところが、実際の位置ズレ量は約0.5画素なので、デフォーカス量に誤差が生じ、フォーカス位置が甘くなってしまうという問題が生じる。   Thus, conventionally, since the pixel position of all pupil data and the pixel position of pupil division data are only obtained alternately for each pixel, the valley position obtained from all pupil data is the position where the x coordinate is 4. Thus, only the information that the valley position obtained from the pupil division data is the position of the x coordinate 5 can be obtained. For this reason, the amount of positional deviation between all pupil data and pupil division data is determined to be one pixel. Then, a defocus amount corresponding to the positional deviation amount of one pixel is obtained, and focus control is executed. However, since the actual positional shift amount is about 0.5 pixels, there is a problem that an error occurs in the defocus amount and the focus position becomes unclean.

これに対して、本実施形態に係る電子カメラ101では、図7に示すように、瞳分割画素位置の全瞳データを周辺の撮像用画素の全瞳データから補間して生成するので、瞳分割画素を含む全ての画素位置で全瞳データが得られる。これにより、全瞳データによる画像の分解能が高くなり、従来より高精度の位置ズレ量の検出が可能になる。例えば図7の場合は、全瞳データのx座標4と5の画素値が約100で、他の全瞳データの画素値が約200なので、x座標4と5の間に谷のピークがあると推定できる。これに対して、従来の図8の例では、全瞳データのx座標4の画素値が約100で他の全瞳データの画素値が全て約200なので、谷のピーク位置を高精度に求めることができない。   On the other hand, in the electronic camera 101 according to the present embodiment, as shown in FIG. 7, all pupil data at the pupil division pixel position is generated by interpolation from all pupil data of surrounding imaging pixels. Whole pupil data is obtained at all pixel positions including the pixel. As a result, the resolution of the image based on the whole pupil data is increased, and the positional deviation amount can be detected with higher accuracy than in the past. For example, in the case of FIG. 7, since the pixel values of the x coordinates 4 and 5 of the whole pupil data are about 100 and the pixel values of the other whole pupil data are about 200, there is a valley peak between the x coordinates 4 and 5. Can be estimated. On the other hand, in the conventional example of FIG. 8, since the pixel value of the x coordinate 4 of all pupil data is about 100 and the pixel values of all other pupil data are all about 200, the peak position of the valley is obtained with high accuracy. I can't.

次に、本実施形態に係る電子カメラ101において、位置ズレ量を小数精度で高精度に求める方法について説明する。尚、図2の例ではx軸の列x0を中心として、x軸の(x0−4)から(x0+4)に瞳分割画素を1画素置きに配置するようにしたが、ここでの説明では、わかり易いように、x0から1画素置きにL個の瞳分割画素が配置されているものとする。この場合、1画素置きに配置される瞳分割画素は、p(x0,y0),p(x0+2,y0),p(x0+4,y0),p(x0+6,y0),p(x0+8,y0),・・・・・・p(x0+2・(L−1),y0)のL個で、画素p(x0+2・I,y0)と表記できる。尚、Iは0から(L−1)までの整数である。   Next, a description will be given of a method for obtaining the positional deviation amount with a decimal precision and a high precision in the electronic camera 101 according to the present embodiment. In the example of FIG. 2, the pupil division pixels are arranged every other pixel from (x0-4) to (x0 + 4) on the x axis with the x axis column x0 as the center. For easy understanding, it is assumed that L pupil division pixels are arranged every other pixel from x0. In this case, the pupil divided pixels arranged every other pixel are p (x0, y0), p (x0 + 2, y0), p (x0 + 4, y0), p (x0 + 6, y0), p (x0 + 8, y0), ... P (x0 + 2 · (L−1), y0), which can be expressed as a pixel p (x0 + 2 · I, y0). I is an integer from 0 to (L-1).

そして、各瞳分割画素の画素値(瞳分割データ)をAで表す場合、L個の各瞳分割画素の瞳分割データは、A(x0,y0),A(x0+2,y0),A(x0+4,y0),A(x0+6,y0),A(x0+8,y0),・・・・・・A(x0+2・(L−1),y0)となり、瞳分割データA(x0+2・I,y0)と表記できる。尚、Iは先述の通りである。   When the pixel value (pupil division data) of each pupil division pixel is represented by A, the pupil division data of each of the L pupil division pixels is A (x0, y0), A (x0 + 2, y0), A (x0 + 4). , Y0), A (x0 + 6, y0), A (x0 + 8, y0),... A (x0 + 2 · (L−1), y0), and pupil division data A (x0 + 2 · I, y0) Can be written. I is as described above.

また、各瞳分割画素の位置に対応する補間生成された全瞳データをDで表す場合、L個の各瞳分割画素に対応する補間生成された全瞳データは、D(x0,y0),D(x0+2,y0),D(x0+4,y0),D(x0+6,y0),D(x0+8,y0),・・・・・・D(x0+2・(L−1),y0)となり、全瞳データD(x0+2・I,y0)と表記できる。尚、Iは先述の通りである。   Further, when the interpolation-generated all-pupil data corresponding to the position of each pupil division pixel is represented by D, the interpolation-generated all-pupil data corresponding to each of the L pupil division pixels is D (x0, y0), D (x0 + 2, y0), D (x0 + 4, y0), D (x0 + 6, y0), D (x0 + 8, y0), ... D (x0 + 2 · (L-1), y0), all pupils It can be expressed as data D (x0 + 2 · I, y0). I is as described above.

上記の定義に従って、瞳分割データAと全瞳データDとの差分d(I)を瞳分割画素毎に(式5)により求める。   In accordance with the above definition, the difference d (I) between the pupil division data A and the whole pupil data D is obtained for each pupil division pixel by (Equation 5).

Figure 0005786355
さらに、L個の瞳分割画素毎の差分d(I)の絶対値の総和Sを(式6)により求める。尚、差分の絶対値の総和Sは、瞳分割データAと全瞳データDとの相関が大きいほど小さくなり、相関が小さいほど大きくなるので、以降の説明において相関値Sと称する。
Figure 0005786355
Further, the sum S of absolute values of the difference d (I) for each of the L pupil-divided pixels is obtained by (Expression 6). The sum S of the absolute values of the differences is smaller as the correlation between the pupil division data A and the whole pupil data D is larger, and is larger as the correlation is smaller. Therefore, it will be referred to as a correlation value S in the following description.

Figure 0005786355
尚、(式6)で求められる相関値Sは、瞳分割データAと全瞳データDの位置関係が図7のように固定されているので、相関値Sが最小であるか否かは判定できない。そこで、瞳分割データまたは全瞳データを少しずつずらしていき、相関値Sが最小になった時のずらし量を求め、これを位置ズレ量とする。
Figure 0005786355
Note that the correlation value S obtained by (Equation 6) is determined as to whether or not the correlation value S is minimum since the positional relationship between the pupil division data A and the whole pupil data D is fixed as shown in FIG. Can not. Therefore, the pupil division data or the whole pupil data is shifted little by little to obtain the shift amount when the correlation value S is minimized, and this is used as the positional deviation amount.

次に説明する例では、先ず、全瞳データを1画素単位でx座標上をずらして行った時の相関値Sを求め、相関値Sが最小となる画素ずらし量を求める。ここで、画素ずらし量をK(Kは整数)とすると、K画素ずらした時の相関値SをS(K)と表記できるので、(式6)は変数I、Kを用いて(式7)となる。   In an example to be described next, first, a correlation value S is obtained when the whole pupil data is shifted on the x coordinate in units of one pixel, and a pixel shift amount that minimizes the correlation value S is obtained. Here, assuming that the pixel shift amount is K (K is an integer), the correlation value S when K pixel shift is performed can be expressed as S (K). Therefore, (Expression 6) uses the variables I and K (Expression 7). )

Figure 0005786355
ここで、Iは、座標X0の瞳分割画素をI=0として、I=0からI=(L−1)までのL個の瞳分割画素の座標位置を示し、K画素ずらした時の差分d(I,K)は(式8)で表すことができる。
Figure 0005786355
Here, I indicates the coordinate position of the L pupil division pixels from I = 0 to I = (L−1), where I = 0 as the pupil division pixel at the coordinate X0, and the difference when K pixels are shifted. d (I, K) can be expressed by (Equation 8).

Figure 0005786355
そして、(式7)においてS(K)が最小になる時のKを求め、これをK0とする。また、この時の相関値S(K)の最小値はS(K0)となる。尚、上記の場合、図7に示したように、瞳分割データは1画素置きのデータであるが、全瞳データDはG画素から得られる全瞳データと補間生成された全瞳データとを有するので、1画素単位で全瞳データが必ず存在する。これにより、全瞳データを1画素ずつずらして上式の計算を行うことができるので、精度良く位置ズレ量を検出することができる。
Figure 0005786355
Then, K is calculated when S (K) is minimized in (Expression 7), and this is set as K0. Further, the minimum value of the correlation value S (K) at this time is S (K0). In the above case, as shown in FIG. 7, the pupil division data is data every other pixel, but the entire pupil data D is the total pupil data obtained from the G pixels and all the pupil data generated by interpolation. Therefore, all pupil data always exists in units of one pixel. As a result, the calculation of the above equation can be performed by shifting the entire pupil data by one pixel at a time, so that the positional deviation amount can be detected with high accuracy.

図9は、上記の処理を模式的に示した図である。図9(a)は、K=0の場合の瞳分割データAと全瞳データDとの差分d(0,0)から差分d((L−1),0)までを各瞳分割画素位置で求める様子を示している。そして、差分d(0,0)から差分d((L−1),0)までの各絶対値の総和を求めて相関値S(0)とする。同様に、図9(b)ではK=1の場合の相関値S(1)を求める時、図9(c)ではK=2の場合の相関値S(2)を求める時のそれぞれの瞳分割データと全瞳データの様子を示している。   FIG. 9 is a diagram schematically showing the above processing. FIG. 9A shows each pupil division pixel position from the difference d (0, 0) to the difference d ((L−1), 0) between the pupil division data A and the whole pupil data D when K = 0. It shows how to ask. Then, the sum of the absolute values from the difference d (0, 0) to the difference d ((L-1), 0) is obtained and set as the correlation value S (0). Similarly, in FIG. 9B, when obtaining the correlation value S (1) in the case of K = 1, in FIG. 9C, each pupil in obtaining the correlation value S (2) in the case of K = 2. The state of divided data and whole pupil data is shown.

このようにして、Kを1画素単位で変化させながら相関値S(K)を求め、相関値S(K)が最小となるKを求める。例えば図9の場合、K=0の時の相関値S(0)が最小になる。尚、上記の例ではKを正の整数として、K=0,+1,+2・・・のようにKを変化させたが、K=0,−1,−2,−3・・・のように負の方向にKを変化させてもよいし、K=・・・−3,−2,−1,0,+1,+2,+3・・・のように、Kを正負に変化させてもよい。   In this way, the correlation value S (K) is obtained while changing K in units of one pixel, and K that minimizes the correlation value S (K) is obtained. For example, in the case of FIG. 9, the correlation value S (0) when K = 0 is minimized. In the above example, K is a positive integer and K is changed as K = 0, +1, +2..., But K = 0, -1, -2, -3. Alternatively, K may be changed in a negative direction, or K may be changed to positive or negative as in K =... -3, -2, -1, 0, +1, +2, +3. Good.

このようにして、相関値S(K)が最小になるときのKを求めることができる。   In this way, K when the correlation value S (K) is minimized can be obtained.

ここで、Kは整数なので画素単位でしか全瞳データと瞳分割データとの位置関係は変化しないので、例えば画素間に相関値Sがさらに小さくなる位置が存在してもKに整数化されるため、位置ズレ量に誤差が生じてしまう。そこで、本実施形態に係る電子カメラ101では、画素間にある実際の像の位置ズレ量Zを小数精度で求めている。   Here, since K is an integer, the positional relationship between all pupil data and pupil division data changes only in units of pixels. For example, even if there is a position where the correlation value S is further reduced between pixels, it is converted into an integer. Therefore, an error occurs in the amount of positional deviation. Therefore, in the electronic camera 101 according to the present embodiment, the positional deviation amount Z of the actual image between the pixels is obtained with decimal accuracy.

図10は、Kを変化させた時の相関値S(K)の値をの一例を示したグラフである。図10において、相関値S(K)が最小になるときのK0とその前後の(K0+1)および(K0−1)での相関値S(K0)、S(K0−1)、S(K0+1)の大きさの例を描いてある。例えば図10の場合、S(K0)はS(K0+1)より小さく、S(K0−1)とS(K0)はほぼ同じ大きさなので、実際の像の位置ズレ量Zは、(K0−1)と(K0)の間にあることがわかる。   FIG. 10 is a graph showing an example of the correlation value S (K) when K is changed. In FIG. 10, correlation values S (K0), S (K0-1), and S (K0 + 1) at K0 when the correlation value S (K) is minimized and (K0 + 1) and (K0-1) before and after the correlation value S (K). The example of the size of is drawn. For example, in the case of FIG. 10, since S (K0) is smaller than S (K0 + 1), and S (K0-1) and S (K0) are substantially the same size, the actual image positional shift amount Z is (K0-1). ) And (K0).

ここで、図10において、小数精度の位置ズレ量Zは公知の内挿法により、例えば(式9)により求めることができる。   Here, in FIG. 10, the positional deviation amount Z with decimal precision can be obtained by, for example, (Equation 9) by a known interpolation method.

Figure 0005786355
ここで、max(A,B)は、AとBの大きい方を選択することを意味する演算子である。
図10の場合、S(K0)とS(K0−1)はほぼ同じなので、上記の式の分母と分子はほぼ同じ値になるので、Z=K0+1/2となる。つまり、位置ズレ量Zは、K0の位置を基準(K0=0)とした場合、Z=0.5となる。また、(K0−1)と(K0)の間は1画素分なので、位置ズレ量は0.5画素となる。
Figure 0005786355
Here, max (A, B) is an operator that means selecting the larger of A and B.
In the case of FIG. 10, since S (K0) and S (K0-1) are almost the same, the denominator and the numerator of the above equation are almost the same value, so that Z = K0 + 1/2. That is, the positional deviation amount Z is Z = 0.5 when the position of K0 is used as a reference (K0 = 0). Further, since the interval between (K0-1) and (K0) is one pixel, the positional deviation amount is 0.5 pixel.

このようにして、本実施形態に係る電子カメラ101では、位置ズレ量Zを少数精度で求めることができる。例えば、先に説明した従来技術では位置ズレ量が1画素になってしまうが、本実施形態に係る電子カメラ101では、位置ズレ量は0.5画素となり、小数精度で正確に求めることができる。尚、内挿法は上記以外の方法を用いてもよい。また、相関値Sの算出式も上記には限定されず、他の方法を適用してもよい。特に、平均レベルが異なるデータ同士の位置ズレを検出する方法も知られており、このような方法を適用すれば瞳分割データに係数を掛けて全瞳データとのレベル合わせを行う処理を省略できるので、処理負荷の低減が可能になる。このようにして、位置ズレ量検出部203は、位置ズレ量を高精度で求めることができる。   Thus, in the electronic camera 101 according to the present embodiment, the positional deviation amount Z can be obtained with a small number of precision. For example, although the positional deviation amount is 1 pixel in the conventional technology described above, in the electronic camera 101 according to the present embodiment, the positional deviation amount is 0.5 pixel and can be accurately obtained with decimal precision. . Note that a method other than the above may be used as the interpolation method. Moreover, the calculation formula of the correlation value S is not limited to the above, and other methods may be applied. In particular, there is also known a method for detecting a positional deviation between data having different average levels. By applying such a method, a process of multiplying the pupil division data by a coefficient and performing level alignment with all pupil data can be omitted. Therefore, the processing load can be reduced. In this way, the positional deviation amount detection unit 203 can obtain the positional deviation amount with high accuracy.

次に、デフォーカス量算出部204は、位置ズレ量検出部203が求めた小数精度の位置ズレ量に対応するデフォーカス量を算出する。ここで、位置ズレ量からデフォーカス量を求める処理は、周知の技術なので詳しい説明は省略するが、例えば位置ズレ量に対応するデフォーカス量を予め計測して、位置ズレ量とデフォーカス量とを対応付けるテーブルを作成しておいてもよいし、変換式を用いて位置ズレ量からデフォーカス量を求めてもよい。このようにして、デフォーカス量算出部204は、位置ズレ検出部203が求めた位置ズレ量からデフォーカス量を求めることができる。   Next, the defocus amount calculation unit 204 calculates a defocus amount corresponding to the position shift amount with decimal precision obtained by the position shift amount detection unit 203. Here, the process for obtaining the defocus amount from the position shift amount is a well-known technique, and therefore a detailed description is omitted. For example, the defocus amount corresponding to the position shift amount is measured in advance, and the position shift amount and the defocus amount are determined. May be created, or the defocus amount may be obtained from the positional shift amount using a conversion formula. In this way, the defocus amount calculation unit 204 can obtain the defocus amount from the position deviation amount obtained by the position deviation detection unit 203.

そして、フォーカスレンズ制御部205は、デフォーカス量算出部204が求めたデフォーカス量に応じてレンズ光学系102のフォーカスレンズの位置を制御する。   The focus lens control unit 205 controls the position of the focus lens of the lens optical system 102 according to the defocus amount obtained by the defocus amount calculation unit 204.

このようにして、本実施形態に係る電子カメラ101は、精度の高いオートフォーカス処理を行うことができる。   In this way, the electronic camera 101 according to the present embodiment can perform highly accurate autofocus processing.

次に、本実施形態に係る電子カメラ101におけるオートフォーカス処理について、図11のフローチャートを用いて説明する。尚、図11に示したフローチャートは、制御部108の内部に予め記憶されたプログラムに従って実行される処理で、AF処理部200に対応する。   Next, autofocus processing in the electronic camera 101 according to the present embodiment will be described with reference to the flowchart of FIG. The flowchart shown in FIG. 11 corresponds to the AF processing unit 200, which is a process executed in accordance with a program stored in advance in the control unit 108.

(ステップS101)画像データ入力部201は、撮像素子104から瞳分割画素を含む行または列の周辺の画素から画像データを読み出し、画像バッファ106に取り込む。   (Step S <b> 101) The image data input unit 201 reads out image data from pixels in the vicinity of a row or column including pupil-divided pixels from the image sensor 104, and imports it into the image buffer 106.

(ステップS102)全瞳データ生成部202は、図5で説明したように、画像構造の検出を行う。   (Step S102) As described with reference to FIG. 5, the all-pupil data generation unit 202 detects the image structure.

(ステップS103)全瞳データ生成部202は、画像構造に応じて選択した撮像用画素の全瞳データを用いて、瞳分割画素位置の全瞳データを補間生成する。   (Step S103) The all-pupil data generation unit 202 interpolates and generates all-pupil data at the pupil division pixel position using all-pupil data of the imaging pixels selected according to the image structure.

(ステップS104)位置ズレ量検出部203は、図9および図10で説明したように、瞳分割画素の瞳分割データと、撮像用画素の全瞳データおよび瞳分割画素の補間生成された全瞳データおよび瞳分割画素と同じ行の撮像用画素の全瞳データとを用いて、瞳分割データと全瞳データとの位置ズレ量を検出する。   (Step S104) As described with reference to FIGS. 9 and 10, the positional deviation amount detection unit 203 performs pupil division data of pupil division pixels, all pupil data of imaging pixels, and all pupils generated by interpolation of pupil division pixels. A positional shift amount between the pupil division data and the whole pupil data is detected using the data and the whole pupil data of the imaging pixels in the same row as the pupil division pixels.

(ステップS105)デフォーカス量算出部204は、位置ズレ量検出部203が検出した位置ズレ量に基づいて、メモリ109などに予め記憶されている位置ズレ量とデフォーカス量とを対応付けたテーブルや変換式を用いてデフォーカス量を算出する。   (Step S105) The defocus amount calculation unit 204 associates the position shift amount and the defocus amount stored in advance in the memory 109 or the like based on the position shift amount detected by the position shift amount detection unit 203. The defocus amount is calculated using the conversion formula.

(ステップS106)フォーカスレンズ制御部205は、デフォーカス量算出部204が算出したデフォーカス量に応じて、光学系102のフォーカスレンズの位置を動かし、被写体像が撮像素子104の受光面に合焦するように制御する。   (Step S106) The focus lens control unit 205 moves the position of the focus lens of the optical system 102 in accordance with the defocus amount calculated by the defocus amount calculation unit 204, and the subject image is focused on the light receiving surface of the image sensor 104. Control to do.

このようにして、本実施形態に係る電子カメラ101は、精度の高いオートフォーカス処理を行うことができる。   In this way, the electronic camera 101 according to the present embodiment can perform highly accurate autofocus processing.

[瞳分割画素の配置例]
(変形例1)
次に、瞳分割画素の画素配置の変形例1について説明する。上記の実施形態では、図2で説明したように、瞳分割画素と撮像用画素とを1画素ずつ交互に配置するようにしたが、変形例1では、図12に示すように、列の一部に連続して瞳分割画素を配置する。例えば図12の場合、瞳分割画素は、画素p(x0−3,y0),p(x0−2,y0),p(x0−1,y0),p(x0,y0),p(x0+1,y0),p(x0+2,y0),p(x0+3,y0)に連続して配置されている。尚、図12の場合でも、先の実施形態と同様に、瞳分割画素位置の全瞳データを周辺の撮像用画素の全瞳データから補間することにより、位置ズレ量を高精度で求めることができる。尚、図12の例では、画像構造を判定せずに例えば瞳分割画素の上下にある撮像用画素の全瞳データの平均値をその瞳分割画素の全瞳データとして補間することができる。例えば図12の場合、瞳分割画素(x0,y0)の全瞳データは上の行のG画素の全瞳データと下の行のG画素の全瞳データとの平均値を瞳分割画素(x0,y0)の全瞳データとする。同様に、瞳分割画素(x0+1,y0)の全瞳データは上の行のR画素の全瞳データと下の行のR画素の全瞳データとの平均値を瞳分割画素(x0+1,y0)の全瞳データとする。尚、異なる色の撮像用画素から補間生成する場合は、被写体画像の色成分に応じてレベル差が生じる場合があるので、例えば瞳分割画素(x0+1,y0)の全瞳データは斜め上のG画素(x0,y0−1)、G画素(x0+2,y0−1)の全瞳データと斜め下のG画素(x0,y0+1)、G画素(x0+2,y0+1)の4つの画素の平均値を瞳分割画素(x0+1,y0)の全瞳データとしてもよい。
[Placement example of pupil division pixel]
(Modification 1)
Next, Modification Example 1 of the pixel arrangement of the pupil division pixels will be described. In the above embodiment, as described with reference to FIG. 2, the pupil division pixels and the imaging pixels are alternately arranged one by one. However, in Modification 1, as shown in FIG. The pupil division pixels are arranged continuously in the part. For example, in the case of FIG. 12, the pupil division pixels are the pixels p (x0-3, y0), p (x0-2, y0), p (x0-1, y0), p (x0, y0), p (x0 + 1, y0), p (x0 + 2, y0), and p (x0 + 3, y0). In the case of FIG. 12 as well, as in the previous embodiment, the amount of positional deviation can be obtained with high accuracy by interpolating the entire pupil data at the pupil division pixel position from the entire pupil data of the surrounding imaging pixels. it can. In the example of FIG. 12, for example, an average value of all the pupil data of the imaging pixels above and below the pupil division pixel can be interpolated as the whole pupil data of the pupil division pixel without determining the image structure. For example, in the case of FIG. 12, the total pupil data of the pupil division pixel (x0, y0) is the average value of the total pupil data of the G pixel in the upper row and the total pupil data of the G pixel in the lower row. , Y0). Similarly, the whole pupil data of the pupil division pixel (x0 + 1, y0) is obtained by calculating the average value of the whole pupil data of the R pixel in the upper row and the whole pupil data of the R pixel in the lower row as the pupil division pixel (x0 + 1, y0). All pupil data. Note that in the case of performing interpolation generation from imaging pixels of different colors, there may be a level difference depending on the color component of the subject image. For example, all pupil data of the pupil division pixel (x0 + 1, y0) All pupil data of pixel (x0, y0-1) and G pixel (x0 + 2, y0-1) and an average value of four pixels of G pixel (x0, y0 + 1) and G pixel (x0 + 2, y0 + 1) diagonally below The whole pupil data of the divided pixel (x0 + 1, y0) may be used.

このようにして求めた全瞳データと瞳分割データとを用いて、先の実施形態と同様に、位置ズレ量を検出することができる。そして、位置ズレ量からデフォーカス量を求めてフォーカス制御を行う。特に、先の実施形態では、全瞳データが各画素毎に得られるので分解能が高くなり、高精度の位置ズレ検出を行うことができたが、本変形例では、全瞳データだけでなく瞳分割データも各画素毎に得られるので、さらに高精度の位置ズレ検出を行うことができる。
(変形例2)
次に、瞳分割画素の画素配置の変形例2について説明する。変形例2では、図13に示すように、瞳分割画素を2画素置きに配置する。例えば図13の場合、瞳分割画素は、画素p(x0−3,y0),p(x0,y0),p(x0+3,y0)のように2画素置きに配置されている。本変形例2においても、先の実施形態と同様に、画像構造を判定して瞳分割画素位置の全瞳データを周辺の撮像用画素の全瞳データから補間生成することにより、位置ズレ量を高精度で求めることができる。尚、変形例2では、瞳分割画素が2画素置きなので、瞳分割データの分解能は先の実施形態の場合より低くなるが、全瞳データは補間生成して各画素毎に得られるので、同じ画素配置で従来技術を適用するよりも高精度の位置ズレ検出が可能になる。逆に、本変形例では、撮像素子104の撮像用画素が瞳分割画素に置き換えられる部分が少なくなるので、画質劣化を防ぐことができる。
Using the entire pupil data and pupil division data obtained in this way, the amount of positional deviation can be detected as in the previous embodiment. Then, the focus control is performed by obtaining the defocus amount from the positional deviation amount. In particular, in the previous embodiment, since the entire pupil data was obtained for each pixel, the resolution was increased, and highly accurate positional deviation detection could be performed. However, in this modification, not only the entire pupil data but also the pupil Since the divided data is also obtained for each pixel, it is possible to detect the positional deviation with higher accuracy.
(Modification 2)
Next, Modification Example 2 of the pixel arrangement of the pupil division pixels will be described. In Modification 2, as shown in FIG. 13, the pupil division pixels are arranged every two pixels. For example, in the case of FIG. 13, the pupil-divided pixels are arranged every two pixels such as pixels p (x0-3, y0), p (x0, y0), and p (x0 + 3, y0). Also in the second modification, as in the previous embodiment, by determining the image structure and interpolating and generating all the pupil data at the pupil division pixel positions from all the pupil data of the surrounding imaging pixels, the positional deviation amount can be reduced. It can be obtained with high accuracy. In Modification 2, since the pupil division pixels are arranged every two pixels, the resolution of the pupil division data is lower than that in the previous embodiment, but all pupil data is generated by interpolation and is obtained for each pixel. It is possible to detect a positional shift with higher accuracy than when the conventional technique is applied in the pixel arrangement. On the contrary, in this modified example, the number of pixels where the imaging pixels of the imaging device 104 are replaced with pupil-divided pixels is reduced, so that it is possible to prevent image quality deterioration.

このようにして求めた全瞳データと瞳分割データとを用いて、先の実施形態と同様に、位置ズレ量を検出することができ、位置ズレ量からデフォーカス量を求めてフォーカス制御を行うことができる。
[撮像素子104の変形例]
次に、撮像素子104の変形例について説明する。先の実施形態では、撮像素子104から瞳分割画素位置の全瞳データを補間生成するための全瞳データを周辺の複数の撮像用画素から個別に全瞳データを読み出して画像バッファ106に取り込み、その後、加算平均などの演算処理を行うようにしたが、制御部108の処理負荷が増えるという問題がある。そこで、撮像素子104の変形例として、図14に示すように、瞳分割画素の上下の2つの撮像用画素の画素値を加算平均する回路(加算平均回路301)を撮像素子104に設け、瞳分割画素位置の補間後の全瞳データを直接撮像素子104から読み出せるようにする。これにより、瞳分割画素の上下の撮像用画素から個別に全瞳データを読み出すための時間や瞳分割画素位置の全瞳データを求める処理を行う必要がなくなり、全瞳データ生成部202が不要になるので、処理負荷を大幅に低減することができる。
Using the entire pupil data and pupil division data obtained in this way, the amount of positional deviation can be detected as in the previous embodiment, and the focus control is performed by obtaining the defocus amount from the amount of positional deviation. be able to.
[Modification Example of Image Sensor 104]
Next, a modified example of the image sensor 104 will be described. In the previous embodiment, all pupil data for interpolating and generating all pupil data at the pupil division pixel position from the image sensor 104 is read out from a plurality of peripheral imaging pixels individually and taken into the image buffer 106. Thereafter, arithmetic processing such as addition averaging is performed, but there is a problem that the processing load of the control unit 108 increases. Therefore, as a modification of the image sensor 104, as shown in FIG. 14, a circuit (addition averaging circuit 301) that averages the pixel values of two imaging pixels above and below the pupil-divided pixel is provided in the image sensor 104, and the pupil All pupil data after interpolation of the divided pixel positions can be read directly from the image sensor 104. This eliminates the need for time for reading out all pupil data from the imaging pixels above and below the pupil-divided pixels and processing for obtaining all-pupil data at the pupil-divided pixel position, and eliminates the need for the all-pupil data generation unit 202. Therefore, the processing load can be greatly reduced.

このようにして、撮像素子104から読み出した後で瞳分割画素位置の全瞳データを補間する必要がなく、先の実施形態と同様に、高精度で位置ズレ量を検出することができ、位置ズレ量からデフォーカス量を求めてフォーカス制御を行うことができる。   In this way, it is not necessary to interpolate the entire pupil data at the pupil division pixel position after reading from the image sensor 104, and the positional deviation amount can be detected with high accuracy as in the previous embodiment. Focus control can be performed by obtaining the defocus amount from the shift amount.

以上、本発明に係るデフォーカス量検出装置および電子カメラについて、各実施形態で例を挙げて説明してきたが、その精神またはその主要な特徴から逸脱することなく他の多様な形で実施することができる。そのため、上述した実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。本発明は、特許請求の範囲によって示されるものであって、本発明は明細書本文にはなんら拘束されない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内である。   As described above, the defocus amount detection device and the electronic camera according to the present invention have been described by way of examples in the respective embodiments, but may be implemented in various other forms without departing from the spirit or main features thereof. Can do. Therefore, the above-described embodiment is merely an example in all respects and should not be interpreted in a limited manner. The present invention is defined by the claims, and the present invention is not limited to the text of the specification. Further, all modifications and changes belonging to the equivalent scope of the claims are within the scope of the present invention.

101・・・電子カメラ;102・・・光学系;103・・・メカニカルシャッタ;104・・・撮像素子;105・・・A/D変換部;106・・・画像バッファ;107・・・画像処理部;108・・・制御部;109・・・メモリ;110・・・表示部;111・・・操作部;112・・・メモリカードIF;12a・・・メモリカード1;200・・・AF処理部;201・・・画像データ入力部;202・・・全瞳データ生成部;203・・・位置ズレ量検出部;204・・・デフォーカス量算出部;205・・・フォーカスレンズ制御部 DESCRIPTION OF SYMBOLS 101 ... Electronic camera; 102 ... Optical system; 103 ... Mechanical shutter; 104 ... Image pick-up element; 105 ... A / D conversion part; 106 ... Image buffer; Processing unit; 108 ... Control unit; 109 ... Memory; 110 ... Display unit; 111 ... Operation unit; 112 ... Memory card IF; 12a ... Memory card 1; AF processing unit; 201, image data input unit, 202, all pupil data generation unit, 203, position shift amount detection unit, 204, defocus amount calculation unit, 205, focus lens control Part

Claims (8)

二次元状に配置された撮像用画素の一部に瞳分割画素が配列された撮像素子から前記瞳分割画素の瞳分割データおよび前記瞳分割画素周辺の前記撮像用画素の全瞳データを読み込む画像データ入力部と、
前記画像データ入力部が読み込んだ前記撮像用画素の前記全瞳データから前記瞳分割画素位置の全瞳データを補間生成する全瞳データ生成部と、
前記全瞳データ生成部により補間生成された前記瞳分割画素位置の前記全瞳データおよび前記撮像用画素の全瞳データと、前記瞳分割画素から読み込まれた前記瞳分割データとの位置ズレ量を検出する位置ズレ検出部と、
前記位置ズレ検出部が検出した位置ズレ量に応じてデフォーカス量を求めるデフォーカス量算出部と
を有することを特徴とするデフォーカス量検出装置。
An image for reading pupil division data of the pupil division pixel and whole pupil data of the imaging pixel around the pupil division pixel from an imaging device in which pupil division pixels are arranged in a part of the two-dimensionally arranged imaging pixels. A data input section;
An all-pupil data generating unit that interpolates and generates all-pupil data at the pupil-divided pixel position from the all-pupil data of the imaging pixels read by the image data input unit;
A positional shift amount between the whole pupil data of the pupil division pixel position and the whole pupil data of the imaging pixel generated by interpolation by the whole pupil data generation unit and the pupil division data read from the pupil division pixel. A position shift detection unit to detect,
A defocus amount detection apparatus, comprising: a defocus amount calculation unit that obtains a defocus amount according to a position shift amount detected by the position shift detection unit.
請求項1に記載のデフォーカス量検出装置において、
前記全瞳データ生成部は、前記撮像用画素から読み込まれた前記全瞳データに基づいて画像構造の方向を判定し、該判定結果に応じて前記瞳分割画素位置の全瞳データを補間生成する際に参照する前記撮像用画素を選択する
ことを特徴とするデフォーカス量検出装置。
The defocus amount detection device according to claim 1,
The all-pupil data generation unit determines the direction of the image structure based on the all-pupil data read from the imaging pixels, and interpolates and generates all-pupil data at the pupil division pixel position according to the determination result. A defocus amount detection device, wherein the imaging pixel to be referred to is selected.
請求項2に記載のデフォーカス量検出装置において、
前記全瞳データ生成部は、前記画像構造の方向を判定する際に、前記瞳分割画素に隣接する上下の前記全瞳データの差分と左右の前記全瞳データの差分とを比較し、差分が小さい方の前記全瞳データ用いて前記瞳分割画素位置の全瞳データを補間生成する
ことを特徴とするデフォーカス量検出装置。
In the defocus amount detection apparatus according to claim 2,
When determining the direction of the image structure, the whole pupil data generation unit compares the difference between the upper and lower whole pupil data adjacent to the pupil division pixel and the difference between the left and right whole pupil data. defocus amount detection apparatus characterized by generating interpolating all pupil data of the pupil division pixel position by using the entire pupil data smaller.
請求項2または3に記載のデフォーカス量検出装置において、
前記全瞳データ生成部は、画像構造の方向を判定するための全瞳データと、前記瞳分割画素位置の全瞳データを補間生成する際に参照する全瞳データとに、前記瞳分割画素周辺の同じ範囲の前記撮像用画素の全瞳データを使用する
ことを特徴とするデフォーカス量検出装置。
In the defocus amount detection apparatus according to claim 2 or 3,
The all-pupil data generation unit includes the entire pupil data for determining the direction of the image structure and all-pupil data referred to when interpolating and generating all-pupil data at the pupil-divided pixel position. A defocus amount detection device using the whole pupil data of the imaging pixels in the same range.
請求項1から3のいずれか一項に記載のデフォーカス量検出装置において、
前記全瞳データ生成部は、前記瞳分割画素が配置された列の全画素位置に対して全瞳データを生成する
ことを特徴とするデフォーカス量検出装置。
In the defocus amount detection apparatus according to any one of claims 1 to 3,
The defocus amount detection device, wherein the all pupil data generation unit generates all pupil data for all pixel positions in a column in which the pupil division pixels are arranged.
請求項1から5のいずれか一項に記載のデフォーカス量検出装置において
前記画像データ入力部は、前記瞳分割画素が配置された列から前記瞳分割データおよび前記全瞳データを、前記瞳分割画素が配置された列の上下の列から前記全瞳データをそれぞれ読み込む
ことを特徴とするデフォーカス量検出装置。
The defocus amount detection device according to any one of claims 1 to 5, wherein the image data input unit converts the pupil division data and the whole pupil data from the row in which the pupil division pixels are arranged. The defocus amount detection apparatus, wherein the whole pupil data is read from the upper and lower rows of the row where the pixels are arranged.
請求項1から5のいずれか一項に記載のデフォーカス量検出装置において
前記画像データ入力部は、前記瞳分割画素周辺の複数の前記撮像用画素の全瞳データを前記撮像素子内で加算平均したデータを前記瞳分割画素位置の全瞳データとして読み出す
ことを特徴とするデフォーカス量検出装置。
The defocus amount detection device according to any one of claims 1 to 5, wherein the image data input unit adds and averages all pupil data of the plurality of imaging pixels around the pupil division pixel in the imaging element. The defocus amount detection device is characterized in that the read data is read out as whole pupil data at the pupil division pixel position.
請求項1から5のいずれか一項に記載のデフォーカス量検出装置を有することを特徴とする電子カメラ。
An electronic camera comprising the defocus amount detection device according to any one of claims 1 to 5.
JP2011032242A 2011-02-17 2011-02-17 Defocus amount detection device and electronic camera Active JP5786355B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011032242A JP5786355B2 (en) 2011-02-17 2011-02-17 Defocus amount detection device and electronic camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011032242A JP5786355B2 (en) 2011-02-17 2011-02-17 Defocus amount detection device and electronic camera

Publications (2)

Publication Number Publication Date
JP2012173334A JP2012173334A (en) 2012-09-10
JP5786355B2 true JP5786355B2 (en) 2015-09-30

Family

ID=46976325

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011032242A Active JP5786355B2 (en) 2011-02-17 2011-02-17 Defocus amount detection device and electronic camera

Country Status (1)

Country Link
JP (1) JP5786355B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6200139B2 (en) 2012-09-21 2017-09-20 矢崎総業株式会社 Equalization equipment
JP6052057B2 (en) * 2013-05-22 2016-12-27 ソニー株式会社 Signal processing device and signal processing method, solid-state imaging device, and electronic apparatus
JP2015194736A (en) * 2014-03-28 2015-11-05 キヤノン株式会社 Imaging apparatus and control method thereof
JP2016009043A (en) 2014-06-24 2016-01-18 ソニー株式会社 Image sensor, calculation method, and electronic apparatus
CN117740335B (en) * 2023-12-08 2025-05-23 深圳盛达同泽科技有限公司 Microlens defocus measurement method, system, device, equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4857877B2 (en) * 2006-04-11 2012-01-18 株式会社ニコン Imaging device and camera
JP4823169B2 (en) * 2007-08-10 2011-11-24 キヤノン株式会社 Imaging device
JP5045350B2 (en) * 2007-10-01 2012-10-10 株式会社ニコン Imaging device and imaging apparatus
JP5029274B2 (en) * 2007-10-10 2012-09-19 株式会社ニコン Imaging device
JP5157400B2 (en) * 2007-12-03 2013-03-06 株式会社ニコン Imaging device
JP5247279B2 (en) * 2008-07-17 2013-07-24 キヤノン株式会社 Imaging apparatus, control method thereof, and program
JP5230388B2 (en) * 2008-12-10 2013-07-10 キヤノン株式会社 Focus detection apparatus and control method thereof
JP5173883B2 (en) * 2009-02-20 2013-04-03 キヤノン株式会社 Imaging device
JP5521373B2 (en) * 2009-04-08 2014-06-11 株式会社ニコン Image sensor

Also Published As

Publication number Publication date
JP2012173334A (en) 2012-09-10

Similar Documents

Publication Publication Date Title
JP5589760B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program.
JP5361535B2 (en) Imaging device
US8823843B2 (en) Image processing device, image capturing device, image processing method, and program for compensating for a defective pixel in an imaging device
US8537267B2 (en) Image processing apparatus, image processing method and program
JP5589857B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program.
CN103444183B (en) Color imaging element and imaging device
JP6506560B2 (en) Focus control device and method therefor, program, storage medium
CN104025574B (en) Camera head and image processing method
JP2009159226A (en) IMAGING ELEMENT, FOCUS DETECTION DEVICE, FOCUS ADJUSTMENT DEVICE, AND IMAGING DEVICE
JPWO2013046973A1 (en) Solid-state imaging device, imaging apparatus, and focusing control method
JP5680797B2 (en) Imaging apparatus, image processing apparatus, and image processing method
WO2012073727A1 (en) Imaging device and focal position detection method
JP5786355B2 (en) Defocus amount detection device and electronic camera
JPWO2012127702A1 (en) Color imaging device, imaging device, and imaging program
JP4295149B2 (en) Color shading correction method and solid-state imaging device
JP5528139B2 (en) Image processing apparatus, imaging apparatus, and image processing program
CN103460702B (en) Color image capturing element and image capturing device
JP5990008B2 (en) Imaging apparatus and control method thereof
JP6576114B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP2014215436A (en) Image-capturing device, and control method and control program therefor
JP2014110619A (en) Image processing device and method of controlling the same, and imaging device and method of controlling the same
JP2012118154A (en) Imaging device
JP6493444B2 (en) Imaging device
JP6467824B2 (en) Imaging device
JP6136364B2 (en) Defocus amount detection device and camera

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141119

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141202

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150129

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150713

R150 Certificate of patent or registration of utility model

Ref document number: 5786355

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

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