JP6245974B2 - Image processing apparatus, control method, and program - Google Patents

Image processing apparatus, control method, and program Download PDF

Info

Publication number
JP6245974B2
JP6245974B2 JP2013264500A JP2013264500A JP6245974B2 JP 6245974 B2 JP6245974 B2 JP 6245974B2 JP 2013264500 A JP2013264500 A JP 2013264500A JP 2013264500 A JP2013264500 A JP 2013264500A JP 6245974 B2 JP6245974 B2 JP 6245974B2
Authority
JP
Japan
Prior art keywords
image
image processing
processing apparatus
images
predetermined direction
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
JP2013264500A
Other languages
Japanese (ja)
Other versions
JP2015122588A (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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2013264500A priority Critical patent/JP6245974B2/en
Publication of JP2015122588A publication Critical patent/JP2015122588A/en
Application granted granted Critical
Publication of JP6245974B2 publication Critical patent/JP6245974B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Studio Devices (AREA)
  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)

Description

本発明は、画像処理装置、制御方法、及びプログラム複数の信号の相関を計算する方法に関し、特に複数の視差画像間の位相差計算(いわゆる相関演算)に関するものである。   The present invention relates to an image processing apparatus, a control method, and a method for calculating a correlation between a plurality of signals in a program, and more particularly to phase difference calculation (so-called correlation calculation) between a plurality of parallax images.

デジカルカメラ等の撮像装置では、特定の被写体に合焦させるため、自動焦点調整機能を有するものがある。焦点調整において撮像装置が焦点状態を検出する方式の1つに、光軸を異ならせて撮影して得られた2つの画像、あるいは異なる瞳領域を通過した光束について得られた2以上の画像について位相差を計算する、所謂位相差検出方式がある(特許文献1及び2)。具体的には、位相差検出対象の画像や信号に含まれる同一被写体の像の位置を、一対の画像の相関演算により特定し、その像ずれ量によって焦点状態の検出がなされる。   Some imaging devices such as a digital camera have an automatic focus adjustment function in order to focus on a specific subject. One of the methods by which the imaging apparatus detects the focus state in focus adjustment is two images obtained by photographing with different optical axes, or two or more images obtained with respect to light beams that have passed through different pupil regions. There is a so-called phase difference detection method for calculating a phase difference (Patent Documents 1 and 2). Specifically, the position of the image of the same subject included in the phase difference detection target image or signal is specified by the correlation calculation of the pair of images, and the focus state is detected based on the image shift amount.

特開平7−199052号公報JP-A-7-199052 特開2007−11314号公報JP 2007-11314 A

しかしながら、上述の特許文献1及び2に示されるような一対の画像を対象として行われる相関演算は演算量が多くなりやすく、焦点検出に要する処理時間が長期化しやすい。また、例えば撮影環境の輝度が低い場合等、相関演算を行う一対の画像に発生するノイズ量が多い場合、ノイズによって相関演算の信用度が低くなり、良好な焦点検出結果が得られない可能性があった。   However, the correlation calculation performed on a pair of images as shown in Patent Documents 1 and 2 described above tends to increase the amount of calculation and prolong the processing time required for focus detection. In addition, when there is a large amount of noise generated in a pair of images for which correlation calculation is performed, for example, when the luminance of the shooting environment is low, the reliability of the correlation calculation may be reduced due to noise, and a good focus detection result may not be obtained. there were.

本発明は、上述の問題点に鑑みてなされたものであり、良好な精度で高速に焦点状態を検出するあるいは被写体距離を検出する画像処理装置、制御方法、及びプログラムを提供することを目的とする。   The present invention has been made in view of the above-described problems, and an object thereof is to provide an image processing apparatus, a control method, and a program for detecting a focus state at high speed with good accuracy or detecting a subject distance. To do.

前述の目的を達成するために、本発明の画像処理装置は、以下の構成を備えることを特徴とする。具体的には画像処理装置は、同一の時間に撮影して得られた画像群から、所定の方向にのみ視差を有する関係にある複数の画像を取得する取得手段と、取得手段により取得された複数の画像の各々から、所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出手段と、抽出手段により抽出された複数の画素列を、複数の画像の各々を撮影した、所定の方向における位置関係に応じて配置した2次元像を生成する生成手段と、生成手段により生成された2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出手段と、検出手段により検出された直線の傾きから同一の被写体の被写体距離を特定する特定手段と、を有し、所定の方向は、画像群の少なくともいずれかの画像における高周波成分の分布に応じて決定されることを特徴とする。 In order to achieve the above object, an image processing apparatus of the present invention is characterized by having the following configuration. Specifically, the image processing apparatus acquires, from an image group obtained by shooting at the same time, an acquisition unit that acquires a plurality of images having a parallax only in a predetermined direction, and the acquisition unit Extraction means for extracting a pixel row that is a pixel row extending in a predetermined direction from each of the plurality of images and photographing the corresponding spatial position, and the plurality of pixel rows extracted by the extraction means are A generating unit that generates a two-dimensional image that is captured according to the positional relationship in a predetermined direction and a pixel that corresponds to the same subject included in the two-dimensional image generated by the generating unit. detecting means for detecting a straight line, have a, specifying means for specifying an object distance of the same subject from the slope of the detected straight line by the detecting means, the predetermined direction, you at least one image of the image group That is determined according to the distribution of the high-frequency component, characterized in Rukoto.

このような構成により本発明によれば、良好な精度で高速に焦点状態を検出することが可能となる。   With such a configuration, according to the present invention, it is possible to detect the focus state at high speed with good accuracy.

本発明の実施形態に係るカメラシステムに含まれるデジタルカメラ100及びレンズ200の機能構成を示したブロック図1 is a block diagram showing functional configurations of a digital camera 100 and a lens 200 included in a camera system according to an embodiment of the present invention. 本発明の実施形態に係る撮像部102の詳細構成を説明するための図The figure for demonstrating the detailed structure of the imaging part 102 which concerns on embodiment of this invention. 本発明の実施形態に係る2次元像の生成を説明するための図The figure for demonstrating the production | generation of the two-dimensional image which concerns on embodiment of this invention 本発明の実施形態に係る2次元像の焦点状態ごとの態様を説明するための図The figure for demonstrating the aspect for every focus state of the two-dimensional image which concerns on embodiment of this invention. 本発明の実施形態に係るデジタルカメラ100で実行される焦点状態検出処理を例示したフローチャートThe flowchart which illustrated the focus state detection process performed with the digital camera 100 which concerns on embodiment of this invention. 本発明の実施形態に係る2次元像に含まれる直線及び傾き検出を説明するための図The figure for demonstrating the straight line and inclination detection which are contained in the two-dimensional image which concerns on embodiment of this invention 本発明の実施形態に係る、遠近競合が存在する場合の2次元像に含まれる直線及び傾き検出を説明するための図The figure for demonstrating the straight line and inclination detection which are contained in the two-dimensional image when perspective conflict exists based on embodiment of this invention 本発明の変形例に係るシステムの態様を示した図The figure which showed the aspect of the system which concerns on the modification of this invention

[実施形態]
以下、本発明の例示的な実施形態について、図面を参照して詳細に説明する。なお、以下に説明する一実施形態は、画像処理装置の一例としての、同一時間に同一被写体を異なる位置で撮像して得られた複数の画像信号を取得可能な撮像装置を有するカメラシステムに、本発明を適用した例を説明する。しかし、本発明は、同一時間に同一被写体を異なる位置で撮像して得られた複数の画像信号を取得可能な任意の機器に適用可能である。
[Embodiment]
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings. Note that an embodiment described below is an example of an image processing apparatus that includes a camera system having an imaging device that can acquire a plurality of image signals obtained by imaging the same subject at different positions at the same time. An example to which the present invention is applied will be described. However, the present invention can be applied to any device capable of acquiring a plurality of image signals obtained by imaging the same subject at different positions at the same time.

また、本明細書において、以下の用語を定義して説明する。   In this specification, the following terms are defined and described.

・「LFデータ(Light Field Data)」
本実施形態のデジタルカメラ100が有する撮像部102から出力され、所定の現像に係る画像処理が適用されて得られた画像信号。LFデータの各画素は、通過した撮像光学系202の分割瞳領域と入射方向との組み合わせが異なる光束に対応する信号強度を示す。LFデータは、光照射野情報あるいは光線空間情報とも呼ばれる。
・ "LF Data (Light Field Data)"
An image signal output from the imaging unit 102 included in the digital camera 100 according to the present embodiment and obtained by applying image processing related to predetermined development. Each pixel of the LF data indicates a signal intensity corresponding to a light beam having a different combination of the divided pupil region and the incident direction of the imaging optical system 202 that has passed. The LF data is also called light irradiation field information or light space information.

・「再構成画像」
LFデータから生成される、任意の焦点面の位置に合焦した画像。具体的にはLFデータから同一の分割瞳領域を通過した画素で生成される複数(瞳分割数)の分割瞳画像について、生成する焦点距離に存在する被写体の像が一致するように位置合わせを行い、対応する画素の画素値を合算(重ね合わせ)することで得られる画像。
・ "Reconstructed image"
An image generated from LF data and focused on an arbitrary focal plane position. Specifically, with respect to a plurality of (pupil division number) divided pupil images generated by pixels that have passed through the same divided pupil region from LF data, the alignment is performed so that the images of the subject existing at the generated focal length match. An image obtained by performing and summing (superimposing) pixel values of corresponding pixels.

《カメラシステムの構成》
図1は、本発明の実施形態に係るカメラシステムに含まれる、デジタルカメラ100及びレンズ200の機能構成を示すブロック図である。
《Camera system configuration》
FIG. 1 is a block diagram showing functional configurations of a digital camera 100 and a lens 200 included in a camera system according to an embodiment of the present invention.

〈デジタルカメラ100の構成〉
カメラ制御部101は、例えばCPUであり、不図示のROM及びRAMを内蔵する。カメラ制御部101は、デジタルカメラ100が有する各ブロックの動作プログラムをROMから読み出し、RAMに展開して実行することにより、デジタルカメラ100が有する各ブロックの動作制御を行う。またカメラ制御部101は、撮像部102から出力される画像信号の解析により決定した焦点位置の情報や、決定した露出設定に対応する絞り値等の情報を、電気接点107を介してレンズ200に送信する。
<Configuration of digital camera 100>
The camera control unit 101 is a CPU, for example, and includes a ROM and a RAM (not shown). The camera control unit 101 reads out an operation program for each block of the digital camera 100 from the ROM, develops the program in the RAM, and executes the program, thereby controlling the operation of each block of the digital camera 100. In addition, the camera control unit 101 sends information on the focal position determined by analysis of the image signal output from the imaging unit 102 and information on the aperture value corresponding to the determined exposure setting to the lens 200 via the electrical contact 107. Send.

撮像部102は、例えばCCDやCMOSセンサ等の撮像素子である。撮像部102は、設定された露出設定に基づいて、カメラ制御部101により生成されたタイミング信号に基づいて撮像素子が有する各光電変換素子(画素)の露光及び読み出しを行う。そして撮像部102は、得られたLFデータのアナログ画像信号を画像処理部103に出力する。具体的には撮像部102は、レンズ200の撮像光学系202により撮像素子の受光面に結像された光学像を光電変換し、アナログ画像信号を出力する。   The imaging unit 102 is an imaging element such as a CCD or a CMOS sensor. The imaging unit 102 performs exposure and readout of each photoelectric conversion element (pixel) included in the imaging device based on the timing signal generated by the camera control unit 101 based on the set exposure setting. Then, the imaging unit 102 outputs an analog image signal of the obtained LF data to the image processing unit 103. Specifically, the imaging unit 102 photoelectrically converts an optical image formed on the light receiving surface of the imaging element by the imaging optical system 202 of the lens 200, and outputs an analog image signal.

