JP5340468B2 - Focus detection apparatus and control method thereof - Google Patents

Focus detection apparatus and control method thereof Download PDF

Info

Publication number
JP5340468B2
JP5340468B2 JP2012227420A JP2012227420A JP5340468B2 JP 5340468 B2 JP5340468 B2 JP 5340468B2 JP 2012227420 A JP2012227420 A JP 2012227420A JP 2012227420 A JP2012227420 A JP 2012227420A JP 5340468 B2 JP5340468 B2 JP 5340468B2
Authority
JP
Japan
Prior art keywords
focus detection
pixel
pixels
focus
image
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
JP2012227420A
Other languages
Japanese (ja)
Other versions
JP2013041294A (en
Inventor
正史 木村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2012227420A priority Critical patent/JP5340468B2/en
Publication of JP2013041294A publication Critical patent/JP2013041294A/en
Application granted granted Critical
Publication of JP5340468B2 publication Critical patent/JP5340468B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To prevent a decrease of accuracy in focusing even when there are defective pixels. <P>SOLUTION: A focus detecting device for detecting a focus state of an imaging surface by an imaging optical system comprises: a focus detection sensor which consists of a plurality of first focus detection pixels and a plurality of second focus detection pixels, and has a plurality of focus detection pixel pairs constituted by the first and second focus detection pixels; a defect storage unit which stores defect information showing defective pixels of the focus detection sensor; an elimination unit which eliminates values of the defective pixels shown by the defect information and values of the first focus detection pixels or the second focus detection pixels consisting of the defective pixels and the focus detection pixel pairs so as not to be used for detecting the focus state; and a detection unit which detects the focus state by a phase difference between a first focus detection image obtained from the first focus detection pixels and a second focus detection image obtained from the second focus detection pixels of the plurality of focus detection pixel pairs after elimination by the elimination unit. <P>COPYRIGHT: (C)2013,JPO&amp;INPIT

Description

本発明は、焦点検出装置及びその制御方法に関する。   The present invention relates to a focus detection apparatus and a control method thereof.

近年、焦点検出装置の高性能化に伴い、ファインダ内の多くの点で測距可能ないわゆる多点測距タイプの焦点検出装置が多く提案されている。位相差AFの原理を活用して多点測距を行う焦点検出装置においては、夫々の測距点に対応した1対の焦点検出像を取得して相関演算を行い、その位相差からデフォーカス量を計算する方法が用いられている。   2. Description of the Related Art In recent years, many so-called multi-point distance measurement type focus detection apparatuses capable of measuring distances at many points in a finder have been proposed with the enhancement of performance of focus detection apparatuses. In a focus detection apparatus that performs multipoint distance measurement using the principle of phase difference AF, a pair of focus detection images corresponding to each distance measurement point are acquired, correlation calculation is performed, and defocusing is performed from the phase difference. A method of calculating the quantity is used.

このような焦点検出装置では、測距点の増加に伴い焦点検出像を取得するための光電変換部も増加している。一方、光電変換部は製造上の欠陥を完全に排除することは非常に困難である。特許文献1には、欠陥のある光電変換の信号を周辺の信号から補間生成することで欠陥の影響を低減する技術が開示されている。また、特許文献2には、稠密に配置された光電変換部のうち欠陥を含まない箇所を測距用の信号として用いることで欠陥の影響を排除する技術が開示されている。   In such a focus detection apparatus, the number of photoelectric conversion units for acquiring a focus detection image increases with an increase in distance measuring points. On the other hand, it is very difficult for the photoelectric conversion part to completely eliminate manufacturing defects. Patent Document 1 discloses a technique for reducing the influence of defects by interpolating a defective photoelectric conversion signal from surrounding signals. Patent Document 2 discloses a technique for eliminating the influence of a defect by using a portion that does not include a defect in a densely arranged photoelectric conversion unit as a signal for distance measurement.

特開平5−56355号公報JP-A-5-56355 特開2001−177756号公報JP 2001-177756 A

一般的に焦点検出装置には合焦時の精度が要求される。ここでいう合焦時の精度とは、撮影光学系の結像面(空間周波数が最も高い位置)と焦点検出装置の求めた合焦位置のずれを指す。   In general, the focus detection device is required to have accuracy during focusing. The precision at the time of focusing here refers to a deviation between the imaging plane (position with the highest spatial frequency) of the photographing optical system and the focusing position obtained by the focus detection device.

しかしながら、特許文献1、2に記載の方法では、1対の焦点検出像のうちの一方の焦点検出像の欠陥画素が補間生成されるために他方の焦点検出像との相関性が失われてしまい、1対の焦点検出像による相関演算に影響が生じる。このため、合焦時の精度が低減する虞があった。特に被写体の輪郭などの被写体像において特徴がある場所が欠陥画素にかかる場合は影響を受けやすい。   However, in the methods described in Patent Documents 1 and 2, since a defective pixel of one focus detection image of a pair of focus detection images is generated by interpolation, the correlation with the other focus detection image is lost. In other words, the correlation calculation using a pair of focus detection images is affected. For this reason, there was a possibility that the accuracy at the time of focusing may be reduced. In particular, it is easily affected when a place having a feature in the subject image such as the contour of the subject falls on the defective pixel.

本発明は、このような従来技術の課題を解決することを目的としてなされたものである。本発明の目的は、欠陥画素を有する場合であっても合焦時の精度が低減することを防止可能な焦点検出装置、その制御方法及びプログラムを提供することである。   The present invention has been made for the purpose of solving such problems of the prior art. An object of the present invention is to provide a focus detection device, a control method thereof, and a program capable of preventing the accuracy at the time of focusing from being reduced even when there are defective pixels.

上記目的は、撮像光学系による結像面の焦点状態を検出する焦点検出装置において、複数の第1の焦点検出用画素と複数の第2の焦点検出用画素から構成され、前記第1の焦点検出用画素と前記第2の焦点検出用画素とが構成する焦点検出用画素対を複数有する焦点検出センサと、前記焦点検出センサの欠陥画素を示す欠陥情報を記憶する欠陥記憶手段と、前記欠陥情報が示す欠陥画素の値と、当該欠陥画素と前記焦点検出用画素対を構成する前記第1の焦点検出用画素又は前記第2の焦点検出用画素の値とを、前記焦点状態の検出に用いないように排除する排除手段と、前記排除手段による排除後の前記複数の焦点検出用画素対の前記第1の焦点検出用画素から得られる第1の焦点検出像と、前記第2の焦点検出用画素から得られる第2の焦点検出像との位相差から、前記焦点状態を検出する検出手段と、を備えることを特徴とする本発明による焦点検出装置によっても達成される。   An object of the present invention is to provide a focus detection apparatus for detecting a focus state of an imaging plane by an imaging optical system, which includes a plurality of first focus detection pixels and a plurality of second focus detection pixels. A focus detection sensor having a plurality of focus detection pixel pairs constituted by a detection pixel and the second focus detection pixel; defect storage means for storing defect information indicating a defective pixel of the focus detection sensor; and the defect The value of the defective pixel indicated by the information and the value of the first focus detection pixel or the second focus detection pixel constituting the defective pixel and the focus detection pixel pair are used to detect the focus state. Exclusion means for excluding use, a first focus detection image obtained from the first focus detection pixels of the plurality of focus detection pixel pairs after exclusion by the exclusion means, and the second focus Second obtained from the detection pixel From the phase difference between the inspection Dezo also achieved by a focus detection apparatus according to the present invention characterized by comprising a detecting means for detecting the focus state.

また、上記目的は、複数の第1の焦点検出用画素と複数の第2の焦点検出用画素から構成され、前記第1の焦点検出用画素と前記第2の焦点検出用画素とが構成する焦点検出用画素対を複数有する焦点検出センサと、前記焦点検出センサの欠陥画素を示す欠陥情報を記憶する欠陥記憶手段とを有し、撮像光学系による結像面の焦点状態を検出する焦点検出装置の制御方法であって、前記欠陥情報が示す欠陥画素の値と、当該欠陥画素と前記焦点検出用画素対を構成する前記第1の焦点検出用画素又は前記第2の焦点検出用画素の値とを、前記焦点状態の検出に用いないように排除する排除工程と、前記排除工程による排除後の前記複数の焦点検出用画素対の前記第1の焦点検出用画素から得られる第1の焦点検出像と、前記第2の焦点検出用画素から得られる第2の焦点検出像との位相差から、前記焦点状態を検出する検出工程と、を含むことを特徴とする本発明による焦点検出装置の制御方法によっても達成される。   Further, the object is configured by a plurality of first focus detection pixels and a plurality of second focus detection pixels, and the first focus detection pixels and the second focus detection pixels are configured. Focus detection that has a focus detection sensor having a plurality of focus detection pixel pairs and defect storage means for storing defect information indicating defective pixels of the focus detection sensor, and detects the focus state of the imaging plane by the imaging optical system A method of controlling an apparatus, comprising: a value of a defective pixel indicated by the defect information; and a value of the first focus detection pixel or the second focus detection pixel constituting the defective pixel and the focus detection pixel pair. A first value obtained from the first focus detection pixels of the plurality of focus detection pixel pairs after being excluded by the exclusion step. Focus detection image and second focus detection From the phase difference between the second focus detection image obtained from iodine, a detection step of detecting the focus state, also achieved by a control method of the focus detecting apparatus according to the present invention, which comprises a.

本発明によれば、欠陥画素を有する場合であっても合焦時の精度が低減することを防止できる。   According to the present invention, it is possible to prevent the accuracy at the time of focusing from being reduced even when there is a defective pixel.

第1の実施形態に係るカメラの構成の概略を示す図である。It is a figure which shows the outline of a structure of the camera which concerns on 1st Embodiment. イメージセンサの一部の領域を例示する図である。It is a figure which illustrates the one part area | region of an image sensor. イメージセンサの一部の画素を例示する図である。It is a figure which illustrates some pixels of an image sensor. (a)は、撮像レンズの瞳領域を通過した光束の光路を例示して焦点検出用画素の瞳分割を説明する図であり、(b)は、撮像レンズの瞳領域を通過した光束の光路を例示して焦点検出用画素の瞳分割を説明する図である。(A) is a figure explaining the pupil division | segmentation of the pixel for a focus detection, illustrating the optical path of the light beam which passed the pupil area | region of the imaging lens, (b) is the optical path of the light beam which passed the pupil area | region of the imaging lens. It is a figure explaining the pupil division of the pixel for focus detections. (a)は、瞳面上での焦点検出用画素への入射特性を説明する図であり、(b)は、瞳面上での焦点検出用画素への入射特性を説明する図である。(A) is a figure explaining the incident characteristic to the pixel for focus detection on a pupil surface, (b) is a figure explaining the incident characteristic to the pixel for focus detection on a pupil surface. 焦点検出用画素群で生成される線像の説明図である。It is explanatory drawing of the line image produced | generated by the pixel group for focus detection. 第1の実施形態に係るカメラのメインフローを示すフローチャートである。It is a flowchart which shows the main flow of the camera which concerns on 1st Embodiment. 第1の実施形態に係る焦点検出サブルーチンを示すフローチャートである。It is a flowchart which shows the focus detection subroutine which concerns on 1st Embodiment. 第1の実施形態に係る相関演算サブルーチンを示すフローチャートである。It is a flowchart which shows the correlation calculation subroutine which concerns on 1st Embodiment. 焦点検出用画素を抜き出して得られる焦点検出像を例示する図である。It is a figure which illustrates the focus detection image obtained by extracting the focus detection pixels. 第1の実施形態に係る相関演算を行っている時の焦点検出像の状態を模式的に示した図である。It is the figure which showed typically the state of the focus detection image at the time of performing the correlation calculation which concerns on 1st Embodiment. 第1の実施形態において再度相関演算を行っている時の焦点検出像の状態を模式的に示した図である。It is the figure which showed typically the state of the focus detection image when performing correlation calculation again in 1st Embodiment. 第1の実施形態に係る撮像サブルーチンを示すフローチャートである。It is a flowchart which shows the imaging subroutine which concerns on 1st Embodiment. 第1の実施形態における最初相関量を求める時の焦点検出像とその相関量を示すグラフであり、(a)は、焦点検出用画素群による線像と輝度との関係を示すグラフであり、(b)は、演算して求められた相関量を示すグラフである。FIG. 6 is a graph showing a focus detection image and a correlation amount when obtaining an initial correlation amount in the first embodiment, and (a) is a graph showing a relationship between a line image and luminance by a focus detection pixel group; (B) is a graph which shows the correlation amount calculated | required by calculation. 第1の実施形態における再度相関量を求める時の焦点検出像とその相関量を示すグラフであり、(a)は、焦点検出用画素群による線像及び再度相関量を求める際の線像と輝度との関係を示すグラフであり、(b)は、演算して求められた相関量を示すグラフである。It is a graph which shows the focus detection image when calculating | requiring a correlation amount in 1st Embodiment again, and its correlation amount, (a) is a line image by the pixel group for focus detection, and a line image at the time of calculating | requiring a correlation amount again. It is a graph which shows the relationship with a brightness | luminance, (b) is a graph which shows the correlation amount calculated | required by calculation. 本発明を用いない場合の焦点検出像とその相関量を示すグラフであり、(a)は、焦点検出用画素群による線像及び相関量を求める際の線像と輝度との関係を示すグラフであり、(b)は、演算して求められた相関量を示すグラフである。It is a graph which shows the focus detection image when not using this invention, and its correlation amount, (a) is a graph which shows the relationship between the line image and brightness | luminance at the time of calculating | requiring the line image and correlation amount by the pixel group for focus detection. (B) is a graph showing the amount of correlation obtained by calculation. 第2の実施形態に係る相関演算サブルーチンを示すフローチャートである。It is a flowchart which shows the correlation calculation subroutine which concerns on 2nd Embodiment. 第2の実施形態に係る相関演算を行っている時の焦点検出像の状態を模式的に示した図である。It is the figure which showed typically the state of the focus detection image at the time of performing the correlation calculation which concerns on 2nd Embodiment. 第2の実施形態において再度相関演算を行っている時の焦点検出像の状態を模式的に示した図である。It is the figure which showed typically the state of the focus detection image when performing correlation calculation again in 2nd Embodiment. 第2の実施形態における最初相関量を求める時の焦点検出像とその相関量を示すグラフであり、(a)は、焦点検出用画素群による線像と輝度との関係を示すグラフであり、(b)は、演算して求められた相関量を示すグラフである。It is a graph which shows the focus detection image when calculating | requiring the first correlation amount in 2nd Embodiment, and its correlation amount, (a) is a graph which shows the relationship between the line image by a pixel group for focus detection, and a brightness | luminance, (B) is a graph which shows the correlation amount calculated | required by calculation. 第2の実施形態における再度相関量を求める時の焦点検出像とその相関量を示すグラフであり、(a)は、焦点検出用画素群による線像及び再度相関量を求める際の線像と輝度との関係を示すグラフであり、(b)は、演算して求められた相関量を示すグラフである。It is a graph which shows the focus detection image when calculating | requiring a correlation amount again in 2nd Embodiment, and its correlation amount, (a) is a line image by the pixel group for focus detection, and a line image at the time of calculating | requiring a correlation amount again. It is a graph which shows the relationship with a brightness | luminance, (b) is a graph which shows the correlation amount calculated | required by calculation. 第3の実施形態に係るカメラの構成の概略を示す図である。It is a figure which shows the outline of a structure of the camera which concerns on 3rd Embodiment. 第3の実施形態に係る瞳分割手段の構成を示す図である。It is a figure which shows the structure of the pupil division means which concerns on 3rd Embodiment. 第3の実施形態に係るカメラのメインフローを示すフローチャートである。It is a flowchart which shows the main flow of the camera which concerns on 3rd Embodiment.

以下、この発明の実施の形態について図を参照して説明するが、この発明は以下の実施の形態に限定されない。また、この発明の実施の形態は発明の最も好ましい形態を示すものであり、発明の範囲を限定するものではない。
[第1の実施形態]
以下に、図1〜図16を参照して第1の実施形態を説明する。図1は、第1の実施形態に係る焦点検出装置を備えたカメラ1の構成の概略を示す断面図である。図1に示すように、カメラ1は、イメージセンサ10(撮像素子)が撮像光学系としての撮像レンズ5の予定結像面(以下、結像面という)に配置されたデジタルスチルカメラである。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the present invention is not limited to the following embodiments. Further, the embodiment of the present invention shows the most preferable mode of the invention, and does not limit the scope of the invention.
[First Embodiment]
The first embodiment will be described below with reference to FIGS. FIG. 1 is a cross-sectional view schematically illustrating a configuration of a camera 1 including a focus detection apparatus according to the first embodiment. As shown in FIG. 1, the camera 1 is a digital still camera in which an image sensor 10 (imaging device) is arranged on a planned imaging surface (hereinafter referred to as an imaging surface) of an imaging lens 5 as an imaging optical system.

カメラ1は、接眼レンズ3、CPU20、イメージセンサ制御回路21、メモリ回路22、インターフェース回路23、画像処理回路24を有する。接眼レンズ3は、ユーザが撮像レンズ5から入射された被写体像を観察するための光学レンズである。CPU20(Central Processing Unit)はカメラ1の動作を中央制御する。また、CPU20は、撮像レンズ5の焦点状態を検出するための検出手段を兼ねている。   The camera 1 includes an eyepiece 3, a CPU 20, an image sensor control circuit 21, a memory circuit 22, an interface circuit 23, and an image processing circuit 24. The eyepiece 3 is an optical lens that allows a user to observe a subject image incident from the imaging lens 5. A CPU 20 (Central Processing Unit) centrally controls the operation of the camera 1. Further, the CPU 20 also serves as a detection unit for detecting the focus state of the imaging lens 5.

イメージセンサ制御回路21は、CPU20の制御の下でイメージセンサ10を駆動制御する。メモリ回路22は、イメージセンサ10にて撮像された画像データなどを記録する。また、メモリ回路22は、イメージセンサ10の受光分布に関する情報や、欠陥記憶手段として後述する焦点検出センサの欠陥情報も予め記憶している。   The image sensor control circuit 21 drives and controls the image sensor 10 under the control of the CPU 20. The memory circuit 22 records image data captured by the image sensor 10 and the like. The memory circuit 22 also stores in advance information related to the light reception distribution of the image sensor 10 and defect information of a focus detection sensor described later as defect storage means.

インターフェース回路23は、接続コネクタ(図示しない)などを介して外部機器と通信接続し、例えば画像処理回路24にて画像処理された画像データを接続された外部機器へ出力する。画像処理回路24は、イメージセンサ10にて撮像した画像データに対して所定の画像処理を行う。   The interface circuit 23 is communicatively connected to an external device via a connection connector (not shown) or the like, and outputs, for example, image data processed by the image processing circuit 24 to the connected external device. The image processing circuit 24 performs predetermined image processing on the image data captured by the image sensor 10.

撮像レンズ5は、カメラ1の本体に対して着脱可能なレンズである。撮像レンズ5は、カメラ1の本体のCPU20から送られてくる情報を電気接点26を介してレンズCPU50にて受信する。CPU20から送られてくる情報とは、撮像レンズ5の駆動制御に関する情報であり、具体的には焦点調整を行うための焦点調整情報、絞り調整を行うための絞り調整情報などである。レンズ駆動機構51は、フォーカスレンズを駆動するアクチュエータなどである。絞り駆動機構52は、絞り装置53を駆動するアクチュエータなどである。絞り装置53は絞り羽根などで入射光量を調整する。   The imaging lens 5 is a lens that can be attached to and detached from the main body of the camera 1. The imaging lens 5 receives information sent from the CPU 20 of the main body of the camera 1 by the lens CPU 50 via the electrical contact 26. The information sent from the CPU 20 is information relating to drive control of the imaging lens 5, and specifically includes focus adjustment information for performing focus adjustment, aperture adjustment information for performing aperture adjustment, and the like. The lens driving mechanism 51 is an actuator that drives the focus lens. The aperture driving mechanism 52 is an actuator that drives the aperture device 53. The diaphragm device 53 adjusts the amount of incident light with a diaphragm blade or the like.

レンズCPU50は、CPU20から送られてくる焦点調整情報に基づいてレンズ駆動機構51を駆動することで、イメージセンサ10に結像される被写体像を合焦状態とする。また、レンズCPU50は、CPU20から送られてくる絞り調整情報に基づいて絞り駆動機構52を駆動することで、絞り装置53を所定の絞り値に絞り込む。   The lens CPU 50 drives the lens driving mechanism 51 based on the focus adjustment information sent from the CPU 20 to bring the subject image formed on the image sensor 10 into a focused state. Further, the lens CPU 50 drives the diaphragm drive mechanism 52 based on the diaphragm adjustment information sent from the CPU 20 to narrow down the diaphragm device 53 to a predetermined diaphragm value.

図2は、イメージセンサ10の一部の領域を例示する平面図である。図2において、「R」「G」「B」の文字はイメージセンサ10における各画素のカラーフィルタの色相を表している。「R」の文字の書かれた画素は赤の成分の光を透過し、「G」の文字の書かれた画素は緑の成分の光を透過し、「B」の文字の書かれた画素は青の成分の光を透過する。図2では「R」「G」「B」の色相をハッチングパターンで示している。図2のハッチングパターンからも明らかなように、イメージセンサ10における「R」「G」「B」の各画素はいわゆるベイヤ配列にしたがって配置されている。   FIG. 2 is a plan view illustrating a partial region of the image sensor 10. In FIG. 2, the characters “R”, “G”, and “B” represent the hue of the color filter of each pixel in the image sensor 10. Pixels with the letter “R” transmit red component light, pixels with the letter “G” transmit green component light, and pixels with the letter “B” written Transmits blue component light. In FIG. 2, the hues of “R”, “G”, and “B” are indicated by hatching patterns. As is apparent from the hatching pattern in FIG. 2, the pixels “R”, “G”, and “B” in the image sensor 10 are arranged according to a so-called Bayer array.

カラーフィルタの配列がベイヤ配列に従うため、1絵素は「R」「B」の画素と2つの「G」の画素から構成される。また、イメージセンサ10には、「R」あるいは「B」であるべき画素の一部において、撮像レンズ5の一部の瞳領域を通過した光束を受光する焦点検出用画素が複数割り当てられている。具体的には、図2においてA、Bで示した画素が撮像レンズ5の焦点状態を検出するための焦点検出用画素(第1の焦点検出用画素、第2の焦点検出用画素)である。また、焦点検出用画素は、1つのA画素と、1つのB画素の組合わせが位相差検出を行うための焦点検出用画素対(以下、画素対)となっている。また、図2に示すように、この画素対は、イメージセンサ10において所定のピッチで分散して複数配置されている。   Since the arrangement of the color filters follows the Bayer arrangement, one picture element is composed of “R” and “B” pixels and two “G” pixels. In addition, the image sensor 10 is assigned a plurality of focus detection pixels that receive a light beam that has passed through a part of the pupil region of the imaging lens 5 in some of the pixels that should be “R” or “B”. . Specifically, the pixels indicated by A and B in FIG. 2 are focus detection pixels (first focus detection pixels and second focus detection pixels) for detecting the focus state of the imaging lens 5. . The focus detection pixel is a focus detection pixel pair (hereinafter referred to as a pixel pair) in which a combination of one A pixel and one B pixel performs phase difference detection. In addition, as shown in FIG. 2, a plurality of pixel pairs are arranged at a predetermined pitch in the image sensor 10.

この焦点検出用画素は、詳細な構成については後述するが、図3に示す第1の電極131にてx方向(図2における横方向)の開口が制限されている。またA、Bの焦点検出用画素では、後述するように互いに異なる瞳領域を通った光線が結像している。したがって、イメージセンサ10は、撮像レンズ5の一部の画素をA、Bの焦点検出用画素とし、その画素対を複数有する焦点検出センサとしての機能を有している。   Although the detailed configuration of this focus detection pixel will be described later, the opening in the x direction (lateral direction in FIG. 2) is restricted by the first electrode 131 shown in FIG. In the focus detection pixels A and B, light rays that have passed through different pupil regions are imaged as described later. Therefore, the image sensor 10 has a function as a focus detection sensor having a part of pixels of the imaging lens 5 as A and B focus detection pixels and a plurality of pixel pairs.

図2に示すように、イメージセンサ10では、A、Bで示した焦点検出用画素を互いに隣接させ、可能な限り互いの距離を短くしている。このため、A、Bで示した焦点検出用画素が被写体像の異なる模様のところを見てしまう可能性を最小限に抑えており、焦点検出誤差を軽減させている。   As shown in FIG. 2, in the image sensor 10, the focus detection pixels indicated by A and B are adjacent to each other, and the distance between them is as short as possible. For this reason, the possibility that the focus detection pixels indicated by A and B see different patterns in the subject image is minimized, and the focus detection error is reduced.

また、イメージセンサ10では、偶数ラインと奇数ラインで境界位置を一致させて、A、Bで示した焦点検出用画素の位置を反転させている。このため、被写体像のエッジ部分がA、Bで示した焦点検出用画素の境界部分にかかった場合において、A、Bで示した焦点検出用画素から得られる像の位相がずれてしまう場合には、その位相ずれが両方同時に発生することとなる。しかも、そのずれ量は、A、Bで示した焦点検出用画素から得られる像において互いに等しく、方向が逆向きとなる。そこで、本実施形態では、瞳分割方向と垂直方向に隣接するラインを少なくとも2つセットで相関演算を行うことで、焦点検出誤差を打ち消し合うようにしている。これは、後述する1対の像の数の決定において、必ず偶数を指定することに対応する。これにより、焦点検出誤差を軽減することができる。   In the image sensor 10, the boundary positions of the even lines and the odd lines are matched, and the positions of the focus detection pixels indicated by A and B are inverted. For this reason, when the edge portion of the subject image falls on the boundary portion of the focus detection pixels indicated by A and B, the phase of the image obtained from the focus detection pixels indicated by A and B shifts. Therefore, both of the phase shifts occur simultaneously. In addition, the shift amounts are equal to each other in the images obtained from the focus detection pixels indicated by A and B, and the directions are opposite to each other. Therefore, in the present embodiment, the focus detection error is canceled out by performing correlation calculation using at least two sets of lines adjacent in the direction perpendicular to the pupil division direction. This corresponds to the fact that an even number is always specified in the determination of the number of a pair of images described later. Thereby, a focus detection error can be reduced.

図3は、イメージセンサ10の一部の画素の前述したX方向での断面を示す図である。具体的には、図3は、X方向の開口が制限された焦点検出用画素と、開口が制限されることなく全瞳領域を受光可能な画素との断面図である。図3において、右側の画素は、撮像レンズ5の全瞳領域を受光可能な画素である。また、左側の焦点検出用画素は、X方向の開口が制限されており、撮像レンズ5の一部の瞳領域からの光束を受光可能な画素である。なお、一部の瞳領域から光束を受光することについては、図4を参照して後述する。   FIG. 3 is a diagram illustrating a cross section of some pixels of the image sensor 10 in the above-described X direction. Specifically, FIG. 3 is a cross-sectional view of a focus detection pixel in which the opening in the X direction is limited and a pixel that can receive the entire pupil region without limiting the opening. In FIG. 3, the right pixel is a pixel that can receive the entire pupil region of the imaging lens 5. Further, the left focus detection pixel has a limited opening in the X direction, and is a pixel that can receive a light beam from a part of the pupil region of the imaging lens 5. In addition, receiving light from a part of pupil regions will be described later with reference to FIG.

図3に示すように、イメージセンサ10は、シリコン基板110の内部に光電変換部111が形成されている。光電変換部111において、被写体像を光電変換して発生した信号電荷は、フローティングディフュージョン部(図示しない)、第1の電極131及び第2の電極132を介して外部に出力される。光電変換部111と第1の電極131との間には層間絶縁膜121が形成され、第1の電極131と第2の電極132との間には層間絶縁膜122が形成されている。   As shown in FIG. 3, in the image sensor 10, a photoelectric conversion unit 111 is formed inside a silicon substrate 110. In the photoelectric conversion unit 111, signal charges generated by photoelectrically converting the subject image are output to the outside through the floating diffusion unit (not shown), the first electrode 131, and the second electrode 132. An interlayer insulating film 121 is formed between the photoelectric conversion unit 111 and the first electrode 131, and an interlayer insulating film 122 is formed between the first electrode 131 and the second electrode 132.

また、第2の電極132の光入射側(Z方向)には層間絶縁膜123が形成され、さらにパッシべーション膜140、平坦化層150が形成されている。平坦化層150の光入射側には、カラーフィルタ層151、平坦化層152及びマイクロレンズ153が形成されている。ここで、マイクロレンズ153の光学パワーは、撮像レンズ5の瞳と光電変換部111が略共役になるように設定されている。また、イメージセンサ10の撮像面において、マイクロレンズ153は、中央に位置する画素では画素の中心に配設され、周辺に位置する画素では撮像レンズ5の光軸側に偏倚して配設される。   In addition, an interlayer insulating film 123 is formed on the light incident side (Z direction) of the second electrode 132, and a passivation film 140 and a planarizing layer 150 are further formed. On the light incident side of the planarization layer 150, a color filter layer 151, a planarization layer 152, and a microlens 153 are formed. Here, the optical power of the microlens 153 is set so that the pupil of the imaging lens 5 and the photoelectric conversion unit 111 are substantially conjugate. On the imaging surface of the image sensor 10, the microlens 153 is disposed at the center of the pixel located at the center, and is biased toward the optical axis side of the imaging lens 5 at the pixels located at the periphery. .

撮像レンズ5を透過した被写体光は、イメージセンサ10近傍に集光する。さらにイメージセンサ10の各画素に到達した光は、マイクロレンズ153で屈曲されて光電変換部111に集光する。通常の撮像に使われる図3に示した右側の画素では、入射する光を遮光しないように第1の電極131及び第2の電極132が配設されている。   The subject light transmitted through the imaging lens 5 is condensed near the image sensor 10. Further, the light reaching each pixel of the image sensor 10 is bent by the microlens 153 and collected on the photoelectric conversion unit 111. In the right pixel shown in FIG. 3 used for normal imaging, the first electrode 131 and the second electrode 132 are provided so as not to block incident light.

一方、図3に示した左側の焦点検出用画素では、第1の電極131の一部が光電変換部111を覆うように配設されている。その結果、焦点検出用画素では、撮像レンズ5の瞳の一部を透過する光束のみが受光可能となっている。また、第1の電極131が入射光束の一部を遮光していることにより光電変換部111の出力が小さくなることを防ぐため、焦点検出用画素のカラーフィルタ層154は、光を吸収しない透過率の高い樹脂で形成されている。   On the other hand, in the left focus detection pixel shown in FIG. 3, a part of the first electrode 131 is disposed so as to cover the photoelectric conversion unit 111. As a result, in the focus detection pixel, only a light beam that passes through a part of the pupil of the imaging lens 5 can be received. In addition, the color filter layer 154 of the focus detection pixel does not absorb light in order to prevent the output of the photoelectric conversion unit 111 from being reduced because the first electrode 131 blocks a part of the incident light flux. It is made of a high rate resin.

図4(a)、(b)は、図2に例示したA、Bの焦点検出用画素の断面と瞳との関係を表した図であり、個々の焦点検出用画素における瞳分割手段を示している。図4(a)は撮像レンズ5の瞳領域161aを通過した光束の光路を例示して瞳分割を説明する図であり、図4(b)は瞳領域161bを通過した光束の光路を例示して瞳分割を説明する図である。   4A and 4B are diagrams showing the relationship between the cross-sections of the focus detection pixels A and B exemplified in FIG. 2 and the pupils, and show the pupil dividing means in each focus detection pixel. ing. 4A is a diagram illustrating pupil division by exemplifying the optical path of the light beam that has passed through the pupil region 161a of the imaging lens 5, and FIG. 4B illustrates the optical path of the light beam that has passed through the pupil region 161b. It is a figure explaining pupil division.

以下、図4(a)、(b)を参照して瞳分割手段について説明する。図4(a)、(b)において、左側の焦点検出用画素は図2におけるAの焦点検出用画素(以下、A画素という)に対応しており、右側の焦点検出用画素は図2におけるBの焦点検出用画素(以下、B画素という)に対応している。また、図4(a)、(b)において、瞳160は撮像レンズ5の瞳を模式的に示したものであり、光電変換部111a、111bは夫々がA画素、B画素の光電変換部を示している。   Hereinafter, the pupil dividing means will be described with reference to FIGS. 4 (a) and 4 (b). 4A and 4B, the left focus detection pixel corresponds to the focus detection pixel A in FIG. 2 (hereinafter referred to as A pixel), and the right focus detection pixel in FIG. This corresponds to B focus detection pixels (hereinafter referred to as B pixels). 4A and 4B, the pupil 160 schematically shows the pupil of the imaging lens 5, and the photoelectric conversion units 111 a and 111 b respectively have the A pixel and B pixel photoelectric conversion units. Show.

図4(a)、(b)に示したように、A画素、B画素の開口はマイクロレンズ153の光軸に対して異なる偏倚量を持つように設けられている。このため、図4(a)に示すように、瞳領域161aを通過した光束はA画素の光電変換部111aには到達するが、B画素の光電変換部111bには到達しない。反対に、図4(b)に示したように、瞳領域161bを通解した光束はB画素の光電変換部111bには到達するが、A画素の光電変換部111aには到達しない。   As shown in FIGS. 4A and 4B, the apertures of the A pixel and the B pixel are provided so as to have different amounts of deviation with respect to the optical axis of the microlens 153. For this reason, as shown in FIG. 4A, the light beam that has passed through the pupil region 161a reaches the photoelectric conversion unit 111a of the A pixel, but does not reach the photoelectric conversion unit 111b of the B pixel. On the other hand, as shown in FIG. 4B, the light beam that has passed through the pupil region 161b reaches the photoelectric conversion unit 111b of the B pixel, but does not reach the photoelectric conversion unit 111a of the A pixel.

図4(a)、(b)に示したように、撮像レンズ5の瞳の一部の領域を通過した光束を得ることができる瞳分割手段において、前述した2つの領域の相対的な位置を示す方向(本実施形態ではX方向)を瞳分割方向と定義する。また、光軸に直交する平面内で瞳分割方向と垂直をなす方向を垂直方向と定義する。なお、本実施形態では瞳分割方向がX方向に存在する焦点検出用画素のみをもつイメージセンサ10を例示しているが、イメージセンサ10は、瞳分割方向がY方向に存在する焦点検出用画素も含む構成であってもよい。   As shown in FIGS. 4A and 4B, in the pupil splitting means that can obtain a light beam that has passed through a partial area of the pupil of the imaging lens 5, the relative positions of the two areas described above are determined. The direction shown (X direction in this embodiment) is defined as the pupil division direction. Further, a direction perpendicular to the pupil division direction in a plane orthogonal to the optical axis is defined as a vertical direction. In the present embodiment, the image sensor 10 having only the focus detection pixels whose pupil division direction is in the X direction is illustrated, but the image sensor 10 is a focus detection pixel whose pupil division direction is in the Y direction. May also be included.

図5(a)、(b)は、撮像レンズ5の瞳160からA画素、B画素に入射する光束を模式的に示し、瞳面上での焦点検出用画素への入射特性を説明する図である。図5(a)はA画素、B画素に入射する領域と瞳の関係を例示し、図5(b)はA画素、B画素に入射する領域が瞳で切り取られる様子を例示している。   FIGS. 5A and 5B schematically show light beams incident on the A pixel and the B pixel from the pupil 160 of the imaging lens 5 and explain the incident characteristics on the focus detection pixels on the pupil plane. It is. FIG. 5A illustrates the relationship between the area incident on the A pixel and the B pixel and the pupil, and FIG. 5B illustrates the state where the area incident on the A pixel and the B pixel is cut out by the pupil.

図5(a)、(b)では、A画素に入射する瞳領域を161a、B画素に入射する瞳領域を161bで示すとともに、入射する比率を濃淡で示した。したがって、図中において、濃い領域は入射する光量が多く、薄い領域は入射する光量が少ない。このように、瞳の領域により入射する比率が異なるのは、マイクロレンズの収差、光学パワーの合わせ込み誤差、光の回折などが原因である。   5A and 5B, the pupil region incident on the A pixel is indicated by 161a, the pupil region incident on the B pixel is indicated by 161b, and the incident ratio is indicated by shading. Accordingly, in the drawing, the dark region has a large amount of incident light, and the thin region has a small amount of incident light. As described above, the incidence ratio varies depending on the pupil region due to micro lens aberration, optical power alignment error, light diffraction, and the like.

また、図5(a)に示すように、撮像レンズ5の瞳160の外側にもA画素、B画素に入射する領域は存在する。しかしながら、実際には、レンズでケラレが発生するため、図5(b)に示すように、瞳160で切り取られた範囲の光がイメージセンサ10に到達することとなる。   Further, as shown in FIG. 5A, there are regions that are incident on the A pixel and the B pixel outside the pupil 160 of the imaging lens 5. However, since vignetting actually occurs in the lens, as shown in FIG. 5B, light in a range cut by the pupil 160 reaches the image sensor 10.

図6は、図5(b)に示す領域からの光束を瞳分離と垂直方向に積分して瞳分離方向の1次元的な像で表現したもので、焦点検出用画素群で生成される線像(焦点検出像)分布図に対応する。図6において、線像分布曲線162aはA画素群の線像分布(第1の焦点検出像)を、線像分布曲線162bはB画素群の線像分布(第2の焦点検出像)をそれぞれ示している。   FIG. 6 shows a one-dimensional image in the pupil separation direction obtained by integrating the light flux from the region shown in FIG. 5B in the vertical direction with respect to the pupil separation, and is a line generated by the focus detection pixel group. This corresponds to an image (focus detection image) distribution diagram. In FIG. 6, the line image distribution curve 162a represents the line image distribution (first focus detection image) of the A pixel group, and the line image distribution curve 162b represents the line image distribution (second focus detection image) of the B pixel group. Show.

図6から分かるように、A画素、B画素は互いに入射角特性が異なっているために、デフォーカスした際にA画素群の線像とB画素群の線像には瞳分離方向の像ずれが発生する。したがって、この像ずれ量と、図6の線像分布を考慮してデフォーカス量を求めることで、いわゆる位相差による焦点検出を行うことが可能となる。   As can be seen from FIG. 6, because the incident angle characteristics of the A pixel and the B pixel are different from each other, an image shift in the pupil separation direction occurs between the line image of the A pixel group and the line image of the B pixel group when defocused. Will occur. Therefore, by obtaining the defocus amount in consideration of the image shift amount and the line image distribution of FIG. 6, it is possible to perform focus detection based on a so-called phase difference.

次に、カメラ1の焦点調整及び撮像工程に関する動作について説明する。図7〜図9及び図13は、カメラ1の焦点調整及び撮像工程を説明するためのフローチャートである。図7は、カメラ1のメインフローを示すフローチャートである。   Next, operations related to the focus adjustment and imaging process of the camera 1 will be described. 7 to 9 and 13 are flowcharts for explaining the focus adjustment and imaging process of the camera 1. FIG. 7 is a flowchart showing the main flow of the camera 1.

図7に示すように、ユーザがカメラ1のメインスイッチ(図示しない)をオンにすることで、CPU20は処理を開始する(S101)。次いで、CPU20は、S102において、カメラ1内の各アクチュエータやイメージセンサ10の動作確認等の初期状態検出を行ない、メモリ内容や実行プログラムの初期化を行なうと共に、撮像準備動作を実行する。   As shown in FIG. 7, when the user turns on a main switch (not shown) of the camera 1, the CPU 20 starts processing (S101). Next, in S102, the CPU 20 performs initial state detection such as operation check of each actuator in the camera 1 and the image sensor 10, initializes memory contents and an execution program, and executes an imaging preparation operation.

次いで、CPU20は、S103において操作スイッチ(図示しない)などによる操作状況に応じて、イメージセンサ10の撮像面AFの開始操作が行われたか否かを判定し、撮像面AFの開始操作が行われるまで待機する。撮像面AFの開始操作が行われた場合、CPU20は、S104においてミラーアップとシャッター開放動作を実行させる。   Next, in S103, the CPU 20 determines whether or not an operation for starting the imaging surface AF of the image sensor 10 has been performed according to an operation state using an operation switch (not shown) or the like, and the operation for starting the imaging surface AF is performed. Wait until. When the imaging surface AF start operation is performed, the CPU 20 causes the mirror up and shutter release operations to be executed in S104.

次いで、CPU20は、S105においてイメージセンサ10を駆動させて撮像動作を開始させ、イメージセンサ10で撮像された画像の読み出しを行う。これにより、イメージセンサ10はプレビュー用の低画素動画像を出力する。   Next, the CPU 20 drives the image sensor 10 to start an imaging operation in S105, and reads an image captured by the image sensor 10. Thereby, the image sensor 10 outputs a low-pixel moving image for preview.

次いで、CPU20は、S107において、イメージセンサ10から読み出した動画像を、カメラ1の背面に設けられた表示器(図示しない)にプレビュー画像として表示させる。ユーザは、このプレビュー画像を目視することで、撮像時の構図決定を行うことができる。   Next, in S107, the CPU 20 displays the moving image read from the image sensor 10 as a preview image on a display device (not shown) provided on the back surface of the camera 1. The user can determine the composition at the time of imaging by viewing the preview image.

次いで、CPU20は、S109においてプレビュー用の動画像から人物の顔認識を行い、S111においてその顔認識により人物の顔が検出されたか否かを判定する。動画像から顔が検出された場合、CPU20は、S113に処理を移行し、焦点調整モードを顔AFモードに設定する。ここで、顔AFモードとは、検出された顔に焦点を合わせるAFモードを指す。   Next, the CPU 20 performs human face recognition from the preview moving image in S109, and determines whether or not a human face has been detected by the face recognition in S111. When a face is detected from the moving image, the CPU 20 proceeds to S113 and sets the focus adjustment mode to the face AF mode. Here, the face AF mode refers to an AF mode that focuses on the detected face.

一方、動画像から顔が検出されない場合、CPU20は、S115に処理を移行し、焦点調整モードを多点AFモードに設定する。ここで、多点AFモードとは、イメージセンサ10の撮像領域を例えば3×5=15分割し、各分割領域で焦点検出を行ない、焦点検出結果と被写体の輝度情報から主被写体を類推し、主被写体に合焦させるモードを指す。   On the other hand, when no face is detected from the moving image, the CPU 20 proceeds to S115 and sets the focus adjustment mode to the multipoint AF mode. Here, the multipoint AF mode means that the imaging area of the image sensor 10 is divided into 3 × 5 = 15, for example, focus detection is performed in each divided area, and the main subject is inferred from the focus detection result and the luminance information of the subject, A mode that focuses on the main subject.

S113あるいはS115でAFモードを設定した後、CPU20は、S117において、設定されたAFモードに応じた焦点検出領域を設定する。例えば、顔AFモードでは検出された顔領域に焦点検出領域を設定し、多点AFモードでは主被写体に対応した領域に焦点検出領域を設定する。   After setting the AF mode in S113 or S115, the CPU 20 sets a focus detection area corresponding to the set AF mode in S117. For example, the focus detection area is set in the detected face area in the face AF mode, and the focus detection area is set in the area corresponding to the main subject in the multipoint AF mode.

次いで、CPU20は、S121において、撮像準備スイッチ(図示しない)がオン操作されたか否かを判定し、オン操作されていなければS105に処理を戻す。これにより、カメラ1は、撮像準備スイッチがオン操作されるまで、S105におけるイメージセンサ10の駆動からS117における焦点検出領域の決定までの処理を繰り返し実行することとなる。   Next, in S121, the CPU 20 determines whether or not an imaging preparation switch (not shown) is turned on. If not, the process returns to S105. Accordingly, the camera 1 repeatedly executes the processing from the driving of the image sensor 10 in S105 to the determination of the focus detection area in S117 until the imaging preparation switch is turned on.

S121において撮像準備スイッチがオン操作された場合、CPU20は、S131へ処理を移行し、焦点検出サブルーチンを実行する。   When the imaging preparation switch is turned on in S121, the CPU 20 proceeds to S131 and executes a focus detection subroutine.

図8は、焦点検出サブルーチンを示すフローチャートである。メインフローのS121から焦点検出サブルーチンを開始するS131に処理が移行すると、図8に示すように、CPU20は、S133において、S117で設定した焦点検出領域に含まれる焦点検出用画素を読み出す。   FIG. 8 is a flowchart showing a focus detection subroutine. When the process proceeds from S121 of the main flow to S131 where the focus detection subroutine is started, as shown in FIG. 8, the CPU 20 reads out the focus detection pixels included in the focus detection area set in S117 in S133.

次いで、CPU20は、S135において、焦点検出用画素から、S117で設定した焦点検出領域に対応した測距視野像を切り出す。次いで、CPU20は、S137において、予め製造工程などでチェックされた欠陥画素の情報のうち、S135で切り出した測距視野像内に存在する焦点検出用画素の欠陥情報を欠陥記憶手段としてのメモリ回路22から得る。次いで、CPU20は、S139において、相関演算サブルーチンを実行する。   Next, in S135, the CPU 20 cuts out a distance measuring field image corresponding to the focus detection area set in S117 from the focus detection pixels. Next, in S137, the CPU 20 uses, as a defect storage unit, the defect information of the focus detection pixels present in the ranging field image cut out in S135 among the information of the defective pixels checked in advance in the manufacturing process or the like in S137. Get from 22. Next, in S139, the CPU 20 executes a correlation calculation subroutine.

図9は、相関演算サブルーチンを示すフローチャートである。焦点検出サブルーチンのS139により相関演算サブルーチンが実行されると、図9に示すように、CPU20は、S191へ処理をジャンプする。次いで、CPU20は、S193において、焦点検出サブルーチンのS137で得た欠陥情報に基づいて欠陥画素を補正処理(補間処理)する。   FIG. 9 is a flowchart showing a correlation calculation subroutine. When the correlation calculation subroutine is executed in S139 of the focus detection subroutine, the CPU 20 jumps the processing to S191 as shown in FIG. Next, in S193, the CPU 20 corrects the defective pixel (interpolation process) based on the defect information obtained in S137 of the focus detection subroutine.

次いで、CPU20は、S195〜S207の像ずらし量のループ処理を行う。具体的には、CPU20は、S197において、像ずらしをした箇所で、S137で得た欠陥画素と対向する画素を補正(補間)する。具体的には、欠陥画素と対向する画素の値が、欠陥画素でない同種の焦点検出用画素の値に基づいて補間される。その後、CPU20は、S199〜S203の視野ループで、測距視野像内で相関量の演算を行う。S201では、例えば後述する演算式などを用いて相関量を演算する。上述した対向画素の補間は、本発明の要部となるので図10、11を用いて詳細に説明する。   Next, the CPU 20 performs a loop process of image shift amounts in S195 to S207. Specifically, in S197, the CPU 20 corrects (interpolates) a pixel facing the defective pixel obtained in S137 at the position where the image is shifted. Specifically, the value of the pixel facing the defective pixel is interpolated based on the value of the same type of focus detection pixel that is not the defective pixel. Thereafter, the CPU 20 calculates the correlation amount in the distance measuring field image in the field loop of S199 to S203. In S201, the correlation amount is calculated using, for example, an arithmetic expression described later. Since the above-described interpolation of the opposed pixels is a main part of the present invention, it will be described in detail with reference to FIGS.

図10は、図2に例示したイメージセンサ10の信号のうち、離散的に配置された焦点検出用画素を抜き出して得られた信号による線像を例示する図である。図2では、A、Bで示した画素のi行j列で得られる信号をとして表現した。本実施形態においては、jが瞳分割方向、iが瞳分割方向と直交する方向である。 FIG. 10 is a diagram illustrating a line image by a signal obtained by extracting focus detection pixels that are discretely arranged from the signals of the image sensor 10 illustrated in FIG. 2. In FIG. 2, a signal obtained from i rows and j columns of the pixels indicated by A and B is expressed as i A j . In the present embodiment, j is the pupil division direction and i is the direction orthogonal to the pupil division direction.

以下では、図10において、に欠陥があるとして説明を行う。(図10のi=2で演算をする場合で説明をする。)
相関量の計算方法は各種の方法が提案されているが、例えば2像の差の絶対値を加算したものを相関量として定義して計算を行う場合には、次の式(1)のとおりに相関量COR(k)を求める。
In the following description, it is assumed that 2 A 7 is defective in FIG. (This will be described in the case where the calculation is performed with i = 2 in FIG. 10.)
Various methods have been proposed for calculating the correlation amount. For example, when the calculation is performed by defining the correlation value as the sum of the absolute values of the differences between the two images, the following equation (1) is satisfied. A correlation amount COR (k) is obtained.

上記式のiは測距視野によって決まる値である。jは測距視野に対応しており、相関演算サブルーチンや視野ループに対応する。kは像ずらし量であり相関演算サブルーチンの像ずらしループに対応する。また、相関量を上記式のように定義することで、相関が高い像ずらし量(k)において相関量COR(k)は最小となる。   I in the above equation is a value determined by the distance measuring field. j corresponds to a distance measuring field, and corresponds to a correlation calculation subroutine or a field loop. k is an image shift amount and corresponds to an image shift loop of the correlation calculation subroutine. Also, by defining the correlation amount as in the above equation, the correlation amount COR (k) is minimized at the image shift amount (k) having a high correlation.

図11は、相関演算を行っている時の線像の状態を模式的に示した図である。図11において、各パラメータは、i=2、j=4,5,…,9、k=−2,−1,0,1,2である。図11から明らかなように、欠陥画素()と向かい合う画素は像をずらすごとに、と変化している。本発明では、この欠陥画素(2A7)及び欠陥画素に対向する画素を像ずらしごとに補間生成する。本発明において、上記の方法を、”向き合う対の画素を夫々生成する”方法と定義する。補間生成する方法として、例えばが欠陥画素の場合には、次の式(2)として与えられる。 FIG. 11 is a diagram schematically showing the state of a line image when performing a correlation calculation. In FIG. 11, the parameters are i = 2, j = 4, 5,..., 9, k = −2, −1, 0, 1, 2. As is apparent from FIG. 11, the pixel facing the defective pixel ( 2 A 7 ) changes to 2 B 5 , 2 B 6 , 2 B 7 , 2 B 8 , and 2 B 9 every time the image is shifted. In the present invention, the defective pixel (2A7) and the pixel facing the defective pixel are generated by interpolation every image shift. In the present invention, the above method is defined as a method of “generating opposite pairs of pixels, respectively”. As an interpolation generation method, for example, when i A j is a defective pixel, the following expression (2) is given.

なお、についても同様である。図11において、2A7は常に欠陥なので、像ずらし量に関わらず=()/2として与えられる。このため相関演算サブルーチンのS193で補正が行われる。一方、向かい合う像は、k=2[bit]の時は=()/2、k=1[bit]の時は=()/2と変化する。このため、相関演算サブルーチンのS197では、像ずらし量に応じて欠陥画素のと対向する画素を順次補間して与える。なお、別の補正式としては、次の式(3)、式(4)等を用いることもできる。 The same applies to i B j . In Figure 11, 2A7 always so defects, given as 2 A 7 = (2 A 6 + 2 A 8) / 2 regardless of the amount of shifting the image. Therefore, correction is performed in S193 of the correlation calculation subroutine. On the other hand, facing the image is, k = 2 [bit] when the 2 B 5 = (2 B 4 + 2 B 6) / 2, k = 1 [bit] when the 2 B 6 = (2 B 5 + 2 B 7 ) / 2. For this reason, in S197 of the correlation calculation subroutine, the pixels facing 2 A 7 of the defective pixels are sequentially interpolated and given according to the image shift amount. As another correction formula, the following formula (3), formula (4), etc. can be used.

式(2)は瞳分割方向に補間を行う式の例、式(3)は瞳分割と素直方向に補間を行う式の例、式(4)は2次元的に補間を行う式の例を示している。本発明は補間のタイミングとその対象に主な特徴があるのでいずれの補正式を用いてもよい。   Expression (2) is an example of an expression that performs interpolation in the pupil division direction, Expression (3) is an example of an expression that performs interpolation in the pupil division and straight direction, and Expression (4) is an example of an expression that performs interpolation in two dimensions. Show. Since the present invention has main characteristics in the interpolation timing and the object, any correction formula may be used.

図9に戻って相関演算サブルーチンの続きを説明する。CPU20は、測距視野内で計算を行うループ処理(S199〜S203)の後、S205で像ずらし量での相関量をRAMなどのメモリに保存する。CPU20は、S195〜S207の像ずらし量のループ処理で、規定の像ずらし範囲で相関量の演算を行う。   Returning to FIG. 9, the continuation of the correlation calculation subroutine will be described. After the loop processing (S199 to S203) for performing calculation within the distance measuring field, the CPU 20 stores the correlation amount as the image shift amount in a memory such as a RAM in S205. The CPU 20 calculates the correlation amount within a specified image shift range in the image shift amount loop processing of S195 to S207.

次いで、CPU20は、S208において、S195からS207でのループで求められた相関量をもとに、焦点検出用画素群における欠陥画素に対向する画素を決定する。つまり、S208では、後述するS209における補間前において、焦点検出用画素によるA画素群における欠陥画素と対向するB画素群の画素が決定される。具体的には、式(1)の定義に従うと相関が高い(2つの像がほぼ一致している)時に相関量CORは最小となるので、相関量が最小となるkを求める。具体的には、図11に示すように、欠陥画素のと対向している画素がの中から選択されることとなる。 Next, in S208, the CPU 20 determines a pixel facing the defective pixel in the focus detection pixel group based on the correlation amount obtained in the loop from S195 to S207. That is, in S208, the pixels of the B pixel group that are opposed to the defective pixels in the A pixel group by the focus detection pixels are determined before interpolation in S209 described later. Specifically, according to the definition of Expression (1), the correlation amount COR is minimized when the correlation is high (the two images are almost coincident), and therefore k that minimizes the correlation amount is obtained. Specifically, as shown in FIG. 11, the pixel facing the defective pixel 2 A 7 is selected from 2 B 5 , 2 B 6 , 2 B 7 , 2 B 8 , and 2 B 9. It will be.

次いで、CPU20は、S209において、S208で決定された欠陥画素に対向する画素の補正処理(補間処理)を行う。この補正処理における方法は、具体的には前述した式(2)〜式(4)を用いた補正方法と同様である。例えば、相関量が最小となるkが1である場合は、欠陥画素と対向する画素のが式(2)により()/2として補正(補間)されることとなる。すなわち、欠陥画素でない同種であるB画素群の焦点検出用画素の値に基づいて補間される。 Next, in step S209, the CPU 20 performs a correction process (interpolation process) for a pixel facing the defective pixel determined in step S208. The method in this correction processing is specifically the same as the correction method using the above-described equations (2) to (4). For example, if the correlation amount is k is 1, becomes minimum, 2 B 6 pixels facing the defective pixel is corrected (interpolated) by the equation (2) as (2 B 5 + 2 B 7 ) / 2 It will be. That is, the interpolation is performed based on the value of the focus detection pixel of the same type B pixel group that is not a defective pixel.

次いで、CPU20は、S211においてデジタルフィルタ処理を行う。S211におけるデジタルフィルタは、焦点検出において注目する周波数などに応じて適切な形状のものを用いてよい。次いで、CPU20は、S213〜S223において、S209で補正処理を行った像を用いて再度相関量を演算する像ずらし量のループ処理を行う。なお、S213〜S223における像ずらし量は、S195〜S207と同じである必要はなく、S209で相関量が最小となったkの近傍で演算が行われればよい。   Next, the CPU 20 performs digital filter processing in S211. The digital filter in S211 may have an appropriate shape according to the frequency of interest in focus detection. Next, in S213 to S223, the CPU 20 performs an image shift amount loop process for calculating the correlation amount again using the image subjected to the correction process in S209. Note that the image shift amounts in S213 to S223 need not be the same as those in S195 to S207, and may be calculated in the vicinity of k where the correlation amount is minimized in S209.

像ずらし量のループ処理において、CPU20は、S215〜S219の視野ループで、測距視野内で相関量の演算を行う。具体的には、CPU20は、S217で式(1)などにしたがって相関量を演算する。なお、S193で欠陥画素の補正を、S209で欠陥画素に対向する画素の補正を行ったので、S215とS217の間では補正処理は行わない。   In the loop processing of the image shift amount, the CPU 20 calculates the correlation amount within the distance measuring field in the field loop of S215 to S219. Specifically, the CPU 20 calculates the correlation amount according to the equation (1) in S217. Since the correction of the defective pixel is performed in S193 and the pixel facing the defective pixel is corrected in S209, the correction process is not performed between S215 and S217.

上述した再度相関量を演算する際の様子を模式的に図12に示した。図12では、S209において、相関量が最小となるkが0であり、が対向するとして処理された場合を示している。図12に示すとおり、S209で補正処理されたは、像ずらし中は補正処理が行われることなく、相関演算に用いられる。次いで、CPU20は、S221において視野ループにより演算された相関量を保存する。 FIG. 12 schematically shows how the correlation amount is calculated again as described above. FIG. 12 shows a case where, in S209, processing is performed assuming that k that minimizes the correlation amount is 0 and 2 A 7 and 2 B 7 face each other. As shown in FIG. 12, 2 B 7 corrected in S209 is used for correlation calculation without being corrected during image shifting. Next, the CPU 20 stores the correlation amount calculated by the visual field loop in S221.

次いで、CPU20は、S225において、プレディクション量を決定する。具体的には、CPU20は、S217で求めた相関量を元に、A画素群の線像とB画素群の線像との相関が最も高くなるkを決定する。次いで、CPU20は、S227において、図8に示した焦点検出サブルーチンのS139にリターンする。   Next, the CPU 20 determines the amount of prediction in S225. Specifically, the CPU 20 determines k with the highest correlation between the line image of the A pixel group and the line image of the B pixel group based on the correlation amount obtained in S217. Next, in S227, the CPU 20 returns to S139 of the focus detection subroutine shown in FIG.

図8に戻り、焦点検出サブルーチンの続きを説明する。S139に次いで、CPU20は、S141において、相関演算結果の信頼性を判定する。ここにおける信頼性とは、2像(A画素群の線像とB画素群の線像)の一致度合いを指し、2像の一致度が良い場合は一般的に焦点検出結果の信頼性が高い。そこで、複数の焦点検出領域が選択されている場合は、S141の判定結果に基づいて信頼性の高い情報を優先的に使用する。   Returning to FIG. 8, the continuation of the focus detection subroutine will be described. Following S139, the CPU 20 determines the reliability of the correlation calculation result in S141. Here, the reliability refers to the degree of coincidence between the two images (line image of the A pixel group and line image of the B pixel group). When the coincidence of the two images is good, the reliability of the focus detection result is generally high. . Therefore, when a plurality of focus detection areas are selected, highly reliable information is preferentially used based on the determination result of S141.

次いで、CPU20は、S143において、S141における信頼性の高い検出結果から焦点ずれ量を演算する。次いで、CPU20は、S145において、図7に示したメインフロー内のS151にリターンする。   Next, in S143, the CPU 20 calculates a defocus amount from the highly reliable detection result in S141. Next, in S145, the CPU 20 returns to S151 in the main flow shown in FIG.

図7に戻り、メインフローの続きを説明する。CPU20は、S151において、図8のS143で計算した焦点ずれ量が予め設定された許容値未満であり、合焦状態であるか否かを判定する。焦点ずれ量が許容値以上であり非合焦状態であると判定した場合、CPU20は、S153において撮像レンズ5のフォーカスレンズを駆動させた後、S131へ処理を戻す。したがって、カメラ1では、合焦状態と判定されるまで、S131乃至S151の処理が繰り返し実行されることとなる。   Returning to FIG. 7, the continuation of the main flow will be described. In S151, the CPU 20 determines whether or not the defocus amount calculated in S143 of FIG. 8 is less than a preset allowable value and is in a focused state. If the CPU 20 determines that the defocus amount is greater than or equal to the allowable value and is out of focus, the CPU 20 drives the focus lens of the imaging lens 5 in S153, and then returns the process to S131. Therefore, in the camera 1, the processes of S131 to S151 are repeatedly executed until it is determined that the camera is in focus.

焦点ずれ量が許容値未満であり合焦状態であると判定した場合、CPU20は、S155において、LCDなどの表示部(図示しない)に合焦状態であることを示す合焦表示を行わせ、S157に処理を移行する。   If the CPU 20 determines that the defocus amount is less than the allowable value and is in focus, the CPU 20 causes a display unit (not shown) such as an LCD to perform focus display indicating that it is in focus in S155, The process proceeds to S157.

次いで、CPU20は、S157において、撮像開始スイッチ(図示しない)がオン操作されたか否かを判定し、オン操作されていなければS159に移行する。CPU20は、S159において、撮像準備スイッチがオン操作されているか否かを判定し、撮像待機状態を維持するか否かを判別する。ここで、撮像待機状態を維持する場合、CPU20は、再びS157に処理を戻す。また、撮像待機状態を解除する場合、CPU20は、S105に処理を戻してプレビュー動作などを実行する。   Next, in S157, the CPU 20 determines whether or not an imaging start switch (not shown) is turned on. If not, the process proceeds to S159. In S159, the CPU 20 determines whether or not the imaging preparation switch is turned on, and determines whether or not to maintain the imaging standby state. Here, when maintaining the imaging standby state, the CPU 20 returns the process to S157 again. When canceling the imaging standby state, the CPU 20 returns the process to S105 and executes a preview operation or the like.

S157において撮像開始スイッチがオン操作された場合、CPU20は、S161に処理を移行し、撮像サブルーチンを実行する。図13は、撮像サブルーチンを示すフローチャートである。   When the imaging start switch is turned on in S157, the CPU 20 shifts the process to S161 and executes an imaging subroutine. FIG. 13 is a flowchart showing an imaging subroutine.

図13に示すように、撮像開始スイッチがオン操作されると、CPU20は、S161において撮像サブルーチン処理を開始し、S163において光量調整絞りを駆動し、露光時間を規定するメカニカルシャッタの開口制御を行う。なお、シャッタの駆動は一旦シャッタを閉じた後に再走行させてもよいし、電気的にリセット動作を行った後にシャッタが閉となるように走行させてもよい。   As shown in FIG. 13, when the imaging start switch is turned on, the CPU 20 starts imaging subroutine processing in S161, drives the light amount adjusting diaphragm in S163, and performs aperture control of the mechanical shutter that defines the exposure time. . The shutter may be driven once after the shutter is closed, or may be driven so that the shutter is closed after an electrical reset operation.

次いで、CPU20は、S165において、高画素静止画撮像のための画像読み出し、すなわちイメージセンサ10の全画素の読み出しを行う。次いで、CPU20は、S167において、読み出した画像信号の欠損画素補間を行う。イメージセンサ10における焦点検出用画素の出力は撮像のためのRGBカラー情報を有しておらず、静止画像を得る上では欠損画素に相当する。したがって、欠損画素補間では、焦点検出用画素の周囲にあるRGBカラー情報を有する撮像用画素の情報から補完することで焦点検出用画素に対応する画像信号を創生する。   Next, in S <b> 165, the CPU 20 reads an image for capturing a high-pixel still image, that is, reads all the pixels of the image sensor 10. Next, in S167, the CPU 20 performs defective pixel interpolation of the read image signal. The output of the focus detection pixel in the image sensor 10 does not have RGB color information for imaging, and corresponds to a defective pixel in obtaining a still image. Therefore, in the defective pixel interpolation, an image signal corresponding to the focus detection pixel is created by complementing the information of the imaging pixels having RGB color information around the focus detection pixel.

次いで、CPU20は、S169において画像のγ補正、エッジ強調等の画像処理を行った後、S171において半導体メモリなどの記録媒体(図示しない)に撮像画像を記録する。次いで、CPU20は、S173において前述した表示部に撮像済み画像を表示した後、S175において図7に示したメインフローにリターンする。図7に示すように、撮像サブルーチンからリターンすると、CPU20は、S181において一連の撮像動作を終了する。   Next, the CPU 20 performs image processing such as image gamma correction and edge enhancement in S169, and then records a captured image in a recording medium (not shown) such as a semiconductor memory in S171. Next, the CPU 20 displays the captured image on the display unit described above in S173, and then returns to the main flow illustrated in FIG. 7 in S175. As shown in FIG. 7, when returning from the imaging subroutine, the CPU 20 ends the series of imaging operations in S181.

ここで、上述した処理による効果を図14〜図16を参照して説明する。ここで、図14(a)は、焦点検出用画素群による線像と輝度との関係を示すグラフである。図14(b)は、図14(a)に例示した焦点検出用画素群の信号から演算して求められた相関量を示すグラフである。なお、図14(a)の横軸は焦点検出用画素の位置を、縦軸は輝度を示している。つまり、図14(a)の例では、中央付近に輝度の高い被写体があり、周囲が暗い場合を例示している。また、焦点検出用画素に欠陥が無ければA像、B像ともに同じ信号が入ることになるが、図14(a)の例では、A像の1つの画素が欠陥のために信号が欠落している。このときに欠落が無ければ像ずらし量=0bitの時に相関量が最小となる。   Here, the effect by the process mentioned above is demonstrated with reference to FIGS. Here, FIG. 14A is a graph showing the relationship between the line image and the luminance by the focus detection pixel group. FIG. 14B is a graph showing the amount of correlation obtained by calculation from the signal of the focus detection pixel group illustrated in FIG. In FIG. 14A, the horizontal axis indicates the position of the focus detection pixel, and the vertical axis indicates the luminance. That is, in the example of FIG. 14A, a case where there is a subject with high brightness near the center and the surrounding is dark is illustrated. If there is no defect in the focus detection pixel, the same signal is input to both the A image and the B image. However, in the example of FIG. 14A, the signal is missing because one pixel of the A image is defective. ing. If there is no omission at this time, the correlation amount is minimized when the image shift amount = 0 bits.

本実施形態では、図14(a)のような信号が得られるのは、焦点が合っている状態で且つ前述した様に中央に輝度の高い被写体があり、周囲が暗い場合である。欠陥と被写体との位置関係で欠陥画素が焦点検出に与える影響は異なるが、欠陥の影響が最も大きくなる場合として、図14(a)では中央の輝度の高い被写体のエッジ部分と欠陥画素が重なった場合を例示した。逆に言うと、暗い場所に黒つぶれなどの欠陥が存在しても焦点検出には影響がない。   In the present embodiment, the signal as shown in FIG. 14A is obtained when the subject is in focus and there is a subject with high brightness at the center as described above, and the surrounding is dark. Although the influence of the defective pixel on the focus detection differs depending on the positional relationship between the defect and the subject, as shown in FIG. 14A, the edge portion of the subject with high brightness overlaps with the defective pixel as the case where the influence of the defect becomes the largest. The case was shown as an example. In other words, even if a defect such as a blackout exists in a dark place, the focus detection is not affected.

図14(b)において、横軸は像ずらし量(前述したkに対応)であり、縦軸は前述した式(1)及び式(2)に基づいて求めた相関量である。前述したフローチャートでは、図9に示したS195〜S207においてこの相関量が求められる。図14(b)では、像ずらし量=0bitで相関量(COR)が最小値となっている。上述したように本実施形態では、焦点検出用画素において、その欠陥画素及びその欠陥画素と向き合う対の画素の夫々が式(2)よって周辺画素から補間される。   In FIG. 14B, the horizontal axis is the image shift amount (corresponding to k described above), and the vertical axis is the correlation amount obtained based on the above-described equations (1) and (2). In the flowchart described above, this correlation amount is obtained in S195 to S207 shown in FIG. In FIG. 14B, the correlation amount (COR) is the minimum value when the image shift amount = 0 bits. As described above, in the present embodiment, in the focus detection pixel, each of the defective pixel and the pair of pixels facing the defective pixel is interpolated from the peripheral pixels by Expression (2).

したがって、本実施形態では、本来像が一致する位置(図14(a)、(b)の例では0bit)の時にノイズが無ければ相関量=0(=相関が高い)となる。この位置で焦点検出用画素群によるA像とB像は一致し、最も相関が高いと判断される。前述したフローチャートでは、相関が最も高い位置を決めて欠陥画素とその欠陥画素と対向する画素を決定する動作がS208で行われる。   Therefore, in this embodiment, if there is no noise at the position where the images originally match (0 bit in the examples of FIGS. 14A and 14B), the correlation amount = 0 (= high correlation). At this position, the A and B images by the focus detection pixel group coincide with each other, and it is determined that the correlation is the highest. In the flowchart described above, an operation of determining a defective pixel and a pixel facing the defective pixel by determining a position having the highest correlation is performed in S208.

図15(a)は、焦点検出用画素群による線像と、S209によって欠陥画素及び欠陥画素に対向する画素が補正された後にデジタルフィルタ処理をした線像と輝度の関係を示すグラフである。図15(b)は、図15(a)に例示した焦点検出用画素群の信号を演算して求められた相関量を示すグラフである。なお、図15(a)の横軸は焦点検出用画素の位置を、縦軸は輝度を示している。前述したS209までにA像、B像の両方に対して欠陥画素および欠陥画素と対向する画素の補正処理したので、図15(a)に示すように、2つの線像は完全に一致している。   FIG. 15A is a graph showing a relationship between the line image by the focus detection pixel group, the line image obtained by performing digital filter processing after correcting the defective pixel and the pixel facing the defective pixel in S209, and the luminance. FIG. 15B is a graph showing the correlation amount obtained by calculating the signal of the focus detection pixel group illustrated in FIG. In FIG. 15A, the horizontal axis indicates the position of the focus detection pixel, and the vertical axis indicates the luminance. By the above-described S209, both the A image and the B image have been corrected for the defective pixel and the pixel facing the defective pixel. Therefore, as shown in FIG. Yes.

図15(b)において、横軸は像ずらし量(前述したkに対応)であり、縦軸は前述した式(1)及び式(2)に基づいて求められた相関量(COR)である。図15(a)に示したように1対の線像は完全に一致しているので、図15(b)に示すグラフでは像ずらし量=0bitの時に相関量が最小(=相関が高い)となる。よって、このグラフにおけるCORが最小値となる像ずらし量が、焦点検出の際のプレディクション量として最終的に選ばれることとなる。   In FIG. 15B, the horizontal axis is the image shift amount (corresponding to k described above), and the vertical axis is the correlation amount (COR) obtained based on the above-described equations (1) and (2). . As shown in FIG. 15A, the pair of line images are completely coincident with each other, and therefore, in the graph shown in FIG. 15B, the correlation amount is minimum when the image shift amount = 0 bits (= high correlation). It becomes. Therefore, the image shift amount at which the COR in this graph is the minimum value is finally selected as the prediction amount at the time of focus detection.

なお、焦点検出用画素群の欠陥画素及び欠陥画素に対向する画素の補間後に再度相関量を演算することによる効果をより分かり易くするために、焦点検出用画素群の欠陥画素のみを補間処理した結果を図16に示す。図16(a)は、焦点検出用画素群による線像と、欠陥画素のみが補正された後にデジタルフィルタ処理をした線像と輝度の関係を示すグラフである。図16(b)は、図16(a)に例示した焦点検出用画素群の信号を演算して求められた相関量を示すグラフである。   Note that only the defective pixels in the focus detection pixel group were interpolated in order to make the effect of calculating the correlation amount again after interpolation of the defective pixels in the focus detection pixel group and the pixels facing the defective pixels. The results are shown in FIG. FIG. 16A is a graph showing the relationship between the line image by the focus detection pixel group, the line image obtained by performing digital filter processing after correcting only the defective pixel, and the luminance. FIG. 16B is a graph showing the correlation amount obtained by calculating the signal of the focus detection pixel group illustrated in FIG.

図16(a)に示すように、欠陥画素のみを補間処理した場合は、1対の線像は一致しない。このため、図16(b)に示すように、相関量を示すグラフ曲線は、非対称且つボトムが完全には下がらない形となる。したがって、このような相関量が求まった場合は、図16(b)に示すように、グラフの変曲点を境にして両側から接線を延長するなどの方法でCOR(k)が最小(COR=0)となるkを推定することとなる。なお、kを推定する方法は、相関量のグラフ曲線に近似する適当な関数を用いて極小値を求める方法であってもよい。   As shown in FIG. 16A, when only a defective pixel is interpolated, a pair of line images do not match. For this reason, as shown in FIG. 16B, the graph curve indicating the correlation amount is asymmetric and the bottom is not completely lowered. Therefore, when such a correlation amount is obtained, as shown in FIG. 16B, COR (k) is minimized (COR) by a method such as extending a tangent from both sides with the inflection point of the graph as a boundary. = 0) is estimated. The method of estimating k may be a method of obtaining a minimum value using an appropriate function that approximates a graph curve of the correlation amount.

