JP2015099337A - Focusing direction detector, imaging device, focusing direction detection processing program - Google Patents

Focusing direction detector, imaging device, focusing direction detection processing program Download PDF

Info

Publication number
JP2015099337A
JP2015099337A JP2013240300A JP2013240300A JP2015099337A JP 2015099337 A JP2015099337 A JP 2015099337A JP 2013240300 A JP2013240300 A JP 2013240300A JP 2013240300 A JP2013240300 A JP 2013240300A JP 2015099337 A JP2015099337 A JP 2015099337A
Authority
JP
Japan
Prior art keywords
pixel
pixel position
image signal
image
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013240300A
Other languages
Japanese (ja)
Inventor
篤史 河合
Atsushi Kawai
篤史 河合
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 JP2013240300A priority Critical patent/JP2015099337A/en
Publication of JP2015099337A publication Critical patent/JP2015099337A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To easily, highly accurately detect a direction of driving an optical system to a focused position of the optical system if an axial chromatic aberration is present.SOLUTION: A focusing direction detector includes: imaging means generating an image including a first image signal relating to a first color component and a second image signal relating to a second color component; correction means correcting at least one of the first image signal and the second image signal so that a first pixel value of the first image signal generally matches a second pixel value of the second image signal, and so that a first gradient of a signal waveform of the first image signal generally matches a second gradient of a signal waveform of the second image signal; and direction detection means detecting a direction of a focused position of an optical system on the basis of a magnitude relation between the first image signal and the second image signal after correction by the correction means.

Description

本発明は、合焦方向検出装置、撮像装置および合焦方向検出処理プログラムに関する。   The present invention relates to a focus direction detection device, an imaging device, and a focus direction detection processing program.

画像中のエッジ部分において、軸上色収差の存在に起因して色成分間で算出されるボケ幅の差が、合焦の前後で変化することを利用して焦点位置を検出し、オートフォーカス時に移動するべき方向を決定する技術が開示されている(例えば、特許文献1参照)。   At the edge part in the image, the focal position is detected by using the fact that the difference in blur width calculated between the color components due to the presence of axial chromatic aberration changes before and after focusing. A technique for determining a direction to move is disclosed (for example, see Patent Document 1).

特開2012−22286号公報JP2012-22286A

特許文献1に開示された発明によれば、2つのサブフラット領域間のエッジ領域に複数のエッジが含まれていると、焦点検出位置の検出誤差が生じる場合がある。   According to the invention disclosed in Patent Document 1, if a plurality of edges are included in the edge region between two sub-flat regions, a detection error of the focus detection position may occur.

(1)請求項1に記載の合焦方向検出装置は、被写体の色を構成する第1の色成分に関する第1の画像信号と、被写体の色を構成し、かつ第1の色成分とは異なる第2の色成分に関する第2の画像信号とを含む画像を生成する撮像手段と、第1の画像信号を構成する第1の複数の画素値のうちの、画像中の第1の画素位置における第1の画素値と、第2の画像信号を構成する第2の複数の画素値のうちの、第1の画素位置に対応する画像中の第2の画素位置における第2の画素値とをほぼ一致させるとともに、第1の画像信号の信号波形の第1の画素位置における第1の勾配と、第2の画像信号の信号波形の第2の画素位置における第2の勾配とをほぼ一致させるように、第1の画像信号および第2の画像信号のうちの少なくとも一方を補正する補正手段と、補正手段による補正後の第1の画像信号および第2の画像信号の大小関係に基づき、光学系の合焦位置の方向を検出する方向検出手段と、を備えることを特徴とする。
(2)請求項13に記載の合焦方向検出処理プログラムは、被写体の色を構成する第1の色成分に関する第1の画像信号と、被写体の色を構成し、かつ第1の色成分とは異なる第2の色成分に関する第2の画像信号とを含む画像を生成する撮像処理と、第1の画像信号を構成する第1の複数の画素値のうちの、画像中の第1の画素位置における第1の画素値と、第2の画像信号を構成する第2の複数の画素値のうちの、第1の画素位置に対応する画像中の第2の画素位置における第2の画素値とをほぼ一致させるとともに、第1の画像信号の信号波形の第1の画素位置における第1の勾配と、第2の画像信号の信号波形の第2の画素位置における第2の勾配とをほぼ一致させるように、第1の画像信号および第2の画像信号のうちの少なくとも一方を補正する補正処理と、補正処理による補正後の第1の画像信号および第2の画像信号の大小関係に基づき、光学系の合焦位置の方向を検出する方向検出処理と、をコンピュータに実行させることを特徴とする。
(1) The in-focus direction detecting device according to claim 1 is a first image signal related to the first color component constituting the color of the subject, the color of the subject, and the first color component. An imaging means for generating an image including a second image signal relating to a different second color component, and a first pixel position in the image among a plurality of first pixel values constituting the first image signal And the second pixel value at the second pixel position in the image corresponding to the first pixel position among the plurality of second pixel values constituting the second image signal And the first gradient at the first pixel position of the signal waveform of the first image signal substantially coincides with the second gradient at the second pixel position of the signal waveform of the second image signal. To correct at least one of the first image signal and the second image signal And a direction detecting means for detecting the direction of the in-focus position of the optical system based on the magnitude relationship between the first image signal and the second image signal corrected by the correcting means. To do.
(2) According to a thirteenth aspect of the present invention, there is provided a focusing direction detection processing program comprising: a first image signal related to a first color component constituting a color of a subject; a color of the subject; Is a first pixel in the image out of an imaging process for generating an image including a second image signal relating to a different second color component, and a first plurality of pixel values constituting the first image signal Of the first pixel value at the position and the second plurality of pixel values constituting the second image signal, the second pixel value at the second pixel position in the image corresponding to the first pixel position And the first gradient at the first pixel position of the signal waveform of the first image signal and the second gradient at the second pixel position of the signal waveform of the second image signal are substantially equal to each other. At least one of the first image signal and the second image signal to match. A correction process for correcting one and a direction detection process for detecting the direction of the in-focus position of the optical system based on the magnitude relationship between the first image signal and the second image signal corrected by the correction process. It is made to perform.

軸上色収差のある場合において、光学系の合焦位置へ光学系を駆動する方向を簡便かつ高精度に検出することができるため、高速な合焦調整が可能となる。   In the case where there is axial chromatic aberration, the direction in which the optical system is driven to the in-focus position of the optical system can be detected easily and with high accuracy, so that high-speed focus adjustment is possible.

一実施の形態における合焦方向検出装置を有する撮像装置のブロック構成図である。It is a block block diagram of the imaging device which has a focusing direction detection apparatus in one embodiment. 合焦方向検出処理のフローチャートである。It is a flowchart of a focusing direction detection process. 補間画像を構成する水平方向および垂直方向に二次元配列に従って配置された画素の一部を表す図である。It is a figure showing a part of pixel arrange | positioned according to a two-dimensional arrangement | sequence in the horizontal direction and the vertical direction which comprise an interpolation image. 後ピン状態における緑色成分および赤色成分に関する画像信号の信号波形を表す図である。It is a figure showing the signal waveform of the image signal regarding the green component in a back pin state, and a red component. 前ピン状態における緑色成分および赤色成分に関する画像信号の信号波形を表す図である。It is a figure showing the signal waveform of the image signal regarding the green component in a front pin state, and a red component. RAW画像を構成するベイヤー配列に従って配置された画素にエッジの輪郭が形成されている様子を表す図である。It is a figure showing a mode that the outline of the edge is formed in the pixel arrange | positioned according to the Bayer arrangement | sequence which comprises a RAW image. 本発明による合焦方向検出装置が合焦方向検出処理を実行するためのコンピュータプログラム製品の提供形態を示す図である。It is a figure which shows the provision form of the computer program product for the focusing direction detection apparatus by this invention for performing a focusing direction detection process.

図1は、本発明の一実施の形態における合焦方向検出装置105を有する撮像装置100のブロック構成図である。撮像装置100は、合焦方向検出装置105とともに、駆動装置140および駆動装置140によって駆動される光学系150を有する。合焦方向検出装置105は、制御装置110および撮像素子120を有する。撮像素子120には、被写体80から到来する被写体光85が、光学系150を透過して入射する。撮像素子120は、被写体80の色を構成する緑色成分(G成分)に関する緑色画像信号(G画像信号)と、被写体80の色を構成する赤色成分(R成分)に関する赤色画像信号(R画像信号)と、被写体80の色を構成する青色成分(B成分)に関する青色画像信号(B画像信号)とを含むRAW画像を生成し、出力する。   FIG. 1 is a block configuration diagram of an imaging apparatus 100 having an in-focus direction detection apparatus 105 according to an embodiment of the present invention. The imaging apparatus 100 includes a driving device 140 and an optical system 150 driven by the driving device 140 together with the focusing direction detection device 105. The in-focus direction detection device 105 includes a control device 110 and an image sensor 120. Subject light 85 coming from the subject 80 enters the image sensor 120 through the optical system 150. The image sensor 120 has a green image signal (G image signal) related to a green component (G component) constituting the color of the subject 80 and a red image signal (R image signal) related to a red component (R component) constituting the color of the subject 80. ) And a blue image signal (B image signal) relating to the blue component (B component) constituting the color of the subject 80 is generated and output.

制御装置110は、合焦方向検出処理プログラムを実行するコンピュータである。制御装置110は、撮像制御部111、ISO感度決定部112、ホワイトバランス補正部113、補間画像生成部114、合焦方向検出用画像信号決定部115、画像信号補正部116、前ピン/後ピン判定指標値算出部117および合焦方向検出部118を機能的に有する。撮像制御部111、ISO感度決定部112、ホワイトバランス補正部113、補間画像生成部114、合焦方向検出用画像信号決定部115、画像信号補正部116、前ピン/後ピン判定指標値算出部117および合焦方向検出部118は、図2を用いて後述する合焦方向検出処理の各ステップを行う。   The control device 110 is a computer that executes a focusing direction detection processing program. The control device 110 includes an imaging control unit 111, an ISO sensitivity determination unit 112, a white balance correction unit 113, an interpolated image generation unit 114, an in-focus direction detection image signal determination unit 115, an image signal correction unit 116, a front pin / rear pin. The determination index value calculation unit 117 and the focusing direction detection unit 118 are functionally provided. Imaging control unit 111, ISO sensitivity determination unit 112, white balance correction unit 113, interpolation image generation unit 114, focus direction detection image signal determination unit 115, image signal correction unit 116, front pin / rear pin determination index value calculation unit 117 and the focus direction detection unit 118 perform each step of the focus direction detection process, which will be described later with reference to FIG.

本実施の形態における合焦方向検出装置105を有する撮像装置100では、RGB各色成分の内R成分およびG成分に軸上色収差がある。被写体光85のうちのR成分に対応する光が、被写体光85のうちのG成分に対応する光よりも後方に結像する場合、すなわち光学系150から離れた位置で被写体80の被写体像を結像する場合に、後述するようにRAW画像に基づいて生成される補間画像において水平方向に画素値が変化するエッジから、軸上色収差による光学系150の合焦位置の方向判定を行う例を示す。なお、本明細書において、「画素」は、撮像装置100の撮像面に配置された光電変換素子ではなく、画像を構成する最小単位を意味するものとする。この場合、光学系150の焦点状態が撮像面に対して後ピン状態であれば、撮像面ではR成分に対応する被写体光によって形成されるR面像がG成分に対応する被写体光によって形成されるG面像よりもボケる。光学系150の焦点状態が撮像面に対して前ピン状態であればG面像がR面像よりもボケる。合焦方向検出装置105に含まれる制御装置110によって行われる合焦方向検出処理のフローチャートを図2に示す。   In imaging apparatus 100 having focusing direction detection apparatus 105 in the present embodiment, R component and G component of RGB color components have axial chromatic aberration. When the light corresponding to the R component of the subject light 85 forms an image behind the light corresponding to the G component of the subject light 85, that is, the subject image of the subject 80 at a position away from the optical system 150. In the case of forming an image, an example in which the direction determination of the in-focus position of the optical system 150 due to axial chromatic aberration is performed from an edge whose pixel value changes in the horizontal direction in an interpolated image generated based on a RAW image as will be described later. Show. Note that in this specification, “pixel” means not the photoelectric conversion element arranged on the imaging surface of the imaging apparatus 100 but the smallest unit constituting an image. In this case, if the focus state of the optical system 150 is a back-pin state with respect to the imaging surface, an R plane image formed by subject light corresponding to the R component is formed by subject light corresponding to the G component on the imaging surface. More blurry than the G-plane image. If the focus state of the optical system 150 is the front pin state with respect to the imaging surface, the G plane image is more blurred than the R plane image. A flowchart of the focus direction detection process performed by the control device 110 included in the focus direction detection device 105 is shown in FIG.