また本実施形態のデジタルカメラ100では、撮像素子109の表面には、図2(a)に示されるようにマイクロレンズ20が格子状に配列されたマイクロレンズアレイ108が配設される。マイクロレンズアレイ108の1つのマイクロレンズ20は、図2(b)に示されるように撮像素子109の複数の光電変換素子(画素)に対応付けられる。レンズ200の撮像光学系202を介して入射した光束は、各マイクロレンズ20により、対応付けられた撮像素子109の画素に結像されることで瞳分割される。即ち、対応付けられた撮像素子109の各画素には、対応付けられた画素位置に対応する撮像光学系202の分割瞳領域を通過した光束が結像される。図2(b)の例では、1つのマイクロレンズ20には5×5=25個の画素が対応付けられており、撮像光学系202の瞳分割数は25となる。   Further, in the digital camera 100 of the present embodiment, a microlens array 108 in which microlenses 20 are arranged in a lattice pattern as shown in FIG. One microlens 20 of the microlens array 108 is associated with a plurality of photoelectric conversion elements (pixels) of the image sensor 109 as shown in FIG. The light beam that has entered through the imaging optical system 202 of the lens 200 is divided into pupils by being imaged by the microlenses 20 on the pixels of the associated image sensor 109. That is, a light beam that has passed through the divided pupil region of the imaging optical system 202 corresponding to the associated pixel position is imaged on each pixel of the associated image sensor 109. In the example of FIG. 2B, 5 × 5 = 25 pixels are associated with one microlens 20, and the number of pupil divisions of the imaging optical system 202 is 25.

図2(c)は、1つのマイクロレンズに対応付けられた画素と、各画素に結像される光束が通過する撮像光学系202の射出瞳の分割瞳領域の対応関係を示した図である。なお、図2(c)の例では簡単のため、1つのマイクロレンズ20に対して水平方向5つの画素21a乃至eがマイクロレンズ20の中心を通る水平線上に並んで配置されているものとする。このとき、マイクロレンズ20により各画素は、射出瞳面上における分割瞳領域31a乃至eと共役関係になるように設計される。図2(c)の例では、画素21aは分割瞳領域31a、画素21bは分割瞳領域31b、画素21cは分割瞳領域31c、画素21dは分割瞳領域31d、そして画素21eは分割瞳領域31eと共役関係にある。   FIG. 2C is a diagram illustrating a correspondence relationship between pixels associated with one microlens and divided pupil regions of the exit pupil of the imaging optical system 202 through which a light beam formed on each pixel passes. . 2C, for the sake of simplicity, it is assumed that five pixels 21a to 21e in the horizontal direction with respect to one microlens 20 are arranged side by side on a horizontal line passing through the center of the microlens 20. . At this time, each pixel is designed by the microlens 20 so as to have a conjugate relationship with the divided pupil regions 31a to 31e on the exit pupil plane. In the example of FIG. 2C, the pixel 21a is the divided pupil region 31a, the pixel 21b is the divided pupil region 31b, the pixel 21c is the divided pupil region 31c, the pixel 21d is the divided pupil region 31d, and the pixel 21e is the divided pupil region 31e. It is in a conjugate relationship.

このようにLFデータは各マイクロレンズ20に対応付けられた画素群がそれぞれ異なる分割瞳領域を通過した光束に対応しているため、画素群ごとに画素値の合算を行って1画素を構成することで、瞳分割していない場合と等価な画像を生成することができる。このとき生成される再構成画像は、撮影時のフォーカスレンズの焦点距離に対応する距離に存在する被写体に合焦した画像となっている。   As described above, since the LF data corresponds to the light fluxes through which the pixel groups associated with the respective microlenses 20 have passed through different divided pupil regions, the pixel values are summed up for each pixel group to constitute one pixel. Thus, an image equivalent to the case where the pupil is not divided can be generated. The reconstructed image generated at this time is an image focused on a subject existing at a distance corresponding to the focal length of the focus lens at the time of shooting.

また各マイクロレンズ20に対応付けられた画素群から同一の分割瞳領域を通過した光束に対応した画素を抽出して画像を構成することで、分割瞳領域の位置に対応した画像を生成することもできる。即ち、図2(b)のようにマイクロレンズ20と光電変換素子が対応付けられている場合、25種類の画像を生成することができる。このとき、各分割瞳領域の位置に対応する画像はそれぞれ異なる光軸について撮影された画像とみなすことができ、例えば隣接する光学系を有する多眼カメラを用いて撮影された視差を有する関係にある画像群と等価といえる。従って、本実施形態ではLFデータを用いた焦点状態を検出する方法について説明するが、本発明は上述した多眼カメラを用いて撮影された画像群についても適用可能であり、この場合、複数の画像に現れた被写体の距離の検出をすることができる。   In addition, an image corresponding to the position of the divided pupil region is generated by extracting an image corresponding to the light beam that has passed through the same divided pupil region from the pixel group associated with each microlens 20 to form an image. You can also. That is, as shown in FIG. 2B, when the microlens 20 and the photoelectric conversion element are associated with each other, 25 types of images can be generated. At this time, the image corresponding to the position of each divided pupil region can be regarded as an image taken with respect to different optical axes, for example, in a relationship having parallax taken using a multi-view camera having an adjacent optical system. It can be said that it is equivalent to a certain image group. Therefore, in this embodiment, a method for detecting a focus state using LF data will be described. However, the present invention can also be applied to a group of images photographed using the above-described multi-lens camera. The distance of the subject appearing in the image can be detected.

画像処理部103は、撮像部102から出力されたLFデータのアナログ画像信号に対して、焦点検出処理を含む種々の画像処理を実行する。具体的には画像処理部103は焦点検出処理の他、入力されたアナログ画像信号に対するA/D変換処理、ホワイトバランス調整処理、ガンマ補正処理等を行う。なお、本実施形態では画像処理部103は、得られたLFデータから再構成画像を生成する処理も行う。また画像処理部103は、上述した各工程で生成されるLFデータや再構成画像のデータに、予め定められた符号化方式に応じて圧縮処理を実行する。また画像処理部103は、上述した各工程で生成されるLFデータ、再構成画像のデータをモードやユーザ指示に応じてメモリや記録媒体に記録するか、あるいは所定の形式に変換して外部に出力する。各種画像処理は、専用回路等により実現されてよい。   The image processing unit 103 performs various image processes including a focus detection process on the analog image signal of the LF data output from the imaging unit 102. Specifically, the image processing unit 103 performs A / D conversion processing, white balance adjustment processing, gamma correction processing, and the like on the input analog image signal in addition to focus detection processing. In the present embodiment, the image processing unit 103 also performs processing for generating a reconstructed image from the obtained LF data. Further, the image processing unit 103 performs compression processing on the LF data and reconstructed image data generated in each step described above according to a predetermined encoding method. Further, the image processing unit 103 records the LF data and reconstructed image data generated in each process described above in a memory or a recording medium according to a mode or a user instruction, or converts the data into a predetermined format and externally Output. Various image processes may be realized by a dedicated circuit or the like.

メモリ104は、記憶素子及び該記憶素子への読み書きを行う処理回路を有する。メモリ104は、記憶素子への出力を行うとともに、表示部105に出力する画像を保存する。またメモリ104は、符号化された画像、動画、音声データ等を保存する。   The memory 104 includes a memory element and a processing circuit that reads from and writes to the memory element. The memory 104 outputs to the storage element and stores an image to be output to the display unit 105. The memory 104 stores encoded images, moving images, audio data, and the like.

表示部105は、例えばLCD等のデジタルカメラ100が備える表示装置である。表示部105には、撮像により得られたLFデータから生成された再構成画像等が表示される。   The display unit 105 is a display device provided in the digital camera 100 such as an LCD. The display unit 105 displays a reconstructed image or the like generated from LF data obtained by imaging.

操作検出部106は、デジタルカメラ100が有するレリーズボタン等のユーザインタフェースになされた操作を検出する。具体的には操作検出部106は、ユーザにより例えばレリーズボタンが操作されたことを検出すると、該操作に対応する制御信号をカメラ制御部101に出力する。   The operation detection unit 106 detects an operation performed on a user interface such as a release button of the digital camera 100. Specifically, when the operation detection unit 106 detects that the user has operated, for example, a release button, the operation detection unit 106 outputs a control signal corresponding to the operation to the camera control unit 101.

〈レンズ200の構成〉
レンズ制御部201は、例えばCPUであり、不図示のROM及びRAMを内蔵する。レンズ制御部201は、ROMに格納されているレンズ200が有する各ブロックの動作プログラムを読み出し、RAMに展開して実行することにより、各ブロックの動作を制御する。レンズ制御部201は、電気接点107を介してカメラ制御部101より焦点位置や絞り値の情報を受信すると、該情報をレンズ駆動部203に伝送し、撮像光学系202の対応する光学部材を駆動させる。
<Configuration of lens 200>
The lens control unit 201 is a CPU, for example, and incorporates a ROM and a RAM (not shown). The lens control unit 201 controls the operation of each block by reading the operation program of each block included in the lens 200 stored in the ROM, developing the program in the RAM, and executing the program. When the lens control unit 201 receives information on the focal position and the aperture value from the camera control unit 101 via the electrical contact 107, the lens control unit 201 transmits the information to the lens driving unit 203 and drives the corresponding optical member of the imaging optical system 202. Let

撮像光学系202は、レンズ200が有するレンズ群や絞り等で構成される。本実施形態では撮像光学系202は、少なくともフォーカスレンズ、シフトレンズ、及び絞りを含む。レンズ駆動部203は、レンズ制御部201から入力された情報に従い、撮像光学系202のフォーカスレンズ、シフトレンズ、及び絞りの駆動制御を行う。なお、本実施形態のレンズ制御部201には不図示の手振れ検出センサが接続されており、レンズ駆動部203はレンズ制御部201より入力された該センサの出力に応じてシフトレンズを駆動する。   The imaging optical system 202 includes a lens group, a diaphragm, and the like that the lens 200 has. In the present embodiment, the imaging optical system 202 includes at least a focus lens, a shift lens, and a diaphragm. The lens driving unit 203 performs drive control of the focus lens, the shift lens, and the diaphragm of the imaging optical system 202 according to the information input from the lens control unit 201. Note that a camera shake detection sensor (not shown) is connected to the lens control unit 201 of this embodiment, and the lens driving unit 203 drives the shift lens according to the output of the sensor input from the lens control unit 201.

《焦点状態を検出する方法の概要》
以下、本実施形態のデジタルカメラ100の画像処理部103が行う焦点状態を検出する方法について、その概要を説明する。
<Overview of how to detect the focus state>
Hereinafter, an outline of a method for detecting a focus state performed by the image processing unit 103 of the digital camera 100 according to the present embodiment will be described.