しかし、上述した推定により求めたkは、焦点が合っている状態にもかかわらずk=0とはならない。つまり、焦点が合っている状態でもずれていると判断され、誤った焦点検出が行われる虞があり、その結果として合焦していないピントの外れた撮像画像を取得することとなる。しかしながら、本実施形態では、上述した簡単なアルゴリズム(フロー)にしたがって焦点検出用画素群に関する欠陥処理を行うことで、焦点検出用画素群に含まれる欠陥画素の影響を低減することができる。このことにより、カメラ1は、ユーザに正確に合焦した撮像画像を提供することが可能となる。また、イメージセンサ10における焦点検出用画素群に欠陥画素を許容できることからイメージセンサ10の歩留まりが向上し、コストの低減を図ることが可能となる。
[第2の実施形態]
図17〜図21は第2の実施形態を説明するための図である。以下では、これらの図を参照して第2の実施形態を説明する。なお、本実施形態は相関演算における演算を除いて第1の実施形態と同様なので、カメラ1の構成等の同様な部分についての説明は割愛し、第1の実施形態と異なる部分についてのみ説明する。
However, k obtained by the above-described estimation does not become k = 0 regardless of the in-focus state. In other words, it is determined that the image is out of focus even when it is in focus, and erroneous focus detection may be performed. As a result, an out-of-focus captured image that is not in focus is acquired. However, in the present embodiment, the influence of the defective pixels included in the focus detection pixel group can be reduced by performing the defect processing related to the focus detection pixel group according to the simple algorithm (flow) described above. Thus, the camera 1 can provide a captured image that is accurately focused on the user. Further, since defective pixels can be allowed in the focus detection pixel group in the image sensor 10, the yield of the image sensor 10 is improved, and the cost can be reduced.
[Second Embodiment]
17 to 21 are diagrams for explaining the second embodiment. Hereinafter, the second embodiment will be described with reference to these drawings. Since this embodiment is the same as the first embodiment except for the calculation in the correlation calculation, the description of the similar parts such as the configuration of the camera 1 is omitted, and only the parts different from the first embodiment are described. .