ステップS210で、制御装置110の撮像制御部111は、撮像素子120からRAW画像を取得し、制御装置110のISO感度決定部112がISO感度を決定する。ISO感度決定部112によって決定されたISO感度で、撮像素子120はRAW画像を生成する。撮像制御部111は、撮像素子120からRAW画像を取得する。制御装置110のホワイトバランス補正部113は、撮像制御部111によって取得されたRAW画像の画像信号に対してホワイトバランス補正を行う。制御装置110の補間画像生成部114は、ホワイトバランス補正部113によって補正されたRAW画像の画像信号に対する補間処理を行って、2次元的な全画素位置にG画素値、R画素値およびB画素値が対応付けられた補間画像を生成する。補間画像における複数のG画素値、複数のR画素値および複数のB画素値が、それぞれG画像信号、R画像信号およびB画像信号を構成する。制御装置110の合焦方向検出用画像信号決定部115は、補間画像の3種類の画像信号、すなわちR画像信号、G画像信号およびB画像信号のうちの2種類の合焦方向検出用画像信号を決定する。この例では、R成分およびG成分に軸上色収差があるため、合焦方向検出用画像信号決定部115は、2種類の合焦方向検出用画像信号として、R画像信号およびG画像信号を決定する。   In step S210, the imaging control unit 111 of the control device 110 acquires a RAW image from the imaging device 120, and the ISO sensitivity determination unit 112 of the control device 110 determines the ISO sensitivity. With the ISO sensitivity determined by the ISO sensitivity determination unit 112, the image sensor 120 generates a RAW image. The imaging control unit 111 acquires a RAW image from the imaging element 120. The white balance correction unit 113 of the control device 110 performs white balance correction on the image signal of the RAW image acquired by the imaging control unit 111. The interpolated image generation unit 114 of the control device 110 performs an interpolating process on the image signal of the RAW image corrected by the white balance correction unit 113, and the G pixel value, the R pixel value, and the B pixel at all two-dimensional pixel positions. An interpolated image in which values are associated is generated. A plurality of G pixel values, a plurality of R pixel values, and a plurality of B pixel values in the interpolated image constitute a G image signal, an R image signal, and a B image signal, respectively. The focus direction detection image signal determination unit 115 of the control device 110 includes three types of interpolated image signals, that is, two types of focus direction detection image signals of the R image signal, the G image signal, and the B image signal. To decide. In this example, since the R component and the G component have axial chromatic aberration, the focus direction detection image signal determination unit 115 determines the R image signal and the G image signal as two types of focus direction detection image signals. To do.

ステップS220で、制御装置110の前ピン/後ピン判定指標値算出部117は、補間画像における注目画素位置の初期座標値を設定する。後述するように、後続のステップで、制御装置110の前ピン/後ピン判定指標値算出部117は、補間画像中の注目画素位置において、合焦方向検出用画像信号決定部115によって2種類の合焦方向検出用画像信号として決定されたR画像信号およびG画像信号の水平方向の勾配、二次勾配ならびに右側の画素値の和および左側の画素値の和を算出する。ステップS220では、前ピン/後ピン判定指標値算出部117は、後述するステップS250におけるそれらの算出に必要なマージンを確保して補間画像中の注目画素位置の初期座標値を設定する。例えば、補間画像中の注目画素位置における勾配および二次勾配を水平方向の隣接画素から算出し、右側のN画素の画素値の和および左側のN画素の画素値の和を算出する場合、水平方向にN+1画素、垂直方向には0画素のマージンがそれぞれ必要となり、注目画素位置の初期座標値は(N+1,0)となる。ステップS220では、前ピン/後ピン判定指標値算出部117は、後述する前ピン判定用カウンタN_FRONTおよび後ピン判定用カウンタN_REARを初期化してN_REAR=0、N_FRONT=0とする。   In step S220, the front pin / rear pin determination index value calculation unit 117 of the control device 110 sets an initial coordinate value of the target pixel position in the interpolation image. As will be described later, in the subsequent steps, the front pin / rear pin determination index value calculation unit 117 of the control device 110 performs two types of focusing direction detection image signal determination unit 115 at the target pixel position in the interpolation image. The sum of the horizontal gradient, the secondary gradient, the right pixel value, and the left pixel value of the R image signal and G image signal determined as the focus direction detection image signal is calculated. In step S220, the front pin / rear pin determination index value calculation unit 117 sets an initial coordinate value of the target pixel position in the interpolated image while ensuring a margin necessary for the calculation in step S250 described later. For example, when calculating the gradient and secondary gradient at the target pixel position in the interpolated image from adjacent pixels in the horizontal direction and calculating the sum of the pixel values of the right N pixels and the left N pixels, A margin of N + 1 pixels in the direction and 0 pixel in the vertical direction are required, and the initial coordinate value of the target pixel position is (N + 1, 0). In step S220, the front pin / rear pin determination index value calculation unit 117 initializes a later-described front pin determination counter N_FRONT and a rear pin determination counter N_REAR so that N_REAR = 0 and N_FRONT = 0.

ステップS230で、制御装置110の前ピン/後ピン判定指標値算出部117は、補間画像における現在の注目画素位置で2色のR画像信号およびG画像信号の信号波形の水平方向の勾配dxRおよびdxG、ならびに水平方向の二次勾配dxRおよびdxGを算出する。本実施の形態では、勾配dxRおよびdxGを水平方向に隣接する画素の画素値差分をとる差分フィルタにより算出し、二次勾配を水平方向に隣接する画素を用いたラプラシアンフィルタにより算出する。図3は、補間画像を構成する水平方向(x方向)および垂直方向(y方向)に二次元配列に従って配置された画素の一部を表す図である。補間画像中の現在の注目画素位置(x,y)において画素値R(x,y)および画素値G(x,y)を用いると、現在の注目画素位置(x,y)における勾配dxRおよびdxG、ならびに二次勾配dxRおよびdxGは、以下の式(1)で表される。画素値R(x−1,y)、R(x,y)およびR(x+1,y)はR画像信号に含まれる。画素値G(x−1,y)、G(x,y)およびG(x+1,y)はG画像信号に含まれる。

Figure 2015099337
In step S230, the front pin / rear pin determination index value calculation unit 117 of the control device 110 performs the horizontal gradients dxR of the signal waveforms of the two colors of the R image signal and the G image signal at the current target pixel position in the interpolation image, and dxG and the horizontal quadratic gradients d 2 xR and d 2 xG are calculated. In the present embodiment, the gradients dxR and dxG are calculated by a difference filter that takes a pixel value difference between pixels adjacent in the horizontal direction, and the secondary gradient is calculated by a Laplacian filter using pixels adjacent in the horizontal direction. FIG. 3 is a diagram illustrating a part of pixels arranged according to a two-dimensional array in the horizontal direction (x direction) and the vertical direction (y direction) constituting the interpolation image. Using the pixel value R (x, y) and the pixel value G (x, y) at the current target pixel position (x, y) in the interpolated image, the gradient dxR at the current target pixel position (x, y) and dxG and quadratic gradients d 2 xR and d 2 xG are represented by the following formula (1). Pixel values R (x-1, y), R (x, y), and R (x + 1, y) are included in the R image signal. Pixel values G (x-1, y), G (x, y), and G (x + 1, y) are included in the G image signal.
Figure 2015099337

i≧2として、画素位置(x−i,y)および(x+i,y)は、注目画素位置(x,y)の近傍で注目画素位置(x,y)を挟む。注目画素位置(x,y)の画素位置(x−i,y)側、すなわち左側から、画素位置(x+i,y)側、すなわち右側へ向かって、R画像信号を構成する画素値が大きくなる傾向を示すとき、勾配dxRは正の勾配であり、R画像信号を構成する画素値が小さくなる傾向を示すとき、勾配dxRは負の勾配である。式(1)に示すように、注目画素位置(x,y)における勾配dxRは、例えば、注目画素位置(x,y)と画素位置(x+i,y)との間の画素位置(x+1,y)における画素値R(x+1,y)と、注目画素位置(x,y)と画素位置(x−i,y)との間の画素位置(x−1,y)における画素値R(x−1,y)との差である。   As i ≧ 2, pixel positions (x−i, y) and (x + i, y) sandwich the target pixel position (x, y) in the vicinity of the target pixel position (x, y). From the pixel position (x−i, y) side of the target pixel position (x, y), that is, the left side, the pixel value constituting the R image signal increases from the pixel position (x + i, y) side, that is, the right side. When indicating a tendency, the gradient dxR is a positive gradient, and when indicating a tendency that the pixel values constituting the R image signal become smaller, the gradient dxR is a negative gradient. As shown in Expression (1), the gradient dxR at the target pixel position (x, y) is, for example, a pixel position (x + 1, y) between the target pixel position (x, y) and the pixel position (x + i, y). ) And a pixel value R (x−y) at a pixel position (x−1, y) between the target pixel position (x, y) and the pixel position (xi, y). 1, y).

補間画像中の注目画素位置(x,y)の画素位置(x−i,y)側、すなわち左側から、画素位置(x+i,y)側、すなわち右側へ向かって、G画像信号を構成する画素値が大きくなる傾向を示すとき、勾配dxGは正の勾配であり、G画像信号を構成する画素値が小さくなる傾向を示すとき、勾配dxGは負の勾配である。式(1)に示すように、注目画素位置(x,y)における勾配dxGは、例えば、注目画素位置(x,y)と画素位置(x+i,y)との間の画素位置(x+1,y)における画素値G(x+1,y)と、注目画素位置(x,y)と画素位置(x−i,y)との間の画素位置(x−1,y)における画素値G(x−1,y)との差である。   Pixels constituting the G image signal from the pixel position (x−i, y) side of the target pixel position (x, y) in the interpolated image, that is, from the left side toward the pixel position (x + i, y) side, that is, the right side. The gradient dxG is a positive gradient when the value tends to increase, and the gradient dxG is a negative gradient when the pixel value constituting the G image signal tends to decrease. As shown in Expression (1), the gradient dxG at the target pixel position (x, y) is, for example, the pixel position (x + 1, y) between the target pixel position (x, y) and the pixel position (x + i, y). ) And the pixel value G (x−y) at the pixel position (x−1, y) between the target pixel position (x, y) and the pixel position (xi, y). 1, y).

式(1)に示すように、二次勾配dxRは、画素値R(x,y)と画素値R(x−1,y)との差から、画素値R(x+1,y)と画素値R(x,y)との差を差し引いた値である。二次勾配dxGは、画素値G(x,y)と画素値G(x−1,y)との差から、画素値G(x+1,y)と画素値G(x,y)との差を差し引いた値である。 As shown in the equation (1), the quadratic gradient d 2 xR is calculated from the difference between the pixel value R (x, y) and the pixel value R (x−1, y) and the pixel value R (x + 1, y). This is a value obtained by subtracting the difference from the pixel value R (x, y). From the difference between the pixel value G (x, y) and the pixel value G (x−1, y), the quadratic gradient d 2 xG is calculated using the pixel value G (x + 1, y) and the pixel value G (x, y). This is the value obtained by subtracting the difference.