本実施形態では画像処理部103は、撮影対象である被写体におけるエッジ等の直線成分に着目して焦点状態の検出を行う。これはエッジ部が高周波成分を含んでおり、焦点状態に敏感に反応してコントラストが変化する(ボケが生じる)ことに基づくものであるが、本発明の実施において、焦点状態の評価に用いる対象はエッジ部に限られるものではない。画像処理部103は、例えばLFデータから生成した1つの再構成画像について垂直方向と水平方向のそれぞれについて直線成分を抽出し、いずれの方向の直線成分が多いかによって焦点状態の検出を行う方向を決定する。例えば画像内に垂直方向の直線成分が多い場合、画像処理部103は以下に説明する焦点状態の検出を水平方向について行う。また例えば画像内に水平方向の直線成分が多い場合、画像処理部103は焦点状態の検出を垂直方向について行う。即ち、画像処理部103は、撮影対象である被写体(撮影範囲)について高周波成分が多く現れる方向を特定し、該方向について焦点状態の検出処理を行う。従って、本発明の実施は上述したような垂直方向及び水平方向に限られるものではなく、例えば撮影範囲に斜め方向の直線成分が多い場合は、該方向と直交する方向について焦点状態の検出処理を行えばよい。なお、本実施形態ではより多くの被写体(直線成分)の焦点状態を評価できるように、撮影範囲の直線成分が多い方向と直交する方向について焦点状態の検出処理を行うものとして説明するが、本発明の実施はこれに限られるものではない。例えば主被写体についての焦点状態のみを検出したい場合は、主被写体の像が現れる領域における直線成分に基づいて焦点状態の検出処理を行う方向を決定してもよい。また、焦点状態の検出処理に係る演算量を削減したい場合は、直線成分が多い方向について焦点状態の検出処理を行うようにしてもよい。また、当然焦点状態の検出処理を行う方向は1方向に限定しなくてもよい。   In the present embodiment, the image processing unit 103 detects a focus state by paying attention to a linear component such as an edge in a subject to be photographed. This is based on the fact that the edge portion contains a high-frequency component and the contrast changes sensitively to the focus state (blurring occurs), but in the implementation of the present invention, the object used for the evaluation of the focus state Is not limited to the edge portion. For example, the image processing unit 103 extracts a linear component in each of the vertical direction and the horizontal direction for one reconstructed image generated from LF data, and determines the direction in which the focus state is detected depending on which direction has more linear components. decide. For example, when there are many vertical line components in the image, the image processing unit 103 detects the focus state described below in the horizontal direction. For example, when there are many linear components in the horizontal direction in the image, the image processing unit 103 detects the focus state in the vertical direction. In other words, the image processing unit 103 identifies a direction in which a high frequency component appears in a subject (shooting range) that is a shooting target, and performs focus state detection processing in the direction. Therefore, the embodiment of the present invention is not limited to the vertical direction and the horizontal direction as described above. For example, when there are many linear components in the oblique direction in the shooting range, the focus state detection process is performed in the direction orthogonal to the direction. Just do it. In the present embodiment, the focus state detection process is performed in a direction orthogonal to the direction in which there are many linear components in the imaging range so that the focus state of more subjects (linear components) can be evaluated. Implementation of the invention is not limited to this. For example, when it is desired to detect only the focus state of the main subject, the direction in which the focus state detection process is performed may be determined based on the linear component in the region where the image of the main subject appears. Further, when it is desired to reduce the amount of calculation related to the focus state detection process, the focus state detection process may be performed in a direction in which there are many linear components. Of course, the direction in which the focus state detection process is performed may not be limited to one direction.

このようにして焦点状態の検出処理を行う方向(検出方向)を決定すると、画像処理部103は、LFデータから検出方向に並ぶ信号列(画素列)を抽出する。例えば図2(b)のように25の光電変換素子が1つのマイクロレンズ20に割り当てられている場合、検出方向の5つの光電変換素子の出力である画素が、マイクロレンズアレイ108の該方向に並ぶマイクロレンズ20の数だけ連結した画素列が抽出される。具体的には例えば検出方向が水平方向(図2のx方向)であった場合、図3に示されるように画素列には分割瞳領域31a、31b、31c、31d、31eを通過した光束に対応する画素が繰り返し現れる。図3において画素に付した参照番号はレンズ番号であり、マイクロレンズアレイ108のx方向において何番目のマイクロレンズ20に対応付けられた画素であるかを示している。また、参照番号に付されたa乃至eの文字は、画素に対応する光束の通過した分割瞳領域が31a乃至eのいずれであるかを示している。なお、以下では該参照番号及び付加文字を用いるために、検出方向は水平方向であるものとして説明する。   When the direction (detection direction) in which the focus state detection process is performed in this way is determined, the image processing unit 103 extracts a signal sequence (pixel sequence) arranged in the detection direction from the LF data. For example, as shown in FIG. 2B, when 25 photoelectric conversion elements are assigned to one microlens 20, pixels that are outputs of five photoelectric conversion elements in the detection direction are arranged in the direction of the microlens array 108. Pixel rows connected by the number of microlenses 20 arranged are extracted. Specifically, for example, when the detection direction is the horizontal direction (x direction in FIG. 2), the light flux that has passed through the divided pupil regions 31a, 31b, 31c, 31d, and 31e in the pixel row as shown in FIG. Corresponding pixels appear repeatedly. In FIG. 3, a reference number assigned to a pixel is a lens number, and indicates a pixel associated with the microlens 20 in the x direction of the microlens array 108. The letters a through e attached to the reference numbers indicate which of the divided pupil areas 31a through e through which the light flux corresponding to the pixel has passed. In the following description, since the reference number and additional characters are used, the detection direction is assumed to be the horizontal direction.

画像処理部103は、このようにLFデータから抽出した検出方向の画素列を、同一の分割瞳領域を通過した光束の出力である画素が一列に並ぶように並び替え、図3のような2次元像300を生成する。図3の2次元像300では、マイクロレンズアレイ108において検出方向に現れるマイクロレンズ20の順に該マイクロレンズを通過した光束に対応する画素が1方向に並ぶ。また、これと直交する方向には、対応する光束が通過した分割瞳領域が検出方向(と逆方向)の順になるように、各マイクロレンズ20を通過した光束に対応する画素が並ぶ。即ち、図3に示されるように2次元像300では、行方向には対応する光束が通過した分割瞳領域が異なる画素が並び、列方向には同一の分割瞳領域を通過した光束に対応する画素が、その光束が通過したマイクロレンズ20が検出方向の順になるように並ぶ。   The image processing unit 103 rearranges the pixel rows in the detection direction extracted from the LF data in this way so that the pixels that are the outputs of the light beams that have passed through the same divided pupil region are arranged in a row, as shown in FIG. A dimensional image 300 is generated. In the two-dimensional image 300 of FIG. 3, pixels corresponding to the light beam that has passed through the microlens 20 are arranged in one direction in the order of the microlens 20 appearing in the detection direction in the microlens array 108. Also, in a direction orthogonal to this, pixels corresponding to the light beams that have passed through each microlens 20 are arranged so that the divided pupil regions through which the corresponding light beams have passed are in the order of the detection direction (and the opposite direction). That is, as shown in FIG. 3, in the two-dimensional image 300, pixels with different divided pupil regions through which the corresponding light flux has passed are arranged in the row direction and correspond to light beams that have passed through the same divided pupil region in the column direction. The pixels are arranged so that the microlenses 20 through which the luminous flux has passed are in the order of the detection direction.

以下の説明では、図3における2次元像300の右向きの方向、即ち対応する光束が通過した分割瞳領域a→eの方向を分割方向と呼ぶ。また、2次元像300の垂直方向には、対応する光束が通過したマイクロレンズがマイクロレンズアレイ108上での検出方向の順となるように画素が並ぶが、以下の説明ではLFデータの検出方向と区別するために図3における上向き方向をレンズ位置方向と呼ぶ。即ち、2次元像300では分割方向に瞳分割領域a、b、c、d、eの順に画素が並び、レンズ位置方向にレンズ番号n、n−1、・・・、5、4、3、2、1の順に画素が並んでいる。なお、本実施形態の2次元像300では、レンズ位置方向の正の方向をレンズ番号の増加と逆方向にとるが、これは後述の角度検出における角度正負方向の定義にあわせたことに依る。   In the following description, the rightward direction of the two-dimensional image 300 in FIG. 3, that is, the direction of the divided pupil region a → e through which the corresponding light flux has passed is referred to as a divided direction. Also, in the vertical direction of the two-dimensional image 300, pixels are arranged so that the microlenses through which the corresponding light flux has passed are in the order of detection directions on the microlens array 108. In the following description, the detection direction of LF data In order to distinguish them from each other, the upward direction in FIG. 3 is referred to as a lens position direction. That is, in the two-dimensional image 300, pixels are arranged in the order of pupil division regions a, b, c, d, and e in the division direction, and lens numbers n, n−1,. Pixels are arranged in the order of 2 and 1. In the two-dimensional image 300 of the present embodiment, the positive direction of the lens position direction is opposite to the increase of the lens number, but this depends on the definition of the angle positive / negative direction in angle detection described later.

本実施形態の画像処理部103は、このようにして生成した2次元像を用いて焦点状態を検出する。ここで、焦点状態によって2次元像がどのように変化するかを、図4を用いてさらに説明する。   The image processing unit 103 of the present embodiment detects the focus state using the two-dimensional image generated in this way. Here, how the two-dimensional image changes depending on the focus state will be further described with reference to FIG.

検出方向と直交する方向に伸びる直線状のエッジを示す被写体に合焦した状態にある場合、該被写体の反射光に対応する光束は、どのような経路を通ってきたとしても、フォーカスレンズの焦点距離に位置する撮像面に収束することになる。例えば、合焦していたエッジが撮影後にLFデータから生成される再構成画像において、検出方向に1画素分の幅を持つ像となって現れる場合、エッジに対応する光束は、撮像面において検出方向に並んだマイクロレンズのうちの1つのマイクロレンズに収束する。そして光束は該マイクロレンズによって検出方向に並んだ光電変換素子に分離されて受光されることになるため、LFデータから抽出された画素列から2次元像を生成すると、図4(b)のようにエッジは分割方向に一直線に並ぶ。図4(b)では、エッジによる輝度差(所定レベル以上の明画素と暗画素とのコントラスト)をわかりやすくするため、明画素を白、暗画素を黒で示している。図4(b)に示されるように、エッジに合焦していた場合は2次元像においてレンズ位置方向の輝度の切り替わりが分割方向に平行なライン(直線)となって現れる。   When focused on a subject showing a linear edge extending in a direction orthogonal to the detection direction, the light beam corresponding to the reflected light of the subject passes through any path, and the focus of the focus lens It converges on the imaging surface located at a distance. For example, when a focused edge appears as an image having a width of one pixel in the detection direction in a reconstructed image generated from LF data after shooting, the light flux corresponding to the edge is detected on the imaging surface. It converges to one of the microlenses arranged in the direction. Then, since the light beam is separated and received by the photoelectric conversion elements arranged in the detection direction by the microlens, when a two-dimensional image is generated from the pixel row extracted from the LF data, as shown in FIG. The edges are aligned in the dividing direction. In FIG. 4B, in order to make the luminance difference due to the edge (contrast between a bright pixel and a dark pixel above a predetermined level) easy to understand, the bright pixel is shown in white and the dark pixel is shown in black. As shown in FIG. 4B, when the focus is on the edge, the luminance switching in the lens position direction appears as a line (straight line) parallel to the dividing direction in the two-dimensional image.