本実施形態において、メインフローは図7、焦点検出サブルーチンは図8、撮像サブルーチンは図13に示したとおりである。第1の実施形態とは異なる相関演算サブルーチンについては図17に示した。   In this embodiment, the main flow is as shown in FIG. 7, the focus detection subroutine is as shown in FIG. 8, and the imaging subroutine is as shown in FIG. The correlation calculation subroutine different from that of the first embodiment is shown in FIG.

図17に示すように、第2の実施形態と第1の実施形態との相違点は、S193aにおいて、焦点検出サブルーチンのS137で得た欠陥情報に基づいて焦点検出用画素群における欠陥部(欠陥画素)の排除処理を行っていることである。ここでいう排除処理とは、欠陥部を焦点状態の検出に用いないように、欠陥部を除いて演算を行うことを指している。なお、具体的な処理方法は後述する。   As shown in FIG. 17, the difference between the second embodiment and the first embodiment is that, in S193a, a defect portion (defect in the focus detection pixel group based on the defect information obtained in S137 of the focus detection subroutine). Pixel) elimination processing. Here, the exclusion process refers to performing an operation excluding the defective portion so that the defective portion is not used for the detection of the focus state. A specific processing method will be described later.

さらに、S195〜S207では像ずらし量の処理ループを形成している。そして、S197aでは、像ずらしをした箇所で、焦点検出サブルーチンのS137で得た欠陥情報に基づいて欠陥画素と対向する画素を焦点状態の検出に用いないように排除する排除処理を行う。   Further, in S195 to S207, an image shift amount processing loop is formed. In S197a, an exclusion process is performed in which the pixel facing the defective pixel is excluded from the focus state detection based on the defect information obtained in S137 of the focus detection subroutine at the position where the image is shifted.