ステップS240で、前ピン/後ピン判定指標値算出部117は、補間画像中の注目画素位置(x,y)における2色の画素値R(x,y)およびG(x,y)、勾配dxRおよびdxG、ならびに二次勾配dxRおよびdxGが、以下の条件(a)、(b)および(c)を満たすか否かを判定する。以下の3つの条件のいずれかを満たさない注目画素位置(x,y)における後述する前ピン/後ピン判定は、後述する合焦位置の方向検出精度を悪化させるため、使用されない。 In step S240, the front pin / rear pin determination index value calculator 117 calculates the pixel values R (x, y) and G (x, y) of two colors at the target pixel position (x, y) in the interpolated image, and the gradient. It is determined whether dxR and dxG and quadratic gradients d 2 xR and d 2 xG satisfy the following conditions (a), (b), and (c). The front / rear pin determination described later at the target pixel position (x, y) that does not satisfy any of the following three conditions is not used because it deteriorates the accuracy of detecting the direction of the focus position described later.

(a)ノイズの影響を受けて精度が悪化するため、2色の画素値R(x,y)およびG(x,y)がいずれも所定の画素値TH_VALUE以上の値であること。画素値が小さいと、ノイズの影響が大きいため、合焦位置の方向検出精度を悪化させやすい。 (A) Since the accuracy deteriorates due to the influence of noise, the two-color pixel values R (x, y) and G (x, y) are both greater than or equal to the predetermined pixel value TH_VALUE. If the pixel value is small, the influence of noise is large, and the accuracy of detecting the direction of the in-focus position is likely to deteriorate.

(b)補間画像中の注目画素位置(x,y)における2色の勾配dxRおよびdxGが所定の勾配値TH_GRAD以上の値であること。例えば画像平坦領域のように、勾配dxRおよびdxGが小さい場合には、合焦位置前後(前ピンおよび後ピン)における軸上色収差によるR画像信号の勾配とG画像信号の勾配との関係の変化が小さいため、合焦位置の方向検出精度を悪化させやすい。 (B) The gradients dxR and dxG of the two colors at the target pixel position (x, y) in the interpolated image are greater than or equal to a predetermined gradient value TH_GRAD. For example, when the gradients dxR and dxG are small as in an image flat region, the change in the relationship between the gradient of the R image signal and the gradient of the G image signal due to axial chromatic aberration before and after the in-focus position (front pin and rear pin) Therefore, it is easy to deteriorate the direction detection accuracy of the in-focus position.

(c)補間画像中の注目画素位置(x,y)における2色の二次勾配dxRおよびdxGがほぼ0であること。例えば、二次勾配dxRおよびdxGが、ともに所定の二次勾配値TH_GRAD2以下であればよい。補間画像中の注目画素位置(x,y)が、画像平坦領域とエッジ領域との境界(エッジ領域の端)や、2つの異なるエッジ領域の境界に位置する場合は、後述する前ピン/後ピン判定指標値が正しく算出されない。 (C) The secondary gradients d 2 xR and d 2 xG of the two colors at the target pixel position (x, y) in the interpolation image are substantially zero. For example, the secondary gradients d 2 xR and d 2 xG may both be equal to or smaller than a predetermined secondary gradient value TH_GRAD2. When the target pixel position (x, y) in the interpolated image is located at the boundary between the image flat area and the edge area (edge of the edge area) or at the boundary between two different edge areas, the front pin / rear to be described later The pin determination index value is not calculated correctly.

上述した条件(a)、(b)および(c)は、以下の式(2)で表される。補間画像中の注目画素位置(x,y)における画素値R(x,y)およびG(x,y)、勾配dxRおよびdxG、ならびに二次勾配dxRおよびdxGが、条件(a)、(b)および(c)、すなわち式(2)を満たすと判定されたとき、本合焦方向検出処理はステップS250へ進む。補間画像中の注目画素位置(x,y)における画素値R(x,y)およびG(x,y)、勾配dxRおよびdxG、ならびに二次勾配dxRおよびdxGが、条件(a)、(b)および(c)、すなわち式(2)を満たさないと判定されたとき、本合焦方向検出処理はステップS270へ進む。

Figure 2015099337
The conditions (a), (b) and (c) described above are expressed by the following formula (2). Pixel values R (x, y) and G (x, y) at the target pixel position (x, y) in the interpolated image, gradients dxR and dxG, and secondary gradients d 2 xR and d 2 xG are determined according to the condition (a ), (B) and (c), that is, when it is determined that the expression (2) is satisfied, the focus direction detection process proceeds to step S250. Pixel values R (x, y) and G (x, y) at the target pixel position (x, y) in the interpolated image, gradients dxR and dxG, and secondary gradients d 2 xR and d 2 xG are determined according to the condition (a ), (B) and (c), that is, when it is determined that the expression (2) is not satisfied, the focus direction detection process proceeds to step S270.
Figure 2015099337

ステップS250において、制御装置110の画像信号補正部116は、ステップS210で合焦方向検出用画像信号決定部115によって決定されたR画像信号およびG画像信号のうちのG画像信号を補正する。具体的には、補間画像中の注目画素位置(x,y)における画素値G(x,y)を画素値R(x,y)にほぼ一致させるとともに、補間画像中の注目画素位置(x,y)における勾配dxGを勾配dxRにほぼ一致させる。注目画素位置(x,y)における補正後の画素値G’(x,y)および補正後の勾配dxG’は、係数aおよび切片bを用いて以下の式(3)で表される。

Figure 2015099337
In step S250, the image signal correction unit 116 of the control device 110 corrects the G image signal of the R image signal and the G image signal determined by the focus direction detection image signal determination unit 115 in step S210. Specifically, the pixel value G (x, y) at the target pixel position (x, y) in the interpolation image is substantially matched with the pixel value R (x, y), and the target pixel position (x in the interpolation image) , Y) approximately matches the gradient dxG with the gradient dxR. The corrected pixel value G ′ (x, y) and the corrected gradient dxG ′ at the target pixel position (x, y) are expressed by the following equation (3) using the coefficient a and the intercept b.
Figure 2015099337

なお、上述したように、注目画素位置(x,y)における補正後の画素値G’(x,y)は画素値R(x,y)にほぼ一致し、注目画素位置(x,y)における補正後の勾配dxG’は勾配dxRにほぼ一致する。注目画素位置(x,y)における画素値G’(x,y)および画素値R(x,y)、ならびに勾配dxG’および勾配dxRが、それぞれ完全に一致する場合は、以下の式(4)のように表される。式(4)を係数aおよび切片bについて解くと、式(5)が得られる。注目画素位置(x,y)における画素値G’(x,y)および画素値R(x,y)、ならびに勾配dxG’および勾配dxRが、それぞれ完全に一致せずに僅かな所定量分だけ異なっていてもよい。例えば、注目画素位置(x,y)またはその周辺の画素位置においてノイズや濃度ムラ等が生じる場合を考慮して、そうしたノイズや濃度ムラ等によって統計的に生じ得ることが予め想定される画素値の変動分を、上記所定量とする。

Figure 2015099337
Figure 2015099337
As described above, the corrected pixel value G ′ (x, y) at the target pixel position (x, y) substantially matches the pixel value R (x, y), and the target pixel position (x, y). The corrected gradient dxG ′ in FIG. 2 substantially matches the gradient dxR. When the pixel value G ′ (x, y) and the pixel value R (x, y), and the gradient dxG ′ and the gradient dxR at the target pixel position (x, y) completely coincide with each other, the following formula (4 ). When equation (4) is solved for coefficient a and intercept b, equation (5) is obtained. The pixel value G ′ (x, y) and the pixel value R (x, y) at the target pixel position (x, y), and the gradient dxG ′ and the gradient dxR do not completely coincide with each other, but only by a small predetermined amount. May be different. For example, in consideration of the case where noise, density unevenness, or the like occurs at the target pixel position (x, y) or the surrounding pixel position, a pixel value that is presumed to be statistically possible due to such noise, density unevenness, or the like. Is the predetermined amount.
Figure 2015099337
Figure 2015099337

図4および図5は、それぞれ後ピン状態および前ピン状態における緑色成分および赤色成分に関する画像信号の信号波形を表す図である。図4(a)および図5(a)においては、R成分に関するR画像信号の信号波形が実線で、補正前のG成分に関するG画像信号の信号波形が破線で、それぞれ示されている。図4(b)および図5(b)においては、R成分に関するR画像信号の信号波形が実線で、補正後のG成分に関するG画像信号の信号波形が破線で、それぞれ示されている。   4 and 5 are diagrams showing signal waveforms of image signals relating to the green component and the red component in the rear pin state and the front pin state, respectively. In FIG. 4A and FIG. 5A, the signal waveform of the R image signal related to the R component is shown by a solid line, and the signal waveform of the G image signal related to the G component before correction is shown by a broken line. In FIG. 4B and FIG. 5B, the signal waveform of the R image signal related to the R component is shown by a solid line, and the signal waveform of the G image signal related to the corrected G component is shown by a broken line.

上述したように、注目画素位置(x,y)における補正後の画素値G’(x,y)は画素値R(x,y)にほぼ一致し、注目画素位置(x,y)における補正後の勾配dxG’は勾配dxRにほぼ一致している様子が、図4(b)および図5(b)に表されている。図4(b)および図5(b)によれば、補正後のG’画像信号とR画像信号との大小関係が、後ピン状態であるか、前ピン状態であるかに応じて定まっている。具体的には、後ピン状態のとき、図4(b)に示すように、注目画素位置(x,y)の左側から右側へ向かって画素値G’および画素値Rがともに右上がりに大きくなるとき、注目画素位置(x,y)の左側の画素位置の画素値G’(x−i,y)が画素値R(x−i,y)よりも大きく、注目画素位置(x,y)の右側の画素位置の画素値G’(x+i,y)が画素値R(x+i,y)よりも小さい。したがって、左側の複数の画素値G’(x−i,y)の画素値和ΣG’(x−i,y)は、左側の複数の画素値R(x−i,y)の画素値和ΣR(x−i,y)よりも大きく、右側の複数の画素値G’(x+i,y)の画素値和ΣG’(x+i,y)は、右側の複数の画素値R(x+i,y)の画素値和ΣR(x+i,y)よりも小さい。   As described above, the corrected pixel value G ′ (x, y) at the target pixel position (x, y) substantially matches the pixel value R (x, y), and the correction at the target pixel position (x, y). A state in which the subsequent gradient dxG ′ substantially coincides with the gradient dxR is shown in FIGS. 4B and 5B. According to FIGS. 4B and 5B, the magnitude relationship between the corrected G ′ image signal and the R image signal is determined depending on whether the state is the rear pin state or the front pin state. Yes. Specifically, in the rear pin state, as shown in FIG. 4B, both the pixel value G ′ and the pixel value R increase from the left to the right of the target pixel position (x, y). The pixel value G ′ (x−i, y) at the pixel position on the left side of the target pixel position (x, y) is larger than the pixel value R (x−i, y), and the target pixel position (x, y) The pixel value G ′ (x + i, y) at the pixel position on the right side of) is smaller than the pixel value R (x + i, y). Accordingly, the pixel value sum ΣG ′ (xi, y) of the left pixel values G ′ (xi, y) is the sum of the left pixel values R (xi, y). A sum of pixel values ΣG ′ (x + i, y) of a plurality of pixel values G ′ (x + i, y) on the right side that is larger than ΣR (x−i, y) is a plurality of pixel values R (x + i, y) on the right side. Is smaller than the sum of pixel values ΣR (x + i, y).