一方、エッジを示す被写体に合焦する焦点距離がLFデータの撮影時のフォーカスレンズの焦点距離よりも短かった場合、該被写体の反射光に対応する光束は、撮像面よりも手前の焦点面に収束することになる。例えば、図4(d)に示されるように、LFデータを撮影した際のマイクロレンズアレイ面である撮像面410に対し、エッジを示す被写体に合焦する焦点距離に対応する焦点面400がレンズ200寄りに存在する場合を考える。このとき、エッジに対応する光束は焦点面400において収束するが、その後さらに広がって撮像面410に至ることになる。理解を容易にするために焦点面400の位置に仮想マイクロレンズ401を定義すると、図4(d)の例では、該仮想マイクロレンズ401によって分離された光束は、撮像面410においてそれぞれ異なるマイクロレンズ411乃至415に入射することになる。即ち、エッジに対応する光束が仮想マイクロレンズ401に収束したとしても、撮像面410では1つのマイクロレンズのみに対応付けられた光電変換素子に受光される訳ではないため、2次元像ではエッジが図4(a)のように現れる。つまり、エッジに合焦せず、所謂後ピン状態にある場合は、2次元像においてレンズ位置方向の輝度の切り替わりは分割方向のラインではなく、分割方向と角度(極座標系で偏角がマイナス(0>θ>−π/2))をなす方向のラインとして現れる。   On the other hand, when the focal length for focusing on the subject indicating the edge is shorter than the focal length of the focus lens at the time of shooting the LF data, the luminous flux corresponding to the reflected light of the subject is on the focal plane in front of the imaging plane. It will converge. For example, as shown in FIG. 4D, a focal plane 400 corresponding to a focal length focused on a subject indicating an edge is a lens with respect to an imaging plane 410 that is a microlens array plane when LF data is captured. Consider the case where it is close to 200. At this time, the light flux corresponding to the edge converges on the focal plane 400, but then spreads further to the imaging plane 410. If the virtual microlens 401 is defined at the position of the focal plane 400 for easy understanding, the light beams separated by the virtual microlens 401 in the example of FIG. It will enter into 411 thru | or 415. That is, even if the light beam corresponding to the edge converges on the virtual microlens 401, the imaging surface 410 does not receive the light on the photoelectric conversion element associated with only one microlens. It appears as shown in FIG. That is, when the focus is not on the edge and the lens is in the so-called rear pin state, the luminance switching in the lens position direction is not a line in the division direction in the two-dimensional image, but the division direction and the angle (the declination angle is minus ( 0> θ> −π / 2)).

同様に、エッジを示す被写体に合焦する焦点距離がLFデータの撮影時のフォーカスレンズの焦点距離よりも長かった場合、該被写体の反射光に対応する光束は、撮像面よりも後方の焦点面に収束することになる。例えば、図4(d)に示されるように、LFデータを撮影した際のマイクロレンズアレイ面である撮像面410に対し、エッジを示す被写体に合焦する焦点距離に対応する焦点面420が撮像素子側に存在する場合を考える。このとき、エッジに対応する光束は焦点面420において収束するが、撮像面410においてはまだ収束していない状態である。理解を容易にするために焦点面420の位置に仮想マイクロレンズ421を定義すると、図4(d)の例では、該仮想マイクロレンズ421によって分離される光束は、撮像面410においてそれぞれ異なるマイクロレンズ411乃至415に入射することになる。即ち、エッジに対応する光束が仮想マイクロレンズ421に収束する前の段階で、撮像面410の複数のマイクロレンズに対応付けられた光電変換素子にそれぞれ受光されるため、2次元像ではエッジが図4(c)のように現れる。つまり、エッジに合焦せず、所謂前ピン状態にある場合は、2次元像においてレンズ位置方向の輝度の切り替わりは分割方向のラインではなく、分割方向と角度(極座標系で偏角がプラス(0<θ<π/2))をなす方向のラインとして現れる。   Similarly, when the focal length for focusing on a subject indicating an edge is longer than the focal length of the focus lens at the time of photographing LF data, the light beam corresponding to the reflected light of the subject is a focal plane behind the imaging plane. Will converge to. For example, as shown in FIG. 4D, a focal plane 420 corresponding to a focal length focused on a subject indicating an edge is captured with respect to an imaging plane 410 that is a microlens array surface when LF data is captured. Consider the case where it exists on the element side. At this time, the light flux corresponding to the edge is converged on the focal plane 420 but not yet converged on the imaging plane 410. If the virtual microlens 421 is defined at the position of the focal plane 420 for easy understanding, the light beams separated by the virtual microlens 421 in the example of FIG. It will enter into 411 thru | or 415. That is, the light beam corresponding to the edge is received by the photoelectric conversion elements associated with the plurality of microlenses on the imaging surface 410 before the light flux corresponding to the edge converges on the virtual microlens 421. It appears as 4 (c). That is, when the focus is not on the edge and the lens is in the so-called front pin state, the luminance switching in the lens position direction in the two-dimensional image is not a line in the division direction, but the division direction and angle (a declination is positive in the polar coordinate system 0 <θ <π / 2)) appears as a line in the direction.

従って、本実施形態の画像処理部103は、LFデータから抽出した検出方向の画素列を用いて2次元像を生成し、エッジに対応する画素によって該画像に現れる直線(同一属性の画素の並び)を検出することで、エッジの焦点状態を検出できる。即ち、画像処理部103は、LFデータの撮影時にエッジは合焦状態であったか、または2次元像に現れる直線の傾きによって前ピン状態及び後ピン状態のいずれであったかを判定することができる。さらに、2次元像に現れる直線の傾きは、その合焦度合いを示しているため、画像処理部103は直線さえ検出できれば、相関演算を行うことなく焦点状態を検出することができる。これは、撮影面と焦点面との距離が離れれば収束するべき光束が、検出方向においてより分散(拡散)してマイクロレンズに入射することによるものである。   Therefore, the image processing unit 103 according to the present embodiment generates a two-dimensional image using the pixel row in the detection direction extracted from the LF data, and displays straight lines (an array of pixels having the same attribute) that appear in the image by the pixels corresponding to the edges. ) To detect the focus state of the edge. That is, the image processing unit 103 can determine whether the edge is in focus when the LF data is captured, or whether the edge is in the front pin state or the back pin state based on the slope of the straight line appearing in the two-dimensional image. Further, since the inclination of the straight line appearing in the two-dimensional image indicates the degree of focusing, the image processing unit 103 can detect the focus state without performing the correlation calculation as long as the straight line can be detected. This is because the light beam that should converge when the distance between the imaging surface and the focal plane is increased is more dispersed (diffused) in the detection direction and enters the microlens.

《焦点状態検出処理》
以下、本実施形態の画像処理部103において実行される焦点状態検出処理について、図5のフローチャートを用いて具体的な処理を説明する。なお、本焦点状態検出処理は、例えばデジタルカメラ100が撮影モードにある状態で、レリーズボタンが半押し状態にされる等の撮影準備指示を受け付けた際に開始されるものとして説明する。
<Focus state detection processing>
Hereinafter, specific processing of the focus state detection processing executed in the image processing unit 103 of the present embodiment will be described with reference to the flowchart of FIG. The focus state detection process will be described as being started when a shooting preparation instruction is received, for example, when the digital camera 100 is in the shooting mode and the release button is pressed halfway.

S501で、画像処理部103は、焦点状態の検出に係る検出方向を決定する。具体的には画像処理部103は、現在のフォーカスレンズの設定で撮像されて出力されたLFデータを取得し、再構成画像を生成する。そして画像処理部103は、生成した再構成画像について、例えば適切なフィルタを適用することで、水平方向及び垂直方向の直線成分の量を把握し、直線成分の量が少ない方向を検出方向に決定する。即ち、直線成分の量が多い方向と直交する方向を検出方向に決定する。   In step S501, the image processing unit 103 determines a detection direction related to detection of a focus state. Specifically, the image processing unit 103 acquires LF data that is captured and output with the current setting of the focus lens, and generates a reconstructed image. Then, the image processing unit 103 grasps the amount of the linear component in the horizontal direction and the vertical direction, for example, by applying an appropriate filter to the generated reconstructed image, and determines the direction in which the amount of the linear component is small as the detection direction. To do. That is, the direction orthogonal to the direction in which the amount of the linear component is large is determined as the detection direction.

S502で、画像処理部103は、LFデータから検出方向の画素列を抽出し、2次元像を生成する。2次元像は、上述したようにLFデータの検出方向に並んだ画素列を、マイクロレンズ単位で分断して検出方向と直交する方向に接続して生成する。なお、2次元像の生成に用いる画素列は、LFデータのいずれの位置から取得してもよい。   In step S502, the image processing unit 103 extracts a pixel row in the detection direction from the LF data, and generates a two-dimensional image. As described above, a two-dimensional image is generated by dividing pixel rows arranged in the detection direction of LF data in units of microlenses and connecting them in a direction orthogonal to the detection direction. Note that the pixel column used for generating the two-dimensional image may be acquired from any position of the LF data.

S503で、画像処理部103は、輝度補正に係る処理を2次元像に適用する。撮像光学系202と撮像素子109との関係が理想的に構成される場合は問題とならないが、一般には像高(光軸からの距離)が離れた瞳領域を通過する光束には、レンズ枠等の遮蔽物(絞りは含まない)によって輝度が低下する、所謂ケラレが発生する。ケラレが発生した場合、輝度が低下することになり2次元像内の複数の画素が同一の被写体の像であるかを判断することが困難になるため、画像処理部103は輝度補正を行ってケラレによる輝度低下を低減する。   In step S503, the image processing unit 103 applies a process related to luminance correction to the two-dimensional image. This is not a problem when the relationship between the imaging optical system 202 and the imaging element 109 is ideally configured. However, in general, a lens frame is used for a light beam that passes through a pupil region with a high image height (distance from the optical axis). So-called vignetting occurs in which the luminance decreases due to a shielding material such as a diaphragm (excluding the stop). When vignetting occurs, the luminance decreases, and it is difficult to determine whether a plurality of pixels in the two-dimensional image are the same subject image. Therefore, the image processing unit 103 performs luminance correction. Reduces brightness reduction due to vignetting.

S504で、画像処理部103は、2次元像内に同一のエッジの像によって構成される画素を抽出するため、例えば所定の空間周波数を示す画素を抽出するフィルタ処理を適用する。フィルタの適用は、2次元像におけるレンズ位置方向に対して行われる。例えば2次元像が図6(a)のような明画素と暗画素の分布を示す場合、明画素と暗画素との切り替わりを示す空間周波数のみを抽出するフィルタを適用することで、図6(b)のように切り替わりを示す画素(エッジ)のみを抽出することができる。   In step S504, the image processing unit 103 applies, for example, a filter process that extracts pixels having a predetermined spatial frequency in order to extract pixels configured by the same edge image in the two-dimensional image. The filter is applied to the lens position direction in the two-dimensional image. For example, when the two-dimensional image shows a distribution of bright pixels and dark pixels as shown in FIG. 6A, a filter that extracts only the spatial frequency indicating the switching between the bright pixels and the dark pixels is applied, so that FIG. Only pixels (edges) indicating switching as in b) can be extracted.

S505で、画像処理部103は、フィルタ適用後の画像から所定の空間周波数を示す画素により構成される直線及び該直線の傾きを検出する。なお、ここで検出する直線とは、再構成画像におけるエッジ成分が呈する直線を指すのではなく、2次元像として構成した際に、異なる分割瞳領域を通過した光束によりそれぞれ異なる位置に結像されたエッジの画素が、2次元像内に構成する直線を指す。また、直線の傾きとは、2次元像において分割方向に1画素移動した際に、レンズ位置方向にどれだけ離れた位置に同一のエッジの像を示す画素が現れるかを示している。   In step S <b> 505, the image processing unit 103 detects a straight line composed of pixels indicating a predetermined spatial frequency and the inclination of the straight line from the image after the filter application. Note that the straight line detected here does not indicate the straight line represented by the edge component in the reconstructed image, but is formed at different positions by the light beams that have passed through different divided pupil regions when configured as a two-dimensional image. A pixel at the edge indicates a straight line constituting the two-dimensional image. In addition, the slope of the straight line indicates how far away in the lens position direction a pixel showing the same edge image appears when moving one pixel in the dividing direction in a two-dimensional image.

