JP5163733B2 - Imaging apparatus and focus determination program - Google Patents

Imaging apparatus and focus determination program Download PDF

Info

Publication number
JP5163733B2
JP5163733B2 JP2010274724A JP2010274724A JP5163733B2 JP 5163733 B2 JP5163733 B2 JP 5163733B2 JP 2010274724 A JP2010274724 A JP 2010274724A JP 2010274724 A JP2010274724 A JP 2010274724A JP 5163733 B2 JP5163733 B2 JP 5163733B2
Authority
JP
Japan
Prior art keywords
edge
image
difference
color
chromatic aberration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2010274724A
Other languages
Japanese (ja)
Other versions
JP2012022286A (en
Inventor
篤史 河合
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2010274724A priority Critical patent/JP5163733B2/en
Priority to US12/987,437 priority patent/US8958009B2/en
Priority to CN2011100080888A priority patent/CN102129146A/en
Priority to EP11150773A priority patent/EP2362258A1/en
Publication of JP2012022286A publication Critical patent/JP2012022286A/en
Application granted granted Critical
Publication of JP5163733B2 publication Critical patent/JP5163733B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、撮像装置、および焦点判定プログラムに関する。   The present invention relates to an imaging apparatus and a focus determination program.

次のようなオートフォーカス装置が知られている。このオートフォーカス装置は、光の色収差を利用してレンズの焦点位置ズレを検出し、検出結果に基づいて焦点調整を行って各色光のぼけを修正する(例えば、特許文献1)。   The following autofocus devices are known. This autofocus device detects the focal position shift of a lens using chromatic aberration of light and corrects the blur of each color light by performing focus adjustment based on the detection result (for example, Patent Document 1).

特開平6−138362号公報JP-A-6-138362

しかしながら、従来のオートフォーカス装置では、AFレンズの位置が合焦位置に対して光軸方向のどちらの方向にずれているかを検出することができず、合焦状態の判定精度が低かった。   However, the conventional autofocus device cannot detect in which direction of the optical axis the position of the AF lens is deviated from the in-focus position, and the accuracy of determining the in-focus state is low.

本発明による撮像装置は、軸上色収差をもつ光学系が形成する被写体像を入力画像として入力する画像入力手段と、画像入力手段により入力された入力画像から各色成分ごとのエッジを検出するエッジ検出手段と、エッジ検出手段により検出された各色成分ごとのエッジに基づいて、撮像素子からの画素加算読み出しあるいは画像処理の際に、エッジ方向に起因して生じる各色成分間の解像度変化を補正する補正手段と、補正手段により各色成分間の解像度変化が補正された後の画像から検出された各色成分ごとのエッジのうち、軸上色収差がある2つの色成分のエッジのボケ幅の差を算出する算出手段と、算出手段によって算出されたボケ幅の差に基づいて、合焦状態を判定する合焦状態判定手段と、を備えることを特徴とする。
本発明による焦点判定プログラムは、軸上色収差をもつ光学系が形成する被写体像を入力画像として入力する画像入力手順と、画像入力手順で入力された入力画像から各色成分ごとのエッジを検出するエッジ検出手順と、エッジ検出手順で検出した各色成分ごとのエッジに基づいて、撮像素子からの画素加算読み出しあるいは画像処理の際に、エッジ方向に起因して生じる各色成分間の解像度変化を補正する補正手順と、補正手順で各色成分間の解像度変化が補正された後の画像から検出された各色成分ごとのエッジのうち、軸上色収差がある2つの色成分のエッジのボケ幅の差を算出する算出手順と、算出手順で算出されたボケ幅の差に基づいて、合焦状態を判定する合焦状態判定手順と、をコンピュータに実行させることを特徴とする。
An image pickup apparatus according to the present invention includes an image input unit that inputs a subject image formed by an optical system having axial chromatic aberration as an input image, and edge detection that detects an edge for each color component from the input image input by the image input unit. And a correction for correcting a change in resolution between the color components caused by the edge direction during pixel addition reading from the image sensor or image processing based on the edge of each color component detected by the edge detection unit And a difference in blur width between the edges of the two color components having axial chromatic aberration among the edges of the color components detected from the image after the resolution change between the color components is corrected by the correction means. And a focusing state determining unit that determines a focusing state based on a difference in blur width calculated by the calculating unit.
The focus determination program according to the present invention includes an image input procedure for inputting a subject image formed by an optical system having axial chromatic aberration as an input image, and an edge for detecting an edge for each color component from the input image input in the image input procedure. Based on the detection procedure and the edge of each color component detected in the edge detection procedure, correction for correcting the change in resolution between the color components caused by the edge direction during pixel addition reading from the image sensor or image processing The difference between the blur widths of the edges of two color components having axial chromatic aberration among the edges of the color components detected from the procedure and the image after the resolution change between the color components is corrected by the correction procedure is calculated. The computer is caused to execute a calculation procedure and an in-focus state determination procedure for determining an in-focus state based on a difference in blur width calculated in the calculation procedure.

本発明によれば、合焦状態を高精度に判定することができる。   According to the present invention, the in-focus state can be determined with high accuracy.

カメラ100の一実施の形態の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an embodiment of a camera 100. FIG. 第1の実施の形態における焦点位置検出処理の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the focus position detection process in 1st Embodiment. モデルエッジへの近似例を示す図である。It is a figure which shows the example of approximation to a model edge. エッジ領域の背景色の補正例を示す図である。It is a figure which shows the example of a correction | amendment of the background color of an edge area | region. 合焦状態の判定例を示す図である。It is a figure which shows the example of determination of a focusing state. 2色エッジ間の色差和の算出例を示す第1の図である。It is a 1st figure which shows the example of calculation of the color difference sum between two color edges. 2色エッジ間の色差和の算出例を示す第2の図である。It is a 2nd figure which shows the example of calculation of the color difference sum between two color edges. 2×2画素加算時のサンプル位置のずれを示す図である。It is a figure which shows the shift | offset | difference of the sample position at the time of 2x2 pixel addition. 第2の実施の形態における焦点位置検出処理の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the focus position detection process in 2nd Embodiment. ベイヤー配列を示す図である。It is a figure which shows a Bayer arrangement | sequence. ベイヤー配列から同色画素勾配を検出するフィルタの例を示すである。It is an example of a filter for detecting the same color pixel gradient from the Bayer array. 2×2画素加算時の元画像に対する参照画素範囲を示す図である。It is a figure which shows the reference pixel range with respect to the original image at the time of 2x2 pixel addition. ベイヤー配列上の水平方向のエッジに対する使用画素を示す図である。It is a figure which shows the use pixel with respect to the edge of the horizontal direction on a Bayer arrangement | sequence. ベイヤー配列上の垂直方向のエッジに対する使用画素を示す図である。It is a figure which shows the use pixel with respect to the edge of the perpendicular direction on a Bayer arrangement | sequence. ベイヤー配列上の斜め方向のエッジに対する使用画素を示す図である。It is a figure which shows the use pixel with respect to the edge of the diagonal direction on a Bayer arrangement | sequence. 第3の実施の形態における焦点位置検出処理の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the focus position detection process in 3rd Embodiment. 補正処理決定のために撮影するチャート画像を示す図である。It is a figure which shows the chart image image | photographed for correction | amendment process determination. エッジ方向による合焦時基準値ずれの変化を示す図である。It is a figure which shows the change of the reference value shift | offset | difference at the time of focusing by edge direction. 補正用の方向性を持つ平滑化フィルタを示す図である。It is a figure which shows the smoothing filter with the directionality for correction | amendment. エッジ方向による合焦時基準値ずれの変化を示す図である。It is a figure which shows the change of the reference value shift | offset | difference at the time of focusing by edge direction.

―第1の実施の形態―
図1は、第1の実施の形態におけるカメラの一実施の形態の構成を示すブロック図である。カメラ100は、操作部材101と、レンズ102と、撮像素子103と、制御装置104と、メモリカードスロット105と、モニタ106とを備えている。操作部材101は、使用者によって操作される種々の入力部材、例えば電源ボタン、レリーズボタン、ズームボタン、十字キー、決定ボタン、再生ボタン、削除ボタンなどを含んでいる。
-First embodiment-
FIG. 1 is a block diagram illustrating a configuration of an embodiment of a camera according to the first embodiment. The camera 100 includes an operation member 101, a lens 102, an image sensor 103, a control device 104, a memory card slot 105, and a monitor 106. The operation member 101 includes various input members operated by the user, such as a power button, a release button, a zoom button, a cross key, an enter button, a play button, and a delete button.

レンズ102は、複数の光学レンズから構成されるが、図1では代表して1枚のレンズで表している。また、レンズ102を構成するレンズには、後述するAF(Auto Focus/自動焦点調整)のためのAFレンズ(焦点調節用レンズ)が含まれる。撮像素子103は、例えばCCDやCMOSなどのイメージセンサーであり、レンズ102により結像した被写体像を撮像する。そして、撮像によって得られた画像信号を制御装置104へ出力する。   The lens 102 is composed of a plurality of optical lenses, but is representatively represented by one lens in FIG. The lenses constituting the lens 102 include an AF lens (focus adjustment lens) for AF (Auto Focus / automatic focus adjustment) described later. The image sensor 103 is an image sensor such as a CCD or a CMOS, for example, and captures a subject image formed by the lens 102. Then, an image signal obtained by imaging is output to the control device 104.

制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、カメラ100を制御する。なお、制御装置104を構成するメモリには、SDRAMやフラッシュメモリが含まれる。SDRAMは、揮発性のメモリであって、CPUがプログラム実行時にプログラムを展開するためのワークメモリとして使用されたり、データを一時的に記録するためのバッファメモリとして使用される。また、フラッシュメモリは、不揮発性のメモリであって、制御装置104が実行するプログラムのデータや、プログラム実行時に読み込まれる種々のパラメータなどが記録されている。   The control device 104 includes a CPU, a memory, and other peripheral circuits, and controls the camera 100. Note that the memory constituting the control device 104 includes SDRAM and flash memory. The SDRAM is a volatile memory, and is used as a work memory for the CPU to develop a program when the program is executed or as a buffer memory for temporarily recording data. The flash memory is a non-volatile memory in which data of a program executed by the control device 104, various parameters read during program execution, and the like are recorded.

制御装置104は、撮像素子103から入力された画像信号に基づいて所定の画像形式、例えばJPEG形式の画像データ(以下、「本画像データ」と呼ぶ)を生成する。また、制御装置104は、生成した画像データに基づいて、表示用画像データ、例えばサムネイル画像データを生成する。制御装置104は、生成した本画像データとサムネイル画像データとを含み、さらにヘッダ情報を付加した画像ファイルを生成してメモリカードスロット105へ出力する。   The control device 104 generates image data in a predetermined image format, for example, JPEG format (hereinafter referred to as “main image data”) based on the image signal input from the image sensor 103. Further, the control device 104 generates display image data, for example, thumbnail image data, based on the generated image data. The control device 104 generates an image file that includes the generated main image data and thumbnail image data, and further includes header information, and outputs the image file to the memory card slot 105.

メモリカードスロット105は、記憶媒体としてのメモリカードを挿入するためのスロットであり、制御装置104から出力された画像ファイルをメモリカードに書き込んで記録する。また、メモリカードスロット105は、制御装置104からの指示に基づいて、メモリカード内に記憶されている画像ファイルを読み込む。   The memory card slot 105 is a slot for inserting a memory card as a storage medium, and the image file output from the control device 104 is written and recorded on the memory card. The memory card slot 105 reads an image file stored in the memory card based on an instruction from the control device 104.

モニタ106は、カメラ100の背面に搭載された液晶モニタ(背面モニタ)であり、当該モニタ106には、メモリカードに記憶されている画像やカメラ100を設定するための設定メニューなどが表示される。また、制御装置104は、使用者によってカメラ100のモードが撮影モードに設定されると、撮像素子103から時系列で取得した画像の表示用画像データをモニタ106に出力する。これによってモニタ106にはスルー画が表示される。   The monitor 106 is a liquid crystal monitor (rear monitor) mounted on the back surface of the camera 100, and the monitor 106 displays an image stored in a memory card, a setting menu for setting the camera 100, and the like. . Further, when the user sets the mode of the camera 100 to the shooting mode, the control device 104 outputs image data for display of images acquired from the image sensor 103 in time series to the monitor 106. As a result, a through image is displayed on the monitor 106.

本実施の形態では、制御装置104は、撮像素子103からスルー画の入力が開始されると、AF(Autoフォーカス/自動焦点調節)処理を実行して、スルー画表示中に継続して焦点調節を行うことによって、スルー画表示中の常時AF制御を行う。具体的には、撮像素子103から入力されるフレームがRGB表色系で表される画像である場合には、RGBの各色成分ごとの軸上色収差の違いにより各色成分の光軸上の合焦位置は異なるため、光軸上の合焦位置の前後においてエッジ領域の各色成分のボケ幅の大小関係が逆転するという点に着目し、2色間のエッジのボケ幅の差に基づいて現在の合焦状態を判定する。そして、現在のAFレンズ位置が合焦位置から光軸方向のどちらの方向にずれているかを判定して、スルー画表示中の常時AF制御を実現する。なお、光軸上の合焦位置の前後においてエッジ領域の各色成分のボケ幅の大小関係が逆転する点についての具体例は、図5により後述する。   In the present embodiment, when input of a through image from the image sensor 103 is started, the control device 104 executes AF (Auto Focus / Automatic Focus Adjustment) processing, and continuously performs focus adjustment during the through image display. By performing this, the AF control is always performed during the through image display. Specifically, when the frame input from the image sensor 103 is an image expressed in the RGB color system, focusing on the optical axis of each color component due to the difference in axial chromatic aberration for each color component of RGB. Focusing on the fact that the magnitude relation of the blur width of each color component in the edge region is reversed before and after the in-focus position on the optical axis because the position is different, the current position based on the difference in the blur width of the edge between the two colors Determine the in-focus state. Then, it is determined in which direction of the optical axis direction the current AF lens position is shifted from the in-focus position, thereby realizing continuous AF control during live view display. A specific example in which the magnitude relationship of the blur width of each color component in the edge region is reversed before and after the in-focus position on the optical axis will be described later with reference to FIG.

ここで、一般的なデジタルカメラで使用されている光学系(レンズ102)や撮像素子103の場合、上述した各色成分のボケ幅は数画素から数十画素単位の広がりを持つのに対して、2色間のボケ幅の差はその10分の1から100分の1程度しかなく、このボケ幅の差は、画素単位でしか行なえないボケ幅の測定誤差に対して小さいため、直接ボケ幅の測定結果からボケ幅の差を精度良く求めることは困難である。このため、本実施の形態では、制御装置104は、以下に説明するように、画素値の集合分類と集合ごとの統計量とに基づいて間接的に2色間のボケ幅の差を算出し、現在のAFレンズ位置が合焦位置から光軸方向のどちらの方向にずれているかを判定することにより、合焦状態を判定する。   Here, in the case of the optical system (lens 102) and the image sensor 103 used in a general digital camera, the blur width of each color component described above has a spread of several pixels to several tens of pixels. The difference in blur width between the two colors is only about 1/10 to 1/100, and this difference in blur width is small with respect to the measurement error of the blur width that can be performed only in pixel units. It is difficult to accurately determine the difference in blur width from the measurement results. For this reason, in the present embodiment, as described below, the control device 104 indirectly calculates a difference in blur width between two colors based on a set classification of pixel values and a statistic for each set. The in-focus state is determined by determining in which direction of the optical axis the current AF lens position is shifted from the in-focus position.

図2は、第1の実施の形態におけるスルー画表示中に常時AF制御を行なうための焦点位置検出処理の流れを示すフローチャートである。図2に示す処理は、撮像素子103からスルー画の入力が開始されると起動するプログラムとして、制御装置104によって実行される。なお、本実施の形態では、RとGとの間に軸上色収差があり、光軸上の合焦位置よりも撮像素子103側にピントがずれている場合、すなわち後ピンの場合にはRがGよりもぼけ、逆に光軸上の合焦位置よりもレンズ102側にピントがずれている場合、すなわち前ピンの場合には常にGがRよりもぼける場合を想定して、以下の処理を説明する。   FIG. 2 is a flowchart showing a flow of a focus position detection process for constantly performing AF control during live view display in the first embodiment. The processing illustrated in FIG. 2 is executed by the control device 104 as a program that is activated when input of a through image from the image sensor 103 is started. In the present embodiment, there is axial chromatic aberration between R and G, and the focus is shifted toward the image sensor 103 from the in-focus position on the optical axis, that is, in the case of the rear pin, R Assuming that G is more blurred than G, and conversely, the lens 102 is out of focus with respect to the in-focus position on the optical axis, that is, G is always more blurred than R in the case of the front pin. Processing will be described.

ステップS1において、制御装置104は、撮像素子103から入力される画像内から評価領域内の画像(評価領域画像)を読み出す。ここで、評価領域画像とは、例えば、撮影画面内に配置されたAF評価エリア内の画像をいう。その後、ステップS2へ進み、制御装置104は、評価領域画像を対象としてエッジ検出を行なって、評価領域画像内に合焦状態の判定に利用することができるエッジの有無を検査する。その後、ステップS3へ進み、制御装置104は、ステップS3におけるエッジの検出結果に基づいて、評価領域画像内からエッジが検出されたか否かを判断する。ステップS3で否定判断した場合には、ステップS14へ進み、制御装置104は、合焦状態の判定は不可能であると判断して、処理を終了する。これに対して、ステップS3で肯定判断した場合には、ステップS4へ進む。   In step S <b> 1, the control device 104 reads an image in the evaluation region (evaluation region image) from the image input from the image sensor 103. Here, the evaluation area image means, for example, an image in the AF evaluation area arranged in the shooting screen. Thereafter, the process proceeds to step S <b> 2, and the control device 104 performs edge detection on the evaluation area image and inspects the presence or absence of an edge that can be used for determining the in-focus state in the evaluation area image. Thereafter, the process proceeds to step S3, and the control device 104 determines whether or not an edge is detected from the evaluation area image based on the edge detection result in step S3. If a negative determination is made in step S3, the process proceeds to step S14, where the control device 104 determines that determination of the in-focus state is impossible and ends the process. On the other hand, if a positive determination is made in step S3, the process proceeds to step S4.

ステップS4では、制御装置104は、評価領域画像内の画素ごとの勾配の有無に基づいて、評価領域画像をフラット領域(平坦部)Fとエッジ領域(エッジ部)Eに分離する。具体的には、制御装置104は、評価領域画像の各画素をp(x,y)と表し、各画素をp(x,y)のR、G、Bそれぞれの値をR(x,y)、G(x,y)、B(x,y)と表した場合には、次式(1)、(2)により勾配量絶対値gR(x,y)とgG(x,y)とを算出する。なお、上述したように、本実施の形態ではRとGとの間に軸上色収差がある場合を想定しているため、次式(1)、(2)により勾配量絶対値gR(x,y)とgG(x,y)とを算出するが、他の色成分間に軸上色収差がある場合には、その色成分について勾配量絶対値を算出すればよい。

Figure 0005163733
Figure 0005163733
In step S4, the control device 104 separates the evaluation region image into a flat region (flat portion) F and an edge region (edge portion) E based on the presence or absence of a gradient for each pixel in the evaluation region image. Specifically, the control device 104 represents each pixel of the evaluation region image as p (x, y), and represents each pixel with R, G, and B values of p (x, y) as R (x, y). ), G (x, y), and B (x, y), the gradient amount absolute values gR (x, y) and gG (x, y) are expressed by the following equations (1) and (2). Is calculated. As described above, in this embodiment, since it is assumed that there is axial chromatic aberration between R and G, the gradient absolute value gR (x, y) and gG (x, y) are calculated. If there is axial chromatic aberration between other color components, the absolute value of the gradient amount may be calculated for that color component.
Figure 0005163733
Figure 0005163733