後ピン状態のとき、図4(b)とは逆に、注目画素位置(x,y)の左側から右側へ向かって画素値G’および画素値Rがともに右下がりに小さくなるときは、注目画素位置(x,y)の左側の画素位置の画素値G’(x−i,y)が画素値R(x−i,y)よりも小さく、注目画素位置(x,y)の右側の画素位置の画素値G’(x+i,y)が画素値R(x+i,y)よりも大きい(不図示)。したがって、左側の複数の画素値G’(x−i,y)の画素値和ΣG’(x−i,y)は、左側の複数の画素値R(x−i,y)の画素値和ΣR(x−i,y)よりも小さく、右側の複数の画素値G’(x+i,y)の画素値和ΣG’(x+i,y)は、右側の複数の画素値R(x+i,y)の画素値和ΣR(x+i,y)よりも大きい。   In the rear pin state, contrary to FIG. 4B, when the pixel value G ′ and the pixel value R both decrease from the left side to the right side of the target pixel position (x, y), The pixel value G ′ (x−i, y) at the pixel position on the left side of the pixel position (x, y) is smaller than the pixel value R (x−i, y), and is on the right side of the target pixel position (x, y). The pixel value G ′ (x + i, y) at the pixel position is larger than the pixel value R (x + i, y) (not shown). Accordingly, the pixel value sum ΣG ′ (xi, y) of the left pixel values G ′ (xi, y) is the sum of the left pixel values R (xi, y). A sum of pixel values ΣG ′ (x + i, y) of a plurality of pixel values G ′ (x + i, y) on the right side that is smaller than ΣR (x−i, y) is a plurality of pixel values R (x + i, y) on the right side. Is greater than the sum of pixel values ΣR (x + i, y).

前ピン状態のとき、図5(b)に示すように、注目画素位置(x,y)の左側から右側へ向かって画素値G’および画素値Rがともに右上がりに大きくなるとき、注目画素位置(x,y)の左側の画素位置の画素値G’(x−i,y)が画素値R(x−i,y)よりも小さく、注目画素位置(x,y)の右側の画素位置の画素値G’(x+i,y)が画素値R(x+i,y)よりも大きい。したがって、左側の複数の画素値G’(x−i,y)の画素値和ΣG’(x−i,y)は、左側の複数の画素値R(x−i,y)の画素値和ΣR(x−i,y)よりも小さく、右側の複数の画素値G’(x+i,y)の画素値和ΣG’(x+i,y)は、右側の複数の画素値R(x+i,y)の画素値和ΣR(x+i,y)よりも大きい。   In the front pin state, as shown in FIG. 5B, when the pixel value G ′ and the pixel value R both increase from the left to the right of the target pixel position (x, y), The pixel value G ′ (x−i, y) at the pixel position on the left side of the position (x, y) is smaller than the pixel value R (x−i, y), and the pixel on the right side of the target pixel position (x, y). The pixel value G ′ (x + i, y) at the position is larger than the pixel value R (x + i, y). Accordingly, the pixel value sum ΣG ′ (xi, y) of the left pixel values G ′ (xi, y) is the sum of the left pixel values R (xi, y). A sum of pixel values ΣG ′ (x + i, y) of a plurality of pixel values G ′ (x + i, y) on the right side that is smaller than ΣR (x−i, y) is a plurality of pixel values R (x + i, y) on the right side. Is greater than the sum of pixel values ΣR (x + i, y).

前ピン状態のとき、図5(b)とは逆に、注目画素位置(x,y)の左側から右側へ向かって画素値G’および画素値Rがともに右下がりに小さくなるときは、注目画素位置(x,y)の左側の画素位置の画素値G’(x−i,y)が画素値R(x−i,y)よりも大きく、注目画素位置(x,y)の右側の画素位置の画素値G’(x+i,y)が画素値R(x+i,y)よりも小さい(不図示)。したがって、左側の複数の画素値G’(x−i,y)の画素値和ΣG’(x−i,y)は、左側の複数の画素値R(x−i,y)の画素値和ΣR(x−i,y)よりも大きく、右側の複数の画素値G’(x+i,y)の画素値和ΣG’(x+i,y)は、右側の複数の画素値R(x+i,y)の画素値和ΣR(x+i,y)よりも小さい。   In the front pin state, contrary to FIG. 5B, when both the pixel value G ′ and the pixel value R decrease downward from the left side to the right side of the target pixel position (x, y), The pixel value G ′ (x−i, y) at the pixel position on the left side of the pixel position (x, y) is larger than the pixel value R (x−i, y), and the pixel value on the right side of the target pixel position (x, y). The pixel value G ′ (x + i, y) at the pixel position is smaller than the pixel value R (x + i, y) (not shown). Accordingly, the pixel value sum ΣG ′ (xi, y) of the left pixel values G ′ (xi, y) is the sum of the left pixel values R (xi, y). A sum of pixel values ΣG ′ (x + i, y) of a plurality of pixel values G ′ (x + i, y) on the right side that is larger than ΣR (x−i, y) is a plurality of pixel values R (x + i, y) on the right side. Is smaller than the sum of pixel values ΣR (x + i, y).

ステップS250において、前ピン/後ピン判定指標値算出部117は、式(6)で表される前ピン/後ピン判定指標値IR−Gを算出する。式(6)において、注目画素位置(x,y)の左側のN画素の画素値R(x−N−1,y),R(x−N,y),・・・,R(x−2,y)の画素値和lsumR、注目画素位置(x,y)の右側のN画素の画素値R(x+2,y),R(x+3,y),・・・,R(x+N+1,y)の画素値和rsumR、注目画素位置(x,y)の左側のN画素の補正後の画素値G’(x−N−1,y),G’(x−N,y),・・・,G’(x−2,y)の画素値和lsumG’、注目画素位置(x,y)の右側のN画素の補正後の画素値G’(x+2,y),G’(x+3,y),・・・,G’(x+N+1,y)の画素値和rsumG’は、いずれも補間画像中で注目画素位置(x,y)が位置する水平方向の画素列に含まれる注目画素位置(x,y)近傍画素から計算される。定数Nの値は、例えば1〜4程度の整数値である。すなわち、前ピン/後ピン判定指標値算出部117は、G画像信号が補正されたG’画像信号およびR画像信号において、注目画素位置(x,y)左側の画素値G’(x−i,y)の画素値和ΣG’(x−i,y)および画素値R(x−i,y)の画素値和ΣR(x−i,y)の差と、注目画素位置(x,y)右側の画素値G’(x+i,y)の画素値和ΣG’(x+i,y)および画素値R(x+i,y)の画素値和ΣR(x+i,y)の差と基づいて、前ピン/後ピン判定指標値IR−Gを算出する。

Figure 2015099337
Figure 2015099337
In step S250, the front pin / rear pin determination index value calculation unit 117 calculates the front pin / rear pin determination index value I RG represented by the equation (6). In Expression (6), pixel values R (x−N−1, y), R (x−N, y),..., R (x−) of the N pixels on the left side of the target pixel position (x, y). 2, y) pixel value sum lsumR, pixel values R (x + 2, y), R (x + 3, y),..., R (x + N + 1, y) on the right side of the target pixel position (x, y) Pixel value sum rsumR, corrected pixel values G ′ (x−N−1, y), G ′ (x−N, y), N ′ on the left side of the target pixel position (x, y),. , G ′ (x−2, y) pixel value sum lsumG ′, corrected pixel values G ′ (x + 2, y), G ′ (x + 3, y) of N pixels on the right side of the target pixel position (x, y) ),..., G ′ (x + N + 1, y) pixel value sums rsumG ′ are all pixel-of-interest positions (including pixel-of-interest positions (x, y)) included in the horizontal pixel row in the interpolated image. x, y) neighborhood It is calculated from the original. The value of the constant N is an integer value of about 1 to 4, for example. That is, the front pin / rear pin determination index value calculation unit 117 has a pixel value G ′ (xi) on the left side of the target pixel position (x, y) in the G ′ image signal and the R image signal in which the G image signal is corrected. , Y), the difference between the pixel value sum ΣG ′ (xi, y) and the pixel value sum ΣR (xi, y) of the pixel value R (xi, y), and the target pixel position (x, y ) Based on the difference between the pixel value sum ΣG ′ (x + i, y) of the right pixel value G ′ (x + i, y) and the pixel value sum ΣR (x + i, y) of the pixel value R (x + i, y), the front pin / The rear pin determination index value I RG is calculated.
Figure 2015099337
Figure 2015099337

ステップS260で、前ピン/後ピン判定指標値算出部117は、勾配dxG’=dxRと、前ピン/後ピン判定指標値IR−Gとの積に基づいて、前ピン判定用カウンタN_FRONTまたは後ピン判定用カウンタN_REARを更新する。勾配dxG’=dxRと前ピン/後ピン判定指標値IR−Gとの積が、正の値をとるとき、あるいは例えば上側閾値TH_I1より大きいとき、上述した後ピン状態にあると判定され、後ピン判定用カウンタN_REARが1だけインクリメントされる。勾配dxG’=dxRと前ピン/後ピン判定指標値IR−Gとの積が、負の値をとるとき、あるいは例えば下側閾値TH_I2より小さいとき、上述した前ピン状態にあると判定され、前ピン判定用カウンタN_FRONTが1だけインクリメントされる。上側閾値TH_I1および下側閾値TH_I2はいずれも0に近い値であるが、前ピン/後ピン判定指標値IR−Gは、撮像面が光学系150の合焦位置に位置する場合のみならず、撮像面が光学系150の合焦位置から遠く離れ過ぎている場合にも0に近い値を示す。撮像面が光学系150の合焦位置から遠く離れ過ぎている場合における前ピン/後ピン判定指標値IR−Gを予め測定した上で、その測定値を考慮して上側閾値TH_I1および下側閾値TH_I2を定めることによって、光学系150の合焦位置の方向の誤検出を防止することができる。 In step S260, the front pin / rear pin determination index value calculation unit 117 determines whether the front pin determination counter N_FRONT or the front pin / rear pin determination index value I R−G is based on the product of the gradient dxG ′ = dxR and the front pin / rear pin determination index value IRG. The rear pin determination counter N_REAR is updated. When the product of the gradient dxG ′ = dxR and the front pin / rear pin determination index value IR −G takes a positive value or is larger than, for example, the upper threshold value TH_I1, it is determined that the rear pin state described above is present, The rear pin determination counter N_REAR is incremented by one. When the product of the gradient dxG ′ = dxR and the front pin / rear pin determination index value IR −G takes a negative value or is smaller than, for example, the lower threshold TH_I2, it is determined that the front pin state described above is present. The front pin determination counter N_FRONT is incremented by 1. Although upper threshold TH_I1 and lower threshold TH_I2 is a value close to 0 both the front pin / rear focus determination index value I R-G is not only when the image pickup surface is positioned at the focus position of the optical system 150 When the imaging surface is too far from the in-focus position of the optical system 150, a value close to 0 is shown. On the imaging surface is measured in advance before the pin / post pin determination index value I R-G in the case where too far away from the in-focus position of the optical system 150, the upper threshold TH_I1 and lower in consideration of the measured values By defining the threshold value TH_I2, erroneous detection of the direction of the in-focus position of the optical system 150 can be prevented.