本ステップの処理は、2次元像において縦方向(検出方向におけるマイクロレンズの並びに画素が対応)には、分割瞳領域ごとに基本的には共通である被写体の明暗パターンが現れることによる。つまり、撮影時の焦点状態と、通過した分割瞳領域が異なることとによって被写体像が結像されるマイクロレンズの位置は異なりうるが、検出方向において現れる被写体像のパターンをみた場合は、分割瞳領域の各々では遮蔽関係の変化がない限り同様となる。従って、本実施形態の2次元像を生成した場合には、分割瞳領域ごとに同様のパターンがレンズ位置方向に並ぶため、撮影時の焦点状態によって該パターンが互いにずれたとしても同一のエッジに対応する像によって2次元像内に直線が現れる。   The processing of this step is due to the appearance of a light / dark pattern of the subject that is basically common for each divided pupil region in the vertical direction (corresponding to the pixels of the microlens in the detection direction) in the two-dimensional image. In other words, the position of the microlens on which the subject image is formed may differ depending on the focus state at the time of shooting and the divided pupil region that has passed, but if the subject image pattern that appears in the detection direction is viewed, The same is true for each of the areas as long as there is no change in the shielding relationship. Therefore, when the two-dimensional image of this embodiment is generated, the same pattern is arranged in the lens position direction for each divided pupil region, so even if the patterns are shifted from each other depending on the focus state at the time of shooting, the same edge is formed. A straight line appears in the two-dimensional image with the corresponding image.

〈直線及び傾き検出〉
以下、本ステップにおいて行う直線成分の検出方法について、図を用いて詳細を説明する。本実施形態では画像処理部103は、2次元像における直線成分の検出を、ハフ変換を用いて検出する。ハフ変換は、画像の特徴抽出に用いられる変換手法の一つであり、例えば画像の特徴に最も合致する直線の検出に使用することができる。
<Linear and tilt detection>
Hereinafter, the linear component detection method performed in this step will be described in detail with reference to the drawings. In the present embodiment, the image processing unit 103 detects the detection of the linear component in the two-dimensional image using the Hough transform. The Hough transform is one of conversion methods used for image feature extraction, and can be used, for example, to detect a straight line that most closely matches the image feature.

S504においてなされたフィルタ処理により高周波成分を含むエッジに対応する画素のみが図6(b)のように抽出されているため、画像処理部103はまず該抽出された画素を順番に選択して直線検出を行う。なお、以下の説明では2次元像に現れる直線の傾きは、分割方向を基準に考え、検出された直線が分割方向から反時計回りの方向に傾いた状態にある場合は正の傾きを有し、時計回りの方向に傾いた状態にある場合は負の傾きであるとする。   Since only the pixels corresponding to the edge including the high frequency component are extracted as shown in FIG. 6B by the filter processing performed in S504, the image processing unit 103 first selects the extracted pixels in order and performs straight lines. Perform detection. In the following description, the inclination of the straight line appearing in the two-dimensional image is considered based on the division direction, and has a positive inclination when the detected straight line is inclined counterclockwise from the division direction. If it is tilted in the clockwise direction, the slope is negative.

ここで、2次元像中に現れた直線600について、その直線及び傾き検出の方法を例示する。まず、図6(b)の(分割方向,レンズ位置方向)=(a,7)の座標に存在する画素601に着目した場合に、画像処理部103は該画素を通過する全ての直線を考慮し、各直線が特定の分割方向の座標で通過するレンズ位置方向の座標に投票を行う。具体的には画像処理部103は、傾きを順に変更しながら画素601を通過する直線を規定していき、例えば中央の分割瞳領域に対応する分割方向cの座標において該直線が通過するレンズ位置方向の座標に投票を行う。これにより、分割方向cの座標における画素601を通過しうる直線の分布を特定することができる。例えば、画素601を通過する直線の傾きが0であった場合は分割方向cの座標において(c,9)を通過し、傾きが+1であった場合は分割方向cの座標において(c,5)を通過し、傾きが−1であった場合は分割方向cの座標において(c,9)を通過する。従って、傾きとレンズ位置方向の座標との関係を示す図6(c)のような分布図に画素601を通過しうる直線の分布を示すと、(傾き,レンズ位置方向)=(0,7)、(1,5)、(−1,9)を通過する直線611のようになる。従って、画像処理部103は該直線611が通過したビン(分布における各マス目)に投票を行うことになる。   Here, the straight line 600 appearing in the two-dimensional image will be exemplified by its straight line and inclination detection method. First, when focusing on the pixel 601 existing at the coordinates (division direction, lens position direction) = (a, 7) in FIG. 6B, the image processing unit 103 considers all straight lines passing through the pixel. Then, voting is performed on the coordinates in the lens position direction through which each straight line passes at the coordinates in a specific division direction. Specifically, the image processing unit 103 defines a straight line that passes through the pixel 601 while sequentially changing the inclination. For example, the lens position through which the straight line passes at the coordinates in the division direction c corresponding to the central divided pupil region. Vote for the direction coordinates. Thereby, it is possible to specify a distribution of straight lines that can pass through the pixel 601 at the coordinates in the dividing direction c. For example, when the slope of the straight line passing through the pixel 601 is 0, it passes (c, 9) in the coordinates in the dividing direction c, and when the slope is +1, the coordinates in the dividing direction c are (c, 5 ), And when the inclination is −1, it passes (c, 9) in the coordinates in the dividing direction c. Therefore, when the distribution of straight lines that can pass through the pixel 601 is shown in a distribution diagram as shown in FIG. 6C showing the relationship between the tilt and the coordinates in the lens position direction, (tilt, lens position direction) = (0, 7 ), (1, 5), and (-1, 9). Therefore, the image processing unit 103 votes for the bin (each square in the distribution) through which the straight line 611 has passed.

次に、図6(b)の(b,8)の座標に存在する画素602に着目した場合に、画像処理部103は同様に画素602を通過する全ての直線について、分割方向cの座標において該直線が通過するレンズ位置方向の座標に投票を行う。例えば、画素602を通過する直線の傾きが0であった場合は分割方向cの座標において(c,8)を通過し、傾きが+1であった場合は分割方向cの座標において(c,7)を通過し、傾きが−1であった場合は分割方向cの座標において(c,9)を通過する。従って、図6(c)の傾きとレンズ位置方向の座標との関係を示す分布図において、画素602を通過しうる直線の分布を示すと、(傾き,レンズ位置方向)=(0,8)、(1,7)、(−1,9)を通過する直線612のようになる。従って画像処理部103は、該直線612が通過したビンにも同様に投票を行う。   Next, when focusing on the pixel 602 existing at the coordinates (b, 8) in FIG. 6B, the image processing unit 103 similarly applies all the straight lines passing through the pixel 602 in the coordinates in the division direction c. Voting is performed on the coordinates in the lens position direction through which the straight line passes. For example, when the slope of the straight line passing through the pixel 602 is 0, it passes (c, 8) in the coordinates in the dividing direction c, and when the slope is +1, it is (c, 7) in the coordinates in the dividing direction c. ), And when the inclination is −1, it passes (c, 9) in the coordinates in the dividing direction c. Accordingly, in the distribution diagram showing the relationship between the tilt and the coordinates in the lens position direction in FIG. 6C, the distribution of straight lines that can pass through the pixel 602 is shown as (tilt, lens position direction) = (0, 8). , (1, 7), (−1, 9), the straight line 612 is obtained. Accordingly, the image processing unit 103 similarly votes for the bin through which the straight line 612 has passed.

直線600として現れている、エッジに対応する画素603、画素604、画素605についても、傾きとレンズ位置方向の座標との関係を示す分布図に直線613、直線614、直線615をそれぞれ定義してビンに投票を行う。これにより、直線600として現れている全ての画素について画像処理部103が投票を行った結果、分布図のビンのうち、直線611乃至615が重複する(傾き,レンズ位置方向)=(−1,9)が最多投票(ピーク)となる。これは、直線600上の各画素を通過する様々な傾きの直線のうち、直線600に対応する傾きの直線のみが全画素共通で通過する直線となるからである。従って、このような投票結果により、画像処理部103は、直線600が(c,9)を通る傾き−1の直線であることを検出できる。   For the pixels 603, 604, and 605 corresponding to the edges that appear as the straight line 600, straight lines 613, 614, and 615 are respectively defined in the distribution chart showing the relationship between the inclination and the coordinates in the lens position direction. Vote on the bin. Accordingly, as a result of the voting by the image processing unit 103 for all the pixels appearing as the straight line 600, the straight lines 611 to 615 overlap (tilt, lens position direction) = (− 1, 9) is the most votes (peak). This is because, among the straight lines having various inclinations passing through the pixels on the straight line 600, only the straight line having the inclination corresponding to the straight line 600 is a straight line passing through all pixels. Therefore, based on such a voting result, the image processing unit 103 can detect that the straight line 600 is a straight line having an inclination of −1 passing through (c, 9).

また画像処理部103は図6(b)の直線620及び630についても同様に投票を行う。そして、最多投票となった(傾き,レンズ位置方向)=(−1,3)、(−1,12)から、それぞれ(c,3)を通る傾き−1の直線、(c,12)を通る傾き−1の直線であることを検出できる。   The image processing unit 103 also votes in the same manner for the straight lines 620 and 630 in FIG. Then, from the most voted (tilt, lens position direction) = (− 1, 3), (−1, 12), a straight line with a slope of −1 passing through (c, 3), (c, 12), respectively. It can be detected that the straight line has a slope of −1.

このようにして直線及び該直線の傾きを検出した後、画像処理部103はS506で、各直線の傾きの情報を、各直線に対応するエッジの像のデフォーカス量に変換して出力し、本焦点状態検出処理を完了する。デフォーカス量は、従来の位相差に基づく焦点検出システムで用いられているような位相差に変換して出力する場合は、傾きに相当する射影角度θを用いて
Δp=tanθ
として算出すればよい。ここで、Δpは隣接する分割瞳領域間での像の位相差を示しており、単位はピクセルである。なお、ピクセルはLFデータから生成された画像におけるピクセルを示しており、撮像素子の画素ピッチとは異なる。また、デフォーカス量はこのような予め定められた変換式に基づいて傾きの値から算出される構成に限らず、例えば撮像光学系202に併せて予め用意された、直線の傾きとデフォーカス量との関係を示すテーブルを参照することにより取得されてもよい。
After detecting the straight line and the inclination of the straight line in this way, the image processing unit 103 converts the information of the inclination of each straight line into a defocus amount of the image of the edge corresponding to each straight line and outputs it in S506, The focus state detection process is completed. When the defocus amount is output after being converted into a phase difference as used in a focus detection system based on a conventional phase difference, Δp = tan θ using a projection angle θ corresponding to the inclination
Can be calculated as Here, Δp indicates the phase difference of the image between adjacent divided pupil regions, and the unit is a pixel. In addition, the pixel has shown the pixel in the image produced | generated from LF data, and is different from the pixel pitch of an image pick-up element. The defocus amount is not limited to the configuration calculated from the inclination value based on such a predetermined conversion formula. For example, the straight line inclination and the defocus amount prepared in advance in the imaging optical system 202 are also provided. May be obtained by referring to a table indicating the relationship between

本焦点状態検出処理により出力されたデフォーカス量の情報は、例えばカメラ制御部101に伝送され、カメラ制御部101は該情報をもとにエッジに対応する特定の被写体に合焦させるためのフォーカスレンズの駆動量をレンズ駆動部203に伝送する。   Information on the defocus amount output by the focus state detection process is transmitted to, for example, the camera control unit 101, and the camera control unit 101 uses the information to focus on a specific subject corresponding to the edge. The lens driving amount is transmitted to the lens driving unit 203.