そして、制御装置104は、算出した勾配量絶対値gR(x,y)とgG(x,y)とに基づいて、次式(3)、(4)を用いて閾値を超える勾配が存在するか否かを判定することにより、評価領域画像をフラット領域Fとエッジ領域Eに分離する。

Figure 0005163733
Figure 0005163733
And the control apparatus 104 has the gradient which exceeds a threshold value using following Formula (3) and (4) based on the calculated gradient amount absolute value gR (x, y) and gG (x, y). Whether or not the evaluation area image is separated into the flat area F and the edge area E.
Figure 0005163733
Figure 0005163733

さらに、制御装置104は、次式(5)、(6)に示すように、フラット領域Fに属する画素の平均値Fmeanを閾値として用いて、フラット領域Fをサブフラット領域FHとFLとに分離する。これにより、評価領域画像内における任意の断面形状を持つエッジを、2つのサブフラット領域FHとFL、および該2つのサブフラット領域間を結ぶエッジ領域Eで表したモデルエッジで近似することができる。

Figure 0005163733
Figure 0005163733
Further, the control device 104 separates the flat area F into sub-flat areas FH and FL using the average value Fmean of the pixels belonging to the flat area F as a threshold, as shown in the following equations (5) and (6). To do. Thereby, an edge having an arbitrary cross-sectional shape in the evaluation area image can be approximated by a model edge represented by two sub-flat areas FH and FL and an edge area E connecting the two sub-flat areas. .
Figure 0005163733
Figure 0005163733

例えば、図3(a)に示すような断面形状を持つエッジ3aは、図3(b)に示すように、エッジ両側のコントラスト差がCとなる2つのサブフラット領域FLおよびFHと、サブフラット領域FL−FH間を結ぶエッジ領域Eとに分離されたモデルエッジ3bで近似される。なお、この図3(b)に示すモデルエッジ3bにおいて、エッジ領域Eの長さwがエッジのボケ幅を示している。また、エッジに沿った方向の画素単位長さ当たりのモデルエッジを換算エッジと呼ぶ。   For example, an edge 3a having a cross-sectional shape as shown in FIG. 3A has two subflat regions FL and FH in which the contrast difference between both sides of the edge is C, as shown in FIG. It is approximated by the model edge 3b separated into the edge region E connecting the regions FL and FH. Note that, in the model edge 3b shown in FIG. 3B, the length w of the edge region E indicates the blur width of the edge. A model edge per pixel unit length in the direction along the edge is called a conversion edge.

その後、ステップS5へ進み、制御装置104は、サブフラット領域FHおよびFLのそれぞれの平均色を調べ、背景色が軸上色収差が見える色か否かを判断する。すなわち、制御装置104は、RとGとの間およびRとBとの間に軸上色収差があり、GとBとの間には軸上色収差がない場合には、サブフラット領域FHおよびFLの背景色がGとBのみにコントラスト差があってもRにコントラスト差がなければ軸上色収差は観察されない。よって、この場合には、背景色がRに十分なコントラスト差があり、かつGとBの内の少なくとも片方に十分なコントラスト差があればステップS5で肯定判断され、それ以外の場合にはステップS5で否定判断される。ステップS5で否定判断した場合には、上述したステップS14へ進み、制御装置104は、合焦状態の判定は不可能であると判断して、処理を終了する。これに対して、ステップS5で肯定判断した場合には、ステップS6へ進む。   Thereafter, the process proceeds to step S5, and the control device 104 examines the average colors of the sub-flat regions FH and FL to determine whether the background color is a color in which axial chromatic aberration is visible. That is, when there is axial chromatic aberration between R and G and between R and B and there is no axial chromatic aberration between G and B, the control device 104 determines that the sub-flat regions FH and FL Even if there is a contrast difference between only G and B in the background color, no axial chromatic aberration is observed unless there is a contrast difference in R. Therefore, in this case, if the background color has a sufficient contrast difference in R and there is a sufficient contrast difference in at least one of G and B, an affirmative determination is made in step S5. A negative determination is made in S5. If a negative determination is made in step S5, the process proceeds to step S14 described above, and the control device 104 determines that determination of the in-focus state is impossible and ends the process. On the other hand, if an affirmative determination is made in step S5, the process proceeds to step S6.

ステップS6では、制御装置104は、サブフラット領域FHおよびFLの色が灰色になるように、評価領域画像の全体を補正する。具体的には、制御装置104は、サブフラット領域FHおよびFLの色が灰色になるように、評価領域画像全体でR、G、Bのエッジ両側でのコントラスト差を正規化する。例えば、図4(a)において実線で示すR成分のエッジR(x)および点線で示すG成分のエッジG(x)は、図4(b)に示すように、エッジ領域Eの両側のコントラスト差が同じになるように背景色の補正が行われる。その後、ステップS7へ進む。   In step S6, control device 104 corrects the entire evaluation area image so that the colors of sub-flat areas FH and FL are gray. Specifically, the control device 104 normalizes contrast differences on both sides of the R, G, and B edges in the entire evaluation area image so that the colors of the sub-flat areas FH and FL are gray. For example, in FIG. 4A, the R component edge R (x) indicated by the solid line and the G component edge G (x) indicated by the dotted line are contrasts on both sides of the edge region E as shown in FIG. The background color is corrected so that the difference is the same. Thereafter, the process proceeds to step S7.

ステップS7では、制御装置104は、ステップS6で各色成分のエッジ両側のコントラスト差を正規化した後の評価領域画像におけるエッジ領域Eに基づいて、R、G、Bのうち軸上色収差のある2色間成分について、次式(7)〜(11)を用いて指標値Iを算出する。すなわち、制御装置104は、まず、背景色補正を行った後の評価領域画像を対象として、式(7)、(8)を示すように、エッジ領域Eに属する画素の平均値Emeanを閾値として用いて、エッジ領域Eをサブエッジ領域ELとEHとに分離する。

Figure 0005163733
Figure 0005163733
In step S7, the control device 104 uses the edge region E in the evaluation region image after normalizing the contrast difference between both edges of each color component in step S6, and 2 having axial chromatic aberration among R, G, and B. For the inter-color component, the index value I is calculated using the following equations (7) to (11). That is, the control device 104 first sets the average value Emean of the pixels belonging to the edge region E as a threshold, as shown in equations (7) and (8), for the evaluation region image after the background color correction is performed. The edge region E is separated into sub-edge regions EL and EH.
Figure 0005163733
Figure 0005163733

次に制御装置104は、次式(9)を用いてサブエッジ領域ELの色差和ΔALを算出し、次式(10)を用いてサブエッジ領域EHの色差和ΔAHを算出する。なお、上述したように、本実施の形態ではRとGとの間に軸上色収差がある場合を想定しているため、次式(9)と(10)では、R成分のエッジとG成分のエッジとを対象として色差和ΔALとΔAHとを算出するが、他の色成分間に軸上色収差がある場合には、その色成分のエッジを対象として色差和ΔALとΔAHとを算出すればよい。