ステップS270で、前ピン/後ピン判定指標値算出部117は、上述したマージンを考慮しても、補間画像中における現在の注目画素位置の右側の画素位置に注目画素位置をシフトすることが可能な場合は、注目画素位置をその右側の画素位置にシフトする。この場合、ステップS270における処理は肯定判定され、本合焦方向検出処理は、ステップS230に戻り、シフトした画素位置で上述したステップS230以降の処理が繰り返される。補間画像中における現在の注目画素位置の右側の画素位置に注目画素位置をシフトすることが不可能な場合は、補間画像中における現在の注目画素位置の下側において、上述したマージンを考慮して最も左端のシフト可能な画素位置に、注目画素位置をシフトする。この場合、ステップS270における処理は肯定判定され、本合焦方向検出処理は、ステップS230に戻り、シフトした画素位置で上述したステップS230以降の処理が繰り返される。補間画像中における現在の注目画素位置の下側に注目画素位置をシフトすることが不可能な場合は、ステップS270における処理は否定判定され、本合焦方向検出処理は、ステップS280に進む。   In step S270, the front pin / rear pin determination index value calculation unit 117 can shift the target pixel position to the pixel position on the right side of the current target pixel position in the interpolation image even in consideration of the margin described above. In this case, the target pixel position is shifted to the right pixel position. In this case, an affirmative determination is made in step S270, and the focus direction detection processing returns to step S230, and the processing from step S230 described above is repeated at the shifted pixel position. If it is impossible to shift the target pixel position to the pixel position to the right of the current target pixel position in the interpolated image, the above margin is taken into consideration below the current target pixel position in the interpolated image. The target pixel position is shifted to the leftmost shiftable pixel position. In this case, an affirmative determination is made in step S270, and the focus direction detection processing returns to step S230, and the processing from step S230 described above is repeated at the shifted pixel position. If it is impossible to shift the target pixel position to the lower side of the current target pixel position in the interpolated image, a negative determination is made in step S270, and the focus direction detection process proceeds to step S280.

ステップS280で、制御装置110の合焦方向検出部118は、前ピン判定用カウンタN_FRONTおよび後ピン判定用カウンタN_REARのカウンタ値に基づき、光学系150の合焦位置の方向を検出する。具体的には、後ピン判定用カウンタN_REARのカウンタ値が前ピン判定用カウンタN_FRONTのカウンタ値よりも大きい場合、後ピンと判定される。合焦方向検出部118は、光学系150の合焦位置の方向は光学系150を撮像素子120の像面から離れる方向であることを検出する。後ピン判定用カウンタN_REARのカウンタ値が前ピン判定用カウンタN_FRONTのカウンタ値よりも小さい場合、前ピンと判定される。合焦方向検出部118は、光学系150の合焦位置の方向は光学系150が撮像素子120の像面へ近づく方向であることを検出する。   In step S280, the focus direction detection unit 118 of the control device 110 detects the direction of the focus position of the optical system 150 based on the counter values of the front pin determination counter N_FRONT and the rear pin determination counter N_REAR. Specifically, when the counter value of the rear pin determination counter N_REAR is larger than the counter value of the front pin determination counter N_FRONT, it is determined as the rear pin. The in-focus direction detection unit 118 detects that the in-focus position of the optical system 150 is away from the image plane of the image sensor 120. When the counter value of the rear pin determination counter N_REAR is smaller than the counter value of the front pin determination counter N_FRONT, it is determined as the front pin. The in-focus direction detection unit 118 detects that the in-focus position direction of the optical system 150 is a direction in which the optical system 150 approaches the image plane of the image sensor 120.

ステップS290で、合焦方向検出部118は、駆動装置140がステップS280で検出された合焦位置の方向に光学系150を駆動するよう、駆動装置140を制御する。その後、本合焦方向検出処理は終了する。   In step S290, the focus direction detection unit 118 controls the drive device 140 so that the drive device 140 drives the optical system 150 in the direction of the focus position detected in step S280. Thereafter, the in-focus direction detection process ends.

本実施の形態における合焦方向検出装置105においては、軸上色収差のある場合において、光学系150の合焦位置へ光学系150を駆動する方向を簡便かつ高精度に検出することができるため、高速な合焦調整が可能となる。また、注目画素位置毎に前ピン/後ピン判定をフィルタ処理としてハード実装することが可能となる。   In the in-focus direction detection apparatus 105 according to the present embodiment, in the case of axial chromatic aberration, the direction in which the optical system 150 is driven to the in-focus position of the optical system 150 can be detected easily and with high accuracy. High-speed focus adjustment is possible. In addition, it is possible to implement the front pin / rear pin determination as a filtering process by hardware for each target pixel position.

−−−変形例−−−
(1)上述した一実施の形態では勾配算出を水平方向隣接画素差分フィルタ、二次勾配を水平方向隣接画素ラプラシアンフィルタにより算出したが、Sobelフィルタのように上下ラインの画素を使用しても良い。例えば上下1ラインずつ使用して、以下の式(8)のようになる。Sobelフィルタを用いる場合、ステップS220では、補間画像における注目画素位置の初期座標値(N+1,1)が設定される。この処理にすることで、3ライン分のバッファ領域が必要となるが、ノイズに対して強い判定を行うことができる。

Figure 2015099337
---- Modified example ---
(1) In the above-described embodiment, the gradient calculation is calculated by the horizontal direction adjacent pixel difference filter, and the secondary gradient is calculated by the horizontal direction adjacent pixel Laplacian filter. However, pixels in the upper and lower lines may be used as in the Sobel filter. . For example, using the upper and lower lines one by one, the following equation (8) is obtained. When the Sobel filter is used, in step S220, initial coordinate values (N + 1, 1) of the target pixel position in the interpolation image are set. With this processing, a buffer area for three lines is required, but a strong determination against noise can be made.
Figure 2015099337

(2)上述した一実施の形態では被写体光85のうちのR成分とG成分との間に軸上色収差があり、被写体光85のうちのR成分に対応する光が、被写体光85のうちのG成分に対応する光よりも後方に結像する場合に、2色のR画像信号およびG画像信号を用いて判定を行う例を示した。G成分とB成分との間や、R成分とB成分との間に軸上色収差がある場合において、同様にしても良い。G成分とB成分との間に軸上色収差があり、被写体光85のうちのB成分に対応する光が、被写体光85のうちのG成分に対応する光よりも後方に結像する場合の前ピン/後ピン判定指標値IB−G、R成分とB成分との間に軸上色収差があり、被写体光85のうちのB成分に対応する光が、被写体光85のうちのR成分に対応する光よりも後方に結像する場合の指標値IB−Rは、それぞれ下式(9)および(10)で表される。その他の軸上色収差についても同様である。

Figure 2015099337
Figure 2015099337
(2) In the above-described embodiment, axial chromatic aberration is present between the R component and the G component in the subject light 85, and the light corresponding to the R component in the subject light 85 is included in the subject light 85. In the case where an image is formed behind the light corresponding to the G component, an example is shown in which determination is performed using the R image signal and the G image signal of two colors. The same may be applied when there is axial chromatic aberration between the G component and the B component or between the R component and the B component. There is an axial chromatic aberration between the G component and the B component, and the light corresponding to the B component of the subject light 85 forms an image behind the light corresponding to the G component of the subject light 85. Front pin / rear pin determination index value I B−G , there is axial chromatic aberration between the R component and the B component, and the light corresponding to the B component of the subject light 85 is the R component of the subject light 85 The index value IB -R when the image is formed behind the light corresponding to is represented by the following expressions (9) and (10), respectively. The same applies to other axial chromatic aberrations.
Figure 2015099337
Figure 2015099337

例えば、R成分およびG成分のいずれかにコントラスト差が無い被写体輪郭では、他の色成分の組合せを使用することで判定性能が向上する。   For example, in a subject outline having no contrast difference in either the R component or the G component, the determination performance is improved by using a combination of other color components.

光学系150として、一般にズームレンズの場合、ズーム位置に応じて軸上色収差バランスは変動する。したがって、レンズの光学設計値、または予め測定した軸上色収差に基づいて、ズーム位置に応じて上記前ピン/後ピン判定指標値IR−G,IB−G,IB−R等のいずれを使用するか、決定する必要がある。そのためには、上述したステップS210において、制御装置110の合焦方向検出用画像信号決定部115が、補間画像を構成する3種類の画像信号であるR画像信号、G画像信号およびB画像信号のうちの2種類の合焦方向検出用画像信号を決定する際に、ズーム位置を考慮することとすればよい。このようにして決定された2種類の合焦方向検出用画像信号がR画像信号およびG画像信号であれば、制御装置110の前ピン/後ピン判定指標値算出部117によって前ピン/後ピン判定指標値IR−Gが算出される。決定された2種類の合焦方向検出用画像信号がB画像信号およびG画像信号であれば、制御装置110の前ピン/後ピン判定指標値算出部117によって前ピン/後ピン判定指標値IB−Gが算出される。決定された2種類の合焦方向検出用画像信号がB画像信号およびR画像信号であれば、制御装置110の前ピン/後ピン判定指標値算出部117によって前ピン/後ピン判定指標値IB−Rが算出される。 In general, in the case of a zoom lens as the optical system 150, the axial chromatic aberration balance varies depending on the zoom position. Therefore, based on the optical design value of the lens or the axial chromatic aberration measured in advance, any one of the front pin / rear pin determination index values I RG , I BG , I B-R, etc. depending on the zoom position. Need to decide whether to use. For this purpose, in step S210 described above, the focus direction detection image signal determination unit 115 of the control device 110 performs the R image signal, the G image signal, and the B image signal, which are three types of image signals constituting the interpolation image. The zoom position may be taken into consideration when determining two types of focus direction detection image signals. If the two types of in-focus direction detection image signals thus determined are the R image signal and the G image signal, the front pin / rear pin determination index value calculation unit 117 of the control device 110 performs the front pin / rear pin. Determination index value I RG is calculated. If the two types of determined focus direction detection image signals are the B image signal and the G image signal, the front pin / rear pin determination index value calculation unit 117 of the control device 110 performs the front pin / rear pin determination index value I. B-G is calculated. If the two types of determined focus direction detection image signals are the B image signal and the R image signal, the front pin / rear pin determination index value calculation unit 117 of the control device 110 performs the front pin / rear pin determination index value I. B-R is calculated.

また、軸上色収差がある色成分の組み合わせが複数通りある場合、被写体の色、撮像素子120による撮像時のISO感度、またはホワイトバランスを考慮して、よりS/Nの高い色成分の組み合わせを選択して、本合焦方向検出処理を行うようにしても良い。このとき、例えば、前ピン/後ピン判定指標値IR−G,IB−G,IB−Rを、重み付けした上で、すべて本合焦方向検出処理に用いることとしてもよい。 Further, when there are a plurality of combinations of color components having axial chromatic aberration, a combination of color components having a higher S / N is selected in consideration of the subject color, ISO sensitivity at the time of imaging by the image sensor 120, or white balance. It may be selected to perform the in-focus direction detection process. At this time, for example, the front pin / rear pin determination index values I RG , I B-G , and I B-R may all be used for the in-focus direction detection process after being weighted.

(3)上述した一実施の形態では水平方向エッジから軸上色収差により合焦方向を検出する例を示した。さらに垂直方向エッジからも同様に軸上色収差により合焦方向を検出してもよい。この場合の前ピン/後ピン判定指標値JR−Gは、下記に示すような、補間画像中の注目画素位置(x,y)における垂直方向のR成分の勾配dyRと、垂直方向のR成分の上側画素値和usumRおよび下側画素値和dsumRと、同様にして計算される補間画像中の注目画素位置(x,y)における垂直方向のG成分の勾配dyGと、垂直方向のG成分の上側画素値和usumGおよび下側画素値和dsumGとを用いて次式(11)により算出すればよい。前ピン/後ピン判定指標値IR−Gと、前ピン/後ピン判定指標値JR−Gとをそれぞれ用いて算出された前ピン判定用カウンタN_FRONTのいずれか一方のカウンタ値、および前ピン/後ピン判定指標値IR−Gと、前ピン/後ピン判定指標値JR−Gとをそれぞれ用いて算出された後ピン判定用カウンタN_REARのいずれか一方のカウンタ値に基づいて光学系150の合焦位置の方向が検出されることとしてもよい。あるいは、前ピン/後ピン判定指標値IR−Gと、前ピン/後ピン判定指標値JR−Gとをそれぞれ用いて算出された前ピン判定用カウンタN_FRONTのカウンタ合算値、および前ピン/後ピン判定指標値IR−Gと、前ピン/後ピン判定指標値JR−Gとをそれぞれ用いて算出された後ピン判定用カウンタN_REARのカウンタ合算値に基づいて光学系150の合焦位置の方向が検出されることとしてもよい。

Figure 2015099337
(3) In the above-described embodiment, the example in which the in-focus direction is detected from the horizontal edge by the longitudinal chromatic aberration is shown. Further, the in-focus direction may also be detected from the vertical edge by axial chromatic aberration. Front focus / rear focus determination index value J R-G in this case, as shown below, and slope dyR vertical R component in the target pixel position in the interpolated image (x, y), in the vertical direction R The upper pixel value sum usumR and the lower pixel value sum dsumR of the components, the gradient dyG of the vertical G component at the target pixel position (x, y) in the interpolation image calculated in the same manner, and the vertical G component The upper pixel value sum usumG and the lower pixel value sum dsumG may be calculated by the following equation (11). A front pin / rear focus determination index value I R-G, front focus / rear focus determination index value J previous R-G and a were calculated using the respective pin determining counter one of the counter values of N_FRONT, and before Optically based on one counter value of the rear pin determination counter N_REAR calculated using the pin / rear pin determination index value I RG and the front pin / rear pin determination index value J RG respectively. The direction of the in-focus position of the system 150 may be detected. Alternatively, front focus / rear focus determination index value I and R-G, front focus / rear focus determination index value J R-G before the calculated with each pin determining counter counter sum of N_FRONT, and the front focus / Rear pin determination index value I RG and the rear pin determination counter value N RG calculated using the front pin / rear pin determination index value J RG respectively. The direction of the focal position may be detected.
Figure 2015099337

(4)上述した一実施の形態では、ステップS250において、制御装置110の画像信号補正部116は、ステップS210で合焦方向検出用画像信号決定部115によって決定されたR画像信号およびG画像信号のうちのG画像信号を補正する。しかし、画像信号補正部116は、R画像信号を補正することによって、補間画像中の注目画素位置(x,y)における画素値R(x,y)を画素値G(x,y)にほぼ一致させるとともに、補間画像中の注目画素位置(x,y)における勾配dxRを勾配dxGにほぼ一致させることとしてもよい。あるいは、R画像信号およびG画像信号をともに補正して、補間画像中の注目画素位置(x,y)における画素値G(x,y)および画素値R(x,y)を所定の画素値にほぼ一致させるとともに、補間画像中の注目画素位置(x,y)における勾配dxGおよび勾配dxRを所定の勾配値にほぼ一致させることとしてもよい。 (4) In the above-described embodiment, in step S250, the image signal correction unit 116 of the control device 110 determines the R image signal and the G image signal determined by the focus direction detection image signal determination unit 115 in step S210. The G image signal is corrected. However, the image signal correction unit 116 corrects the R image signal so that the pixel value R (x, y) at the target pixel position (x, y) in the interpolated image is substantially equal to the pixel value G (x, y). In addition, the gradient dxR at the target pixel position (x, y) in the interpolation image may be substantially matched with the gradient dxG. Alternatively, both the R image signal and the G image signal are corrected, and the pixel value G (x, y) and the pixel value R (x, y) at the target pixel position (x, y) in the interpolation image are set to predetermined pixel values. The gradient dxG and the gradient dxR at the target pixel position (x, y) in the interpolation image may be substantially matched with a predetermined gradient value.

(5)上述した一実施の形態では一枚画像に対して判定結果を出力する構成で説明したが、一枚画像のうちの焦点検出エリアに対応する範囲に対して本発明を適用し、その焦点検出エリア内での後ピン判定用カウンタN_REARのカウンタ値と、前ピン判定用カウンタN_FRONTのカウンタ値とに基づいて、光学系150の合焦位置の方向が検出されることとしても良い。 (5) In the above-described embodiment, the configuration in which the determination result is output for one image has been described. However, the present invention is applied to a range corresponding to the focus detection area in one image, and The direction of the in-focus position of the optical system 150 may be detected based on the counter value of the rear pin determination counter N_REAR and the counter value of the front pin determination counter N_FRONT within the focus detection area.

(6)上述した一実施の形態では一枚画像に対して判定結果を出力する構成で説明したが、撮像素子120から所定間隔毎に生成されて出力される複数のフレーム画像またはそれらの補間画像を対象として、後ピン判定用カウンタN_REARのカウンタ積算値と、前ピン判定用カウンタN_FRONTのカウンタ積算値とに基づいて、すなわち画像1枚毎に各カウンタ値を初期化せずに積算した積算値に基づいて、光学系150の合焦位置の方向が検出されることとしても良い。 (6) In the above-described embodiment, the configuration in which the determination result is output for one image has been described. However, a plurality of frame images generated and output from the image sensor 120 at predetermined intervals or their interpolated images. , Based on the counter integrated value of the rear pin determination counter N_REAR and the counter integrated value of the front pin determination counter N_FRONT, that is, the integrated value obtained by integrating each counter value for each image without initialization. The direction of the in-focus position of the optical system 150 may be detected based on the above.

(7)上述した一実施の形態では補間済みのRGB補間画像を対象として説明したが、補間前のRAW画像を対象としても良い。この場合、補間前のRAW画像から直接的に、勾配と、RAW画像中の注目画素位置の左右両側における画素値和を計算することで処理負荷を軽減することができる。例えばベイヤー配列のRAW画像に対して、R成分およびG成分間に軸上色収差がある場合に、水平方向エッジから合焦方向を検出するためには、式(12)を用いて前ピン/後ピン判定指標値IR−Gを算出すればよい。ベイヤー配列RAW画像中の第1の注目画素位置(x,y)における画素値P(x,y)がR成分を有する場合、そのすぐ下の第2の注目画素位置(x,y+1)における画素値P(x,y)はG成分を有する。そこで、第1の注目画素位置(x,y)をR成分を有する画素位置を選んでシフトしながら、式(12)による演算が行われる。

Figure 2015099337
(7) In the above-described embodiment, the interpolated RGB interpolation image has been described as an object. However, a raw image before interpolation may be an object. In this case, the processing load can be reduced by calculating the gradient and the sum of pixel values on both the left and right sides of the target pixel position in the RAW image directly from the RAW image before interpolation. For example, when there is axial chromatic aberration between the R component and the G component for a RAW image in the Bayer array, the front pin / rear position can be detected using Expression (12) in order to detect the in-focus direction from the horizontal edge. The pin determination index value I RG may be calculated. When the pixel value P (x, y) at the first target pixel position (x, y) in the Bayer array RAW image has an R component, the pixel at the second target pixel position (x, y + 1) immediately below it The value P (x, y) has a G component. Therefore, the calculation according to Expression (12) is performed while shifting the first target pixel position (x, y) by selecting a pixel position having an R component.
Figure 2015099337

図6は、RAW画像を構成するベイヤー配列に従って2次元的に配置された画素にエッジの輪郭が形成されている様子を表す図である。図6に示すように、RAW画像における第1の注目画素位置(x,y)および第2の注目画素位置(x,y+1)にエッジ輪郭位置が含まれていれば、本発明を適用することによって、第1の注目画素位置(x,y)および第2の注目画素位置(x,y+1)において、後ピン判定用カウンタN_REARおよび前ピン判定用カウンタN_FRONTが更新され、光学系150の合焦位置の方向を検出することができる。   FIG. 6 is a diagram illustrating a state in which an edge outline is formed on pixels that are two-dimensionally arranged according to a Bayer array that configures a RAW image. As shown in FIG. 6, the present invention is applied if the edge contour position is included in the first target pixel position (x, y) and the second target pixel position (x, y + 1) in the RAW image. Accordingly, the rear pin determination counter N_REAR and the front pin determination counter N_FRONT are updated at the first target pixel position (x, y) and the second target pixel position (x, y + 1), and the optical system 150 is focused. The direction of the position can be detected.

式(12)において、画素値和lsumRは、例えば、図6に示すRAW画像における第1の注目画素位置(x,y)の左側のN画素の画素値R(x−2N−2,y),R(x−2N,y),・・・,R(x−6,y),R(x−4,y)の画素値和である。画素値和rsumRは、例えば、RAW画像における第1の注目画素位置(x,y)の右側のN画素の画素値R(x+4,y),R(x+6,y),・・・,R(x+2N,y),R(x+2N+2,y)の画素値和である。画素値和lsumG’は、例えば、RAW画像における第2の注目画素位置(x,y)の左側のN画素の画素値G(x−2N−2,y+1),G(x−2N,y+1),・・・,G(x−6,y+1),G(x−4,y+1)が制御装置110の画像信号補正部116によって補正された画素値の画素値和である。画素値和rsumG’は、例えば、RAW画像における第2の注目画素位置(x,y)の右側のN画素の画素値G(x+4,y+1),G(x+6,y+1),・・・,G(x+2N,y+1),G(x+2N+2,y+1)が制御装置110の画像信号補正部116によって補正された画素値の画素値和である。   In Expression (12), the pixel value sum lsumR is, for example, the pixel value R (x−2N−2, y) of the N pixel on the left side of the first target pixel position (x, y) in the RAW image illustrated in FIG. 6. , R (x−2N, y),..., R (x−6, y), R (x−4, y). The pixel value sum rsumR is, for example, the pixel values R (x + 4, y), R (x + 6, y),..., R () of the N pixels on the right side of the first target pixel position (x, y) in the RAW image. x + 2N, y) and R (x + 2N + 2, y). The pixel value sum lsumG ′ is, for example, pixel values G (x−2N−2, y + 1) and G (x−2N, y + 1) of N pixels on the left side of the second target pixel position (x, y) in the RAW image. ,..., G (x−6, y + 1) and G (x−4, y + 1) are pixel value sums of pixel values corrected by the image signal correction unit 116 of the control device 110. The pixel value sum rsumG ′ is, for example, the pixel values G (x + 4, y + 1), G (x + 6, y + 1),..., G on the right side of the second target pixel position (x, y) in the RAW image. (X + 2N, y + 1) and G (x + 2N + 2, y + 1) are pixel value sums of pixel values corrected by the image signal correction unit 116 of the control device 110.

式(12)において、勾配dxRは、図6に示すように、RAW画像における第1の注目画素位置(x,y)と画素位置(x+4,y)との間の画素位置(x+2,y)における画素値R(x+2,y)と、RAW画像における第1の注目画素位置(x,y)と画素位置(x−4,y)との間の画素位置(x−2,y)における画素値R(x−2,y)との差である。勾配dxGは、図6に示すように、RAW画像における第2の注目画素位置(x,y+1)と画素位置(x+4,y+1)との間の画素位置(x+2,y+1)における画素値G(x+2,y+1)と、RAW画像における第2の注目画素位置(x,y+1)と画素位置(x−4,y+1)との間の画素位置(x−2,y+1)における画素値G(x−2,y+1)との差である。   In Expression (12), as shown in FIG. 6, the gradient dxR is a pixel position (x + 2, y) between the first target pixel position (x, y) and the pixel position (x + 4, y) in the RAW image. At the pixel position (x-2, y) between the pixel value R (x + 2, y) at the first pixel position (x, y) and the pixel position (x-4, y) in the RAW image. The difference from the value R (x−2, y). As shown in FIG. 6, the gradient dxG is a pixel value G (x + 2) at a pixel position (x + 2, y + 1) between the second target pixel position (x, y + 1) and the pixel position (x + 4, y + 1) in the RAW image. , Y + 1) and the pixel value G (x−2) at the pixel position (x−2, y + 1) between the second target pixel position (x, y + 1) and the pixel position (x−4, y + 1) in the RAW image. , Y + 1).

B成分およびG成分間に軸上色収差がある場合、またはB成分およびR成分間に軸上色収差がある場合においても、R成分およびG成分間に軸上色収差がある場合と同様にして、前ピン/後ピン判定指標値IB−GまたはIB−Rを算出すればよい。 Even when there is axial chromatic aberration between the B component and the G component, or when there is axial chromatic aberration between the B component and the R component, as in the case where there is axial chromatic aberration between the R component and the G component, The pin / rear pin determination index value IB -G or IB -R may be calculated.

(8)撮像装置100の制御装置110が上述の実施形態および変形例の各々における合焦方向検出処理を実行するためのコンピュータプログラム製品は、図7に示されるように、プログラム記憶媒体2000(例えばCD−ROM)や通信ネットワーク4000(例えばインターネット)によって伝達されるデータ信号を通じてデータ処理装置1500(例えばPC)に提供される。撮像装置100は、そのデータ処理装置1500から通信を介して合焦方向検出処理プログラムを読み込む。 (8) As shown in FIG. 7, a computer program product for the control device 110 of the imaging device 100 to execute the focus direction detection processing in each of the above-described embodiments and modifications is a program storage medium 2000 (for example, The data processing device 1500 (for example, a PC) is provided through a data signal transmitted through a CD-ROM) or a communication network 4000 (for example, the Internet). The imaging apparatus 100 reads a focusing direction detection processing program from the data processing apparatus 1500 via communication.

データ処理装置1500は、プログラム記憶媒体2000を介して合焦方向検出処理プログラムの提供を受ける。あるいは、以下の供給形態で合焦方向検出処理プログラムが提供されても良い。データ処理装置1500は通信ネットワーク4000との接続機能を有する。サーバー3000は合焦方向検出処理プログラムを提供するコンピュータであり、ハードディスクなどの記憶媒体に合焦方向検出処理プログラムを格納する。サーバー3000はハードディスクから読み出した合焦方向検出処理プログラムを、データ信号として搬送波に載せ、通信ネットワーク4000を介してデータ処理装置1500へ転送する。以上のように、合焦方向検出処理プログラムは、プログラム記憶媒体2000や通信ネットワーク4000を介するデータ信号としての提供を含む種々の形態のコンピュータプログラム製品によって供給されることが好ましい。   The data processing device 1500 is provided with a focusing direction detection processing program via the program storage medium 2000. Alternatively, the focus direction detection processing program may be provided in the following supply form. The data processing device 1500 has a connection function with the communication network 4000. The server 3000 is a computer that provides a focusing direction detection processing program, and stores the focusing direction detection processing program in a storage medium such as a hard disk. The server 3000 places the focusing direction detection processing program read from the hard disk on a carrier wave as a data signal, and transfers it to the data processing device 1500 via the communication network 4000. As described above, the focusing direction detection processing program is preferably supplied by various forms of computer program products including provision as data signals via the program storage medium 2000 and the communication network 4000.

上述した実施の形態および変形例は、それぞれ組み合わせてもよい。   The above-described embodiments and modifications may be combined.

80 被写体、85 被写体光、
100 撮像装置、105 合焦方向検出装置、110 制御装置、
111 撮像制御部、112 ISO感度決定部、113 ホワイトバランス補正部、
114 補間画像生成部、115 合焦方向検出用画像信号決定部、
116 画像信号補正部、117 前ピン/後ピン判定指標値算出部、
118 合焦方向検出部、120 撮像素子、140 駆動装置、150 光学系、
1500 データ処理装置、2000 プログラム記憶媒体、
3000 サーバー、4000 通信ネットワーク
80 subject, 85 subject light,
100 imaging device, 105 focusing direction detection device, 110 control device,
111 imaging control unit, 112 ISO sensitivity determination unit, 113 white balance correction unit,
114 interpolation image generation unit, 115 in-focus direction detection image signal determination unit,
116 image signal correction unit, 117 front pin / rear pin determination index value calculation unit,
118 in-focus direction detection unit, 120 imaging device, 140 driving device, 150 optical system,
1500 data processing device, 2000 program storage medium,
3000 servers, 4000 communication networks

Claims (13)