このように、本実施形態のデジタルカメラ100では、LFデータを使用することで、計算量の多い相関演算を行うことなく、被写体の焦点状態を容易に検出することができる。また本実施形態に示したようなハフ変換における投票を用いてデフォーカス量を取得する手法を採用する場合、たとえ撮影時においてノイズの影響によりエッジが適切に撮影されなかったとしても、安定して好適なデフォーカス量を取得することができる。即ち、2つの画像の相関演算を行う場合よりも、本手法は2次元像においてエッジにより現れる直線の傾きを検出する際にサンプリング数を多くすることができる。従って、ノイズの影響により傾きが誤検出される画素があったとしても、そのような傾きは投票数が少なくなるため排除することができ、結果的にノイズを影響を受けていない画素により定められた、精度の高いデフォーカス量を取得することができる。   As described above, in the digital camera 100 of the present embodiment, by using the LF data, it is possible to easily detect the focus state of the subject without performing a correlation calculation with a large calculation amount. In addition, when adopting a method for obtaining the defocus amount using voting in the Hough transform as shown in this embodiment, even if the edge is not properly captured due to the influence of noise at the time of capturing, it is stable. A suitable defocus amount can be acquired. In other words, this method can increase the number of samplings when detecting the slope of a straight line that appears in the two-dimensional image due to an edge, compared with the case of performing a correlation operation between two images. Therefore, even if there is a pixel whose inclination is erroneously detected due to the influence of noise, such inclination can be eliminated because the number of votes decreases, and as a result, it is determined by a pixel that is not affected by noise. In addition, a highly accurate defocus amount can be acquired.

《遮蔽関係にある複数の被写体が存在する場合の適用例》
上述した焦点状態検出処理の説明においては、検出対象となる被写体は他の被写体により遮蔽されない、撮影環境の深度方向において焦点状態の検出対象である被写体が1体である例について説明したが、本発明はこれに限られるものではない。以下、複数の被写体が撮影環境の深度方向の異なる位置に存在(所謂遠近競合)し、遮蔽が生じるような場合に、本発明を適用した際の処理の例を図7を用いて説明する。
《Example of application when there are multiple subjects in shielding relationship》
In the description of the focus state detection process described above, an example in which the subject to be detected is not shielded by another subject and the subject to be detected in the focus state in the depth direction of the shooting environment is one is described. The invention is not limited to this. Hereinafter, an example of processing when the present invention is applied will be described with reference to FIG. 7 when a plurality of subjects are present at different positions in the depth direction of the photographing environment (so-called perspective conflict) and shielding occurs.

図7(d)に示されるように、撮像光学系202から見た深度方向において、手前から被写体701、被写体702、被写体703(図示した範囲の外に存在する)が並んでいる状況を考える。このとき、上述したように例えば水平方向を検出方向として設定し、LFデータから抽出された画素列を変形すると、例えば図7(a)のような2次元像が得られる。図7(a)では、図6(a)と同様に被写体の像に対応する画素を明画素及び暗画素として示しているが、明画素は各被写体の輝度に合わせてハッチングを異ならせて示した。レンズ位置方向の負の方向(マイクロレンズの番号が増加する方向)は、図7(d)に示される撮影範囲の右から左に向かう方向に相当するため、図7(d)において1番右に配置された被写体702が図7(a)の画素群712に対応している。また同様に、図7(d)において左方向に進んで次に現れる被写体701は図7(a)の画素群711に対応しており、図7(d)において1番左に配置された最遠方の被写体703は図7(a)の画素群713に対応している。   As shown in FIG. 7D, a situation is considered in which a subject 701, a subject 702, and a subject 703 (existing outside the illustrated range) are arranged in the depth direction viewed from the imaging optical system 202. At this time, as described above, for example, when the horizontal direction is set as the detection direction and the pixel row extracted from the LF data is deformed, a two-dimensional image as shown in FIG. 7A is obtained. In FIG. 7A, the pixels corresponding to the subject image are shown as bright pixels and dark pixels as in FIG. 6A, but the bright pixels are shown with different hatching according to the luminance of each subject. It was. The negative direction of the lens position direction (the direction in which the number of the microlens increases) corresponds to the direction from the right to the left of the imaging range shown in FIG. The object 702 arranged in the area corresponds to the pixel group 712 in FIG. Similarly, the subject 701 that appears to the left in FIG. 7D and appears next corresponds to the pixel group 711 in FIG. 7A, and is the leftmost pixel 701 arranged in FIG. 7D. A distant subject 703 corresponds to the pixel group 713 in FIG.

このように得られた2次元像に対して上述のフィルタ処理を適用すると、図7(b)のようにレンズ位置方向における明画素と暗画素の切り替わりを示す画素(エッジ)のみが抽出される。図7(b)では、各被写体のエッジ成分が現れているが、それぞれ同一のエッジに対応する画素で構成される直線の傾きが異なっていることが理解されよう。図7(b)の例では被写体702に合焦した状態でLFデータが撮影されており、2次元像において被写体702のエッジに対応する画素群722が分割方向に平行な直線として現れている。一方で、被写体701については所謂後ピン状態となっているため、被写体701のエッジに対応する画素群721a及びbは2次元像において負の傾きを有する直線として現れている。また被写体703については所謂前ピン状態となっているため、被写体703のエッジに対応する画素群723a及びbは2次元像において正の傾きを有する直線として現れている。   When the above-described filter processing is applied to the two-dimensional image obtained in this way, only pixels (edges) indicating switching between bright pixels and dark pixels in the lens position direction are extracted as shown in FIG. 7B. . In FIG. 7B, the edge component of each subject appears, but it will be understood that the slopes of the straight lines composed of pixels corresponding to the same edge are different. In the example of FIG. 7B, LF data is captured in a state where the subject 702 is focused, and a pixel group 722 corresponding to the edge of the subject 702 appears as a straight line parallel to the dividing direction in the two-dimensional image. On the other hand, since the subject 701 is in a so-called rear pin state, the pixel groups 721a and b corresponding to the edge of the subject 701 appear as straight lines having a negative slope in the two-dimensional image. Since the subject 703 is in a so-called front pin state, the pixel groups 723a and b corresponding to the edge of the subject 703 appear as straight lines having a positive inclination in the two-dimensional image.

画像処理部103は、このように検出された画素群721乃至723の各画素を選択しながらハフ変換における投票を行い、図7(c)に示すような分布図を生成することで、各画素群に対応する直線の傾きを単一被写体の場合と同様に取得することができる。なお、図7(c)においては2次元像に現れたエッジによる画素群のそれぞれに対する投票の結果、ビン731、732、733、734、及び735がそれぞれ最多投票となっている。該ビンには他のビンとの比較を目的としてハッチングを付したが、ハッチングの濃淡は、特にビン731、734、及び735が被写体のコントラストが低いエッジに対応していることに依る。   The image processing unit 103 performs voting in the Hough transform while selecting each pixel of the pixel groups 721 to 723 thus detected, and generates a distribution diagram as illustrated in FIG. The inclination of the straight line corresponding to the group can be acquired in the same manner as in the case of a single subject. In FIG. 7C, the bins 731, 732, 733, 734, and 735 are the most frequently voted as a result of voting for each pixel group by the edges that appear in the two-dimensional image. The bins are hatched for the purpose of comparison with other bins. The shades of hatching depend on the fact that bins 731, 734, and 735 correspond to edges with low contrast of the subject.

従って、画像処理部103は、撮影範囲に含まれる被写体の各々についてデフォーカス量を生成して出力することができるため、カメラ制御部101は該情報に基づいて、合焦すべき被写体に合焦するよう、レンズ駆動部203への制御信号を出力すればよい。   Therefore, since the image processing unit 103 can generate and output a defocus amount for each of the subjects included in the shooting range, the camera control unit 101 focuses on the subject to be focused based on the information. Thus, a control signal to the lens driving unit 203 may be output.

なお、検出された直線のうちのいずれの直線に対応する被写体に合焦させるかは、例えば以下のように判断してよい。ひとつの方法として、図7(c)において最大の値を持つビンの被写体を合焦させる被写体として選択する方法が考えられる。この場合、最もコントラストの高いエッジを有する被写体に合焦させることがことができる。つまり図7(c)の例では、ビン732または733が選択され、被写体701に合焦される。   Note that it may be determined, for example, as follows whether the subject corresponding to which of the detected straight lines is focused. As one method, a method of selecting the subject in the bin having the maximum value in FIG. In this case, the subject having the edge with the highest contrast can be focused. That is, in the example of FIG. 7C, the bin 732 or 733 is selected and focused on the subject 701.

別の方法としては、図7(c)において投票値が上位数個のビンを選択してレンズ位置方向に加算をした後に(傾きごとの値に変換して)、最大の値を有する傾きを選択する方法が考えられる。このようにするとコントラストの高い被写体にピントを合わせることが可能となる。図7(c)の例ではビン732とビン733を加算した傾き−1が選択され、被写体701に合焦する。   As another method, after selecting the bins with the highest voting value in FIG. 7C and adding in the lens position direction (converting to a value for each inclination), the inclination having the maximum value is obtained. A method of selecting is conceivable. In this way, it is possible to focus on a subject with high contrast. In the example of FIG. 7C, the inclination −1 obtained by adding the bin 732 and the bin 733 is selected, and the subject 701 is focused.

さらに別の方法としては、図7(c)において上位数個のビンを選択してレンズ位置方向に加算した後に(傾きごとの値に変換して)、被写体が手前にある側から極値をサーチする方法が考えられる。これは手前の被写体701に優先してピントを合わせたい場合に有効となる。図7(c)の例ではビン734とビン735を加算した角度+1が選択され、最遠方の被写体703に合焦する。   As another method, after selecting the top few bins in FIG. 7C and adding them in the direction of the lens position (converting them to values for each inclination), the extreme value is obtained from the side where the subject is in front. A search method is conceivable. This is effective when it is desired to focus on the subject 701 in front. In the example of FIG. 7C, the angle +1 obtained by adding the bin 734 and the bin 735 is selected, and the farthest subject 703 is focused.

また、本実施形態ではLFデータから抽出した画素列を使用して2次元像を生成し、画素列に現れる高周波成分の像のデフォーカス量を検出する方法について説明したが、本発明の実施はLFデータから抽出した画素列に限られるものではない。上述したように、LFデータは、分割瞳領域の各々を通過した光束により結像された、光軸の異なる画像群を記録していることと等価である。従って、同一の被写体を撮影した多眼カメラの出力画像群についても、本発明を適用することができる。即ち、多眼カメラの出力画像群のうち、少なくとも決定された検出方向にのみ視差を有する関係にある画像の各々から抽出した画素列を、レンズ位置方向に展開し、光学系の位置関係に併せて分割方向にそれらを並べることで上述の2次元像を生成できる。このとき、それぞれの画像から抽出した画素列は、光学系の位置関係に合わせて各画像を配置した場合に、検出方向に伸びる同一直線上の画素の並びである。これにより同一の被写体について、検出方向に並ぶ光学系で撮影された画像間における像ずれ量を相関演算を行うことなしに把握することができ、光学系の位置関係と合わせて該被写体の被写体距離を特定することができる。なお、本実施形態で説明した2次元像を用いる画像間の相関を把握する手法は、その信頼度を保つためには、少なくとも検出する直線について視差を有する関係にある3つの画像から2次元像を生成することが好ましい。   In the present embodiment, a method for generating a two-dimensional image using a pixel column extracted from LF data and detecting a defocus amount of an image of a high-frequency component appearing in the pixel column has been described. It is not limited to the pixel column extracted from the LF data. As described above, the LF data is equivalent to recording a group of images with different optical axes formed by the light beams that have passed through each of the divided pupil regions. Therefore, the present invention can also be applied to an output image group of a multi-view camera that captures the same subject. That is, a pixel row extracted from each of the images having a parallax only in the determined detection direction in the output image group of the multi-view camera is developed in the lens position direction, and is combined with the positional relationship of the optical system. By arranging them in the dividing direction, the above-described two-dimensional image can be generated. At this time, the pixel row extracted from each image is an arrangement of pixels on the same straight line extending in the detection direction when each image is arranged in accordance with the positional relationship of the optical system. As a result, for the same subject, the amount of image shift between images taken by the optical system aligned in the detection direction can be grasped without performing a correlation operation, and the subject distance of the subject together with the positional relationship of the optical system Can be specified. Note that the method of grasping the correlation between images using the two-dimensional image described in the present embodiment is a two-dimensional image from three images having a parallax with respect to at least a straight line to be detected in order to maintain the reliability. Is preferably generated.