Figure 0005163733
Figure 0005163733
Next, the control device 104 calculates the color difference sum ΔAL of the sub-edge region EL using the following equation (9), and calculates the color difference sum ΔAH of the sub-edge region EH using the following equation (10). As described above, in the present embodiment, since it is assumed that there is axial chromatic aberration between R and G, in the following equations (9) and (10), the edge of the R component and the G component The color difference sums ΔAL and ΔAH are calculated for the edges of the color component, but if there is axial chromatic aberration between the other color components, the color difference sums ΔAL and ΔAH are calculated for the edges of the color components. Good.
Figure 0005163733
Figure 0005163733

さらに制御装置104は、次式(11)により、軸上色収差のある2色間、すなわちRとGとの間について、指標値Iを算出する。指標値Iは、後述する式(23)との比較により、評価領域画像内に換算エッジボケ幅差Δwを示すエッジがいくつ存在するかを示す量である。なお、次式(11)による評価値Iの算出は、評価領域画像内におけるエッジ形状を何ら仮定せず、統計量に基づいた階層的な画素集合への分類のみで行なうため、どのような評価領域画像に対しても式(11)による評価値Iの算出が可能である。

Figure 0005163733
Further, the control device 104 calculates an index value I between two colors having axial chromatic aberration, that is, between R and G, by the following equation (11). The index value I is an amount indicating how many edges indicating the converted edge blur width difference Δw exist in the evaluation region image by comparison with the equation (23) described later. Note that the evaluation value I is calculated by the following formula (11) without assuming any edge shape in the evaluation region image, and only by classification into a hierarchical pixel set based on statistics, so The evaluation value I can also be calculated for the region image by the equation (11).
Figure 0005163733

その後、ステップS8へ進み、制御装置104は、評価領域画像内に含まれる上述した換算エッジの数(換算エッジ数)Nを概算する。例えば、制御装置104は、上述したEmeanで評価領域画像を二値化して境界となる画素を数えることにより換算エッジ数Nを概算することが可能である。その後、ステップS9へ進む。   Thereafter, the process proceeds to step S8, and the control device 104 approximates the number N of converted edges (number of converted edges) N included in the evaluation area image. For example, the control device 104 can approximate the converted edge number N by binarizing the evaluation region image with the above-mentioned Emeans and counting pixels serving as boundaries. Then, it progresses to step S9.

ステップS9では、制御装置104は、現在のAFレンズ位置が合焦位置から光軸方向のどちらの方向にずれているかを判定するために用いる換算エッジボケ幅差Δwを算出する。式(11)により算出される評価値Iと、換算エッジ数Nおよび換算エッジボケ幅差Δwの間には、I=Δw×Nという関係が成り立つことから、制御装置104は、次式(12)により換算エッジボケ幅差Δwを算出する。
Δw=I/N ・・・(12)
これにより、任意の形状のエッジを含む評価領域画像から換算エッジボケ幅差Δwを間接的に算出することができる。なお、ここで算出される換算エッジボケ幅差Δwは、軸上色収差があるR成分とG成分との間の換算エッジボケ幅差であるため、Δwは、ΔwR−Gと表記することもできる。
In step S9, the control device 104 calculates a converted edge blur width difference Δw that is used to determine in which direction of the optical axis direction the current AF lens position is shifted from the in-focus position. Since the relationship of I = Δw × N is established between the evaluation value I calculated by the equation (11), the converted edge number N, and the converted edge blur width difference Δw, the control device 104 represents the following equation (12) To calculate the converted edge blur width difference Δw.
Δw = I / N (12)
Thereby, the converted edge blur width difference Δw can be indirectly calculated from the evaluation area image including the edge of an arbitrary shape. Note that the converted edge blur width difference Δw calculated here is a converted edge blur width difference between the R component and G component having axial chromatic aberration, and thus Δw can also be expressed as ΔwR−G.

その後、ステップS10へ進み、制御装置104は、換算エッジボケ幅差Δwに基づいてAFレンズの移動方向を判定するために用いる閾値を設定する。なお、AFレンズが合焦位置に近いほど、算出されるΔwは0に近い値となる。このため、Δwが0のときに合焦位置と判定し、それ以外の場合にはΔwが0になる方向をAFレンズの移動方向と判定することも可能である。しかしながら、本実施の形態では、測定誤差によるピント前後の誤判定を避けるために、Δwが0を中心とした一定範囲内にあればAFレンズ位置は合焦位置にあると判定するために、ステップS10で所定の閾値を設定する。なお、閾値は、あらかじめ決められた定数であってもよいし、画像や撮影条件等に基づいて適宜設定してもよい。   Thereafter, the process proceeds to step S10, and the control device 104 sets a threshold value used for determining the moving direction of the AF lens based on the converted edge blur width difference Δw. Note that as the AF lens is closer to the in-focus position, the calculated Δw becomes closer to 0. For this reason, it is possible to determine the in-focus position when Δw is 0, and in other cases, it is possible to determine the direction in which Δw is 0 as the movement direction of the AF lens. However, in this embodiment, in order to avoid erroneous determination before and after focusing due to a measurement error, in order to determine that the AF lens position is in the in-focus position if Δw is within a certain range centered on 0, In S10, a predetermined threshold is set. Note that the threshold may be a predetermined constant, or may be set as appropriate based on an image, shooting conditions, and the like.

その後、ステップS11へ進み、制御装置104は、ステップS9で算出した換算エッジボケ幅差Δwと閾値とを比較して、現在の焦点調節状態が前ピンか後ピンかを判定する。すなわち、Δwが−0.5から0.5の間にあるときに合焦状態と判定するように閾値が設定されている場合には、制御装置104は、Δwが0.5より大きいときに後ピンであると判定し、Δwが−0.5より小さいときに前ピンであると判定する。   Thereafter, the process proceeds to step S11, and the control device 104 compares the converted edge blur width difference Δw calculated in step S9 with a threshold value to determine whether the current focus adjustment state is the front pin or the rear pin. That is, when Δw is between −0.5 and 0.5, when the threshold is set so that the in-focus state is determined, the controller 104 determines that Δw is greater than 0.5. It is determined that it is a rear pin, and when Δw is smaller than −0.5, it is determined that it is a front pin.

例えば、図4に示した正規化後のR成分のエッジR(x)とG成分のエッジG(x)とを考えると、後ピンの場合には、上述したようにRがGよりもぼけるため、図5(a)に示すようにR成分のエッジ領域Eの長さwRとG成分のエッジ領域Eの長さwGとの間には、wR>wGの関係が成り立つ。このため、制御装置104は、Δw(=wR−wG)が閾値の上限である0.5より大きい場合には、後ピンであると判定する。   For example, considering the normalized R-component edge R (x) and G-component edge G (x) shown in FIG. 4, in the case of the rear pin, R is more blurred than G as described above. Therefore, as shown in FIG. 5A, a relationship of wR> wG is established between the length wR of the R component edge region E and the length wG of the G component edge region E. For this reason, when Δw (= wR−wG) is larger than 0.5 which is the upper limit of the threshold value, the control device 104 determines that it is a rear pin.

一方、前ピンの場合には、上述したようにGがRよりもぼけるため、図5(c)に示すようにR成分のエッジ領域Eの長さwRとG成分のエッジ領域Eの長さwGとの間には、wR<wGの関係が成り立つ。このため、制御装置104は、Δw(=wR−wG)が閾値の下限である−0.5より小さい場合には、前ピンであると判定する。   On the other hand, in the case of the front pin, since G is more blurred than R as described above, the length wR of the R component edge region E and the length of the G component edge region E as shown in FIG. A relationship of wR <wG is established with wG. Therefore, the control device 104 determines that the pin is the front pin when Δw (= wR−wG) is smaller than −0.5 which is the lower limit of the threshold.

これに対して、合焦時には図5(b)に示すようにR成分のエッジ領域Eの長さwRとG成分のエッジ領域Eの長さwGとの間には、原則としてwR=wGの関係が成り立つ。このため、制御装置104は、Δw(=wR−wG)が閾値の下限である−0.5以上、かつ閾値の上限である0.5以下である場合には、合焦状態であるため、前ピンか後ピンかは不明であると判定する。   On the other hand, as shown in FIG. 5B, in principle, between the length wR of the R component edge region E and the length wG of the G component edge region E, as shown in FIG. A relationship is established. For this reason, the control device 104 is in a focused state when Δw (= wR−wG) is −0.5 or more which is the lower limit of the threshold value and 0.5 or less which is the upper limit of the threshold value. It is determined that the front pin or the rear pin is unknown.

その後、ステップS12へ進み、制御装置104は、ステップS11における判定の結果、前ピンまたは後ピンと判定されたか否かを判断する。ステップS12で否定判断した場合には、上述したステップS14へ進み、制御装置104は、合焦状態の判定は不可能であると判断して、処理を終了する。これに対して、ステップS12で肯定判断した場合には、ステップS13へ進む。   Thereafter, the process proceeds to step S12, and the control device 104 determines whether or not it is determined as a front pin or a rear pin as a result of the determination in step S11. If a negative determination is made in step S12, the process proceeds to step S14 described above, and the control device 104 determines that determination of the in-focus state is impossible and ends the process. On the other hand, when an affirmative determination is made in step S12, the process proceeds to step S13.

ステップS13では、制御装置104は、ステップS11での判定結果に基づいて、Δwを0に近付けることができる方向をAFレンズの移動方向として判定する。そして、制御装置104は、判定したAFレンズの移動方向をAFレンズを駆動させるためのモータに出力することによって、AFレンズを合焦方向へ移動させる。その後、処理を終了する。   In step S13, the control device 104 determines a direction in which Δw can approach 0 as the movement direction of the AF lens based on the determination result in step S11. Then, the control device 104 outputs the determined movement direction of the AF lens to a motor for driving the AF lens, thereby moving the AF lens in the focusing direction. Thereafter, the process ends.

以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)制御装置104は、評価領域画像から各色成分ごとのエッジを検出して、軸上色収差がある2つの色成分のエッジの換算エッジボケ幅差Δwを算出し、該換算エッジボケ幅差Δwに基づいて、合焦状態を判定するようにした。これによって、合焦状態を高精度に判定することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The control device 104 detects an edge for each color component from the evaluation area image, calculates a converted edge blur width difference Δw of the edges of two color components having axial chromatic aberration, and calculates the converted edge blur width difference Δw. Based on this, the focused state is determined. Thereby, the in-focus state can be determined with high accuracy.

(2)制御装置104は、軸上色収差がある2つの色成分のエッジをフラット領域Fとエッジ領域Eとに分類し、エッジ領域Eを対象として算出した色差和に基づいて評価値Iを算出するようにした。そして、制御装置104は、算出した評価値Iを用いて式(12)により換算エッジボケ幅差Δwを算出するようにした。これによって、エッジの形状が不明である場合でも、換算エッジボケ幅差Δwを算出することができる。 (2) The control device 104 classifies the edges of the two color components having axial chromatic aberration into the flat region F and the edge region E, and calculates the evaluation value I based on the color difference sum calculated for the edge region E. I tried to do it. And the control apparatus 104 was made to calculate conversion edge blur width difference (DELTA) w by Formula (12) using the calculated evaluation value I. FIG. Thereby, even when the shape of the edge is unknown, the converted edge blur width difference Δw can be calculated.

(3)制御装置104は、軸上色収差がある2つの色成分のエッジの両側のコントラスト差を無くすように補正を行い、補正後の評価領域画像を用いて換算エッジボケ幅差Δwを算出するようにした。これによって、換算エッジボケ幅差Δwの算出精度を高めることができる。 (3) The control device 104 performs correction so as to eliminate the contrast difference between both sides of the edge of the two color components having axial chromatic aberration, and calculates the converted edge blur width difference Δw using the corrected evaluation area image. I made it. As a result, the calculation accuracy of the converted edge blur width difference Δw can be increased.

―第2の実施の形態―
上述した第1の実施の形態では、軸上色収差がある2つの色成分のエッジの換算エッジボケ幅差Δwを算出し、該換算エッジボケ幅差Δwに基づいて、合焦状態を判定するようにした。この場合、軸上色収差に起因する各色成分のボケ量とは別に、入力画像が生成される過程の処理が原因で各色成分間の解像度が変化して測定されるボケ幅および各色成分間のボケ幅差が変化することがある。
-Second embodiment-
In the first embodiment described above, the converted edge blur width difference Δw between the edges of two color components having axial chromatic aberration is calculated, and the in-focus state is determined based on the converted edge blur width difference Δw. . In this case, apart from the blur amount of each color component due to axial chromatic aberration, the blur width measured by changing the resolution between the color components due to the process of the process of generating the input image and the blur between the color components. The width difference may change.