被写体の色を構成する第1の色成分に関する第1の画像信号と、前記被写体の色を構成し、かつ前記第1の色成分とは異なる第2の色成分に関する第2の画像信号とを含む画像を生成する撮像手段と、
前記第1の画像信号を構成する第1の複数の画素値のうちの、前記画像中の第1の画素位置における第1の画素値と、前記第2の画像信号を構成する第2の複数の画素値のうちの、前記第1の画素位置に対応する前記画像中の第2の画素位置における第2の画素値とをほぼ一致させるとともに、前記第1の画像信号の信号波形の前記第1の画素位置における第1の勾配と、前記第2の画像信号の信号波形の前記第2の画素位置における第2の勾配とをほぼ一致させるように、前記第1の画像信号および前記第2の画像信号のうちの少なくとも一方を補正する補正手段と、
前記補正手段による補正後の前記第1の画像信号および前記第2の画像信号の大小関係に基づき、光学系の合焦位置の方向を検出する方向検出手段と、を備えることを特徴とする合焦方向検出装置。
A first image signal relating to a first color component constituting the color of the subject, and a second image signal relating to a second color component constituting the color of the subject and different from the first color component. Imaging means for generating an image including:
Of the first plurality of pixel values constituting the first image signal, the first pixel value at the first pixel position in the image and the second plurality constituting the second image signal. Among the pixel values of the first image signal, the second pixel value at the second pixel position in the image corresponding to the first pixel position is substantially matched, and the signal waveform of the first image signal is The first image signal and the second image signal so that the first gradient at one pixel position and the second gradient at the second pixel position of the signal waveform of the second image signal substantially coincide with each other. Correcting means for correcting at least one of the image signals of
Direction detecting means for detecting the direction of the in-focus position of the optical system based on the magnitude relationship between the first image signal and the second image signal corrected by the correcting means. Focal direction detection device.
請求項1に記載の合焦方向検出装置において、
前記第1の複数の画素値は、前記第1の画素位置の近傍で前記第1の画素位置を挟む第3の画素位置および第4の画素位置のうちの、前記第3の画素位置における第3の画素値および前記第4の画素位置における第4の画素値を含み、
前記第2の複数の画素値は、前記第2の画素位置の近傍で前記第2の画素位置を挟む、前記第3の画素位置に対応する第5の画素位置および前記第4の画素位置に対応する第6の画素位置のうちの、前記第5の画素位置における第5の画素値および前記第6の画素位置における第6の画素値を含み、
前記被写体から到来して前記光学系を透過する被写体光のうちの前記第2の色成分に対応する光が、前記被写体光のうちの前記第1の色成分に対応する光よりも、前記光学系から離れた位置で前記被写体の被写体像を結像するとき、前記方向検出手段は、
前記第1の画素位置の前記第3の画素位置側から前記第4の画素位置側へ向かって画素値が大きくなるとともに、前記第2の画素位置の前記第5の画素位置側から前記第6の画素位置側へ向かって画素値が大きくなるときであって、前記第3の画素値が前記第5の画素値よりも大きく、かつ前記第4の画素値が前記第6の画素値よりも小さいとき、前記合焦位置の方向は前記光学系を前記撮像手段の像面から離れる方向であることを検出し、
前記第1の画素位置の前記第3の画素位置側から前記第4の画素位置側へ向かって画素値が小さくなるとともに、前記第2の画素位置の前記第5の画素位置側から前記第6の画素位置側へ向かって画素値が小さくなるときであって、前記第3の画素値が前記第5の画素値よりも小さく、かつ前記第4の画素値が前記第6の画素値よりも大きいとき、前記合焦位置の方向は前記光学系を前記撮像手段の像面から離れる方向であることを検出し、
前記第1の画素位置の前記第3の画素位置側から前記第4の画素位置側へ向かって画素値が大きくなるとともに、前記第2の画素位置の前記第5の画素位置側から前記第6の画素位置側へ向かって画素値が大きくなるときであって、前記第3の画素値が前記第5の画素値よりも小さく、かつ前記第4の画素値が前記第6の画素値よりも大きいとき、前記合焦位置の方向は前記光学系が前記撮像手段の像面へ近づく方向であることを検出し、
前記第1の画素位置の前記第3の画素位置側から前記第4の画素位置側へ向かって画素値が小さくなるとともに、前記第2の画素位置の前記第5の画素位置側から前記第6の画素位置側へ向かって画素値が小さくなるときであって、前記第3の画素値が前記第5の画素値よりも大きく、かつ前記第4の画素値が前記第6の画素値よりも小さいとき、前記合焦位置の方向は前記光学系を前記撮像手段の像面から離れる方向であることを検出し、前記合焦位置の方向は前記光学系が前記撮像手段の像面へ近づく方向であることを検出することを検出することを特徴とする合焦方向検出装置。
The in-focus direction detecting device according to claim 1,
The first plurality of pixel values are the first pixel value in the third pixel position among the third pixel position and the fourth pixel position sandwiching the first pixel position in the vicinity of the first pixel position. 3 pixel values and a fourth pixel value at the fourth pixel position,
The second plurality of pixel values are defined by a fifth pixel position corresponding to the third pixel position and a fourth pixel position sandwiching the second pixel position in the vicinity of the second pixel position. Of the corresponding sixth pixel positions, including a fifth pixel value at the fifth pixel position and a sixth pixel value at the sixth pixel position;
The light corresponding to the second color component of the subject light coming from the subject and passing through the optical system is more optical than the light corresponding to the first color component of the subject light. When forming the subject image of the subject at a position away from the system, the direction detection means
The pixel value increases from the third pixel position side of the first pixel position toward the fourth pixel position side, and from the fifth pixel position side of the second pixel position to the sixth pixel position side. The third pixel value is larger than the fifth pixel value, and the fourth pixel value is larger than the sixth pixel value. When small, it is detected that the direction of the in-focus position is a direction away from the image plane of the imaging unit of the optical system,
The pixel value decreases from the third pixel position side of the first pixel position toward the fourth pixel position side, and from the fifth pixel position side of the second pixel position to the sixth pixel position side. The third pixel value is smaller than the fifth pixel value, and the fourth pixel value is smaller than the sixth pixel value. When large, it detects that the direction of the in-focus position is a direction away from the image plane of the image pickup means, and
The pixel value increases from the third pixel position side of the first pixel position toward the fourth pixel position side, and from the fifth pixel position side of the second pixel position to the sixth pixel position side. The third pixel value is smaller than the fifth pixel value, and the fourth pixel value is larger than the sixth pixel value. When large, the direction of the in-focus position is detected to be a direction in which the optical system approaches the image plane of the imaging unit,
The pixel value decreases from the third pixel position side of the first pixel position toward the fourth pixel position side, and from the fifth pixel position side of the second pixel position to the sixth pixel position side. The third pixel value is greater than the fifth pixel value, and the fourth pixel value is greater than the sixth pixel value. When it is small, it is detected that the direction of the in-focus position is a direction away from the image plane of the image pickup means, and the in-focus position is a direction in which the optical system approaches the image plane of the image pickup means. An in-focus direction detecting device for detecting that it is.
請求項2に記載の合焦方向検出装置において、
前記第1の勾配は、前記第1の画素位置と前記第3の画素位置との間の第7の画素位置における、前記第1の複数の画素値に含まれる第7の画素値と、前記第1の画素位置と前記第4の画素位置との間の第8の画素位置における、前記第1の複数の画素値に含まれる第8の画素値との差に基づく値であり、
前記第2の勾配は、前記第2の画素位置と前記第5の画素位置との間の第9の画素位置における、前記第2の複数の画素値に含まれる第9の画素値と、前記第2の画素位置と前記第6の画素位置との間の第10の画素位置における、前記第2の複数の画素値に含まれる第10の画素値との差に基づく値であることを特徴とする合焦方向検出装置。
The in-focus direction detecting device according to claim 2,
The first gradient includes a seventh pixel value included in the first plurality of pixel values at a seventh pixel position between the first pixel position and the third pixel position; A value based on a difference from an eighth pixel value included in the first plurality of pixel values at an eighth pixel position between the first pixel position and the fourth pixel position;
The second gradient includes a ninth pixel value included in the second plurality of pixel values at a ninth pixel position between the second pixel position and the fifth pixel position; and A value based on a difference from a tenth pixel value included in the second plurality of pixel values at a tenth pixel position between the second pixel position and the sixth pixel position. In-focus direction detection device.
請求項2または3に記載の合焦方向検出装置において、
前記第1の画素値と前記第7の画素値との差から、前記第8の画素値と前記第1の画素値との差を差し引いた値が所定の二次勾配値以下であるとともに、前記第2の画素値と前記第9の画素値との差から、前記第10の画素値と前記第2の画素値との差を差し引いた値が前記所定の二次勾配値以下であることを特徴とする合焦方向検出装置。
The in-focus direction detecting device according to claim 2 or 3,
A value obtained by subtracting a difference between the eighth pixel value and the first pixel value from a difference between the first pixel value and the seventh pixel value is equal to or less than a predetermined secondary gradient value; A value obtained by subtracting the difference between the tenth pixel value and the second pixel value from the difference between the second pixel value and the ninth pixel value is equal to or less than the predetermined secondary gradient value. An in-focus direction detecting device.
請求項1〜4のいずれか1項に記載の合焦方向検出装置において、
前記第1の勾配および前記第2の勾配は所定の勾配値以上の値であることを特徴とする合焦方向検出装置。
In the focusing direction detection apparatus according to any one of claims 1 to 4,
The in-focus direction detecting device, wherein the first gradient and the second gradient are values greater than or equal to a predetermined gradient value.
請求項1〜5のいずれか1項に記載の合焦方向検出装置において、
前記第1の画素値および前記第2の画素値は所定の画素値以上の値であることを特徴とする合焦方向検出装置。
In the in-focus direction detection device according to any one of claims 1 to 5,
The in-focus direction detecting device, wherein the first pixel value and the second pixel value are equal to or greater than a predetermined pixel value.
請求項4〜6のいずれか1項に記載の合焦方向検出装置において、
前記第1の複数の画素値に対応する前記画像中の第1の複数の画素位置の各々が、前記第1の画素位置に対応し、
前記第2の複数の画素値に対応する前記画像中の第2の複数の画素位置の各々が、前記第2の画素位置に対応し、
前記補正手段は、前記第1の複数の画素信号位置および前記第2の複数の画素位置のそれぞれについて、前記第1の画像信号および前記第2の画像信号のうちの少なくとも一方を補正し、
前記方向検出手段は、前記第1の複数の画素信号位置および前記第2の複数の画素位置のそれぞれについて、前記大小関係に基づき、前記合焦位置の方向を検出することを特徴とする合焦方向検出装置。
The in-focus direction detection device according to any one of claims 4 to 6,
Each of the first plurality of pixel positions in the image corresponding to the first plurality of pixel values corresponds to the first pixel position;
Each of the second plurality of pixel positions in the image corresponding to the second plurality of pixel values corresponds to the second pixel position;
The correcting means corrects at least one of the first image signal and the second image signal for each of the first plurality of pixel signal positions and the second plurality of pixel positions;
The direction detecting means detects the direction of the in-focus position based on the magnitude relationship for each of the first plurality of pixel signal positions and the second plurality of pixel positions. Direction detection device.
請求項1〜7のいずれか1項に記載の合焦方向検出装置において、
前記第1の画素位置と前記第2の画素位置とは同一であることを特徴とする合焦方向検出装置。
In the focusing direction detection apparatus according to any one of claims 1 to 7,
The in-focus direction detecting device, wherein the first pixel position and the second pixel position are the same.
請求項1〜7のいずれか1項に記載の合焦方向検出装置において、
前記第1の画素位置と前記第2の画素位置とは互いに隣接することを特徴とする合焦方向検出装置。
In the focusing direction detection apparatus according to any one of claims 1 to 7,
The in-focus direction detecting device, wherein the first pixel position and the second pixel position are adjacent to each other.
請求項1〜9のいずれか1項に記載の合焦方向検出装置において、
前記撮像手段によって生成される前記画像は、前記被写体の色を構成する3種類の色成分に関する3種類の画像信号を含み、
前記合焦方向検出装置は、前記光学系のズーム位置と、前記被写体の色と、前記3種類の画像信号が出力される際のISO感度と、前記3種類の画像信号に対するホワイトバランスとのうちのいずれか1つに応じて、前記3種類の画像信号のうちから2種類の画像信号を決定する決定手段をさらに備え、
前記決定手段によって決定された前記2種類の画像信号が前記第1の画像信号および前記第2の画像信号であることを特徴とする合焦方向検出装置。
The in-focus direction detection device according to any one of claims 1 to 9,
The image generated by the imaging means includes three types of image signals relating to three types of color components that constitute the color of the subject,
The in-focus direction detection device includes a zoom position of the optical system, a color of the subject, an ISO sensitivity when the three types of image signals are output, and a white balance for the three types of image signals. According to any one of the above, further comprising a determining means for determining two types of image signals from the three types of image signals,
The in-focus direction detecting device, wherein the two types of image signals determined by the determining means are the first image signal and the second image signal.
請求項1〜10のいずれか1項に記載の合焦方向検出装置において、
前記撮像手段は、前記第1の画像信号と前記第2の画像信号とを含むフレーム画像を所定間隔毎に出力し、
前記方向検出手段は、前記所定間隔毎に出力される複数の前記フレーム画像における前記大小関係に基づき、前記合焦位置の方向を検出することを特徴とする合焦方向検出装置。
The in-focus direction detection device according to any one of claims 1 to 10,
The imaging means outputs a frame image including the first image signal and the second image signal at predetermined intervals,
The in-focus direction detecting apparatus, wherein the direction detecting unit detects a direction of the in-focus position based on the magnitude relationship in the plurality of frame images output at the predetermined intervals.
請求項1〜11のいずれか1項に記載の合焦方向検出装置と、
前記光学系と、
前記方向検出手段によって検出された前記合焦位置の方向に前記光学系を駆動する駆動手段とを備えることを特徴とする撮像装置。
The in-focus direction detection device according to any one of claims 1 to 11,
The optical system;
An imaging apparatus comprising: drive means for driving the optical system in the direction of the in-focus position detected by the direction detection means.
被写体の色を構成する第1の色成分に関する第1の画像信号と、前記被写体の色を構成し、かつ前記第1の色成分とは異なる第2の色成分に関する第2の画像信号とを含む画像を生成する撮像処理と、
前記第1の画像信号を構成する第1の複数の画素値のうちの、前記画像中の第1の画素位置における第1の画素値と、前記第2の画像信号を構成する第2の複数の画素値のうちの、前記第1の画素位置に対応する前記画像中の第2の画素位置における第2の画素値とをほぼ一致させるとともに、前記第1の画像信号の信号波形の前記第1の画素位置における第1の勾配と、前記第2の画像信号の信号波形の前記第2の画素位置における第2の勾配とをほぼ一致させるように、前記第1の画像信号および前記第2の画像信号のうちの少なくとも一方を補正する補正処理と、
前記補正処理による補正後の前記第1の画像信号および前記第2の画像信号の大小関係に基づき、光学系の合焦位置の方向を検出する方向検出処理と、をコンピュータに実行させることを特徴とする合焦方向検出処理プログラム。
A first image signal relating to a first color component constituting the color of the subject, and a second image signal relating to a second color component constituting the color of the subject and different from the first color component. Imaging processing to generate an image including,
Of the first plurality of pixel values constituting the first image signal, the first pixel value at the first pixel position in the image and the second plurality constituting the second image signal. Among the pixel values of the first image signal, the second pixel value at the second pixel position in the image corresponding to the first pixel position is substantially matched, and the signal waveform of the first image signal is The first image signal and the second image signal so that the first gradient at one pixel position and the second gradient at the second pixel position of the signal waveform of the second image signal substantially coincide with each other. Correction processing for correcting at least one of the image signals of
A direction detection process for detecting a direction of a focus position of the optical system based on a magnitude relationship between the first image signal and the second image signal after correction by the correction process; A focusing direction detection processing program.
JP2013240300A 2013-11-20 2013-11-20 Focusing direction detector, imaging device, focusing direction detection processing program Pending JP2015099337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013240300A JP2015099337A (en) 2013-11-20 2013-11-20 Focusing direction detector, imaging device, focusing direction detection processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013240300A JP2015099337A (en) 2013-11-20 2013-11-20 Focusing direction detector, imaging device, focusing direction detection processing program

Publications (1)

Publication Number Publication Date
JP2015099337A true JP2015099337A (en) 2015-05-28

Family

ID=53375966

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013240300A Pending JP2015099337A (en) 2013-11-20 2013-11-20 Focusing direction detector, imaging device, focusing direction detection processing program

Country Status (1)

Country Link
JP (1) JP2015099337A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106524909A (en) * 2016-10-20 2017-03-22 北京旷视科技有限公司 Three-dimensional image acquisition method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106524909A (en) * 2016-10-20 2017-03-22 北京旷视科技有限公司 Three-dimensional image acquisition method and apparatus

Similar Documents

Publication Publication Date Title
JP6327922B2 (en) Image processing apparatus, image processing method, and program
CN102685511B (en) Image processing apparatus and image processing method
CN105391932B (en) Image processing apparatus and its control method and photographic device and its control method
JP5709911B2 (en) Image processing method, image processing apparatus, image processing program, and imaging apparatus
US8358835B2 (en) Method for detecting and correcting chromatic aberration, and apparatus and method for processing image using the same
US20110285879A1 (en) Image processing device and image pickup device using the same
JP6013284B2 (en) Imaging apparatus and imaging method
JP2016130869A (en) Method of generating focus signal
KR20090020290A (en) Method and apparatus for compensating chromatic aberration of an image
KR20120136813A (en) Apparatus and method for image processing
JP2014027570A (en) Image processing method, image processing program, image processor and imaging device
JP5917048B2 (en) Image processing apparatus, image processing method, and program
JP2015216576A (en) Image processing apparatus, image processing method, imaging apparatus, electronic apparatus, and program
JP5528139B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5973804B2 (en) Image processing apparatus and control method thereof
US10515442B2 (en) Image processing apparatus that corrects for lateral chromatic aberration, image capturing apparatus, image processing method, and storage medium
JP2011160255A5 (en)
JP2016219985A (en) Image processing device, imaging apparatus, image processing method, and image processing program
JP5353945B2 (en) Image processing apparatus, image processing program, and electronic camera
JP2015099337A (en) Focusing direction detector, imaging device, focusing direction detection processing program
JP6415094B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
Lluis-Gomez et al. Chromatic aberration correction in RAW domain for image quality enhancement in image sensor processors
JP2015163915A (en) Image processor, imaging device, image processing method, program, and storage medium
JP6552248B2 (en) IMAGE PROCESSING APPARATUS AND METHOD, IMAGING APPARATUS, AND PROGRAM
JP6086829B2 (en) Image processing apparatus and image processing method