このように本発明は、光軸が異なり、視差を有する関係にある画像群から取得した画素列を用いて2次元像を生成することで、複雑な相関演算を行うことなく単純な直線検出の処理によりエッジのデフォーカス量あるいは被写体距離を特定することができる。即ち、本発明の手法は、従来の1対の信号(視差の異なる2つの信号)から相関演算により相関を求める手法に比べ、より多くの信号をサンプルとして一度に扱えるため、ガウス分布に従う誤差(例えば熱的な雑音)等に対してより好適な結果を得ることができる。つまり、サンプル数が多いため、ノイズ等の影響を受けた画素が存在していたとしても該画素の影響を低減することができるため、従来の手法に比べて演算結果のロバスト性に優れている。従って、撮影環境が暗く、センサ出力のS/N比が良好でない状態であっても、好適な焦点状態の検出結果を得ることができる。   As described above, the present invention generates a two-dimensional image using a pixel array acquired from a group of images having different optical axes and having a parallax, thereby enabling simple straight line detection without performing complex correlation calculation. By processing, the defocus amount of the edge or the subject distance can be specified. That is, the method of the present invention can handle more signals as a sample at a time than the conventional method of obtaining a correlation from a pair of signals (two signals having different parallaxes) by a correlation calculation, and therefore an error (according to a Gaussian distribution) For example, a more favorable result can be obtained for thermal noise). In other words, since the number of samples is large, the influence of the pixels can be reduced even if there are pixels affected by noise or the like, so that the calculation result is more robust than the conventional method. . Therefore, even when the shooting environment is dark and the S / N ratio of the sensor output is not good, a suitable focus state detection result can be obtained.

以上説明したように、本実施形態の画像処理装置は、良好な精度で高速に焦点状態を検出することができる。具体的には画像処理装置は、画像群から、所定の方向に視差を有する関係にある複数の画像を取得し、該複数の画像の各々から、所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する。そして抽出した複数の画素列を、複数の画像の各々を撮影した、所定の方向における位置関係に応じて配置した2次元像を生成し、該2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する。画像処理装置は、該検出した直線の傾きから同一の被写体の被写体距離を特定する。   As described above, the image processing apparatus according to the present embodiment can detect the focus state at high speed with good accuracy. Specifically, the image processing apparatus acquires a plurality of images having a parallax relationship in a predetermined direction from the image group, and is a pixel row extending in a predetermined direction from each of the plurality of images, and correspondingly A pixel row that captures the spatial position to be extracted is extracted. Then, a two-dimensional image in which each of the plurality of extracted pixels is photographed for each of the plurality of images and arranged according to the positional relationship in a predetermined direction is generated, and the same subject included in the two-dimensional image is generated. A straight line constituted by pixels is detected. The image processing apparatus specifies the subject distance of the same subject from the detected inclination of the straight line.

[変形例]
上述した実施形態では、LFデータを撮影出力可能なデジタルカメラ100に本発明を適用した例について説明したが、本発明の適用はこれに限られるものではない。例えば、図8(a)に示すようにデジタルカメラ100からLFデータを取得し、再構成画像を生成して表示装置801に表示させることが可能なPC等の情報処理装置800にも本発明は適用可能である。
[Modification]
In the above-described embodiment, the example in which the present invention is applied to the digital camera 100 capable of photographing and outputting LF data has been described. However, the application of the present invention is not limited to this. For example, as shown in FIG. 8A, the present invention is applied to an information processing apparatus 800 such as a PC that can acquire LF data from the digital camera 100, generate a reconstructed image, and display the reconstructed image on the display apparatus 801. Applicable.

《表示装置801の表示態様》
本変形例において、情報処理装置800のCPUはデジタルカメラ100から取得したLFデータから再構成画像を生成し、表示装置801に出力して表示させる。図8(b)及び(c)は、表示装置801に表示される画像(ウィンドウ)示しており、それぞれ深度方向の異なった位置に存在する被写体に合焦した画像を示している。
<< Display Mode of Display Device 801 >>
In this modification, the CPU of the information processing apparatus 800 generates a reconstructed image from the LF data acquired from the digital camera 100 and outputs the reconstructed image to the display device 801 for display. FIGS. 8B and 8C show images (windows) displayed on the display device 801, each showing an image focused on a subject present at a different position in the depth direction.

CPUは、再構成画像が表示装置801に表示されている場合に、再構成画像上の領域に対するユーザの指示入力がなされたことを受け付けると、該領域に現れる被写体に合焦させた再構成画像を新たに生成して表示装置801に表示させるよう動作する。   When the CPU accepts the user's instruction input for the area on the reconstructed image when the reconstructed image is displayed on the display device 801, the CPU refocuses the reconstructed image on the subject appearing in the area. Is newly generated and displayed on the display device 801.

例えばLFデータの撮影時、ユーザが被写体820に合焦させた状態で撮影を行うことを所望していたが、予期せず被写体830に合焦した焦点状態となりLFデータを撮影がなされてしまった場合を考える。このとき、LFデータから撮影時の焦点距離に対応した再構成画像を生成すると、図8(b)のようになり、被写体820の像は、コントラストが低く低品位の像となっている。このような再構成画像が表示装置801に表示されている場合に、ユーザが被写体820の像が存在する領域を指定する操作を行うと、CPUは、例えば図8(d)に示すフローチャートの処理を実行し、被写体820に合焦した再構成画像を生成する。なお、以下の説明では、上述の検出方向は再構成画像の水平方向であるものとして説明する。   For example, when shooting LF data, the user wanted to shoot with the subject 820 in focus, but unexpectedly focused on the subject 830 and the LF data was shot. Think about the case. At this time, when a reconstructed image corresponding to the focal length at the time of shooting is generated from the LF data, the image is as shown in FIG. 8B, and the image of the subject 820 is a low-quality image with low contrast. When such a reconstructed image is displayed on the display device 801, when the user performs an operation for designating an area where the image of the subject 820 is present, the CPU performs, for example, the process of the flowchart illustrated in FIG. To generate a reconstructed image focused on the subject 820. In the following description, it is assumed that the detection direction is the horizontal direction of the reconstructed image.

S841で、CPUは、LFデータから少なくとも検出方向のみの視差を有する関係にある指定された領域を含む画像の画素列を読み出し、2次元像を生成する。そしてCPUは、2次元像についてフィルタ処理、直線検出処理、角度検出処理を行って、被写体820に対応する像による直線の傾きの情報を取得する。さらにCPUは、該傾きの情報から相関が最大となる焦点距離、即ち傾きが0なる(分割方向に平行なライン)となる焦点距離位置を特定する。   In S841, the CPU reads a pixel column of an image including a designated area having a relationship having at least a parallax only in the detection direction from the LF data, and generates a two-dimensional image. Then, the CPU performs filter processing, straight line detection processing, and angle detection processing on the two-dimensional image, and acquires information on the inclination of the straight line by the image corresponding to the subject 820. Further, the CPU specifies the focal distance at which the correlation is maximum, that is, the focal distance position at which the inclination becomes 0 (a line parallel to the dividing direction) from the inclination information.

S842で、CPUは、特定した焦点距離に対応する面についてLFデータから再構成画像を生成し、S843で生成した画像を表示装置801に伝送して表示させる。   In S842, the CPU generates a reconstructed image from the LF data for the surface corresponding to the identified focal length, and transmits the image generated in S843 to the display device 801 for display.

このようにすることで、表示装置801には、被写体820に合焦した図8(c)のような再構成画像が表示される。上述したように、本発明の手法によれば複雑な相関演算を行うことなく、簡易的な処理でデフォーカス量等の画像間の相関を取得できる。   By doing so, the reconstructed image as shown in FIG. 8C focused on the subject 820 is displayed on the display device 801. As described above, according to the method of the present invention, correlation between images such as the amount of defocus can be acquired with simple processing without performing complicated correlation calculation.

[その他の実施形態]
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
[Other Embodiments]
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

Claims (11)