このような状況は、例えば、単板式カラー撮像素子から読み出したRAW画像を補間して画像を生成する撮像装置において、撮像素子から画素加算読み出しを行って読み出したRAW画像を画素加算を想定していない補間装置により補間した場合に発生する。具体的には、撮影画像と同一撮像素子の出力画像でコントラストAFによる合焦動作を行う場合、フレームレート向上を目的とした画像サイズ縮小のため画素加算読み出しが行われる。一方コストの都合で撮影画像用の補間装置しか備えていない場合、合焦動作に用いる画素加算された画像の補間には必ずしも最適化されていない補間装置で補間が行われた画像が生成される。このとき単板式カラー撮像素子の画素配列が画素加算に対して色成分によって均一な分布をしていない場合には、生成される画像の画素に対する縦、横、斜めの方向に依存して各色成分間の解像度変化が起こる場合がある。   In such a situation, for example, in an imaging apparatus that generates an image by interpolating a RAW image read from a single-plate color image sensor, pixel addition is performed on the RAW image read by performing pixel addition readout from the image sensor. Occurs when interpolating with no interpolator. Specifically, when a focusing operation by contrast AF is performed on the output image of the same image sensor as the captured image, pixel addition reading is performed to reduce the image size for the purpose of improving the frame rate. On the other hand, if only an interpolator for captured images is provided for cost reasons, an image that has been interpolated by an interpolator that is not necessarily optimized for interpolating the pixel-added image used for the focusing operation is generated. . In this case, if the pixel arrangement of the single-plate color image sensor does not have a uniform distribution due to the color components with respect to pixel addition, each color component depends on the vertical, horizontal, and diagonal directions with respect to the pixels of the generated image. There may be a resolution change between.

例えば撮像素子が最もよく使われるRGGBの4色ベイヤー配列で、同色2×2画素平均の画素加算読み出しを行った場合、画素加算読み出しにより元のベイヤー配列RAW画像と相似な配列の縮小ベイヤー配列RAW画像が生成されるが、撮像素子上の光学像におけるサンプル位置重心と画像データ上の画素位置は図8のようにずれる。   For example, in a four-color Bayer array of RGGB in which an image sensor is most often used, when pixel addition reading with an average of 2 × 2 pixels of the same color is performed, a reduced Bayer array RAW having an array similar to the original Bayer array RAW image by pixel addition reading Although an image is generated, the sample position gravity center in the optical image on the image sensor and the pixel position on the image data are shifted as shown in FIG.

すなわち、図8(a)に示す元ベイヤー配列RAW画像で、図8(b)に示すように同色2×2画素平均の画素加算読み出しを行って得られる縮小ベイヤー配列RAW画像では、R画素の元のベイヤー配列RAW画像上のサンプル位置重心、すなわち4つのR画素の重心位置8aと、縮小ベイヤー配列RAW画像におけるR´画素の画素位置8bとにはずれが生じている。同様に、Gr画素の元ベイヤー配列RAW画像上のサンプル位置重心、すなわち4つのGr画素の重心位置8cと、縮小ベイヤー配列RAW画像におけるGr´画素の画素位置8dとにはずれが生じている。Gb画素の元ベイヤー配列RAW画像上のサンプル位置重心、すなわち4つのGb画素の重心位置8eと、縮小ベイヤー配列RAW画像におけるGb´画素の画素位置8fとにはずれが生じている。B画素の元ベイヤー配列RAW画像上のサンプル位置重心、すなわち4つのB画素の重心位置8gと、縮小ベイヤー配列RAW画像におけるB´画素の画素位置8hとにはずれが生じている。   That is, in the original Bayer array RAW image shown in FIG. 8A, in the reduced Bayer array RAW image obtained by performing pixel addition reading of 2 × 2 pixels average of the same color as shown in FIG. There is a deviation between the sample position centroid on the original Bayer array RAW image, that is, the centroid position 8a of the four R pixels and the pixel position 8b of the R ′ pixel in the reduced Bayer array RAW image. Similarly, there is a difference between the sample position centroid on the original Bayer array RAW image of Gr pixels, that is, the centroid position 8c of four Gr pixels and the pixel position 8d of Gr ′ pixels in the reduced Bayer array RAW image. There is a deviation between the sample position centroid on the original Bayer array RAW image of Gb pixels, that is, the centroid position 8e of the four Gb pixels and the pixel position 8f of the Gb ′ pixel in the reduced Bayer array RAW image. There is a deviation between the sample position centroid on the original Bayer array RAW image of B pixels, that is, the centroid position 8g of the four B pixels and the pixel position 8h of the B ′ pixel in the reduced Bayer array RAW image.

この縮小ベイヤー配列RAW画像の色に依存したサンプル位置ずれを想定していない補間装置が元のベイヤー配列RAW画像と同じ処理で補間を行うと偽色や、ベイヤー配列に対する方向に依存する色成分間の解像度の変化が生じた画像が生成されることになる。このような画像で第1の実施の形態で上述した軸上色収差に起因する二色間のエッジボケ幅差を利用した焦点位置判定を行うと、画像に含まれるエッジの方向に依存して測定される二色間のエッジボケ幅差が変化する。こういった変化が存在すると、合焦状態における基準値との比較で行う焦点位置判定の際、変化の依存性を元にした条件別判定を行う必要が生じて判定精度が悪化する。また動く被写体を追尾中や動画撮影中に軸上色収差による合焦状態判定を行う場合には、判定動作中にエッジ位置が回転すると判定の基準となる値が変化するために安定した判定結果を出すことが難しくなる。   When the interpolation device that does not assume the sample position shift depending on the color of the reduced Bayer array RAW image performs interpolation by the same processing as the original Bayer array RAW image, false colors and color components depending on the direction with respect to the Bayer array An image in which a change in resolution occurs is generated. When focus position determination is performed on such an image using the edge blur width difference between the two colors caused by the axial chromatic aberration described in the first embodiment, it is measured depending on the direction of the edge included in the image. The edge blur width difference between the two colors changes. If such a change exists, it is necessary to make a condition-based determination based on the dependency of the change when the focus position is determined by comparison with the reference value in the in-focus state, and the determination accuracy deteriorates. In addition, when performing in-focus state determination due to longitudinal chromatic aberration while tracking a moving subject or shooting a moving image, the value used as the determination reference changes when the edge position rotates during the determination operation, so a stable determination result is obtained. It becomes difficult to put out.

このような問題を解決するために、第2の実施の形態では、このような補間処理を行うと入力画像に軸上色収差以外の各色成分間の解像度変化が含まれる状況に対して、RAW画像あるいは補間済み画像から各色成分間の解像度変化による影響を受けない画素の組み合わせだけを選別して利用することにより、精度の高い軸上色収差による焦点位置判定を行う方法について説明する。   In order to solve such a problem, in the second embodiment, when such an interpolation process is performed, a RAW image is used for a situation in which the input image includes a change in resolution between color components other than axial chromatic aberration. Alternatively, a method for performing a highly accurate focal position determination based on axial chromatic aberration by selecting and using only combinations of pixels that are not affected by a change in resolution between color components from an interpolated image will be described.

第2の実施の形態では、画素加算読出と補間によりエッジ方向に依存した各色成分間の解像度変化が発生する場合を例にとって、処理の流れを説明する。図9は、第2の実施の形態における焦点位置検出処理の流れを示すフローチャート図である。   In the second embodiment, the flow of processing will be described by taking as an example a case where a change in resolution between color components depending on the edge direction occurs due to pixel addition reading and interpolation. FIG. 9 is a flowchart showing a flow of focus position detection processing in the second embodiment.

ステップS1において、制御装置104は、R、Gr、Gb、Bの4種のカラーフィルタから成るベイヤー配列の撮像素子から上述した2×2画素加算を行って画像を読み出した縮小ベイヤー配列RAW画像を取得する。図8(b)に示したように、この縮小ベイヤー配列RAW画像は画像データ上の画素位置と元画像に対する各色成分のサンプル位置重心がずれている。このため、補間装置が画素加算読み出しを想定していない場合、エッジ方向により各色成分間の解像度が変化した画像が生成される。そこでこの悪影響を回避するため、補間を行わずにそのままステップS2に進む。   In step S1, the control device 104 performs a reduced Bayer array RAW image obtained by performing the above-described 2 × 2 pixel addition from the Bayer array image sensor including four types of color filters R, Gr, Gb, and B and reading the image. get. As shown in FIG. 8B, in this reduced Bayer array RAW image, the pixel position on the image data and the sample position centroid of each color component with respect to the original image are shifted. For this reason, when the interpolation device does not assume pixel addition reading, an image in which the resolution between the color components is changed depending on the edge direction is generated. Therefore, in order to avoid this adverse effect, the process proceeds to step S2 without performing interpolation.

ステップS2では、制御装置104は、縮小ベイヤー配列RAW画像からR、Gr、Gb、Bの4色の色成分それぞれのエッジ方向を検出する。例えば、図10に示すような縮小ベイヤー配列RAW画像に対して、図11(a)、(b)、(c)、(d)に示すような4種のフィルタを用いて同色画素勾配を画素ごとに算出し、画像全体で総和をとって比較する。そして、エッジ勾配の符号と、絶対値が最大となる方向とから、各色成分ごとに8方向のうちの1つの方向をエッジ方向として検出することができる。   In step S2, the control device 104 detects the edge directions of the four color components R, Gr, Gb, and B from the reduced Bayer array RAW image. For example, with respect to a reduced Bayer array RAW image as shown in FIG. 10, the same color pixel gradient is obtained by using four types of filters as shown in FIGS. 11 (a), (b), (c) and (d). It is calculated for each image, and the whole image is taken and compared. Then, from the sign of the edge gradient and the direction having the maximum absolute value, one of the eight directions can be detected as the edge direction for each color component.

その後、ステップS3へ進み、制御装置104は、ステップS2でのエッジ方向の検出結果に基づいて、縮小ベイヤー配列RAW画像内にエッジが存在するか否かを判断する。例えば、ステップS2において、勾配が小さくエッジが検出されない場合には、縮小ベイヤー配列RAW画像内にエッジが存在しないと判断する。ステップS3で否定判断した場合には、ステップS1で取得した縮小ベイヤー配列RAW画像は、軸上色収差による焦点位置判定には不適な画像であると判断して、そのまま処理を終了する。これに対して、ステップS3で肯定判断した場合には、ステップS4へ進む。   Thereafter, the process proceeds to step S3, and the control device 104 determines whether or not an edge exists in the reduced Bayer array RAW image based on the detection result of the edge direction in step S2. For example, if the gradient is small and no edge is detected in step S2, it is determined that no edge exists in the reduced Bayer array RAW image. If a negative determination is made in step S3, it is determined that the reduced Bayer array RAW image acquired in step S1 is an image that is inappropriate for focus position determination due to axial chromatic aberration, and the process ends. On the other hand, if a positive determination is made in step S3, the process proceeds to step S4.

ステップS4では、制御装置104は、ステップS2でのエッジ方向の検出結果に基づいて、縮小ベイヤー配列RAW画像内から各色成分ごとに検出したエッジ方向が互いに一致しているか否かを判断する。ステップS4で否定判断した場合には、ステップS1で取得した縮小ベイヤー配列RAW画像は、軸上色収差による焦点位置判定には不適な画像であると判断して、そのまま処理を終了する。これに対して、ステップS4で肯定判断した場合には、ステップS1で取得した縮小ベイヤー配列RAW画像は、軸上色収差による焦点位置判定が可能な画像であると判断してステップS5へ進む。   In step S4, the control device 104 determines whether or not the edge directions detected for each color component from the reduced Bayer array RAW image coincide with each other based on the detection result of the edge direction in step S2. When a negative determination is made in step S4, it is determined that the reduced Bayer array RAW image acquired in step S1 is an image that is inappropriate for the focal position determination due to the longitudinal chromatic aberration, and the process is ended as it is. On the other hand, if an affirmative determination is made in step S4, the reduced Bayer array RAW image acquired in step S1 is determined to be an image capable of determining the focal position based on axial chromatic aberration, and the process proceeds to step S5.

ステップS5では、制御装置104は、ステップS2で検出したエッジ方向に応じて各色成分間で解像度とサンプル位置の一致する画素の選別を行う。ここで、軸上色収差による焦点位置判定は図5に示した関係を利用して、RとG、GとB、RとBの三組の二色間のボケ幅の差を、合焦時の基準値と比較して行われ、三組の二色間ボケ幅差の結果を算出し、それぞれに重み付けをして最終的な判定結果が得られる。   In step S5, the control device 104 selects pixels having the same resolution and sample position between the respective color components in accordance with the edge direction detected in step S2. Here, the focal position determination based on axial chromatic aberration uses the relationship shown in FIG. 5 to determine the difference in blur width between two colors of R and G, G and B, and R and B at the time of focusing. The result of the difference between the three sets of two-color blur widths is calculated and weighted for each to obtain a final determination result.

まず、R、Gr、Gb、Bの4種のカラーフィルタからなるベイヤー配列RAW画像を補間する場合はGrとGbの両方を用いてG面画像が生成されるが、本実施の形態ではGrとGbを区別して扱う。これは図8に示したような画素加算を行うと、図12(a)に示すように、縮小ベイヤー配列RAW画像のR´画素の元ベイヤー配列RAW画像のR画素に対する参照範囲が3×3画素であるのに対して、図12(b)に示すように、縮小ベイヤー配列RAW画像のGr´+Gb´画素の元のベイヤー配列RAW画像のGr+Gb画素に対する参照範囲は4×4画素となっており、Gr´+Gb´画素をG画素として使用するとRに対するGの解像度が若干悪化して、軸上色収差による微小なボケ幅の差を測る場合に悪影響が出るためである。   First, when interpolating a Bayer array RAW image composed of four color filters of R, Gr, Gb, and B, a G plane image is generated using both Gr and Gb. In this embodiment, Gr and Gb is distinguished and handled. When pixel addition as shown in FIG. 8 is performed, as shown in FIG. 12A, the reference range of the R ′ pixel of the reduced Bayer array RAW image to the R pixel of the original Bayer array RAW image is 3 × 3. In contrast to the pixel, as shown in FIG. 12B, the reference range for the Gr + Gb pixel of the original Bayer array RAW image of the Gr ′ + Gb ′ pixel of the reduced Bayer array RAW image is 4 × 4 pixels. This is because if the Gr ′ + Gb ′ pixel is used as a G pixel, the resolution of G with respect to R is slightly deteriorated, and there is an adverse effect when a minute difference in blur width due to axial chromatic aberration is measured.

一方Gr´とGb´を区別して扱えば、図12(c)に示すように、例えば縮小ベイヤー配列RAW画像のGr´画素の元RAW画像Gr画素に対する参照範囲は3×3画素となってR画素の参照範囲と等しくなり、解像度を一致させることが出来る。   On the other hand, if Gr ′ and Gb ′ are distinguished from each other, as shown in FIG. 12C, for example, the reference range of the Gr ′ pixel of the reduced Bayer array RAW image to the original RAW image Gr pixel is 3 × 3 pixels. It becomes equal to the reference range of the pixel, and the resolution can be matched.

次に、制御装置104は、エッジの方向に応じて軸上色収差による焦点位置判定を行う二色の組み合わせごとに、使用する画素の組み合わせを選別する。本実施の形態では以下の(a)〜(c)3つの場合で分ける。   Next, the control device 104 selects a combination of pixels to be used for each combination of two colors for performing focal position determination based on axial chromatic aberration according to the edge direction. In this embodiment, the following three cases (a) to (c) are used.

(a)図13(a)に示すような水平方向エッジの場合
この場合は、RとGの組み合わせとして、図13(b)に示すようにR画素とGr画素とを選別し、GとBの組み合わせとして、図13(c)に示すようにGb画素とB画素とを選別する。このように選ぶことで、図13(b)、(c)に示すように水平方向エッジに対してエッジを横切る方向にRとG、GとBのそれぞれの組み合わせで同じ解像度とサンプル位置にすることができる。この場合、RとBの組み合わせに対しては解像度は一致するがサンプル位置がずれる。そのため、RとBで求めた結果は使用しないか、RとBで求めた結果をRとG、GとBで求めた結果よりも重みを低くして用いる。
(A) In the case of a horizontal edge as shown in FIG. 13A In this case, as a combination of R and G, R and Gr pixels are selected as shown in FIG. As a combination, a Gb pixel and a B pixel are selected as shown in FIG. By selecting in this way, as shown in FIGS. 13B and 13C, the same resolution and sample position are obtained in the respective combinations of R and G and G and B in the direction crossing the edge with respect to the horizontal edge. be able to. In this case, the resolution matches the combination of R and B, but the sample position is shifted. Therefore, the result obtained with R and B is not used, or the result obtained with R and B is used with a lower weight than the result obtained with R and G, and G and B.

(b)図14(a)に示すような垂直方向エッジの場合
この場合は、RとGの組み合わせとして、図14(b)に示すようにR画素とGb画素とを選別し、GとBの組み合わせとして、図14(c)に示すようにGr画素とB画素とを選別する。このように選ぶことで、図14(b)、(c)に示すように垂直方向エッジに対してエッジを横切る方向にRとG、GとBのそれぞれの組み合わせで同じ解像度とサンプル位置にすることができる。この場合も上述した(a)の場合と同様にRとBの組み合わせに対しては解像度は一致するがサンプル位置がずれる。そのため、RとBで求めた結果は使用しないか、RとBで求めた結果をRとG、GとBで求めた結果よりも重みを低くして用いる。
(B) Case of vertical edge as shown in FIG. 14A In this case, as a combination of R and G, R and Gb pixels are selected as shown in FIG. As a combination, a Gr pixel and a B pixel are selected as shown in FIG. By selecting in this way, as shown in FIGS. 14B and 14C, the same resolution and sample position are obtained in the respective combinations of R and G and G and B in the direction across the edge with respect to the vertical edge. be able to. Also in this case, as in the case of (a) described above, for the combination of R and B, the resolution is the same, but the sample position is shifted. Therefore, the result obtained with R and B is not used, or the result obtained with R and B is used with a lower weight than the result obtained with R and G, and G and B.

(c)図15(a)に示すような斜め方向エッジの場合
この場合は、図15(b)に示すように、R画素とB画素の組み合わせによりRとBとを同じ解像度とサンプル位置にすることが出来る。この場合についてはRとG、GとBの組み合わせに対してサンプル位置はずれるが、解像度についてはGr画素かGb画素のいずれか片方のみを用いることで一致させることが出来る。よって、RとG、GとBで求めた結果は使用しないか、RとG、GとBで求めた結果をRとBで求めた結果よりも重みを低くして用いる。
(C) In the case of an oblique edge as shown in FIG. 15 (a) In this case, as shown in FIG. 15 (b), R and B are set to the same resolution and sample position by a combination of R and B pixels. I can do it. In this case, the sample position is shifted with respect to the combination of R and G and G and B, but the resolution can be matched by using only one of the Gr pixel and the Gb pixel. Therefore, the results obtained from R and G and G and B are not used, or the results obtained from R and G, G and B are used with a lower weight than the results obtained from R and B.

その後、ステップS6へ進み、制御装置104は、ステップS5で選別した画素の組から軸上色収差による焦点位置判定を行って処理を終了する。具体的には、制御装置104は、ステップS5で選別した画素の組を対象として、第1の実施の形態における図2のステップS4〜S14の処理を実行する。すなわち、第1の実施の形態では、RとGとの間に軸上色収差がある場合の例について説明したが、このRとGに代えて、ステップS5で選別した画素の組を対象として図2のステップS4〜S14の処理を実行する。   Thereafter, the process proceeds to step S6, where the control device 104 performs a focal position determination based on axial chromatic aberration from the pixel group selected in step S5, and ends the process. Specifically, the control device 104 executes the processes of steps S4 to S14 of FIG. 2 in the first embodiment for the pixel group selected in step S5. That is, in the first embodiment, an example in which axial chromatic aberration is present between R and G has been described. However, instead of R and G, a set of pixels selected in step S5 is a target. Steps S4 to S14 of step 2 are executed.

以上説明した第2の実施の形態によれば、以下のような効果を得ることができる。
制御装置104は、入力画像に含まれるエッジの方向に応じて、軸上色収差以外の要因で異なった解像度を一致させるための画素の組み合わせを選別するようにした。これによって、入力画像に含まれるエッジの条件によらず軸上色収差に起因する二色間のエッジボケ幅差の合焦状態における基準値を揃えることができ、合焦状態における基準値との大小を比較して行う焦点位置検出の精度を向上することが出来る。また、被写体追尾や動画撮影における合焦動作を行う場合には、入力画像内で被写体が移動したりしてエッジ方向が回転したり、照明が変化して被写体色が変化しても合焦状態における基準値が変化しなくなるため、安定した軸上色収差を利用した焦点状態検出を行って合焦調整が可能となる。さらに、使用する画素を選別して制限することで扱う画素データ量が抑えられ、補間処理も不要となるため計算コストが削減されて焦点位置検出処理が高速化されるといった副次的な効果も期待できる。
According to the second embodiment described above, the following effects can be obtained.
The control device 104 selects pixel combinations for matching different resolutions due to factors other than axial chromatic aberration, according to the direction of the edge included in the input image. As a result, the reference value in the focused state of the edge blur width difference between the two colors caused by the longitudinal chromatic aberration can be aligned regardless of the edge condition included in the input image, and the magnitude of the reference value in the focused state can be increased or decreased. It is possible to improve the accuracy of focal position detection performed in comparison. In addition, when performing focusing operations in subject tracking or movie shooting, the subject is in focus even if the subject moves within the input image and the edge direction rotates, or the illumination changes and the subject color changes. Since the reference value does not change at this time, it is possible to perform focus adjustment by performing focus state detection using stable axial chromatic aberration. Furthermore, by selecting and limiting the pixels to be used, the amount of pixel data to be handled is suppressed, and no interpolation processing is required, so that the calculation cost is reduced and the focus position detection processing is speeded up. I can expect.

―第3の実施の形態―
第3の実施の形態では、入力画像に軸上色収差以外の各色成分間の解像度変化が含まれる状況に対しても、入力画像に対して単純な補正処理を施すことにより、精度の高い軸上色収差による焦点位置判定を行う方法について説明する。本実施の形態では、判定に用いる画像で発生する各色成分間の解像度変化を打ち消す補正処理をあらかじめ求めておき、焦点位置判定を行う前にこの補正処理を用いて入力画像に補正を行ってから焦点位置判定を行う。
-Third embodiment-
In the third embodiment, even when the input image includes a change in resolution between color components other than axial chromatic aberration, a simple correction process is performed on the input image, thereby providing a highly accurate on-axis. A method for performing focal position determination based on chromatic aberration will be described. In the present embodiment, a correction process for canceling the resolution change between each color component generated in the image used for the determination is obtained in advance, and the input image is corrected using this correction process before performing the focus position determination. Determine the focal position.

第3の実施の形態では、エッジ方向に依存して各色成分間の解像度変化が発生する画素加算読み出しと補間の場合を例にとり、処理の流れを説明する。図16は、第3の実施の形態における焦点位置検出処理の流れを示すフローチャート図である。   In the third embodiment, the flow of processing will be described by taking as an example the case of pixel addition reading and interpolation in which a resolution change between each color component occurs depending on the edge direction. FIG. 16 is a flowchart showing the flow of the focus position detection process in the third embodiment.

ステップS1において、制御装置104は、ベイヤー配列の撮像素子から画素加算を行って画像を読み出す。その後、ステップS2へ進み、制御装置104は、ステップS1で読み出した画像に対して補間処理を施す。ここで、補間装置が画素加算読み出しを想定していない場合には、エッジ方向により各色成分間の解像度が変化した画像が生成される。   In step S <b> 1, the control device 104 reads out an image by performing pixel addition from the Bayer array image sensor. Thereafter, the process proceeds to step S2, and the control device 104 performs an interpolation process on the image read out in step S1. Here, when the interpolation device does not assume pixel addition reading, an image is generated in which the resolution between the color components changes depending on the edge direction.

その後、ステップS3へ進み、制御装置104は、入力画像にエッジ方向依存性が存在するか否かを判断する。本実施の形態では、本発明が目的とする軸上色収差による焦点位置検出処理に入力される画像と同一の撮像素子、画素加算読み出し駆動、補間装置、画像処理等の組み合わせにより入力画像の持つエッジ方向依存性をあらかじめ調査しておく。例えば、図17(a)、(b)に示すような白黒の市松模様を画素配列に対して縦横、斜めに置いた画像をコントラストAFなどにより合焦状態で撮影して、入力画像の持つエッジ方向依存性を調査しておき、その調査結果に基づいてステップS3の判断を行う。   Thereafter, the process proceeds to step S3, and the control device 104 determines whether or not the input image has edge direction dependency. In this embodiment, the edge of the input image is obtained by combining the same image sensor, pixel addition read drive, interpolation device, image processing, and the like as the image input to the focal position detection process based on the longitudinal chromatic aberration targeted by the present invention. Investigate the direction dependency beforehand. For example, an image in which a black and white checkered pattern as shown in FIGS. 17A and 17B is placed vertically and horizontally and obliquely with respect to the pixel array is photographed in a focused state by contrast AF or the like, and the edge of the input image The direction dependency is investigated, and the determination in step S3 is performed based on the investigation result.

ステップS3で否定判断した場合には、入力画像の持つエッジ方向依存性を補正するための処理は必要でないことから、後述するステップS5へ進む。これに対して、ステップS3で肯定判断した場合には、入力画像の持つエッジ方向依存性を補正するための処理が必要であると判断して、ステップS4へ進む。ステップS4では、制御装置104は、ステップS2で補間処理が行われた画像に対して、入力画像の持つ解像度のエッジ方向依存性を補正するための処理を実行する。具体的には、以下のように処理を行う。   If a negative determination is made in step S3, processing for correcting the edge direction dependency of the input image is not necessary, and the process proceeds to step S5 described later. On the other hand, if an affirmative determination is made in step S3, it is determined that processing for correcting the edge direction dependency of the input image is necessary, and the process proceeds to step S4. In step S4, the control device 104 executes a process for correcting the edge direction dependency of the resolution of the input image on the image subjected to the interpolation process in step S2. Specifically, processing is performed as follows.

まず、制御装置104は、軸上色収差による焦点位置検出処理で使用されるものと同一の方法により二色間のエッジボケ幅差Δωをエッジ方向ごとに算出する。ここではRとGの色成分間に生じる軸上色収差から合焦状態を判定する場合について説明する。制御装置104は、合焦状態でのチャート撮影画像からRとGの色成分間のエッジボケ幅差を算出してこれをΔωAF(R−G)とする。ここで、合焦状態におけるRのボケ幅をωAF_R、Gのボケ幅をωAF_Gとすると、ΔωAF(R−G)=ωAF_R−ωAF_Gの関係が存在する。   First, the control device 104 calculates the edge blur width difference Δω between two colors for each edge direction by the same method as that used in the focal position detection process based on longitudinal chromatic aberration. Here, a case where the in-focus state is determined from the longitudinal chromatic aberration generated between the R and G color components will be described. The control device 104 calculates the edge blur width difference between the R and G color components from the chart photographed image in the focused state, and sets this as ΔωAF (RG). Here, if the blur width of R in the in-focus state is ωAF_R and the blur width of G is ωAF_G, there is a relationship of ΔωAF (RG) = ωAF_R−ωAF_G.

ΔωAF(R−G)のエッジ方向による変化をプロットした結果を図18に示す。図18では、縦横斜めの8方向のエッジについてΔωAF(R−G)の算出結果をプロットした例を示している。この図18では、エッジ方向が撮像素子配列に対するエッジの角度が45度、225度の周辺でΔωAF(R−G)が0.0を基準としてプラス方向に変化していると見ることができる。どちらも画像上で右上から左下に伸びるエッジであり、この方向のエッジでΔωAF(R−G)がプラス方向に変化しているということは、これと直交する左上から右下にいたる方向でRの解像度が低下し、ωAF_Rが大きくなっていると解釈できる。これを補正するためには、例えば、図19(a)に示す3×3の平滑化フィルタをGの色成分のみに適用することにより、左上から右下に至る方向でGの解像度を低下させてRの解像度に一致するような平滑化を行えばよい。これにより、エッジ方向によるΔωAF(R−G)の変化は、図20(a)のように補正される。その結果、エッジ方向によるΔωAF(R−G)の変動は解消されるため、ステップS5では、どの方向のエッジについてもΔωAF(R−G)=0.0を基準値として、これとの大小により焦点位置検出処理を行うことが可能となる。   FIG. 18 shows the result of plotting the change of ΔωAF (RG) due to the edge direction. FIG. 18 shows an example in which the calculation result of ΔωAF (RG) is plotted with respect to edges in eight directions that are slanted vertically and horizontally. In FIG. 18, it can be seen that ΔωAF (RG) changes in the plus direction with 0.0 as a reference when the edge direction is around 45 degrees and 225 degrees with respect to the image sensor array. Both are edges extending from the upper right to the lower left on the image, and ΔωAF (RG) changes in the positive direction at the edge in this direction. It can be interpreted that the resolution of ωAF_R has decreased and ωAF_R has increased. In order to correct this, for example, the 3 × 3 smoothing filter shown in FIG. 19A is applied only to the G color component, thereby reducing the resolution of G in the direction from the upper left to the lower right. Then, smoothing may be performed so as to match the resolution of R. Thus, the change in ΔωAF (RG) due to the edge direction is corrected as shown in FIG. As a result, the variation of ΔωAF (RG) due to the edge direction is eliminated. Therefore, in step S5, ΔωAF (RG) = 0.0 is set as the reference value for the edge in any direction, and depending on the magnitude thereof. The focal position detection process can be performed.

また図18からは別の解釈も可能である。すなわちエッジ方向が撮像素子配列に対するエッジの角度が135度、315度(=−45度)の周辺でΔωAF(R−G)が0.3を基準としてマイナス方向に変化していると見ても良い。この場合はどちらも画像上で左上から右下に伸びるエッジであり、この方向のエッジでΔωAF(R−G)がマイナス方向に変化しているということは、これと直交する右上から左下にいたる方向でGの解像度が低下し、ωAF_Gが大きくなっていると解釈できる。これを補正するためには、例えば、図19(b)に示す3×3の平滑化フィルタをRの色成分のみに適用することにより、右上から左下に至る方向でRの解像度を低下させてGの解像度に一致するような平滑化を行えばよい。これにより、エッジ方向によるΔωAF(R−G)の変化は、図20(b)のように補正される。その結果、エッジ方向によるΔωAF(R−G)の変動は解消されるため、ステップS5では、どの方向のエッジについてもΔωAF(R−G)=0.3を基準値として、これとの大小により焦点位置検出処理を行うことが可能となる。   Another interpretation is possible from FIG. That is, even if the edge direction is around 135 ° and 315 ° (= −45 °) with respect to the image sensor array, ΔωAF (RG) changes in the negative direction with 0.3 as a reference. good. In this case, both are edges extending from the upper left to the lower right on the image, and that ΔωAF (RG) changes in the negative direction at the edge in this direction, the upper right is orthogonal to the lower left. It can be interpreted that the resolution of G decreases in the direction and ωAF_G increases. In order to correct this, for example, by applying the 3 × 3 smoothing filter shown in FIG. 19B only to the R color component, the resolution of R is reduced in the direction from the upper right to the lower left. Smoothing that matches the resolution of G may be performed. Thus, the change in ΔωAF (RG) due to the edge direction is corrected as shown in FIG. As a result, the variation of ΔωAF (RG) due to the edge direction is eliminated. Therefore, in step S5, ΔωAF (RG) = 0.3 is used as the reference value for the edge in any direction, depending on the magnitude thereof. The focal position detection process can be performed.

後者の場合では基準値が0.3となり0とはならないが、これは特に問題とはならない。合焦状態でのΔωAF(R−G)がどのような値となるかは光学系とコントラストAFなどの合焦動作に依存し、多くの場合R、G、Bの全ての色成分で見て総合的にコントラストの良くなる状態が合焦状態と規定されるため、そのうち二色のみ(ここではRとGのみ)に注目した場合、合焦状態でもΔωAF(R−G)は0になるとは限らない。補正後の値がどの値でも良く、ΔωAF(R−G)エッジ方向に対する依存性が解消される状態に画像を補正することが重要となる。   In the latter case, the reference value is 0.3 and does not become 0, but this is not a problem. The value of ΔωAF (RG) in the in-focus state depends on the focusing operation such as the optical system and contrast AF. In many cases, it is seen with all color components of R, G, and B. Since the state where the contrast is improved overall is defined as the in-focus state, if attention is paid to only two colors (here, only R and G), ΔωAF (RG) is 0 even in the in-focus state. Not exclusively. The value after correction may be any value, and it is important to correct the image so that the dependency on the ΔωAF (RG) edge direction is eliminated.

その後、ステップS5へ進み、制御装置104は、ステップS4において各色成分間の解像度変化が補正された画像を対象として、図2のステップS4〜S14の処理を実行することにより、軸上色収差を用いた焦点位置検出を行う。その後、処理を終了する。   Thereafter, the process proceeds to step S5, and the control device 104 uses the axial chromatic aberration by executing the processes in steps S4 to S14 in FIG. The focus position is detected. Thereafter, the process ends.

以上説明した第3の実施の形態によれば、以下のような効果を得ることができる。
制御装置104は、軸上色収差以外の要因で生じる各色成分間の解像度変化を補正してから、合焦状態を判定するようにした。これによって、入力画像に含まれるエッジ方向やエッジ両側の色、エッジを横切る断面形状、撮影距離やズームポジションなど光学系の状態によらず合焦状態における軸上色収差に起因する二色間のエッジボケ幅差の基準値を揃えることができ、基準値との大小を比較して行う合焦位置検出の精度を向上することが出来る。また、被写体追尾や動画撮影における合焦動作を行う場合には、入力画像内で被写体が移動したりしてエッジ方向が回転したり、被写体が前後に移動して撮影距離が変化したり、照明条件が変化して被写体色が変化しても合焦状態における基準値が変化しなくなるため、安定した軸上色収差を利用した焦点状態検出を行って合焦調整が可能となる。
According to the third embodiment described above, the following effects can be obtained.
The control device 104 corrects the change in resolution between the color components caused by factors other than axial chromatic aberration, and then determines the in-focus state. As a result, the edge blur between two colors caused by axial chromatic aberration in the focused state regardless of the state of the optical system, such as the edge direction and the colors on both sides of the edge, the cross-sectional shape across the edge, the shooting distance and the zoom position included in the input image The reference value of the width difference can be made uniform, and the accuracy of in-focus position detection performed by comparing the difference value with the reference value can be improved. Also, when performing focusing operations in subject tracking or video shooting, the subject moves in the input image and the edge direction rotates, the subject moves back and forth, the shooting distance changes, Since the reference value in the in-focus state does not change even if the subject color changes due to a change in conditions, the focus adjustment can be performed by performing a focus state detection using stable axial chromatic aberration.

―変形例―
なお、上述した実施の形態のカメラは、以下のように変形することもできる。
(1)上述した第1の実施の形態では、式(12)を用いて換算エッジボケ幅差Δwを算出する例について説明した。しかしながら、以下の(A)〜(D)に示す何れかの方法により換算エッジボケ幅差Δwを算出するようにしてもよい。
-Modification-
The camera according to the above-described embodiment can be modified as follows.
(1) In the above-described first embodiment, the example in which the converted edge blur width difference Δw is calculated using Expression (12) has been described. However, the converted edge blur width difference Δw may be calculated by any of the following methods (A) to (D).

(A)制御装置104は、評価領域内から検出され、図4に示したように正規化されたエッジから直接R成分のエッジのボケ幅wRとG成分のエッジのボケ幅wGとを測定し、次式(13)により換算エッジボケ幅差Δwを算出するようにしてもよい。この方法によれば、簡易な計算でΔwを算出できるため、上述した実施の形態よりもΔwを算出するための計算量を少なくすることができる。

Figure 0005163733
(A) The control device 104 measures the blur width wR of the R component edge and the blur width wG of the G component edge directly from the normalized edge detected as shown in FIG. The converted edge blur width difference Δw may be calculated by the following equation (13). According to this method, since Δw can be calculated by simple calculation, the amount of calculation for calculating Δw can be reduced as compared with the embodiment described above.
Figure 0005163733

(B)制御装置104は、評価領域内から検出され、図4に示したように正規化されたエッジの勾配を測定し、間接的に換算エッジボケ幅差Δwを算出するようにしてもよい。具体的には、R成分のエッジのボケ幅wRとR成分のエッジの勾配gRとエッジ両側のコントラスト差Cとの間には次式(14)に示す関係があり、G成分のエッジのボケ幅wGとG成分のエッジの勾配gGとエッジ両側のコントラスト差Cとの間には次式(15)に示す関係がある。

Figure 0005163733
Figure 0005163733
(B) The control device 104 may measure the gradient of the edge detected from the evaluation region and normalized as shown in FIG. 4, and indirectly calculate the converted edge blur width difference Δw. Specifically, the relationship of the blur width wR of the R component edge, the gradient gR of the R component edge, and the contrast difference C on both sides of the edge is expressed by the following equation (14). The relationship represented by the following equation (15) exists between the width wG, the gradient g of the edge of the G component, and the contrast difference C on both sides of the edge.
Figure 0005163733
Figure 0005163733

このため、制御装置104は、次式(16)により換算エッジボケ幅差Δwを算出することができる。

Figure 0005163733
この方法の場合も、簡易な計算でΔwを算出できるため、上述した実施の形態よりもΔwを算出するための計算量を少なくすることができる。 For this reason, the control apparatus 104 can calculate conversion edge blur width difference (DELTA) w by following Formula (16).
Figure 0005163733
Also in this method, since Δw can be calculated by a simple calculation, the amount of calculation for calculating Δw can be reduced as compared with the above-described embodiment.

(C)制御装置104は、エッジ領域Eの色差和を測定し、間接的にΔwを算出するようにしてもよい。例えば、図4に示した正規化後のR成分のエッジR(x)とG成分のエッジG(x)とを考えると、エッジ領域EのR、G2色間の色差和ΔaR−Gは、図6に示すR成分のエッジの輝度面積aRとG成分のエッジの輝度面積aGとを用いて、次式(17)により算出される。
ΔaR−G=aR−aG ・・・(17)
(C) The control device 104 may measure the sum of color differences in the edge region E and indirectly calculate Δw. For example, considering the normalized R component edge R (x) and G component edge G (x) shown in FIG. 4, the color difference sum ΔaR-G between the R and G2 colors of the edge region E is Using the brightness area aR of the edge of the R component and the brightness area aG of the edge of the G component shown in FIG.
ΔaR−G = aR−aG (17)

ここで、換算エッジにおいては、点6a、点6b、点6cを頂点とする三角形の面積により表されるR成分のエッジの輝度面積aRと、R成分のエッジのボケ幅wRと、エッジ両側のコントラスト差Cとの間には、次式(18)に示す関係があり、点6d、点6e、点6fを頂点とする三角形の面積により表されるG成分のエッジの輝度面積aGと、G成分のエッジのボケ幅wGと、エッジ両側のコントラスト差Cとの間には、次式(19)に示す関係がある。

Figure 0005163733
Figure 0005163733
Here, in the converted edge, the luminance area aR of the R component edge represented by the area of the triangle having the points 6a, 6b, and 6c as vertices, the blur width wR of the R component edge, There is a relationship expressed by the following equation (18) between the contrast difference C, the luminance area aG of the edge of the G component represented by the area of a triangle having the points 6d, 6e, and 6f as vertices, and G The relationship expressed by the following equation (19) exists between the blur width wG of the edge of the component and the contrast difference C on both sides of the edge.
Figure 0005163733
Figure 0005163733

このため、制御装置104は、次式(20)により換算エッジボケ幅差Δwを算出することができる。

Figure 0005163733
この方法の場合も、簡易な計算でΔwを算出できるため、上述した実施の形態よりもΔwを算出するための計算量を少なくすることができる。 Therefore, the control device 104 can calculate the converted edge blur width difference Δw by the following equation (20).
Figure 0005163733
Also in this method, since Δw can be calculated by a simple calculation, the amount of calculation for calculating Δw can be reduced as compared with the above-described embodiment.

(D)制御装置104は、図4に示した正規化後のR成分のエッジR(x)とG成分のエッジG(x)とにおけるエッジ領域Eを、図7に示すようにエッジ領域Eの中間値を境にしてサブエッジ領域ELとEHとに分割する。これにより、R成分のエッジのボケ幅wRとG成分のエッジのボケ幅wGは、それぞれRとGに共通な幅で2分割される。すなわち、R成分のエッジのボケ幅wRはエッジ領域Eの中間値を境にそれぞれwR/2ずつに2分割され、G成分のエッジのボケ幅wGはエッジ領域Eの中間値を境にそれぞれwG/2ずつに2分割される。 (D) The control device 104 converts the edge region E in the R component edge R (x) and the G component edge G (x) after normalization shown in FIG. Are divided into sub-edge regions EL and EH. As a result, the blur width wR of the R component edge and the blur width wG of the G component edge are divided into two by a width common to R and G, respectively. In other words, the blur width wR of the edge of the R component is divided into two parts each of wR / 2 with the intermediate value of the edge region E as the boundary, and the blur width wG of the edge of the G component is wG with the intermediate value of the edge region E as the boundary. / 2 divided into two.

次に、制御装置104は、分割した各サブエッジ領域ELとEHとのそれぞれについて、2色間の色差和を算出する。この色差和は、上述した(C)で式(17)に示したようにR成分のエッジの輝度面積とG成分のエッジの輝度面積との差分となる。図7に示す例の場合には、サブエッジ領域ELについてのR、G2色間の色差和ΔaLR−Gは、点7a、点7b、点7cを頂点とする三角形の面積と、点7a、点7d、点7cを頂点とする三角形の面積との差分となり、次式(21)により算出される。

Figure 0005163733
また、サブエッジ領域EHについてのR、G2色間の色差和ΔaHR−Gは、点7a、点7e、点7gを頂点とする三角形の面積と、点7a、点7e、点7f、点7gを頂点とする台形の面積との差分となり、次式(22)により算出される。
Figure 0005163733
Next, the control device 104 calculates the color difference sum between the two colors for each of the divided sub-edge regions EL and EH. This sum of color differences is the difference between the luminance area of the edge of the R component and the luminance area of the edge of the G component as shown in the equation (17) in (C) described above. In the case of the example shown in FIG. 7, the color difference sum ΔaLR-G between the R and G2 colors for the sub-edge region EL is the area of a triangle having points 7a, 7b and 7c as vertices, and points 7a and 7d. , The difference from the area of the triangle having the point 7c as a vertex, and is calculated by the following equation (21).
Figure 0005163733
Further, the color difference sum ΔaHR-G between the R and G2 colors for the sub-edge region EH is the area of the triangle having the points 7a, 7e, and 7g as vertices, and the points 7a, 7e, 7f, and 7g as vertices. And is calculated by the following equation (22).
Figure 0005163733

制御装置104は、式(21)、(22)に基づいて、換算エッジボケ幅差Δw、すなわちΔwR−Gを次式(23)により算出することができる。

Figure 0005163733
この方法によれば、軸上色収差がある2色で共通するサブエッジ領域EL、EHを参照して色差和を算出するため、上述した(A)〜(C)の方法よりも精度良く換算エッジボケ幅差Δwを算出することができる。 The control device 104 can calculate the converted edge blur width difference Δw, that is, ΔwR−G by the following equation (23) based on the equations (21) and (22).
Figure 0005163733
According to this method, since the color difference sum is calculated with reference to the sub-edge regions EL and EH that are common to two colors having axial chromatic aberration, the converted edge blur width is more accurate than the methods (A) to (C) described above. The difference Δw can be calculated.

なお、ここではエッジ領域Eを中間値を境にして2つのサブエッジ領域ELとEHとに2分割する例について説明したが、エッジ領域Eをさらに細かく分割し、それぞれのサブエッジ領域を対象として色差和を算出するようにしてもよい。この場合、各サブエッジ領域ごとに算出された色差和に対して適切な加重線形和をとることによって、換算エッジボケ幅差Δwを間接的に算出することができる。   Here, an example in which the edge region E is divided into two sub-edge regions EL and EH with an intermediate value as the boundary has been described. However, the edge region E is further divided into sub-edge regions, and the color difference sums for the respective sub-edge regions. May be calculated. In this case, the converted edge blur width difference Δw can be indirectly calculated by taking an appropriate weighted linear sum with respect to the color difference sum calculated for each sub-edge region.

(2)上述した第1の実施の形態では、制御装置104は、エッジ領域Eに属する画素の平均値Emeanを閾値として用いて、エッジ領域Eをサブエッジ領域ELとEHとに分離する例について説明した。しかしながら、制御装置104は、フラット領域Fやエッジ領域Eにおける画素値の統計的分布に基づく値を閾値として用い、エッジ領域Eをサブエッジ領域ELとEHとに分離するようにしてもよい。このとき、サブエッジ領域ELとEHは、それぞれに重複する画素を含むようにしてもよい。 (2) In the first embodiment described above, the control device 104 describes an example in which the edge region E is separated into the sub-edge regions EL and EH using the average value Emean of the pixels belonging to the edge region E as a threshold value. did. However, the control device 104 may use a value based on a statistical distribution of pixel values in the flat region F or the edge region E as a threshold value and separate the edge region E into sub-edge regions EL and EH. At this time, the sub-edge regions EL and EH may include overlapping pixels.

(3)上述した第1の実施の形態では、制御装置104は、エッジ領域Eを2つのサブエッジ領域ELとEHとに分離する例について説明した。しかしながら、制御装置104は、エッジ領域Eを3つ以上のサブエッジ領域E1〜Enに分離するようにしてもよい。この場合、上述した評価値Iに代えて、所定の係数によるE1〜Enの色差和の係数加重演算により評価値Iと等価な値を算出してもよいし、それぞれのサブエッジ領域さらに階層的に分類して評価値Iを算出してもよい。また、評価領域画像内に換算エッジへの近似が成り立たないエッジが存在する場合には、評価値Iに対して、それを考慮した補正を行うようにしてもよい。 (3) In the above-described first embodiment, the control device 104 has described the example in which the edge region E is separated into two sub-edge regions EL and EH. However, the control device 104 may separate the edge region E into three or more sub-edge regions E1 to En. In this case, instead of the above-described evaluation value I, a value equivalent to the evaluation value I may be calculated by coefficient weighting calculation of the color difference sum of E1 to En by a predetermined coefficient, and each sub-edge region is further hierarchically arranged. The evaluation value I may be calculated by classification. If there is an edge in the evaluation area image that cannot be approximated to the converted edge, the evaluation value I may be corrected in consideration thereof.

(4)上述した第1の実施の形態では、エッジ領域を2つのサブエッジ領域ELとEHとに分離を行う前に画像のアップサンプリングを行うようにすれば、合焦位置精度をさらに向上させることできる。特にレンズ位置が合焦状態に近くエッジ幅がシャープな場合にアップサンプリングによって領域分離の分解能が改善されるため、大きな精度向上が見込まれる。このとき、計算負荷の許される範囲で高い拡大倍率のアップサンプリングを行えばよい。また画像拡大時の画素補間方法は周囲の画素を用いた単純な双線形補間でよい。 (4) In the first embodiment described above, if the image is upsampled before the edge region is separated into the two sub-edge regions EL and EH, the in-focus position accuracy can be further improved. it can. In particular, when the lens position is close to the in-focus state and the edge width is sharp, the resolution of the region separation is improved by upsampling, so a great improvement in accuracy is expected. At this time, upsampling at a high magnification may be performed within a range where calculation load is allowed. The pixel interpolation method at the time of image enlargement may be simple bilinear interpolation using surrounding pixels.

(5)上述した第2の実施の形態では、2×2画素加算読出した縮小ベイヤー配列RAW画像を例に説明したが本発明の適用範囲はそれに限定されない。例えば、本発明は元ベイヤー配列RAW画像に対して適用しても良い。ベイヤー配列RAW画像の補間処理において輝度色差面での補間を行う場合やエッジ強調効果が含まれる場合がある。それらは画質面では優れた画像を生成するが、軸上色収差を用いた焦点位置検出に対しては微妙な二色間のボケ幅の差を消す効果をもたらす事もあり、そういった場合には補間を行わないRAW画像を用いた方が高精度な焦点位置検出ができる。また本発明は補間済みの画像に対して適用しても良い。ベイヤー配列RAW画像を補間して全画素でRGBの値を持つ画像から、元ベイヤー配列RAW画像に由来する画素のみを選別して用いることで、補間等画像処理の影響を受けた各色成分間の解像度変化の影響を避けることが可能となる場合がある。いずれの場合についても、入力された画像から、軸上色収差による焦点位置判定を行う二色の組み合わせのそれぞれについて、解像度とサンプル位置がなるべく一致する画素の組み合わせを選別することが重要となる。 (5) In the second embodiment described above, a reduced Bayer array RAW image obtained by adding and reading 2 × 2 pixels has been described as an example, but the scope of application of the present invention is not limited thereto. For example, the present invention may be applied to an original Bayer array RAW image. In the Bayer array RAW image interpolation processing, there is a case where interpolation on the luminance color difference plane is performed or an edge enhancement effect is included. Although they produce excellent images in terms of image quality, they may have the effect of eliminating subtle differences in the blur width between two colors for focal position detection using axial chromatic aberration. In such cases, interpolation is performed. More accurate focus position detection can be performed by using a RAW image that is not performed. The present invention may be applied to an interpolated image. By interpolating the Bayer array RAW image and selecting only the pixels derived from the original Bayer array RAW image from the images having RGB values in all pixels, it is possible to select between the color components affected by image processing such as interpolation. It may be possible to avoid the effect of resolution changes. In any case, it is important to select, from the input image, a combination of pixels whose resolution and sample position match as much as possible for each of the two color combinations for performing focal position determination based on axial chromatic aberration.

(6)上述した第2、第3の実施の形態は、画素加算読み出しに最適化されていない補間装置により生成される画像を例としてあげたが、本発明の対象はこれに限定するものではない。例えば、画質改善を目的としたエッジ方向に適応的な補間処理、ノイズ除去、エッジ強調や色調変換などといったあらゆる画像処理や、撮像素子が原因で各色成分間の解像度が変化した画像も対象に含む。また各色成分間の解像度が変化する条件はエッジ方向によるものだけでなく、エッジ両側の色、エッジを横切る断面形状(エッジの形状)、撮影距離やズームポジションなど光学系の状態によるものなども含まれる。 (6) In the second and third embodiments described above, an image generated by an interpolation device that is not optimized for pixel addition readout is taken as an example, but the subject of the present invention is not limited to this. Absent. For example, all image processing such as interpolation processing adaptive to the edge direction for the purpose of improving image quality, noise removal, edge enhancement and tone conversion, and images in which the resolution between the color components has changed due to the image sensor are also included. . The conditions for changing the resolution between each color component include not only those depending on the edge direction, but also those depending on the state of the optical system such as the color on both sides of the edge, the cross-sectional shape (edge shape) across the edge, the shooting distance and zoom position, etc. It is.

(7)上述した第3の実施の形態では、図18に示したように、縦横斜めの8方向のエッジについてΔωAF(R−G)のエッジ方向による変化を測定する例について説明した。しかしながら、さらに細かいエッジの傾きに対して変化を調査し、より精度の高い補正方法と係数を決定しても良い。 (7) In the above-described third embodiment, as shown in FIG. 18, an example has been described in which the change in ΔωAF (RG) due to the edge direction of the edges in eight vertical and horizontal diagonal directions is measured. However, a more accurate correction method and coefficient may be determined by investigating changes with respect to a finer edge inclination.

(8)上述した第3の実施の形態では、図6のステップS4において、平滑化により補正を行う例を示したが、補正の手段としては平滑化に限定されない。例えば、エッジ強調などの各色成分間の解像度変化を補正しうる処理であってもよい。またエッジ方向に対する変化以外にも、エッジ両側の色、エッジを横切る断面形状、撮影距離やズームポジションなど光学系の状態による変化を同じように調べて、この影響を補正する手段をあらかじめ調べて決定してもよい。また、ステップS4では、入力画像によるエッジの特徴を都度調べて補正の強度をあらかじめ決められた係数から適応的に変化させても良い。 (8) In the above-described third embodiment, an example in which correction is performed by smoothing in step S4 of FIG. 6 has been described, but the correction means is not limited to smoothing. For example, processing that can correct a change in resolution between color components such as edge enhancement may be used. In addition to the change to the edge direction, the same change is checked by the optical system state, such as the color on both sides of the edge, the cross-sectional shape across the edge, the shooting distance and the zoom position, and the means to correct this effect is determined in advance. May be. In step S4, the feature of the edge of the input image may be examined each time, and the correction strength may be adaptively changed from a predetermined coefficient.

(9)上述した第1〜第3の実施の形態では、本発明をカメラ100に適用する例について説明した。しかしながら、オートフォーカス機能を備えた他の撮影装置にも本発明を適用することができる。 (9) In the above-described first to third embodiments, the example in which the present invention is applied to the camera 100 has been described. However, the present invention can also be applied to other photographing apparatuses having an autofocus function.

なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。また、上述の実施の形態と複数の変形例を組み合わせた構成としてもよい。   Note that the present invention is not limited to the configurations in the above-described embodiments as long as the characteristic functions of the present invention are not impaired. Moreover, it is good also as a structure which combined the above-mentioned embodiment and a some modification.

100 カメラ、101 操作部材、102 レンズ、103 撮像素子、104 制御装置、105 メモリカードスロット、106 モニタ 100 Camera, 101 Operation member, 102 Lens, 103 Image sensor, 104 Control device, 105 Memory card slot, 106 Monitor

Claims (13)

軸上色収差をもつ光学系が形成する被写体像を入力画像として入力する画像入力手段と、
前記画像入力手段により入力された前記入力画像から各色成分ごとのエッジを検出するエッジ検出手段と、
前記エッジ検出手段により検出された各色成分ごとのエッジに基づいて、撮像素子からの画素加算読み出しあるいは画像処理の際に、エッジ方向に起因して生じる各色成分間の解像度変化を補正する補正手段と、
前記補正手段により前記各色成分間の解像度変化が補正された後の画像から検出された各色成分ごとのエッジのうち、前記軸上色収差がある2つの色成分のエッジのボケ幅の差を算出する算出手段と、
前記算出手段によって算出された前記ボケ幅の差に基づいて、合焦状態を判定する合焦状態判定手段と、を備えることを特徴とする撮像装置。
Image input means for inputting a subject image formed by an optical system having axial chromatic aberration as an input image;
Edge detection means for detecting an edge for each color component from the input image input by the image input means;
Correction means for correcting a change in resolution between the color components caused by the edge direction at the time of pixel addition reading from the image sensor or image processing based on the edge of each color component detected by the edge detection means; ,
The difference between the blur widths of the edges of the two color components having the longitudinal chromatic aberration among the edges of the color components detected from the image after the resolution change between the color components is corrected by the correction unit is calculated. A calculation means;
An imaging apparatus comprising: an in-focus state determining unit that determines an in-focus state based on the difference in blur width calculated by the calculating unit.
請求項1に記載の撮像装置において、
前記算出手段は、前記軸上色収差がある2つの色成分のエッジの色差和に基づいて所定の評価値を算出し、算出した前記評価値を用いて前記ボケ幅の差を算出することを特徴とする撮像装置。
The imaging device according to claim 1,
The calculating means calculates a predetermined evaluation value based on a color difference sum of edges of two color components having the axial chromatic aberration, and calculates the difference in blur width using the calculated evaluation value. An imaging device.
請求項2に記載の撮像装置において、
前記算出手段は、前記軸上色収差がある2つの色成分のエッジを平坦部とエッジ部とに分類し、前記エッジ部を対象として前記色差和を算出することを特徴とする撮像装置。
The imaging device according to claim 2,
The imaging device classifies edges of two color components having axial chromatic aberration into a flat portion and an edge portion, and calculates the color difference sum for the edge portion as an object.
請求項1に記載の撮像装置において、
前記算出手段は、前記軸上色収差がある2つの色成分のエッジのボケ幅をそれぞれ測定し、該測定結果に基づいて前記ボケ幅の差を算出することを特徴とする撮像装置。
The imaging device according to claim 1,
The image-capturing apparatus, wherein the calculating unit measures a blur width of edges of two color components having the longitudinal chromatic aberration, and calculates a difference between the blur widths based on the measurement result.
請求項1に記載の撮像装置において、
前記算出手段は、前記軸上色収差がある2つの色成分のエッジのボケ幅とエッジの勾配、およびエッジ両側のコントラスト差に基づいて前記ボケ幅の差を算出することを特徴とする撮像装置。
The imaging device according to claim 1,
The imaging unit calculates the difference between the blur widths based on a blur width and an edge gradient of two edge components having axial chromatic aberration and a contrast difference between both sides of the edge.
請求項1に記載の撮像装置において、
前記算出手段は、前記軸上色収差がある2つの色成分のエッジの輝度面積と、エッジ両側のコントラスト差に基づいて前記ボケ幅の差を算出することを特徴とする撮像装置。
The imaging device according to claim 1,
The imaging device calculates the difference in blur width based on a luminance area of an edge of two color components having axial chromatic aberration and a contrast difference between both sides of the edge.
請求項1〜6のいずれか一項に記載の撮像装置において、
前記軸上色収差がある2つの色成分のエッジの両側のコントラスト差を無くすように補正を行う色補正手段をさらに備え、
前記算出手段は、前記補正手段によって補正が行なわれた後の画像を用いて、前記ボケ幅の差を算出することを特徴とする撮像装置。
In the imaging device according to any one of claims 1 to 6,
Color correction means for performing correction so as to eliminate the contrast difference between both sides of the edge of the two color components having the longitudinal chromatic aberration;
The image-capturing apparatus according to claim 1, wherein the calculating unit calculates the difference in blur width using an image after correction by the correcting unit.
請求項1〜7のいずれか一項に記載の撮像装置において、
前記算出手段は、前記入力画像のアップサンプリング処理を行ったのち前記ボケ幅の差を算出することを特徴とする撮像装置。
In the imaging device according to any one of claims 1 to 7,
The image pickup apparatus, wherein the calculating unit calculates the difference in blur width after performing an upsampling process on the input image.
請求項1〜8のいずれか一項に記載の撮像装置において、
前記各色成分間の解像度変化は、画像の画素配列に対するエッジ方向、エッジ両側の色、エッジの形状、光学系の状態に依存することを特徴とする撮像装置。
In the imaging device according to any one of claims 1 to 8 ,
The change in resolution between the color components depends on the edge direction with respect to the pixel arrangement of the image, the color on both sides of the edge, the shape of the edge, and the state of the optical system.
請求項1〜9に記載の撮像装置において、
前記補正手段は、他の色成分に解像度を一致させたい色成分の画素に対して、あらかじめ設定された係数の平滑化フィルタをかけることにより補正を行うことを特徴とする撮像装置。
The imaging device according to claim 1 ,
The image pickup apparatus, wherein the correction unit performs correction by applying a smoothing filter having a coefficient set in advance to a pixel of a color component whose resolution is to be matched with that of another color component.
請求項1〜9に記載の撮像装置において、
前記補正手段は、他の色成分に解像度を一致させたい色成分の画素に対して、あらかじめ設定された係数のエッジ強調フィルタをかけることにより補正を行うことを特徴とする撮像装置。
The imaging device according to claim 1 ,
The image pickup apparatus according to claim 1, wherein the correction unit performs correction by applying an edge enhancement filter having a coefficient set in advance to a pixel of a color component whose resolution is to be matched with another color component.
請求項10または11に記載の撮像装置において、
前記補正手段は、入力画像によるエッジの特徴に基づいて、前記係数を変化させることを特徴とする撮像装置。
The imaging device according to claim 10 or 11 ,
The imaging device according to claim 1, wherein the correction unit changes the coefficient based on a feature of an edge by an input image.
軸上色収差をもつ光学系が形成する被写体像を入力画像として入力する画像入力手順と、
前記画像入力手順で入力された前記入力画像から各色成分ごとのエッジを検出するエッジ検出手順と、
前記エッジ検出手順で検出した各色成分ごとのエッジに基づいて、撮像素子からの画素加算読み出しあるいは画像処理の際に、エッジ方向に起因して生じる各色成分間の解像度変化を補正する補正手順と、
前記補正手順で前記各色成分間の解像度変化が補正された後の画像から検出された各色成分ごとのエッジのうち、前記軸上色収差がある2つの色成分のエッジのボケ幅の差を算出する算出手順と、
前記算出手順で算出された前記ボケ幅の差に基づいて、合焦状態を判定する合焦状態判定手順と、をコンピュータに実行させるための焦点判定プログラム。
An image input procedure for inputting a subject image formed by an optical system having axial chromatic aberration as an input image;
An edge detection procedure for detecting an edge for each color component from the input image input in the image input procedure;
Based on the edge for each color component detected in the edge detection procedure, a correction procedure for correcting a change in resolution between the color components caused by the edge direction at the time of pixel addition reading from the image sensor or image processing ;
The difference between the blur widths of the edges of the two color components having the longitudinal chromatic aberration among the edges of the color components detected from the image after the resolution change between the color components is corrected by the correction procedure is calculated. Calculation procedure,
A focus determination program for causing a computer to execute an in-focus state determination procedure for determining an in-focus state based on the difference in blur width calculated in the calculation procedure.
JP2010274724A 2010-01-12 2010-12-09 Imaging apparatus and focus determination program Active JP5163733B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2010274724A JP5163733B2 (en) 2010-06-17 2010-12-09 Imaging apparatus and focus determination program
US12/987,437 US8958009B2 (en) 2010-01-12 2011-01-10 Image-capturing device
CN2011100080888A CN102129146A (en) 2010-01-12 2011-01-12 Image pickup device
EP11150773A EP2362258A1 (en) 2010-01-12 2011-01-12 Image-capturing device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2010138440 2010-06-17
JP2010138440 2010-06-17
JP2010274724A JP5163733B2 (en) 2010-06-17 2010-12-09 Imaging apparatus and focus determination program

Publications (2)

Publication Number Publication Date
JP2012022286A JP2012022286A (en) 2012-02-02
JP5163733B2 true JP5163733B2 (en) 2013-03-13

Family

ID=45776591

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2010274725A Active JP5223912B2 (en) 2010-01-12 2010-12-09 Imaging apparatus and focus determination program
JP2010274724A Active JP5163733B2 (en) 2010-01-12 2010-12-09 Imaging apparatus and focus determination program

Family Applications Before (1)

Application Number Title Priority Date Filing Date
JP2010274725A Active JP5223912B2 (en) 2010-01-12 2010-12-09 Imaging apparatus and focus determination program

Country Status (1)

Country Link
JP (2) JP5223912B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6074954B2 (en) * 2011-09-02 2017-02-08 株式会社ニコン Focus evaluation device, imaging device, and program
JP6196148B2 (en) * 2013-12-24 2017-09-13 エルジー ディスプレイ カンパニー リミテッド Defocus control device and defocus control method
WO2016084223A1 (en) * 2014-11-28 2016-06-02 オリンパス株式会社 Image processing apparatus, image processing method, and image processing program
JP6633624B2 (en) 2015-05-12 2020-01-22 オリンパス株式会社 Image processing apparatus, image processing method, and image processing program
JP6563131B2 (en) * 2015-12-09 2019-08-21 クオリティー ヴィジョン インターナショナル インコーポレイテッドQuality Vision International, Inc. Focusing system for telecentric optical measuring machine

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03136012A (en) * 1989-10-23 1991-06-10 Olympus Optical Co Ltd Focusing detecting device
JPH03204277A (en) * 1990-01-05 1991-09-05 Canon Inc Focus detection method
US5742892A (en) * 1995-04-18 1998-04-21 Sun Microsystems, Inc. Decoder for a software-implemented end-to-end scalable video delivery system
JP3503372B2 (en) * 1996-11-26 2004-03-02 ミノルタ株式会社 Pixel interpolation device and pixel interpolation method
JP2000165892A (en) * 1998-11-30 2000-06-16 Matsushita Electric Ind Co Ltd Pixel interpolation method and image processor
JP2003015026A (en) * 2001-07-02 2003-01-15 Konica Corp Image processing method and image processing device
JP4658401B2 (en) * 2001-07-27 2011-03-23 オリンパス株式会社 Imaging device
JP4246244B2 (en) * 2007-09-14 2009-04-02 オリンパス株式会社 Imaging device

Also Published As

Publication number Publication date
JP2012022287A (en) 2012-02-02
JP2012022286A (en) 2012-02-02
JP5223912B2 (en) 2013-06-26

Similar Documents

Publication Publication Date Title
US8958009B2 (en) Image-capturing device
JP4815807B2 (en) Image processing apparatus, image processing program, and electronic camera for detecting chromatic aberration of magnification from RAW data
US8587712B2 (en) Image processing apparatus and method of correcting image quality degradation caused by aberrations due to optical system
JP5445363B2 (en) Image processing apparatus, image processing method, and image processing program
JP6074954B2 (en) Focus evaluation device, imaging device, and program
CN104519329B (en) Image processing apparatus, image pickup apparatus, image pickup system and image processing method
JP5246078B2 (en) Object location program and camera
JP5163733B2 (en) Imaging apparatus and focus determination program
JP5882789B2 (en) Image processing apparatus, image processing method, and program
US20140184853A1 (en) Image processing apparatus, image processing method, and image processing program
JP2015011058A (en) Imaging device and imaging method
JP4311040B2 (en) Chromatic aberration correction apparatus, chromatic aberration correction method, and chromatic aberration correction program
WO2014013792A1 (en) Noise evaluation method, image processing device, imaging device, and program
KR100867049B1 (en) Image correction device and image correction method
JP4804310B2 (en) Imaging apparatus and image restoration method
JP6415108B2 (en) Image processing method, image processing apparatus, imaging apparatus, image processing program, and storage medium
JP6436840B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
US20230085080A1 (en) Information processing apparatus, information processing method, and information processing program
JP2010177832A (en) Image processing apparatus and image processing method
JP6352150B2 (en) Image processing apparatus and image processing method
US20160269628A1 (en) Image processing apparatus, image processing method, and recording medium
JP6238673B2 (en) Image processing apparatus, imaging apparatus, imaging system, image processing method, image processing program, and storage medium
JP6467824B2 (en) Imaging device
JP6467823B2 (en) Imaging device
JP6604737B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120406

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120417

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120618

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121203

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5163733

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250