図18は、相関演算を行っている時の焦点検出用画素群による焦点検出像であるA像とB像の状態を模式的に示した図である。図18は、欠陥画素の排除処理を行った後の状態を図示している。図18では、排除処理の結果、演算から除かれた画素が明らかになるように右に排除した画素を明示した。   FIG. 18 is a diagram schematically showing the states of the A image and the B image that are focus detection images by the focus detection pixel group during the correlation calculation. FIG. 18 illustrates a state after the defective pixel elimination process is performed. In FIG. 18, the pixel excluded to the right is clearly shown so that the pixel excluded from the calculation becomes clear as a result of the exclusion process.

図18から明らかなように、欠陥画素のと向かい合う画素は像をずらすごとにと変化している。本実施形態では、欠陥画素の及びその欠陥画素に対向する画素を像ずらしごとに削除することで相関演算に影響を与えないようにする。本発明において、上記の方法を”欠陥画素と向き合う対の画素を夫々排除した焦点検出像を生成する”方法と定義する。 As apparent from FIG. 18, the pixel facing the defective pixel 2 A 7 changes to 2 B 5 , 2 B 6 , 2 B 7 , 2 B 8 , and 2 B 9 every time the image is shifted. In this embodiment, 2 A 7 of the defective pixel and the pixel facing the defective pixel are deleted every image shift so that the correlation calculation is not affected. In the present invention, the above method is defined as “a method for generating a focus detection image in which a pair of pixels facing a defective pixel is excluded”.

図18において、は常に欠陥なので、像ずらし量に関わらず削除され、の次はとなるようにA像は処理される。このため、相関演算サブルーチンのS193aで排除処理が行われる。 18, since 2 A 7 always defects are removed regardless of the amount of shifting the image, the next 2 A 6 is A image such that 2 A 8 is processed. For this reason, the exclusion process is performed in S193a of the correlation calculation subroutine.

一方、向かい合う像はk=2[bit]の時はなので、の次はとなるようにB像は処理される。また、向かい合う像はk=1[bit]の時はなので、の次はとなるようにB像は処理される。つまり、像ずらしによってB像の処理方法が変化している。このため、相関演算サブルーチンのS197aにおける排除処理では、像ずらし量に応じて欠陥画素のと対向する画素を削除することでB像を与える。 On the other hand, facing the image is because 2 B 5 when the k = 2 [bit], B picture as follows 2 B 4 becomes 2 B 6 is processed. Also, opposing the image is because 2 B 6 when the k = 1 [bit], as B picture following a 2 B 7 of 2 B 5 is processed. That is, the processing method of the B image is changed by image shifting. For this reason, in the exclusion process in S197a of the correlation calculation subroutine, the B image is given by deleting the pixel facing 2 A 7 of the defective pixel according to the image shift amount.

相関演算サブルーチンのS199〜S203では、第1の実施形態と同様に測距視野内で計算を行う視野ループを形成する。また、S205では、像ずらし量での相関量をメモリに保存する。上述したS195〜S207の像ずらし量のループ処理により、規定の像ずらし範囲での相関量の演算が行われる。   In correlation calculation subroutines S199 to S203, a visual field loop for performing calculation within the distance measuring visual field is formed as in the first embodiment. In S205, the correlation amount based on the image shift amount is stored in the memory. By the above-described image shift amount loop processing in S195 to S207, the correlation amount is calculated in the specified image shift range.

S208では、第1の実施形態と同様、S195からS207でのループで求められた相関量をもとに、後述するS209aにおける排除前において、焦点検出用画素群における欠陥画素に対向する画素を決定する。具体的には、式(1)の定義に従うと相関が高い(2つの像がほぼ一致している)時に相関量CORは最小となるので、相関量が最小となるkを求める。例えば、欠陥画素のと対向している画素がの中から選択されることとなる。次いで、CPU20は、S209aにおいて、S208で決定された画素を排除する。 In S208, as in the first embodiment, based on the correlation amount obtained in the loop from S195 to S207, a pixel that faces the defective pixel in the focus detection pixel group is determined before being eliminated in S209a described later. To do. Specifically, according to the definition of Expression (1), the correlation amount COR is minimized when the correlation is high (the two images are almost coincident), and therefore k that minimizes the correlation amount is obtained. For example, the pixel facing the defective pixel 2 A 7 is selected from 2 B 5 , 2 B 6 , 2 B 7 , 2 B 8 , and 2 B 9 . Next, the CPU 20 eliminates the pixel determined in S208 in S209a.

次いで、CPU20が行うS211以降の処理は第1の実施形態と同様である。具体的には、S211では、デジタルフィルタ処理を行う。S211におけるデジタルフィルタは、焦点検出において注目する周波数などに応じて適切な形状のものを用いてよい。S213〜223では、欠陥画素に対向する画素をS209aにより排除した像を用いて再度相関量を演算するための像ずらしループを形成する。なお、S213における像ずらし量はS195と同じである必要はなく、S209aで相関量が最小となったkの近傍で演算が行われればよい。   Next, the processing after S211 performed by the CPU 20 is the same as that of the first embodiment. Specifically, in S211, digital filter processing is performed. The digital filter in S211 may have an appropriate shape according to the frequency of interest in focus detection. In S213 to 223, an image shift loop for calculating the correlation amount again is formed using the image in which the pixel facing the defective pixel is excluded in S209a. Note that the image shift amount in S213 does not have to be the same as that in S195, and it is sufficient if the calculation is performed in the vicinity of k where the correlation amount is minimized in S209a.

S215〜S219の視野ループでは、測距視野内の相関量の演算を行う。S193aで欠陥画素を、S209aで欠陥画素に対向する画素を排除したので、S215とS217の間では補正処理は行わない。   In the field loop of S215 to S219, the correlation amount in the distance measuring field is calculated. Since the defective pixel is excluded in S193a and the pixel facing the defective pixel is excluded in S209a, the correction process is not performed between S215 and S217.

上述した再度相関量を演算する様子を模式的に図19に示した。図19では、S209aにおいて、相関量が最小となるkが0であり、が対向するとして処理された場合を示している。図19に示すとおり、はS209aで排除され、再度相関量を演算する際には用いられない。S221では視野ループにより演算された相関量を保存し、S225では、プレディクション量を決定する。具体的には、S217で求めた相関量を元に、A画素群の線像とB画素群の線像との相関が最も高くなるkを決定する。次いで、S227では、図8に示した焦点検出サブルーチンのS139にリターンする。 FIG. 19 schematically shows how the correlation amount is calculated again as described above. FIG. 19 shows a case where, in S209a, processing is performed assuming that k that minimizes the correlation amount is 0 and 2 A 7 and 2 B 7 face each other. As shown in FIG. 19, 2 B 7 is excluded in S209a and is not used when calculating the correlation amount again. In S221, the correlation amount calculated by the visual field loop is stored, and in S225, the prediction amount is determined. Specifically, based on the correlation amount obtained in S217, k that gives the highest correlation between the line image of the A pixel group and the line image of the B pixel group is determined. Next, in S227, the process returns to S139 of the focus detection subroutine shown in FIG.

ここで、上述した処理による効果を図20、図21を参照して説明する。なお、被写体による焦点検出用画素群からの信号やその輝度及び欠陥画素の位置などは、図14に例示した第1の実施形態と同じとする。図20は最初相関量を求める時の焦点検出像とその相関量を示すグラフであり、図20(a)は排除処理が行われた後の焦点検出用画素群による線像と輝度との関係を示すグラフである。また、図20(b)は、図20(a)に例示した焦点検出用画素群の信号から演算して求められた相関量を示すグラフである。なお、図20(a)の横軸は焦点検出用画素の位置を、縦軸は輝度を示している。   Here, the effect by the process mentioned above is demonstrated with reference to FIG. 20, FIG. The signal from the focus detection pixel group by the subject, the luminance thereof, the position of the defective pixel, and the like are the same as those in the first embodiment illustrated in FIG. FIG. 20 is a graph showing the focus detection image and the correlation amount when the correlation amount is first obtained, and FIG. 20A is a relationship between the line image and the luminance by the focus detection pixel group after the exclusion process is performed. It is a graph which shows. FIG. 20B is a graph showing the amount of correlation obtained by calculation from the signal of the focus detection pixel group illustrated in FIG. In FIG. 20A, the horizontal axis indicates the position of the focus detection pixel, and the vertical axis indicates the luminance.

図20(a)を生成する元の信号は、図14(a)に示したようにA像のみ被写体の輝度変化がある箇所に欠陥がある信号である。一方、図20(a)に示す信号は、正しく2つの像が重ねあわされた場所で排除処理を施した後の信号である。したがって、図14(a)と図20(a)とにおいて、輝度の高い部分を比べた場合は図20(a)の方が排除処理によって短くなる。また、図20(a)に示したように、欠陥画素及びその欠陥画素と対向する画素を排除したので、正しく重ねあわされたときには、他の画素の信号は完全に一致し、2つの像の相関が高く演算される。   The original signal for generating FIG. 20 (a) is a signal having a defect in a portion where only the A image has a luminance change as shown in FIG. 14 (a). On the other hand, the signal shown in FIG. 20A is a signal after the exclusion process is performed at a place where two images are correctly overlapped. Therefore, in FIG. 14 (a) and FIG. 20 (a), when a portion with high luminance is compared, FIG. 20 (a) is shortened by the exclusion process. Also, as shown in FIG. 20 (a), since the defective pixel and the pixel facing the defective pixel are excluded, the signals of the other pixels are completely coincided with each other when they are correctly overlaid. High correlation is calculated.

図20(b)において、横軸は像ずらし量であり、縦軸は前述した式(1)に基づいて求めた相関量である。前述したフローチャートでは、図17に示したS195〜S207においてこの相関量が求められる。図20(b)では、像ずらし量=0bitで相関量(COR)が最小値となっている。また、本実施形態では、焦点検出用画素群の欠陥画素及びその欠陥画素と向き合う対の像信号を排除して用いないようにし、排除後の焦点検出像の相関量が演算される。   In FIG. 20B, the horizontal axis is the image shift amount, and the vertical axis is the correlation amount obtained based on the above-described equation (1). In the flowchart described above, this correlation amount is obtained in S195 to S207 shown in FIG. In FIG. 20B, the correlation amount (COR) is the minimum value when the image shift amount = 0 bits. In the present embodiment, the defective pixel of the focus detection pixel group and the pair of image signals facing the defective pixel are excluded and not used, and the correlation amount of the focus detection image after the exclusion is calculated.

したがって、本実施形態では、本来像が一致する場所(図20(b)、(b)の例では0bit)の時にノイズが無ければ相関量=0(=相関が高い)となる。この位置で焦点検出用画素群によるA像とB像は完全に一致し、最も相関が高いと判断される。前述したフローチャートでは、相関が最も高い位置を決めて欠陥画素とその欠陥画素と対向する画素を決定する動作がS209aで行われる。   Therefore, in this embodiment, if there is no noise at the place where the images originally match (0 bits in the examples of FIGS. 20B and 20B), the correlation amount = 0 (= high correlation). At this position, the A image and the B image by the focus detection pixel group are completely matched, and it is determined that the correlation is the highest. In the flowchart described above, an operation of determining a defective pixel and a pixel facing the defective pixel by determining a position having the highest correlation is performed in S209a.

図21(a)は、焦点検出用画素群による線像と、S209aによって欠陥画素及び欠陥画素に対向する画素が排除された後にデジタルフィルタ処理をした線像と輝度の関係を示すグラフである。図21(b)は、図21(a)に例示した焦点検出用画素群の信号を演算して求められた相関量を示すグラフである。なお、図21(a)の横軸は焦点検出用画素の位置を、縦軸は輝度を示している。前述したS209aまでにA像、B像の両方に対して欠陥画素及び欠陥画素と対向する画素の排除処理をしたので、図21(a)に示すように、2つの線像は完全に一致している。   FIG. 21A is a graph showing the relationship between the line image by the focus detection pixel group, the line image obtained by performing digital filter processing after the defective pixel and the pixel facing the defective pixel are excluded by S209a, and the luminance. FIG. 21B is a graph showing the correlation amount obtained by calculating the signal of the focus detection pixel group illustrated in FIG. In FIG. 21A, the horizontal axis indicates the position of the focus detection pixel, and the vertical axis indicates the luminance. Since both the A image and the B image have been subjected to the exclusion process of the defective pixel and the pixel facing the defective pixel by S209a described above, the two line images completely coincide as shown in FIG. ing.

図21(b)において、横軸は像ずらし量であり、縦軸は前述した式(1)に基づいて求められた相関量である。図21(a)に示したように1対の線像は完全に一致しているので、図21(b)に示すグラフでは像ずらし量=0bitの時に相関量が最小(=相関が高い)となる。よって、このグラフにおける相関量CORが最小値となる像ずらし量が、焦点検出の際のプレディクション量として最終的に選ばれることとなる。   In FIG. 21B, the horizontal axis represents the image shift amount, and the vertical axis represents the correlation amount obtained based on the above-described equation (1). As shown in FIG. 21 (a), the pair of line images are completely coincident with each other. Therefore, in the graph shown in FIG. 21 (b), the correlation amount is minimum when the image shift amount = 0 bits (= high correlation). It becomes. Therefore, the image shift amount at which the correlation amount COR in this graph is the minimum value is finally selected as the prediction amount at the time of focus detection.

本実施形態では、上述した簡単なアルゴリズム(フロー)にしたがって焦点検出用画素群に関する欠陥処理(排除処理)を行うことで、焦点検出用画素群に含まれる欠陥画素の影響を低減することができる。このことにより、カメラ1は、ユーザに正確に合焦した撮像画像を提供することが可能となる。また、イメージセンサ10における焦点検出用画素群に欠陥画素を許容できることからイメージセンサ10の歩留まりが向上し、コストの低減を図ることが可能となる。
[第3の実施形態]
図22〜図24は第3の実施形態を説明するための図である。以下では、これらの図を参照して第3の実施形態を説明する。なお、本実施形態において、前述した第1、2の実施形態と同様な部分についての説明は割愛する。
In the present embodiment, the defect processing (exclusion processing) related to the focus detection pixel group is performed according to the simple algorithm (flow) described above, thereby reducing the influence of the defective pixels included in the focus detection pixel group. . Thus, the camera 1 can provide a captured image that is accurately focused on the user. Further, since defective pixels can be allowed in the focus detection pixel group in the image sensor 10, the yield of the image sensor 10 is improved, and the cost can be reduced.
[Third Embodiment]
22-24 is a figure for demonstrating 3rd Embodiment. Hereinafter, the third embodiment will be described with reference to these drawings. In addition, in this embodiment, the description about the part similar to 1st, 2nd embodiment mentioned above is omitted.

図22は、第3の実施形態に係る焦点検出装置を備えたカメラ1aの構成の概略を示す図である。図22に示すように、カメラ1aは、イメージセンサ10(撮像素子)が撮像レンズ5の結像面に配置されたデジタルスチルカメラである。なお、焦点検出センサ205の欠陥情報を記憶する欠陥記憶手段を含む処理回路などの電気的な構成は、第1の実施形態と同様なので、ここでは省略した。   FIG. 22 is a diagram illustrating an outline of a configuration of a camera 1a including the focus detection apparatus according to the third embodiment. As shown in FIG. 22, the camera 1 a is a digital still camera in which an image sensor 10 (imaging device) is disposed on the imaging surface of the imaging lens 5. Note that the electrical configuration of the processing circuit including the defect storage means for storing the defect information of the focus detection sensor 205 is the same as that of the first embodiment, and is omitted here.

カメラ1aでは、ユーザが構図を決めている状態では、撮像レンズ5から入射される光の光路がクイックリターンミラー200によって変更され、被写体像を観察するための接眼レンズ3に光束が導かれる。同時に、クイックリターンミラー200は半反射面になっており、接眼レンズ3に導かれる光束以外の残りの光束は焦点検出センサ205に導かれることとなる。焦点検出センサ205は、撮影光学系の異なる瞳領域を通った1対の光束を結像させる瞳分割手段と、1対の光束の一方が結像される第1のエリアと、1対の光束の他方が結像される第2のエリアとを有する。   In the camera 1a, when the user determines the composition, the optical path of the light incident from the imaging lens 5 is changed by the quick return mirror 200, and the light beam is guided to the eyepiece 3 for observing the subject image. At the same time, the quick return mirror 200 has a semi-reflective surface, and the remaining light beam other than the light beam guided to the eyepiece lens 3 is guided to the focus detection sensor 205. The focus detection sensor 205 includes a pupil dividing unit that forms a pair of light beams that have passed through different pupil regions of the photographing optical system, a first area on which one of the pair of light beams is formed, and a pair of light beams. A second area on which the other is imaged.

ここで、カメラ1aにおける瞳分割手段に関して図22及び図23を参照して説明する。図23に示すように、焦点検出センサ205における瞳分割手段は、フィールドレンズ201、視野マスク202、瞳分割マスク203、2次結像レンズ204a、204bより構成される。視野マスク202は撮像レンズ5の結像面近傍に設けられ、焦点検出範囲を規定する。2次結像レンズ204a、204bからみて撮像レンズ5に近い側には絞り孔203a、203bを有する瞳分割マスク203が設けられている。絞り孔203a、203bは2次結像レンズ204a、204bに入射する光束を規制する。瞳分割マスク203は、フィールドレンズ201の光学パワーにより撮像レンズ5の射出瞳の位置に略結像するような関係の位置に置かれる。   Here, pupil dividing means in the camera 1a will be described with reference to FIGS. As shown in FIG. 23, the pupil division means in the focus detection sensor 205 includes a field lens 201, a field mask 202, a pupil division mask 203, and secondary imaging lenses 204a and 204b. The field mask 202 is provided in the vicinity of the imaging surface of the imaging lens 5 and defines a focus detection range. A pupil division mask 203 having aperture holes 203a and 203b is provided on the side closer to the imaging lens 5 when viewed from the secondary imaging lenses 204a and 204b. The aperture holes 203a and 203b restrict the light beam incident on the secondary imaging lenses 204a and 204b. The pupil division mask 203 is placed at such a position as to form an approximate image at the position of the exit pupil of the imaging lens 5 by the optical power of the field lens 201.

1対の2次結像レンズ204a、204bは、視野マスク202で決定された領域の被写体像を焦点検出センサ205の第1のエリアとしての受光エリア206aと、第2のエリアとしての受光エリア206b上に結像させる。焦点検出センサ205の受光エリア206a、206b上において、被写体像により光電変換された電荷は、電気信号として読み出され、位相差による焦点検出演算に用いられる。したがって、カメラ1aでは、前述の受光エリア206a、206bから得られる電気信号から適宜なレンズ位置の演算を行うことで、測距視野に対応したデフォーカス量を得ることができる。   The pair of secondary imaging lenses 204a and 204b includes a light receiving area 206a as the first area of the focus detection sensor 205 and a light receiving area 206b as the second area of the subject image determined by the field mask 202. Image on top. On the light receiving areas 206a and 206b of the focus detection sensor 205, the electric charge photoelectrically converted by the subject image is read out as an electric signal and used for focus detection calculation based on a phase difference. Therefore, the camera 1a can obtain a defocus amount corresponding to the distance measuring field by calculating an appropriate lens position from the electrical signals obtained from the light receiving areas 206a and 206b.

図24は、カメラ1aのメインフローを示すフローチャートである。なお、焦点検出サブルーチン及び撮像サブルーチンは第1の実施形態で例示した図10、図11のフローチャートに従って行う。また、図24に示すフローチャートでは、第1の実施形態と同じ動作をするものには同じ符号を付した。以下に第1の実施形態との違いについて述べる。   FIG. 24 is a flowchart showing a main flow of the camera 1a. Note that the focus detection subroutine and the imaging subroutine are performed according to the flowcharts of FIGS. 10 and 11 illustrated in the first embodiment. Further, in the flowchart shown in FIG. 24, the same reference numerals are given to the same operations as those in the first embodiment. Differences from the first embodiment will be described below.

図24に示すように、第1の実施形態との違いは、本実施形態に係るメインフローにはS103、S104がないことである。本実施形態では、焦点検出センサ205に被写体像を導くためのいわゆる2次結像光学系に、半透過のクイックリターンミラーを通して光束を導くため、ミラーアップ動作やシャッター開放動作が必要ない。また撮影サブルーチン内のS163では、第1の実施形態においてシャッター閉→再走行という動作をしている。これに対し、本実施形態では、S163に到達した時にシャッターは閉状態にあるので、従来の銀塩カメラなどと同様のシャッター走行動作をすればよい。なお、その他の動作は第1の実施形態と同じである。   As shown in FIG. 24, the difference from the first embodiment is that the main flow according to the present embodiment does not include S103 and S104. In the present embodiment, since the light beam is guided to the so-called secondary imaging optical system for guiding the subject image to the focus detection sensor 205 through the semi-transmissive quick return mirror, the mirror up operation and the shutter opening operation are not necessary. In S163 in the photographing subroutine, an operation of shutter closing → re-running is performed in the first embodiment. On the other hand, in this embodiment, the shutter is in the closed state when S163 is reached, so that the shutter running operation similar to that of a conventional silver halide camera or the like may be performed. Other operations are the same as those in the first embodiment.

なお、図23に例示した焦点検出センサ205は、受光エリア206a、206bが2次元的にひろがるいわゆるエリアセンサであってもよいし、複数の1対の像を得るためのラインを持ついわゆるラインセンサであってもよい。このようなセンサには、本発明を容易に適用できる。具体的には、S133において、焦点検出を行うための焦点検出センサ205の信号を読み出せばよく、以下は第1の実施形態と同様の動作でよい。   The focus detection sensor 205 illustrated in FIG. 23 may be a so-called area sensor in which the light receiving areas 206a and 206b expand two-dimensionally, or a so-called line sensor having lines for obtaining a plurality of pairs of images. It may be. The present invention can be easily applied to such a sensor. Specifically, in S133, the signal of the focus detection sensor 205 for performing focus detection may be read, and the following operation may be the same as that of the first embodiment.

本実施形態によれば、上述した簡単なアルゴリズム(フロー)にしたがって焦点検出センサ205の欠陥画素を処理することで、焦点検出センサ205に含まれる欠陥画素の影響を低減することができる。このことにより、カメラ1aは、ユーザに正確に合焦した撮像画像を提供することが可能となる。また、撮像レンズ5における欠陥画素を許容できることから撮像レンズ5の歩留まりが向上し、コストの低減を図ることが可能となる。   According to the present embodiment, the influence of defective pixels included in the focus detection sensor 205 can be reduced by processing defective pixels of the focus detection sensor 205 according to the simple algorithm (flow) described above. Thus, the camera 1a can provide a captured image that is accurately focused on the user. Further, since defective pixels in the imaging lens 5 can be tolerated, the yield of the imaging lens 5 can be improved and the cost can be reduced.

なお、上述した実施の形態における記述は、一例を示すものであり、これに限定するものではない。上述した実施の形態における構成及び動作に関しては、適宜変更が可能である。   Note that the description in the above-described embodiment shows an example, and the present invention is not limited to this. The configuration and operation in the embodiment described above can be changed as appropriate.

例えば、上述した実施形態では焦点検出用画素群におけるA像において欠陥画素がある場合を例示したが、B像に欠陥画素があっても同様な処理が行われることは言うまでもない。さらに、焦点検出用画素群におけるA像、B像ともに欠陥画素がある場合であっても同様である。
(他の実施形態)
上述の実施形態は、システム或は装置のコンピュータ(或いはCPU、MPU等)によりソフトウェア的に実現することも可能である。従って、上述の実施形態をコンピュータで実現するために、該コンピュータに供給されるコンピュータプログラム自体も本発明を実現するものである。つまり、上述の実施形態の機能を実現するためのコンピュータプログラム自体も本発明の一つである。
For example, in the above-described embodiment, the case where there is a defective pixel in the A image in the focus detection pixel group is illustrated, but it goes without saying that the same processing is performed even if there is a defective pixel in the B image. Further, the same applies to the case where there are defective pixels in both the A and B images in the focus detection pixel group.
(Other embodiments)
The above-described embodiment can also be realized in software by a computer of a system or apparatus (or CPU, MPU, etc.). Therefore, the computer program itself supplied to the computer in order to implement the above-described embodiment by the computer also realizes the present invention. That is, the computer program itself for realizing the functions of the above-described embodiments is also one aspect of the present invention.

なお、上述の実施形態を実現するためのコンピュータプログラムは、コンピュータで読み取り可能であれば、どのような形態であってもよい。例えば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等で構成することができるが、これらに限るものではない。上述の実施形態を実現するためのコンピュータプログラムは、記憶媒体又は有線/無線通信によりコンピュータに供給される。プログラムを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、磁気テープ等の磁気記憶媒体、MO、CD、DVD等の光/光磁気記憶媒体、不揮発性の半導体メモリなどがある。   The computer program for realizing the above-described embodiment may be in any form as long as it can be read by a computer. For example, it can be composed of object code, a program executed by an interpreter, script data supplied to the OS, but is not limited thereto. A computer program for realizing the above-described embodiment is supplied to a computer via a storage medium or wired / wireless communication. Examples of the storage medium for supplying the program include a magnetic storage medium such as a flexible disk, a hard disk, and a magnetic tape, an optical / magneto-optical storage medium such as an MO, CD, and DVD, and a nonvolatile semiconductor memory.

有線/無線通信を用いたコンピュータプログラムの供給方法としては、コンピュータネットワーク上のサーバを利用する方法がある。この場合、本発明を形成するコンピュータプログラムとなりうるデータファイル(プログラムファイル)をサーバに記憶しておく。プログラムファイルとしては、実行形式のものであっても、ソースコードであっても良い。そして、このサーバにアクセスしたクライアントコンピュータに、プログラムファイルをダウンロードすることによって供給する。この場合、プログラムファイルを複数のセグメントファイルに分割し、セグメントファイルを異なるサーバに分散して配置することも可能である。つまり、上述の実施形態を実現するためのプログラムファイルをクライアントコンピュータに提供するサーバ装置も本発明の一つである。   As a computer program supply method using wired / wireless communication, there is a method of using a server on a computer network. In this case, a data file (program file) that can be a computer program forming the present invention is stored in the server. The program file may be an executable format or a source code. Then, the program file is supplied by downloading to a client computer that has accessed the server. In this case, the program file can be divided into a plurality of segment files, and the segment files can be distributed and arranged on different servers. That is, a server apparatus that provides a client computer with a program file for realizing the above-described embodiment is also one aspect of the present invention.

また、上述の実施形態を実現するためのコンピュータプログラムを暗号化して格納した記憶媒体を配布し、所定の条件を満たしたユーザに、暗号化を解く鍵情報を供給し、ユーザの有するコンピュータへのインストールを許可してもよい。鍵情報は、例えばインターネットを介してホームページからダウンロードさせることによって供給することができる。また、上述の実施形態を実現するためのコンピュータプログラムは、すでにコンピュータ上で稼働するOSの機能を利用するものであってもよい。さらに、上述の実施形態を実現するためのコンピュータプログラムは、その一部をコンピュータに装着される拡張ボード等のファームウェアで構成してもよいし、拡張ボード等が備えるCPUで実行するようにしてもよい。   In addition, a storage medium in which the computer program for realizing the above-described embodiment is encrypted and distributed is distributed, and key information for decrypting is supplied to a user who satisfies a predetermined condition, and the user's computer Installation may be allowed. The key information can be supplied by being downloaded from a homepage via the Internet, for example. Further, the computer program for realizing the above-described embodiment may use an OS function already running on the computer. Further, a part of the computer program for realizing the above-described embodiment may be configured by firmware such as an expansion board attached to the computer, or may be executed by a CPU provided in the expansion board. Good.

1、1a カメラ
5 撮像レンズ
10 イメージセンサ
20 CPU
21 イメージセンサ制御回路
22 メモリ回路
23 インターフェース回路
24 画像処理回路
1, 1a Camera 5 Imaging lens 10 Image sensor 20 CPU
21 Image sensor control circuit 22 Memory circuit 23 Interface circuit 24 Image processing circuit

Claims (5)

撮像光学系による結像面の焦点状態を検出する焦点検出装置において、
複数の第1の焦点検出用画素と複数の第2の焦点検出用画素から構成され、前記第1の焦点検出用画素と前記第2の焦点検出用画素とが構成する焦点検出用画素対を複数有する焦点検出センサと、
前記焦点検出センサの欠陥画素を示す欠陥情報を記憶する欠陥記憶手段と、
前記欠陥情報が示す欠陥画素の値と、当該欠陥画素と前記焦点検出用画素対を構成する前記第1の焦点検出用画素又は前記第2の焦点検出用画素の値とを、前記焦点状態の検出に用いないように排除する排除手段と、
前記排除手段による排除後の前記複数の焦点検出用画素対の前記第1の焦点検出用画素から得られる第1の焦点検出像と、前記第2の焦点検出用画素から得られる第2の焦点検出像との位相差から、前記焦点状態を検出する検出手段と、
を備えることを特徴とする焦点検出装置。
In the focus detection device that detects the focus state of the imaging plane by the imaging optical system,
A focus detection pixel pair composed of a plurality of first focus detection pixels and a plurality of second focus detection pixels, and formed by the first focus detection pixels and the second focus detection pixels. A plurality of focus detection sensors;
Defect storage means for storing defect information indicating defective pixels of the focus detection sensor;
The value of the defective pixel indicated by the defect information and the value of the first focus detection pixel or the second focus detection pixel constituting the defective pixel and the focus detection pixel pair are set in the focus state. An exclusion means for excluding it from being used for detection;
A first focus detection image obtained from the first focus detection pixels of the plurality of focus detection pixel pairs after exclusion by the exclusion means, and a second focus obtained from the second focus detection pixels. Detection means for detecting the focus state from a phase difference with a detection image;
A focus detection apparatus comprising:
前記排除手段が、前記排除前の前記複数の焦点検出用画素対から得られる前記第1の焦点検出像と、前記第2の焦点検出像との相関に基づいて、前記欠陥画素と前記焦点検出用画素対を構成する前記第1の焦点検出用画素又は前記第2の焦点検出用画素を決定することを特徴とする請求項1に記載の焦点検出装置。   The defective unit and the focus detection based on a correlation between the first focus detection image obtained from the plurality of focus detection pixel pairs before the exclusion and the second focus detection image. 2. The focus detection apparatus according to claim 1, wherein the first focus detection pixel or the second focus detection pixel constituting the pixel pair is determined. 前記複数の焦点検出用画素対が、被写体像を光電変換する複数の画素を備えた前記結像面に配置された撮像素子において、所定のピッチで分散して配置されることを特徴とする請求項1又は請求項2に記載の焦点検出装置。   The plurality of focus detection pixel pairs are arranged in a dispersed manner at a predetermined pitch in an image pickup device arranged on the imaging plane having a plurality of pixels for photoelectrically converting a subject image. The focus detection apparatus according to claim 1 or 2. 前記焦点検出センサが、前記撮像光学系の異なる瞳領域を通った1対の光束を結像させる瞳分割手段と、前記1対の光束の一方が結像される第1のエリアと、前記1対の光束の他方が結像される第2のエリアとを有し、前記複数の第1の焦点検出用画素が前記第1のエリアに、前記複数の第2の焦点検出用画素が前記第2のエリアに配置されることを特徴とする請求項1又は請求項2に記載の焦点検出装置。   The focus detection sensor forms a pair of light beams that pass through different pupil regions of the imaging optical system, a first area where one of the pair of light beams is imaged, and the 1 A second area on which the other of the pair of light beams is imaged, the plurality of first focus detection pixels in the first area, and the plurality of second focus detection pixels in the first area. The focus detection apparatus according to claim 1, wherein the focus detection apparatus is arranged in two areas. 複数の第1の焦点検出用画素と複数の第2の焦点検出用画素から構成され、前記第1の焦点検出用画素と前記第2の焦点検出用画素とが構成する焦点検出用画素対を複数有する焦点検出センサと、前記焦点検出センサの欠陥画素を示す欠陥情報を記憶する欠陥記憶手段とを有し、撮像光学系による結像面の焦点状態を検出する焦点検出装置の制御方法であって、
前記欠陥情報が示す欠陥画素の値と、当該欠陥画素と前記焦点検出用画素対を構成する前記第1の焦点検出用画素又は前記第2の焦点検出用画素の値とを、前記焦点状態の検出に用いないように排除する排除工程と、
前記排除工程による排除後の前記複数の焦点検出用画素対の前記第1の焦点検出用画素から得られる第1の焦点検出像と、前記第2の焦点検出用画素から得られる第2の焦点検出像との位相差から、前記焦点状態を検出する検出工程と、
を含むことを特徴とする焦点検出装置の制御方法。
A focus detection pixel pair composed of a plurality of first focus detection pixels and a plurality of second focus detection pixels, and formed by the first focus detection pixels and the second focus detection pixels. A control method for a focus detection apparatus that includes a plurality of focus detection sensors and defect storage means for storing defect information indicating defective pixels of the focus detection sensors, and detects a focus state of an imaging plane by an imaging optical system. And
The value of the defective pixel indicated by the defect information and the value of the first focus detection pixel or the second focus detection pixel constituting the defective pixel and the focus detection pixel pair are set in the focus state. An exclusion step to exclude it from being used for detection;
A first focus detection image obtained from the first focus detection pixels of the plurality of focus detection pixel pairs after exclusion in the exclusion step, and a second focus obtained from the second focus detection pixels. A detection step of detecting the focus state from a phase difference with a detection image;
A control method for a focus detection apparatus, comprising:
JP2012227420A 2012-10-12 2012-10-12 Focus detection apparatus and control method thereof Active JP5340468B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012227420A JP5340468B2 (en) 2012-10-12 2012-10-12 Focus detection apparatus and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012227420A JP5340468B2 (en) 2012-10-12 2012-10-12 Focus detection apparatus and control method thereof

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2008315027A Division JP5230388B2 (en) 2008-12-10 2008-12-10 Focus detection apparatus and control method thereof

Publications (2)

Publication Number Publication Date
JP2013041294A JP2013041294A (en) 2013-02-28
JP5340468B2 true JP5340468B2 (en) 2013-11-13

Family

ID=47889671

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012227420A Active JP5340468B2 (en) 2012-10-12 2012-10-12 Focus detection apparatus and control method thereof

Country Status (1)

Country Link
JP (1) JP5340468B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7057090B2 (en) * 2017-10-11 2022-04-19 キヤノン株式会社 Distance measuring device and distance measuring method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3205941B2 (en) * 1991-08-28 2001-09-04 池上通信機株式会社 Automatic aperture adjustment device
JP2814945B2 (en) * 1995-03-03 1998-10-27 株式会社ニコン Automatic focus detection device
JPH1010420A (en) * 1996-06-21 1998-01-16 Nikon Corp Focal point detector and method for adjusting the same
JP2001177756A (en) * 1999-12-21 2001-06-29 Canon Inc Image pickup device and camera system provided with it
JP5003132B2 (en) * 2006-12-07 2012-08-15 ソニー株式会社 Imaging device and imaging apparatus

Also Published As

Publication number Publication date
JP2013041294A (en) 2013-02-28

Similar Documents

Publication Publication Date Title
JP5230388B2 (en) Focus detection apparatus and control method thereof
US20200280714A1 (en) Method for performing out-focus using depth information and camera using the same
JP5089515B2 (en) Focus adjustment device, imaging device, interchangeable lens, conversion coefficient calibration method, conversion coefficient calibration program
JP5097077B2 (en) Imaging apparatus, control method thereof, and program
JP5183715B2 (en) Image processing apparatus and image processing method
JP5173954B2 (en) Image processing apparatus and image processing method
JP5219865B2 (en) Imaging apparatus and focus control method
US20130050546A1 (en) Image processing apparatus and method
EP3048787A1 (en) Image processing apparatus, image pickup apparatus, image processing method, program, and storage medium
JP5966426B2 (en) Focus detection device
JP2013030895A (en) Signal processing apparatus, imaging apparatus, signal processing method, and program
US10122910B2 (en) Focus detection device and image-capturing apparatus
JP2020533883A (en) Methods and equipment for double camera-based imaging
US20240214668A1 (en) Image processing device, image processing method, imaging device, and recording medium
US9060119B2 (en) Image capturing apparatus and control method for image capturing apparatus
JP2011257565A (en) Imaging device
JP2020088689A (en) Image processing apparatus, imaging apparatus, and image processing method
JP2014135564A (en) Image pickup device and image processing device
JP2015152749A (en) Imaging device and control method of the same
JP5340468B2 (en) Focus detection apparatus and control method thereof
JP5486284B2 (en) Imaging device
JP6346484B2 (en) Image processing apparatus and control method thereof
JP2016031446A (en) Imaging device and method of controlling the same
JP2014026050A (en) Image capturing device and image processing device
JP6136364B2 (en) Defocus amount detection device and camera

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130628

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130806

R151 Written notification of patent or utility model registration

Ref document number: 5340468

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151