撮影して得られた画像群から、所定の方向に視差を有する関係にある複数の画像を取得する取得手段と、
前記取得手段により取得された前記複数の画像の各々から、前記所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出手段と、
前記抽出手段により抽出された複数の前記画素列を、前記複数の画像の各々を撮影した、前記所定の方向における位置関係に応じて配置した2次元像を生成する生成手段と、
前記生成手段により生成された前記2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出手段と、
前記検出手段により検出された直線の傾きから前記同一の被写体の被写体距離を特定する特定手段と、を有し、
前記所定の方向は、前記画像群の少なくともいずれかの画像における高周波成分の分布に応じて決定され
ことを特徴とする画像処理装置。
Acquisition means for acquiring a plurality of images having a parallax in a predetermined direction from a group of images obtained by photographing;
An extraction means for extracting a pixel row extending in the predetermined direction and capturing a corresponding spatial position from each of the plurality of images obtained by the obtaining portion;
Generating means for generating a two-dimensional image in which the plurality of pixel columns extracted by the extracting means are taken according to the positional relationship in the predetermined direction, each of which is taken of the plurality of images;
Detecting means for detecting a straight line composed of pixels corresponding to the same subject included in the two-dimensional image generated by the generating means;
Have a, specifying means for specifying an object distance of the same subject from the slope of the detected straight line by the detection means,
The predetermined direction, the image processing apparatus according to claim Rukoto determined according to the distribution of the high frequency component in at least one of an image of the image group.
撮影して得られた、所定の方向に視差を有する関係にある複数の画像から、所定の被写体に合焦した画像を生成して出力する画像処理装置であって、
画像群から前記複数の画像を取得する取得手段と、
前記取得手段により取得された前記複数の画像の各々から、前記所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出手段と、
前記抽出手段により抽出された複数の前記画素列を、前記複数の画像の各々を撮影した、前記所定の方向における位置関係に応じて配置した2次元像を生成する生成手段と、
前記生成手段により生成された前記2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出手段と、
前記検出手段により検出された直線の傾きに応じて、前記複数の画像の位置を前記所定の方向に移動させて、前記同一の被写体に合焦した画像を生成して出力する出力手段と、を有する
ことを特徴とする画像処理装置。
An image processing apparatus that generates and outputs an image focused on a predetermined subject from a plurality of images having a parallax in a predetermined direction obtained by photographing,
Obtaining means for obtaining the plurality of images from an image group;
An extraction means for extracting a pixel row extending in the predetermined direction and capturing a corresponding spatial position from each of the plurality of images obtained by the obtaining portion;
Generating means for generating a two-dimensional image in which the plurality of pixel columns extracted by the extracting means are taken according to the positional relationship in the predetermined direction, each of which is taken of the plurality of images;
Detecting means for detecting a straight line composed of pixels corresponding to the same subject included in the two-dimensional image generated by the generating means;
Output means for generating and outputting an image focused on the same subject by moving the positions of the plurality of images in the predetermined direction according to the inclination of the straight line detected by the detection means; An image processing apparatus comprising:
瞳分割された光束にそれぞれ対応する画像群から、所定の方向に視差を有する関係にある複数の画像を取得する取得手段と、
前記取得手段により取得された前記複数の画像の各々から、前記所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出手段と、
前記抽出手段により抽出された複数の前記画素列を、前記複数の画像の各々に対応する光束の瞳領域における位置関係に応じて連結した2次元像を生成する生成手段と、
前記生成手段により生成された前記2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出手段と、
前記検出手段により検出された直線の傾きから前記画像群を撮影した際の前記同一の被写体の焦点状態を特定する特定手段と、を有し、
前記所定の方向は、前記画像群の少なくともいずれかの画像における高周波成分の分布に応じて決定され
ことを特徴とする画像処理装置。
Acquisition means for acquiring a plurality of images having a parallax in a predetermined direction from image groups respectively corresponding to pupil-divided light fluxes;
An extraction means for extracting a pixel row extending in the predetermined direction and capturing a corresponding spatial position from each of the plurality of images obtained by the obtaining portion;
Generating means for generating a two-dimensional image in which a plurality of the pixel columns extracted by the extracting means are connected according to a positional relationship in a pupil region of a light beam corresponding to each of the plurality of images;
Detecting means for detecting a straight line composed of pixels corresponding to the same subject included in the two-dimensional image generated by the generating means;
Have a, specifying means for specifying a focus state of the same object at the time of shooting the images from the slope of the detected straight line by the detection means,
The predetermined direction, the image processing apparatus according to claim Rukoto determined according to the distribution of the high frequency component in at least one of an image of the image group.
前記所定の方向は、前記画像群の少なくともいずれかの画像における高周波成分の分布に応じて決定されることを特徴とする請求項に記載の画像処理装置。 The image processing apparatus according to claim 2 , wherein the predetermined direction is determined according to a distribution of high-frequency components in at least one image of the image group. 前記所定の方向は、前記画像群の少なくともいずれかの画像に現れる直線成分のうち、その数が最も多い方向と直交する方向に決定されることを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。   The predetermined direction is determined in a direction orthogonal to a direction having the largest number of linear components appearing in at least one of the images in the image group. The image processing apparatus according to item. 前記検出手段は、前記2次元像に対して前記複数の画素列の方向に現れる所定レベル以上の輝度差を示す画素を抽出し、該画素に基づいて直線を検出することを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。   The said detection means extracts the pixel which shows the brightness | luminance difference more than the predetermined level which appears in the direction of the said several pixel row | line | column with respect to the said two-dimensional image, and detects a straight line based on this pixel. The image processing apparatus according to any one of 1 to 5. 前記検出手段は、前記2次元像のハフ変換により直線を検出することを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the detection unit detects a straight line by a Hough transform of the two-dimensional image. 画像処理装置の取得手段が、撮影して得られた画像群から、所定の方向に視差を有する関係にある複数の画像を取得する取得工程と、
前記画像処理装置の抽出手段が、前記取得工程において取得された前記複数の画像の各々から、前記所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出工程と、
前記画像処理装置の生成手段が、前記抽出工程において抽出された複数の前記画素列を、前記複数の画像の各々を撮影した、前記所定の方向における位置関係に応じて配置した2次元像を生成する生成工程と、
前記画像処理装置の検出手段が、前記生成工程において生成された前記2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出工程と、
前記画像処理装置の特定手段が、前記検出工程において検出された直線の傾きから前記同一の被写体の被写体距離を特定する特定工程と、を有し、
前記所定の方向は、前記画像群の少なくともいずれかの画像における高周波成分の分布に応じて決定され
ことを特徴とする画像処理装置の制御方法。
An acquisition step in which an acquisition unit of the image processing apparatus acquires a plurality of images having a parallax in a predetermined direction from an image group obtained by photographing;
An extraction step in which the extraction unit of the image processing apparatus extracts a pixel row extending in the predetermined direction and capturing a corresponding spatial position from each of the plurality of images acquired in the acquisition step. When,
The generation unit of the image processing apparatus generates a two-dimensional image in which the plurality of pixel columns extracted in the extraction step are arranged according to the positional relationship in the predetermined direction, in which each of the plurality of images is captured. Generating process to
A detecting step in which the detecting means of the image processing apparatus detects a straight line constituted by pixels corresponding to the same subject included in the two-dimensional image generated in the generating step;
Specifying means of the image processing apparatus, have a, a specifying step of specifying an object distance of the same subject from the slope of the detected straight lines in the detection step,
The predetermined direction is determined according to the distribution of the high frequency component in at least one of an image of the image group control method for an image processing apparatus according to claim Rukoto.
撮影して得られた、所定の方向に視差を有する関係にある複数の画像から、所定の被写体に合焦した画像を生成して出力する画像処理装置であって、
前記画像処理装置の取得手段が、画像群から前記複数の画像を取得する取得工程と、
前記画像処理装置の抽出手段が、前記取得工程において取得された前記複数の画像の各々から、前記所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出工程と、
前記画像処理装置の生成手段が、前記抽出工程において抽出された複数の前記画素列を、前記複数の画像の各々を撮影した、前記所定の方向における位置関係に応じて配置した2次元像を生成する生成工程と、
前記画像処理装置の検出手段が、前記生成工程において生成された前記2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出工程と、
前記画像処理装置の出力手段が、前記検出工程において検出された直線の傾きに応じて、前記複数の画像の位置を前記所定の方向に移動させて、前記同一の被写体に合焦した画像を生成して出力する出力工程と、を有する
ことを特徴とする画像処理装置の制御方法。
An image processing apparatus that generates and outputs an image focused on a predetermined subject from a plurality of images having a parallax in a predetermined direction obtained by photographing,
An acquisition step in which the acquisition unit of the image processing apparatus acquires the plurality of images from an image group;
An extraction step in which the extraction unit of the image processing apparatus extracts a pixel row extending in the predetermined direction and capturing a corresponding spatial position from each of the plurality of images acquired in the acquisition step. When,
The generation unit of the image processing apparatus generates a two-dimensional image in which the plurality of pixel columns extracted in the extraction step are arranged according to the positional relationship in the predetermined direction, in which each of the plurality of images is captured. Generating process to
A detecting step in which the detecting means of the image processing apparatus detects a straight line constituted by pixels corresponding to the same subject included in the two-dimensional image generated in the generating step;
The output unit of the image processing device generates an image focused on the same subject by moving the positions of the plurality of images in the predetermined direction according to the inclination of the straight line detected in the detection step. And an output process for outputting the image processing apparatus.
画像処理装置の抽出手段が、瞳分割された光束にそれぞれ対応する画像群から、所定の方向に視差を有する関係にある複数の画像を取得する取得工程と、
前記画像処理装置の抽出手段が、前記取得工程において取得された前記複数の画像の各々から、前記所定の方向に延びる画素列であって、対応する空間位置を撮影した画素列を抽出する抽出工程と、
前記画像処理装置の生成手段が、前記抽出工程において抽出された複数の前記画素列を、前記複数の画像の各々に対応する光束の瞳領域における位置関係に応じて連結した2次元像を生成する生成工程と、
前記画像処理装置の検出手段が、前記生成工程において生成された前記2次元像に含まれる、同一の被写体に対応する画素によって構成される直線を検出する検出工程と、
前記画像処理装置の特定手段が、前記検出工程において検出された直線の傾きから前記画像群を撮影した際の前記同一の被写体の焦点状態を特定する特定工程と、を有し、
前記所定の方向は、前記画像群の少なくともいずれかの画像における高周波成分の分布に応じて決定され
ことを特徴とする画像処理装置の制御方法。
An obtaining step in which an extraction unit of the image processing apparatus obtains a plurality of images having a parallax in a predetermined direction from an image group corresponding to each of the pupil-divided light beams;
An extraction step in which the extraction unit of the image processing apparatus extracts a pixel row extending in the predetermined direction and capturing a corresponding spatial position from each of the plurality of images acquired in the acquisition step. When,
The generation unit of the image processing apparatus generates a two-dimensional image obtained by connecting the plurality of pixel columns extracted in the extraction step according to a positional relationship in a pupil region of a light beam corresponding to each of the plurality of images. Generation process;
A detecting step in which the detecting means of the image processing apparatus detects a straight line constituted by pixels corresponding to the same subject included in the two-dimensional image generated in the generating step;
Specifying means of the image processing apparatus, have a, a specifying step of specifying a focus state of the same object at the time of shooting the images from the slope of the detected straight lines in the detection step,
The predetermined direction is determined according to the distribution of the high frequency component in at least one of an image of the image group control method for an image processing apparatus according to claim Rukoto.
コンピュータを、請求項1乃至7のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1 thru | or 7.
JP2013264500A 2013-12-20 2013-12-20 Image processing apparatus, control method, and program Expired - Fee Related JP6245974B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013264500A JP6245974B2 (en) 2013-12-20 2013-12-20 Image processing apparatus, control method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013264500A JP6245974B2 (en) 2013-12-20 2013-12-20 Image processing apparatus, control method, and program

Publications (2)

Publication Number Publication Date
JP2015122588A JP2015122588A (en) 2015-07-02
JP6245974B2 true JP6245974B2 (en) 2017-12-13

Family

ID=53533879

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013264500A Expired - Fee Related JP6245974B2 (en) 2013-12-20 2013-12-20 Image processing apparatus, control method, and program

Country Status (1)

Country Link
JP (1) JP6245974B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05141930A (en) * 1991-11-19 1993-06-08 Nippon Telegr & Teleph Corp <Ntt> Three-dimensional shape measuring device
JP5170276B2 (en) * 2011-03-31 2013-03-27 カシオ計算機株式会社 Image reconstruction device, image reconstruction method, and image reconstruction program
JP6016567B2 (en) * 2012-10-05 2016-10-26 キヤノン株式会社 Correlation calculation device, imaging device, correlation calculation method, program, and storage medium

Also Published As

Publication number Publication date
JP2015122588A (en) 2015-07-02

Similar Documents

Publication Publication Date Title
JP6548367B2 (en) Image processing apparatus, imaging apparatus, image processing method and program
JP6159097B2 (en) Image processing apparatus, imaging apparatus, control method, and program
KR20130083853A (en) Image processing apparatus, image sensing apparatus, control method, and recording medium
JP5766077B2 (en) Image processing apparatus and image processing method for noise reduction
US8937662B2 (en) Image processing device, image processing method, and program
JP6095266B2 (en) Image processing apparatus and control method thereof
US10148862B2 (en) Image capturing apparatus, method for controlling image capturing apparatus focus area display, and storage medium
WO2017130522A1 (en) Image processing device, image capturing device, image processing method and program
JP2016001853A (en) Image processing system, imaging device, control method, and program
US11277569B2 (en) Measurement apparatus, image capturing apparatus, control method, and recording medium
JP6190119B2 (en) Image processing apparatus, imaging apparatus, control method, and program
JP2019083580A (en) Image processing apparatus, image processing method, and program
JP5743769B2 (en) Image processing apparatus and image processing method
JP6245974B2 (en) Image processing apparatus, control method, and program
JP7373297B2 (en) Image processing device, image processing method and program
JP6502640B2 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, PROGRAM, AND RECORDING MEDIUM
JP2015122669A (en) Image processing system, control method of the same, and program
US10334161B2 (en) Image processing apparatus, image processing method, computer program and imaging apparatus
JP2016099322A (en) Imaging device, control method of imaging device, and program
JP6566800B2 (en) Imaging apparatus and imaging method
JP6016567B2 (en) Correlation calculation device, imaging device, correlation calculation method, program, and storage medium
JP6478536B2 (en) Image processing apparatus and imaging apparatus, and control method and program thereof
JP6106026B2 (en) Image processing apparatus, imaging apparatus, playback apparatus, control method, and program
US20150365599A1 (en) Information processing apparatus, image capturing apparatus, and control method
JP7346021B2 (en) Image processing device, image processing method, imaging device, program and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170809

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171003

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171114

R151 Written notification of patent or utility model registration

Ref document number: 6245974

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees