JP2009008686A - Range finder - Google Patents

Range finder Download PDF

Info

Publication number
JP2009008686A
JP2009008686A JP2008192675A JP2008192675A JP2009008686A JP 2009008686 A JP2009008686 A JP 2009008686A JP 2008192675 A JP2008192675 A JP 2008192675A JP 2008192675 A JP2008192675 A JP 2008192675A JP 2009008686 A JP2009008686 A JP 2009008686A
Authority
JP
Japan
Prior art keywords
sensor
data
correlation value
value
shift amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2008192675A
Other languages
Japanese (ja)
Other versions
JP4802223B2 (en
Inventor
Hideo Yoshida
秀夫 吉田
Kiichi Mihara
喜一 三原
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.)
Fujinon Corp
Original Assignee
Fujinon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujinon Corp filed Critical Fujinon Corp
Priority to JP2008192675A priority Critical patent/JP4802223B2/en
Publication of JP2009008686A publication Critical patent/JP2009008686A/en
Application granted granted Critical
Publication of JP4802223B2 publication Critical patent/JP4802223B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prevent deterioration of ranging accuracy by reducing an operation amount by performing correlation value operation using AF data obtained at prescribed intervals among AF data within a pair of window ranges, and also by performing correlation operation using all AF data within a pair of the window ranges, using a shift amount in the window range when the maximum correlation value among the correlation values found this way is obtained as a reference and narrowing down the range within a prescribed range before and after the reference. <P>SOLUTION: Correlation value operation is performed by using AF data for every three data between a pair of AF data obtained from a pair of the window ranges. After that, the shift amount in the window range when the maximum correlation value is obtained among the correlation values obtained by a correlation value operating means is used as the reference, and within the prescribed range (re-operation range) before and after the reference, the correlation value operation (ordinary operation) is performed by using all AF data within a pair of the window ranges. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は測距装置に係り、特にパッシブ方式のAFセンサを用いた例えばカメラの測距装置に関する。   The present invention relates to a distance measuring device, and more particularly to a distance measuring device for a camera using a passive AF sensor.

パッシブ方式のAFセンサを用いたカメラの測距装置は、例えば左右一対のラインセンサにより測距対象物を撮像し、左右のセンサ像(AFデータ)を取得する。この左右一対のラインセンサから得られるAFデータのうち、相関値演算に使用する一対のAFデータを取得するための一対のウインドウ範囲を決定し、この一対のウインドウ範囲を一対の所定のセンサ領域(採用センサ)内で互いに逆方向にシフトさせながら順次相関値演算に使用する一対のAFデータを取得する。又は、一方のウインドウ範囲を固定し、他方のウインドウ範囲をシフトさせながら順次相関値演算に使用する一対のAFデータを取得する。このようにして得られる一対のAFデータの相関を求め、最大相関が得られるとき(一対の採用センサ内の左右のセンサ像が一致するとき)のウインドウ範囲のシフト量に基づいて測距対象物距離を算出している。   A camera distance measuring device using a passive AF sensor images a distance measuring object using, for example, a pair of left and right line sensors, and acquires left and right sensor images (AF data). Of the AF data obtained from the pair of left and right line sensors, a pair of window ranges for acquiring a pair of AF data used for correlation value calculation is determined, and the pair of window ranges is defined as a pair of predetermined sensor regions ( A pair of AF data used for the correlation value calculation is sequentially acquired while shifting in the opposite directions in the employed sensor). Alternatively, a pair of AF data used for correlation value calculation is sequentially acquired while fixing one window range and shifting the other window range. The correlation object of the pair of AF data obtained in this way is obtained, and the distance measurement object is based on the shift amount of the window range when the maximum correlation is obtained (when the left and right sensor images in the pair of adopted sensors match). The distance is calculated.

上記のようにAFデータの相関値演算によって最大相関を求める場合、AFデータの画素数が多くなると、相関演算の回数が増加し、測距時間が増加するという問題がある。   When obtaining the maximum correlation by calculating the correlation value of the AF data as described above, there is a problem that as the number of pixels of the AF data increases, the number of correlation calculations increases and the distance measurement time increases.

従来、この問題を解決するためにAFデータから離散的に分布した演算対象画素を選択し、選択された演算対象画素についてのみ相関値演算(一画素相関値演算)を行い、各演算対象画素の相関値をシフト量ごとに加え合わせ、その合計相関値に基づいてシフト量を求める測距方法が提案されている(特許文献1参照)。
特開平10−26525号公報
Conventionally, in order to solve this problem, calculation target pixels distributed discretely from AF data are selected, and a correlation value calculation (one-pixel correlation value calculation) is performed only on the selected calculation target pixel. A distance measurement method has been proposed in which correlation values are added for each shift amount and the shift amount is obtained based on the total correlation value (see Patent Document 1).
Japanese Patent Laid-Open No. 10-26525

しかしながら、従来の測距方法では、測距時間は短縮されるが、測距精度が低減するという問題がある。更に、各演算対象画素の一画素相関演算後に、各相関値をシフト量ごとに加え合わせるため、一画素相関結果全てを保存しておく必要があるという問題がある。   However, in the conventional distance measuring method, the distance measuring time is shortened, but there is a problem that the distance measuring accuracy is decreased. Furthermore, after the one-pixel correlation calculation of each pixel to be calculated, there is a problem that all the one-pixel correlation results need to be stored in order to add the correlation values for each shift amount.

本発明はこのような事情に鑑みてなされたもので、測距精度を低下させずに測距時間の短縮を図ることができる測距装置を提供することを目的とする。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide a distance measuring device capable of shortening the distance measuring time without reducing the distance measuring accuracy.

前記目的を達成するために請求項1に係る測距装置は、複数の受光素子からなる一対のラインセンサに測距対象物からの光を結像させ、各受光素子から得られた信号に基づいて相関値演算用の一対のAFデータを生成するAFデータ生成手段と(ここで、AFデータはラインセンサの各受光素子から出力された信号を積分して得られたセンサデータをそのまま用いたもの、及び、センサデータにコントラスト抽出処理等を施したものを含む)、前記一対のラインセンサのうちの測距に使用する一対の採用センサ範囲から一対のAFデータを取得するAFデータ取得手段と、前記一対の採用センサ範囲内において、相関値演算に使用する一対のAFデータを取得するための一対のウインドウ範囲を決定し、該一対のウインドウ範囲を前記一対の採用センサ範囲内の最高相関を得るためにシフトさせながら順次相関値演算する第1の相関値演算手段であって、前記一対のウインドウ範囲内のAFデータのうちの所定間隔置きのAFデータを用いて相関値演算する第1の相関値演算手段と、前記第1の相関値演算手段により得られた相関値のうちの最高相関値が得られたときの前記ウインドウ範囲のシフト量を基準とする前後の所定の範囲内で、前記一対のウインドウ範囲をシフトさせながら順次相関値演算する第2の相関値演算手段であって、前記一対のウインドウ範囲内の全てのAFデータを用いて相関値演算する第2の相関値演算手段と、前記第2の相関値演算手段により得られた相関値のうちの最高相関値が得られたときの前記ウインドウ範囲のシフト量に基づいて測距対象物の距離を算出する測距対象物距離算出手段と、を備えたことを特徴としている。   In order to achieve the object, a distance measuring apparatus according to claim 1 forms an image of light from a distance measuring object on a pair of line sensors composed of a plurality of light receiving elements, and based on signals obtained from the light receiving elements. AF data generating means for generating a pair of AF data for correlation value calculation (here, the AF data is obtained by directly using sensor data obtained by integrating signals output from the respective light receiving elements of the line sensor) And AF data acquisition means for acquiring a pair of AF data from a pair of adopted sensor ranges used for ranging among the pair of line sensors, including a sensor data subjected to contrast extraction processing, etc. Within the pair of adopted sensor ranges, a pair of window ranges for acquiring a pair of AF data used for correlation value calculation is determined, and the pair of window ranges is determined as the pair of window ranges. First correlation value calculation means for sequentially calculating correlation values while shifting to obtain the highest correlation within the sensor range, and using AF data at predetermined intervals among the AF data in the pair of window ranges The first correlation value calculating means for calculating the correlation value and the shift amount of the window range when the highest correlation value among the correlation values obtained by the first correlation value calculating means is obtained as a reference. A second correlation value calculation means for sequentially calculating correlation values while shifting the pair of window ranges within a predetermined range before and after, wherein correlation value calculation is performed using all AF data in the pair of window ranges. And a second correlation value calculating means and a shift amount of the window range when the highest correlation value among the correlation values obtained by the second correlation value calculating means is obtained. It is characterized by comprising: a distance measurement object distance calculating means for calculating the release.

即ち、第1の相関演算手段は、一対のウインドウ範囲内のAFデータのうちの所定間隔置きのAFデータを用いて相関値演算を行なうため、演算量を低減することができ、一方、第2の相関演算手段は、第1の相関値演算手段により得られた相関値のうちの最高相関値が得られたときのウインドウ範囲のシフト量を基準とする前後の所定の範囲内で、一対のウインドウ範囲内の全てのAFデータを用いて相関値演算するため、測距精度が低下することがない。   That is, since the first correlation calculation means performs correlation value calculation using AF data at predetermined intervals among the AF data in the pair of window ranges, the calculation amount can be reduced, while the second The correlation calculation means includes a pair of pairs within a predetermined range before and after the shift amount of the window range when the highest correlation value among the correlation values obtained by the first correlation value calculation means is obtained. Since the correlation value is calculated using all the AF data within the window range, the ranging accuracy does not deteriorate.

請求項2に示すように前記第1の相関値演算手段は、前記採用センサ内の相関値演算により高い相関を示す極値が複数ある場合には、最も相関の高い極値を暫定第1極値とし、次に相関の高い極値を暫定第2極値として求め、前記第2の相関値演算手段は、前記暫定第1極値と暫定第2極値との差が所定の基準値内の場合には、前記暫定第1極値が得られたときの前記ウインドウ範囲のシフト量を基準とする前後の所定の範囲内と、前記暫定第2極値が得られたときの前記ウインドウ範囲のシフト量を基準とする前後の所定の範囲内とでそれぞれ相関値演算を行うことを特徴としている。   According to a second aspect of the present invention, when there are a plurality of extreme values showing a high correlation by the correlation value calculation in the employed sensor, the first correlation value calculation means determines the extreme value having the highest correlation as the provisional first pole. And the second correlation value calculating means determines that the difference between the provisional first extreme value and the provisional second extreme value is within a predetermined reference value. In this case, within the predetermined range before and after the shift amount of the window range when the provisional first extreme value is obtained, and the window range when the provisional second extreme value is obtained The correlation value calculation is performed within a predetermined range before and after the shift amount.

前記暫定第1極値と暫定第2極値との差が所定の基準値内の場合には、いずれの極値が最高相関値に近いか不明だからである。   This is because when the difference between the provisional first extreme value and the provisional second extreme value is within a predetermined reference value, it is unknown which extreme value is close to the highest correlation value.

請求項3に示すように、前記第1の相関値演算手段により最高相関値が得られたときの前記ウインドウ範囲のシフト量と、前記第2の相関値演算手段により最高相関値が得られるときの前記ウインドウ範囲のシフト量との差を求める手段と、前記求めた差が所定のシフト量以上の場合には測距不能とする判定手段と、を有することを特徴としている。   The shift amount of the window range when the highest correlation value is obtained by the first correlation value calculating means, and when the highest correlation value is obtained by the second correlation value calculating means. Means for determining a difference from the shift amount of the window range, and determining means for disabling ranging when the calculated difference is equal to or greater than a predetermined shift amount.

前記第1、第2の相関値演算手段によって求めた最高相関値が得られたときの各シフト量の差が所定のシフト量以上の場合には、それぞれ求めたシフト量の信頼性が低く、誤測距されるおそれがあるからである。   When the difference between the shift amounts when the highest correlation value obtained by the first and second correlation value calculating means is obtained is not less than a predetermined shift amount, the reliability of the obtained shift amount is low, This is because there is a risk of erroneous distance measurement.

請求項4に示すように、前記第1の相関値演算手段により暫定第1極値が得られたときの前記ウインドウ範囲の第1のシフト量及び暫定第2極値が得られたときの前記ウインドウ範囲の第2のシフト量と、前記第2の相関値演算手段により最高相関値が得られるときの前記ウインドウ範囲の第3のシフト量との差をそれぞれ求める手段と、前記求めた差のうちの小さい方の差が所定のシフト量以上の場合には測距不能とする判定手段と、を有することを特徴としている。   According to a fourth aspect of the present invention, the first shift amount and the temporary second extreme value of the window range when the temporary first extreme value is obtained by the first correlation value calculating means are obtained when the temporary second extreme value is obtained. Means for determining a difference between the second shift amount of the window range and a third shift amount of the window range when the highest correlation value is obtained by the second correlation value calculating means; And determining means for disabling the distance measurement when the smaller difference is equal to or greater than a predetermined shift amount.

即ち、前記第1極値の第1のシフト量と第2極値の第2のシフト量のうち、最高相関値のシフト量(第3のシフト量)に近い方のシフト量と、第3のシフト量との差の大きさによって測距不能か否かを判定するようにしている。   That is, among the first shift amount of the first extreme value and the second shift amount of the second extreme value, the shift amount closer to the shift amount (third shift amount) of the highest correlation value; Whether or not distance measurement is possible is determined based on the magnitude of the difference from the shift amount.

請求項5に示すように、前記第1の相関値演算手段により最高相関値が得られたときの前記ウインドウ範囲のシフト量と、前記第2の相関値演算手段により最高相関値が得られるときの前記ウインドウ範囲のシフト量との差を求める手段を有し、前記第2の相関値演算手段は、前記求めた差のシフト量の分だけ前記所定の範囲を越えて追加の相関値演算を行うことを特徴としている。   The shift amount of the window range when the highest correlation value is obtained by the first correlation value computing means and when the highest correlation value is obtained by the second correlation value computing means as shown in claim 5 The second correlation value calculating means performs an additional correlation value calculation exceeding the predetermined range by an amount of the calculated shift amount of the difference. It is characterized by doing.

請求項6に示すように、前記測距対象物距離算出手段は、前記第2の相関値演算手段により得られた相関値のうちの最高相関値と、その前後の前記所定の範囲の相関値とに基づいて補間値演算によって真の最高相関値が得られるシフト量を求め、該シフト量に基づいて測距対象物距離を算出することを特徴としている。前記第2の相関値演算手段により得られる最高相関値は、離散的な相関値のなかの最高相関値であるが、請求項6によれば、離散的でない真の最高相関値のシフト量を求めることができる。尚、請求項5は、前記補間値演算によって真の最高相関値を求める際に、補間値演算に使用する相関値が不足しないようにしている。   According to a sixth aspect of the present invention, the distance measuring object distance calculating means includes the highest correlation value among the correlation values obtained by the second correlation value calculating means, and the correlation values in the predetermined range before and after the correlation value. On the basis of the above, a shift amount at which a true maximum correlation value is obtained by interpolation value calculation is obtained, and a distance measurement object distance is calculated based on the shift amount. The highest correlation value obtained by the second correlation value calculating means is the highest correlation value among the discrete correlation values. According to claim 6, the shift amount of the true highest correlation value that is not discrete is calculated. Can be sought. According to the fifth aspect of the present invention, when the true maximum correlation value is obtained by the interpolation value calculation, the correlation value used for the interpolation value calculation is not deficient.

請求項7に示すように、前記第1の相関値演算手段により最高相関値が得られたときの前記ウインドウ範囲のシフト量が、近距離側測距不要範囲内か否かを判断する判断手段と、前記判断手段によって近距離側測距不要範囲内と判断されると、前記第2の相関値演算手段による相関値演算を中止させる手段と、を有し、第1の相関値演算手段により得られた最高相関値をもとに測距対象物の距離を算出することを特徴としている。   The determination means for determining whether or not the shift amount of the window range when the highest correlation value is obtained by the first correlation value calculation means is within a short distance-side distance measurement unnecessary range. And a means for stopping the correlation value calculation by the second correlation value calculation means when the determination means determines that it is within the short distance side distance measurement unnecessary range, and the first correlation value calculation means It is characterized in that the distance of the object to be measured is calculated based on the highest correlation value obtained.

請求項8に示すように前記一対の採用センサは、前記一対のラインセンサの全測距エリアのセンサ、又は前記一対のラインセンサの全測距エリアを複数の分割エリアに分割した各分割エリアのセンサである。後者の場合には、ある採用センサでの測距が不能となる場合でも、他の採用センサでの測距が可能となる場合がある。   As shown in claim 8, the pair of adopted sensors includes a sensor for the entire distance measuring area of the pair of line sensors, or each of the divided areas obtained by dividing the entire distance measuring area of the pair of line sensors into a plurality of divided areas. It is a sensor. In the latter case, even if it is impossible to perform distance measurement using a certain adopted sensor, distance measurement using another adopted sensor may be possible.

本発明に係る測距装置によれば、一対のウインドウ範囲内のAFデータのうちの所定間隔置きのAFデータを用いて相関値演算を行なうようにしたため、演算量を低減することができ、一方、このようにして求めた相関値のうちの最高相関値が得られたときのウインドウ範囲のシフト量を基準とする前後の所定の範囲に絞って、一対のウインドウ範囲内の全てのAFデータを用いて相関値演算を行なうようにしたため、測距精度が低下することがない。   According to the distance measuring apparatus according to the present invention, since the correlation value calculation is performed using the AF data at predetermined intervals among the AF data in the pair of window ranges, the calculation amount can be reduced. All AF data in a pair of window ranges are narrowed down to a predetermined range before and after the shift amount of the window range when the highest correlation value among the correlation values thus obtained is obtained. Since the correlation value calculation is performed using the distance measurement accuracy, the distance measurement accuracy does not decrease.

以下添付図面に従って、本発明に係る測距装置を例えばカメラに適用した場合の好ましい実施の形態について詳説する。   A preferred embodiment when the distance measuring device according to the present invention is applied to, for example, a camera will be described in detail below with reference to the accompanying drawings.

図1は、本発明が適用されたカメラの正面斜視図である。同図に示すようにカメラ10には、被写体像を銀塩フイルムに結像する撮影レンズを備えたズームレンズ鏡胴12と、ストロボ光が発光されるストロボ発光窓16と、撮影者が被写体を確認するファインダ窓18と、被写体距離を測定するパッシブタイプのAFセンサが内蔵されているAF窓22と、被写体の明るさを測定する測光センサが内蔵されている測光窓25と、撮影者がシャッタレリーズを指示する際に操作するシャッタボタン34等が設けられている。   FIG. 1 is a front perspective view of a camera to which the present invention is applied. As shown in the figure, the camera 10 includes a zoom lens barrel 12 having a photographing lens for forming a subject image on a silver salt film, a strobe light emission window 16 that emits strobe light, and a photographer selects a subject. A finder window 18 for checking, an AF window 22 containing a passive AF sensor for measuring the subject distance, a photometric window 25 containing a photometric sensor for measuring the brightness of the subject, and a photographer taking a shutter. A shutter button 34 or the like that is operated when instructing the release is provided.

図2は、カメラ10の背面斜視図である。同図に示すようにカメラ10には、設定されている撮影モード等や日付情報等を表示するLCD表示パネル38と、ストロボの発光モードを設定するフラッシュボタン42と、セルフタイマーのモードを設定するセルフタイマーボタン44と、フォーカスのモードを設定するフォーカスボタン46と、日付や時刻を設定する日付ボタン48と、撮影画角をワイド方向又はテレ方向に指示するズームボタン50とが設けられている。   FIG. 2 is a rear perspective view of the camera 10. As shown in the figure, the camera 10 is set with an LCD display panel 38 for displaying a set shooting mode, date information, etc., a flash button 42 for setting a flash emission mode, and a self-timer mode. A self-timer button 44, a focus button 46 for setting a focus mode, a date button 48 for setting a date and time, and a zoom button 50 for instructing a shooting angle of view in a wide direction or a tele direction are provided.

例えば、フラッシュボタン42を操作すると、フラッシュ(ストロボ)に関するモードを切り替えることができ、フラッシュボタン42で選択可能なモードとして、被写体が暗い場合にストロボ光を自動発光するオートモード、本発光前にプレ発光を行い赤目を軽減する赤目軽減モード、ストロボ光を強制発光する強制発光モード、ストロボを発光しない発光禁止モード、ストロボを発光して人物と夜景とを撮影する夜景ポートレートモード等がある。また、フォーカスボタン46を操作すると、フォーカスに関するモードを切り替えることができ、フォーカスボタン46で選択可能なモードとして、自動でピント合わせを行うオートフォーカスモード、遠景を撮影するための遠景モード、マクロ撮影のためのマクロモード等のモードがある。   For example, when the flash button 42 is operated, the mode related to the flash (strobe) can be switched. As modes that can be selected with the flash button 42, an auto mode that automatically emits strobe light when the subject is dark, There are a red-eye reduction mode that emits light and reduces red-eye, a forced light-emission mode that forcibly emits strobe light, a light-emission prohibit mode that does not emit a strobe light, and a night-scene portrait mode in which a person is photographed with a strobe. When the focus button 46 is operated, the focus mode can be switched. As a mode selectable with the focus button 46, an auto focus mode for automatically focusing, a distant view mode for photographing a distant view, and a macro shooting mode. There are modes such as macro mode.

図3は、上記カメラ10の制御部を示したブロック図である。同図に示すようにカメラ10には、カメラ10の全体を制御するCPU60(情報処理手段)が設けられており、以下に示す各部から情報を取得するとともに、CPU60からの指示によって以下に示す各部を制御することが可能となっている。尚、図3に示すCPU60は、CPUコア部とI/O、ウォッチドグタイマ、A/D変換器等の周辺回路から構成されるASICであってもよい。   FIG. 3 is a block diagram showing a control unit of the camera 10. As shown in the figure, the camera 10 is provided with a CPU 60 (information processing means) for controlling the entire camera 10, acquires information from the following units, and receives the following units according to instructions from the CPU 60. Can be controlled. Note that the CPU 60 shown in FIG. 3 may be an ASIC that includes a CPU core unit and peripheral circuits such as an I / O, a watchdog timer, and an A / D converter.

また、同図に示すようにカメラ10には、電池の電圧を昇圧させるとともに安定化させてCPU60及びその他の各周辺回路に電源を供給するレギュレータ62と、ズームレンズ鏡胴12をモータ駆動してズーム位置やフォーカス位置を変更するとともにズーム位置やフォーカス位置の位置情報をCPU60に出力する鏡胴駆動部64と、フイルム給送モータを駆動してフイルムを給送するフイルム給送駆動部66とが設けられている。   Further, as shown in the figure, the camera 10 has a regulator 62 that boosts and stabilizes the battery voltage and supplies power to the CPU 60 and other peripheral circuits, and the zoom lens barrel 12 by motor driving. A lens barrel drive unit 64 that changes the zoom position and focus position and outputs position information of the zoom position and focus position to the CPU 60, and a film feed drive unit 66 that drives the film feed motor to feed the film. Is provided.

またカメラ10には、露光時にシャッタを開閉してフイルムを露光するシャッタ駆動部68と、図1の測光窓25を介して取り込んだ外光に基づいて被写体の光量を測定する測光センサ70と、メインコンデンサを充電し、また、メイコンデンサに充電した発光エネルギーによりストロボを発光させるストロボ装置72と、図1のAF窓22から取り込んだ被写体光からオートフォーカスにおける測距に必要なデータを取得するパッシブタイプのAFセンサ74とが設けられている。   Further, the camera 10 includes a shutter driving unit 68 that opens and closes a shutter during exposure to expose a film, a photometric sensor 70 that measures the amount of light of a subject based on external light captured through the photometric window 25 of FIG. A strobe device 72 that charges the main capacitor and emits a strobe with the light emission energy charged in the main capacitor, and a passive that acquires data necessary for autofocusing from the subject light captured from the AF window 22 in FIG. A type AF sensor 74 is provided.

またカメラ10には、カメラ10の制御に関するパラメータやデータ、処理プログラム、測距に関する情報等の各種情報を書き換え自在に記録するプログラマブルROM82(EEPROM等の記録手段)と、CPU60からの指示に基づいてLCD表示パネル38に対して各モードに応じた図形、文字、数字等を表示するための信号を出力するLCD駆動部84とが設けられている。   In addition, the camera 10 is based on a programmable ROM 82 (recording means such as an EEPROM) that rewritably records various information such as parameters and data related to the control of the camera 10, processing programs, and information on distance measurement, and instructions from the CPU 60. An LCD drive unit 84 is provided for outputting a signal for displaying graphics, characters, numbers, and the like corresponding to each mode on the LCD display panel 38.

図2に示したシャッタボタン34、フラッシュボタン42、セルフタイマーボタン44、フォーカスボタン46、日付ボタン48、ズームボタン50等の各種ボタンの操作は各ボタンに対応して設けられたスイッチからのオン/オフ信号としてCPU60に与えられる。これらのスイッチは、図3においてスイッチ部86として示されている。尚、シャッタボタン34については半押しの状態(SP1がONの状態)と全押しの状態(SP2がONの状態)とが区別して検出される。   The operation of various buttons such as the shutter button 34, the flash button 42, the self-timer button 44, the focus button 46, the date button 48, and the zoom button 50 shown in FIG. 2 is turned on / off from a switch provided corresponding to each button. It is given to the CPU 60 as an off signal. These switches are shown as switch section 86 in FIG. For the shutter button 34, a half-pressed state (SP1 is turned on) and a fully-pressed state (SP2 is turned on) are distinguished and detected.

尚、図3に示すドライバ88は、CPU60からの指令に基づいて鏡胴駆動部64に設けられているズーム駆動モータやフォーカス駆動モータを制御し、フイルム給送駆動部66に設けられているフイルム給送モータを駆動することが可能となっている。また、ドライバ88は、CPU60からの指令に基づいて基準電圧や駆動電力をA/D変換回路や測光センサ70に出力することが可能となっている。また、ドライバ88は、CPU60からの指令に基づいてフイルム露光時に開閉するシャッタの制御信号をシャッタ駆動部68に出力するとともに、ストロボの発光/停止を指示する信号をストロボ装置72に出力することが可能となっている。   The driver 88 shown in FIG. 3 controls a zoom drive motor and a focus drive motor provided in the lens barrel drive unit 64 based on a command from the CPU 60, and a film provided in the film feed drive unit 66. The feeding motor can be driven. The driver 88 can output a reference voltage and driving power to the A / D conversion circuit and the photometric sensor 70 based on a command from the CPU 60. The driver 88 can output a shutter control signal that opens and closes during film exposure to the shutter drive unit 68 based on a command from the CPU 60, and can output a signal instructing flash emission / stop to the strobe device 72. It is possible.

図4は、パッシブ方式によるAFセンサ74の構成を示した図である。同図に示すようにAFセンサ74には、例えば白と黒の2つの色から構成されている被写体90の像を左右の各センサの受光面に結像するレンズ92と、受光面に結像した像を光電変換して輝度信号として出力する右側のR(右)センサ94及び左側のL(左)センサ96と、CPU60と間で各種データの送受信を行うとともにRセンサ94及びLセンサ96の制御とデータ処理を行う処理回路99とが設けられている。尚、Rセンサ94、Lセンサ96、及び、処理回路99は、例えば、同一基板上に実装される。   FIG. 4 is a diagram showing a configuration of the passive AF sensor 74. As shown in the figure, the AF sensor 74 has, for example, a lens 92 that forms an image of a subject 90 composed of two colors of white and black on the light receiving surfaces of the left and right sensors, and an image formed on the light receiving surfaces. Various data is transmitted and received between the CPU 60 and the right R (right) sensor 94 and the left L (left) sensor 96 that photoelectrically convert the obtained image and output as a luminance signal, and the R sensor 94 and the L sensor 96 A processing circuit 99 that performs control and data processing is provided. The R sensor 94, the L sensor 96, and the processing circuit 99 are mounted on the same substrate, for example.

Rセンサ94及びLセンサ96は例えばCMOSラインセンサであり、直線上に配列された複数のセル(受光素子)から構成される。尚、Rセンサ94とLセンサ96のそれぞれのセルには図中左側から順にセンサ番号1、2、3…233、234が付されるものとする。ただし、Rセンサ94及びLセンサ96の左右両側の5つずつのセルは、ダミーのセルとして実際には使用されていないため、有効なセンサ領域は、センサ番号6から229までとなっている。これらのRセンサ94及びLセンサ96の各セルからは受光した光量に応じた輝度信号がセンサ番号と関連付けて処理回路99に順次出力される。   The R sensor 94 and the L sensor 96 are, for example, CMOS line sensors, and are composed of a plurality of cells (light receiving elements) arranged on a straight line. It is assumed that sensor numbers 1, 2, 3,... 233, 234 are assigned to the cells of the R sensor 94 and the L sensor 96 in order from the left side in the drawing. However, since the five cells on both the left and right sides of the R sensor 94 and the L sensor 96 are not actually used as dummy cells, the effective sensor areas are sensor numbers 6 to 229. From each cell of these R sensor 94 and L sensor 96, a luminance signal corresponding to the received light quantity is sequentially output to the processing circuit 99 in association with the sensor number.

処理回路99は、CPU60から指示信号によってAFセンサ74の動作状態と非動作状態の切替えを行い、動作状態においてCPU60から動作内容に関する制御データを取得すると、その制御データに基づいて積分処理等の処理を開始する。詳細は後述するが積分処理は各Rセンサ94及びLセンサ96から得た各セルの輝度信号を各セル毎に積分(加算)し、各セル毎の輝度信号の積分値(光量の積分値)を生成する処理である。尚、各セル毎の輝度信号の積分値を示す値としてAFセンサ74の受光セルから出力されるデータをセンサデータというものとすると、処理回路99がセンサデータとして実際に生成する値は、各セルの輝度信号の積分値を所定の基準値(基準電圧VREF)から減算した値であり、以下の説明においてセンサデータという場合には、この値をいうものとする。従って、センサデータは受光した光量が多い程、低い値を示す。但し、AFセンサ74から出力されるセンサデータは、各セルからの出力を各セルごとに積分した信号に基づく値であって、AFセンサ74で撮像した被写体の特徴を示すデータ(例えば、被写体のコントラストを示すデータ)であれば、少なくとも以下で説明する処理を同様に適用できる。また、以下の説明において、単に積分又は積分処理という場合にはセンサデータ(輝度信号の積分値)を得るための積分又は積分処理を示すものとする。   The processing circuit 99 switches between the operating state and the non-operating state of the AF sensor 74 according to an instruction signal from the CPU 60. When control data regarding the operation content is acquired from the CPU 60 in the operating state, processing such as integration processing is performed based on the control data. To start. Although details will be described later, the integration processing integrates (adds) the luminance signals of the cells obtained from the R sensors 94 and L sensors 96 for each cell, and the integrated value of the luminance signal for each cell (integrated value of the light amount). Is a process for generating If the data output from the light receiving cell of the AF sensor 74 as the value indicating the integral value of the luminance signal for each cell is referred to as sensor data, the value that the processing circuit 99 actually generates as sensor data is This is a value obtained by subtracting the integral value of the luminance signal from a predetermined reference value (reference voltage VREF). In the following description, this value is referred to as sensor data. Therefore, the sensor data shows a lower value as the amount of received light increases. However, the sensor data output from the AF sensor 74 is a value based on a signal obtained by integrating the output from each cell for each cell, and indicates the characteristics of the subject imaged by the AF sensor 74 (for example, the subject data). If it is data indicating contrast, at least the processing described below can be similarly applied. Further, in the following description, when simply referred to as integration or integration processing, integration or integration processing for obtaining sensor data (an integration value of luminance signals) is assumed.

また、積分処理は、例えば、Rセンサ94とLセンサ96のそれぞれのセンサ領域内(有効なセル内)のうちCPU60によって指定された後述するピーク選択領域内のいずれかのセルのセンサデータが所定の積分終了値に達すると、即ち、ピーク選択領域内のセンサデータのピーク値(最小値)が積分終了値に達すると、測距を行うのに十分なセンサデータが得られたと判断して終了する。このとき、処理回路99は、CPU60に積分終了を示す信号(積分終了信号)を出力する。尚、上述のようにセンサデータのピーク値が積分終了値に達した場合をAFセンサ74における積分終了条件とするのではなく、例えば、ピーク選択領域内におけるセンサデータの平均値が所定値に達した場合を積分終了条件としてもよく、また、他の条件を積分終了条件としてもよい。   In addition, for example, the integration process is performed when the sensor data of any cell in a peak selection region (described later) designated by the CPU 60 in the respective sensor regions (effective cells) of the R sensor 94 and the L sensor 96 is predetermined. When the integration end value is reached, that is, when the peak value (minimum value) of the sensor data in the peak selection region reaches the integration end value, it is determined that sufficient sensor data for ranging is obtained. To do. At this time, the processing circuit 99 outputs a signal indicating the end of integration (integration end signal) to the CPU 60. As described above, the case where the peak value of the sensor data reaches the integration end value is not set as the integration end condition in the AF sensor 74. For example, the average value of the sensor data in the peak selection region reaches a predetermined value. In this case, the integration end condition may be set, and another condition may be set as the integration end condition.

CPU60は、積分終了信号を受けて処理回路99から積分処理によって得られた各セルのセンサデータをセンサ番号と対応付けて取得する。これによって、CPU60はRセンサ94及びLセンサ96で撮像された画像(以下、センサ像という)を認識する。そして、詳細を後述するようにRセンサ94とLセンサ96のそれぞれのセンサ像の間(又は、センサ像のコントラスト抽出処理を実施した後)で相関値演算を行い、相関が最も高くなるときのセンサ像のズレ量を求め、被写体90までの距離を算出する(三角測量の原理)。図5、図6は、それぞれAFセンサ74から被写体90までの距離が近い場合と遠い場合のセンサ像(センサデータ)を例示した図である。被写体90までの距離が近い場合、図5に示すようにLセンサ96のセンサ番号87〜101までのセンサデータは明るい値(50)となり、センサ番号101〜150までは暗い値(200)となる。Rセンサ94についてはLセンサ96と異なる位置に設けられているため、センサ番号85〜133までのセンサデータは明るい値(50)となり、センサ番号133〜148までは暗い値(200)となる。   The CPU 60 receives the integration end signal and acquires the sensor data of each cell obtained by the integration process from the processing circuit 99 in association with the sensor number. As a result, the CPU 60 recognizes an image captured by the R sensor 94 and the L sensor 96 (hereinafter referred to as a sensor image). Then, as will be described in detail later, the correlation value is calculated between the respective sensor images of the R sensor 94 and the L sensor 96 (or after the contrast extraction processing of the sensor image is performed), and the correlation is highest. The amount of deviation of the sensor image is obtained, and the distance to the subject 90 is calculated (the principle of triangulation). FIGS. 5 and 6 are diagrams exemplifying sensor images (sensor data) when the distance from the AF sensor 74 to the subject 90 is short and long, respectively. When the distance to the subject 90 is short, as shown in FIG. 5, the sensor data of the sensor numbers 87 to 101 of the L sensor 96 has a bright value (50), and the sensor numbers 101 to 150 have a dark value (200). . Since the R sensor 94 is provided at a position different from that of the L sensor 96, the sensor data from sensor numbers 85 to 133 are bright values (50), and the sensor numbers 133 to 148 are dark values (200).

これに対して、被写体90までの距離が遠い場合(例えば略無限遠の場合)には、図6に示すように、Lセンサ96のセンサ番号87〜117までのセンサデータは明るい値(50)となり、センサ番号118〜150までは暗い値(200)となる。一方、Rセンサ94は、Lセンサ96とは異なる位置に設けられているものの被写体位置が遠距離に存在するために、センサ番号85〜116までのセンサデータは明るい値(50)となり、センサ番号117〜148までは暗い値(200)となる。この場合にCPU60は、Rセンサ94とLセンサ96のセンサ像のズレ量がほとんどなく、被写体が略無限遠に存在すると判断することができる。これに対して、図5に示したように被写体が近距離に存在する場合には、センサ像のズレ量が大きくなる。   On the other hand, when the distance to the subject 90 is long (for example, approximately infinity), the sensor data of the sensor numbers 87 to 117 of the L sensor 96 are bright values (50) as shown in FIG. Thus, the sensor numbers 118 to 150 are dark values (200). On the other hand, although the R sensor 94 is provided at a position different from the L sensor 96, the subject position exists at a long distance, so the sensor data from sensor numbers 85 to 116 has a bright value (50). From 117 to 148, a dark value (200) is obtained. In this case, the CPU 60 can determine that there is almost no deviation between the sensor images of the R sensor 94 and the L sensor 96 and that the subject exists at approximately infinity. On the other hand, when the subject exists at a short distance as shown in FIG. 5, the amount of deviation of the sensor image becomes large.

定量的には、被写体距離は、Rセンサ94とLセンサ96との間隔及び各センサからレンズ92までの距離、Rセンサ94及びLセンサ96の各セルのピッチ(例えば12μm)等を考慮して、センサ像のズレ量から算出することができる。センサ像のズレ量は、Rセンサ94とLセンサ96のそれぞれのセンサ像の間で相関値演算を行うことにより求めることができ、詳細については後述する。   Quantitatively, the subject distance takes into account the distance between the R sensor 94 and the L sensor 96, the distance from each sensor to the lens 92, the pitch of each cell of the R sensor 94 and L sensor 96 (for example, 12 μm), and the like. It can be calculated from the amount of deviation of the sensor image. The shift amount of the sensor image can be obtained by performing a correlation value calculation between the sensor images of the R sensor 94 and the L sensor 96, and details thereof will be described later.

次に、上記構成のAFセンサ74を使用して被写体の距離を測距し、その被写体にピントを合わせるAF測距の処理内容について説明する。   Next, details of the AF distance measurement process for measuring the distance of the subject using the AF sensor 74 configured as described above and focusing on the subject will be described.

カメラ10の処理モードを撮像のモードに設定して利用者がシャッタボタン34を半押しすると、CPU60はスイッチ部86からシャッタボタン34が半押しされたことを示すSP1のオン信号を取得する。SP1のオン信号を取得した場合、CPU60は、被写体を撮像するために被写体の輝度に応じたAEを設定するとともに、被写体を特定してピントを合わせるAF測距処理を開始する。   When the processing mode of the camera 10 is set to the imaging mode and the user presses the shutter button 34 halfway, the CPU 60 acquires from the switch unit 86 an SP1 ON signal indicating that the shutter button 34 has been pressed halfway. When the SP1 ON signal is acquired, the CPU 60 sets an AE corresponding to the brightness of the subject in order to capture the subject, and starts an AF distance measurement process for identifying and focusing on the subject.

図7は、上記CPU60におけるAF測距の処理手順の概要を示すフローチャートである。   FIG. 7 is a flowchart showing an outline of the AF ranging process procedure in the CPU 60.

[ステップS10(測距エリア設定処理)]
撮影レンズは、ズームレンズ鏡胴12を駆動することにより焦点距離を可変できるのに対し、AFセンサ74にセンサ像を結像させるレンズ92は、固定焦点レンズである。そこで、撮影レンズのレンズ位置(画角)に対応して測距エリアを変更するようにしている。即ち、撮影レンズがテレ位置の場合には、測距エリアを狭くする。
[Step S10 (ranging area setting process)]
The photographing lens can change the focal length by driving the zoom lens barrel 12, whereas the lens 92 that forms the sensor image on the AF sensor 74 is a fixed focus lens. Therefore, the ranging area is changed corresponding to the lens position (view angle) of the photographing lens. That is, when the photographing lens is at the tele position, the distance measuring area is narrowed.

ここで、図8に示すようにRセンサ94及びLセンサ96のセンサ領域は、それぞれ5分割したエリア単位で相関値演算等の処理が行われ、各エリア毎に被写体距離が算出されるようになっている。これらの分割されたエリアを以下分割エリアというものとすると、分割エリアは、同図に示すように「右エリア」、「右中エリア」、「中央エリア」、「左中エリア」、「左エリア」から構成される。また、各分割エリアは、隣接する分割エリアと一部領域(セル)を共有している。相関値演算等の際には、Rセンサ94とLセンサ96の対応する各分割エリア間(同一名の分割エリア間)でそれぞれ個別に相関値演算が行われることになる。尚、本実施の形態では分割エリアはセンサ領域を5分割したものであるが5分割以外の分割数であってもよい。   Here, as shown in FIG. 8, the sensor area of the R sensor 94 and the L sensor 96 is subjected to processing such as correlation value calculation for each area divided into five areas so that the subject distance is calculated for each area. It has become. If these divided areas are hereinafter referred to as divided areas, the divided areas are “right area”, “middle right area”, “center area”, “middle left area”, “left area” as shown in FIG. Is comprised. Each divided area shares a partial area (cell) with an adjacent divided area. In the correlation value calculation or the like, the correlation value calculation is individually performed between the corresponding divided areas of the R sensor 94 and the L sensor 96 (between divided areas of the same name). In the present embodiment, the divided area is obtained by dividing the sensor area into five, but may be divided into numbers other than five.

測距エリアは、Rセンサ94とLセンサ96のそれぞれのセンサ領域のうち測距に使用する領域であり、その領域を決めるのに上記分割エリアが使用される。この測距エリア設定処理の詳細について、図9のフローチャートを用いて説明する。   The ranging area is an area used for ranging among the sensor areas of the R sensor 94 and the L sensor 96, and the divided area is used to determine the area. Details of the distance measurement area setting process will be described with reference to the flowchart of FIG.

まず、CPU60は、現在設定されているズーム位置(画角の設定角度)に関する情報を鏡胴駆動部64から取得して、現在のズーム位置が所定のズーム位置よりテレ側かワイド側(テレ以外)かを判定する(ステップS10A)。例えばズーム可変範囲をZ1〜Z6の6つの範囲に分けた場合に、現在のズーム位置がテレ端側の範囲Z6に設定されているときにはテレ側と判定し、それ以外の範囲Z1〜Z5に設定されているときには、テレ以外と判定する。尚、マクロモードに設定されているときにはテレ以外と判定する。   First, the CPU 60 obtains information on the currently set zoom position (angle of view angle setting) from the lens barrel drive unit 64, and the current zoom position is set to the tele side or the wide side (other than tele) other than the predetermined zoom position. (Step S10A). For example, when the zoom variable range is divided into six ranges Z1 to Z6, if the current zoom position is set to the tele end side range Z6, it is determined to be the tele side, and other ranges are set to Z1 to Z5. If it is, it is determined that it is not tele. When the macro mode is set, it is determined that it is not tele.

もし、テレ側と判定した場合には、図10に示すようにRセンサ94及びLセンサ96のセンサ領域(画角が±6.5°の範囲)のうち、測距に使用する測距エリアを撮影レンズの画角に対応した範囲(画角が±3.9°の範囲)に制限する。即ち、テレと判定した場合には、Rセンサ94及びLセンサ96の全センサ領域(5エリア)のうちの中央部の「右中エリア」、「中央エリア」、及び「左中エリア」の3つの分割エリアで構成される領域(1)を測距エリアとして設定する(3エリア設定)(ステップS10B)。一方、テレ以外と判定した場合には、「右エリア」、「右中エリア」、「中央エリア」、「左中エリア」、「左エリア」の5つの分割エリアで構成される領域(2)を測距エリアとして設定する(5エリア設定)(ステップS10C)。   If it is determined to be the tele side, as shown in FIG. 10, the distance measurement area used for distance measurement in the sensor area of R sensor 94 and L sensor 96 (range of field angle is ± 6.5 °). Is limited to a range corresponding to the angle of view of the photographic lens (range of the angle of view is ± 3.9 °). That is, when it is determined as tele, three of the “right middle area”, “central area”, and “left middle area” in the center of all the sensor areas (5 areas) of the R sensor 94 and the L sensor 96 are displayed. An area (1) composed of two divided areas is set as a distance measuring area (three area setting) (step S10B). On the other hand, if it is determined that it is not tele, an area composed of five divided areas of “right area”, “right middle area”, “center area”, “left middle area”, “left area” (2) Is set as a distance measurement area (5 area setting) (step S10C).

[ステップS12(AFデータ取得処理)]
ステップS12では、被写体の明るさに応じてAFデータ(後に記述)の取得方法を切り替えている。
[Step S12 (AF data acquisition process)]
In step S12, the AF data (described later) acquisition method is switched according to the brightness of the subject.

即ち、被写体の輝度が超高輝度又は高輝度の場合には、AFセンサ74のセンサ感度(輝度信号のゲイン)を低感度に設定し、かつ測距エリアが3エリア設定の場合には、測距エリア(図10の領域(1)参照)を構成する「中央エリア」、「左中エリア」、及び「右中エリア」における積分処理を個別に行い、測距エリアが5エリア設定の場合には、測距エリア(図10の領域(2)参照)を構成する「中央エリア」、「左中及び左エリア」、及び「右中及び右エリア」における積分処理を個別に行う。尚、「左中及び左エリア」は「左中エリア」及び「左エリア」から構成される領域を示し、「右中及び右エリア」は「右中エリア」及び「右エリア」から構成される領域を示す。また、AFセンサ74のセンサ感度は、高感度と低感度の2段階に切り替えることができるようになっている。   That is, when the luminance of the subject is very high or high, the sensor sensitivity (gain of the luminance signal) of the AF sensor 74 is set to low sensitivity, and the measurement area is set to 3 areas, the measurement is performed. When integration processing is separately performed in the “center area”, “middle left area”, and “middle right area” constituting the distance area (see area (1) in FIG. 10), and the distance measurement area is set to five areas. Are individually integrated in the “central area”, “middle left and left area”, and “middle right and right area” constituting the distance measurement area (see area (2) in FIG. 10). “Left middle and left area” indicates an area composed of “Left middle area” and “Left area”, and “Right middle and right area” includes “Right middle area” and “Right area”. Indicates the area. Further, the sensor sensitivity of the AF sensor 74 can be switched between two stages of high sensitivity and low sensitivity.

ここで、上記測距エリアを構成する「中央エリア」、「左中エリア」(又は「左中及び左エリア」)、及び「右中エリア」(又は「右中及び右エリア」)における積分処理を個別に行うとは、「中央エリア」内のいずれかのセンサデータが積分終了値に達すると、その「中央エリア」のセンサデータを取得し、続いてセンサデータをリセットして積分を開始し、「左中エリア」(又は「左中及び左エリア」)内のいずれかのセルのセンサデータが積分終了値に達すると、その「左中エリア」(又は「左中及び左エリア」)のセンサデータを取得し、次にセンサデータをリセットして積分を開始し、「右中エリア」(又は「右中及び右エリア」)内のいずれかのセルのセンサデータが積分終了値に達すると、その「右中エリア」(又は「右中及び右エリア」)のセンサデータを取得することをいう。このようにして、複数の領域の積分処理を個別に行うことにより、いずれかの領域に高輝度のライトなどが入射し、その領域のセンサデータが不適当な場合でも他の領域から有効なセンサデータを取得することができる。例えば、測距エリアが5エリア設定の場合において、測距エリア内に図11(A)、(B)に示すような主要被写体である人物と、人物後方の高輝度のライトが存在するものとする。このとき、例えば、測距エリアの全領域を選択領域(ピーク選択領域)として積分処理を行うと、図11(A)に示すように高輝度のライトに対応する右エリアにおけるセンサデータの信号レベルが適切なものとなり、主要被写体である人物に対応する中央エリアにおけるセンサデータの信号レベルが小さくなる。このため、各分割エリアごとに被写体距離を求めようとすると、中央エリアに関しては測距不能と判断され、結果的に後方のライトに合焦してしまう不具合が生じる。これに対して、上述のように測距エリアを複数の領域に分けて個別に積分処理を行うと、図11(B)に示すように中央エリアの積分処理において主要被写体である人物に対応するのセンサデータの信号レベルが適切なものとなり、結果的に人物に合焦させることができるようになる。   Here, the integration processing in the “center area”, “middle left area” (or “middle left and left area”), and “middle right area” (or “middle right and right area”) constituting the distance measurement area If any sensor data in the “central area” reaches the integration end value, the sensor data for that “central area” is acquired, then the sensor data is reset and integration is started. When the sensor data of any cell in the “left middle area” (or “left middle and left area”) reaches the integration end value, the “left middle area” (or “left middle and left area”) When the sensor data is acquired, then the sensor data is reset and integration is started, and when the sensor data of any cell in the “Right Middle Area” (or “Right Middle and Right Area”) reaches the integration end value , Its “right middle area” (or “right middle Say that acquires sensor data of the right area "). In this way, by performing integration processing of multiple areas individually, even if high-intensity light or the like enters one of the areas, and the sensor data in that area is inappropriate, the sensor is effective from other areas. Data can be acquired. For example, when the distance measurement area is set to five areas, a person who is a main subject as shown in FIGS. 11A and 11B and a high-intensity light behind the person exist in the distance measurement area. To do. At this time, for example, if integration processing is performed with the entire area of the ranging area as a selection area (peak selection area), the signal level of the sensor data in the right area corresponding to the high-intensity light as shown in FIG. Becomes appropriate, and the signal level of the sensor data in the central area corresponding to the person who is the main subject is reduced. For this reason, when trying to obtain the subject distance for each divided area, it is determined that distance measurement is impossible for the central area, and as a result, there is a problem that the rear light is focused. On the other hand, when the ranging area is divided into a plurality of areas and individually integrated as described above, it corresponds to the person who is the main subject in the integration processing of the central area as shown in FIG. Thus, the signal level of the sensor data becomes appropriate, and as a result, the person can be focused.

また、被写体の輝度が中輝度の場合には、AFセンサ74のセンサ感度を低感度に設定し、かつ3エリア設定又は5エリア設定された測距エリアにおける積分処理を一括して行う。例えば、3エリア設定の場合には、測距エリア(図10の領域(1)参照)を構成する「中央エリア」、「左中エリア」、及び「右中エリア」の積分処理を同時に行い、これらの「中央エリア」、「左中エリア」、及び「右中エリア」内のいずれかのセルのセンサデータが積分終了値に達すると、「中央エリア」、「左中エリア」、及び「右中エリア」のセンサデータを一括して取得する。   Further, when the luminance of the subject is medium, the sensor sensitivity of the AF sensor 74 is set to low sensitivity, and integration processing is collectively performed in the ranging area set to 3 areas or 5 areas. For example, in the case of setting three areas, integration processing of “center area”, “middle left area”, and “middle right area” constituting the ranging area (see area (1) in FIG. 10) is performed simultaneously. When the sensor data of any cell in these “central area”, “middle left area”, and “middle right area” reaches the integration end value, “middle area”, “middle left area”, and “right Collect the sensor data of “middle area” at once.

更に、被写体の輝度が低輝度の場合には、AFセンサ74のセンサ感度を高感度に設定し、かつ3エリア設定又は5エリア設定された測距エリアにおける積分処理を一括して行う。尚、積分時間が所定の時間経過しても測距エリア内のセルのセンサデータが積分終了値に達しない場合には、積分を終了させた後、AFセンサ74のセンサ感度を低感度に切り替えて積分を開始すると共に、オートフォーカス用の補助光をストロボ装置72から発光させる(AFプレ発光)。この場合には、3エリア設定又は5エリア設定された測距エリアにおける積分処理を一括して行う。   Furthermore, when the luminance of the subject is low, the sensor sensitivity of the AF sensor 74 is set to high sensitivity, and integration processing is performed in a range-finding area that is set to 3 areas or 5 areas. If the sensor data of the cells in the distance measuring area does not reach the integration end value even after the integration time has elapsed, the integration is terminated and the sensor sensitivity of the AF sensor 74 is switched to low sensitivity. Then, integration is started and auxiliary light for autofocus is emitted from the flash device 72 (AF pre-emission). In this case, integration processing in the ranging area set to 3 areas or 5 areas is performed collectively.

尚、ここでは、AFセンサ74の受光セルより出力されるデータをセンサデータとしており、下記コントラスト検出処理1以降に使用される画像データとしては、センサデータ自体とする場合の他に、センサデータにコントラスト抽出処理等を施したものとする場合もあるため、コントラスト検出処理1以降の処理では、センサデータをそのまま処理に用いたもの、及び、センサデータにコントラスト抽出処理等を施したものを総称してAFデータと記載する。   Here, the data output from the light receiving cell of the AF sensor 74 is used as sensor data, and the image data used in the following contrast detection process 1 or later is the sensor data in addition to the sensor data itself. Contrast extraction processing and the like may be performed. Therefore, the processing after the contrast detection processing 1 is a generic term for the sensor data used for the processing as it is, and the sensor data subjected to the contrast extraction processing or the like. And described as AF data.

[ステップS14(コントラスト検出処理1)]
ステップS14では、ステップS12で取得したAFデータが測距に必要なコントラストがあるか否かを判定する。そして、AFデータが測距に必要なコントラストがないと判定(低コントラスト判定)されると、測距不能とする。
[Step S14 (Contrast Detection Process 1)]
In step S14, it is determined whether or not the AF data acquired in step S12 has a contrast necessary for distance measurement. If it is determined that the AF data does not have the contrast necessary for distance measurement (low contrast determination), distance measurement is disabled.

ここで、ステップS10の測距エリア設定処理において、測距エリアとして3エリア設定がされている場合には、右中エリア、中央エリア、及び左中エリアの各分割エリアごとに上記コントラスト判定を行い、低コントラスト判定された分割エリアのAFデータを使用した相関値演算等の処理は行わないようにしている。同様に、測距エリアとして5エリア設定がされている場合には、右エリア、右中エリア、中央エリア、左中エリア、左エリアの各分割エリアごとに上記コントラスト判定を行い、低コントラスト判定された分割エリアのAFデータを使用した相関値演算等の処理は行わないようにしている。   Here, in the ranging area setting process in step S10, when three areas are set as the ranging area, the above contrast determination is performed for each of the divided areas of the middle right area, the central area, and the middle left area. The processing such as the correlation value calculation using the AF data of the divided area determined as low contrast is not performed. Similarly, when five areas are set as the distance measurement area, the above contrast determination is performed for each divided area of the right area, the middle right area, the center area, the middle left area, and the left area, and the low contrast determination is performed. Processing such as correlation value calculation using AF data of the divided areas is not performed.

[ステップS16(相関値演算処理)]
ステップS16では、AFセンサ74のRセンサ94及びLセンサ96からそれぞれ取り込んだセンサ像(AFデータ)の間で相関値演算を行い、相関が最も高くなるときのセンサ像のズレ量(左右のAFデータ間のシフト量)を求める。この左右のAFデータ間のシフト量から被写体の距離を求めることができる。
[Step S16 (Correlation Value Calculation Processing)]
In step S16, a correlation value calculation is performed between the sensor images (AF data) acquired from the R sensor 94 and the L sensor 96 of the AF sensor 74, and the sensor image shift amount (left and right AFs) when the correlation is the highest. The shift amount between data) is obtained. The distance of the subject can be obtained from the shift amount between the left and right AF data.

尚、測距エリアとして3エリア設定がされている場合には、右中エリア、中央エリア、及び左中エリアの各分割エリアごとに相関値演算を行い、測距エリアとして5エリア設定がされている場合には、右エリア、右中エリア、中央エリア、左中エリア、左エリアの各分割エリアごとに相関値演算を行うが、上記ステップS14で低コントラスト(測距不能)の判定が行われた分割エリアでの相関値演算は行わない。   When three areas are set as the distance measurement area, the correlation value is calculated for each divided area of the middle right area, the center area, and the middle left area, and five areas are set as the distance measurement area. If there is, the correlation value calculation is performed for each divided area of the right area, the middle right area, the center area, the middle left area, and the left area, but the determination of low contrast (distance cannot be measured) is performed in step S14. No correlation value calculation is performed in the divided areas.

次に、上記相関値演算について図12を参照しながら説明する。   Next, the correlation value calculation will be described with reference to FIG.

図12において、94A及び96Aは、それぞれRセンサ94及びLセンサ96のうちのある分割エリアのセンサ(以下「採用センサ」という)である。また、94B及び96Bは、それぞれ採用センサ94A及び96AのAFデータから相関値演算に使用するAFデータを抽出するためのRウインドウ及びLウインドウである。   In FIG. 12, 94A and 96A are sensors in certain divided areas (hereinafter referred to as “adopted sensors”) of the R sensor 94 and the L sensor 96, respectively. Reference numerals 94B and 96B denote an R window and an L window for extracting AF data used for correlation value calculation from AF data of the employed sensors 94A and 96A, respectively.

ここで、Rウインドウ94BとLウインドウ96Bとのシフト量をn(n=−2,−1,0,1,…,MAX(=38))とすると、n=−2のときにRウインドウ94Bは採用センサ94Aの左端に位置し、Lウインドウ96Bは採用センサ96Aの右端に位置している。そして、n=−1のときにLウインドウ96Bは採用センサ96Aの右端から1セル分だけ左にシフトし、n=0のときにRウインドウ94Bは採用センサ94Aの左端から1セル分だけ右にシフトし、同様にしてnが1増加するごとにRウインドウ94BとLウインドウ96Bとは交互に1セルずつ移動する。そして、n=MAXのときにRウインドウ94Bは採用センサ94Aの右端に位置し、Lウインドウ96Bは採用センサ96Aの左端に位置する。   Here, if the shift amount between the R window 94B and the L window 96B is n (n = −2, −1, 0, 1,..., MAX (= 38)), the R window 94B when n = −2. Is located at the left end of the adoption sensor 94A, and the L window 96B is located at the right end of the adoption sensor 96A. When n = −1, the L window 96B is shifted to the left by one cell from the right end of the employed sensor 96A, and when n = 0, the R window 94B is shifted to the right by one cell from the left end of the employed sensor 94A. Similarly, every time n increases by 1, the R window 94B and the L window 96B alternately move one cell at a time. When n = MAX, the R window 94B is located at the right end of the adopted sensor 94A, and the L window 96B is located at the left end of the adopted sensor 96A.

いま、Rウインドウ94BとLウインドウ96Bとのあるシフト量nのときの相関値をf(n)とすると、相関値f(n)は、次式、   Assuming that the correlation value f (n) between the R window 94B and the L window 96B at a certain shift amount n is f (n), the correlation value f (n) is given by

Figure 2009008686
Figure 2009008686

で表すことができる。尚、式(1)において、iはウインドウ内のセルの位置(i=1,2,…wo(=42))を示す番号であり、R(i)及びL(i)は、それぞれRウインドウ94B及びLウインドウ96Bの同じセル位置iのセルから得られたAFデータである。即ち、式(1)に示すように相関値f(n)は、Rウインドウ94B及びLウインドウ96Bの同じセル位置のセルから得られたAFデータの差分の絶対値の総和であり、相関が高い程、ゼロに近づく。 Can be expressed as In equation (1), i is a number indicating the position of a cell in the window (i = 1, 2,... Wo (= 42)), and R (i) and L (i) are R windows. 94B and AF data obtained from the cell at the same cell position i in the L window 96B. That is, as shown in the equation (1), the correlation value f (n) is a sum of absolute values of differences between AF data obtained from cells at the same cell position in the R window 94B and the L window 96B, and has a high correlation. The closer to zero.

従って、シフト量nを変えて相関値f(n)を求め、相関値f(n)が最も小さくなるとき(相関が最も高くなるとき)のシフト量nから被写体の距離を求めることができる。尚、被写体距離が無限遠のときに、シフト量n=0で相関が最も高くなり、被写体距離が至近端のときに、シフト量n=MAXで相関が最も高くなるように被写体像がRセンサ94及びLセンサ96に結像するようになっている。また、相関を求める演算式は、上式(1)に限らず、他の演算式を用いることができる。その場合において、相関が高いほど相関値が大きくなる場合があり、このときには、以下の説明における相関値についての大小関係を反転してその演算式において本実施の形態を適用する。例えば、上式(1)により算出した相関値の極小値は、極大値となり、また、上式(1)により算出した相関値について小さい又は大きいなどの文言は、大きい又は小さいなどの文言に反転して適用することができる。   Accordingly, the correlation value f (n) can be obtained by changing the shift amount n, and the subject distance can be obtained from the shift amount n when the correlation value f (n) is the smallest (when the correlation is the highest). It should be noted that when the subject distance is infinity, the correlation is highest when the shift amount is n = 0, and when the subject distance is the closest end, the subject image is R so that the correlation is highest when the shift amount is n = MAX. An image is formed on the sensor 94 and the L sensor 96. Further, the arithmetic expression for obtaining the correlation is not limited to the above expression (1), and other arithmetic expressions can be used. In such a case, the correlation value may increase as the correlation increases. In this case, the magnitude relationship of the correlation value in the following description is inverted, and the present embodiment is applied to the arithmetic expression. For example, the minimum value of the correlation value calculated by the above equation (1) becomes the maximum value, and the wording of the correlation value calculated by the above equation (1) is reversed to the wording of the large or small value. And can be applied.

[ステップS18(コントラスト検出処理2)]
ステップS14では、分割エリア内のAFデータが、測距に必要なコントラストがあるか否かを判定しているのに対し、ステップS18では相関が最大となるシフト量nのときのウインドウ範囲内のAFデータが、測距に必要なコントラストがあるか否かを判定する。そして、低コントラストと判定すると、測距不能とし、そのときのシフト量nに基づく測距は行わない。
[Step S18 (contrast detection process 2)]
In step S14, it is determined whether or not the AF data in the divided area has a contrast necessary for distance measurement. In step S18, the AF data in the window range at the time of the shift amount n that maximizes the correlation is determined. It is determined whether the AF data has a contrast necessary for distance measurement. If it is determined that the contrast is low, distance measurement is disabled, and distance measurement based on the shift amount n at that time is not performed.

[ステップS20(L、Rチャンネル差補正処理)]
ステップS20では、AFセンサ74から得られた左右のAFデータであって、相関が最大となるウインドウ範囲内の左右のAFデータの最小値を比較する。そして、左右のAFデータの最小値の差の絶対値が第1の基準値以上かつ第2の基準値以下の場合に、ダイナミックレンジを越えない方のチャンネルのAFデータを補正する。尚、相関が最大となったときの相関値が小さい場合には、AFデータを補正しなくても相関値演算の結果は信頼性が高いと判断できるため、相関が最大となったときの相関値が第3の基準値以上の場合にのみAFデータの補正を行うようにしてもよい。
[Step S20 (L and R channel difference correction processing)]
In step S20, the left and right AF data obtained from the AF sensor 74 and the minimum values of the left and right AF data within the window range where the correlation is maximum are compared. Then, when the absolute value of the difference between the minimum values of the left and right AF data is not less than the first reference value and not more than the second reference value, the AF data of the channel that does not exceed the dynamic range is corrected. If the correlation value when the correlation is maximum is small, it can be determined that the correlation value calculation result is highly reliable without correcting the AF data. The AF data may be corrected only when the value is greater than or equal to the third reference value.

また、AFデータを補正した場合には、再度相関値演算を行い、最小の相関値を求める。そして、補正後の最小の相関値と補正前の最小の相関値とを比較し、一致度の高い方の相関値のシフト量を採用する。   When the AF data is corrected, the correlation value is calculated again to obtain the minimum correlation value. Then, the minimum correlation value after correction is compared with the minimum correlation value before correction, and the shift amount of the correlation value having the higher degree of coincidence is employed.

[ステップS22(補間値演算処理)]
ステップS22では、相関が最も高くなるときの相関値f(n)(最小極小値)を求めた後、その最小極小値と前後の相関値とを使用し、シフト量が1以内(AFセンサ74のセルの1ピッチ以内)の補間値を算出する。
[Step S22 (Interpolation Value Calculation Processing)]
In step S22, after obtaining a correlation value f (n) (minimum minimum value) when the correlation is highest, the minimum minimum value and the preceding and following correlation values are used, and the shift amount is within 1 (AF sensor 74). The interpolated value is calculated within 1 pitch of the cell.

前記補間値は、最小極小値が得られたシフト量をnとすると、その最小極小値と、そのシフト量nの前後の複数のシフト量における相関値(最低3つの相関値)とに基づいて、これらの相関値を通りV字状に交わる2本の直線の交点を求め、その交点の位置と前記シフト量nとの差分値として算出される。   The interpolation value is based on the minimum minimum value and correlation values (a minimum of three correlation values) at a plurality of shift amounts before and after the shift amount n, where n is the shift amount at which the minimum minimum value is obtained. Then, an intersection of two straight lines that intersect in a V shape passing through these correlation values is obtained, and calculated as a difference value between the position of the intersection and the shift amount n.

[ステップS24(AFエラー処理)]
ステップS24では、3エリア設定又は5エリア設定された測距エリアの全ての測距エリアで測距不能と判定されると、予め設定した被写体距離にピントを合わせるように撮影レンズをセットする。
[Step S24 (AF error processing)]
In step S24, if it is determined that distance measurement is not possible in all the distance measurement areas of the three area settings or the five area settings, the photographic lens is set so as to focus on a preset subject distance.

即ち、オートフォーカス用の補助光を発光し、かつ全ての測距エリアのAFデータ量不足によりエラーと判断された場合、無限遠にピントが合うように撮影レンズをセットする。   In other words, when the auxiliary light for autofocus is emitted and it is determined that an error occurs due to insufficient AF data amount in all the distance measurement areas, the photographing lens is set so as to focus at infinity.

また、オートフォーカス用の補助光を発光し、かつ全ての測距エリアのAFデータ量不足によりエラーと判断された場合、フイルム感度に応じてストロボ到達可能な固定焦点セット距離に切り替える。例えば、ISO400以上の場合には、固定焦点セット距離を6mとし、ISO400未満の場合には、固定焦点セット距離を3mとする。更に、エラーの種類によってピントを合わせる固定焦点セット距離を切り替えるようにしてもよい。   Further, when an auxiliary light for autofocus is emitted and an error is determined due to insufficient AF data amount in all the distance measurement areas, the fixed focus set distance that can be reached by the strobe is switched according to the film sensitivity. For example, in the case of ISO 400 or more, the fixed focus set distance is 6 m, and in the case of less than ISO 400, the fixed focus set distance is 3 m. Furthermore, the fixed focus set distance to be focused may be switched depending on the type of error.

[ステップS26(距離算出処理)]
ステップS26では、ステップS16での相関値演算により最小極小値の相関値が得られるときのシフト量nと、ステップS22で演算した補間値とに基づいて被写体距離を算出する。尚、3エリア設定又は5エリア設定された測距エリアの全ての測距エリアごとに被写体距離を算出する。
[Step S26 (distance calculation processing)]
In step S26, the subject distance is calculated based on the shift amount n when the minimum correlation value is obtained by the correlation value calculation in step S16 and the interpolation value calculated in step S22. It should be noted that the subject distance is calculated for every distance measuring area of the three areas or the five areas set.

[ステップS28(エリア選択処理)]
AF測距処理中にエラーが発生しない場合には、3エリア設定時には3つの被写体距離が算出され、5エリア設定時には5つの被写体距離が算出される。複数の被写体距離が算出されると、基本的には最も近距離の被写体距離を採用する。
[Step S28 (area selection process)]
If no error occurs during the AF distance measurement process, three subject distances are calculated when the three areas are set, and five subject distances are calculated when the five areas are set. When a plurality of subject distances are calculated, the closest subject distance is basically adopted.

尚、5エリア設定時に5つの被写体距離が算出され、これらの被写体距離のうち、左エリア又は右エリアのうちの何れか一方のエリアに対応する被写体距離が超至近距離となり、それ以外のエリアに対応する被写体距離が全て中間距離以遠となる場合には、超至近の結果を採用せず、中間距離以遠の被写体距離のうちの最も近距離の被写体距離を採用する。   When five areas are set, five subject distances are calculated, and among these subject distances, the subject distance corresponding to one of the left area and the right area is the very close distance, and the other areas When all the corresponding subject distances are beyond the intermediate distance, the result of the closest distance is not adopted, and the subject distance closest to the subject distances beyond the intermediate distance is adopted.

{AFデータ取得処理(図7ステップS12)の詳細}
次に、上記図7のステップS12におけるAFデータ取得処理について詳説する。
{Details of AF data acquisition process (step S12 in FIG. 7)}
Next, the AF data acquisition process in step S12 of FIG. 7 will be described in detail.

まず、ピーク選択領域について説明すると、ピーク選択領域とは、AFセンサ74の積分処理において、センサデータのピーク値(最小値)が積分終了値に達したか否かを監視するセルの範囲をいう。図13は、以下で説明するAFデータ取得処理において設定されるピーク選択領域の態様を示した図である。ピーク選択領域は、上記図8で説明した分割エリアを単位として構成され、図13(A)には、Rセンサ94及びLセンサ96の分割エリアが示されている。これに対して、同図(B)〜同図(H)にはピーク選択領域が示されており、ピーク選択領域は領域(1)〜(7)の7通りに切り替えられる。   First, the peak selection area will be described. The peak selection area refers to a range of cells for monitoring whether or not the peak value (minimum value) of sensor data has reached the integration end value in the integration process of the AF sensor 74. . FIG. 13 is a diagram showing a mode of the peak selection region set in the AF data acquisition process described below. The peak selection area is configured with the divided areas described in FIG. 8 as a unit, and FIG. 13A shows the divided areas of the R sensor 94 and the L sensor 96. On the other hand, the peak selection region is shown in FIGS. (B) to (H), and the peak selection region is switched to seven regions (1) to (7).

同図(B)に示す領域(1)は、Rセンサ94及びLセンサ96における「中央エリア」、「右中エリア」、及び「左中エリア」の3つの分割エリアから構成され、同図(C)に示す領域(2)は、Rセンサ94及びLセンサ96における「中央エリア」、「右中エリア」、「右エリア」、「左中エリア」、及び「左エリア」の5つの分割エリアから構成される。尚、領域(1)は、図10で示した3エリア設定時の領域(1)に等しく、領域(2)は、図10で示した5エリア設定時の領域(2)に等しい。同図(D)、(E)、(F)に示す領域(3)、(4)、(5)はそれぞれ、Rセンサ94及びLセンサ96における「中央エリア」、「左中エリア」、「右中エリア」であり、同図(G)に示す領域(6)は、Rセンサ94及びLセンサ96における左中エリア及び左エリアから構成され、同図(H)に示す領域(7)は、Rセンサ94及びLセンサ96における右中エリア及び右エリアから構成される。   The area (1) shown in FIG. 5B is composed of three divided areas of “center area”, “right middle area”, and “left middle area” in the R sensor 94 and the L sensor 96. The area (2) shown in C) includes five divided areas of the “center area”, “right middle area”, “right area”, “left middle area”, and “left area” in the R sensor 94 and the L sensor 96. Consists of The area (1) is equal to the area (1) when the three areas are set as shown in FIG. 10, and the area (2) is equal to the area (2) when the five areas are set as shown in FIG. Regions (3), (4), and (5) shown in FIGS. (D), (E), and (F) are “center area”, “left middle area”, “ The area (6) shown in FIG. 6G is composed of the left center area and the left area in the R sensor 94 and the L sensor 96, and the area (7) shown in FIG. , The R sensor 94 and the L sensor 96 are composed of a middle right area and a right area.

図14は、AFデータ取得処理の手順を示したフローチャートである。まず、CPU60は、測光センサ70が出力する光量の信号出力を参照して、被写体から得た光量が超高輝度と判断する所定の閾値以上であるか否かを判定する(ステップS50)。NOと判定した場合、CPU60は、AFセンサ74(AFセンサ74の処理回路99)に対して一括ゲイン高積分の処理を開始させる(ステップS52)。尚、以下の説明では、AFセンサ74の処理回路99が行う処理であっても処理回路99とは明記せず、単にAFセンサ74と記述する。   FIG. 14 is a flowchart showing the procedure of AF data acquisition processing. First, the CPU 60 refers to the signal output of the light amount output from the photometric sensor 70 and determines whether or not the light amount obtained from the subject is greater than or equal to a predetermined threshold value for determining ultra-high brightness (step S50). When it is determined NO, the CPU 60 causes the AF sensor 74 (the processing circuit 99 of the AF sensor 74) to start batch gain high integration processing (step S52). In the following description, even if the processing is performed by the processing circuit 99 of the AF sensor 74, the processing circuit 99 is not specified and is simply described as the AF sensor 74.

一括ゲイン高積分は、上記図7に示したステップS10の測距エリア設定処理により設定した測距エリアと同一範囲の領域をピーク選択領域とし、また、AFセンサ74のセンサ感度を高感度とし、測距エリア内の各セルのセンサデータを一括して取得する処理である。上記測距エリア設定処理において測距エリアを3エリア設定とした場合(ズーム位置がテレの場合)には、ピーク選択領域は、図13(B)に示した領域(1)に設定される。一方、測距エリアを5エリア設定とした場合(ズーム位置がテレ以外の場合)には、ピーク選択領域は、図13(C)に示したピーク選択領域(2)に設定される。尚、一括ゲイン高積分は、被写体輝度が低輝度の場合のセンサデータを取得するための積分処理であるが、後述の記載からも分かるように被写体輝度が高輝度、中輝度、低輝度のどの状態にあるかを判別するための処理でもある。このステップS52の一括ゲイン高積分の処理の代わりに被写体輝度を判別するための他の方法を採用してもよい。   In the collective gain high integration, an area in the same range as the distance measurement area set by the distance measurement area setting process in step S10 shown in FIG. 7 is set as a peak selection area, and the sensor sensitivity of the AF sensor 74 is set as high sensitivity. This is a process of acquiring sensor data of each cell in the distance measurement area at once. When the distance measurement area is set to 3 areas in the distance measurement area setting process (when the zoom position is tele), the peak selection area is set to the area (1) shown in FIG. On the other hand, when the distance measurement area is set to 5 areas (when the zoom position is other than tele), the peak selection area is set to the peak selection area (2) shown in FIG. The collective gain high integration is an integration process for acquiring sensor data when the subject brightness is low. However, as can be seen from the description below, the subject gain is high brightness, medium brightness, or low brightness. It is also a process for determining whether or not it is in a state. Instead of the collective gain high integration process in step S52, another method for determining the subject brightness may be employed.

AFセンサ74による一括ゲイン高積分の開始後、CPU60は、AFセンサ74から積分処理の終了を示す積分終了信号が出力されるのを待機する。そして、積分処理の開始後、積分処理が終了するまでに要した時間(積分時間)が2ms未満か、2ms以上4ms未満か、又は、4ms以上か(4ms経過しても積分処理が終了しないか)を判定する(ステップS54)。   After the batch gain high integration by the AF sensor 74 is started, the CPU 60 waits for an integration end signal indicating the end of the integration process to be output from the AF sensor 74. Then, after the integration process is started, the time (integration time) required for the integration process to end is less than 2 ms, 2 ms to less than 4 ms, or 4 ms or more (whether the integration process does not end even after 4 ms elapses) ) Is determined (step S54).

もし、積分時間が2ms未満であった場合には、被写体が高輝度であると判断してAFセンサ74のセンサデータをリセットし、詳細を後述する3分割ゲイン低積分の処理に切り替える(ステップS56)。積分時間が2ms以上4ms未満であった場合には、被写体が中輝度であると判断してAFセンサ74のセンサデータをリセットし、詳細を後述する一括ゲイン低積分の処理に切り替える(ステップS58)。積分時間が4ms以上であった場合には、被写体が低輝度であると判断して詳細を後述する低輝度時処理を実行する(ステップS60)。   If the integration time is less than 2 ms, it is determined that the subject has high brightness, the sensor data of the AF sensor 74 is reset, and the process is switched to a three-division gain low integration process described later in detail (step S56). ). If the integration time is not less than 2 ms and less than 4 ms, it is determined that the subject has medium luminance, the sensor data of the AF sensor 74 is reset, and the processing is switched to a collective gain low integration process described later in detail (step S58). . If the integration time is 4 ms or more, it is determined that the subject has low luminance, and low luminance processing described in detail later is executed (step S60).

ここで、上記ステップS50においてYES、即ち、被写体が超高輝度と判定した場合には、2ms未満で終了した場合と同様に3分割ゲイン低積分の処理を実行する(ステップS56)。   If YES in step S50, that is, if it is determined that the subject has an extremely high brightness, the process of three-fold gain low integration is executed in the same manner as when the process is completed in less than 2 ms (step S56).

ステップS56の3分割ゲイン低積分の処理は、AFセンサ74のセンサ感度を低感度に設定し、また、上記測距エリア設定処理において設定した測距エリアを3分割し、分割した各エリアをそれぞれ順にピーク選択領域としてAFセンサ74に積分処理を実行させるCPU60の処理である。   The three-divided gain low integration process in step S56 sets the sensor sensitivity of the AF sensor 74 to a low sensitivity, and also divides the distance measurement area set in the distance measurement area setting process into three, and each divided area is divided. This is processing of the CPU 60 that causes the AF sensor 74 to execute integration processing in order as a peak selection region.

即ち、上記図7ステップS10の測距エリア設定処理において測距エリアを3エリア設定として場合(ズーム位置がテレの場合)、測距エリアは「中央エリア」、「左中エリア」及び「右中エリア」から構成される。この測距エリアを「中央エリア」、「左中エリア」、及び、「右中エリア」の各分割エリアに3分割して、各分割エリアを順にピーク選択領域として積分処理を実行する。図13で示したピーク選択領域の態様においては、同図(D)、(E)、(F)の領域(3)、(4)、(5)が順にピーク選択領域として設定される。具体的には、図15のフローチャートに示すように、まず、中央エリア(領域(3))をピーク選択領域とし(ステップS80)、また、AFセンサ74のセンサ感度を低感度として(ステップS82)積分処理を開始する(ステップS84)。この積分処理が終了し、CPU60が領域(3)のセンサデータを取得すると(ステップS86)、測距エリアが3エリア設定であるため(ステップS88)、続いて、左中エリア(領域(4))をピーク選択領域とし(ステップS90)、また、AFセンサ74のセンサ感度を低感度として(ステップS92)積分処理を開始する(ステップS94)。この積分処理が終了し、CPU60が領域(4)のセンサデータを取得すると(ステップS96)、続いて、右中エリア(領域(5))をピーク選択領域とし(ステップS98)、また、AFセンサ74のセンサ感度を低感度として(ステップS100)積分処理を開始する(ステップS102)。この積分処理が終了し、CPU60が領域(5)のセンサデータを取得すると(ステップS104)、3分割ゲイン低積分の処理を終了する。これによって以後の測距演算に必要な測距エリア内の各分割エリアのセンサデータが取得される。   That is, when the distance measurement area is set to 3 areas in the distance measurement area setting process of step S10 in FIG. 7 (when the zoom position is tele), the distance measurement areas are “center area”, “middle left area” and “middle right” It consists of “area”. This distance measuring area is divided into three divided areas of “central area”, “middle left area”, and “middle right area”, and integration processing is executed with each divided area as a peak selection area in order. In the mode of the peak selection region shown in FIG. 13, the regions (3), (4), and (5) in FIGS. (D), (E), and (F) are set as the peak selection region in order. Specifically, as shown in the flowchart of FIG. 15, first, the central area (region (3)) is set as the peak selection region (step S80), and the sensor sensitivity of the AF sensor 74 is set low (step S82). Integration processing is started (step S84). When the integration process is completed and the CPU 60 acquires the sensor data of the area (3) (step S86), since the distance measurement area is set to 3 areas (step S88), the left middle area (area (4) ) As a peak selection region (step S90), and the sensor sensitivity of the AF sensor 74 is set low (step S92), and integration processing is started (step S94). When this integration process is completed and the CPU 60 acquires the sensor data of the region (4) (step S96), the right middle area (region (5)) is set as the peak selection region (step S98), and the AF sensor The sensor sensitivity of 74 is set to low sensitivity (step S100), and integration processing is started (step S102). When this integration process ends and the CPU 60 acquires the sensor data of the region (5) (step S104), the three-divided gain low integration process ends. As a result, sensor data of each divided area in the distance measurement area necessary for the subsequent distance calculation is acquired.

一方、上記測距エリア設定処理において5エリア設定とした場合(ズーム位置がテレ以外の場合)、測距エリアは、「中央エリア」、「左中エリア」、「左エリア」、「右中エリア」、「右エリア」から構成される。この測距エリアを図13(D)、(G)、(H)の領域(3)、(6)、(7)に3分割して、各領域(3)、(6)、(7)を順にピーク選択領域として積分処理を実行する。具体的には、図15のフローチャートで説明すると、上述の3エリア設定の場合と同様に、まず、中央エリア (領域(3))をピーク選択領域とし(ステップS80)、また、AFセンサ74のセンサ感度を低感度として(ステップS82)積分処理を開始する(ステップS84)。この積分処理が終了し、CPU60が領域(3)のセンサデータを取得すると(ステップS86)、測距エリアが5エリア設定であるため(ステップS88)、続いて、左中エリア及び左エリア(領域(6))をピーク選択領域とし(ステップS106)、また、AFセンサ74のセンサ感度を低感度として(ステップS108)積分処理を開始する(ステップS110)。この積分処理が終了し、CPU60が領域(6)のセンサデータを取得すると(ステップS112)、続いて、右中エリア及び右エリア(領域(7))をピーク選択領域とし(ステップS114)、また、AFセンサ74のセンサ感度を低感度として(ステップS116)積分処理を開始する(ステップS118)。この積分処理が終了し、CPU60が領域(7)のセンサデータを取得すると(ステップS120)、3分割ゲイン低積分の処理を終了する。これによって以後の測距演算に必要な測距エリア内の各分割エリアのセンサデータが取得される。   On the other hand, when 5 areas are set in the distance measurement area setting process (when the zoom position is other than tele), the distance measurement areas are “center area”, “middle left area”, “left area”, “middle right area”. ”And“ Right area ”. This distance measuring area is divided into three regions (3), (6), and (7) in FIGS. 13D, 13G, and 13H, and each region (3), (6), (7) Are sequentially executed using the peak selection region. Specifically, with reference to the flowchart of FIG. 15, as in the case of the three area setting described above, first, the central area (region (3)) is set as the peak selection region (step S80). The sensor sensitivity is set to low sensitivity (step S82) and integration processing is started (step S84). When this integration process ends and the CPU 60 acquires the sensor data of the area (3) (step S86), since the distance measurement area is set to 5 areas (step S88), the left middle area and the left area (area) (6)) is set as the peak selection region (step S106), and the sensitivity of the AF sensor 74 is set low (step S108), and the integration process is started (step S110). When this integration process is completed and the CPU 60 acquires the sensor data of the area (6) (step S112), the right middle area and the right area (area (7)) are set as the peak selection areas (step S114). Then, the sensor sensitivity of the AF sensor 74 is set to low sensitivity (step S116), and integration processing is started (step S118). When this integration process ends and the CPU 60 acquires the sensor data of the region (7) (step S120), the three-divided gain low integration process ends. As a result, sensor data of each divided area in the distance measurement area necessary for the subsequent distance calculation is acquired.

尚、上記説明では測距エリアが5エリア設定の場合には、測距エリアを領域(3)、(6)、(7)に3分割するようにしたが、これに限らず、各分割エリアに5分割してそれぞれの分割エリアを順にピーク選択領域として積分処理を実行しセンサデータを取得するようにしてもよい。即ち、測距エリアを分割する領域の数は本実施の形態の場合に限らず任意に設定変更できる。   In the above description, when the distance measurement area is set to five areas, the distance measurement area is divided into three areas (3), (6), and (7). The sensor data may be acquired by performing integration processing with each divided area in turn as a peak selection region. That is, the number of areas into which the ranging area is divided is not limited to the case of the present embodiment, and can be arbitrarily set and changed.

図14のステップS58における一括ゲイン低積分の処理は、ステップS52の一括ゲイン高積分において採用したピーク選択領域を変更せず、AFセンサ74のセンサ感度を高感度から低感度に切り替えてAFセンサ74に積分処理を実行させるCPU60の処理である。   The collective gain low integration process in step S58 of FIG. 14 does not change the peak selection region adopted in the collective gain high integration of step S52, and switches the sensor sensitivity of the AF sensor 74 from high sensitivity to low sensitivity. This is a process of the CPU 60 that causes the integration process to be executed.

即ち、上記測距エリア設定処理において測距エリアを3エリア設定とした場合(ズーム位置がテレの場合)には、ピーク選択領域を、図13(B)に示した領域(1)とし、また、AFセンサ74のセンサ感度を低感度としてAFセンサ74に積分処理を実行させる。一方、上記測距エリア設定処理において測距エリアを5エリア設定とした場合(ズーム位置がテレ以外の場合)には、ピーク選択領域を、図13(C)に示した領域(2)とし、また、AFセンサ74のセンサ感度を低感度としてAFセンサ74に積分処理を実行させる。   That is, when the distance measurement area is set to 3 areas in the distance measurement area setting process (when the zoom position is tele), the peak selection area is the area (1) shown in FIG. The AF sensor 74 is made to perform integration processing with the sensor sensitivity of the AF sensor 74 being low. On the other hand, when the distance measurement area is set to five areas in the distance measurement area setting process (when the zoom position is other than tele), the peak selection area is the area (2) shown in FIG. In addition, the AF sensor 74 is made to perform integration processing with the sensor sensitivity of the AF sensor 74 being low.

以上の積分処理が終了するとCPU60は、AFセンサ74から測距エリア内のセンサデータを取得する。これによって、測距演算に必要な測距エリア内の各分割エリアのセンサデータが取得される。   When the above integration processing is completed, the CPU 60 acquires sensor data in the distance measurement area from the AF sensor 74. Thereby, sensor data of each divided area in the distance measurement area necessary for distance measurement calculation is acquired.

図14のステップS60における低輝度時処理は、ステップS52における一括ゲイン高積分の処理を、最大許容積分時間を限度として積分処理が終了するまで継続させる処理である。   The low-brightness process in step S60 of FIG. 14 is a process in which the collective gain high integration process in step S52 is continued until the integration process ends with the maximum allowable integration time as a limit.

最大許容積分時間は、撮影モードにより異なり、撮影モードが発光禁止モードに設定されている場合には、上記ステップS52の一括ゲイン高積分の積分時間が4ms以上経過した後も200ms(最大許容積分時間)を限度としてそのまま積分処理を継続させる。もし、積分処理が200ms以内で正常に終了した場合(ピーク選択領域内のセンサデータのピーク値が積分終了値に達したことにより積分を終了した場合(以下同様))には、その時点のセンサデータをAFセンサ74から取得する。一方、200msが経過しても積分処理が正常に終了しない場合には、CPU60からの指示信号により強制的に積分処理を終了させ、その時点でのセンサデータをAFセンサ74から取得する。   The maximum allowable integration time differs depending on the shooting mode. When the shooting mode is set to the light emission inhibition mode, the maximum allowable integration time is 200 ms even after the integration time of the collective gain high integration in step S52 is 4 ms or more. ) Is continued as it is. If the integration process ends normally within 200 ms (if the integration ends when the peak value of the sensor data in the peak selection region reaches the integration end value (the same applies hereinafter)), the sensor at that time Data is acquired from the AF sensor 74. On the other hand, if the integration process does not end normally even after 200 ms elapses, the integration process is forcibly ended by an instruction signal from the CPU 60, and sensor data at that time is acquired from the AF sensor 74.

また、撮影モードが発光禁止モードでない場合には、まず、上記ステップS52の一括ゲイン高積分の積分時間が4ms以上経過した後も100msを限度 (最大許容積分時間)としてそのまま積分処理を継続させる。もし、積分処理が100ms以内で正常に終了した場合には、その時点でセンサデータをAFセンサ74から取得する。一方、積分時間が100msに達しても積分処理が終了しない場合には、CPU60からの指示信号により強制的に積分処理を終了させる。そして、ストロボ装置AF72による補助光の発光によりAFプレ発光させながら積分処理を再度開始させる。尚、夜景ポートレートモードのように夜景と手前の人物とを同時に撮影するようなモードに設定されている場合には、夜景にピントが合う不具合を防止するために、一括ゲイン高積分の積分時間は、100msの替わりに25msを限度とし、積分時間が25msに達しても積分処理が正常に終了しない場合には、積分処理を強制的に終了させて、AFプレ発光と共に積分処理を開始させる。尚、以下、AFプレ発光させながら積分を行う処理をプレ発光処理という。   If the photographing mode is not the light emission prohibition mode, the integration process is continued as it is with a limit of 100 ms (maximum allowable integration time) after the integration time of the collective gain high integration in step S52 is 4 ms or longer. If the integration process ends normally within 100 ms, sensor data is acquired from the AF sensor 74 at that time. On the other hand, if the integration process does not end even when the integration time reaches 100 ms, the integration process is forcibly ended by an instruction signal from the CPU 60. Then, the integration process is restarted while the AF pre-light is emitted by the auxiliary light emitted by the strobe device AF72. Note that when the night scene and the person in the foreground are photographed at the same time as in the night scene portrait mode, the integration time for the collective gain high integration is used to prevent the problem of focusing on the night scene. Is limited to 25 ms instead of 100 ms, and if the integration process does not end normally even if the integration time reaches 25 ms, the integration process is forcibly ended and the integration process is started together with AF pre-emission. Hereinafter, processing for performing integration while causing AF pre-emission is referred to as pre-emission processing.

プレ発光処理による積分処理を開始する場合、ステップS52の一括ゲイン高積分において採用したピーク選択領域を変更せず、AFセンサ74のセンサ感度を高感度から低感度に切り替えてAFセンサ74に積分処理を開始させる。また、AFプレ発光は、断続的なパルス発光により所定の上限回数を設定して行う。これにより、プレ発光が上限回数に達する前に積分処理が正常に終了した場合には、そのときのセンサデータをAFセンサ74から取得する。一方、プレ発光が上限回数に達しても積分処理が正常に終了しない場合には、積分処理を強制的に終了させて、その時点でのセンサデータをAFセンサ74から取得する。   When integration processing by pre-emission processing is started, the peak selection region employed in the collective gain high integration in step S52 is not changed, and the sensor sensitivity of the AF sensor 74 is switched from high sensitivity to low sensitivity and integration processing is performed on the AF sensor 74. To start. The AF pre-emission is performed by setting a predetermined upper limit number of times by intermittent pulse emission. As a result, when the integration process is normally completed before the pre-emission reaches the upper limit number, the sensor data at that time is acquired from the AF sensor 74. On the other hand, if the integration process does not end normally even if the pre-emission reaches the upper limit, the integration process is forcibly ended and sensor data at that time is acquired from the AF sensor 74.

尚、上記実施の形態では被写体輝度が高輝度又は超高輝度の場合だけ測距エリアを複数の領域(ピーク選択領域)に分割して各領域ごとにセンサデータを取得するようにしたが、被写体輝度が中輝度や低輝度の場合であっても高輝度等の場合と同様に測距エリアを複数の領域に分割して各領域ごとにセンサデータを取得するようにしてもよい。   In the above embodiment, the distance measurement area is divided into a plurality of areas (peak selection areas) only when the subject brightness is high or very high, and sensor data is acquired for each region. Even when the luminance is medium luminance or low luminance, the distance measurement area may be divided into a plurality of areas as in the case of high luminance or the like, and sensor data may be acquired for each area.

また、上記実施の形態では、被写体輝度が超高輝度、高輝度、中輝度、低輝度の場合に場合分けしてそれぞれの場合に対応したセンサデータの取得処理を行うようにしたが、これに限らず、被写体輝度のレベルを上記実施の形態よりも細かく又は粗く場合分けしてそれぞれの被写体輝度のレベルに対応したセンサデータの取得処理を行うようにしてもよい。   Further, in the above embodiment, the process of acquiring sensor data corresponding to each case is performed by dividing into cases where the subject brightness is ultra-high brightness, high brightness, medium brightness, and low brightness. However, the subject luminance level may be finer or coarser than that in the above embodiment, and sensor data acquisition processing corresponding to each subject luminance level may be performed.

次に、上記AFデータ取得処理を実行する際のCPU60とAFセンサ74 (処理回路99)の処理動作について詳説する。図16に示すようにCPU60とAFセンサ74との間では、複数の信号ラインにより各種信号の送受信が行われる。CPU60からAFセンサ74に送信される信号の信号ラインとしては、AFセンサ74を動作状態又は非動作状態に切り替える信号が送信される/AFCEN、制御データの設定を指示する信号が送信される/AFRST、制御データの内容を示す信号が送信されるAFAD、READ/WRIGHT−クロックパルスが送信されるAFCLK等がある。AFセンサ74からCPU60に送信される信号の信号ラインとしては、積分処理が終了したことを示す信号が送信される/AFEND、ピーク選択領域におけるセンサデータのピーク値(最小値)がアナログデータとして送信されるMDATA、Rセンサ94及びLセンサ96の各セルのセンサデータがアナログデータとして送信されるAFDATAP等がある。尚、以下、各信号ラインから送信される信号の種類を信号ラインの名称により識別する(/AFCEN信号、/AFRST信号等)。   Next, processing operations of the CPU 60 and the AF sensor 74 (processing circuit 99) when executing the AF data acquisition processing will be described in detail. As shown in FIG. 16, various signals are transmitted and received between the CPU 60 and the AF sensor 74 through a plurality of signal lines. As a signal line of a signal transmitted from the CPU 60 to the AF sensor 74, a signal for switching the AF sensor 74 to an operation state or a non-operation state is transmitted / AFCEN, and a signal instructing setting of control data is transmitted / AFRST AFAD to which a signal indicating the contents of control data is transmitted, and AFCLK to which a READ / WRIGHT-clock pulse is transmitted. As a signal line of a signal transmitted from the AF sensor 74 to the CPU 60, a signal indicating that the integration process is completed is transmitted / AFEND, and a peak value (minimum value) of sensor data in the peak selection region is transmitted as analog data. MDATA, the R sensor 94, and the AF sensor that transmits the sensor data of each cell of the L sensor 96 as analog data. Hereinafter, the type of signal transmitted from each signal line is identified by the name of the signal line (/ AFCEN signal, / AFRST signal, etc.).

CPU60及びAFセンサ74における上記各信号の送受信の動作タイミングについて図17の動作タイミングチャートを用いて説明する。CPU60が/AFCEN信号を1(Highレベル)に設定している場合、AFセンサ74は非動作状態にあり、CPU60が/AFCEN信号を0(Lowレベル)に切り替えるとAFセンサ74が動作状態に切り替わる(時刻T10参照)。   The operation timing of transmission / reception of each signal in the CPU 60 and the AF sensor 74 will be described with reference to the operation timing chart of FIG. When the CPU 60 sets the / AFCEN signal to 1 (High level), the AF sensor 74 is in a non-operating state, and when the CPU 60 switches the / AFCEN signal to 0 (Low level), the AF sensor 74 switches to an operating state. (See time T10).

AFセンサ74を動作状態に切り替えた後、所定時間(10ms)が経過すると、CPU60は/AFRST信号を1から0に切り替えてAFセンサ74に対して制御データの設定を指示する(時刻T20参照)。そして、CPU60は、AFセンサ74に対して、AFAD信号により制御データを送信すると共に、AFCLK信号によりクロックパルスを送信する(時刻T20〜T30の期間参照)。AFセンサ74は、/AFRST信号が1から0に切り替えられると、AFCLK信号により与えられるクロックパルスに同期してAFAD信号の信号レベルを読み込む。これによって、ピーク選択領域、センサ感度等の積分処理に必要なデータがAFセンサ74にセットされる。尚、制御データとして、D0からD127までの128個の1又は0で示されるデータが時系列で送信されるが、制御データの内容については後述する。   When a predetermined time (10 ms) elapses after the AF sensor 74 is switched to the operating state, the CPU 60 switches the / AFRST signal from 1 to 0 and instructs the AF sensor 74 to set control data (see time T20). . Then, the CPU 60 transmits control data by the AFAD signal to the AF sensor 74 and also transmits a clock pulse by the AFCLK signal (refer to the period from time T20 to T30). When the / AFRST signal is switched from 1 to 0, the AF sensor 74 reads the signal level of the AFAD signal in synchronization with the clock pulse given by the AFCLK signal. As a result, data necessary for integration processing such as a peak selection region and sensor sensitivity is set in the AF sensor 74. As control data, 128 pieces of data indicated by 1 or 0 from D0 to D127 are transmitted in time series. The contents of the control data will be described later.

AFAD信号により最後のデータ(D127)が送信され(時刻T30参照)、100μsが経過すると(時刻T40参照)、CPU60は/AFRST信号を0から1に切り替え、積分処理の開始を指示する。これにより、AFセンサ74は、センサ感度を高感度に設定した場合には150μs後に、センサ感度を低感度に設定した場合には30μs後に、Rセンサ94及びLセンサ96の各セルによる受光を開始すると共に、各セルから逐次出力される輝度信号の積分を開始する(時刻T50参照)。同時に、AFセンサ74は、/AFEND信号を1から0に切り替え、積分を開始したことをCPU60に送信する。また、MDATA信号によりピーク選択領域内のセンサデータのピーク値をアナログデータとして出力する。   When the last data (D127) is transmitted by the AFAD signal (see time T30) and 100 μs has elapsed (see time T40), the CPU 60 switches the / AFRST signal from 0 to 1, and instructs the start of integration processing. Thereby, the AF sensor 74 starts light reception by each cell of the R sensor 94 and the L sensor 96 after 150 μs when the sensor sensitivity is set to high sensitivity and after 30 μs when the sensor sensitivity is set to low sensitivity. At the same time, integration of the luminance signal sequentially output from each cell is started (see time T50). At the same time, the AF sensor 74 switches the / AFEND signal from 1 to 0, and transmits to the CPU 60 that integration has started. Further, the peak value of the sensor data in the peak selection region is output as analog data by the MDATA signal.

積分処理の開始後、センサデータのピーク値が所定の積分終了値VEND(例えば、0.5V)に達すると、AFセンサ74は、輝度信号の積分を終了すると共に、/AFEND信号を0から1に切り替える(時刻T60参照)。尚、/AFEND信号の0から1への切替りが積分終了信号となる。   When the peak value of the sensor data reaches a predetermined integration end value VEND (for example, 0.5 V) after the start of the integration process, the AF sensor 74 ends the integration of the luminance signal and changes the / AFEND signal from 0 to 1. (Refer to time T60). Note that switching of the / AFEND signal from 0 to 1 is an integration end signal.

CPU60は、/AFEND信号が0に設定されていた時間(時刻T50〜T60の期間)を検出することより、積分時間を検出すると共に、/AFEND信号が0から1に切り替えられたことにより積分が終了したことを検出する。   The CPU 60 detects the integration time by detecting the time when the / AFEND signal is set to 0 (period from time T50 to T60), and the integration is performed when the / AFEND signal is switched from 0 to 1. Detect that it has finished.

積分が終了すると、CPU60は、AFセンサ74に対してAFCLK信号によりクロックパルスを送信し、センサデータの読出しを指示する(時刻T70参照)。尚、ピーク選択領域内におけるセンサデータのピーク値が積分終了値に達した場合にAFセンサ74が積分を自動的に終了する自動終了モードと、センサデータのピーク値が積分終了値に達したか否かとは無関係に外部(CPU60)からの指示により積分を終了する外部終了モードとがあり、CPU60は、前者の場合にはAFAD信号を1に設定した状態を維持して上記クロックパルスを送信し、後者の場合にはAFAD信号を0に切り替えてAFセンサ74の積分を終了させた後、上記クロックパルスを送信する。また、前者の場合であってもCPU60がAFAD信号を1から0に切り替えることにより強制的にAFセンサ74における積分を終了させることができるようになっている。   When the integration is completed, the CPU 60 transmits a clock pulse by the AFCLK signal to the AF sensor 74 and instructs reading of the sensor data (see time T70). In addition, when the peak value of the sensor data in the peak selection area reaches the integration end value, the auto end mode in which the AF sensor 74 automatically ends the integration, and whether the peak value of the sensor data has reached the integration end value. Regardless of whether or not, there is an external termination mode in which integration is terminated by an instruction from the outside (CPU 60). In the former case, the CPU 60 keeps the AFAD signal set to 1 and transmits the clock pulse. In the latter case, the AFAD signal is switched to 0 to complete the integration of the AF sensor 74, and then the clock pulse is transmitted. Even in the former case, the CPU 60 can forcibly terminate the integration in the AF sensor 74 by switching the AFAD signal from 1 to 0.

AFセンサ74は、AFCLK信号により与えられるクロックパルスに同期して各セルごとに積分して得たセンサデータをアナログデータとしてLセンサ96とRセンサ94のセンサ番号1からセンサ番号234まで交互にCPU60に送信する。これによってCPU60はセンサデータをAFセンサ74から取得する。   The AF sensor 74 alternately converts the sensor data obtained by integrating each cell in synchronization with the clock pulse given by the AFCLK signal from the sensor numbers 1 to 234 of the L sensor 96 and the R sensor 94 as analog data. Send to. As a result, the CPU 60 acquires sensor data from the AF sensor 74.

次に、上記AFAD信号により送受信される制御データの内容について説明する。上述のように制御データは、D0からD127までの128個の1又は0のデータから構成される(図17時刻T20〜T30の期間参照)。このうち、D0〜D111は、AFセンサ74において設定すべきピーク選択領域を示すピーク選択領域設定データであり、D112〜D118は、ピーク選択領域数を示すピーク選択領域数データである。尚、ピーク選択領域設定データ及びピーク選択領域数データの詳細は後述する。   Next, the contents of the control data transmitted / received by the AFAD signal will be described. As described above, the control data is composed of 128 pieces of 1 or 0 data from D0 to D127 (see the period of time T20 to T30 in FIG. 17). Among these, D0 to D111 are peak selection region setting data indicating the peak selection region to be set in the AF sensor 74, and D112 to D118 are peak selection region number data indicating the number of peak selection regions. Details of the peak selection area setting data and the peak selection area number data will be described later.

また、D119〜D120はダミーデータ(0)であり、D121は設定すべきセンサ感度を示す感度データである。本実施の形態においてセンサ感度は、高又は低の2段階で切替可能であり、D121が1の場合には高感度、D121が0の場合には低感度の設定を示す。   D119 to D120 are dummy data (0), and D121 is sensitivity data indicating sensor sensitivity to be set. In the present embodiment, the sensor sensitivity can be switched in two steps, high or low. When D121 is 1, high sensitivity is indicated, and when D121 is 0, low sensitivity is indicated.

D122は、積分の終了に関するモードを示す積分モードデータであり、D122が1のときは外部からの指示によって積分を終了する外部終了モードの設定を示し、D122が0のときは、ピーク選択領域内のセンサデータが所定の積分終了値(積分終了電圧)VENDに達したときにAFセンサ74が自動で積分処理を終了する自動終了モードの設定を示す。   D122 is integration mode data indicating a mode related to the end of integration. When D122 is 1, it indicates the setting of an external end mode in which integration is ended by an instruction from the outside. When D122 is 0, it is within the peak selection region. This indicates the setting of the automatic end mode in which the AF sensor 74 automatically ends the integration process when the sensor data reaches a predetermined integration end value (integration end voltage) VEND.

D123は、自動終了モードの場合に積分終了値VENDを設定する自動積分終了電圧設定データであり、本実施の形態では、D123が1の場合には電圧Lの設定を示し、D123が0の場合には電圧Hの設定を示す。   D123 is automatic integration end voltage setting data for setting the integration end value VEND in the case of the automatic end mode. In this embodiment, when D123 is 1, it indicates the setting of the voltage L, and when D123 is 0 Shows the setting of the voltage H.

D124〜D126は、基準電圧VREFを設定するVREF選択データである。3ビットのデータによって8種類の基準電圧を設定することができる。D127は、制御データの終了を示す終了データであり、常に1に設定される。   D124 to D126 are VREF selection data for setting the reference voltage VREF. Eight types of reference voltages can be set by 3-bit data. D127 is end data indicating the end of the control data, and is always set to 1.

次に、ピーク選択領域設定データD0〜D111及びピーク選択領域数データD112〜D118について詳説する。Rセンサ94及びLセンサ96は、それぞれ図18に示すようにセンサ番号1から234までの234個のセルによって構成されている。各センサ94、96の左右5つのセル(センサ番号1〜5、及び、センサ番号230〜234)はダミーセルであり、実際に有効なセル(有効画素)はセンサ番号6〜229までの224個となっている。   Next, the peak selection region setting data D0 to D111 and the peak selection region number data D112 to D118 will be described in detail. Each of the R sensor 94 and the L sensor 96 includes 234 cells having sensor numbers 1 to 234 as shown in FIG. The left and right five cells (sensor numbers 1 to 5 and sensor numbers 230 to 234) of the sensors 94 and 96 are dummy cells, and the actually effective cells (effective pixels) are 224 from sensor numbers 6 to 229. It has become.

CPU60及びAFセンサ74の処理上において、有効画素範囲のセンサ番号6〜229のセルは、隣接する4つずつセルを1ブロックとしてブロック単位で管理されており、同図に示すようにLセンサ96のセンサ番号229からセンサ番号6まで順に4つ単位でブロック番号D0、D1、…、D55(ブロック数56)が割り当てられ、Rセンサ94のセンサ番号229からセンサ番号6まで順に4つ単位でブロック番号D56、D57、…、D111(ブロック数56)が割り当てられている。   In the processing of the CPU 60 and the AF sensor 74, the cells having sensor numbers 6 to 229 in the effective pixel range are managed in units of blocks with four adjacent cells as one block. As shown in FIG. Block numbers D0, D1,..., D55 (number of blocks 56) are assigned in order from the sensor number 229 to sensor number 6 of the R sensor 94, and the blocks from the sensor number 229 to the sensor number 6 of the R sensor 94 are sequentially blocked in units of four. Numbers D56, D57,..., D111 (number of blocks 56) are assigned.

CPU60とAFセンサ74との間で制御データとして送受信されるD0〜D111のデータは、このようにして割り当てられたブロック番号に対応しており、ピーク選択領域設定データD0〜D111を図19のように配列して示すと、Lセンサ96についての設定データは、点線で囲まれていないD0〜D55であり、Rセンサ94についての設定データは、点線で囲まれたD56〜D111である。例えば、設定データD0、D56は、それぞれLセンサ96、Rセンサ94のセンサ番号226〜229についての設定データを示し、設定データD55、D111は、それぞれLセンサ96、Rセンサ94のセンサ番号6〜9についての設定データを示す。   The data of D0 to D111 transmitted / received as control data between the CPU 60 and the AF sensor 74 corresponds to the block numbers assigned in this way, and the peak selection region setting data D0 to D111 are shown in FIG. , The setting data for the L sensor 96 is D0 to D55 not surrounded by a dotted line, and the setting data for the R sensor 94 is D56 to D111 surrounded by a dotted line. For example, the setting data D0 and D56 indicate the setting data for the sensor numbers 226 to 229 of the L sensor 96 and the R sensor 94, respectively, and the setting data D55 and D111 respectively indicate the sensor numbers 6 to 6 of the L sensor 96 and the R sensor 94. The setting data for 9 is shown.

ピーク選択領域設定データD0〜D111は、その設定データに対応するブロック番号の4つのセルをピーク選択領域内のセルとして設定するか否かを示しており、設定データが1のときは、その設定データに対応するブロック番号の4つのセルはピーク選択領域内のセルとして設定され、設定データが0のときは、その設定データに対応するブロック番号の4つのセルはピーク選択領域外のセルとして設定される。例えば、設定データD0が1の場合、Lセンサ96のセル229、228、227、226は、ピーク選択領域内のセルとして設定される。   The peak selection area setting data D0 to D111 indicate whether or not four cells having a block number corresponding to the setting data are set as cells in the peak selection area. The four cells with the block number corresponding to the data are set as cells in the peak selection area. When the setting data is 0, the four cells with the block number corresponding to the setting data are set as cells outside the peak selection area. Is done. For example, when the setting data D0 is 1, the cells 229, 228, 227, and 226 of the L sensor 96 are set as cells in the peak selection region.

また、ピーク選択領域設定データと共に制御データとして送受信されるピーク選択領域数データD112〜D118は、ピーク選択領域設定データによりピーク選択領域として設定するブロック数を2進数で示したものであり、図20に示すように、D112を最上位ビット、D118を最下位ビットとした7ビットデータにより、ピーク選択領域として設定するブロック数が表される。同図(A)に示すようにD115のみが1の場合にはピーク選択領域として設定するブロック数は8であり、同図(B)に示すようにD112〜D114が1、D115〜D118が0の場合にはピーク選択領域として設定するブロック数は112である。   In addition, the peak selection area number data D112 to D118 transmitted and received as control data together with the peak selection area setting data indicate the number of blocks set as the peak selection area by the peak selection area setting data in binary number. As shown, the number of blocks to be set as the peak selection region is represented by 7-bit data in which D112 is the most significant bit and D118 is the least significant bit. When only D115 is 1 as shown in FIG. 11A, the number of blocks set as the peak selection region is 8, and D112 to D114 are 1 and D115 to D118 are 0 as shown in FIG. In this case, 112 blocks are set as the peak selection region.

次に、ピーク選択領域設定データの生成手順について説明する。ピーク選択領域は、図13に示したように領域(1)〜(7)のいずれかに設定される。各領域(1)〜(7)をピーク選択領域として設定する際のピーク選択領域設定データは、以下のように生成される。   Next, a procedure for generating peak selection region setting data will be described. The peak selection area is set to any one of the areas (1) to (7) as shown in FIG. The peak selection area setting data when setting each area (1) to (7) as the peak selection area is generated as follows.

例えば、図21に示すようにRセンサ94又はLセンサ96のセンサ領域Sにおいて領域P(斜線部分)をピーク選択領域として設定する場合、領域Pの右端と左端のセルのセンサ番号を求め、センサ番号が領域Pの右端と左端のセルのセンサ番号の間にあるセルをピーク選択領域内のセルとする。   For example, as shown in FIG. 21, when the region P (shaded portion) is set as the peak selection region in the sensor region S of the R sensor 94 or the L sensor 96, the sensor numbers of the rightmost and leftmost cells of the region P are obtained and the sensor A cell whose number is between the sensor numbers of the rightmost and leftmost cells in the region P is defined as a cell in the peak selection region.

ここで、各セルのセンサ番号が各セルのアドレスを示すものとし、特に領域Pの右端のアドレスをピーク選択開始アドレスPS、左端のアドレスをピーク選択終了アドレスPEとする。   Here, the sensor number of each cell indicates the address of each cell, and in particular, the right end address of the region P is the peak selection start address PS and the left end address is the peak selection end address PE.

一方、領域Pを特定する情報として領域Pの右端のアドレスS1と、領域P内の所定セルのアドレスS2と、アドレスS2のセルから領域Pの左端のセルまでのセル数(センサ数)Dが予め参照データとして与えられているとする。このとき、領域Pのピーク選択領域開始アドレスPSとピーク選択領域終了アドレスPEは、次式、
[数2]
PS=S1 …(2)
PE=S2+D−1…(3)
により求めることができる。尚、Rセンサ94においてピーク選択領域とする領域に対する上記ピーク選択開始アドレスPS、ピーク選択終了アドレスPE、参照データS1、S2、Dを、それぞれPSR、PER、SR1、SR2、DRとし、Lセンサ96においてピーク選択領域とする領域に対する上記ピーク選択開始アドレスPS、ピーク選択終了アドレスPE、参照データS1、S2、Dを、それぞれPSL、PEL、SL1、SL2、DLとして識別する。
On the other hand, as information specifying the region P, the rightmost address S1 of the region P, the address S2 of a predetermined cell in the region P, and the number of cells (number of sensors) D from the cell of the address S2 to the leftmost cell of the region P are It is assumed that it is given in advance as reference data. At this time, the peak selection region start address PS and the peak selection region end address PE of the region P are expressed by the following equations:
[Equation 2]
PS = S1 (2)
PE = S2 + D-1 (3)
It can ask for. In the R sensor 94, the peak selection start address PS, peak selection end address PE, and reference data S1, S2, D for the region to be the peak selection region are PSR, PER, SR1, SR2, DR, respectively, and the L sensor 96 The peak selection start address PS, peak selection end address PE, and reference data S1, S2, and D for the region to be selected as the peak selection region are identified as PSL, PEL, SL1, SL2, and DL, respectively.

図13に示した各領域(1)〜(7)をピーク選択領域として設定する場合について具体的に説明すると、各領域(1)〜(7)をピーク選択領域として設定する際の参照データとして、Rセンサ94及びLセンサ96の各分割エリアの右端のセルのアドレスと、各分割エリアの採用センサ数(セル数)が用いられる。   The case where each region (1) to (7) shown in FIG. 13 is set as the peak selection region will be described in detail. As reference data when each region (1) to (7) is set as the peak selection region, The address of the rightmost cell in each divided area of the R sensor 94 and the L sensor 96 and the number of employed sensors (number of cells) in each divided area are used.

本実施の形態においてRセンサ94及びLセンサ96に対して採用される各分割エリアの右端のセルのアドレス及び各分割エリアの採用センサ数の具体的数値例を図22に示す。尚、Rセンサ94については括弧なしの数値で示し、Lセンサ96については括弧付きの数値で示している。   FIG. 22 shows a specific numerical example of the address of the cell at the right end of each divided area and the number of adopted sensors in each divided area adopted for the R sensor 94 and the L sensor 96 in the present embodiment. The R sensor 94 is indicated by numerical values without parentheses, and the L sensor 96 is indicated by numerical values with parentheses.

例えば、領域(1)をピーク選択領域とする場合、Rセンサ94についての参照データSR1、SR2、DRは、それぞれ左中エリアの右端のセルのアドレス46、右中エリアの右端のセルのアドレス126、右中エリアの採用センサ数62である。同様にLセンサ96についての参照データSL1、SL2、DLは、それぞれ左中エリアの右端のセルのアドレス48、右中エリアの右端のセルのアドレス128、右中エリアの採用センサ数62である。これらの参照データを上式(2)、(3)に代入すると、Rセンサ94及びLセンサ96における領域(1)のピーク選択開始アドレスPSR、PSL、ピーク選択終了アドレスPER、PELが算出される。即ち、
[数3]
PSR=46
PER=126+62−1=187
PSL=48
PEL=128+62−1=189
が算出される。従って、領域(1)をピーク選択領域とする場合にはRセンサ94についてはセンサ番号46〜187のセルがピーク選択領域内のセルとすることが求まり、Lセンサ96についてはセンサ番号48〜189のセルがピーク選択領域内のセルとすることが求まる。
For example, when the region (1) is the peak selection region, the reference data SR1, SR2, and DR for the R sensor 94 are respectively the rightmost cell address 46 in the left middle area and the rightmost cell address 126 in the right middle area. The number of employed sensors in the right middle area is 62. Similarly, the reference data SL1, SL2, and DL for the L sensor 96 are the address 48 of the rightmost cell in the middle left area, the address 128 of the rightmost cell in the middle right area, and the number of employed sensors 62 in the middle right area. By substituting these reference data into the above equations (2) and (3), peak selection start addresses PSR and PSL, peak selection end addresses PER and PEL of the region (1) in the R sensor 94 and the L sensor 96 are calculated. . That is,
[Equation 3]
PSR = 46
PER = 126 + 62-1 = 187
PSL = 48
PEL = 128 + 62-1 = 189
Is calculated. Accordingly, when the region (1) is set as the peak selection region, it is determined that the cells with sensor numbers 46 to 187 are the cells in the peak selection region for the R sensor 94, and the sensor numbers 48 to 189 are for the L sensor 96. Are determined to be cells in the peak selection region.

領域(1)以外の領域(2)〜(7)をピーク選択領域とする場合についても上述と同様にしてピーク選択開始アドレスPSR、PSL、ピーク選択終了アドレスPER、PELを算出することができる。即ち、設定しようとするピーク選択領域内において、右端にある分割エリア内の右端のアドレスを参照データSR1、SL1とし、左端にある分割エリア内の右端のアドレスを参照データSR2、SL2とする。また、その左端にある分割エリアの採用センサ数をDR、DLとする。そして、上式(2)、(3)にそれらの値を代入することによって、各領域(2)〜(7)をピーク選択領域として設定する場合のピーク選択開始アドレスPSR、PSL及びピーク選択終了アドレスPER、PELを算出することができる。図22にも示されているように、領域(2)の場合には、PSR=6、PER=227、PSL=8、PEL=229、領域(3)の場合には、PSR=86、PER=147、PSL=88、PEL=149、領域(4)の場合には、PSR=46、PER=107、PSL=48、PEL=109、領域(5)の場合には、PSR=126、PER=187、PSL=128、PEL=189、領域(6)の場合には、PSR=6、PER=107、PSL=8、PEL=109、領域(7)の場合には、PSR=126、PER=227、PSL=128、PEL=229となる。   When the regions (2) to (7) other than the region (1) are used as the peak selection regions, the peak selection start addresses PSR and PSL and the peak selection end addresses PER and PEL can be calculated in the same manner as described above. That is, in the peak selection region to be set, the right end address in the rightmost divided area is set as reference data SR1 and SL1, and the right end address in the leftmost divided area is set as reference data SR2 and SL2. Further, the number of employed sensors in the divided area at the left end is assumed to be DR and DL. Then, by substituting those values into the above formulas (2) and (3), the peak selection start addresses PSR and PSL and the peak selection end when each region (2) to (7) is set as the peak selection region Addresses PER and PEL can be calculated. As shown in FIG. 22, in the case of region (2), PSR = 6, PER = 227, PSL = 8, PEL = 229, and in case of region (3), PSR = 86, PER. = 147, PSL = 88, PEL = 149, in the case of region (4), PSR = 46, PER = 107, PSL = 48, PEL = 109, in the case of region (5), PSR = 126, PER = 187, PSL = 128, PEL = 189, in case of region (6), PSR = 6, PER = 107, PSL = 8, PEL = 109, in case of region (7), PSR = 126, PER = 227, PSL = 128, and PEL = 229.

尚、右エリア、右中エリア、中央エリア、左中エリア、左エリアの順に、Rセンサ94における各分割エリアの右端のセルのアドレスをRSR、RMSR、MSR、LMSR、LSR、各エリアの採用センサ数をRWR、RMWR、MWR、LMWR、LWRとし、また、Lセンサ96における各分割エリアの右端のセルのアドレスをRSL、RMSL、SL、LMSL、LSL、各エリアの採用センサ数をRWL、RMWL、MWL、LMWL、LWLとすると、図23に示すように各領域(1)〜(7)をピーク選択領域とする場合に上記SR1、SR2、SL1、SL2、DR、DLに代入するアドレス及びセンサ数が対応する。   In addition, the address of the cell at the right end of each divided area in the R sensor 94 is RSR, RMSR, MSR, LMSR, LSR, and the adopted sensor for each area in the order of the right area, the middle right area, the center area, the middle left area, and the left area The number is RWR, RMWR, MWR, LMWR, LWR, and the address of the rightmost cell of each divided area in the L sensor 96 is RSL, RMSL, SL, LMSL, LSL, and the number of employed sensors in each area is RWL, RMWL, When MWL, LMWL, and LWL are used, as shown in FIG. 23, when each region (1) to (7) is set as a peak selection region, the number of addresses and sensors to be substituted for SR1, SR2, SL1, SL2, DR, and DL Corresponds.

以上のようにして、ピーク選択領域とする領域のピーク選択開始アドレスPSとピーク選択終了アドレスPEを得ると、次に図18のように4つのセルを1ブロックとしたブロック番号D0〜D55、D56〜D111によりピーク選択領域の範囲を求める。このとき、ピーク選択開始アドレスPSとピーク選択終了アドレスPEを含むブロック番号の4つのセルは、ピーク選択領域内のセルとする。   As described above, when the peak selection start address PS and peak selection end address PE of the area to be the peak selection area are obtained, the block numbers D0 to D55, D56 having four cells as one block as shown in FIG. The range of the peak selection region is obtained by ~ D111. At this time, the four cells having the block numbers including the peak selection start address PS and the peak selection end address PE are cells in the peak selection area.

そこで、Lセンサ96とRセンサ94のそれぞれについてピーク選択領域の左端のブロック番号をピーク選択開始ブロック番号DSL、DSRとし、ピーク選択領域の右端のブロック番号をピーク選択終了ブロック番号DEL、DERとすると、次式、
[数4]
DSL=INT((229−PEL)/4) …(4)
DEL=55−INT((PSL−6)/4) …(5)
DSR=56+INT((229−PER)/4) …(6)
DER=111−INT((PSR−6)/4) …(7)
によりDSL、DEL、DSR、DERが得られる。ただし、DSL<0の場合は、DSL=0とし、DEL>55の場合は、DEL=55とし、DSR<56の場合は、DSR=56とし、DER>111の場合は、DER=111とする。
Therefore, for each of the L sensor 96 and the R sensor 94, the block numbers at the left end of the peak selection region are the peak selection start block numbers DSL and DSR, and the block numbers at the right end of the peak selection region are the peak selection end block numbers DEL and DER. ,
[Equation 4]
DSL = INT ((229−PEL) / 4) (4)
DEL = 55-INT ((PSL-6) / 4) (5)
DSR = 56 + INT ((229-PER) / 4) (6)
DER = 111-INT ((PSR-6) / 4) (7)
Thus, DSL, DEL, DSR, and DER are obtained. However, DSL = 0 if DSL <0, DEL = 55 if DEL> 55, DSR = 56 if DSR <56, and DER = 111 if DER> 111. .

ピーク選択領域は、Rセンサ94については、ブロック番号DSRからDERまでの範囲となり、Lセンサ96については、ブロック番号DSLからDELまでの範囲となるため、ピーク選択領域設定データD0〜D111は、それらの範囲において1に設定され、他の範囲で0に設定される。   The peak selection area is in the range from the block number DSR to DER for the R sensor 94, and the range from the block number DSL to DEL for the L sensor 96. Therefore, the peak selection area setting data D0 to D111 are Is set to 1 in this range, and is set to 0 in other ranges.

また、このとき、ピーク選択領域数をDPSとすると、ピーク選択領域数DPSは、次式、
[数5]
DPS=DEL−DSL+1+DER−DSR+1 …(8)
により得られる。ピーク選択領域数データD112〜D118は、DPSを二進数により表すことで得られる。
At this time, if the number of peak selection regions is DPS, the number of peak selection regions DPS is expressed by the following equation:
[Equation 5]
DPS = DEL-DSL + 1 + DER-DSR + 1 (8)
Is obtained. The peak selection area number data D112 to D118 are obtained by expressing DPS by binary numbers.

図24は、図13の各領域(1)〜(7)をピーク選択領域とする場合に、図22に示した数値例から上式(4)〜(8)により生成されるピーク選択領域設定データD0〜D111及びピーク選択領域数データD112〜D118を示した図である。例えば、領域(1)をピーク選択領域とする場合、ピーク選択開始アドレスPSR、PSLはそれぞれ46、48であり、ピーク選択終了アドレスPER、PELはそれぞれ187、189であるから、これらの数値を上式(4)〜(7)に代入すると、ピーク選択開始ブロック番号DSL、DSRは、それぞれ10、66となり、ピーク選択終了ブロック番号DEL、DERは、それぞれ45、101となる。従って、図24の領域(1)についてのピーク選択領域設定データD0〜D111に示すように、D0〜D9が0、D10〜D45が1、D46〜D55が0、D56〜D65が0、D66〜D101が1、D102〜D111が0となる。また、上式(8)により、領域(1)のピーク選択領域数は112となり、図24の領域(1)についてのピーク選択領域数データD112〜D118に示すように、各データ値は、順に1001000となる。   FIG. 24 shows peak selection region settings generated by the above equations (4) to (8) from the numerical example shown in FIG. 22 when each region (1) to (7) in FIG. 13 is a peak selection region. It is the figure which showed data D0-D111 and peak selection area number data D112-D118. For example, when the region (1) is a peak selection region, the peak selection start addresses PSR and PSL are 46 and 48, respectively, and the peak selection end addresses PER and PEL are 187 and 189, respectively. Substituting into the equations (4) to (7), the peak selection start block numbers DSL and DSR are 10 and 66, respectively, and the peak selection end block numbers DEL and DER are 45 and 101, respectively. Therefore, as shown in the peak selection region setting data D0 to D111 for the region (1) in FIG. 24, D0 to D9 is 0, D10 to D45 is 1, D46 to D55 is 0, D56 to D65 is 0, D66 to D101 is 1, and D102 to D111 are 0. Further, according to the above equation (8), the number of peak selection regions in the region (1) is 112, and as shown in the peak selection region number data D112 to D118 for the region (1) in FIG. 1001000.

以上のように各領域(1)〜(7)をピーク選択領域として設定する際に、ピーク選択領域設定データD0〜D111やピーク選択領域数データD112〜D118を、各分割エリアの範囲を示すアドレス情報を参照データとして生成するようにしているため、予め図24に示したような膨大なデータをメモリに登録しておく必要がなく、メモリを節約することができる。尚、上記実施の形態では、各分割エリアの範囲を示すアドレス情報として各分割エリアの右端のアドレスと採用センサ数を参照する場合について説明したが、各分割エリアの範囲を示すアドレス情報として各分割エリアの右端と左端のアドレスを参照データとしてピーク選択領域設定データD0〜D111やピーク選択領域数データD112〜D118を生成することもできる。また、各分割エリアの範囲を示すアドレス情報であれば、上記以外のアドレス情報であってもピーク選択領域設定データD0〜D111やピーク選択領域数データD112〜D118を生成することができる。   As described above, when the areas (1) to (7) are set as the peak selection areas, the peak selection area setting data D0 to D111 and the peak selection area number data D112 to D118 are addresses indicating the ranges of the divided areas. Since information is generated as reference data, it is not necessary to register a huge amount of data as shown in FIG. 24 in advance in the memory, and the memory can be saved. In the above-described embodiment, the case where the right end address of each divided area and the number of employed sensors are referred to as address information indicating the range of each divided area has been described. However, each divided area is referred to as address information indicating the range of each divided area. Peak selection region setting data D0 to D111 and peak selection region number data D112 to D118 can also be generated using the addresses at the right and left ends of the area as reference data. In addition, if the address information indicates the range of each divided area, the peak selection region setting data D0 to D111 and the peak selection region number data D112 to D118 can be generated even with address information other than the above.

次に、AFセンサ74から/AFEND信号が正常に出力されない場合における処理について説明する。例えば、図14のステップS52、ステップS56、ステップS58における各積分処理において、通常は、図17に示したように/AFRST信号が0から1に切り替わった後(時刻T40参照)、所定時間経過後(センサ感度が高感度の場合には150μs後、低感度の場合には30μs後)に積分が開始されて/AFEND信号が1から0に切り替わる(時刻T50参照)。そして、ピーク選択領域内のセンサデータのピーク値が積分終了値に達すると、/AFEND信号が0から1に切り替わる(時刻T60参照)。CPU60はこの/AFEND信号の0から1への切り替わりを積分終了信号として検知し、積分終了を認識する。   Next, processing when the / AFEND signal is not normally output from the AF sensor 74 will be described. For example, in each integration process in step S52, step S56, and step S58 in FIG. 14, normally, as shown in FIG. 17, after the / AFRST signal is switched from 0 to 1 (see time T40), a predetermined time has elapsed. The integration is started after 150 μs when the sensor sensitivity is high and after 30 μs when the sensor sensitivity is low, and the / AFEND signal is switched from 1 to 0 (see time T50). When the peak value of the sensor data in the peak selection region reaches the integration end value, the / AFEND signal is switched from 0 to 1 (see time T60). The CPU 60 detects the change of the / AFEND signal from 0 to 1 as an integration end signal, and recognizes the end of integration.

これに対して、被写体輝度が低い場合や、被写体輝度が一定輝度を超えている場合、又は、/AFEND信号の接続エラーの場合には、最大許容積分時間が経過しても/AFEND信号が正常に出力されない場合がある。   On the other hand, if the subject brightness is low, if the subject brightness exceeds a certain brightness, or if a connection error of the / AFEND signal occurs, the / AFEND signal is normal even if the maximum allowable integration time has elapsed. May not be output.

被写体輝度が低い場合に/AFEND信号が正常に出力されない(/AFEND信号が0から1へ切り替わらない)のは、センサデータのピーク値が積分終了値に達しないためである。例えば、被写体が明るい場合には、図26(A)に示すように/AFEND信号が1から0に切り替わった後(積分処理が開始された後)、最大許容積分時間が経過する前に、ピーク選択領域におけるセンサデータのピーク値が積分終了値に達するため(同図MDATA信号参照)、/AFEND信号が0から1に切り替わる(積分終了信号が出力される)。これに対して、被写体が暗い場合には、図26(C)に示すように/AFEND信号が1から0に切り替わった後、最大許容積分時間が経過する前に、ピーク選択領域におけるセンサデータのピーク値が積分終了値に達しないため(同図MDATA信号参照)、最大許容積分時間が経過するまでに/AFEND信号は0から1に切り替わらず、積分終了信号は出力されない。尚、最大許容積分時間に達するとCPU60からAFセンサ74に強制的に積分処理を終了させる信号(図26(B)のAFAD=“L”にする)が与えられるため、その信号により最大許容積分時間経過時に積分処理が終了し、/AFEND信号が0から1に切り替わる。   The reason why the / AFEND signal is not normally output when the subject brightness is low (the / AFEND signal does not switch from 0 to 1) is that the peak value of the sensor data does not reach the integration end value. For example, when the subject is bright, as shown in FIG. 26 (A), after the / AFEND signal is switched from 1 to 0 (after the integration process is started), the peak is reached before the maximum allowable integration time elapses. Since the peak value of the sensor data in the selected area reaches the integration end value (see the MDATA signal in the figure), the / AFEND signal is switched from 0 to 1 (an integration end signal is output). On the other hand, when the subject is dark, as shown in FIG. 26C, after the / AFEND signal is switched from 1 to 0 and before the maximum allowable integration time elapses, Since the peak value does not reach the integration end value (see the MDATA signal in the figure), the / AFEND signal is not switched from 0 to 1 until the maximum allowable integration time elapses, and the integration end signal is not output. When the maximum allowable integration time is reached, the CPU 60 gives a signal for forcibly terminating the integration process to the AF sensor 74 (AFAD = “L” in FIG. 26B). When the time elapses, the integration process ends, and the / AFEND signal switches from 0 to 1.

一方、被写体輝度が一定輝度を超えている場合に/AFEND信号が正常に出力されない(/AFEND信号が1から0へ切り替わらない、及び、/AFEND信号が0から1へ切り替わらない)のは、AFセンサ74の特性上の問題である。即ち、正常に積分処理が行われ、センサデータのピーク値が積分終了値に達していても被写体輝度が極めて高い場合にはAFセンサ74の特性上、/AFEND信号が正常に出力されない場合があり、例えば、/AFEND信号が次のような出力形態となることがある(特に、図14ステップS32のゲイン高感度積分時に生じやすい)。被写体輝度がある一定輝度を超えた場合、図25に示すように/AFRST信号が0から1に切り替わってから所定時間経過後の積分開始時に本来0に切り替わるべき/AFEND信号が0に切り替わらなくなる(同図(A)の場合)。この場合には当然に積分処理の終了時においても/AFEND信号は0から1に切り替わることがなく積分終了信号は出力されない。一方、これよりも被写体輝度が高くなると、/AFEND信号が正常に出力されるようになるが(同図(B)の場合)、積分時間が極めて短いために/AFEND信号の1から0への切替わり及び0から1への切替わりを正常に認識できない場合がある。更に被写体輝度が高くなりセンサの動作限界を超えると、/AFEND信号が1から0に切り替わったまま積分が終了しても1に切り替わらなくなり(同図(C)の場合)、この場合も積分終了信号が出力されない。   On the other hand, when the subject luminance exceeds a certain luminance, the / AFEND signal is not normally output (the / AFEND signal does not switch from 1 to 0, and the / AFEND signal does not switch from 0 to 1). This is a problem on the characteristics of the sensor 74. That is, if the integration process is normally performed and the peak value of the sensor data reaches the integration end value, and the subject brightness is extremely high, the / AFEND signal may not be output normally due to the characteristics of the AF sensor 74. For example, the / AFEND signal may have the following output form (particularly, it is likely to occur during gain high-sensitivity integration in step S32 in FIG. 14). When the subject luminance exceeds a certain luminance, as shown in FIG. 25, the / AFEND signal should not be switched to 0 at the start of integration after a predetermined time has elapsed since the / AFRST signal was switched from 0 to 1. In the case of FIG. In this case, as a matter of course, the / AFEND signal does not switch from 0 to 1 even at the end of the integration process, and the integration end signal is not output. On the other hand, if the subject brightness is higher than this, the / AFEND signal is normally output (in the case of FIG. 5B), but the integration time is extremely short, so the / AFEND signal is changed from 1 to 0. There are cases where switching and switching from 0 to 1 cannot be recognized normally. If the subject brightness further increases and the sensor operation limit is exceeded, even if the integration is completed while the / AFEND signal is switched from 1 to 0, it will not be switched to 1 (in the case of (C) in the figure). No signal is output.

このように被写体輝度が一定輝度を超えると(特に感度高で積分を実行した場合(S52))、輝度が高くなるに従って、
(a) /AFEND信号が1から0に切り替わらない場合。
(b) /AFEND信号が1から0に切り替わった後、/AFEND信号が0から1へとの切り替わりが非常に短い場合。
(c) /AFDEN信号が1から0となるが、その後/AFEND信号が0から1へと切り替わらない場合。
の3通り、/AFEND信号が正常に出力されない場合がある。
Thus, when the subject brightness exceeds a certain brightness (particularly when integration is executed with high sensitivity (S52)), as the brightness increases,
(a) The / AFEND signal does not switch from 1 to 0.
(b) The / AFEND signal switches from 0 to 1 after the / AFEND signal switches from 1 to 0.
(c) The / AFDEN signal changes from 1 to 0, but the / AFEND signal does not change from 0 to 1 thereafter.
In some cases, the / AFEND signal may not be output normally.

/AFEND信号が1から0に切り替わらない場合は、ある一定輝度を超えた場合(この場合は/AFEND信号の接続エラーの場合も考えられる)と想定し、後に示すMDATAにより、実際にある一定輝度を超えていたかを判断する。   When the / AFEND signal does not switch from 1 to 0, it is assumed that the luminance exceeds a certain luminance (in this case, a connection error of the / AFEND signal may be considered), and a certain luminance is actually obtained by MDATA described later. Judge whether it was over.

また、ある一定輝度よりも被写体輝度が高くなり、/AFEND信号が1から0に切り替わった後、/AFEND信号が0から1へとの切り替わりが非常に短く、CPUに於いて正常に/AFEND信号を認識できない場合も、CPU側から見ると上記の/AFEND信号が1から0に切り替わらないと認識するため、ある一定輝度を超えた場合と推定し、後に示すMDATAにより、実際にある一定輝度を超えていたかを判断する。   Also, after the subject brightness becomes higher than a certain brightness and the / AFEND signal is switched from 1 to 0, the / AFEND signal is switched from 0 to 1 very quickly, and the / AFEND signal is normal in the CPU. Even if it cannot be recognized, it is assumed that the above-mentioned / AFEND signal does not switch from 1 to 0 when viewed from the CPU side. Therefore, it is estimated that the signal exceeds a certain luminance. Determine if it was over.

更に被写体輝度が高くなり、/AFEND信号が1から0となり、その後/AFEND信号が0から1へと切り替わらない場合は被写体輝度が低い場合で丁度最大許容積分時間で積分が終了した場合と、超高輝度の場合で/AFEND信号が0から1へと切り替わらない場合との判断ができなくなる(センサピーク(後に示すMDATAの値)が共に最小値のため)。   If the subject brightness further increases, the / AFEND signal changes from 1 to 0, and then the / AFEND signal does not switch from 0 to 1, then the subject brightness is low and the integration has just finished at the maximum allowable integration time. In the case of high luminance, it is impossible to determine whether the / AFEND signal does not switch from 0 to 1 (because both the sensor peak (MDATA value shown later) is the minimum value).

そこで、図14のステップS50において測距対象物が測光センサにより超高輝度と判定された場合は、図14のステップS52(感度高積分)を実施せず、ステップS56の3分割ゲイン低積分を実施し上記誤判断を防ぐこととしている。   Therefore, if it is determined in step S50 in FIG. 14 that the object to be measured is extremely bright by the photometric sensor, step S52 (high sensitivity integration) in FIG. 14 is not performed, and the three-division gain low integration in step S56 is performed. It will be implemented to prevent the above misjudgment.

ところで、回路の不具合により/AFEND信号が1から0に切り替わらない場合も想定される。   Incidentally, there may be a case where the / AFEND signal does not switch from 1 to 0 due to a circuit failure.

ここで、
(a)/AFEND信号のみの接続エラーの場合(正常に積分は実施されるが、積分開始及び積分終了が判断できない場合)
及び
(b)回路の積分動作エラーの場合(/AFEND信号以外の接続エラーであり、VCC、GND、/AFCEN、/AFRST、AFCLKのいずれかの接続エラーにより積分が実施されない場合、及び、AFセンサ破損等により積分が実施されない場合)
が考えられる。
here,
(A) In the case of a connection error with only the / AFEND signal (when integration is normally performed but integration start and integration end cannot be determined)
And (b) In the case of an integration operation error of the circuit (a connection error other than the / AFEND signal, and integration is not performed due to any connection error of V CC , GND, / AFCEN, / AFRST, AFCLK, and AF (If integration is not performed due to sensor damage, etc.)
Can be considered.

/AFEND信号の接続エラーの場合も、/AFEND信号が1から0に切り替わらず、/AFEND信号が正常に出力されない。このため、/AFEND信号が1から0に切り替わらない場合には、上述のように被写体輝度が一定輝度を超えている場合を想定するだけでなく、/AFEND信号の接続エラーの場合も想定する。そして、後に示すMDATAによりセンサデータが積分終了条件を満たすか否かを判断する。/AFEND信号の接続エラーの場合で、MDATAの値が、図26(B)のMC_JDG以上(ほぼ初期値(VREF))となる場合(被写体輝度が極端に低く信号蓄積がほとんど行われていない場合)は、測距不能と判断する。   Also in the case of a connection error of the / AFEND signal, the / AFEND signal is not switched from 1 to 0, and the / AFEND signal is not normally output. For this reason, when the / AFEND signal does not switch from 1 to 0, not only the case where the subject luminance exceeds a certain luminance as described above, but also the case where a connection error of the / AFEND signal is assumed. And it is judged by MDATA shown later whether sensor data satisfy | fills integration completion conditions. / AFEND signal connection error and MDATA value is equal to or greater than MC_JDG (almost initial value (VREF)) in FIG. 26B (subject luminance is extremely low and signal accumulation is hardly performed. ) Is determined to be impossible.

また、/AFEND信号の接続エラーの場合で、MDATAの値が、図26(B)のMC_JDG未満の場合(被写体輝度が極端に低くなく、ある程度信号蓄積が行われている場合)は、測距を継続する。   Also, in the case of a connection error of the / AFEND signal, if the value of MDATA is less than MC_JDG in FIG. 26B (when the subject brightness is not extremely low and signal accumulation is performed to some extent), distance measurement Continue.

また、回路の積分動作エラーの場合も、/AFEND信号が1から0に切り替わらず、/AFEND信号が正常に出力されない。このため、/AFEND信号が1から0に切り替わらない場合には、上述のように被写体輝度が一定輝度を超えている場合を想定するだけでなく、回路の積分動作エラーの場合も想定する。そして、後に示すMDATAによりセンサデータが積分終了条件を満たすか否かを判断する。回路の積分動作エラーの場合は、MDATAの値が、ほぼ初期値(VREF)となる(積分が実施されていない)。この場合は、測距不能と判断する。   Also in the case of an integration operation error of the circuit, the / AFEND signal is not switched from 1 to 0, and the / AFEND signal is not normally output. Therefore, when the / AFEND signal does not switch from 1 to 0, not only the case where the subject luminance exceeds a certain luminance as described above, but also the case where an integration operation error of the circuit is assumed. And it is judged by MDATA shown later whether sensor data satisfy | fills integration completion conditions. In the case of an integration operation error of the circuit, the value of MDATA is almost the initial value (VREF) (integration is not performed). In this case, it is determined that distance measurement is impossible.

一方、被写体輝度がある一定輝度を超えていることに起因する場合にはMDATAの値が、約0.6Vとなり(積分が終了している)、この場合は、測距を継続する。   On the other hand, if the subject luminance exceeds a certain luminance, the value of MDATA is about 0.6 V (integration is completed), and in this case, distance measurement is continued.

尚、表現上、被写体輝度が低いためにセンサデータが信号量不足となるような場合も積分処理が正常に行われていない場合の範疇に属するものとする。また、信号量不足のため測距不能と判断するのは、実際には、積分処理の開始からセンサデータのピーク値に全く変化が生じなかった場合か、又は、極めて少ない変化しか生じなかった場合であり、それ以外では測距可能な場合もあるため積分処理は正常に行われていると判断し、測距不能とは判断しないものとしている。   For the sake of expression, it is assumed that the case where the sensor data becomes insufficient in signal amount due to low subject luminance belongs to the category where the integration processing is not normally performed. Also, it is judged that distance measurement is impossible due to insufficient signal amount when the peak value of sensor data has not changed at all since the start of integration processing or when there has been very little change. In other cases, it may be possible to measure the distance, so that it is determined that the integration process is normally performed, and it is not determined that the distance measurement is impossible.

以上のように、積分時間が一定時間を経過しても/AFEND信号から積分開始信号又は積分終了信号が正常に出力されない場合には、積分処理が正常に行われているか否かをMDATA信号により判定することとする。MDATA信号はピーク選択領域におけるセンサデータのピーク値をアナログデータとして出力するものであるから、積分処理が行われていれば、図25に示すように/AFEND信号が正常に出力されていなくてもMDATA信号からピーク選択領域におけるセンサデータのピーク値が正常に出力され、積分処理が正常に行われているか否が容易に判断できる。   As described above, if the integration start signal or the integration end signal is not normally output from the AFEND signal even if the integration time has passed a fixed time, whether or not the integration processing is normally performed is determined by the MDATA signal. Judgment is made. Since the MDATA signal outputs the peak value of the sensor data in the peak selection region as analog data, as long as integration processing is performed, the / AFEND signal may not be output normally as shown in FIG. The peak value of the sensor data in the peak selection region is normally output from the MDATA signal, and it can be easily determined whether the integration process is normally performed.

CPU60の処理内容を具体的に説明すると、図14のステップS52における一括ゲイン高積分の実行時において、CPU60は、/AFRST信号を0から1に切り替えた後(図17時刻T40参照)、一定時間(例えば500μs)経過するまでに、AFセンサ74から積分開始を示す/AFEND信号の1から0への切り替わりを検出しなかった場合には、MDATA信号を読み取る。そして、そのMDATA信号の値が積分終了値に達していれば、/AFEND信号の1から0への切り替わりが検出されなかった理由が被写体輝度が高輝度(超高輝度)であることに起因するものと判断して、積分時間が2ms未満であった場合と同様に3分割ゲイン低積分の処理(図14ステップS54、S56参照)に移行する。一方、MDATA信号の値が所定値以上の場合、即ち、積分開始時の値から全く変化していない場合(上記基準電圧VREFの値の場合)、又は、全く変化がないのと同等とみなせる値の場合には、回路の積分動作エラーとして測距不能とする。上述以外の場合には通常通り積分処理を継続する。この後の処理は、図14のフローチャートで説明したので省略する。   The processing contents of the CPU 60 will be specifically described. At the time of executing the collective gain high integration in step S52 of FIG. 14, the CPU 60 switches the / AFRST signal from 0 to 1 (see time T40 in FIG. 17), and then for a predetermined time. If the switch from AF sensor 74 indicating the start of integration / switching of AFEND signal from 1 to 0 is not detected by the time (for example, 500 μs), MDATA signal is read. If the value of the MDATA signal has reached the integration end value, the reason why the / AFEND signal has not been switched from 1 to 0 is that the subject brightness is high (super high brightness). In the same manner as in the case where the integration time is less than 2 ms, the process proceeds to the 3-division gain low integration process (see steps S54 and S56 in FIG. 14). On the other hand, when the value of the MDATA signal is equal to or greater than the predetermined value, that is, when there is no change from the value at the start of integration (in the case of the value of the reference voltage VREF), or a value that can be regarded as equivalent to no change at all. In this case, distance measurement is impossible as an integration operation error of the circuit. In cases other than the above, the integration process is continued as usual. Since the subsequent processing has been described with reference to the flowchart of FIG.

図14のステップS56における3分割ゲイン低積分の実行時において(図15のステップS84、S94、S102、S110、S118の各積分処理の実行時において)、上述と同様にCPU60は、/AFRST信号を0から1に切り替えた後、一定時間(例えば500μs)経過するまでに、AFセンサ74から積分開始を示す/AFEND信号の1から0への切り替わりを検出しなかった場合には、MDATA信号を読み取る。このときMDATA信号の値が所定値(図26(B)のMC_JDG)以上の場合、即ち、積分開始時の値から全く変化していない場合(上記基準電圧VREFの値の場合)、又は、全く変化がないのと同等とみなせる値の場合には、そのときの積分処理におけるピーク選択領域を構成する分割エリアについて測距不能とする(回路の積分動作エラー)。一方、前記一定時間が経過するまでに、AFセンサ74から積分開始を示す/AFEND信号の1から0への切り替わりを検出した場合には、最大許容積分時間を限度として積分処理を継続する。もし、最大許容積分時間が経過するまでにAFセンサ74から積分終了を示す/AFEND信号の0から1への切り替わりを検出しなかった場合には、最大許容積分時間に達した時点でMDATA信号を読み取る。このときMDATA信号の値が所定値(図26(B)のMC_JDG)以上の場合、即ち、積分開始時の値から全く変化していない場合(上記基準電圧VREFの値の場合)、又は、全く変化がないのと同等とみなせる値の場合には、そのときの積分処理におけるピーク選択領域を構成する分割エリアについてセンサデータの信号量不足として測距不能とする(センサデータを無効とする)。これ以外の場合は、正常に積分処理が行われたと判定し、それまでCPU60に蓄積されたセンサデータを有効として、その時点におけるセンサデータの読み出しを行う。尚、最大許容積分時間が経過してもMDATA信号の値が積分終了値に達していない場合には積分処理が継続しているため、CPU60は、強制的にAFセンサ74の積分処理を停止させてから(AFAD信号を1から0に切り替えてから)、センサデータの読出しを行う。   When executing the three-division gain low integration in step S56 of FIG. 14 (when executing the integration processes of steps S84, S94, S102, S110, and S118 of FIG. 15), the CPU 60 outputs the / AFRST signal in the same manner as described above. After switching from 0 to 1, when a certain time (for example, 500 μs) elapses, the MDATA signal is read when the AF sensor 74 detects the start of integration / switching of AFEND signal from 1 to 0 is not detected. . At this time, when the value of the MDATA signal is greater than or equal to a predetermined value (MC_JDG in FIG. 26B), that is, when there is no change from the value at the start of integration (in the case of the value of the reference voltage VREF), or at all In the case of a value that can be regarded as equivalent to no change, distance measurement is disabled for the divided areas constituting the peak selection region in the integration process at that time (circuit integration operation error). On the other hand, when the AF sensor 74 detects the start of integration / switching of the AFEND signal from 1 to 0 before the fixed time elapses, the integration process is continued up to the maximum allowable integration time. If the AF sensor 74 indicates the end of integration / no change of the AFEND signal from 0 to 1 is detected before the maximum allowable integration time elapses, the MDATA signal is output when the maximum allowable integration time is reached. read. At this time, when the value of the MDATA signal is greater than or equal to a predetermined value (MC_JDG in FIG. 26B), that is, when there is no change from the value at the start of integration (in the case of the value of the reference voltage VREF), or at all In the case of a value that can be regarded as equivalent to no change, distance measurement is disabled (sensor data is invalidated) for the divided areas that constitute the peak selection region in the integration process at that time because the signal amount of sensor data is insufficient. In other cases, it is determined that the integration process has been normally performed, the sensor data accumulated until then is validated, and the sensor data at that time is read out. If the value of the MDATA signal does not reach the integration end value even after the maximum allowable integration time has elapsed, the integration process continues, so the CPU 60 forcibly stops the integration process of the AF sensor 74. (After switching the AFAD signal from 1 to 0), the sensor data is read out.

図14のステップS58における一括ゲイン低積分の実行時において、上述と同様にCPU60は、/AFRST信号を0から1に切り替えた後、一定時間 (例えば500μs)経過するまでに、AFセンサ74から積分終了を示す/AFEND信号の0から1への切り替わりを検出しなかった場合には、MDATA信号を読み取る。このとき、MDATA信号の値が所定値以上の場合、即ち、積分開始時の値から全く変化していない場合(上記基準電圧VREFの値の場合)、又は、全く変化がないのと同等とみなせる値の場合には、測距不能と判定する(回路の積分動作エラー)。尚、一括ゲイン低積分ではピーク選択領域は測距エリア全域に設定されているため、測距エリアを構成する全ての分割エリアにおいて測距不能(測距自体が不能)となる。一方、前記一定時間が経過するまでに、AFセンサ74から積分開始を示す/AFEND信号の1から0への切り替わりを検出した場合には、最大許容積分時間を限度として積分処理を継続する。もし、最大許容積分時間が経過するまでにAFセンサ74から積分終了を示す/AFEND信号の0から1への切り替わりを検出しなかった場合には、最大許容積分時間に達した時点でMDATA信号を読み取る。このときMDATA信号の値が所定値以上の場合、即ち、積分開始時の値から全く変化していない場合(上記基準電圧VREFの値の場合)、又は、全く変化がないのと同等とみなせる値の場合には、センサデータの信号量不足として測距不能とする(センサデータを無効とする)。これ以外の場合は、正常に積分処理が行われたと判定し、それまでCPU60に蓄積されたセンサデータを有効として、その時点におけるセンサデータの読み出しを行う。尚、この場合も上述と同様に最大許容積分時間が経過してもMDATA信号の値が積分終了値に達していない場合には積分処理が継続しているため、CPU60は、強制的にAFセンサ74の積分処理を停止させてから(AFAD信号を1から0に切り替えてから)、センサデータの読出しを行う。   When executing the collective gain low integration in step S58 in FIG. 14, the CPU 60 integrates from the AF sensor 74 after a certain time (for example, 500 μs) has elapsed after switching the / AFRST signal from 0 to 1, as described above. If the change of the AFEND signal indicating the end from 0 to 1 is not detected, the MDATA signal is read. At this time, when the value of the MDATA signal is greater than or equal to a predetermined value, that is, when there is no change from the value at the start of integration (in the case of the value of the reference voltage VREF), it can be regarded as equivalent to no change. In the case of a value, it is determined that distance measurement is impossible (circuit integration operation error). In the collective gain low integration, since the peak selection region is set in the entire distance measurement area, distance measurement is impossible in all the divided areas constituting the distance measurement area (range measurement itself is impossible). On the other hand, when the AF sensor 74 detects the start of integration / switching of the AFEND signal from 1 to 0 before the fixed time elapses, the integration process is continued up to the maximum allowable integration time. If the AF sensor 74 indicates the end of integration / no change of the AFEND signal from 0 to 1 is detected before the maximum allowable integration time elapses, the MDATA signal is output when the maximum allowable integration time is reached. read. At this time, when the value of the MDATA signal is equal to or greater than a predetermined value, that is, when there is no change from the value at the start of integration (in the case of the value of the reference voltage VREF), or a value that can be regarded as equivalent to no change at all. In this case, the distance measurement is impossible because the signal amount of sensor data is insufficient (sensor data is invalidated). In other cases, it is determined that the integration process has been normally performed, the sensor data accumulated until then is validated, and the sensor data at that time is read out. In this case as well, as described above, if the value of the MDATA signal does not reach the integration end value even after the maximum allowable integration time has elapsed, the integration process continues, so the CPU 60 forces the AF sensor. After the integration process 74 is stopped (after the AFAD signal is switched from 1 to 0), the sensor data is read out.

次に、CPU60によるセンサデータの読出し処理について説明する。図17のタイミングチャートに示したように、CPU60は、例えば、AFセンサ74から送信される/AFEND信号が0から1に切り替えられ、積分が終了したことを検出すると、AFセンサ74に対してAFCLK信号によりクロックパルスを送信し、センサデータの読出しを開始する。AFセンサ74からは、クロックパルスに同期して各セルごとのセンサデータがアナログデータとして順次AFDATAP信号により出力され、A/D変換された後、CPU60に入力される。   Next, sensor data reading processing by the CPU 60 will be described. As shown in the timing chart of FIG. 17, for example, when the CPU 60 detects that the / AFEND signal transmitted from the AF sensor 74 is switched from 0 to 1 and integration is completed, the AFCLK signal is sent to the AF sensor 74. A clock pulse is transmitted by the signal, and reading of the sensor data is started. From the AF sensor 74, sensor data for each cell is sequentially output as analog data by the AFDATAP signal in synchronization with the clock pulse, and after A / D conversion, is input to the CPU 60.

具体的には、AFDATAP信号によりLセンサ96とRセンサ94の各セルのセンサデータが交互にセンサ番号1からセンサ番号234まで順に出力されCPU60のA/D変換回路により読み出される。尚、Lセンサ96とRセンサ94のすべてのセルのセンサデータが送信された後、数個のダミーデータが送信される。   Specifically, the sensor data of each cell of the L sensor 96 and the R sensor 94 is alternately output in order from the sensor number 1 to the sensor number 234 by the AFDATAP signal, and is read by the A / D conversion circuit of the CPU 60. In addition, after the sensor data of all the cells of the L sensor 96 and the R sensor 94 are transmitted, several pieces of dummy data are transmitted.

ここで、クロックパルスによるセンサデータの読出し速度について説明する。上述のようにあるピーク選択領域をAFセンサ74に対して設定して上記積分処理を実行させた場合に、その積分処理によってAFセンサ74で蓄積された各セルのセンサデータのうち、CPU60が以後の測距演算の処理において実際に使用するセンサデータは、1又は複数の分割エリアにより構成されるピーク選択領域の範囲内における各セルのセンサデータに限られ、それ以外の範囲における各セルのセンサデータは不要である。また、上述のようにピーク選択領域の範囲内であっても、AFセンサ74に対するピーク選択領域の設定は、隣接する4つのセルを1ブロックとしたブロック単位(上記ブロック番号D0、D1、…、D55、ブロック番号D56、D57、…、D111についての記載事項参照)で行われるため、実際には、ピーク選択領域の両端のブロック内においてもセンサデータを取得する必要のないセルが存在する。更に、本実施の形態では、必要なセンサデータはピーク選択領域内に限られるが、測距演算の態様によってはピーク選択領域内に限らず、ピーク選択領域外のセルのセンサデータも必要な場合がある。そこで、CPU60の以後の処理において必要なセンサデータを生成するセルの範囲をデータ取得範囲といい、CPU60の以後の処理において不要なセンサデータを生成するセルの範囲をデータ非取得範囲というものとすると、CPU60は、一定周期のクロックパルスを出力するのではなく、図27に示すようにデータ取得範囲のセルのセンサデータを搬送する期間T2のクロック周期よりも、データ非取得範囲のセルのセンサデータを搬送する期間T1のクロック周期を短くし、不要なセンサデータの読出し時間を短縮している。   Here, the reading speed of the sensor data by the clock pulse will be described. As described above, when a certain peak selection region is set for the AF sensor 74 and the integration process is executed, the CPU 60 subsequently executes sensor data of each cell accumulated in the AF sensor 74 by the integration process. The sensor data actually used in the distance measurement calculation process is limited to the sensor data of each cell within the range of the peak selection region constituted by one or a plurality of divided areas, and the sensor of each cell in the other range No data is required. In addition, even within the range of the peak selection area as described above, the peak selection area setting for the AF sensor 74 is performed in block units (block numbers D0, D1,... D55, block numbers D56, D57,..., D111)). Actually, there is a cell that does not need to acquire sensor data even in the blocks at both ends of the peak selection region. Furthermore, in the present embodiment, the necessary sensor data is limited to the peak selection area, but depending on the mode of distance measurement, not only the peak selection area but also the sensor data of cells outside the peak selection area is necessary. There is. Therefore, a cell range that generates sensor data necessary for the subsequent processing of the CPU 60 is referred to as a data acquisition range, and a cell range that generates unnecessary sensor data in the subsequent processing of the CPU 60 is referred to as a data non-acquisition range. , The CPU 60 does not output a clock pulse with a fixed period, but as shown in FIG. 27, the sensor data of the cells in the data non-acquisition range than the clock period of the period T2 for carrying the sensor data of the cells in the data acquisition range as shown in FIG. The clock period of the period T1 for conveying the data is shortened, and the reading time of unnecessary sensor data is shortened.

例えば、データ取得範囲のセルのセンサデータを搬送する際、AFDATAP信号の安定期間の周期(“H”)を16μs、A/D変換を実施する期間の周期を18μs(“L”)とすると、データ非取得範囲のセルのセンサデータを搬送する際はクロック周期を(“H”)2μs、(“L”)2μsとしている。(“H”)16μs、(“L”)18μs周期のクロックパルスでは、各セルのセンサデータの値をA/D変換回路により適切に取得することができるが、2μs周期のクロックパルスでは、各セルのセンサデータの値を適切に取得することができない可能性がある。しかしながら、データ非取得範囲のセンサデータは不要であるため、データ非取得範囲のセンサデータを(“H”)2μs、(“L”)2μs周期のクロックパルスで搬送することに不具合は生じない。   For example, when transporting sensor data of cells in the data acquisition range, if the period (“H”) of the AFDATAP signal is 16 μs and the period of the A / D conversion period is 18 μs (“L”), When the sensor data of cells in the data non-acquisition range is conveyed, the clock cycle is set to (“H”) 2 μs and (“L”) 2 μs. With a clock pulse having a period of (“H”) 16 μs and (“L”) 18 μs, the sensor data value of each cell can be appropriately acquired by the A / D conversion circuit. There is a possibility that the value of the sensor data of the cell cannot be acquired appropriately. However, since sensor data in the data non-acquisition range is unnecessary, there is no problem in transporting the sensor data in the data non-acquisition range with clock pulses having a cycle of (“H”) 2 μs and (“L”) 2 μs.

また、図27に示すようにデータ取得範囲の全てのセンサデータの搬送が終了した場合には、データ非取得範囲のセンサデータの搬送が残っているときでも、AFCLK信号(クロックパルス)の出力を停止させ、データ取得範囲後のデータ非取得範囲のセンサデータの読み出しを実施しないようにすることで、更に、センサデータの読出し時間を短縮することができる。   Further, as shown in FIG. 27, when the transfer of all the sensor data in the data acquisition range is completed, the AFCLK signal (clock pulse) is output even when the transfer of the sensor data in the non-data acquisition range remains. By stopping and not reading the sensor data in the non-data acquisition range after the data acquisition range, it is possible to further shorten the sensor data read time.

尚、データ非取得範囲のセンサデータの搬送からデータ取得範囲のセンサデータの搬送に移行する場合には、クロックパルスの安定等を考慮してデータ取得範囲ののセンサデータの搬送を開始する1つ前のセルからクロック周期を(“H”)16μs、(“L”)18μsに切り替えるようにしている。但し、このようにデータ取得範囲のセンサデータの搬送時におけるクロック周期への移行を、データ取得範囲のセンサデータの搬送を開始する1つ前のセルから行うのではなく、データ取得範囲のセンサデータの搬送を開始するのと同時に行うようにしてもよいし、また、2つ以上前のセルから行うようにしてもよい。   In the case of shifting from the transport of sensor data in the data non-acquisition range to the transport of sensor data in the data capture range, one of the start of transport of sensor data in the data capture range is considered in consideration of clock pulse stability and the like. The clock cycle is switched to (“H”) 16 μs and (“L”) 18 μs from the previous cell. However, the shift to the clock cycle during the transfer of the sensor data in the data acquisition range is not performed from the cell immediately before the start of the transfer of the sensor data in the data acquisition range, but the sensor data in the data acquisition range. It may be performed simultaneously with the start of the transfer of the above, or may be performed from two or more previous cells.

次に、センサデータからAFデータを生成する処理について説明する。上述のようにAFセンサ74の受光セルより出力されるデータをセンサデータとすると、AFセンサ74から出力された各センサデータをA/D変換回路により取得し、取得したセンサデータのA/D変換値そのものをCPU60における以後の各処理で使用するAFデータとする場合と、測距精度向上のためセンサデータに所定の処理を施したものをAFデータとする場合とが考えられる。前者の場合にはCPU60においてAFデータを生成するための特別の処理を行う必要はなく、センサデータの取得処理がAFデータの取得処理となるが、後者の場合にはセンサデータの取得後、CPU60においてAFデータを生成するための特別の処理が行われることになる。後者の場合の例として、センサデータにコントラスト抽出処理を施したものを以後の各処理で使用するAFデータとすることができ、以下、センサデータにコントラスト抽出処理を施してAFデータを生成する場合の処理について説明する。   Next, a process for generating AF data from sensor data will be described. As described above, when the data output from the light receiving cell of the AF sensor 74 is sensor data, each sensor data output from the AF sensor 74 is acquired by an A / D conversion circuit, and A / D conversion of the acquired sensor data is performed. A case where the value itself is used as AF data to be used in each subsequent process in the CPU 60, and a case where sensor data is subjected to a predetermined process for improving the distance measurement accuracy are considered as AF data. In the former case, it is not necessary to perform a special process for generating AF data in the CPU 60, and the sensor data acquisition process is the AF data acquisition process. In the latter case, after the sensor data is acquired, the CPU 60 Special processing for generating AF data is performed in step S2. As an example of the latter case, the sensor data subjected to contrast extraction processing can be used as AF data to be used in the subsequent processing. Hereinafter, the sensor data is subjected to contrast extraction processing to generate AF data. The process will be described.

コントラスト抽出処理は、例えば、あるセンサ番号(アドレスi)のセルに着目したときに、その着目したセルのセンサデータと、着目したセルに対してmセル分(m画素分)離間したセンサ番号(i+m)のセルのセンサデータとの差分(又は比)を算出する演算処理である。言い換えると、Rセンサ94とLセンサ96から得たセンサデータのそれぞれについて、センサデータとそのセンサデータをm画素分シフトしたものとの差分を算出する処理である。即ち、Rセンサ94におけるセンサ番号(i)のセルのセンサデータをR(i)、Lセンサ96におけるセンサ番号(i)のセルのセンサデータをL(i)とすると、Rセンサ94のセンサデータに対しては、次式、
[数6]
R(i)−R(i+m) …(9)
の演算が行われ、Lセンサ96のセンサデータに対しては、次式、
[数7]
L(i)−L(i+m) …(10)
の演算が行われる。これによって得られた差分データはAFセンサ74の各セルによって撮像されたセンサ像のコントラストを示す。尚、本明細書では、2画素分のセンサデータの差分によりコントラストを示すデータを算出する演算処理を2画素差分演算という。
In contrast extraction processing, for example, when a cell of a certain sensor number (address i) is focused, the sensor data of the focused cell and a sensor number (m pixels) apart from the focused cell are extracted. i + m) is a calculation process for calculating a difference (or ratio) from the sensor data of the cell. In other words, for each of the sensor data obtained from the R sensor 94 and the L sensor 96, the difference between the sensor data and the sensor data shifted by m pixels is calculated. That is, if the sensor data of the cell of sensor number (i) in the R sensor 94 is R (i) and the sensor data of the cell of sensor number (i) in the L sensor 96 is L (i), the sensor data of the R sensor 94 Is given by
[Equation 6]
R (i) -R (i + m) (9)
For the sensor data of the L sensor 96, the following equation is given:
[Equation 7]
L (i) -L (i + m) (10)
Is calculated. The difference data thus obtained indicates the contrast of the sensor image captured by each cell of the AF sensor 74. In the present specification, an arithmetic process for calculating data indicating contrast based on a difference between sensor data for two pixels is referred to as a two-pixel difference calculation.

差分をとる2つのセンサデータの上記セル間隔mの値は、所望の設定値とすることができるが、以下の説明ではm=2とする。但し、AFセンサ74においてセンサ番号が偶数のセルで蓄積された電荷と奇数のセルで蓄積された電荷は、異なるチャンネルにより伝送され、処理されるため、上記差分データも同一チャンネル同士のセルのセンサデータから求めるのが好ましく、mの値としては偶数であることが望ましい。尚、上式(9)、(10)により求めたデータは、CPU60でAFセンサ74から取得したセンサデータの数に比べてm個分減少するが、予めm個分減少することを考慮して上記データ取得範囲を拡大しておくことによって必要なAFデータ数を確保することができる。   The value of the cell interval m of the two sensor data taking the difference can be a desired set value, but m = 2 in the following description. However, in the AF sensor 74, the charge accumulated in the cells with even sensor numbers and the charge accumulated in the odd cells are transmitted and processed by different channels. It is preferable to obtain from data, and it is desirable that the value of m is an even number. The data obtained by the above equations (9) and (10) is reduced by m compared to the number of sensor data acquired from the AF sensor 74 by the CPU 60, but considering that it is reduced by m in advance. The necessary number of AF data can be secured by expanding the data acquisition range.

従来においては、上式(9)、(10)により得られた差分データをAFデータとしているが本実施の形態では、その差分データに対して更に+255を加算する処理と、2で割る処理とを加えたものをAFデータとする。即ち、Rセンサ94のセンサ番号iに対応するAFデータをAFR(i)とし、Lセンサ96のセンサ番号iに対応するAFデータをAFL(i)とすると、m=2の場合、次式、
[数8]
AFR(i)=(255+R(i−1)−R(i+1))/2 …(11)
AFL(i)=(255+L(i−1)−L(i+1))/2 …(12)
により得られた値をAFデータとする。
Conventionally, the difference data obtained by the above formulas (9) and (10) is used as AF data, but in this embodiment, a process of adding +255 to the difference data and a process of dividing by 2 AF data is added. That is, when AF data corresponding to the sensor number i of the R sensor 94 is AFR (i) and AF data corresponding to the sensor number i of the L sensor 96 is AFL (i), when m = 2,
[Equation 8]
AFR (i) = (255 + R (i−1) −R (i + 1)) / 2 (11)
AFL (i) = (255 + L (i−1) −L (i + 1)) / 2 (12)
The value obtained by the above is AF data.

ここで、AFデータを単に上式(9)、(10)により得られた差分データとするのではなく、上式(11)、(12)としたのは、RAM使用量の増加と相関値演算等の演算時間の増加を抑止するためである。例えば、各セルのセンサデータは8ビットのデータとして得られるとする。この場合、センサデータR(i)、L(i)の値は図28(A)に示すように0〜+255の範囲にある。これに対して上式(9)、(10)により得られた差分データをAFデータとした場合(この場合を従来方式という)、図28(B)に示すようにAFデータの値は−255〜+255の範囲にあり、9ビットのデータとなる。RAMの使用及び演算においてはバイト単位で処理されるため、9ビットのデータは、16ビット(2バイト)のデータとして処理されることになる。   Here, the AF data is not simply the difference data obtained by the above equations (9) and (10), but the above equations (11) and (12) are used to increase the RAM usage and the correlation value. This is to prevent an increase in calculation time such as calculation. For example, it is assumed that sensor data of each cell is obtained as 8-bit data. In this case, the values of the sensor data R (i) and L (i) are in the range of 0 to +255 as shown in FIG. On the other hand, when the difference data obtained by the above equations (9) and (10) is used as AF data (this case is referred to as a conventional method), the value of the AF data is −255 as shown in FIG. It is in the range of ~ + 255 and becomes 9-bit data. Since the RAM is used and calculated in units of bytes, 9-bit data is processed as 16-bit (2 bytes) data.

一方、上式(11)、(12)により得られた差分データをAFデータとした場合には(この場合を新方式という)、図28(C)に示すようにAFデータの値は0〜+255の範囲にあり、8ビットのデータとなる。従って、RAMの使用及び演算においては1バイトのデータとして処理されることになる。図29(A)、(B)に、それぞれ同一のセンサデータに基づいて新方式により生成されたAFデータの値と、従来方式により生成されたAFデータの値とを例示しておく。   On the other hand, when the difference data obtained by the above equations (11) and (12) is used as AF data (this case is referred to as a new method), as shown in FIG. It is in the range of +255 and becomes 8-bit data. Therefore, in the use and calculation of the RAM, it is processed as 1-byte data. FIGS. 29A and 29B illustrate AF data values generated by the new method based on the same sensor data, and AF data values generated by the conventional method, respectively.

新方式のようにAFデータをセンサデータと同じビット数のデータとなるように生成することにより、RAM使用量が低減すると共に、相関値演算等の以後の各処理における処理時間が低減する。尚、上式(11)、(12)による新方式では、上式(9)、(10)による従来方式の差分演算結果を半分にしているため、測距精度の低下が考えられるが、実質的な不具合は生じないことを確認している。   By generating AF data so that it has the same number of bits as sensor data as in the new method, the RAM usage is reduced and the processing time in each subsequent process such as correlation value calculation is reduced. In addition, in the new method based on the above formulas (11) and (12), the difference calculation result of the conventional method based on the above formulas (9) and (10) is halved. It has been confirmed that there is no problem.

次に、上記新方式によりAFデータを生成する際の具体的処理内容について説明する。従来では、測距エリアの各セルのセンサデータがAFセンサから読み出されると、その読み出されたセンサデータはそのままRAMに格納される。そして、AFデータ(画像)を用いた相関値演算等の処理が開始されると、その処理の実行中においてRAMからAFデータ(画像)が読み出されて上式(9)、(10)の演算により必要な差分データが逐次生成されるようになっている。例えば、AFデータ(画像)が使用される相関値演算処理では、図12に示したようにRウインドウ94BとLウインドウ96Bとを1セルずつシフトさせながら、各シフト量n(採用センサ数62、ウインドウサイズ42の場合、n=−2,−1,0,1,…,MAX(=38))ごとに各ウインドウ範囲内のAFデータ(画像)により相関値が算出される。このため、同じセルのAFデータ(画像)が繰り返し使用されることになり、その都度、AFデータ(画像)がRAMから読み出され、2画素差分演算により差分データが生成されることになる。このように相関値演算の実行時(実行中)において差分データを生成する場合における各シフト量n(n=−2,−1,0,1,…,MAX(=38))ごとの相関値演算の処理手順を図30に示す。まず、i=1としてRAMからセンサデータL(i+1)とL(i−1)を読み出す(ステップS600、S602)。尚、ここで示すiは、上記Rウインドウ94B、Lウインドウ96Bにおけるセル位置iを示す。そして、上式(12)により、差分データAFL(i)=(255+L(i−1)−L(i+1))/2を算出する(ステップS604)。同様に、RAMからセンサデータR(i+1)とR(i−1)を読み出す(ステップS606、S608)。そして、上式(11)により、差分データAFR(i)=(255+R(i−1)−R(i+1))/2を算出する(ステップS610)。次に、相関値f(n)を求めるための上式(1)における右辺の|L(i)−R(i)|をf(ni)として、AFL(i)>AFR(i)か否かを判定する(ステップS612)。YESと判定した場合、f(ni)=L(i)−R(i)とし(ステップS614)、NOと判定した場合、f(ni)=R(i)−L(i)とする(ステップS616)。続いて、上式(1)の左辺f(n)の値(初期値0)に対してf(ni)を加算してその値をf(n)の新たな値とする。即ち、f(n)=f(n)+f(ni)とする(ステップS618)。   Next, specific processing contents when generating AF data by the new method will be described. Conventionally, when sensor data of each cell in the ranging area is read from the AF sensor, the read sensor data is stored in the RAM as it is. When processing such as correlation value calculation using AF data (image) is started, AF data (image) is read from the RAM during execution of the processing, and the above formulas (9) and (10) Necessary difference data is sequentially generated by calculation. For example, in the correlation value calculation process in which AF data (image) is used, as shown in FIG. 12, the shift amount n (the number of employed sensors 62, while the R window 94B and the L window 96B are shifted one cell at a time). In the case of the window size 42, the correlation value is calculated from the AF data (image) in each window range for every n = −2, −1, 0, 1,..., MAX (= 38)). For this reason, the AF data (image) of the same cell is repeatedly used, and the AF data (image) is read from the RAM each time, and difference data is generated by 2-pixel difference calculation. Thus, the correlation value for each shift amount n (n = −2, −1, 0, 1,..., MAX (= 38)) when differential data is generated during the execution of the correlation value calculation (during execution). The calculation processing procedure is shown in FIG. First, i = 1 and sensor data L (i + 1) and L (i-1) are read from the RAM (steps S600 and S602). Note that i shown here indicates the cell position i in the R window 94B and the L window 96B. Then, the difference data AFL (i) = (255 + L (i−1) −L (i + 1)) / 2 is calculated by the above equation (12) (step S604). Similarly, sensor data R (i + 1) and R (i-1) are read from the RAM (steps S606 and S608). Then, the difference data AFR (i) = (255 + R (i−1) −R (i + 1)) / 2 is calculated by the above equation (11) (step S610). Next, let | L (i) −R (i) | on the right side in the above equation (1) for obtaining the correlation value f (n) be f (ni), and whether AFL (i)> AFR (i). Is determined (step S612). If YES is determined, f (ni) = L (i) −R (i) is set (step S614). If NO is determined, f (ni) = R (i) −L (i) is set (step S614). S616). Subsequently, f (ni) is added to the value (initial value 0) of the left side f (n) of the above formula (1), and the value is set as a new value of f (n). That is, f (n) = f (n) + f (ni) is set (step S618).

次に、i=(ウインドウサイズwo(=42))となったか否かを判定し(ステップS620)、YESと判定した場合にはこの処理を終了する(ステップS622)。一方、NOと判定した場合には、i=i+1とし(ステップS624)、上記ステップS600の処理に戻り、ステップS600の処理から繰り返す。上記が各シフト量nごとの演算であり、さらに各シフト量n(n=−2〜38)ごとにi=1からi=woまで演算処理を繰り返す。   Next, it is determined whether or not i = (window size wo (= 42)) (step S620). If it is determined YES, this process ends (step S622). On the other hand, if NO is determined, i = i + 1 is set (step S624), the process returns to step S600, and the process is repeated from step S600. The above is the calculation for each shift amount n, and the calculation process is repeated from i = 1 to i = wo for each shift amount n (n = −2 to 38).

このようにAFデータ(画像)を用いた相関値演算処理の実行時に差分データを生成する場合では、図12に示したように同じセルのAFデータ(画像)を繰り返し使用するため重複して2画素差分演算を実行する必要がある。従って、その演算に時間を要し、結果的に測距演算に要する時間が長くなるという問題が生じることとなる。   As described above, when the difference data is generated during the execution of the correlation value calculation process using the AF data (image), the AF data (image) of the same cell is repeatedly used as shown in FIG. It is necessary to execute pixel difference calculation. Therefore, the calculation takes time, resulting in a problem that the time required for the distance measurement calculation becomes long.

上記不具合を解消するため、本実施の形態では、差分データを用いた処理を開始する前に予めAFデータ(差分)を生成しておき、その生成したAFデータ(差分)をRAMに格納しておくようにする。図31に、相関値演算の実行前に予めAFデータ(差分)を生成してRAMに格納しておいた場合における相関値演算の処理手順を示す。まず、i=1としてRAMからAFデータ(差分)AFL(i)とAFR(i)を読み出す(ステップS650、S652)。尚、ここで示すiは、上記Rウインドウ94B、Lウインドウ96Bにおけるセル位置iを示す。次に、相関値f(n)を求めるための上式(1)における右辺の|L(i)−R(i)|をf(ni)として、AFL(i)>AFR(i)か否かを判定する(ステップS654)。YESと判定した場合、f(ni)=L(i)−R(i)とし(ステップS656)、NOと判定した場合、f(ni)=R(i)−L(i)とする(ステップS658)。続いて、上式(1)の左辺f(n)の値(初期値0)に対してf(ni)を加算してその値をf(n)の新たな値とする。即ち、f(n)=f(n)+f(ni)とする(ステップS660)。   In order to solve the above problem, in the present embodiment, AF data (difference) is generated in advance before starting processing using difference data, and the generated AF data (difference) is stored in the RAM. To leave. FIG. 31 shows a correlation value calculation processing procedure when AF data (difference) is generated and stored in the RAM before the correlation value calculation is executed. First, AF data (difference) AFL (i) and AFR (i) are read from the RAM with i = 1 (steps S650 and S652). Note that i shown here indicates the cell position i in the R window 94B and the L window 96B. Next, let | L (i) −R (i) | on the right side in the above equation (1) for obtaining the correlation value f (n) be f (ni), and whether AFL (i)> AFR (i). Is determined (step S654). If YES is determined, f (ni) = L (i) −R (i) is set (step S656). If NO is determined, f (ni) = R (i) −L (i) is set (step S656). S658). Subsequently, f (ni) is added to the value (initial value 0) of the left side f (n) of the above formula (1), and the value is set as a new value of f (n). That is, f (n) = f (n) + f (ni) is set (step S660).

次に、i=(ウインドウサイズwo(=42))となったか否かを判定し(ステップS662)、YESと判定した場合にはこの処理を終了する(ステップS664)。一方、NOと判定した場合には、i=i+1とし(ステップS666)、上記ステップS650の処理に戻り、ステップS650の処理から繰り返す。   Next, it is determined whether or not i = (window size wo (= 42)) (step S662). If it is determined YES, this process ends (step S664). On the other hand, if NO is determined, i = i + 1 is set (step S666), the process returns to step S650, and the process is repeated from step S650.

このようにAFデータ(差分)を予め生成してRAMに格納しておくことによって、AFデータ(差分)を用いた各処理の実行時には、必要なAFデータ(差分)をRAMから読み出すだけでよく、差分データを生成するための処理に要する時間が大幅に削減される。図30と図31に示した相関値演算における処理時間を比較すると、図31の処理では、図30のステップS602、S604と、ステップS608、S610の処理に要する時間分(2×21μs)だけ相関値演算に要する時間を短縮することができる。上記iの演算回数は、採用センサ数62、ウインドウサイズ42の設定で5エリアの場合、(i=1〜42→42回)×(n=−2〜38→41回)×5エリア=42×41×5=8610回となる。従って、総合測距時間は、8610回×(2×21μs)≒362ms短縮することができる。尚、AFデータ(差分)を予め生成してRAMに格納しておく場合には、センサデータからAFデータ(差分)を生成するための処理時間が相関値演算の時間とは別に必要であるが、これについては後述する。   By generating AF data (difference) in advance and storing it in the RAM in this way, it is only necessary to read out the necessary AF data (difference) from the RAM when executing each process using the AF data (difference). The time required for processing for generating the difference data is greatly reduced. When the processing time in the correlation value calculation shown in FIG. 30 and FIG. 31 is compared, in the processing of FIG. The time required for value calculation can be shortened. The number of i calculations is (i = 1 to 42 → 42 times) × (n = −2 to 38 → 41 times) × 5 area = 42 when the number of sensors used is 62 and the window size 42 is set to 5 areas. × 41 × 5 = 8610 times. Accordingly, the total distance measurement time can be shortened by 8610 times × (2 × 21 μs) ≈362 ms. When AF data (difference) is generated in advance and stored in the RAM, a processing time for generating AF data (difference) from the sensor data is required separately from the time for calculating the correlation value. This will be described later.

ところで、2画素差分演算を実施する場合の態様については2通りの態様が考えられる。第1の態様は、AFセンサ74から読み出したセンサデータを一旦、RAMに格納し(AFデータ(画像))、その後、RAMからAFデータ(画像)を読み出して差分データを上式(11)、(12)により生成して2画素差分演算を実施するというものである。第2の態様は、AFセンサ74からセンサデータを順次読み出している際に、各センサ番号iのセンサデータについて上式(11)、(12)の演算に必要なセンサデータが得られた時点でその差分演算(11)、(12)を実施し、順次生成した差分演算結果をRAMに格納する(AFデータ(差分))というものである。第1の態様におけるセンサデータの読出し処理については、差分データの生成処理と独立して行われるため2画素差分演算を行わない場合や相関値演算等の各処理の実行時においてAFデータ(画像)を生成する場合のセンサデータの読出し処理と同じである。一方、第2の態様のセンサデータの読出し処理については、センサデータを読出しながら2画素差分演算を行っているため、その分センサデータの読出しに要する時間が長くなる。但し、第1の態様においても2画素差分演算を行うことを考慮すると、第1の態様の方が第2の態様よりも有利ということではない。   By the way, there are two possible modes for performing the two-pixel difference calculation. In the first aspect, the sensor data read from the AF sensor 74 is temporarily stored in the RAM (AF data (image)), and then the AF data (image) is read from the RAM to obtain the difference data by the above formula (11), The two-pixel difference calculation is performed by (12). In the second mode, when the sensor data is sequentially read from the AF sensor 74, the sensor data necessary for the calculations of the above equations (11) and (12) is obtained for the sensor data of each sensor number i. The difference calculations (11) and (12) are performed, and the difference calculation results generated sequentially are stored in the RAM (AF data (difference)). The sensor data reading process in the first mode is performed independently of the difference data generation process, and therefore AF data (image) is used when the two-pixel difference calculation is not performed or when each process such as correlation value calculation is performed. This is the same as the sensor data reading process when generating. On the other hand, in the sensor data reading process of the second aspect, since the two-pixel difference calculation is performed while reading the sensor data, the time required for reading the sensor data increases accordingly. However, in consideration of performing the two-pixel difference calculation also in the first mode, the first mode is not more advantageous than the second mode.

ここで、相関値演算等の実行時に差分データを生成する場合(以下、この場合を従来方式という)のデータの流れを図32に示し、AFデータ(差分)を予め生成してRAMに格納しておく場合(以下、この場合を新方式という)として上記第2の態様を採用した場合のデータの流れを図33に示す。図32に示すように従来方式ではAFセンサから順次読み出された各セルのセンサデータはRAMに格納される。そして、相関値演算の実行時においてRAMからAFデータ(画像)が読み出されて上式(11)又は(12)により差分データが生成され、相関値f(n)が算出される。一方、図33に示すように新方式の第2の態様では、AFセンサから順次読み出された各セルのセンサデータは上式(11)又は(12)により差分演算処理が実施されAFデータ(差分)としてRAMに格納される。そして、相関値演算の実行時にはRAMに格納されたAFデータ(差分)が読出されて相関値f(n)が算出される。図には示していないが新方式において上式(11)又は(12)によりセンサデータをAFデータ(差分)に変換する際には2つのセンサデータが必要であるため、2つのセンサデータが読み出されるまでAFセンサから先に読み出されたセンサデータを保持しておくメモリ(RAM)が必要である。しかしながら全てのセンサデータを格納するためのメモリ容量を必要としない。具体的には、センサデータはL(i−1)、R(i−1)、L(i)、R(i)、L(i+1)、R(i+1)、…の順に読み出されるため、2つのセンサデータのセル間隔mが2の場合には、5つのセンサデータを格納するRAMがあれば十分である。例えば、L(i−1)、R(i−1)、L(i)、R(i)、L(i+1)を格納した時点で、上式(12)のAFL(i)をRAMに格納されたL(i−1)、L(i+1)から求めることができる。そして、AFL(i)を求めた際には、L(i−1)のセンサデータは以後不要となるため、そのデータを消去して、次いでAFセンサ74から読み出されるセンサデータR(i+1)をその消去したアドレスに格納することによって、上式(11)のAFR(i)をR(i−1)、R(i+1)から求めることができる。このようにして、AFセンサ74から読み出した5つのセンサデータをRAMに格納すると共に、新たなセンサデータを読み出した際にはRAMに格納されているセンサデータのうち最も先に読み出したセンサデータを消去してその新たなセンサデータをRAMに格納することによって少ないメモリ容量のRAMでAFデータ(差分)を順次作成することができる。   Here, FIG. 32 shows the flow of data when differential data is generated during correlation value calculation or the like (hereinafter referred to as the conventional method), and AF data (difference) is generated in advance and stored in the RAM. FIG. 33 shows a data flow in the case where the second mode is adopted as a case (hereinafter, this case is referred to as a new method). As shown in FIG. 32, in the conventional method, the sensor data of each cell sequentially read from the AF sensor is stored in the RAM. Then, at the time of executing the correlation value calculation, AF data (image) is read from the RAM, difference data is generated by the above equation (11) or (12), and a correlation value f (n) is calculated. On the other hand, as shown in FIG. 33, in the second mode of the new method, the sensor data of each cell sequentially read out from the AF sensor is subjected to difference calculation processing by the above formula (11) or (12) and the AF data ( Difference) is stored in the RAM. When executing the correlation value calculation, the AF data (difference) stored in the RAM is read to calculate the correlation value f (n). Although not shown in the figure, when converting sensor data into AF data (difference) using the above formula (11) or (12) in the new method, two sensor data are required, so two sensor data are read out. A memory (RAM) that holds sensor data previously read from the AF sensor is necessary. However, a memory capacity for storing all sensor data is not required. Specifically, the sensor data is read in the order of L (i−1), R (i−1), L (i), R (i), L (i + 1), R (i + 1),. When the cell interval m of two sensor data is 2, a RAM for storing five sensor data is sufficient. For example, when L (i-1), R (i-1), L (i), R (i), and L (i + 1) are stored, AFL (i) in the above equation (12) is stored in the RAM. L (i−1), L (i + 1) obtained. When the AFL (i) is obtained, the sensor data of L (i-1) is no longer necessary. Therefore, the data is deleted, and then the sensor data R (i + 1) read from the AF sensor 74 is obtained. By storing in the erased address, AFR (i) in the above equation (11) can be obtained from R (i−1) and R (i + 1). In this manner, the five sensor data read from the AF sensor 74 are stored in the RAM, and when new sensor data is read, the sensor data read first is stored among the sensor data stored in the RAM. By erasing and storing the new sensor data in the RAM, AF data (difference) can be sequentially generated with a RAM having a small memory capacity.

続いて、センサデータの読出し処理に関して、上記従来方式を採用した場合と、新方式として上記第2の態様を採用した場合とを比較する。図34は、従来方式におけるセンサデータの読出し処理を示したフローチャートであり、図35は、従来方式におけるセンサデータ読出し時の上記AFCLK信号及びAFDATAP信号を示したタイミングチャートである。これらの図を参照して従来方式におけるセンサデータの読出し処理について説明すると、まず、AFCLK信号を“H”から“L”に切り替え(ステップS700)、センサデータを示すAFDATAP信号をA/D変換する(ステップS702)。そして、AFCLK信号を“L”から“H”に切り替え(ステップS704)、A/D変換により取得したセンサデータR(i)又はL(i)をRAMに格納する(ステップS706)。以上の処理を繰り返す。尚、AFCLK信号の“H”、“L”の期間はそれぞれ例えば16μs、18μsである。   Subsequently, regarding the sensor data reading process, the case where the conventional method is adopted and the case where the second mode is adopted as a new method will be compared. FIG. 34 is a flowchart showing sensor data read processing in the conventional method, and FIG. 35 is a timing chart showing the AFCLK signal and AFDATAP signal at the time of sensor data read in the conventional method. With reference to these figures, the sensor data reading process in the conventional method will be described. First, the AFCLK signal is switched from “H” to “L” (step S700), and the AFDATAT signal indicating the sensor data is A / D converted. (Step S702). Then, the AFCLK signal is switched from “L” to “H” (step S704), and the sensor data R (i) or L (i) acquired by the A / D conversion is stored in the RAM (step S706). The above processing is repeated. The periods of the AFCLK signal “H” and “L” are, for example, 16 μs and 18 μs, respectively.

一方、図36は、新方式(第2の態様)におけるセンサデータの読出し処理のフローチャートであり、図37は、新方式におけるセンサデータ読出し時の上記AFCLK信号及びAFDATAP信号を示した図である。これらの図を参照して新方式におけるセンサデータの読出し処理について説明すると、まず、AFCLK信号を“H”から“L”に切り替え(ステップS750)、センサデータを示すAFDATAP信号をA/D変換する(ステップS752)。そして、AFCLK信号を“L”から“H”に切り替え(ステップS754)、A/D変換により取得したセンサデータR(i)又はL(i)をRAMに格納する(ステップS756)。次にRAMからセンサデータR(i−2)又はL(i−2)を読み出し(ステップS6−5)、上式(11)又は(12)によりAFデータ(差分)AFR(i−1)又はAFL(i−1)を算出する(ステップS760)、そして、算出したAFデータ(差分)AFR(i−1)又はAFL(i−1)をRAMに格納する(ステップS762)。以上の処理を繰り返す。   On the other hand, FIG. 36 is a flowchart of the sensor data reading process in the new method (second mode), and FIG. 37 is a diagram showing the AFCLK signal and the AFDATAP signal at the time of reading sensor data in the new method. The sensor data reading process in the new method will be described with reference to these drawings. First, the AFCLK signal is switched from “H” to “L” (step S750), and the AFDATAT signal indicating the sensor data is A / D converted. (Step S752). Then, the AFCLK signal is switched from “L” to “H” (step S754), and the sensor data R (i) or L (i) acquired by the A / D conversion is stored in the RAM (step S756). Next, sensor data R (i-2) or L (i-2) is read from the RAM (step S6-5), and AF data (difference) AFR (i-1) or according to the above equation (11) or (12). AFL (i-1) is calculated (step S760), and the calculated AF data (difference) AFR (i-1) or AFL (i-1) is stored in the RAM (step S762). The above processing is repeated.

以上の新方式と従来方式のセンサデータ読出し処理手順から分かるように新方式ではステップS758、S760、S762の動作時間分(21μs)だけ従来方式よりも1つのセンサデータの読出しに時間を要する。尚、ステップS758、S760、S762の処理は、AFCLK信号が“H”の際に行われるため、図37に示すようにAFCLK信号の“H”の期間が従来方式に比べてセンサデータの読出し時間が長く、37μsとなっている。即ち、センサデータの読出し時間だけを考慮すると、新方式は、従来方式よりも不利である。しかしながら、センサデータの読出しと、例えば相関値演算を含む処理全体の時間を比較すると新方式の方が短時間で処理を終了させることができる。具体的に計算した例を図38の表に示す。表には新方式、従来方式、及び、参考として2画素差分演算を行わない場合(従来(2)方式)のそれぞれにおいて、センサデータの読出し時間、1回当たりの相関値演算時間、相関値総演算時間(41回、5エリア設定)、合計(センサデータ読出し時間+相関値総演算時間)が示されており、また、新方式と従来方式との差Δ(1)と、新方式と従来(2)方式との差Δ(2)が示されている。   As can be seen from the above-described sensor data read processing procedure of the new method and the conventional method, the new method requires more time to read one sensor data than the conventional method by the operation time (21 μs) of steps S758, S760, and S762. Since the processes of steps S758, S760, and S762 are performed when the AFCLK signal is “H”, as shown in FIG. 37, the “H” period of the AFCLK signal is longer than the conventional method for reading the sensor data. Is 37 μs. That is, considering only the sensor data read time, the new method is disadvantageous than the conventional method. However, when the reading of sensor data is compared with the overall processing time including, for example, correlation value calculation, the new method can complete the processing in a shorter time. An example of specific calculation is shown in the table of FIG. The table shows sensor data read time, correlation value calculation time per time, and total correlation value for the new method, the conventional method, and the case where 2 pixel difference calculation is not performed (conventional (2) method). Calculation time (41 times, 5 area setting) and total (sensor data read time + correlation value total calculation time) are shown. Also, the difference Δ (1) between the new method and the conventional method, and the new method and the conventional method. (2) A difference Δ (2) from the method is shown.

センサデータの読出し時間は、{AFCLK信号の(“H”の時間+“L”の時間)}×セル数×2(Rセンサ94とLセンサ96)であり、新方式の場合には、はじめの5セル分のセンサデータ読出し期間では2画素差分演算ができないので、(従来方式による5セル分のセンサデータの読出し時間)+(新方式による残りセル分のセンサデータの読出し時間)となる。上記説明で使用した数値を当てはめると、(16+18)×5+(37+18)×((229−6+1)×2−5)=24535μsとなる。   The sensor data read time is {AFCLK signal (“H” time + “L” time)} × number of cells × 2 (R sensor 94 and L sensor 96). Since the two-pixel difference calculation cannot be performed in the sensor data reading period of 5 cells, (sensor data reading time for 5 cells according to the conventional method) + (sensor data reading time for the remaining cells according to the new method). Applying the numerical values used in the above description, (16 + 18) × 5 + (37 + 18) × ((229−6 + 1) × 2−5) = 24535 μs.

一方、1回当たりの相関値演算時間は、新方式の場合には実測値を用いており、従来方式の場合には、実測値+演算時間増加分としている。演算時間増加分は図30に示したように21μs×2としている。尚、従来方式の1回当たりの相関値演算時間は、1.2×0.021×2×42=2.964msである。   On the other hand, as the correlation value calculation time per time, an actual measurement value is used in the case of the new method, and an actual measurement value + an increase in calculation time is used in the case of the conventional method. The increase in calculation time is 21 μs × 2 as shown in FIG. The correlation value calculation time per time in the conventional method is 1.2 × 0.021 × 2 × 42 = 2.964 ms.

この表から分かるように新方式では、従来方式に比べて全センサデータの読出し時間が9ms程度長くなる。しかしながら、相関値演算に関しては、新方式では従来方式に対して約361msも処理時間が短縮されるため、その他の判断処理等に要する時間が同じだとすると、新方式では測距時間が352msも短縮されることになる。   As can be seen from this table, in the new method, the reading time of all sensor data is about 9 ms longer than in the conventional method. However, with regard to correlation value calculation, the processing time is reduced by about 361 ms in the new method compared to the conventional method. Therefore, if the time required for other determination processing is the same, the distance measurement time is reduced by 352 ms in the new method. It will be.

以上、センサデータに所要の処理を施してAFデータを生成する場合、そのAFデータの生成はCPU60において行うようにしたが、必ずしもCPU60において行う必要はなく、AFセンサ74においてセンサデータに所要の処理を施してAFデータを生成し、CPU60にその生成したAFデータを与えるようにしてもよい。更に、後述の相関値演算処理についてもCPU60において行うのではなく、AFセンサ74において行い、その結果得られた距離信号をCPU60に与えるようにしてもよい。   As described above, when the AF data is generated by performing the required processing on the sensor data, the generation of the AF data is performed by the CPU 60. To generate AF data, and the generated AF data may be given to the CPU 60. Further, a correlation value calculation process described later may be performed not by the CPU 60 but by the AF sensor 74, and a distance signal obtained as a result may be provided to the CPU 60.

{相関値演算処理(図7ステップS16)の詳細}
次に、上記図7のステップS16における相関値演算処理について詳説する。図12を用いて上述したように相関値演算処理においてCPU60は、AFセンサ74のRセンサ94及びLセンサ96の測距エリアを構成する各分割エリアごとに、図7のステップS14のAFデータ取得処理により取得したAFデータに基づいて上式(1)により相関値f(n)(n=−2,−1,0,1,…,MAX(=38))を算出する。そして、算出した相関値f(n)に基づいて各分割エリアごとに相関が最も高くなるシフト量nを検出する。尚、ステップS14のコントラスト検出処理1において測距に必要なコントラストがないと判定された分割エリアについては、相関値演算処理は行わない。
{Details of correlation value calculation process (step S16 in FIG. 7)}
Next, the correlation value calculation process in step S16 of FIG. 7 will be described in detail. As described above with reference to FIG. 12, in the correlation value calculation process, the CPU 60 acquires the AF data in step S <b> 14 of FIG. 7 for each divided area constituting the distance measurement area of the R sensor 94 and L sensor 96 of the AF sensor 74. The correlation value f (n) (n = −2, −1, 0, 1,..., MAX (= 38)) is calculated by the above equation (1) based on the AF data acquired by the processing. Then, based on the calculated correlation value f (n), the shift amount n at which the correlation is highest for each divided area is detected. Note that the correlation value calculation process is not performed for the divided areas determined to have no contrast necessary for distance measurement in the contrast detection process 1 of step S14.

ここで、CPU60は、極小値を求めるためf(n−1)≧f(n)<f(n+1)の判断を実施し、相関が最も高くなる(最高相関の)シフト量として、相関値f(n)が最小極小値となるシフト量nを検出する。多くの場合には相関値の極小値は1つであり、最高相関のシフト量は、その極小値が得られるシフト量nとなる。   Here, the CPU 60 performs a determination of f (n−1) ≧ f (n) <f (n + 1) in order to obtain the minimum value, and uses the correlation value f as the shift amount that provides the highest correlation (highest correlation). The shift amount n at which (n) is the minimum minimum value is detected. In many cases, the minimum value of the correlation value is one, and the shift amount of the highest correlation is the shift amount n at which the minimum value is obtained.

一方、相関値f(n)の分布(f(n−1)≧f(n)<f(n+1)の判断)において極小値が複数存在する場合もあり、その場合には、最高相関のシフト量は、原則として、複数の極小値のうち最小の極小値(最小極小値)が得られるシフト量nとなる。ただし、極小値が複数存在する場合には、誤測距となる可能性があるため、以下で説明する極小値判断処理において、最小極小値のシフト量nを最高相関のシフト量として採用することが妥当であるか否かを判断する。尚、極小値が1つの場合の極小値とそのシフト量、又は、極小値が複数存在する場合の最小極小値とそのシフト量をいずれも最小極小値fmin1(又は、最小極小値f(nmin1))とシフト量nmin1で表す。   On the other hand, there may be a plurality of local minimum values in the distribution of correlation values f (n) (judgment of f (n−1) ≧ f (n) <f (n + 1)). The amount is, in principle, a shift amount n at which a minimum minimum value (minimum minimum value) is obtained among a plurality of minimum values. However, when there are a plurality of local minimum values, there is a possibility of erroneous distance measurement. Therefore, in the local minimum value determination process described below, the shift amount n of the minimum local minimum value is adopted as the maximum correlation shift amount. Judge whether or not is appropriate. It should be noted that the minimum value and its shift amount when there is one minimum value, or the minimum minimum value and its shift amount when there are a plurality of minimum values, are both the minimum minimum value fmin1 (or the minimum minimum value f (nmin1)). ) And the shift amount nmin1.

次に、極小値判断処理について説明する。ある分割エリアにおいて相関値f(n)の極小値が2つ以上存在した場合、CPU60は、最小極小値fmin1と2番目に小さい極小値(第2極小値という)とを検出し、それらの差(極小値差)を求める。尚、第2極小値をfmin2、極小値差をΔfmin(=fmin2−fmin1)で表す。極小値判断の処理概略としては、その極小値差Δfminが大きい場合には、最小極小値fmin1のシフト量nmin1を最高相関のシフト量nとして採用する。一方、極小値差Δfminが小さい場合には、誤測距となる可能性が高いため測距不能とする。尚、以下、最高相関のシフト量をnmin、最高相関における相関値(最高相関値)をfmin又はf(nmin)で表す。   Next, the minimum value determination process will be described. When two or more minimum values of the correlation value f (n) exist in a certain divided area, the CPU 60 detects the minimum minimum value fmin1 and the second smallest minimum value (referred to as the second minimum value), and the difference between them is detected. (Minimum value difference) is obtained. The second minimum value is represented by fmin2, and the difference between the minimum values is represented by Δfmin (= fmin2−fmin1). As an outline of processing for determining the minimum value, when the minimum value difference Δfmin is large, the shift amount nmin1 of the minimum minimum value fmin1 is adopted as the shift amount n of the highest correlation. On the other hand, when the minimum value difference Δfmin is small, there is a high possibility of erroneous distance measurement, and therefore distance measurement is impossible. Hereinafter, the shift amount of the highest correlation is represented by nmin, and the correlation value at the highest correlation (maximum correlation value) is represented by fmin or f (nmin).

ところで、相関値f(n)の極小値が複数存在した場合に、測距可能か又は測距不能かの判断を、一定の基準値に対して極小値差Δfminが大きいか又は小さいかで判断するのは次のような態様を考慮すると必要以上に測距不能となるか、又は、誤測距の可能性が高くなる不具合がある。即ち、極小値差Δfminがある程度小さくても測距可能とすべき場合と、極小値差Δfminがある程度大きくても測距不能とすべき場合とがある。   By the way, when there are a plurality of minimum values of the correlation value f (n), whether or not distance measurement is possible is determined based on whether the minimum value difference Δfmin is large or small with respect to a certain reference value. Considering the following aspects, there is a problem that the distance measurement becomes unnecessarily impossible or the possibility of erroneous distance measurement becomes high. That is, there are a case where distance measurement should be possible even if the minimum value difference Δfmin is small to some extent, and a case where distance measurement should be impossible even if the minimum value difference Δfmin is large to some extent.

例えば、前者の場合の態様を図39に示し、後者の場合の態様を図40に示す。図39(A)、(B)にはAFセンサ74の各Rセンサ94及びLセンサ96における中央エリアの各セルから得られたAFデータの例が示されており、同図に示すように中央エリアの各セルから得られたAFデータが低コントラストであったとする。尚、以下の説明において、同様の処理が行われる分割エリア(測距エリアを構成する各分割エリア)のうち説明上着目している分割エリア又はそのセンサ(各セル)を採用センサというものとする。このような場合、相関値演算によって算出される相関値f(n)は、同図(C)に示すように全体的に小さな値(後述の図40との比較による)となる。また、同図(C)では、シフト量n=8のところで最小極小値fmin1が検出され、シフト量n=18のところで第2極小値fmin2が検出されているが、これらの極小値差Δfminも後述の図40の場合に比べて小さい。しかしながら、この図39の態様の場合、最小極小値fmin1のシフト量nmin1(=8)は被写体距離に適切に対応した値であり、測距可能と判断すべきである。   For example, FIG. 39 shows an aspect in the former case, and FIG. 40 shows an aspect in the latter case. 39A and 39B show examples of AF data obtained from each cell in the central area of each R sensor 94 and L sensor 96 of the AF sensor 74. As shown in FIG. It is assumed that AF data obtained from each cell in the area has low contrast. In the following description, among the divided areas (each divided area constituting the distance measuring area) in which the same processing is performed, the divided area or its sensor (each cell) focused on the description is referred to as an adopted sensor. . In such a case, the correlation value f (n) calculated by the correlation value calculation is an overall small value (by comparison with FIG. 40 described later) as shown in FIG. In FIG. 6C, the minimum minimum value fmin1 is detected when the shift amount n = 8, and the second minimum value fmin2 is detected when the shift amount n = 18. This is smaller than the case of FIG. However, in the case of the mode of FIG. 39, the shift amount nmin1 (= 8) of the minimum minimum value fmin1 is a value that appropriately corresponds to the subject distance, and it should be determined that distance measurement is possible.

一方、図40(A)、(B)には、Rセンサ94及びLセンサ96の採用センサ(中央エリア)から得られたAFデータが周期的に変化する例が示されている。このようなAFデータが得られるのは、例えば、縞模様の被写体を撮像した場合である。この場合に、相関値演算によって算出される相関値f(n)も同図(C)に示すように周期的に変化し、全体的に大きな値(前述の図39との比較による)となる。また、同図(D)の拡大図に示すようにシフト量n=14のところで最小極小値fmin1が検出され、シフト量n=20のところで第2極小値fmin2が検出されているが、これらの極小値差Δfminも前述の図39の場合に比べて大きい。しかしながら、この図40の態様の場合、最小極小値fmin1のシフト量nmin1(=14)は被写体距離に適切に対応していない可能性が高く、この採用センサについては測距不能とすべきである。   On the other hand, FIGS. 40A and 40B show an example in which AF data obtained from the adopted sensors (center area) of the R sensor 94 and the L sensor 96 changes periodically. Such AF data is obtained, for example, when a striped subject is imaged. In this case, the correlation value f (n) calculated by the correlation value calculation also periodically changes as shown in FIG. 10C, and becomes a large value as a whole (by comparison with FIG. 39 described above). . Further, as shown in the enlarged view of FIG. 4D, the minimum minimum value fmin1 is detected at the shift amount n = 14, and the second minimum value fmin2 is detected at the shift amount n = 20. The minimum value difference Δfmin is also larger than in the case of FIG. However, in the case of the mode of FIG. 40, there is a high possibility that the shift amount nmin1 (= 14) of the minimum minimum value fmin1 does not appropriately correspond to the subject distance, and this adopted sensor should be unable to measure the distance. .

CPU60は、図39のように測距可能とすべき場合と図40のように測距不能とすべき場合とを適切に判断するため、具体的、以下のように判断処理を行う。   Specifically, the CPU 60 performs a determination process as follows in order to appropriately determine the case where distance measurement should be possible as shown in FIG. 39 and the case where distance measurement should not be possible as shown in FIG.

まず、採用センサの相関値f(n)の分布において複数検出された極小値のうち最小極小値fmin1と第2極小値fmin2を検出する。そして、次式、
[数9]
fmin1<基準値R3 …(13)
が成り立つか否かを判断する。この判断は、図39と図40の場合を分けるための判断であり、基準値R3はこれらの場合を分けるために適切な値に設定される。もし、式(13)が成り立つ場合、即ち、図39の場合、次いで、極小値差Δfmin(=fmin2−fmin1)を求め、次式、
[数10]
Δfmin<基準値R2 …(14)
が成り立つか否かを判断する。基準値R2は、図39の場合を考慮して少なくとも後述の基準値R1よりも小さい値に設定される。もし、式(14)が成り立つ場合には、極小値差Δfminが小さいとして、この採用センサについて測距不能とする。式(14)が成り立たない場合には、測距可能とし、最小極小値fmin1のシフト量nmin1を最高相関値fminのシフト量nminとして採用する。
First, the minimum minimum value fmin1 and the second minimum value fmin2 are detected among a plurality of minimum values detected in the distribution of the correlation values f (n) of the employed sensors. And the following formula:
[Equation 9]
fmin1 <reference value R3 (13)
Determine whether or not. This determination is a determination for dividing the cases of FIG. 39 and FIG. 40, and the reference value R3 is set to an appropriate value for dividing these cases. If the equation (13) is satisfied, that is, in the case of FIG. 39, the minimum value difference Δfmin (= fmin2−fmin1) is obtained, and the following equation:
[Equation 10]
Δfmin <reference value R2 (14)
Determine whether or not. In consideration of the case of FIG. 39, the reference value R2 is set to a value that is at least smaller than a reference value R1 described later. If equation (14) holds, it is determined that the minimum value difference Δfmin is small, and the distance measurement is not possible for this adopted sensor. If equation (14) does not hold, distance measurement is possible, and the shift amount nmin1 of the minimum minimum value fmin1 is adopted as the shift amount nmin of the maximum correlation value fmin.

一方、上式(13)が成り立たない場合、即ち、図40の場合には、次式、
[数11]
Δfmin<基準値R1 …(15)
が成り立つか否かを判断する。基準値R1は、図40の場合を考慮して少なくとも基準値R2よりも大きい値に設定される。もし、式(15)が成り立つ場合には、図40のように縞模様の被写体等である可能性が高いと判断してこの採用センサでの測距を不能とする。式(15)が成り立たない場合には、測距可能とし、最小極小値fmin1のシフト量nmin1を最高相関値fminのシフト量nminとして採用する。
On the other hand, when the above equation (13) does not hold, that is, in the case of FIG.
[Equation 11]
Δfmin <reference value R1 (15)
Determine whether or not. The reference value R1 is set to a value that is at least larger than the reference value R2 in consideration of the case of FIG. If equation (15) holds, it is determined that there is a high possibility that the subject is a striped pattern, as shown in FIG. If equation (15) does not hold, distance measurement is possible, and the shift amount nmin1 of the minimum minimum value fmin1 is adopted as the shift amount nmin of the maximum correlation value fmin.

以上のような極小値判断処理を行うことにより誤測距等の不具合の発生頻度が削減される。   By performing the minimum value determination process as described above, the frequency of occurrence of problems such as erroneous distance measurement is reduced.

次に、相関値演算処理において測距時間の短縮を図るための複数の他の態様について説明する。まず、測距時間の短縮を図る第1の実施の形態について説明する。図7ステップS16の説明では(式(1)参照)、相関値f(n)(n=−2,−1,0,1,…,MAX(=38))は、Rウインドウ94BとLウインドウ96Bの同一セル位置i(i=1,2,…wo(=42))におけるAFデータの差分の絶対値 (以下、単にAFデータの差分という)を全てのセル位置iについて加算したものである。本第1の実施の形態では、各シフト量nの相関値f(n)を求める際に、全てのセル位置iについてAFデータの差分を加算するのではなく、セル位置iを一定間隔おきにとって加算するものとする。例えば、セル位置iを3つおきにとって、AFデータの差分を加算する。尚、以下の説明において、相関値f(n)の算出においてAFデータの差分を加算する演算対象のセルを採用セルという。また、3つおきのセル位置iのセルを採用セルとする場合の相関値演算を以下、「i3つおき演算」といい、これに対して、式(1)のように全てのセル位置iのセルを採用セルとする場合の相関値演算を以下、「通常演算」という。   Next, a plurality of other modes for shortening the distance measurement time in the correlation value calculation process will be described. First, a first embodiment for shortening the distance measurement time will be described. In the description of step S16 in FIG. 7 (see equation (1)), the correlation values f (n) (n = −2, −1, 0, 1,..., MAX (= 38)) are R window 94B and L window. The absolute value of the difference of AF data at the same cell position i (i = 1, 2,..., Wo (= 42)) of 96B (hereinafter simply referred to as AF data difference) is added for all cell positions i. . In the first embodiment, when obtaining the correlation value f (n) of each shift amount n, the difference between the AF data is not added for all the cell positions i, but the cell positions i are set at regular intervals. It shall be added. For example, for every third cell position i, the difference of AF data is added. In the following description, a calculation target cell to which the difference of AF data is added in the calculation of the correlation value f (n) is referred to as an adopted cell. Further, the correlation value calculation when the cells at every third cell position i are adopted cells is hereinafter referred to as “i every third cell calculation”. On the other hand, all the cell positions i are expressed as shown in Expression (1). Hereinafter, the correlation value calculation in the case where the selected cell is adopted is referred to as “normal calculation”.

図41は、i3つおき演算におけるRウインドウ94B及びLウインドウ96B内の採用セルのセル位置iを示した図である。同図に示すようにi3つおき演算では、Rウインドウ94B及びLウインドウ96Bともにセル位置1から順に3つおきのセル位置i(=1、5、9、13、…)のセルが採用セルとして採用される。ウインドウサイズが42の場合(wo=42の場合)には採用セルの最終のセル位置iは41となる。この場合の相関値f(n)の演算式は、上式(1)と同様に次式、   FIG. 41 is a diagram showing cell positions i of adopted cells in the R window 94B and the L window 96B in every third i calculation. As shown in the figure, in every third i-th computation, cells in every third cell position i (= 1, 5, 9, 13,...) Are selected as the adopted cells in order from the cell position 1 in both the R window 94B and the L window 96B. Adopted. When the window size is 42 (when wo = 42), the final cell position i of the adopted cells is 41. The equation for calculating the correlation value f (n) in this case is the following equation, as in the above equation (1):

Figure 2009008686
Figure 2009008686

により表されるが、iはi=1、5,9、13,17、21,25,29,33、37,41のように3つおきにとられる。尚、採用セルのセル位置iは3つおきでなくてもよく、また、セル位置i=1からでなくてもよい。また、上式(16)では上式(1)に対して4倍の因子が加えられているが、i3つおき演算では通常演算に対してデータ数が1/4となるため通常演算と数値を合わせたためである。 Where i is taken every three as i = 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41. Note that the cell positions i of the adopted cells need not be every three, and may not be from the cell position i = 1. In the above equation (16), a factor of four times is added to the above equation (1), but every third i3 operation has 1/4 the number of data compared to the normal operation. This is because of the combination.

ここで、採用センサの各セルで得られたAFデータに基づいて、通常演算とi3つおき演算とにより相関値f(n)を求めた場合の算出結果の例をそれぞれ図42、図43に示す。これらの図から分かるように、相関値f(n)の分布の大要は、i3つおき演算の場合でも通常演算と大きくは変わらず、この例ではi3つおき演算の場合でも通常演算と同じシフト量n(=10)で最小極小値が得られている。   Here, examples of calculation results when the correlation value f (n) is obtained by the normal calculation and every third i3 calculation based on the AF data obtained in each cell of the employed sensor are shown in FIGS. 42 and 43, respectively. Show. As can be seen from these figures, the outline of the distribution of the correlation value f (n) is not much different from the normal calculation even in the case of every third i calculation, and in this example, the same as the normal calculation in the case of every third i calculation. The minimum minimum value is obtained with the shift amount n (= 10).

CPU60は、上述のようにi3つおき演算により各シフト量nについての相関値f(n)を算出した場合、通常演算による場合と同様に相関値f(n)が極小値となるシフト量nを検出する。このとき、図42、図43から分かるようにi3つおき演算により求めた相関値f(n)は通常演算により求めた相関値f(n)に比べて変動が大きく、精度が低い。従って、i3つおき演算での極小値の位置は通常演算での極小値の位置と異なる可能性がある。そこで、i3つおき演算を行う場合には、検出された極小値が1つの場合にはその極小値を暫定最小極小値とし、検出された極小値が複数の場合にはそのうちの最小の極小値を暫定最小極小値とし、その暫定最小極小値のシフト量付近において再度、通常演算により相関値f(n)を算出する。尚、検出された極小値が複数の場合において、2番目に小さい極小値(暫定第2極小値)と暫定最小極小値との差が小さい場合には、暫定第2極小値のシフト量付近においても通常演算により相関値f(n)の算出を行うが、この場合の詳細については後述する。また、以下、暫定最小極小値をTfmin1、そのときのシフト量をTnmin1で表す。また、通常演算により相関値f(n)を再演算する範囲を再演算範囲という。   When the CPU 60 calculates the correlation value f (n) for each shift amount n by every third i calculation as described above, the shift amount n at which the correlation value f (n) is a minimum value as in the normal calculation. Is detected. At this time, as can be seen from FIG. 42 and FIG. 43, the correlation value f (n) obtained by calculation every third i is more varied and less accurate than the correlation value f (n) obtained by normal calculation. Therefore, the position of the minimum value in every i3 calculation may be different from the position of the minimum value in the normal calculation. Therefore, when performing every third i calculation, if there is only one detected minimum value, that minimum value is set as the provisional minimum minimum value, and if there are a plurality of detected minimum values, the minimum minimum value among them is used. Is the provisional minimum value, and the correlation value f (n) is calculated again by normal calculation in the vicinity of the shift amount of the provisional minimum value. In the case where there are a plurality of detected minimum values, when the difference between the second smallest minimum value (provisional second minimum value) and the provisional minimum minimum value is small, in the vicinity of the shift amount of the provisional second minimum value. In this case, the correlation value f (n) is calculated by normal calculation. Details of this case will be described later. Further, hereinafter, the provisional minimum value is expressed as Tfmin1, and the shift amount at that time is expressed as Tnmin1. Further, a range in which the correlation value f (n) is recalculated by normal calculation is referred to as a recalculation range.

CPU60は、通常演算によりシフト量Tnmin1付近の再演算範囲の相関値f(n)を再演算すると、その再演算範囲における相関値f(n)の極小値及びそのシフト量を、通常演算により算出した相関値f(n)に基づいて検出する。この再演算により検出される極小値及びシフト量は、測距不能と判断される場合(後述)を除き、採用センサにおける全ての相関値f(n)を通常演算により求めた場合に検出される上述の最小極小値fmin1及びそのシフト量nmin1に相当するため、それぞれ最小極小値fmin1、シフト量nmin1で表す。尚、再演算により検出したことを強調する場合には再演算最小極小値fmin1という。この再演算の処理によって検出される再演算最小極小値fmin1及びシフト量nmin1は、測距不能と判定される場合を除き、相関値演算処理によって検出すべき最高相関値fminとそのシフト量nminとなる。   When the CPU 60 recalculates the correlation value f (n) in the recalculation range near the shift amount Tnmin1 by the normal calculation, the minimum value of the correlation value f (n) and the shift amount in the recalculation range are calculated by the normal calculation. Detection is performed based on the correlation value f (n). The minimum value and shift amount detected by this recalculation are detected when all correlation values f (n) in the employed sensor are obtained by normal calculation except when it is determined that distance measurement is impossible (described later). Since it corresponds to the above-mentioned minimum minimum value fmin1 and the shift amount nmin1, it is represented by the minimum minimum value fmin1 and the shift amount nmin1, respectively. When emphasizing the detection by recalculation, it is referred to as a recalculation minimum minimum value fmin1. The recalculation minimum minimum value fmin1 and the shift amount nmin1 detected by this recalculation process are the highest correlation value fmin to be detected by the correlation value calculation process and the shift amount nmin, unless it is determined that distance measurement is impossible. Become.

再演算範囲は、例えば、暫定最小極小値Tfmin1が得られたシフト量Tnmin1に対して±5のシフト量の範囲とする。例えば、図43の場合に暫定最小極小値Tfmin1が得られたシフト量Tnmin1は10であるから、再演算範囲は、図44に示すようにシフト量n=5〜15となる。この再演算範囲で再演算を行うと、同図に示すように再演算範囲において図42と同一の相関値f(n)が算出されるため、本来検出されるべき最小極小値fmin1のシフト量nmin1が再演算により検出される。尚、この例では暫定最小極小値Tfmin1のシフト量Tnmin1と再演算最小極小値fmin1のシフト量nmin1とは一致している。   The recalculation range is, for example, a shift amount range of ± 5 with respect to the shift amount Tmin1 from which the provisional minimum value Tfmin1 is obtained. For example, in the case of FIG. 43, the shift amount Tminin1 from which the provisional minimum minimum value Tfmin1 is obtained is 10, so the recalculation range is the shift amount n = 5 to 15 as shown in FIG. When recalculation is performed in this recalculation range, the same correlation value f (n) as that in FIG. 42 is calculated in the recalculation range as shown in the figure. Therefore, the shift amount of the minimum minimum value fmin1 that should be detected originally nmin1 is detected by recalculation. In this example, the shift amount Tminin1 of the provisional minimum minimum value Tfmin1 and the shift amount nmin1 of the recalculated minimum minimum value fmin1 coincide with each other.

ここで、i3つおき演算により検出された暫定最小極小値Tfmin1のシフト量Tnmin1が図45に示すように近距離警告範囲内であった場合、上述の通常演算による再演算は行わず、Tnmin1=nmin1として近距離警告とする。近距離警告範囲とは、オートフォーカスにおいてピント合わせができない近距離の範囲をいい、上述の再演算は、暫定最小極小値Tfmin1のシフト量Tnmin1が近距離警告範囲外のときのみ行うものとする。   Here, if the shift amount Tnmin1 of the temporary minimum value Tfmin1 detected by every third i-th operation is within the short distance warning range as shown in FIG. 45, the recalculation by the above-mentioned normal calculation is not performed, and Tnmin1 = It is set as a near distance warning as nmin1. The short distance warning range refers to a short distance range that cannot be focused in autofocus, and the above recalculation is performed only when the shift amount Tmin1 of the provisional minimum minimum value Tfmin1 is outside the short distance warning range.

CPU60は、上述のように再演算により算出した相関値f(n)により再演算最小極小値fmin1のシフト量nmin1を検出すると、そのシフト量nmin1とi3つおき演算により検出された暫定最小極小値Tfmin1のシフト量Tnmin1とを比較する。通常、これらのシフト量は一致するが、場合によっては一致しないことがある。この場合、図7ステップS22の補間値演算処理等、この後の処理において必要な範囲の相関値f(n)(通常演算による相関値)が不足するため、不足しているシフト量nにおける相関値f(n)の再演算を追加で行う。即ち、再演算最小極小値fmin1のシフト量nmin1(最高相関のシフト量nmin)に対し、少なくとも一定のシフト量範囲(例えば、±5の範囲)で通常演算による相関値f(n)を算出しておく必要があり、暫定最小極小値Tfmin1のシフト量Tnmin1と再演算最小極小値fmin1のシフト量nmin1とが一致していない場合には、再演算最小極小値fmin1のシフト量nmin1に対して必要なシフト量範囲の相関値f(n)が不足する。本実施の形態では、再演算最小極小値fmin1のシフト量nmin1に対して通常演算による相関値f(n)が必要なシフト量範囲は再演算範囲と同じ範囲(±5の範囲)とする。   When the CPU 60 detects the shift amount nmin1 of the recalculation minimum minimum value fmin1 from the correlation value f (n) calculated by the recalculation as described above, the shift minimum nmin1 and the provisional minimum minimum value detected by every third i3 calculation. The shift amount Tnmin1 of Tfmin1 is compared. Normally, these shift amounts match, but in some cases they do not match. In this case, the correlation value f (n) (correlation value obtained by the normal calculation) in the necessary range in the subsequent processing such as the interpolation value calculation processing in step S22 in FIG. Additional recalculation of the value f (n) is performed. That is, the correlation value f (n) by the normal calculation is calculated in at least a certain shift amount range (for example, ± 5 range) with respect to the shift amount nmin1 (maximum correlation shift amount nmin) of the recalculation minimum minimum value fmin1. If the shift amount Tnmin1 of the provisional minimum minimum value Tfmin1 and the shift amount nmin1 of the recalculation minimum minimum value fmin1 do not match, it is necessary for the shift amount nmin1 of the recalculation minimum minimum value fmin1. The correlation value f (n) in the shift range is insufficient. In the present embodiment, the shift amount range in which the correlation value f (n) by the normal calculation is required for the shift amount nmin1 of the recalculation minimum minimum value fmin1 is the same range (± 5 range) as the recalculation range.

そこで、再演算最小極小値fmin1のシフト量nmin1に対して必要なシフト量範囲のうち、既に通常演算による相関値f(n)が算出された再演算範囲以外のシフト量について、通常演算による相関値f(n)の再演算を追加で行う。但し、暫定最小極小値Tfmin1のシフト量Tnmin1と再演算最小極小値fmin1のシフト量nmin1との差(シフト量差nSA)が所定の値(例えば3)以上の場合には、再演算最小極小値fmin1が本来検出されるべき最小極小値でない可能性が高くなるため、測距不能とする。尚、再演算の結果、極小値が検出されなくなった場合もこの場合に相当し測距不能とする。また、不足分の相関値f(n)を再演算するための処理を不足分相関値再演算処理といい、その詳細については後述する。   Therefore, among the shift amount ranges necessary for the shift amount nmin1 of the recalculation minimum minimum value fmin1, the shift amount outside the recalculation range in which the correlation value f (n) by the normal calculation has already been calculated is correlated by the normal calculation. Additional recalculation of the value f (n) is performed. However, if the difference (shift amount difference nSA) between the shift amount Tminin1 of the provisional minimum minimum value Tfmin1 and the shift amount nmin1 of the recalculation minimum minimum value fmin1 is a predetermined value (for example, 3) or more, the recalculation minimum minimum value Since there is a high possibility that fmin1 is not the minimum minimum value that should be detected, distance measurement is impossible. It should be noted that the case where the minimum value is not detected as a result of the recalculation corresponds to this case and the distance measurement is impossible. The process for recalculating the deficient correlation value f (n) is referred to as deficient correlation value recalculation processing, and details thereof will be described later.

次に、i3つおき演算により求めた相関値f(n)において極小値が複数存在し、そのうちの最小極小値(暫定最小極小値Tfmin1)と第2極小値(暫定第2極小値)との差が小さい場合について説明する。例えば、採用センサにおける全てのシフト量n(n=−2〜MAX(=38))について通常演算により相関値f(n)を算出した場合、図46に示すように極小値が複数存在し、最小極小値fmin1のシフト量nmin1がシフト量n=7で検出され、第2極小値fmin2のシフト量nmin2がシフト量n=32で検出されるものとする。そして、このようなAFデータに対してi3つおき演算により相関値f(n)を算出すると、図47に示すような相関値分布が得られたとする。この場合、CPU60は、まず、図47のようにi3つおき演算により算出した相関値f(n)の分布において最小極小値と第2極小値とを検出する。尚、i3つおき演算における最小極小値を上述のように暫定最小極小値Tfmin1、そのシフト量をTnmin1で表し、第2極小値を暫定第2極小値Tfmin2、そのシフト量をTnmin2で表す。また、図47では、暫定最小極小値Tfmin1のシフト量Tnmin1は32、暫定第2極小値Tfmin2のシフト量Tnmin2は6で検出されている。   Next, there are a plurality of minimum values in the correlation value f (n) obtained by every i3 calculation, and the minimum minimum value (provisional minimum minimum value Tfmin1) and the second minimum value (provisional second minimum value) among them A case where the difference is small will be described. For example, when the correlation value f (n) is calculated by normal calculation for all shift amounts n (n = −2 to MAX (= 38)) in the employed sensor, there are a plurality of minimum values as shown in FIG. It is assumed that the shift amount nmin1 of the minimum minimum value fmin1 is detected with a shift amount n = 7, and the shift amount nmin2 of the second minimum value fmin2 is detected with a shift amount n = 32. Then, when the correlation value f (n) is calculated for every such AF data by every i3 calculation, a correlation value distribution as shown in FIG. 47 is obtained. In this case, the CPU 60 first detects the minimum minimum value and the second minimum value in the distribution of the correlation value f (n) calculated by the calculation of every third i as shown in FIG. Note that, as described above, the minimum minimum value in every third i-th operation is expressed as the temporary minimum minimum value Tfmin1, the shift amount is expressed as Tnmin1, the second minimum value is expressed as the temporary second minimum value Tfmin2, and the shift amount is expressed as Tnmin2. In FIG. 47, the shift amount Tminin1 of the provisional minimum minimum value Tfmin1 is detected as 32, and the shift amount Tanmin2 of the provisional second minimum value Tfmin2 is detected as 6.

もし、i3つおき演算により検出された暫定最小極小値Tfmin1と暫定第2極小値Tfmin2との差(極小値差ΔTfmin=Tfmin2−Tfmin1)が所定の基準値以上の場合には、上述のようにCPU60は、暫定最小極小値Tfmin1のシフト量Tnmin1に対する再演算範囲のみで再演算(通常演算)を行う。一方、極小値差ΔTfminが上記基準値よりも小さい場合には、暫定最小極小値Tfmin1のシフト量Tnmin1に対する再演算範囲と、暫定第2極小値Tfmin2のシフト量Tnmin2に対する再演算範囲とで再演算を行う。但し、極小値差ΔTfminが上記基準値よりも小さい場合において、暫定最小極小値Tfmin1のシフト量Tnmin1と暫定第2極小値Tfmin2シフト量Tnmin2のいずれもが近距離警告範囲内であった場合には、再演算は行わずに近距離警告とする。いずれか一方でも近距離警告範囲内でない場合には上述の通り、両方のシフト量の近傍で再演算を行う。   If the difference between the provisional minimum minimum value Tfmin1 and the provisional second minimum value Tfmin2 (minimum value difference ΔTfmin = Tfmin2−Tfmin1) detected by every three i3 computations is equal to or greater than a predetermined reference value, as described above. The CPU 60 performs recalculation (normal calculation) only in the recalculation range for the shift amount Tnmin1 of the provisional minimum value Tfmin1. On the other hand, when the minimum value difference ΔTfmin is smaller than the reference value, recalculation is performed between the recalculation range for the shift amount Tnmin1 of the provisional minimum minimum value Tfmin1 and the recalculation range for the shift amount Tnmin2 of the provisional second minimum value Tfmin2. I do. However, when the minimum value difference ΔTfmin is smaller than the reference value, when both the shift amount Tminin1 of the provisional minimum minimum value Tfmin1 and the shift amount Tminin2 of the provisional second minimum value Tfmin2 are within the short distance warning range. The short distance warning is made without performing recalculation. If either one is not within the short distance warning range, recalculation is performed in the vicinity of both shift amounts as described above.

図48は、図47における極小値差ΔTfminが上記基準値よりも小さいと判断された場合における再演算の結果を示した図である。同図に示すように暫定最小極小値Tfmin1のシフト量Tnmin1(=32)に対して±5のシフト量範囲(シフト量n=27〜37)が再演算範囲として再演算され、その再演算範囲において通常演算による相関値f(n)が算出される。また、暫定第2極小値Tfmin2のシフト量Tnmin2(=6)に対しても±5のシフト量範囲(シフト量n=1〜11)が再演算範囲として再演算され、その再演算範囲において通常演算による相関値f(n)が算出される。これらの再演算範囲で再演算された相関値f(n)は図46の対応するシフト量範囲の相関値f(n)の値に等しい。   FIG. 48 is a diagram showing the result of recalculation when it is determined that the minimum value difference ΔTfmin in FIG. 47 is smaller than the reference value. As shown in the figure, a shift amount range of ± 5 (shift amount n = 27 to 37) is recalculated as a recalculation range with respect to the shift amount Tminin1 (= 32) of the provisional minimum value Tfmin1, and the recalculation range The correlation value f (n) by the normal calculation is calculated at. Further, a shift amount range of ± 5 (shift amount n = 1 to 11) is recalculated as a recalculation range with respect to the shift amount Tminin2 (= 6) of the provisional second minimum value Tfmin2, and the normal range in the recalculation range A correlation value f (n) is calculated by calculation. The correlation value f (n) recalculated in these recalculation ranges is equal to the correlation value f (n) in the corresponding shift amount range in FIG.

CPU60は、このように暫定最小極小値Tfmin1のシフト量Tnmin1付近と暫定第2極小値Tfmin2のシフト量Tnmin2付近で再演算を行うと、それらの再演算範囲において、再演算(通常演算)による相関値f(n)に基づいて極小値及びそのシフト量を検出する。これによって検出された最小極小値と第2極小値をそれぞれ再演算最小極小値fmin1、再演算第2極小値fmin2で表し、それらのシフト量をそれぞれシフト量fmin1、シフト量fmin2で表す。再演算最小極小値fmin1及びそのシフト量fmin1と、再演算第2極小値fmin2及びそのシフト量nmin2は、測距不能と判断される場合(後述)を除き、採用センサにおける全ての相関値f(n)を通常演算により求めた場合に検出される上述の最小極小値fmin1及びそのシフト量nmin1と、第2極小値fmin2及びそのシフト量nmin2に相当し、最小極小値fmin1のシフト量nmin1が相関値演算処理により検出すべき最高相関値fminのシフト量nminとなる。   When the CPU 60 performs recalculation in the vicinity of the shift amount Tanmin1 of the provisional minimum minimum value Tfmin1 and the shift amount Tanmin2 of the provisional second minimum value Tfmin2 in this way, correlation by recalculation (normal calculation) is performed in those recalculation ranges. Based on the value f (n), the minimum value and its shift amount are detected. The detected minimum minimum value and the second minimum value are represented by a recalculated minimum minimum value fmin1 and a recalculated second minimum value fmin2, respectively, and their shift amounts are represented by a shift amount fmin1 and a shift amount fmin2, respectively. The recalculated minimum minimum value fmin1 and its shift amount fmin1, the recalculated second minimum value fmin2 and its shift amount nmin2 are all correlation values f ( The above-mentioned minimum minimum value fmin1 and its shift amount nmin1 detected when n) is obtained by normal calculation correspond to the second minimum value fmin2 and its shift amount nmin2, and the shift amount nmin1 of the minimum minimum value fmin1 is correlated. This is the shift amount nmin of the highest correlation value fmin to be detected by the value calculation process.

次に、暫定最小極小値が複数存在する場合において、i3つおき演算により検出された暫定最小極小値Tfmin1のシフト量Tnmin1と再演算により検出された再演算最小極小値fmin1のシフト量nmin1とが一致しない場合について説明する。この場合、上述したのと同様に、再演算最小極小値fmin1のシフト量nmin1に対して、少なくとも一定のシフト量範囲(例えば、±5の範囲)で通常演算による相関値f(n)が必要となるため、不足分の相関値f(n)の再演算(通常演算)を追加で行う。   Next, when there are a plurality of provisional minimum values, the shift amount Tminin1 of the provisional minimum value Tfmin1 detected by every i3 calculation and the shift amount nmin1 of the recalculation minimum value fmin1 detected by recalculation are obtained. The case where they do not match will be described. In this case, as described above, the correlation value f (n) by the normal calculation is required at least in a certain shift amount range (for example, a range of ± 5) with respect to the shift amount nmin1 of the recalculated minimum minimum value fmin1. Therefore, the recalculation (normal calculation) of the insufficient correlation value f (n) is additionally performed.

また、シフト量差nSAが所定の基準値以上の場合には測距不能とするが、この場合のシフト量差nSAは、再演算最小極小値fmin1のシフト量nmin1が暫定最小極小値Tfmin1のシフト量Tnmin1に対する再演算に起因して検出されたものであれば、それらのシフト量差とするのが適切であるが、再演算最小極小値fmin1のシフト量nmin1が暫定第2極小値Tfmin2のシフト量Tnmin2に対する再演算に起因して検出された場合には、暫定第2極小値Tfmin2のシフト量Tnmin2と再演算最小極小値fmin1のシフト量nmin1とのシフト量差とするのが適切である。   Further, distance measurement is impossible when the shift amount difference nSA is equal to or larger than a predetermined reference value. In this case, the shift amount difference nSA is a shift of the recalculated minimum minimum value fmin1 to the temporary minimum minimum value Tfmin1. If it is detected due to the recalculation for the amount Tminin1, it is appropriate to make the difference between the shift amounts, but the shift amount nmin1 of the recalculation minimum minimum value fmin1 is the shift of the provisional second minimum value Tfmin2. When it is detected due to recalculation on the amount Tnmin2, it is appropriate to set the shift amount difference between the shift amount Tminin2 of the provisional second minimum value Tfmin2 and the shift amount nmin1 of the recalculation minimum minimum value fmin1.

そこで、暫定最小極小値Tfmin1のシフト量Tnmin1と再演算最小極小値fmin1のシフト量nmin1とのシフト量差DIS1(=|Tnmin1−nmin1|)と、暫定最小極小値Tfmin2のシフト量Tnmin2と再演算最小極小値fmin1のシフト量nmin1とのシフト量差DIS2(=|Tnmin2−nmin1|)を求め、そのうち小さい方の値をシフト量差nSAとしてシフト量差nSAにより測距可能か否かを判断する。   Therefore, the shift amount difference DIS1 (= | Tnmin1-nmin1 |) between the shift amount Tminin1 of the provisional minimum minimum value Tfmin1 and the shift amount nmin1 of the recalculation minimum minimum value fmin1, and the shift amount Tnmin2 of the provisional minimum minimum value Tfmin2 are recalculated. A shift amount difference DIS2 (= | Tnmin2−nmin1 |) of the minimum minimum value fmin1 and the shift amount nmin1 is obtained, and it is determined whether or not distance measurement is possible using the smaller value as the shift amount difference nSA. .

図48に示した場合、再演算最小極小値fmin1のシフト量nmin1は7であるから、シフト量差DIS1は図中(1)で示す1の値となり、シフト量差DIS2は図中(2)で示す25となる。従って、測距可能か否かは、シフト量差DIS1の大きさで判断する。   In the case shown in FIG. 48, since the shift amount nmin1 of the recalculated minimum minimum value fmin1 is 7, the shift amount difference DIS1 is a value of 1 shown in (1) in the figure, and the shift amount difference DIS2 is (2) in the figure. It becomes 25 shown by. Accordingly, whether or not distance measurement is possible is determined by the magnitude of the shift amount difference DIS1.

図49は、不足分再演算処理の処理手順を示したフローチャートである。不足分再演算処理を実施する前において、CPU60は、i3つおき演算により相関値f(n)を算出し、暫定最小極小値Tfmin1のシフト量Tnmin1を検出する。また、暫定最小最小極Tfmin1以外に暫定第2極小値Tfmin2が存在する場合には、そのシフト量Tnmin2を検出する。そして、再演算範囲で通常演算による再演算を行い、再演算範囲において再演算最小極小値fmin1のシフト量nmin1を検出する。   FIG. 49 is a flowchart showing the processing procedure of the shortage recalculation processing. Before executing the shortage recalculation process, the CPU 60 calculates the correlation value f (n) by every third i-th operation, and detects the shift amount Tnmin1 of the temporary minimum value Tfmin1. If there is a provisional second minimum value Tfmin2 other than the provisional minimum / minimum pole Tfmin1, the shift amount Tminin2 is detected. Then, recalculation by normal calculation is performed in the recalculation range, and the shift amount nmin1 of the recalculation minimum minimum value fmin1 is detected in the recalculation range.

続いて図49の不足分再演算処理に移行する。まず、暫定第2極小値Tfmin2のシフト量Tnmin2が存在するか否か、即ち、暫定第2極小値Tfmin2が存在するか否かを判定する(ステップS150)。NOであれば、後述のステップS168に移行する。一方、YESであれば、次に、暫定第2極小値Tfmin2のシフト量Tnmin2に対して±5のシフト量nの範囲を再演算範囲として再演算を実施したか否かを判定する(ステップS152)。もし、NOと判定した場合には、後述のステップS168に移行する。一方、YESと判定した場合には、(シフト量nmin1≧シフト量Tnmin1)か否かを判定する(ステップS154)。YESであれば、暫定最小極小値Tfmin1と再演算最小極小値fmin1とのシフト量差の大きさを示す値DIS1を(DIS1=nmin1−Tnmin1)とし(ステップS156)、NOであれば、シフト量差DIS1を(DIS1=Tnmin1−nmin1)とする(ステップS158)。   Subsequently, the process shifts to the shortage recalculation process of FIG. First, it is determined whether or not the shift amount Tnmin2 of the provisional second minimum value Tfmin2 exists, that is, whether or not the provisional second minimum value Tfmin2 exists (step S150). If NO, the process proceeds to step S168 described later. On the other hand, if YES, it is next determined whether or not the recalculation is performed with the range of the shift amount n of ± 5 as the recalculation range with respect to the shift amount Tminin2 of the provisional second minimum value Tfmin2 (step S152). ). If NO is determined, the process proceeds to step S168 described later. On the other hand, when it determines with YES, it is determined whether it is (shift amount nmin1> = shift amount Tnmin1) (step S154). If YES, the value DIS1 indicating the magnitude of the shift amount difference between the provisional minimum minimum value Tfmin1 and the recalculated minimum minimum value fmin1 is set to (DIS1 = nmin1-Tnmin1) (step S156), and if NO, the shift amount The difference DIS1 is set as (DIS1 = Tnmin1-nmin1) (step S158).

次に、CPU60は、(シフト量nmin1≧シフト量Tnmin2)か否かを判定する(ステップS160)。YESであれば、暫定第2極小値Tfmin2と再演算最小極小値fmin1とのシフト量差の大きさを示す値DIS2を(DIS1=nmin1−Tnmin2)とし(ステップS162)、NOであれば、シフト量差DIS2を(DIS2=Tnmin2−nmin1)とする(ステップS164)。   Next, the CPU 60 determines whether or not (shift amount nmin1 ≧ shift amount Tnmin2) (step S160). If YES, the value DIS2 indicating the magnitude of the shift amount difference between the provisional second minimum value Tfmin2 and the recalculated minimum minimum value fmin1 is set to (DIS1 = nmin1−Tminin2) (step S162). The quantity difference DIS2 is set to (DIS2 = Tnmin2-nmin1) (step S164).

次に、(DIS1≦DIS2)か否かを判定し(ステップS166)、YES、即ち、再演算最小極小値fmin1が暫定第2極小値Tfmin2よりも暫定最小極小値Tfmin1に近い位置にあると判定した場合には、暫定値ZANTEI=シフト量Tnmin1とする(ステップS168)。NO、即ち、再演算最小極小値fmin1が暫定最小極小値Tfmin1よりも暫定第2極小値Tfmin2に近い位置にあると判定した場合には、暫定値ZANTEI=シフト量Tnmin2とする(ステップS170)。尚、ステップS150、又は、ステップS152においてNOと判定した場合には、ステップS168に移行して、暫定値ZANTEI=シフト量Tnmin1とする。   Next, it is determined whether (DIS1 ≦ DIS2) (step S166), YES, that is, it is determined that the recalculation minimum minimum value fmin1 is closer to the temporary minimum minimum value Tfmin1 than the temporary second minimum value Tfmin2. In such a case, the provisional value ZANTEI = shift amount Tnmin1 is set (step S168). If NO, that is, if it is determined that the recalculated minimum minimum value fmin1 is closer to the provisional second minimum value Tfmin2 than the provisional minimum minimum value Tfmin1, the provisional value ZANTEI = shift amount Tnmin2 is set (step S170). If NO is determined in step S150 or step S152, the process proceeds to step S168, where the provisional value ZANTEI = shift amount Tnmin1.

次に、CPU60は、(ZANTEI≧nmin1)か否か、即ち、再演算最小極小値fmin1のシフト量nmin1が暫定値ZANTEIに対して+側又は−側のいずれにあるかを判定する(ステップS172)。YESと判定した場合、シフト量差nSAを(nSA=ZANTEI−nmin1)とする(ステップS174)。   Next, the CPU 60 determines whether or not (ZANTEI ≧ nmin1), that is, whether the shift amount nmin1 of the recalculation minimum minimum value fmin1 is on the + side or the − side with respect to the provisional value ZANTEI (step S172). ). If YES is determined, the shift amount difference nSA is set to (nSA = ZANTEI-nmin1) (step S174).

そして、まず、(nSA≧3)か否かを判定する(ステップS176)。YESと判定した場合には、測距不能として(ステップS178)、この不足分再演算処理を終了する。   First, it is determined whether (nSA ≧ 3) (step S176). If YES is determined, ranging is impossible (step S178), and the shortage recalculation process is terminated.

ステップS176においてNOと判定した場合には、続いて、(nSA=2)か否かを判定する(ステップS180)。ここでYESと判定した場合には、シフト量n=nmin1−4及びnmin1−5における相関値f(nmin1−4)と、相関値f(nmin1−5)を通常演算により再演算する(ステップS182)。   If NO is determined in step S176, it is subsequently determined whether (nSA = 2) or not (step S180). If YES is determined here, the correlation value f (nmin1-4) and the correlation value f (nmin1-5) at the shift amounts n = nmin1-4 and nmin1-5 are recalculated by normal calculation (step S182). ).

ステップS180においてNOと判定した場合には、次に(nSA=1)か否かを判定する(ステップS184)。YESと判定した場合には、シフト量nmin1−5における相関値f(nmin1−5)を通常演算により再演算する(ステップS186)。   If it is determined as NO in step S180, it is next determined whether or not (nSA = 1) (step S184). When it determines with YES, the correlation value f (nmin1-5) in shift amount nmin1-5 is recalculated by a normal calculation (step S186).

ステップS184においてNOと判定した場合には再演算(不足分の再演算)を行わず(ステップS188)、不足分再演算の処理を終了する。   When it is determined NO in step S184, recalculation (recalculation for shortage) is not performed (step S188), and the deficiency recalculation process is terminated.

上記ステップS172においてNOと判定した場合には、シフト量差nSA=nmin1−ZANTEIとする(ステップS190)。   If NO is determined in step S172, the shift amount difference nSA = nmin1-ZANTEI is set (step S190).

そして、まず、(nSA≧3)か否かを判定する(ステップS192)。YESと判定した場合には、測距不能として(ステップS194)、この不足分再演算処理を終了する。   First, it is determined whether or not (nSA ≧ 3) (step S192). If YES is determined, ranging is impossible (step S194), and the shortage recalculation process is terminated.

ステップS192においてNOと判定した場合には、続いて、(nSA=2)か否かを判定する(ステップS196)。ここでYESと判定した場合には、シフト量n=nmin1−4及びnmin1−5における相関値f(nmin1−4)と、相関値f(nmin1−5)を通常演算により再演算する(ステップS198)。   If NO is determined in step S192, it is subsequently determined whether (nSA = 2) or not (step S196). If YES is determined here, the correlation value f (nmin1-4) and the correlation value f (nmin1-5) at the shift amounts n = nmin1-4 and nmin1-5 and the correlation value f (nmin1-5) are recalculated by normal calculation (step S198). ).

ステップS196においてNOと判定した場合には、次に(nSA=1)か否かを判定する(ステップS200)。YESと判定した場合には、シフト量n=nmin1−5における相関値f(nmin1−5)を通常演算により再演算する(ステップS202)。   If NO is determined in step S196, it is next determined whether or not (nSA = 1) (step S200). When it determines with YES, the correlation value f (nmin1-5) in shift amount n = nmin1-5 is recalculated by a normal calculation (step S202).

ステップS196においてNOと判定した場合には再演算(不足分の再演算)を行わず(ステップS188)、不足分再演算の処理を終了する。   If NO is determined in step S196, recalculation (recalculation for shortage) is not performed (step S188), and the deficiency recalculation process is terminated.

尚、不足分再演算範囲がnの最小値(−2)未満、又は、nの最大値(38)を超えた場合は再演算を実施しないこととする。   Note that if the shortage recalculation range is less than the minimum value (−2) of n or exceeds the maximum value (38) of n, the recalculation is not performed.

以上の不足分再演算処理により最高相関値fminのシフト量nminに対して必要なシフト量範囲の通常演算による相関値f(n)が得られる。   Through the above shortage recalculation process, the correlation value f (n) by the normal calculation of the shift amount range necessary for the shift amount nmin of the maximum correlation value fmin is obtained.

次に、以上のi3つおき演算に特有の誤測距及びその防止について説明する。i3つおき演算に特有の誤測距は、上記「AFデータの取得処理」の欄で説明したようにセンサデータにコントラスト抽出処理(2画素差分演算)を施したものをAFデータとする場合において特に問題となる。図50(A)、(B)は2画素差分演算により得たRセンサ94とLセンサ96のAFデータのうち、シフト量n=0におけるi3つおき演算で使用するAFデータを例示した図である。この場合、相関値演算は3つおきにデータを使用しているため、コントラストの有る部分を捉えることができない。一方、この前後の前後のシフト量ではコントラストの有る部分を捉えることができるので、シフト量n=0で極小値となる可能性が高い。この状態からシフト量nが8ずれた場合(n=8)は、i3つおき演算で使用するAFデータのセンサ番号は4つシフトすることになるため、端の1つ以外は全てn=0のときと同じAFデータが使用されることになる。このとき新たに加わった端のAFデータにコントラストがなかった場合には、再びこのシフト量n=8においても極小値となる可能性が高い。   Next, a description will be given of erroneous ranging and its prevention, which are peculiar to every third i3 calculation. As described in the above “AF data acquisition process” section, an erroneous distance measurement specific to every third i calculation is performed when the sensor data subjected to contrast extraction processing (two-pixel difference calculation) is used as AF data. Especially problematic. FIGS. 50A and 50B are diagrams illustrating AF data used in every third i-th calculation at the shift amount n = 0, among the AF data of the R sensor 94 and the L sensor 96 obtained by the two-pixel difference calculation. is there. In this case, since every third correlation value calculation uses data, a portion having contrast cannot be captured. On the other hand, since the shift amount before and after this can capture a portion having contrast, there is a high possibility that the shift amount n = 0 will be a minimum value. When the shift amount n is deviated by 8 from this state (n = 8), the sensor number of AF data used in every third i3 calculation is shifted by 4, so that n = 0 except for one of the ends. The same AF data as in the case of is used. At this time, if there is no contrast in the newly added AF data at the end, there is a high possibility that the shift value n = 8 again becomes the minimum value.

このような現象はシフト量が8ずつシフトするごとに繰り返される。図51は、図50(A)、(B)のAFデータの例でi3つおき演算を行って相関値f(n)を算出した結果を示したものであり、同図に示すようにシフト量n=0、8、16、…において極小値が検出される。尚、図50(A)、(B)のAFデータの例で通常演算を行った場合の相関値分布を図52に示す。このように通常演算において検出される真の極小値とは無関係の位置で極小値が検出されるため、誤測距を招くおそれがある。   Such a phenomenon is repeated every time the shift amount is shifted by 8. FIG. 51 shows the result of calculating the correlation value f (n) by performing every i3 calculation in the AF data examples of FIGS. 50 (A) and 50 (B). As shown in FIG. Minimal values are detected in the quantities n = 0, 8, 16,. FIG. 52 shows the correlation value distribution when normal calculation is performed on the AF data examples of FIGS. 50 (A) and 50 (B). As described above, since the local minimum value is detected at a position unrelated to the true local minimum value detected in the normal calculation, there is a risk of erroneous distance measurement.

また、図50のようなセンサデータの態様が実測で得られた場合にi3つおき演算で求めた相関値f(n)を図53に示す。この場合、暫定最小極小値Tfmin1はシフト量Tnmin1=33で検出され、暫定第2極小値Tfmin2はシフト量Tnmin2=26で検出されている。このような実測においては、図50(A)、(B)のようにあるシフト量nの相関値を算出する際に使用する全てのセンサデータにコントラストがないということはほとんど無く、多少のコントラストが存在しており、その影響で極小値が8ごとのシフト量間隔で繰り返されずに、±1ずれて7や9のシフト量間隔で観測される場合がある。   FIG. 53 shows the correlation value f (n) obtained by calculation every third i3 when the sensor data mode as shown in FIG. 50 is obtained by actual measurement. In this case, the provisional minimum value Tfmin1 is detected with the shift amount Tminin1 = 33, and the provisional second minimum value Tfmin2 is detected with the shift amount Tminin2 = 26. In such an actual measurement, as shown in FIGS. 50A and 50B, there is almost no absence of contrast in all sensor data used when calculating the correlation value of a certain shift amount n, and there is a slight contrast. As a result, there is a case where the minimum value is not repeated at every shift amount interval of 8 due to the influence, and is observed at a shift amount interval of 7 or 9 with a deviation of ± 1.

以上のことから、暫定最小極小値Tfmin1と暫定第2極小値Tfmin2との差が所定の調整値aより小さい場合であって、暫定最小極小値のシフト量Tnmin1と暫定第2極小値のシフト量Tnmin2との差が8の倍数であるか、又は、8の倍数の±1である場合にはi3つおき演算ではなく上記通常演算により相関値演算を行うようにする。即ち、
[数13]
Tfmin2−Tfmin1<調整値a
かつ、
[数14]
|Tnmin1−Tnmin2|=(8の倍数)又は(8の倍数の±1)
の場合には通常演算に切り替える。通常演算に切り替えることによってi3つおき演算に特有の誤測距を防止することができる。尚、i3つおき演算ではなく通常演算により相関値演算を行う場合、暫定最小極小値のシフト量Tnmin1と暫定第2極小値のシフト量Tnmin2との差が、8の倍数であるか、又は、8の倍数の±1であることを条件の一つとしたが、i3つおき演算の場合に限らず、この条件を一般化すると、任意の値xに対してセル位置iがxつおきのixつおき演算の場合には、暫定最小極小値のシフト量Tnmin1と暫定第2極小値のシフト量Tnmin2との差が、(x+1)×2の倍数であるか、又は、(x+1)×2の倍数の±1であることという条件となる。
Thus, the difference between the provisional minimum minimum value Tfmin1 and the provisional second minimum value Tfmin2 is smaller than the predetermined adjustment value a, and the shift amount between the provisional minimum minimum value Tmin1 and the provisional second minimum value. When the difference from Tnmin2 is a multiple of 8 or ± 1 of a multiple of 8, the correlation value calculation is performed by the above normal calculation instead of every i3 calculation. That is,
[Equation 13]
Tfmin2−Tfmin1 <Adjustment value a
And,
[Formula 14]
| Tnmin1-Tnmin2 | = (multiple of 8) or (± 1 of multiples of 8)
In case of, switch to normal calculation. By switching to the normal calculation, it is possible to prevent erroneous ranging unique to every third i-th calculation. When the correlation value calculation is performed by normal calculation instead of every i3 calculation, the difference between the shift amount Tminin1 of the provisional minimum minimum value and the shift amount Tnmin2 of the provisional second minimum value is a multiple of 8, or One condition is that it is ± 1 that is a multiple of 8. However, this condition is not limited to every other i3 operation, and this condition is generalized to ix with every x cell positions i for any value x. In the case of every other calculation, the difference between the shift amount Tminin1 of the provisional minimum minimum value and the shift amount Tminin2 of the provisional second minimum value is a multiple of (x + 1) × 2, or (x + 1) × 2 The condition is that the multiple is ± 1.

次に、相関値演算処理において測距時間の短縮を図る第2の実施の形態について説明する。上述の通常演算、i3つおき演算のいずれの場合においても採用センサにおける全てのシフト量n(n=−2,−1,0,1,…,MAX(=38))について、相関値f(n)を算出するようにしたが、本第2の実施の形態においては、全てのシフト量nについての相関値f(n)は算出せず、一定間隔おきのシフト量nについての相関値f(n)を算出する。例えば、シフト量nを3つおきに算出する。尚、シフト量nを3つおきにとる場合の相関値演算を以下、「n3つおき演算」といい、これに対して、全てのシフト量nについ相関値f(n)を求める場合の相関値演算を本第2の実施の形態の説明では「通常演算」という(第1の実施の形態における「通常演算」の意味とは異なる)。また、n3つおき演算において相関値f(n)を算出するシフト量nを、採用シフト量nという。   Next, a second embodiment for reducing the distance measurement time in the correlation value calculation process will be described. In any case of the above-described normal calculation and every third i calculation, the correlation value f () for all shift amounts n (n = −2, −1, 0, 1,..., MAX (= 38)) in the employed sensor. In this second embodiment, the correlation value f (n) for all the shift amounts n is not calculated, but the correlation value f for the shift amounts n at regular intervals is calculated in the second embodiment. (n) is calculated. For example, every third shift amount n is calculated. The correlation value calculation in the case where every third shift amount n is taken is hereinafter referred to as “every three n3 calculation”. On the other hand, the correlation value in the case where the correlation value f (n) is obtained for all the shift amounts n. The value calculation is referred to as “normal calculation” in the description of the second embodiment (different from the meaning of “normal calculation” in the first embodiment). Further, the shift amount n for calculating the correlation value f (n) in every third n-th operation is referred to as adopted shift amount n.

図54(A)は、採用センサのセンサ数(即ち、採用センサ数)が62、ウインドウサイズが42の場合に、n3つおき演算における採用シフト量nの例を示しており、採用シフト量nは、シフト量n=−2から3つおきのn=2、6、10、14、…、38に設定される。尚、同図のN1は、図12を参照すると、採用センサ96Aの右端に対する各採用シフト量n=−2、2、6、…におけるLウインドウ96Bのシフト量を示し、N2は、採用センサ94Aの左端に対する各採用シフト量におけるRウインドウ94Bのシフト量を示す。   FIG. 54 (A) shows an example of the employed shift amount n in the calculation every third n3 when the number of employed sensors (that is, the number of employed sensors) is 62 and the window size is 42. Are set to every third n = 2, 6, 10, 14,..., 38 from the shift amount n = −2. 12, N1 indicates the shift amount of the L window 96B at each adopted shift amount n = −2, 2, 6,... With respect to the right end of the adopted sensor 96A, and N2 represents the adopted sensor 94A. The shift amount of the R window 94B at each adopted shift amount with respect to the left end of FIG.

但し、n3つおき演算においても図54(A)に示す採用シフト量以外に図54(B)に示すシフト量n=−1、0、36、37については採用シフト量として相関値f(n)を算出することが望ましい。図55、図56、図57は、通常演算により全てのシフト量nについて相関値f(n)を求めた場合において、最小極小値fmin1が遠距離、中距離、近距離のそれぞれに得られる場合を仮定して、図54(A)に示した採用シフト量n(=2、6、10、14、…、38)のみで相関値f(n)を算出した場合の相関値分布と、図54(A)に示した採用シフト量nと併せて図54(B)に示した採用シフト量n(=−1、0、36、37)で相関値f(n)を算出した場合の相関値分布を示したグラフである。尚、図54(A)の採用シフト量nのみの相関値分布は、図中「□」記号の点を結ぶ分布により示し、図54(A)及び図54(B)の採用シフト量nの相関値分布は、図中「▲」記号の点を結ぶ分布により示す。   However, in the calculation every third n3, in addition to the adopted shift amount shown in FIG. 54A, the shift value n = −1, 0, 36, 37 shown in FIG. ) Is desirable. FIG. 55, FIG. 56, and FIG. 57 show the case where the minimum minimum value fmin1 is obtained for each of the long distance, the medium distance, and the short distance when the correlation value f (n) is obtained for all the shift amounts n by the normal calculation. , And the correlation value distribution when the correlation value f (n) is calculated using only the employed shift amount n (= 2, 6, 10, 14,..., 38) shown in FIG. The correlation when the correlation value f (n) is calculated with the adopted shift amount n (= -1, 0, 36, 37) shown in FIG. 54 (B) together with the adopted shift amount n shown in 54 (A). It is the graph which showed value distribution. The correlation value distribution of only the adopted shift amount n in FIG. 54 (A) is shown by a distribution connecting the dots indicated by “□” in the figure, and the correlation of the adopted shift amount n in FIGS. 54 (A) and 54 (B). The correlation value distribution is indicated by a distribution connecting points indicated by “「 ”in the figure.

まず、通常演算により本来検出される最小極小値fmin1が遠距離のシフト量に存在する場合であって、その最小極小値fmin1が図54(A)の採用シフト量nと異なるシフト量n=−1にあるとする。この場合に図54(A)の採用シフト量nのみで相関値f(n)を算出すると、図55の「□」記号を結ぶ相関値分布に示すように、これによって算出された相関値分布からは、そのシフト量n=−1付近において極小値が検出されない事態が生じる。これに対して、図54(B)の採用シフト量n(=−1、0)において相関値f(n)を算出すれば、図55の「▲」記号を結ぶ相関値分布に示すようにシフト量n=−1において最小極小値が検出され、遠距離側において本来検出されるべき最小極小値fmin1が検出されない不具合が解消される。   First, in the case where the minimum minimum value fmin1 originally detected by the normal calculation exists in the shift amount at a long distance, the minimum minimum value fmin1 is different from the adopted shift amount n in FIG. Suppose that it is in 1. In this case, when the correlation value f (n) is calculated using only the adopted shift amount n in FIG. 54A, the correlation value distribution calculated by this is shown in the correlation value distribution connecting the “□” symbols in FIG. Therefore, there occurs a situation in which the minimum value is not detected in the vicinity of the shift amount n = −1. On the other hand, when the correlation value f (n) is calculated at the adopted shift amount n (= −1, 0) in FIG. 54B, as shown in the correlation value distribution connecting the “▲” symbols in FIG. The minimum minimum value is detected at the shift amount n = −1, and the problem that the minimum minimum value fmin1 that should be detected on the long distance side is not detected is solved.

これと同様に、通常演算により本来検出される最小極小値fmin1が近距離のシフト量に存在する場合であって、その最小極小値fmin1が図54(A)の採用シフト量nと異なるシフト量n=−37にあるとする。この場合に図54(A)の採用シフト量nのみで相関値f(n)を算出すると、図57の「□」記号を結ぶ相関値分布に示すように、これによって算出された相関値分布からは、そのシフト量n=−37付近において極小値が検出されない事態が生じる。これに対して、図54(B)の採用シフト量n(=36、37)において相関値f(n)を算出すれば、図57の「▲」記号を結ぶ相関値分布に示すようにシフト量n=−37において最小極小値が検出され、近距離側において本来検出されるべき最小極小値fmin1が検出されない不具合が解消される。   Similarly, in the case where the minimum minimum value fmin1 originally detected by the normal calculation exists in the shift amount in the short distance, the minimum minimum value fmin1 is different from the adopted shift amount n in FIG. 54A. Let n = −37. In this case, when the correlation value f (n) is calculated using only the adopted shift amount n in FIG. 54A, the correlation value distribution calculated by this is shown in the correlation value distribution connecting the “□” symbols in FIG. Therefore, there occurs a situation in which the minimum value is not detected in the vicinity of the shift amount n = −37. On the other hand, if the correlation value f (n) is calculated at the adopted shift amount n (= 36, 37) in FIG. 54B, the shift is as shown in the correlation value distribution connecting the “▲” symbols in FIG. The minimum minimum value is detected in the quantity n = −37, and the problem that the minimum minimum value fmin1 that should be detected on the short distance side is not detected is solved.

一方、通常演算により本来検出される最小極小値fmin1が中距離に存在する場合においては、上述のような不具合はほとんど生じない。例えば、図56の細線で示すように通常演算による最小極小値fmin1が図54(A)の採用シフト量nと異なるシフト量n=16にあるとする。このような場合に図54(A)の採用シフト量nのみで相関値f(n)を算出したとすると、図56の「□」記号を結ぶ相関値分布に示すようにシフト量n=16の近傍の例えばシフト量n=18において極小値が検出される。一般に、最小極小値fmin1のシフト量nmin1が中距離に存在する場合には、そのシフト量nに向かって両側から相関値が小さくなる相関値分布を示すため、図54(A)の採用シフト量nのみで相関値f(n)を算出した場合であっても最小極小値fmin1のシフト量nに対して、少なくともその近傍で極小値が検出される。極小値の存在が分かれば、通常演算により検出される最小極小値fmi1の正確なシフト量nmin1は、後述の再演算によって検出できるため、このn3つおき演算の処理としては十分である。   On the other hand, in the case where the minimum minimum value fmin1 that is originally detected by the normal calculation exists at a medium distance, the above-described problems hardly occur. For example, as shown by the thin line in FIG. 56, it is assumed that the minimum minimum value fmin1 obtained by the normal calculation is at a shift amount n = 16 different from the adopted shift amount n in FIG. In such a case, assuming that the correlation value f (n) is calculated using only the adopted shift amount n in FIG. 54A, the shift amount n = 16 as shown in the correlation value distribution connecting the “□” symbols in FIG. For example, a minimum value is detected at a shift amount n = 18 in the vicinity of. In general, when the shift amount nmin1 of the minimum minimum value fmin1 exists at a medium distance, a correlation value distribution in which the correlation value decreases from both sides toward the shift amount n is shown. Even when the correlation value f (n) is calculated only by n, the minimum value is detected at least in the vicinity of the shift amount n of the minimum minimum value fmin1. If the existence of the minimum value is known, the accurate shift amount nmin1 of the minimum minimum value fmi1 detected by the normal calculation can be detected by the recalculation described later, which is sufficient for the processing of every third n3 calculation.

以上のことから、n3つおき演算では図54(A)に示した採用シフト量nのみでなく、図54(B)に示した採用シフト量nについても相関値f(n)を算出するのが好適である。以下、図54(A)のように3つおきの採用シフト量nと、図54(B)のように遠距離側及び近距離側の特定の採用シフト量nとにおいて相関値f(n)を算出することをn3つおき演算というものとする。但し、図54(A)の採用シフト量nのみで相関値演算を行うようにしてもよく、また、この場合に図55や図57に示すような極小値の存在しない相関値分布が得られたときには、遠距離又は近距離に極小値が存在すると仮定して後述の再演算を行うようにしてもよい。   From the above, every third n3 calculation calculates the correlation value f (n) not only for the adopted shift amount n shown in FIG. 54 (A) but also for the adopted shift amount n shown in FIG. 54 (B). Is preferred. Hereinafter, the correlation value f (n) between every third adopted shift amount n as shown in FIG. 54A and a particular adopted shift amount n on the far side and near side as shown in FIG. 54B. It is assumed that every third n3 is calculated. However, the correlation value calculation may be performed using only the adopted shift amount n in FIG. 54A, and in this case, a correlation value distribution having no minimum value as shown in FIGS. 55 and 57 is obtained. In such a case, the recalculation described later may be performed on the assumption that there is a minimum value at a long distance or a short distance.

CPU60は、上述のようにn3つおき演算により採用シフト量nにおける相関値f(n)を算出した場合、採用シフト量nで得られた相関値f(n)の分布から相関値f(n)が極小値となるシフト量nを検出する。このとき検出された極小値が1つの場合にはその極小値を暫定最小極小値Tfmin1とし、検出された極小値が複数の場合にはそのうちの最小の極小値を暫定最小極小値とし、その暫定最小極小値のシフト量付近において再度、通常演算により相関値f(n)を再演算する。尚、この再演算の処理は、上述のi3つおき演算における再演算と全く同様の方法を用いることができ、再演算の範囲、検出された極小値が複数の場合の処理方法、不足分相関値演算等の詳細な説明については省略する。また、用語の定義もi3つおき演算の説明で使用したものと同様とする。   When the CPU 60 calculates the correlation value f (n) at the adopted shift amount n by every n3 computations as described above, the CPU 60 calculates the correlation value f (n) from the distribution of the correlation values f (n) obtained at the adopted shift amount n. ) Detects the shift amount n at which the minimum value is obtained. When the detected minimum value is one, the minimum value is set as the provisional minimum minimum value Tfmin1, and when the detected minimum value is plural, the minimum minimum value is set as the provisional minimum minimum value. The correlation value f (n) is recalculated again by normal calculation again in the vicinity of the shift amount of the minimum minimum value. Note that this recalculation process can use the same method as the recalculation in every third i-th operation described above, the recalculation range, the processing method when there are a plurality of detected minimum values, and the correlation of the shortage. Detailed description of value calculation and the like will be omitted. The definition of terms is the same as that used in the description of every third i operation.

再演算範囲は、暫定最小極小値Tfmin1のシフト量Tnmin1に対して例えば±5のシフト量の範囲とし、図56の例では、暫定最小極小値Tfmin1が得られたシフト量Tnmin1は18であるから、再演算範囲は、図58に示すようにシフト量n=13〜23となる。但し、n3つおき演算において既に相関値f(n)を算出している採用シフト量nついては再演算で改めて相関値f(n)を算出する必要はなく、図58に示すように再演算範囲に含まれる採用シフト量n=14、18、22については、再演算において相関値f(n)の算出は行わない。   The recalculation range is, for example, a shift amount range of ± 5 with respect to the shift amount Tminin1 of the provisional minimum value Tfmin1, and in the example of FIG. The recalculation range is the shift amount n = 13 to 23 as shown in FIG. However, for the adopted shift amount n for which the correlation value f (n) has already been calculated in every third calculation, it is not necessary to calculate the correlation value f (n) again by recalculation, and the recalculation range as shown in FIG. For the adopted shift amounts n = 14, 18, and 22 included in, the correlation value f (n) is not calculated in the recalculation.

CPU60は、以上の再演算によって再演算範囲の相関値f(n)を算出すると、その再演算範囲の相関値f(n)に基づいて最小極小値fmin1のシフト量nmin1を検出し、そのシフト量nmin1を相関値演算において検出すべき最高相関のシフト量nminとする。   When the CPU 60 calculates the recalculation range correlation value f (n) by the above recalculation, the CPU 60 detects the shift amount nmin1 of the minimum minimum value fmin1 based on the recalculation range correlation value f (n), and the shift. Let the amount nmin1 be the shift amount nmin of the highest correlation to be detected in the correlation value calculation.

ここで、i3つおき演算、又は、n3つおき演算を採用した場合における演算数について示しておくと、例えば、上述の採用センサ数62、ウインドウサイズ42の場合、i3つおき演算においては、演算数は41/4=10.25であり、再演算数11を合わせて合計21.25個である。n3つおき演算においては、演算数は15であり、再演算数8を合わせて合計23個である。これに対して、通常演算の場合には、41個であるから、i3つおき演算、n3つおき演算では、演算数が十分削減され、測距時間の短縮が図られるのが分かる。   Here, the number of operations when every third i-th operation or every third n-th operation is adopted is shown. For example, in the case of the above-mentioned number of employed sensors 62 and window size 42, in every third i-th operation, The number is 41/4 = 10.25, and the total number of recalculations 11 is 21.25. In every n3 computations, the number of computations is 15, and the total number of recalculations is 8 for a total of 23. On the other hand, in the case of the normal calculation, since the number is 41, it can be seen that the calculation number is sufficiently reduced and the distance measurement time is shortened in every third calculation and every third calculation.

以上説明した第1の実施の形態におけるi3つおき演算において、暫定最小極小値Tfmin1のシフト量nmin1と、通常演算の最小極小値fmin1のシフト量nmin1とが一致しない場合、それらのシフト量差が大きいと不足分相関値演算における演算数が増加するため時間短縮の効果が少なくなる。また、i3つおき演算では、データ数が通常演算の1/4になるため精度が低下し暫定極小値が現れない場合がある。このような現象はAFデータのコントラストが低い場合に多くみられる。   In the i3 calculation in the first embodiment described above, if the shift amount nmin1 of the provisional minimum minimum value Tfmin1 does not match the shift amount nmin1 of the minimum minimum value fmin1 of the normal calculation, the difference between the shift amounts is If it is larger, the number of operations in the shortage correlation value calculation increases, so the effect of shortening the time is reduced. Further, in every third i calculation, the number of data is ¼ that of the normal calculation, so the accuracy is lowered and the temporary minimum value may not appear. Such a phenomenon is often seen when the contrast of AF data is low.

そこで、採用センサにおけるAFデータのコントラストが所定の基準値より大きい場合には、i3つおき演算を行い、低い場合には、通常演算を行うようにすれば、このような現象の多くは生じなくなる。また、コントラストが低い場合には、第2の実施の形態におけるn3つおき演算を行うようにしてもよい。   Therefore, if the contrast of the AF data in the employed sensor is greater than a predetermined reference value, every other i3 calculation is performed, and if it is low, the normal calculation is performed. . In addition, when the contrast is low, every third n3 calculation in the second embodiment may be performed.

{コントラスト検出処理(図7ステップS14、ステップS18)の詳細}
次に、図7のステップS14におけるコントラス検出処理1及びステップS18におけるコントラス検出処理2について詳説する。コントラスト検出は、AFセンサ74の所定範囲内のセル(センサデータ)から得られたAFデータの最大値と最小値に基づいてセンサ像(AFデータ)のコントラストの有無を検出する処理である。コントラストの評価値として本実施の形態では、AFデータの最大値と最小値との差を用い、コントラストが所定の基準値以上であればコントラスト有りと判定し、前記基準値より小さければコントラスト無しと判定する。
{Details of Contrast Detection Processing (Steps S14 and S18 in FIG. 7)}
Next, the contrast detection process 1 in step S14 and the contrast detection process 2 in step S18 will be described in detail. The contrast detection is a process of detecting the presence or absence of contrast in the sensor image (AF data) based on the maximum value and the minimum value of AF data obtained from cells (sensor data) within a predetermined range of the AF sensor 74. In the present embodiment, the difference between the maximum value and the minimum value of the AF data is used as the contrast evaluation value. If the contrast is equal to or higher than a predetermined reference value, it is determined that there is contrast, and if it is smaller than the reference value, there is no contrast. judge.

図7のステップS14におけるコントラスト検出処理1は、測距エリアを構成する各分割エリアごとに分割エリアの全セル、即ち、採用センサの全セルを対象範囲としてコントラスト検出を行う一方、ステップS16におけるコントラスト検出処理2は、各分割エリアにおいて、相関値演算により検出された最小極小値fmin1のシフト量nmin1、即ち、最高相関値fminのシフト量nminにおけるウインドウ範囲内の全セルを対象範囲としてコントラスト検出を行う。   In contrast detection processing 1 in step S14 of FIG. 7, contrast detection is performed for all divided cells constituting the ranging area, that is, all cells of the divided area, that is, all cells of the employed sensor, while contrast in step S16. In the detection process 2, in each divided area, the contrast detection is performed with the shift amount nmin1 of the minimum minimum value fmin1 detected by the correlation value calculation, that is, all cells in the window range in the shift amount nmin of the maximum correlation value fmin as the target range. Do.

図59は、コントラスト検出処理1とコントラスト検出処理2による一連のコントラスト検出処理の全体手順を示したフローチャートである。CPU60は、図7のステップS12におけるAFデータ取得処理によりAFデータを取得すると、図7のステップS14におけるコントラスト検出処理1の一処理として、測距エリアを構成するRセンサ94及びLセンサ96の各分割エリアを個別の対象範囲としたコントラスト検出1の処理を行う(ステップS250)。今、Rセンサ94及びLセンサ96の対応するある分割エリアに着目し、そのRセンサ94の分割エリアとLセンサ96の分割エリアをそれぞれRセンサ94の採用センサ、Lセンサ96の採用センサというものとする。そして、それらの採用センサについてコントラスト検出1を行うとすると、CPU60は、Rセンサ94の採用センサの全セルのAFデータのうち最大値及び最小値を検出する。このとき検出されたAFデータの最大値をRMAX、最小値をRMINとする。同様にLセンサ96の採用センサの全セルのAFデータのうち最大値及び最小値を検出する。このとき検出されたAFデータの最大値をLMAX、最小値をLMINとする。   FIG. 59 is a flowchart showing an overall procedure of a series of contrast detection processing by contrast detection processing 1 and contrast detection processing 2. When the CPU 60 acquires the AF data by the AF data acquisition process in step S12 of FIG. 7, each of the R sensor 94 and the L sensor 96 constituting the distance measurement area is processed as one process of the contrast detection process 1 in step S14 of FIG. The process of contrast detection 1 is performed with the divided areas as individual target ranges (step S250). Now, paying attention to a corresponding divided area of the R sensor 94 and the L sensor 96, the divided area of the R sensor 94 and the divided area of the L sensor 96 are referred to as an adopted sensor of the R sensor 94 and an adopted sensor of the L sensor 96, respectively. And Then, if contrast detection 1 is performed for these employed sensors, the CPU 60 detects the maximum value and the minimum value among the AF data of all the cells of the employed sensor of the R sensor 94. The maximum value of the AF data detected at this time is RMAX, and the minimum value is RMIN. Similarly, the maximum value and the minimum value are detected from the AF data of all the cells of the adopted sensor of the L sensor 96. The maximum value of the AF data detected at this time is LMAX, and the minimum value is LMIN.

次いで、CPU60は、Rセンサ94の採用センサにおけるコントラストを次式、
[数15]
RMAX−RMIN …(17)
により求め、Lセンサ96の採用センサにおけるコントラストを次式、
[数16]
LMAX−LMIN …(18)
により求める。 次に、CPU60は、図7のステップS14におけるコントラスト検出処理1の一処理として、ステップS250のコントラスト検出1により検出したコントラストによりコントラスト判定1を行う(ステップS252)。即ち、Rセンサ94の採用センサにおける上式(17)のコントラストRMAX−RMIN、及び、Lセンサ96の採用センサにおける上式(18)のコントラストLMAX−LMINが所定の基準値R4に対してそれぞれ、
[数17]
RMAX−RMIN<R4 …(19)
LMAX−LMIN<R4 …(20)
が成り立つか否かを判定する。もし、上式(19)と(20)のうちいずれか一方でも成り立つ場合にはコントラスト無しとしてそれらの採用センサ(着目している分割エリア)における測距を不能とする(ステップS254)。上式(19)と(20)の両方とも成り立たない場合には、それらの採用センサにおけるコントラストを有りとする。
Next, the CPU 60 calculates the contrast in the adopted sensor of the R sensor 94 as follows:
[Equation 15]
RMAX-RMIN (17)
The contrast in the sensor employed by the L sensor 96 is calculated by the following equation:
[Equation 16]
LMAX-LMIN (18)
Ask for. Next, as one process of the contrast detection process 1 in step S14 of FIG. 7, the CPU 60 performs the contrast determination 1 based on the contrast detected by the contrast detection 1 in step S250 (step S252). That is, the contrast RMAX-RMIN of the above equation (17) in the adopted sensor of the R sensor 94 and the contrast LMAX-LMIN of the above equation (18) in the adopted sensor of the L sensor 96 are respectively set with respect to the predetermined reference value R4.
[Equation 17]
RMAX-RMIN <R4 (19)
LMAX-LMIN <R4 (20)
It is determined whether or not holds. If either one of the above formulas (19) and (20) holds, it is determined that there is no contrast, and distance measurement in those employed sensors (the divided area of interest) is disabled (step S254). If neither of the above formulas (19) and (20) hold, the contrast in those employed sensors is assumed to be present.

次に、CPU60は、ステップS252においてコントラスト有りと判定した分割エリアについて、上記図7のステップS16における相関値演算処理を行う(ステップS256)。   Next, the CPU 60 performs the correlation value calculation process in step S16 of FIG. 7 for the divided areas determined to have contrast in step S252 (step S256).

次に、CPU60は、上記図7のステップS18におけるコントラスト検出処理2の一処理として、相関値演算により検出された最高相関のシフト量nminにおけるRウインドウ94B及びLウインドウ96Bを対象範囲としたコントラスト検出2を行う(ステップS258)。今、Rセンサ94及びLセンサ96のある対応する分割エリアに着目し、そのRセンサ94の分割エリアとLセンサ96の分割エリアをそれぞれRセンサ94の採用センサ、Lセンサ96の採用センサというものとする。そして、それらの採用センサについてコントラスト検出2を行うとすると、CPU60は、そのRセンサ94の採用センサにおいて最高相関のシフト量nminが得られたときのRウインドウ94Bの範囲でAFデータの最大値と最小値を検出する。このとき検出された最大値をRWMAX、最小値をRWMINとする。同様にLセンサ96の採用センサにおいて最高相関のシフト量nminが得られたときのLウインドウ96Bの範囲でAFデータの最大値と最小値を検出する。このとき検出された最大値をLWMAX、最小値をLWMINとする。そして、CPU60は、前記Rウインドウ94Bにおけるコントラストを次式、
[数18]
RWMAX−RWMIN …(21)
により求める。また、Lウインドウ96Bにおけるコントラストを次式、
[数19]
LWMAX−LWMIN …(22)
により求める。
Next, as one process of the contrast detection process 2 in step S18 of FIG. 7, the CPU 60 performs contrast detection with the R window 94B and the L window 96B in the maximum correlation shift amount nmin detected by the correlation value calculation as the target range. 2 is performed (step S258). Now, paying attention to a corresponding divided area of the R sensor 94 and the L sensor 96, the divided area of the R sensor 94 and the divided area of the L sensor 96 are referred to as an adopted sensor of the R sensor 94 and an adopted sensor of the L sensor 96, respectively. And Then, if contrast detection 2 is performed for these employed sensors, the CPU 60 determines the maximum AF data value within the range of the R window 94B when the highest correlation shift amount nmin is obtained in the employed sensor of the R sensor 94. Detect the minimum value. The maximum value detected at this time is RWMAX, and the minimum value is RWMIN. Similarly, the maximum value and the minimum value of the AF data are detected in the range of the L window 96B when the maximum correlation shift amount nmin is obtained in the sensor employed by the L sensor 96. The maximum value detected at this time is LWMAX, and the minimum value is LWMIN. The CPU 60 calculates the contrast in the R window 94B by the following formula:
[Equation 18]
RWMAX-RWMIN (21)
Ask for. Further, the contrast in the L window 96B is expressed by the following equation:
[Equation 19]
LWMAX-LWMIN (22)
Ask for.

続いて、CPU60は、上記図7のステップS18におけるコントラスト検出処理2の一処理として、上式(21)、(22)により求めたコントラストによりコントラスト判定2を行う(ステップS260)。即ち、Rウインドウ94Bにおける上式(21)のコントラストRWMAX−RWMIN、及び、Lウインドウ96Bにおける上式(22)のコントラストLWMAX−LWMINが上述の基準値R4に対してそれぞれ、
[数20]
RWMAX−RWMIN<R4 …(23)
LWMAX−LWMIN<R4 …(24)
が成り立つか否かを判定する。もし、上式(23)と(24)のうちいずれか一方でも成り立つ場合にはコントラスト無しとしてそれらの採用センサ(着目している分割エリア)における測距を不能とする(ステップS254)。上式(23)と(24)の両方とも成り立たない場合には、それらのウインドウにおけるコントラストを有りとする。コントラスト有りとした場合には次の処理に移行する。
Subsequently, as a process of the contrast detection process 2 in step S18 of FIG. 7, the CPU 60 performs the contrast determination 2 based on the contrast obtained by the above equations (21) and (22) (step S260). That is, the contrast RWMAX-RWMIN of the above equation (21) in the R window 94B and the contrast LWMAX-LWMIN of the above equation (22) in the L window 96B are respectively compared with the reference value R4.
[Equation 20]
RWMAX-RWMIN <R4 (23)
LWMAX-LWMIN <R4 (24)
It is determined whether or not holds. If either one of the above formulas (23) and (24) is satisfied, the distance measurement is disabled in those employed sensors (the divided area of interest) with no contrast (step S254). If neither of the above equations (23) and (24) hold, the contrast in those windows is assumed to be present. If there is a contrast, the process proceeds to the next process.

以上のコントラスト検出処理1及びコントラスト検出処理2により測距不能と判定される場合の具体例について説明する。例えば、Rセンサ94及びLセンサ96の中央エリアを採用センサとして着目した場合に、それら採用センサの全セル範囲のAFデータが図60(A)、(B)に示すように低コントラストを示していたとする。この場合に、相関値演算により相関値f(n)を算出すると、同図(C)に示すように最小極小値fmin1のシフト量nmin1、即ち、最高相関値fminのシフト量nminがシフト量n=12で検出される。このような場合、同図(A)、(B)に示しているようにRセンサ94の採用センサ及びLセンサ96の採用センサにおいて、シフト量nminにおけるウインドウ範囲(最高相関値となったウインドウ範囲)のAFデータも低コントラストを示し、シフト量n=12を最高相関のシフト量nminとすると誤測距となる可能性が高い。   A specific example in the case where it is determined that distance measurement is impossible by the above contrast detection processing 1 and contrast detection processing 2 will be described. For example, when focusing on the center area of the R sensor 94 and the L sensor 96 as the adopted sensor, the AF data of the entire cell range of the adopted sensor shows low contrast as shown in FIGS. 60 (A) and (B). Suppose. In this case, when the correlation value f (n) is calculated by the correlation value calculation, the shift amount nmin1 of the minimum minimum value fmin1 as shown in FIG. = 12. In such a case, as shown in FIGS. 6A and 6B, in the adoption sensor of the R sensor 94 and the adoption sensor of the L sensor 96, the window range at the shift amount nmin (the window range having the highest correlation value). ) Also shows low contrast, and if the shift amount n = 12 is the highest correlation shift amount nmin, there is a high possibility of erroneous ranging.

このように採用センサの全セル範囲においてAFデータが低コントラストを示す場合、実際にはこの採用センサに対して相関値演算処理は行われることなく、コントラスト検出処理1におけるコントラスト判定1(図59のステップS252)において測距不能と判定される。従って、明らかに測距不能なAFデータを示す採用センサについては相関値演算が行われないため、測距時間が短縮される。   Thus, when AF data shows low contrast in the entire cell range of the adopted sensor, the correlation value calculation process is not actually performed on the adopted sensor, and contrast determination 1 in the contrast detection process 1 (in FIG. 59). In step S252), it is determined that distance measurement is impossible. Accordingly, since the correlation value calculation is not performed for the employed sensor that clearly shows AF data that cannot be measured, the distance measurement time is shortened.

一方、図61(A)、(B)に示すようにRセンサ94及びLセンサ96の採用センサの全セル範囲においては、AFデータが高コントラストを示していたとする。この場合に、相関値演算により相関値f(n)を算出したとすると、同図(C)に示すように最高相関値fminのシフト量nminがシフト量n=12で検出される。しかしながら、この場合において、同図(A)、(B)に示しているようにRセンサ94の採用センサ及びLセンサ96の採用センサにおいて、最高相関値となったウインドウ範囲のAFデータは低コントラストを示しており、シフト量n=12を最高相関のシフト量nminとすると誤測距となる可能性が高い。   On the other hand, as shown in FIGS. 61A and 61B, it is assumed that the AF data shows high contrast in the entire cell range of the adopted sensors of the R sensor 94 and the L sensor 96. In this case, if the correlation value f (n) is calculated by the correlation value calculation, the shift amount nmin of the maximum correlation value fmin is detected with the shift amount n = 12, as shown in FIG. However, in this case, as shown in FIGS. 6A and 6B, in the adoption sensor of the R sensor 94 and the adoption sensor of the L sensor 96, the AF data in the window range having the highest correlation value is low contrast. If the shift amount n = 12 is the highest correlation shift amount nmin, there is a high possibility of erroneous ranging.

このように、採用センサの全セルを対象範囲としてコントラスト検出処理1ではコントラスト有りと判定されるような場合であっても、相関値演算により検出された最高相関のシフト量nminにおけるウインドウ範囲ではAFデータが低コントラストを示す場合には、コントラスト検出処理2におけるコントラスト判定2(図59のステップS260)において測距不能と判定される。従って、コントラスト検出処理1において測距可能とされた場合でも誤測距となる可能性が高い図61のような場合にはコントラスト検出処理2によって適切に測距不能と判定される。   As described above, even if it is determined that there is contrast in the contrast detection process 1 with all cells of the employed sensor as the target range, AF is not used in the window range in the maximum correlation shift amount nmin detected by the correlation value calculation. When the data shows low contrast, it is determined that distance measurement is impossible in contrast determination 2 (step S260 in FIG. 59) in the contrast detection process 2. Therefore, even in the case where the distance can be measured in the contrast detection process 1, in the case shown in FIG. 61 where the possibility of erroneous distance measurement is high, it is determined that the distance cannot be properly measured by the contrast detection process 2.

以上説明したコントラスト検出処理では、相関値演算処理(図59のステップS256)を行った後、最高相関のシフト量nminにおけるウインドウ範囲についてコントラスト検出処理2を行うようにしたが(同図ステップS258、260)、相関値演算処理を行った後にコントラスト検出処理2を行う代わりに、相関値演算処理を行う前において上述のコントラスト検出処理2と同様の処理を行うようにすることもできる。例えば、コントラスト検出処理1によりある分割エリアの全セルのAFデータを対象としてコントラスト有りと判定されたとする。この場合、次に、その分割エリアの全てのシフト量nにおけるウインドウ範囲を対象として、各ウインドウ範囲ごとにコントラストの有無を検出する。この結果、コントラスト無しと判定したウインドウ範囲のシフト量nについては相関値演算を行わず、コントラスト有りと判定したウインドウ範囲のシフト量nについてのみ相関値演算を行い、相関値f(n)を算出する。そして、相関値f(n)を算出したシフト量nの範囲で最高相関値fminのシフト量nminを検出する。この場合、相関値演算における演算数を削減することができ、測距時間の短縮が図れる。尚、この場合におけるコントラスト検出処理は行わなくても良い。また、全てのシフト量nにおけるウインドウ範囲においてコントラスト無しと判定された場合には、一度も相関値演算が行われず、測距不能と判定される。   In the contrast detection process described above, the correlation value calculation process (step S256 in FIG. 59) is performed, and then the contrast detection process 2 is performed for the window range in the maximum correlation shift amount nmin (step S258 in the figure). 260) Instead of performing the contrast detection processing 2 after performing the correlation value calculation processing, the same processing as the above-described contrast detection processing 2 may be performed before performing the correlation value calculation processing. For example, it is assumed that the contrast detection process 1 determines that there is contrast for the AF data of all cells in a certain divided area. In this case, next, the presence / absence of contrast is detected for each window range with respect to the window range in all shift amounts n of the divided area. As a result, the correlation value calculation is not performed for the shift amount n of the window range determined to have no contrast, and the correlation value calculation is performed only for the shift amount n of the window range determined to have contrast to calculate the correlation value f (n). To do. Then, the shift amount nmin of the maximum correlation value fmin is detected in the range of the shift amount n for which the correlation value f (n) is calculated. In this case, the number of calculations in the correlation value calculation can be reduced, and the distance measurement time can be shortened. In this case, the contrast detection process may not be performed. If it is determined that there is no contrast in the window range for all shift amounts n, the correlation value calculation is never performed and it is determined that distance measurement is impossible.

更に、一箇所でもコントラストがあるウインドウがあった場合は、全ての相関値演算を実施するようにしてもよい。   Furthermore, if there is a window with contrast even at one location, all correlation value calculations may be performed.

{L、Rチャンネル差補正処理(図7ステップS20)の詳細}
次に、図7のステップS20におけるL、Rチャンネル差補正処理について説明する。L、Rチャンネル差補正処理は、AFセンサ74のRセンサ94から取得したAFデータと、AFセンサ74のLセンサ96から取得したAFデータとの信号量を一致させる処理である。本処理では、上記コントラスト検出処理2のコントラスト判定2(図59参照)においてコントラスト有りと判定した分割エリアにおいて、最高相関値が得られたRウインドウ94B及びLウインドウ96Bの範囲付近(±5n)のAFデータに対して行う。
{Details of L and R channel difference correction processing (step S20 in FIG. 7)}
Next, the L and R channel difference correction processing in step S20 in FIG. 7 will be described. The L and R channel difference correction processing is processing for matching the signal amounts of the AF data acquired from the R sensor 94 of the AF sensor 74 and the AF data acquired from the L sensor 96 of the AF sensor 74. In this process, in the divided area determined to have contrast in the contrast determination 2 (see FIG. 59) of the contrast detection process 2, the vicinity of the range of the R window 94B and the L window 96B (± 5n) where the highest correlation value was obtained. Performed on AF data.

まず、CPU60におけるL、Rチャンネル差補正処理の手順について図62のフローチャートを用いて説明する。同図のステップS300で示しているコントラスト判定2の処理は、上記図59ステップS260のコントラスト判定2に相当し、この判定処理において、コントラスト無しと判定された分割エリアについては、測距不能とされ、コントラスト有りと判定された分割エリアについては、以下のL、Rチャンネル差補正処理に移行する。そこで、コントラスト有りと判定したある分割エリアを採用センサとして着目して以下説明すると、CPU60は、まず、補正が必要か否かを判定するために、その採用センサにおいて最高相関値が得られたRウインドウ94Bの範囲とLウインドウ96Bの範囲でそれぞれAFデータの最小値を検出して比較し、その差の絶対値(左右最小値差ΔDMIN)が大きいか小さいか、又は、大きすぎるかを判定する(ステップS302)。尚、この判定の前又は後(ステップS300とステップS302の間、又は、ステップS302とステップS304の間)において、前記採用センサにおける最高相関値が所定の基準値以上か否かの判断を行い、最高相関値がその基準値以上の場合にのみ本補正が必要であると判断し、最高相関値が基準値より小さい場合には本補正を行わないようにしてもよい。ここで、最高相関値が得られたRウインドウ94BにおけるAFデータの最小値をRWMIN、Lウインドウ96におけるAFデータの最小値をLWMINとすると、左右最小値差ΔDMINは、次式、
[数21]
ΔDMIN=|LWMIN−RWMIN| …(25)
により算出される。そして、所定の基準値R5、R6(R5<R6)に対して、
[数22]
ΔDMIN<R5 …(26)
が成り立つ場合には左右最小値差ΔDMINが小さいと判定し、
[数23]
R6≧ΔDMIN≧R5 …(27)
が成り立つ場合には左右最小値差ΔDMINが大きいと判定する。
[数24]
ΔDMIN>R6 …(28)
が成り立つ場合には左右最小値差ΔDMINが大きすぎると判定する。
First, the procedure of the L and R channel difference correction processing in the CPU 60 will be described with reference to the flowchart of FIG. The process of contrast determination 2 shown in step S300 in the figure corresponds to the contrast determination 2 in step S260 of FIG. 59. In this determination process, distance measurement is impossible for the divided areas determined to have no contrast. For the divided areas determined to have contrast, the process proceeds to the following L and R channel difference correction processing. Accordingly, a description will be given below by focusing on a certain divided area determined to have contrast as an adopted sensor. First, the CPU 60 determines whether or not correction is necessary. The minimum value of the AF data is detected and compared in the range of the window 94B and the range of the L window 96B, respectively, and it is determined whether the absolute value of the difference (left and right minimum value difference ΔDMIN) is large, small, or too large. (Step S302). Before or after this determination (between step S300 and step S302 or between step S302 and step S304), it is determined whether or not the highest correlation value in the employed sensor is equal to or greater than a predetermined reference value. It may be determined that the main correction is necessary only when the highest correlation value is equal to or higher than the reference value, and the main correction may not be performed when the highest correlation value is smaller than the reference value. Here, assuming that the minimum value of AF data in the R window 94B where the highest correlation value is obtained is RWMIN, and the minimum value of AF data in the L window 96 is LWMIN, the left-right minimum value difference ΔDMIN is given by the following equation:
[Equation 21]
ΔDMIN = | LWMIN−RWMIN | (25)
Is calculated by And for the predetermined reference values R5, R6 (R5 <R6),
[Equation 22]
ΔDMIN <R5 (26)
If the following holds, it is determined that the left-right minimum value difference ΔDMIN is small,
[Equation 23]
R6 ≧ ΔDMIN ≧ R5 (27)
Is satisfied, it is determined that the left-right minimum value difference ΔDMIN is large.
[Equation 24]
ΔDMIN> R6 (28)
Is satisfied, it is determined that the left-right minimum value difference ΔDMIN is too large.

以上の判定処理により、左右最小値差ΔDMINが小さいと判定した場合には、本補正を行わずに次の処理に移行し、左右最小値差ΔDMINが大きい(補正に適正)と判定した場合には、本補正を行うため、次のステップS304の処理に移行する。左右最小値差ΔDMINが大きすぎると判定した場合には、測距不能とする(ステップS306)。   If it is determined by the above determination processing that the left and right minimum value difference ΔDMIN is small, the process proceeds to the next process without performing the main correction, and the right and left minimum value difference ΔDMIN is determined to be large (suitable for correction). Shifts to the process of the next step S304 in order to perform the main correction. If it is determined that the left-right minimum value difference ΔDMIN is too large, distance measurement is disabled (step S306).

左右最小値差ΔDMINが大きいと判定した場合、次に、CPU60は、Rセンサ94及びLセンサ96の採用センサにおける補正範囲のAFデータを補正する(ステップS304)。AFデータの補正は、例えば、Rセンサ94の採用センサにおけるAFデータの最小値とLセンサ96の採用センサにおけるAFデータの最小値との差分量を求め、その差分量が減少するように一方のセンサのAFデータに対して他方のセンサのAFデータの信号量を加減する。尚、AFデータの補正についての詳細は後述する。また、AFデータの補正範囲は、次のステップS308の処理における補正後のAFデータに基づく相関値演算において所定シフト量範囲の相関値f(n)を算出する際に必要なAFデータの範囲である。   If it is determined that the left-right minimum value difference ΔDMIN is large, the CPU 60 next corrects the AF data of the correction range in the adopted sensor of the R sensor 94 and the L sensor 96 (step S304). The correction of the AF data is performed, for example, by obtaining a difference amount between the minimum value of the AF data in the adoption sensor of the R sensor 94 and the minimum value of the AF data in the adoption sensor of the L sensor 96 and reducing one of the difference amounts. The signal amount of the AF data of the other sensor is adjusted with respect to the AF data of the sensor. Details of the AF data correction will be described later. The AF data correction range is a range of AF data necessary for calculating the correlation value f (n) of the predetermined shift amount range in the correlation value calculation based on the corrected AF data in the processing of the next step S308. is there.

AFデータを補正すると、その補正後のAFデータを使用して再度相関値演算(補正後の相関値演算)を行い、相関値f(n)′を求める(ステップS308)。AFデータ補正後の相関値演算は、全てのシフト量nについて行うようにしてもよいが、本実施の形態では、AFデータ補正前の相関値演算において最高相関が得られたシフト量nminの付近、例えば、シフト量nminに対して±5の範囲についてのみ行うものとする。   When the AF data is corrected, correlation value calculation (correlation value calculation after correction) is performed again using the corrected AF data to obtain a correlation value f (n) ′ (step S308). The correlation value calculation after the AF data correction may be performed for all the shift amounts n. However, in the present embodiment, the vicinity of the shift amount nmin at which the highest correlation is obtained in the correlation value calculation before the AF data correction. For example, it is performed only for a range of ± 5 with respect to the shift amount nmin.

次に、CPU60は、AFデータ補正後の相関値演算によって得られた相関値f(n)′に基づいて、AFデータ補正後の相関値演算により相関値f(n)′を行ったシフト量の範囲で最小極小値fmin′及びそのシフト量nmin′を検出する。そして、最小極小値fmin′に基づいて、補正後におけるRセンサ94のAFデータとLセンサ96のAFデータについて、一致度が低いか高いか、又は一致度が低すぎるかを判定する(ステップS310)。具体的には、例えば、AFデータ補正後の最小極小値fmin′が所定の基準値R7に対して、次式、
[数25]
fmin′>基準値R7 …(29)
を満たす場合には、一致度が低すぎると判定する。一方、式(29)が成り立たない場合において、AFデータ補正後の最小極小値fmin′と補正前の最高相関値fminとが、次式、
[数26]
fmin≦fmin′ …(30)
を満たす場合には、一致度が低いと判定する。式(30)が成り立たず、次式、
[数27]
fmin>fmin′ …(31)
が成り立つ場合には、一致度が高いと判定する。
Next, the CPU 60 performs the shift amount obtained by performing the correlation value f (n) ′ by the correlation value calculation after the AF data correction based on the correlation value f (n) ′ obtained by the correlation value calculation after the AF data correction. In this range, the minimum minimum value fmin ′ and the shift amount nmin ′ are detected. Then, based on the minimum minimum value fmin ′, it is determined whether the AF data of the R sensor 94 and the AF data of the L sensor 96 after correction are low, high, or too low (step S310). ). Specifically, for example, the minimum minimum value fmin ′ after AF data correction is expressed by the following equation with respect to a predetermined reference value R7:
[Equation 25]
fmin ′> reference value R7 (29)
When satisfy | filling, it determines with a coincidence degree being too low. On the other hand, when Equation (29) does not hold, the minimum minimum value fmin ′ after AF data correction and the maximum correlation value fmin before correction are expressed by the following equation:
[Equation 26]
fmin ≦ fmin ′ (30)
When satisfy | filling, it determines with a coincidence degree being low. Equation (30) does not hold, and
[Equation 27]
fmin> fmin ′ (31)
Is satisfied, it is determined that the degree of coincidence is high.

この判定処理により、一致度が低すぎると判定した場合には、この採用センサについて測距不能とする(ステップS306)。一致度が低いと判定した場合には、以後の処理においてAFデータ補正後の相関値演算の結果ではなく、AFデータ補正前の相関値演算の結果を採用することとする(ステップS312)。一方、一致度が高いと判定した場合には、AFデータ補正後の相関値演算の結果を採用することとする(ステップS314)。AFデータ補正後の相関値演算の結果を採用することとした場合において、以後の処理の説明で使用する相関値f(n)、最高相関値fmin及びそのシフト量nminの用語は、AFデータ補正後の相関値f(n)′、最小極小値fmin′及びそのシフト量nnmin′を示す。   If it is determined by this determination process that the degree of coincidence is too low, distance measurement is disabled for this adopted sensor (step S306). If it is determined that the degree of coincidence is low, the correlation value calculation result before AF data correction is used instead of the correlation value calculation result after AF data correction in the subsequent processing (step S312). On the other hand, if it is determined that the degree of coincidence is high, the result of correlation value calculation after AF data correction is adopted (step S314). When adopting the result of correlation value calculation after AF data correction, the terms correlation value f (n), maximum correlation value fmin, and shift amount nmin used in the description of the subsequent processing are AF data correction. The subsequent correlation value f (n) ′, the minimum minimum value fmin ′, and the shift amount nnmin ′ are shown.

ここで、上記ステップS304のAFデータの補正について一実施例を説明する。図63は、AFデータの補正をRセンサ94のAFデータとLセンサ96のAFデータの信号量差を補正して行う場合の処理手順を示したフローチャートである。まず、CPU60は、Rセンサ94とLセンサ96のうち、AFデータを補正するセンサ(補正センサ)を判定する(ステップS330)。   Here, an embodiment of the AF data correction in step S304 will be described. FIG. 63 is a flowchart showing a processing procedure when the correction of AF data is performed by correcting the signal amount difference between the AF data of the R sensor 94 and the AF data of the L sensor 96. First, the CPU 60 determines a sensor (correction sensor) that corrects AF data among the R sensor 94 and the L sensor 96 (step S330).

具体的には、最高相関が得られたRウインドウ内におけるAFデータの最小値RMINと最高相関が得られたLウインドウ内における最小値LMINを比較し、RMIN>LMINの場合には、Rセンサ94を補正センサとし、RMIN<LMINの場合には、Lセンサ96を補正センサとする。   Specifically, the minimum value RMIN of the AF data in the R window in which the highest correlation is obtained is compared with the minimum value LMIN in the L window in which the highest correlation is obtained, and if RMIN> LMIN, the R sensor 94 Is the correction sensor, and when RMIN <LMIN, the L sensor 96 is the correction sensor.

Lセンサ96を補正センサとする場合、Rセンサ94及びLセンサ96の補正前のAFデータをR及びL、補正後のAFデータをRH及びLHとすると、次式、
[数28]
LH=L−信号量差
RH=R
により求める(ステップS332)。ここで、信号量差は、LMIN−RMINとする。
When the L sensor 96 is a correction sensor, R and L are AF data before correction of the R sensor 94 and the L sensor 96, and RH and LH are AF data after correction.
[Equation 28]
LH = L-Signal amount difference RH = R
(Step S332). Here, the signal amount difference is LMIN−RMIN.

一方、Rセンサ94を補正センサとする場合には、次式、
[数29]
LH=L
RH=R−信号量差
により求める(ステップS334)。ここで、信号量差は、RMIN−LMINとする。
On the other hand, when the R sensor 94 is a correction sensor,
[Equation 29]
LH = L
RH = R−obtained from the signal amount difference (step S334). Here, the signal amount difference is RMIN−LMIN.

以上のL、Rチャンネル差補正処理による効果について説明する。図64は、上記図62に示したL、Rチャンネル差補正処理を新方式としてその効果を従来方式と比較して示した図である。新方式は、従来方式と比べると、特に、図62のステップS302における補正を行うか否かの判定処理の内容が相違しており、1つ目の従来方式の例(この方式を従来方式(1)とする)としては、新方式のように最高相関値が得られたRウインドウ94BとLウインドウ96Bの範囲内におけるAFデータの最小値を比較するのではなく、Rセンサ94の採用センサ内における全てのAFデータに対する最小値RMINと、Lセンサ96の採用センサ内における全てのAFデータに対する最小値LMINとを比較し、その最小値差が所定値よりも大きい場合にAFデータを補正する方式をいうものとする。   The effect of the above L and R channel difference correction processing will be described. FIG. 64 is a diagram showing the effect of the L and R channel difference correction processing shown in FIG. 62 as a new method in comparison with the conventional method. Compared with the conventional method, the new method is different in the content of the determination process whether or not to perform correction in step S302 of FIG. 62, and the first conventional method (this method is the conventional method ( 1)), the minimum value of the AF data in the range of the R window 94B and the L window 96B where the highest correlation value was obtained is not compared as in the new method, but the R sensor 94 is not used. A method for comparing the minimum value RMIN for all AF data in the sensor and the minimum value LMIN for all AF data in the sensor employed by the L sensor 96 and correcting the AF data when the minimum value difference is larger than a predetermined value. It shall be said.

2つ目の従来方式の例(この方式を従来方式(2)とする)としては、Rセンサ94とLセンサ96のそれぞれの採用センサ内におけるAFデータの平均値を求め、その差が所定値よりも大きい場合にAFデータを補正する方式がある。平均値が一致するように一方のセンサのAFデータを補正する方式をいうものとする。   As an example of the second conventional method (this method is referred to as the conventional method (2)), the average value of the AF data in each of the employed sensors of the R sensor 94 and the L sensor 96 is obtained, and the difference is a predetermined value. There is a method of correcting the AF data when it is larger than the above. A method of correcting the AF data of one sensor so that the average values match is assumed.

例えば、Rセンサ94及びLセンサ96の採用センサ(例えば中央エリア)内において図64(A)、(B)に示すようなAFデータが得られたとする。このAFデータの例は本来補正が不要な場合を示したものである。そして、この採用センサにおけるAFデータに対して相関値演算を行った結果、AFデータ補正前(補正無し)の相関値分布が同図(C)の「・」記号で結ばれた分布を示したとする。尚、この補正無しの相関値分布では、最高相関のシフト量nminはシフト量n=10において検出されており、そのときのRウインドウ94BとLウインドウ96Bの範囲は、それぞれ同図(A)、(B)においてAFデータの分布が太線で示されている範囲である。   For example, it is assumed that AF data as shown in FIGS. 64A and 64B is obtained in the adopted sensor (for example, the central area) of the R sensor 94 and the L sensor 96. This example of AF data shows a case where correction is not originally required. As a result of performing the correlation value calculation on the AF data in the adopted sensor, the correlation value distribution before the AF data correction (without correction) shows a distribution connected by “·” symbols in FIG. To do. In the correlation value distribution without correction, the maximum correlation shift amount nmin is detected at the shift amount n = 10. The ranges of the R window 94B and the L window 96B at that time are shown in FIG. In (B), the AF data distribution is indicated by a thick line.

このような場合に、従来方式(1)によりAFデータの補正を行うか否かを判定すると、同図(A)、(B)の比較から明らかなようにRセンサ94とLセンサ96のそれぞれの採用センサ内におけるAFデータの最小値に差(図中「従来(1)」で示されている差)が生じているため、AFデータの補正(上記信号量差の補正)が行われることになり、その補正後のAFデータに基づいて相関値演算を行うと、その相関値分布は、同図(C)の「△」記号で結ばれた分布を示す。このAFデータ補正後に得られた相関値分布では、最小極小値が大きいため、Rセンサ94のAFデータとLセンサ96のAFデータの信号量の一致度が低いと判定され、測距不能と判定される結果となる。尚、従来では、新方式のようにAFデータ補正前に相関値演算を行うことはしていないため、一致度が低いと判定した場合に、新方式のようにAFデータ補正前の相関値演算の結果を採用するという処置は行われていない。このように、従来方式(1)では、本来測距不能とすべきでないAFデータが得られているにもかかわらず、補正を行うことによって測距不能となる不具合が生じる場合がある。   In such a case, when it is determined whether or not the AF data is corrected by the conventional method (1), each of the R sensor 94 and the L sensor 96 is apparent from the comparison between FIGS. Since there is a difference in the minimum value of the AF data in the sensor adopted (difference indicated by “Conventional (1)” in the figure), AF data correction (correction of the above signal amount difference) is performed. When the correlation value calculation is performed based on the corrected AF data, the correlation value distribution indicates a distribution connected by the symbol “Δ” in FIG. In the correlation value distribution obtained after the AF data correction, since the minimum minimum value is large, it is determined that the degree of coincidence between the signal amounts of the AF data of the R sensor 94 and the AF data of the L sensor 96 is low, and it is determined that distance measurement is impossible. Result. Conventionally, since the correlation value calculation is not performed before the AF data correction as in the new method, when it is determined that the degree of coincidence is low, the correlation value calculation before the AF data correction is performed as in the new method. No action has been taken to adopt the result of. As described above, in the conventional method (1), there is a case in which the distance measurement becomes impossible due to the correction even though the AF data that should not be the distance measurement is obtained.

また、従来方式(2)によりAFデータの補正を行うか否かを判定すると、Rセンサ94とLセンサ96のそれぞれの採用センサ内におけるAFデータの平均値に差(同図(A)、(B)の比較において「従来(2)」で示されている差)が生じているため、AFデータの補正(上記信号量差の補正)が行われることになり、その補正後のAFデータに基づいて相関値演算を行うと、その相関値分布は、同図(C)の「×」記号で結ばれた相関値分布を示す。このAFデータ補正後に得られた相関値分布では、従来方式(1)と同様に最小極小値が大きいため、Rセンサ94のAFデータとLセンサ96のAFデータの信号量の一致度が低いと判定され、測距不能と判定される結果となる。このように、従来方式(2)においても、本来測距不能とすべきでないAFデータが得られているにもかかわらず、補正を行うことによって測距不能となる不具合が生じる場合がある。   Further, when it is determined whether or not to correct the AF data by the conventional method (2), the difference between the average values of the AF data in the employed sensors of the R sensor 94 and the L sensor 96 (see FIGS. In the comparison of B), the difference shown in “Conventional (2)” has occurred, so AF data correction (correction of the above signal amount difference) is performed. When the correlation value calculation is performed based on the correlation value distribution, the correlation value distribution indicates a correlation value distribution connected by “x” symbols in FIG. In the correlation value distribution obtained after this AF data correction, since the minimum minimum value is large as in the conventional method (1), the degree of coincidence between the signal amounts of the AF data of the R sensor 94 and the AF data of the L sensor 96 is low. As a result, it is determined that ranging is impossible. As described above, even in the conventional method (2), there is a case in which the distance measurement becomes impossible due to the correction even though the AF data that should not be the distance measurement is obtained.

以上のような従来方式(1)、(2)に対して、新方式によりAFデータの補正を行うか否かを判定すると、採用センサにおいて最高相関値が得られたRウインドウ94BとLウインドウ96Bの範囲内ではAFデータの最小値に差がないため、補正は行われず、余分な相関値演算を実施する必要がない。従って、従来方式(1)、(2)のような不具合は生じない。仮に補正を行ったとすると、その相関値分布は、同図(C)の「□」記号で結ばれた分布を示し、従来方式(1)、(2)と同様に一致度が低いと判定される。しかし、この場合においても新方式の場合には、測距不能ではなく、AFデータ補正前の相関値演算の結果を採用するという判断となるため、補正前のAFデータが補正無しで測距可能なものである場合には、AFデータを補正することが適切でなかった場合であっても測距不能となる不具合を回避することができる。   When it is determined whether or not to correct the AF data by the new method as compared with the conventional methods (1) and (2) as described above, the R window 94B and the L window 96B where the highest correlation value is obtained in the employed sensor. Since there is no difference in the minimum value of the AF data within the range, correction is not performed and it is not necessary to perform extra correlation value calculation. Therefore, the problems as in the conventional methods (1) and (2) do not occur. If correction is made, the correlation value distribution is a distribution connected by the “□” symbol in FIG. 5C, and it is determined that the degree of coincidence is low as in the conventional methods (1) and (2). The However, in this case as well, in the case of the new method, it is determined that the result of correlation value calculation before AF data correction is adopted instead of being impossible to measure distance, so that AF data before correction can be measured without correction. In such a case, even if it is not appropriate to correct the AF data, it is possible to avoid a problem that distance measurement is impossible.

次に、上記ステップS304におけるAFデータ補正において、図63のフローチャートで示した信号量差補正の代わりに他の補正手段を採用する場合について説明する。ここで説明するAFデータの補正は、Rセンサ94及びLセンサ96の採用センサにおけるAFデータの信号量差のみではなく、コントラスト比の補正も行うものである。補正はRセンサ94のAFデータとLセンサ96のAFデータのうち、ダイナミックレンジを超えない方のセンサのAFデータに対して行う。以下、具体的に補正処理の内容を説明する。   Next, a description will be given of a case where another correction unit is employed in the AF data correction in step S304 instead of the signal amount difference correction shown in the flowchart of FIG. The correction of AF data described here is not only a difference in signal amount of AF data in the sensors employed by the R sensor 94 and the L sensor 96 but also a correction of the contrast ratio. The correction is performed on the AF data of the sensor that does not exceed the dynamic range among the AF data of the R sensor 94 and the AF data of the L sensor 96. Hereinafter, the details of the correction process will be described.

まず、AFデータの補正式において使用するコントラスト補正量とオフセット補正量について説明する。尚、オフセット補正量は、上記信号量差を補正するための補正量に相当するものである。ここで、コントラスト補正量をDLVCOMPA、オフセット補正量をDLVCOMPB、Rセンサ94の採用センサにおけるAFデータの最大値及び最小値をそれぞれR1MAX及びR1MIN、Lセンサ96の採用センサにおけるAFデータの最大値及び最小値をそれぞれL1MAX及びL1MIN、最高相関が得られたRウインドウ94B及びLウインドウ96BにおけるAFデータの最小値をそれぞれR2MIN及びL2MINとする。   First, the contrast correction amount and the offset correction amount used in the AF data correction formula will be described. The offset correction amount corresponds to a correction amount for correcting the signal amount difference. Here, the contrast correction amount is DLVCOMPA, the offset correction amount is DLVCOMPB, the AF data maximum value and minimum value in the adopted sensor of the R sensor 94 are R1MAX and R1MIN, and the AF data maximum value and minimum in the adopted sensor of the L sensor 96, respectively. The values are L1MAX and L1MIN, respectively, and the minimum values of AF data in the R window 94B and L window 96B where the highest correlation is obtained are R2MIN and L2MIN, respectively.

コントラスト補正量DLVCOMPAとオフセット補正量DLVCOMPBを求める式は、最高相関が得られたRウインドウ94BにおけるAFデータの最小値R2MINとRウインドウ94BにおけるAFデータの最小値R2MINとの大小関係によって異なる。次式、
[数30]
L2MIN≦R2MIN …(32)
が成り立つ場合、コントラスト補正量DLVCOMPAとオフセット補正量DLVCOMPBは、次式、
[数31]
DLVCOMPA=(R1MAX−R1MIN)/(L1MAX−L1MIN) …(33)
DLVCOMPB=R1MIN−{(R1MAX−R1MIN)/(L1MAX−L1MIN)}×L1MIN …(34)
により求められる。
The expressions for obtaining the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMPB differ depending on the magnitude relationship between the minimum value R2MIN of AF data in the R window 94B and the minimum value R2MIN of AF data in the R window 94B where the highest correlation is obtained. The following formula,
[Equation 30]
L2MIN ≦ R2MIN (32)
Is satisfied, the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMB are expressed by the following equation:
[Equation 31]
DLVCOMPA = (R1MAX−R1MIN) / (L1MAX−L1MIN) (33)
DLVCOMB = R1MIN − {(R1MAX−R1MIN) / (L1MAX−L1MIN)} × L1MIN (34)
It is calculated by.

一方、次式、
[数32]
L2MIN>R2MIN …(35)
が成り立つ場合、コントラスト補正量DLVCOMPAとオフセット補正量DLVCOMPBは、次式、
[数33]
DLVCOMPA=(L1MAX−L1MIN)/(R1MAX−R1MIN) …(36)
DLVCOMPB=L1MIN−{(L1MAX−L1MIN)/(R1MAX−R1MIN)}×R1MIN …(37)
により求められる。
On the other hand,
[Formula 32]
L2MIN> R2MIN (35)
Is satisfied, the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMB are expressed by the following equation:
[Equation 33]
DLVCOMPA = (L1MAX−L1MIN) / (R1MAX−R1MIN) (36)
DLVCOMB = L1MIN − {(L1MAX−L1MIN) / (R1MAX−R1MIN)} × R1MIN (37)
It is calculated by.

上式によりコントラスト補正量DLVCOMPA及びオフセット補正量DLVCOMPBを求めると、次にコントラスト補正量DLVCOMPA及びオフセット補正量DLVCOMPBに基づいて採用センサにおける補正範囲のAFデータを補正する演算処理について説明する。ここで、Rセンサ94及びLセンサ96の補正前のAFデータをR及びL、補正後のAFデータをRH及びLHとする。   Once the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMPB are obtained from the above equations, calculation processing for correcting the AF data of the correction range in the employed sensor based on the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMB will be described next. Here, the AF data before correction of the R sensor 94 and the L sensor 96 is R and L, and the AF data after correction is RH and LH.

次式、
[数34]
L2MIN≦R2MIN …(38)
が成り立つ場合、補正後のAFデータRH、LHは、上式(33)、(34)により求めたコントラスト補正量DLVCOMPAとオフセット補正量DLVCOMPBを用いて、次の補正式、
[数35]
LH=DLVCOMPA×L+DLVCOMPB …(39)
RH=R …(40)
により算出される。
The following formula,
[Formula 34]
L2MIN ≦ R2MIN (38)
Is satisfied, the corrected AF data RH and LH are obtained by using the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMB obtained by the above equations (33) and (34), and the following correction equation:
[Equation 35]
LH = DLVCOMPA × L + DLVCOMB (39)
RH = R (40)
Is calculated by

一方、次式、
[数36]
L2MIN>R2MIN …(41)
の場合、補正後のAFデータRH、LHは、上式(36)、(37)により求めたコントラスト補正量DLVCOMPAとオフセット補正量DLVCOMPBを用いて、次の補正式、
[数37]
LH=L …(42)
RH=DLVCOMPA×R+DLVCOMPB …(43)
により算出される。
On the other hand,
[Equation 36]
L2MIN> R2MIN (41)
In the case of the corrected AF data RH and LH, the following correction equation is obtained using the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMB obtained by the above equations (36) and (37):
[Equation 37]
LH = L (42)
RH = DLVCOMPA × R + DLVCOMB (43)
Is calculated by

以上のAFデータ補正の処理手順を図65のフローチャートに示す。CPU60は、上記図7ステップS16の相関値演算処理により最高相関が得られたRウインドウ94B及びLウインドウ96BにおけるAFデータの最小値R2MIN、L2MINについて、上式(32)、即ち、
[数38]
L2MIN≦R2MIN …(32)
が成り立つか否かを判定する(ステップS350)。YESと判定した場合、次に、コントラスト補正量DLVCOMPAを上式(33)、即ち、
[数39]
DLVCOMPA=(R1MAX−R1MIN)/(L1MAX−L1MIN) …(33)
により算出する(ステップS352)。また、オフセット補正量DLVCOMPBを上式(34)、即ち、
[数40]
DLVCOMPB=R1MIN−{(R1MAX−R1MIN)/(L1MAX−L1MIN)}×L1MIN …(34)
により算出する(ステップS354)。
The above AF data correction processing procedure is shown in the flowchart of FIG. The CPU 60 calculates the minimum value R2MIN and L2MIN of the AF data in the R window 94B and the L window 96B in which the highest correlation is obtained by the correlation value calculation process in step S16 in FIG.
[Equation 38]
L2MIN ≦ R2MIN (32)
It is determined whether or not holds (step S350). If the determination is YES, then the contrast correction amount DLVCOMPA is set to the above equation (33), that is,
[Equation 39]
DLVCOMPA = (R1MAX−R1MIN) / (L1MAX−L1MIN) (33)
(Step S352). Further, the offset correction amount DLVCOMB is expressed by the above equation (34), that is,
[Equation 40]
DLVCOMB = R1MIN − {(R1MAX−R1MIN) / (L1MAX−L1MIN)} × L1MIN (34)
(Step S354).

そして、補正後のAFデータRH、LHを上式(39)、(40)、即ち、
[数41]
LH=DLVCOMPA×L+DLVCOMPB …(39)
RH=R …(40)
により算出する(ステップS356)。
Then, the corrected AF data RH and LH are expressed by the above equations (39) and (40), that is,
[Equation 41]
LH = DLVCOMPA × L + DLVCOMB (39)
RH = R (40)
(Step S356).

一方、上記ステップS350においてNOと判定した場合には、コントラスト補正量DLVCOMPAを上式(36)、即ち、
[数42]
DLVCOMPA=(L1MAX−L1MIN)/(R1MAX−R1MIN) …(36)
により算出する(ステップS358)。また、オフセット補正量DLVCOMPBを、上式(37)、即ち、
[数43]
DLVCOMPB=L1MIN−{(L1MAX−L1MIN)/(R1MAX−R1MIN)}×R1MIN …(37)
により算出する(ステップS360)。
On the other hand, if it is determined NO in step S350, the contrast correction amount DLVCOMPA is expressed by the above equation (36), that is,
[Formula 42]
DLVCOMPA = (L1MAX−L1MIN) / (R1MAX−R1MIN) (36)
(Step S358). Further, the offset correction amount DLVCOMB is expressed by the above equation (37), that is,
[Equation 43]
DLVCOMB = L1MIN − {(L1MAX−L1MIN) / (R1MAX−R1MIN)} × R1MIN (37)
(Step S360).

そして、補正後のAFデータLH、RHを上式(42)、(43)、即ち、
[数44]
LH=L …(42)
RH=DLVCOMPA×R+DLVCOMPB …(43)
により算出する(ステップS362)。
Then, the corrected AF data LH and RH are expressed by the above equations (42) and (43), that is,
[Equation 44]
LH = L (42)
RH = DLVCOMPA × R + DLVCOMB (43)
(Step S362).

次に、ここで説明したコントラスト補正とオフセット補正(信号量差補正)を行う場合のAFデータ補正処理の効果について上述の信号量差補正のみ行うAFデータ補正処理(図63参照)と比較して説明する。尚、前者を新方式、後者を従来方式(実施例1)という。   Next, the effect of the AF data correction processing when performing the contrast correction and offset correction (signal amount difference correction) described here is compared with the AF data correction processing (see FIG. 63) in which only the signal amount difference correction is performed. explain. The former is called a new method, and the latter is called a conventional method (Example 1).

まず、Rセンサ94とLセンサ96のうち一方のセンサが明るい場合(太陽光等が片側のセンサに多く照射された場合→信号量差有り、コントラスト差無しの場合)における補正結果を例示する。図66(A)、(B)は、Rセンサ94及びLセンサ96の採用センサ(図では中央エリア)における補正前(補正無し)のAFデータの分布と従来方式による補正後のAFデータの分布を示しており、補正は、Rセンサ94のAFデータに対して行われている。   First, the correction result in the case where one of the R sensor 94 and the L sensor 96 is bright (when sunlight or the like is radiated to one sensor in a large amount → when there is a signal amount difference and no contrast difference) will be exemplified. 66A and 66B show the distribution of AF data before correction (without correction) and the distribution of AF data after correction according to the conventional method in the sensors (center area in the drawing) of the R sensor 94 and L sensor 96. FIG. The correction is performed on the AF data of the R sensor 94.

一方、図67(A)、(B)は、図66と同じ補正前(補正無し)のAFデータの分布と新方式による補正後のAFデータの分布を示しており、補正は、Lセンサ96のAFデータに対して行われている。   On the other hand, FIGS. 67A and 67B show the same AF data distribution (without correction) as that in FIG. 66 and the AF data distribution after correction by the new method. This is performed for AF data.

そして、図68は、図66及び図67における補正前のAFデータと、新方式及び従来方式による補正後のAFデータに基づいてそれぞれ相関値f(n)を算出した場合の相関値分布を示している。   FIG. 68 shows the correlation value distribution when the correlation value f (n) is calculated based on the AF data before correction in FIGS. 66 and 67 and the AF data after correction by the new method and the conventional method. ing.

図68の相関値分布から分かるように、補正前におけるRセンサ94のAFデータとLセンサ96のAFデータとにコントラスト差が無い場合には、従来方式と新方式のいずれのAFデータ補正でも同じ結果を示し、補正無しの場合に比べてRセンサ94のAFデータとLセンサ96のAFデータの信号量の一致度が向上している。図69は、実際に被写体を至近から無限遠までの距離に配置し、その距離(横軸)に対して、オートフォーカスにより設定される撮影レンズの設定距離(縦軸)を、AFデータの補正を行わない場合(補正無しの場合)、新方式によりAFデータを補正した場合、従来方式によりAFデータを補正した場合、及び、設計値の場合について示したものである。この図から明らかなように、補正無しの場合には、設計値とのずれを生じているが、従来方式及び新方式による場合には撮影レンズの設定距離が設計値とほぼ一致していることが分かる。以上のことからRセンサ94とLセンサ96とにコントラスト差が無い場合には、従来方式と新方式のいずれのAFデータ補正処理でも適切な結果が得られる。   As can be seen from the correlation value distribution of FIG. 68, when there is no contrast difference between the AF data of the R sensor 94 and the AF data of the L sensor 96 before correction, the same AF data correction is performed for both the conventional method and the new method. The result shows that the degree of coincidence between the signal amounts of the AF data of the R sensor 94 and the AF data of the L sensor 96 is improved as compared with the case without correction. In FIG. 69, the subject is actually arranged at a distance from the nearest to infinity, and the setting distance (vertical axis) of the photographing lens set by autofocus is corrected with respect to the distance (horizontal axis). This is a case where AF data is not corrected (when correction is not performed), AF data is corrected by a new method, AF data is corrected by a conventional method, and a case of design values. As is clear from this figure, there is a deviation from the design value in the case of no correction, but in the case of the conventional method and the new method, the setting distance of the taking lens is almost the same as the design value. I understand. From the above, when there is no contrast difference between the R sensor 94 and the L sensor 96, an appropriate result can be obtained by either the conventional method or the new method of AF data correction processing.

しかしながら、Rセンサ94とLセンサ96のうち一方のセンサが暗い場合 (片側のセンサを指等で隠してしまった場合→信号量差及びコントラスト差有りの場合)には、新方式の方が従来方式に比べてより有利な結果が得られる。次に、この場合における補正結果を例示する。図70(A)、(B)は、Rセンサ94及びLセンサ96の採用センサ(図では中央エリア)における補正前(補正無し)のAFデータの分布と従来方式による補正後のAFデータの分布を示しており、補正は、Rセンサ94のAFデータに対して行われている。   However, when one of the R sensor 94 and the L sensor 96 is dark (when one sensor is hidden with a finger etc. → when there is a signal amount difference and a contrast difference), the new method is conventional. More advantageous results are obtained compared to the method. Next, the correction result in this case will be exemplified. FIGS. 70A and 70B show the distribution of AF data before correction (without correction) and the distribution of AF data after correction according to the conventional method in the sensors (center area in the drawing) of the R sensor 94 and L sensor 96. FIG. The correction is performed on the AF data of the R sensor 94.

一方、図71(A)、(B)は、図70と同じ補正前(補正無し)のAFデータの分布と新方式による補正後のAFデータの分布を示しており、補正は、Lセンサ96のAFデータに対して行われている。   On the other hand, FIGS. 71A and 71B show the same AF data distribution before correction (without correction) as that in FIG. 70 and AF data distribution after correction by the new method. This is performed for AF data.

そして、図72は、図70及び図71における補正前のAFデータ、新方式及び従来方式による補正後のAFデータに基づいてそれぞれ相関値f(n)を算出した場合の相関値分布を示している。   FIG. 72 shows the correlation value distribution when the correlation value f (n) is calculated based on the AF data before correction in FIGS. 70 and 71 and the AF data after correction by the new method and the conventional method. Yes.

図72の相関値分布から分かるように従来方式に比べて新方式によるAFデータ補正の方が最小極小値が小さな値を示し、Rセンサ94のAFデータとLセンサ96のAFデータの信号量の一致度がより向上している。図73は、実際に被写体を至近から無限遠までの距離に配置し、その距離(横軸)に対して、AFにより設定される撮影レンズの設定距離(縦軸)を、AFデータの補正を行わない場合(補正無しの場合)、新方式によりAFデータを補正した場合、従来方式によりAFデータを補正した場合、及び、設計値の場合について示したものである。この図から明らかなように、補正無しの場合及び従来方式による場合には撮影レンズの設定距離が設計値とのずれを生じているが、新方式による場合には、撮影レンズの設定距離が設計値とほぼ一致していることが分かる。以上のことからRセンサ94とLセンサ96とにコントラスト差が有る場合には、従来方式よりも新方式によるAFデータ補正処理の方が適切な結果が得られる。従って、コントラスト差の有無に関係なく適切な結果が得られる新方式は従来方式に比べてより好適である。   As can be seen from the correlation value distribution of FIG. 72, the AF data correction by the new method shows a smaller minimum minimum value than the conventional method, and the signal amounts of the AF data of the R sensor 94 and the AF data of the L sensor 96 are smaller. The degree of matching is better. In FIG. 73, the subject is actually arranged at a distance from the closest distance to infinity, and the set distance (vertical axis) of the photographing lens set by AF is corrected for the AF data with respect to the distance (horizontal axis). In the case of not performing (without correction), the AF data is corrected by the new method, the AF data is corrected by the conventional method, and the case of the design value is shown. As is clear from this figure, the setting distance of the photographic lens is different from the design value in the case of no correction and in the conventional method, but in the case of the new method, the setting distance of the photographic lens is designed. It can be seen that the values are almost the same. From the above, when there is a contrast difference between the R sensor 94 and the L sensor 96, the AF data correction processing by the new method can obtain a more appropriate result than the conventional method. Therefore, the new method that can obtain an appropriate result regardless of the presence or absence of the contrast difference is more preferable than the conventional method.

尚、上記コントラスト補正量DLVCOMPAやオフセット補正量DLVCOMPBを算出する際におけるR1MAX及びR1MIN、L1MAX及びL1MINはそれぞれRセンサ94、Lセンサ96の採用センサにおけるAFデータの最大値及び最小値としたが、これに限らず、Rセンサ94、Lセンサ96のAFデータを補正する範囲におけるAFデータの最大値及び最小値としてもよい。さらに、R1MAX、R1MIN、L1MAX、L1MINの代わりにR2MAX、R2MIN、L2MAX、L2MINを用いてもよい。また、上式(32)、(35)、(38)、(41)におけるR2MIN、L2MINは、それぞれ最高相関が得られたRウインドウ94B及びLウインドウ96BにおけるAFデータの最小値としたが、R2MIN、L2MINの代わりにAFデータを補正する範囲におけるAFデータの最小値を用いてもよい。   The R1MAX and R1MIN, and the L1MAX and L1MIN when calculating the contrast correction amount DLVCOMPA and the offset correction amount DLVCOMPB are the maximum value and the minimum value of the AF data in the sensors employed by the R sensor 94 and the L sensor 96, respectively. Not limited to this, the maximum value and the minimum value of the AF data in the range in which the AF data of the R sensor 94 and the L sensor 96 are corrected may be used. Further, R2MAX, R2MIN, L2MAX, and L2MIN may be used instead of R1MAX, R1MIN, L1MAX, and L1MIN. Further, R2MIN and L2MIN in the above equations (32), (35), (38), and (41) are the minimum values of the AF data in the R window 94B and the L window 96B where the highest correlation is obtained. Instead of L2MIN, the minimum value of AF data in the range in which AF data is corrected may be used.

{極小値判定処理}
次に、極小値判定の処理について説明する。上記図7ステップS16の相関値演算処理や、図7ステップS20のL、Rチャンネル差補正処理には、相関値分布から相関値f(n)の極小値を検出する処理が含まれるが、その際に、ここで説明する極小値判定の処理により極小値が存在するか否かの判断が行われる。基本的に、極小値と判断される相関値は、そのシフト量の両側に隣接するシフト量におけるいずれの相関値よりも小さくなるものであり、極小値のうち最小のものが最小極小値となる。
{Minimum value judgment processing}
Next, the minimum value determination process will be described. The correlation value calculation process in step S16 in FIG. 7 and the L and R channel difference correction processes in step S20 in FIG. 7 include a process for detecting the minimum value of the correlation value f (n) from the correlation value distribution. At this time, it is determined whether or not there is a minimum value by the process of determining the minimum value described here. Basically, the correlation value determined as the minimum value is smaller than any correlation value in the shift amount adjacent to both sides of the shift amount, and the minimum of the minimum values is the minimum minimum value. .

ところで、被写体が測距可能な至近よりも近距離に存在する場合、相関値の極小値は本来存在しない。図74は、この場合において、相関値f(n)をシフト量nの最大値である38よりも更に近距離側のシフト量まで求めたと仮定した場合の相関値分布の一例を示した図である。このような相関値分布においてはシフト量n=−2〜38の範囲に極小値が存在しないため、この採用センサでは測距不能と判定される。この判定は適切である。   By the way, when the subject is located at a closer distance than the closest possible distance, the minimum value of the correlation value does not exist. FIG. 74 is a diagram showing an example of the correlation value distribution when it is assumed in this case that the correlation value f (n) is obtained up to the shift amount closer to the nearer side than 38 which is the maximum value of the shift amount n. is there. In such a correlation value distribution, since there is no minimum value in the range of the shift amount n = −2 to 38, it is determined that distance measurement is impossible with this adopted sensor. This determination is appropriate.

しかしながら、このように被写体が至近よりも近距離に存在する場合においても実際には図75や図76に示すように極小値が存在してしまう場合がある。尚、図75は高コントラストの場合、図76は低コントラストの場合を示している。   However, even when the subject is present at a shorter distance than the closest distance, there may actually be a local minimum value as shown in FIGS. 75 shows the case of high contrast, and FIG. 76 shows the case of low contrast.

これに対して極小値判定の基本的判定内容として、極小値が所定値よりも大きい場合には極小値でないと判定することとしているため、例えばその所定値を1000とした場合、図75の場合には極小値は存在せず、適切に測距不能と判定される。   On the other hand, as the basic determination content of the minimum value determination, when the minimum value is larger than the predetermined value, it is determined that the minimum value is not the minimum value. There is no local minimum value, and it is determined that distance measurement is not possible.

一方、図76の場合には、極小値が1000より小さい値で存在するため、上記判定内容では極小値が存在すると判定される不具合が生じる。   On the other hand, in the case of FIG. 76, since the minimum value exists with a value smaller than 1000, there is a problem that it is determined that the minimum value exists in the above determination content.

そこで、本極小値判定では、次のような判定を行い、上記不具合を解消する。被写体が測距可能な範囲内に存在する場合、通常、相関値f(n)の最小極小値は最小値でもある。これに対して、最小極小値のシフト量よりも至近側で最小値が検出された場合には、至近よりもさらに近距離側に被写体があると予想できる。従って、最小極小値のシフト量よりも至近側(シフト量が小さい程、至近側)に最小極小値より小さい相関値が存在する場合には、近距離警告又は測距不能とする。   Therefore, in this local minimum value determination, the following determination is performed to eliminate the above-mentioned problem. When the subject is within a range that can be measured, the minimum value of the correlation value f (n) is usually the minimum value. On the other hand, when the minimum value is detected closer to the minimum minimum value than the shift amount, it can be predicted that the subject is further closer than the closest distance. Therefore, if there is a correlation value smaller than the minimum minimum value closer to the shift side of the minimum minimum value (the closer the shift amount, the closer the shift side), the short distance warning or the distance measurement is disabled.

一方、最小極小値のシフト量よりも遠距離側に最小値があった場合は、何らかの異常(シフト量n=0で無限遠となるので、無限遠より更に無限遠はありえない)であると判断できるため、測距不能とする。   On the other hand, if there is a minimum value on the far side from the shift amount of the minimum minimum value, it is determined that there is some kind of abnormality (the shift amount n = 0 becomes infinity, so there can be no more infinity than infinity). Because it is possible, distance measurement is impossible.

{補間値演算処理(図7ステップS22)の詳細}
次に、図7のステップS22における補間値演算処理について説明する。補間値演算処理は、各分割エリアにおいて最高相関(最高相関値fmin)が得られたシフト量nminに対して周辺の相関値f(n)から更に精度の高い最高相関のシフト量を検出する処理である。尚、以下の説明において補間値演算処理によって検出する最高相関のシフト量を真の最高相関のシフト量といい、その値をxで示す。
{Details of Interpolation Value Calculation Processing (Step S22 in FIG. 7)}
Next, the interpolation value calculation process in step S22 of FIG. 7 will be described. The interpolation value calculation process is a process for detecting the shift amount of the highest correlation with higher accuracy from the peripheral correlation value f (n) with respect to the shift amount nmin in which the highest correlation (maximum correlation value fmin) is obtained in each divided area. It is. In the following description, the shift amount of the highest correlation detected by the interpolation value calculation process is referred to as a true shift amount of the highest correlation, and the value is indicated by x.

CPU60は、この補間値演算処理において次のような処理を行う。図77に示すように採用センサにおいて最高相関(最高相関値fmin(f(nmin))が得られたシフト量nminに対して、−1のシフト量nmin−1の相関値f(nmin−1)と+1のシフト量nmin+1の相関値f(nmin+1)とが、次式、
[数45]
f(nmin−1)>f(nmin+1) …(44)
の関係を満たしたとする。この場合、CPU60は、シフト量nminとシフト量nmin−1の相関値f(nmin)及びf(nmin−1)を通る直線L1と、シフト量nmin+1とシフト量nmin+2の相関値f(nmin+1)及びf(nmin+2)を通る直線L2との交点を求める。そして、その交点を真の最高相関のシフト量xとする。
The CPU 60 performs the following processing in this interpolation value calculation processing. As shown in FIG. 77, the correlation value f (nmin-1) of the shift amount nmin-1 of -1 with respect to the shift amount nmin for which the highest correlation (maximum correlation value fmin (f (nmin))) was obtained in the employed sensor. And the correlation value f (nmin + 1) of the shift amount nmin + 1 of +1 is
[Equation 45]
f (nmin-1)> f (nmin + 1) (44)
Suppose that the relationship is satisfied. In this case, the CPU 60 determines the straight line L1 passing through the correlation values f (nmin) and f (nmin−1) of the shift amount nmin and the shift amount nmin−1, and the correlation value f (nmin + 1) of the shift amount nmin + 1 and the shift amount nmin + 2. The intersection with the straight line L2 passing through f (nmin + 2) is obtained. The intersection is set as the true maximum correlation shift amount x.

一方、図78に示すように最高相関が得られたシフト量nminに対して−1のシフト量nmin−1の相関値f(nmin−1)と+1のシフト量nmin+1の相関値f(nmin+1)とが、次式、
[数46]
f(nmin−1)≦f(nmin+1) …(45)
の関係を満たしたとする。この場合、CPU60は、シフト量nmin−1とシフト量nmin−2の相関値f(nmin−1)及びf(nmin−2)を通る直線L1と、シフト量nminとシフト量nmin+1の相関値f(nmin)及びf(nmin+1)を通る直線L2との交点を求める。そして、その交点を真の最高相関のシフト量xとする。
On the other hand, as shown in FIG. 78, the correlation value f (nmin-1) of the shift amount nmin-1 of -1 and the correlation value f (nmin + 1) of the shift amount nmin + 1 of +1 with respect to the shift amount nmin with which the highest correlation was obtained. And the following formula:
[Equation 46]
f (nmin−1) ≦ f (nmin + 1) (45)
Suppose that the relationship is satisfied. In this case, the CPU 60 determines the straight line L1 passing through the correlation values f (nmin-1) and f (nmin-2) of the shift amount nmin-1 and the shift amount nmin-2, and the correlation value f of the shift amount nmin and the shift amount nmin + 1. The intersection point with the straight line L2 passing through (nmin) and f (nmin + 1) is obtained. The intersection is set as the true maximum correlation shift amount x.

ただし、図79に示すようにシフト量nの最小値(シフト量n=−2)が相関値f(n)の最小値、又は、図80に示すようにシフト量nの最大値(シフト量n=38)が相関値f(n)の最小値であった場合、これらの最小値は極小値とはならないため、シフト量nの最小値(シフト量n=−2)又は最大値(シフト量n=38)を最高相関のシフト量nminとして補間値演算を行う場合はない。この場合には測距不能となる。   However, as shown in FIG. 79, the minimum value of the shift amount n (shift amount n = −2) is the minimum value of the correlation value f (n), or the maximum value of the shift amount n (shift amount) as shown in FIG. When n = 38) is the minimum value of the correlation value f (n), these minimum values are not minimal values, and therefore the minimum value (shift amount n = -2) or maximum value (shift) of the shift amount n There is no case where the interpolation value is calculated with the amount n = 38) as the maximum correlation shift amount nmin. In this case, distance measurement is impossible.

また、図81(A)、(B)に示すようにシフト量nの最小値(シフト量n=−2)に対して+1のシフト量(シフト量n=−1)が最高相関のシフト量nminであった場合において、図81(A)のように上式(44)の関係が成り立つ場合(図77の場合)には、補間値演算を行うことができる。しかし、図81(B)のように上式(45)の関係が成り立つ場合(図78の場合)には、上記直線L1が定まらないため補間値演算を行うことなく測距不能とする。   As shown in FIGS. 81A and 81B, a shift amount of +1 (shift amount n = −1) is the shift amount having the highest correlation with respect to the minimum value of shift amount n (shift amount n = −2). In the case of nmin, when the relationship of the above equation (44) is established as shown in FIG. 81A (in the case of FIG. 77), the interpolation value calculation can be performed. However, when the relationship of the above equation (45) is satisfied as shown in FIG. 81B (in the case of FIG. 78), the straight line L1 is not determined, and thus the distance measurement is impossible without performing the interpolation value calculation.

また、図82(A)、(B)に示すようにシフト量nの最大値−1(シフト量n=37)が最高相関のシフト量nminであった場合において、図82(B)のように上式(45)の関係が成り立つ場合(図78の場合)には、補間値演算を行うことができる。しかし、図82(A)のように上式(44)の関係が成り立つ場合(図77の場合)には、上記直線L2が定まらないため補間値演算を行うことなく測距不能とする。   As shown in FIGS. 82A and 82B, when the maximum value −1 (shift amount n = 37) of the shift amount n is the highest correlation shift amount nmin, as shown in FIG. 82B. When the relationship of the above equation (45) is satisfied (in the case of FIG. 78), the interpolation value can be calculated. However, when the relationship of the above equation (44) is established as shown in FIG. 82A (in the case of FIG. 77), the straight line L2 is not determined, and thus the distance measurement is impossible without performing the interpolation value calculation.

以上の処理は、原則的な処理であり、次の場合には他の処理により真の最高相関のシフト量xを求める。例えば、最高相関が得られたシフト量nminに対して、±2の範囲のシフト量nmin−2、nmin−1、nmin+1、nmin+2の相関値f(n)を比較した場合に、シフト量nminを含めて連続する3点のシフト量nのみで相関値f(n)が近い値を示したとする。この場合には、その3点の中央点における相関値がシフトしていると考えられる。   The above processing is a principle processing. In the following case, the true maximum correlation shift amount x is obtained by other processing. For example, when the correlation value f (n) of the shift amounts nmin−2, nmin−1, nmin + 1, and nmin + 2 in the range of ± 2 is compared with the shift amount nmin where the highest correlation is obtained, the shift amount nmin is It is assumed that the correlation value f (n) shows a close value only with the three consecutive shift amounts n. In this case, it is considered that the correlation values at the three central points are shifted.

そこで、この場合には、上述の補間値演算処理の代わりに、次に説明する補間値演算処理により真の最高相関のシフト量xを検出する。尚、上述した補間値演算処理を補間値通常演算処理といい、以下で説明する補間値演算処理を補間値別演算処理という。また、相関値f(n)が近い値か否かの具体的判断については後述する。   In this case, instead of the above-described interpolation value calculation process, the true maximum correlation shift amount x is detected by the interpolation value calculation process described below. The interpolation value calculation process described above is referred to as an interpolation value normal calculation process, and the interpolation value calculation process described below is referred to as an interpolation value-specific calculation process. Further, specific determination as to whether or not the correlation value f (n) is a close value will be described later.

上述のように連続する3点のシフト量nにおいてのみ相関値f(n)が近い値を示す場合、その3点のシフト量nのうち中央点の相関値が、本来、最高相関値fminとして検出されるべきものであったと考えられる。そこで、CPU60は、3点のシフト量nのうち最小のシフト量nsと、そのシフト量nsに対して−1のシフト量ns−1との相関値f(ns)及びf(ns−1)を通る直線L1と、3点のシフト量nのうち最大のシフト量nlとそのシフト量nlに対して+1のシフト量nl+1との相関値f(nl)及びf(nl+1)を通る直線L2との交点を求める。そして、その交点を真の最高相関のシフト量xとする。   When the correlation value f (n) shows a close value only at three consecutive shift amounts n as described above, the correlation value at the center point among the three shift amounts n is essentially the highest correlation value fmin. It is thought that it was to be detected. Therefore, the CPU 60 correlates the minimum shift amount ns among the three shift amounts n and the correlation values f (ns) and f (ns−1) between the shift amount ns and the shift amount ns−1 of −1. And a straight line L2 passing through correlation values f (nl) and f (nl + 1) between the maximum shift amount nl of the three shift amounts n and the shift amount nl + 1 which is +1 with respect to the shift amount nl. Find the intersection of The intersection is set as the true maximum correlation shift amount x.

例えば、図83に示すように最高相関のシフト量nminが0で検出され、最高相関値f(0)とそのシフト量nminに対して+1と+2のシフト量1、2における相関値f(1)、f(2)が近い値になったとする。この場合、シフト量n=−1と0の相関値を通る直線L1と、シフト量n=2と3の相関値を通る直線L2との交点を求め、その交点をシフト量xとする。尚、この例のように最高相関のシフト量nminに対して+1と+2のシフト量における相関値が最高相関値に近い値となった場合の処理を処理タイプ1という。   For example, as shown in FIG. 83, the maximum correlation shift amount nmin is detected as 0, and the maximum correlation value f (0) and the correlation value f (1 at shift amounts 1 and 2 of +1 and +2 with respect to the shift amount nmin. ) And f (2) are close to each other. In this case, an intersection point between the straight line L1 passing through the correlation value of the shift amount n = −1 and 0 and the straight line L2 passing through the correlation value of the shift amount n = 2 and 3 is obtained, and the intersection point is set as the shift amount x. Note that the processing when the correlation value at the +1 and +2 shift amounts is close to the maximum correlation value with respect to the maximum correlation shift amount nmin as in this example is referred to as processing type 1.

また、図84に示すように最高相関のシフト量nminが0で検出され、最高相関値f(0)とそのシフト量nminに対して−1と+1のシフト量−1、1における相関値f(−1)、f(1)が近い値になったとする。この場合、シフト量n=−2と−1の相関値を通る直線L1と、シフト量n=1と2の相関値を通る直線L2との交点を求め、その交点をシフト量xとする。尚、この例のように最高相関のシフト量nminに対して−1と+1のシフト量における相関値が最高相関値に近い値となった場合の処理を処理タイプ2という。   As shown in FIG. 84, the maximum correlation shift amount nmin is detected as 0, and the maximum correlation value f (0) and the correlation value f at -1 and +1 shift amounts −1 and 1 with respect to the shift amount nmin. Assume that (−1) and f (1) are close to each other. In this case, an intersection point between the straight line L1 passing through the correlation value of the shift amount n = −2 and −1 and the straight line L2 passing through the correlation value of the shift amount n = 1 and 2 is obtained, and the intersection point is set as the shift amount x. The processing when the correlation value at the shift amount of −1 and +1 with respect to the shift amount nmin of the highest correlation becomes a value close to the highest correlation value as in this example is referred to as processing type 2.

また、図85に示すように最高相関のシフト量nminが0で検出され、最高相関値f(0)とそのシフト量nminに対して−2と−1のシフト量−2、−1における相関値f(−2)、f(−1)が近い値になったとする。この場合、シフト量n=−3と−2の相関値を通る直線L1と、シフト量n=0と1の相関値を通る直線L2との交点を求め、その交点をシフト量xとする。尚、この例のように最高相関のシフト量nminに対して−2と−1のシフト量において相関値が最高相関値に近い値となった場合の処理を処理タイプ3という。   In addition, as shown in FIG. 85, the maximum correlation shift amount nmin is detected as 0, and the maximum correlation value f (0) and the correlation between −2 and −1 shift amounts −2 and −1 with respect to the shift amount nmin. Assume that the values f (−2) and f (−1) are close to each other. In this case, an intersection point between the straight line L1 passing through the correlation value of the shift amount n = −3 and −2 and the straight line L2 passing through the correlation value of the shift amount n = 0 and 1 is obtained, and the intersection point is set as the shift amount x. Note that the processing when the correlation value becomes close to the maximum correlation value in the shift amounts of −2 and −1 with respect to the maximum correlation shift amount nmin as in this example is referred to as processing type 3.

図86は、補間値演算処理において上記補間値通常演算及び補間値別演算の処理タイプ1〜3を判別する手順を示したフローチャートである。まず、CPU60は、最高相関値f(nmin)と、最高相関のシフト量nminに対して+1のシフト量nmin+1における相関値f(nmin+1)との相関値差f(nmin+1)−f(nmin)が基準値R7に対して、次式、
[数47]
f(nmin+1)−f(nmin)<R7
を満たすか否かを判定する(ステップS400)。尚、基準値R7は、2つの相関値が近い値であると判定できる上限値である。もし、NOと判定した場合には、次に、最高相関値f(nmin)と、シフト量nminに対して−1のシフト量nmin−1における相関値f(nmin−1)との相関値差f(nmin−1)−f(nmin)が基準値R7に対して、次式、
[数48]
f(nmin−1)−f(nmin)<R7
を満たすか否かを判定する(ステップS402)。もし、この判定処理においてもNOと判定した場合には、補間値通常演算処理を行い(ステップS432)、真の最高相関のシフト量xを検出してこの補間値演算処理を終了する。
FIG. 86 is a flowchart showing a procedure for discriminating the processing types 1 to 3 of the above-described normal interpolation value calculation and interpolation value-specific calculation in the interpolation value calculation process. First, the CPU 60 determines that the correlation value difference f (nmin + 1) −f (nmin) between the maximum correlation value f (nmin) and the correlation value f (nmin + 1) at the shift amount nmin + 1 that is +1 with respect to the maximum correlation shift amount nmin. For the reference value R7,
[Equation 47]
f (nmin + 1) −f (nmin) <R7
It is determined whether or not the condition is satisfied (step S400). The reference value R7 is an upper limit value that can determine that two correlation values are close to each other. If the determination is NO, then the correlation value difference between the highest correlation value f (nmin) and the correlation value f (nmin-1) at the shift amount nmin-1 of -1 with respect to the shift amount nmin. f (nmin−1) −f (nmin) is the following formula with respect to the reference value R7:
[Formula 48]
f (nmin-1) -f (nmin) <R7
It is determined whether or not the condition is satisfied (step S402). If NO is determined in this determination process, an interpolation value normal calculation process is performed (step S432), the true maximum correlation shift amount x is detected, and the interpolation value calculation process is terminated.

一方、ステップS402においてYESと判定した場合、次に、最高相関のシフト量nminに対して−3のシフト量nmin−3における相関値f(nmin−3)が存在するか否かを判定する(ステップS404)。NOと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、YESと判定した場合には、シフト量nmin−1における相関値f(nmin−1)と、シフト量nmin−2における相関値f(nmin−2)との相関値差f(nmin−2)−f(nmin−1)が基準値R7に対して、次式、
[数49]
f(nmin−2)−f(nmin−1)<R7
を満たすか否かを判定する(ステップS406)。もし、この判定処理においてNOと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、YESと判定した場合には、シフト量nmin−2における相関値f(nmin−2)とシフト量nmin−3における相関値f(nmin−3)との相関値差f(nmin−3)−f(nmin−2)が基準値R7に対して、次式、
[数50]
f(nmin−3)−f(nmin−2)<R7
を満たすか否かを判定する(ステップS408)。もし、この判定処理においてYESと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、NOと判定した場合には、シフト量nmin+1における相関値f(nmin+1)とシフト量nmin−2における相関値f(nmin−2)との相関値差f(nmin+1)−f(nmin−2)が基準値R7に対して、次式、
[数51]
f(nmin+1)−f(nmin−2)<R7
を満たすか否かを判定する(ステップS410)。もし、この判定処理においてNOと判定した場合には、処理タイプ3の補間値別演算処理を行う(ステップS412)。即ち、図85に示したように相関値f(nmin−1)付近に極小値 (真の最高相関値)が存在すると想定し、相関値f(nmin−3)、f(nmin−2)、f(nmin)、f(nmin+1)に基づいてシフト量xを求める。
On the other hand, if YES is determined in step S402, it is then determined whether or not there is a correlation value f (nmin-3) at the shift amount nmin-3 of -3 with respect to the shift amount nmin of the highest correlation ( Step S404). When it is determined NO, an interpolation value normal calculation process is performed (step S432). On the other hand, if YES is determined, the correlation value difference f (nmin−2) between the correlation value f (nmin−1) at the shift amount nmin−1 and the correlation value f (nmin−2) at the shift amount nmin−2. ) −f (nmin−1) with respect to the reference value R7,
[Equation 49]
f (nmin-2) -f (nmin-1) <R7
It is determined whether or not the condition is satisfied (step S406). If it is determined NO in this determination process, an interpolation value normal calculation process is performed (step S432). On the other hand, if YES is determined, the correlation value difference f (nmin-3) between the correlation value f (nmin-2) at the shift amount nmin-2 and the correlation value f (nmin-3) at the shift amount nmin-3. −f (nmin−2) with respect to the reference value R7,
[Equation 50]
f (nmin-3) -f (nmin-2) <R7
It is determined whether or not the condition is satisfied (step S408). If YES is determined in this determination process, an interpolation value normal calculation process is performed (step S432). On the other hand, if NO is determined, the correlation value difference f (nmin + 1) −f (nmin−2) between the correlation value f (nmin + 1) at the shift amount nmin + 1 and the correlation value f (nmin−2) at the shift amount nmin−2. ) For the reference value R7,
[Formula 51]
f (nmin + 1) -f (nmin-2) <R7
It is determined whether or not the condition is satisfied (step S410). If it is determined NO in this determination process, a process type 3 calculation process for each interpolation value is performed (step S412). That is, as shown in FIG. 85, it is assumed that there is a minimum value (true maximum correlation value) in the vicinity of the correlation value f (nmin−1), and the correlation values f (nmin−3), f (nmin−2), A shift amount x is obtained based on f (nmin) and f (nmin + 1).

一方、ステップS410においてYESと判定した場合には、処理タイプ2の補間値別演算処理を行う(ステップS420)。即ち、図84に示したように相関値f(nmin)付近に極小値(真の最高相関値)が存在すると想定し、相関値f(nmin−2)、f(nmin−1)、f(nmin+1)、f(nmin+2)に基づいてシフト量xを求める。   On the other hand, if YES is determined in step S410, a processing type 2 calculation process for each interpolation value is performed (step S420). That is, as shown in FIG. 84, it is assumed that there is a minimum value (true maximum correlation value) near the correlation value f (nmin), and the correlation values f (nmin-2), f (nmin-1), f ( The shift amount x is obtained based on nmin + 1) and f (nmin + 2).

上記ステップS400においてYESと判定した場合には、CPU60は、最高相関値f(nmin)と、最高相関のシフト量nminに対して−1のシフト量nmin−1における相関値差f(nmin−1)との相関値差f(nmin−1)−f(nmin)が基準値R7に対して、次式、
[数52]
f(nmin−1)−f(nmin)<R7
を満たすか否かを判定する(ステップS414)。YESと判定した場合、次に、シフト量nmin−1における相関値f(nmin−1)と、シフト量nmin−2における相関値f(nmin−2)との相関値差f(nmin−2)−f(nmin−1)が基準値R7に対して、次式、
[数53]
f(nmin−2)−f(nmin−1)<R7
を満たすか否かを判定する(ステップS416)。もし、この判定処理においてYESと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、NOと判定した場合には、次に、シフト量nmin+1における相関値f(nmin+1)と、シフト量nmin+2における相関値f(nmin+2)との相関値差f(nmin+2)−f(nmin+1)が基準値R7に対して、次式、
[数54]
f(nmin+2)−f(nmin+1)<R7
を満たすか否かを判定する(ステップS418)。もし、この判定処理においてYESと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、NOと判定した場合には、処理タイプ2の補間値別演算処理を行う(ステップS420)。
If YES is determined in step S400, the CPU 60 determines the maximum correlation value f (nmin) and the correlation value difference f (nmin−1) at the shift amount nmin−1 of −1 with respect to the shift amount nmin of the highest correlation. ) And the correlation value difference f (nmin−1) −f (nmin) with respect to the reference value R7,
[Formula 52]
f (nmin-1) -f (nmin) <R7
It is determined whether or not the condition is satisfied (step S414). If YES is determined, next, the correlation value difference f (nmin-2) between the correlation value f (nmin-1) at the shift amount nmin-1 and the correlation value f (nmin-2) at the shift amount nmin-2. −f (nmin−1) is the following equation with respect to the reference value R7:
[Formula 53]
f (nmin-2) -f (nmin-1) <R7
It is determined whether or not the condition is satisfied (step S416). If YES is determined in this determination process, an interpolation value normal calculation process is performed (step S432). On the other hand, if NO is determined, then the correlation value difference f (nmin + 2) −f (nmin + 1) between the correlation value f (nmin + 1) at the shift amount nmin + 1 and the correlation value f (nmin + 2) at the shift amount nmin + 2 is For the reference value R7,
[Formula 54]
f (nmin + 2) −f (nmin + 1) <R7
It is determined whether or not the condition is satisfied (step S418). If YES is determined in this determination process, an interpolation value normal calculation process is performed (step S432). On the other hand, when it determines with NO, the processing type 2 calculation process according to interpolation value is performed (step S420).

上記ステップS414においてNOと判定した場合、CPU60は、最高相関のシフト量nminに対して−3のシフト量nmin−3における相関値f(nmin−3)が存在するか否かを判定する(ステップS422)。NOと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、YESと判定した場合には、シフト量nmin+1における相関値f(nmin+1)と、シフト量nmin+2における相関値f(nmin+2)との相関値差f(nmin+2)−f(nmin+1)が基準値R7に対して、次式、
[数55]
f(nmin+2)−f(nmin+1)<R7
を満たすか否かを判定する(ステップS424)。NOと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、YESと判定した場合には、シフト量nmin+2における相関値f(nmin+2)と、シフト量nmin+3における相関値f(nmin+3)との相関値差f(nmin+3)−f(nmin+2)が基準値R7に対して、次式、
[数56]
f(nmin+3)−f(nmin+2)<R7
を満たすか否かを判定する(ステップS426)。もし、YESと判定した場合には、補間値通常演算処理を行う(ステップS432)。一方、NOと判定した場合には、次に、シフト量nmin−1における相関値f(nmin−2)と、シフト量nmin+2における相関値f(nmin+2)との相関値差f(nmin−1)−f(nmin+2)が基準値R7に対して、次式、
[数57]
f(nmin−1)−f(nmin+2)<R7
を満たすか否かを判定する(ステップS428)。もし、NOと判定した場合には、処理タイプ2の補間値別演算処理を行う(ステップS420)。一方、YESと判定した場合には、処理タイプ1の補間値別演算処理を行う(ステップS430)。即ち、図83に示したように相関値f(nmin+1)付近に極小値(真の最高相関値)が存在すると想定し、相関値f(nmin−1)、f(nmin)、f(nmin+2)、f(nmin+3)に基づいてシフト量xを求める。
If it is determined as NO in step S414, the CPU 60 determines whether or not there is a correlation value f (nmin-3) at a shift amount nmin-3 of -3 with respect to the shift amount nmin of the highest correlation (step S414). S422). When it is determined NO, an interpolation value normal calculation process is performed (step S432). On the other hand, if YES is determined, the correlation value difference f (nmin + 2) −f (nmin + 1) between the correlation value f (nmin + 1) at the shift amount nmin + 1 and the correlation value f (nmin + 2) at the shift amount nmin + 2 is the reference value R7. Is given by
[Equation 55]
f (nmin + 2) −f (nmin + 1) <R7
It is determined whether or not the condition is satisfied (step S424). When it is determined NO, an interpolation value normal calculation process is performed (step S432). On the other hand, if YES is determined, the correlation value difference f (nmin + 3) −f (nmin + 2) between the correlation value f (nmin + 2) at the shift amount nmin + 2 and the correlation value f (nmin + 3) at the shift amount nmin + 3 is the reference value R7. Is given by
[Formula 56]
f (nmin + 3) −f (nmin + 2) <R7
It is determined whether or not the condition is satisfied (step S426). If YES is determined, an interpolation value normal calculation process is performed (step S432). On the other hand, if NO is determined, then the correlation value difference f (nmin-1) between the correlation value f (nmin-2) at the shift amount nmin-1 and the correlation value f (nmin + 2) at the shift amount nmin + 2. -F (nmin + 2) is the following equation with respect to the reference value R7:
[Equation 57]
f (nmin-1) -f (nmin + 2) <R7
It is determined whether or not the condition is satisfied (step S428). If it is determined as NO, processing type 2 calculation processing for each interpolation value is performed (step S420). On the other hand, when it determines with YES, the processing type 1 calculation process according to interpolation value is performed (step S430). That is, as shown in FIG. 83, it is assumed that there is a minimum value (true maximum correlation value) near the correlation value f (nmin + 1), and the correlation values f (nmin−1), f (nmin), f (nmin + 2). , F (nmin + 3) to obtain the shift amount x.

{AFエラー処理(図7ステップS24)の詳細}
次に、図7のステップS24におけるAFエラー処理について説明する。AFエラー処理は、測距エリア設定処理(図7ステップS10参照)において3エリア設定又は5エリア設定された測距エリアの全ての分割エリアで測距不能と判定されると、予め設定した被写体距離にピントを合わせるように撮影レンズを固定焦点にセットする処理である。尚、撮影レンズを固定焦点にセットするCPU60の処理を固定焦点処理といい、以下、この固定焦点処理について説明する。
{Details of AF error processing (step S24 in FIG. 7)}
Next, the AF error process in step S24 of FIG. 7 will be described. In the AF error process, if it is determined that distance measurement is impossible in all the divided areas of the 3 areas set or 5 areas set in the distance measurement area setting process (see step S10 in FIG. 7), a preset subject distance is set. In this process, the photographic lens is set at a fixed focal point so that it is in focus. Note that the process of the CPU 60 for setting the photographing lens to a fixed focus is called a fixed focus process, and this fixed focus process will be described below.

測距エリアの全ての分割エリアで測距不能と判定された場合、CPU60は測距不能と判定された原因やフイルム感度等に応じて図87及び図88のフローチャートに示すように予め決められた固定焦点に撮影レンズを設定する。   When it is determined that distance measurement is impossible in all the divided areas of the distance measurement area, the CPU 60 determines in advance according to the cause of determination that distance measurement is impossible, film sensitivity, and the like as shown in the flowcharts of FIGS. Set the photographic lens to a fixed focus.

まず、CPU60は、測距エリアの全ての分割エリアにおいて測距不能と判定された場合、AFプレ発光を行ったか否かを判定する(ステップS450)。NOと判定した場合には、センサ感度を高感度と低感度のいずれに設定していたかを判定する(ステップS452)。低感度に設定していたと判定した場合には、撮影レンズを固定焦点6mに設定する(ステップS454)
一方、ステップS452においてセンサ感度を高感度に設定していたと判定した場合には、図88のフローチャートに移行し、フイルム感度がISO400未満かISO400以上かを判定する(ステップS464)。ISO400未満と判定した場合には、撮影レンズを固定焦点3mに設定する(ステップS466)。一方、ISO400以上と判定した場合には、撮影レンズを固定焦点6mに設定する(ステップS468)。
First, the CPU 60 determines whether or not AF pre-emission has been performed when it is determined that distance measurement is impossible in all the divided areas of the distance measurement area (step S450). If NO is determined, it is determined whether the sensor sensitivity is set to high sensitivity or low sensitivity (step S452). If it is determined that the sensitivity has been set low, the photographic lens is set to a fixed focus 6 m (step S454).
On the other hand, if it is determined in step S452 that the sensor sensitivity has been set to high sensitivity, the process proceeds to the flowchart of FIG. 88, and it is determined whether the film sensitivity is less than ISO400 or more than ISO400 (step S464). If it is determined that it is less than ISO 400, the photographing lens is set to a fixed focal point 3 m (step S466). On the other hand, if it is determined that the ISO lens is 400 or higher, the photographing lens is set to a fixed focus 6m (step S468).

上記ステップS450においてYESと判定した場合、CPU60は、次に測距エリアが5エリア設定か3エリア設定かを判定する(ステップS456)。5エリア設定と判定した場合には、それら全ての分割エリアにおいて測距不能と判定された原因が信号量不足(被写体が暗いこと)であったか否かを判定する(ステップS458)。YESと判定した場合には、撮影レンズを無限遠位置に設定する(ステップS460)。一方、NOと判定した場合には、上記図88のフローチャートの処理に移行し、フイルム感度に応じた固定焦点に撮影レンズを設定する(詳細は省略)。   If it is determined as YES in step S450, the CPU 60 next determines whether the ranging area is set to 5 areas or 3 areas (step S456). If it is determined that the five areas are set, it is determined whether or not the cause of determining that ranging is impossible in all the divided areas is insufficient signal amount (the subject is dark) (step S458). If YES is determined, the photographing lens is set at an infinite position (step S460). On the other hand, if NO is determined, the process proceeds to the flowchart of FIG. 88, and the photographing lens is set at a fixed focus corresponding to the film sensitivity (details are omitted).

上記ステップS456において3エリア設定と判定した場合も5エリア設定の場合と同様にそれら全ての分割エリアにおいて測距不能と判定された原因が信号量不足であったか否かを判定する(ステップS462)。YESと判定した場合には、撮影レンズを無限遠位置に設定する(ステップS460)。一方、NOと判定した場合には、上記図88のフローチャートの処理に移行し、フイルム感度に応じた固定焦点に撮影レンズを設定する(詳細は省略)。   When it is determined in step S456 that 3 areas are set, it is determined whether or not the cause of determining that ranging is impossible in all the divided areas is insufficient signal amount in the same manner as in the case of 5 areas (step S462). If YES is determined, the photographing lens is set at an infinite position (step S460). On the other hand, if NO is determined, the process proceeds to the flowchart of FIG. 88, and the photographing lens is set at a fixed focus corresponding to the film sensitivity (details are omitted).

{エリア選択処理(図7ステップS28)の詳細}
次に、図7のステップS28におけるエリア選択処理について説明する。エリア選択処理は、測距エリアの各分割エリアごとに算出された被写体距離のうち、どの分割エリアの被写体距離を撮影レンズのピント合わせに採用するかを選択する処理である。原則的には、測距不能と判定された分割エリア以外の分割エリアで算出された被写体距離のうち最も近いものが採用される。尚、各分割エリアにおける被写体距離は、図7のステップS22における補間値演算処理により求められた真の最高相関のシフト量xに基づいて、図7のステップS26における距離算出処理により求められる。
{Details of Area Selection Processing (Step S28 in FIG. 7)}
Next, the area selection process in step S28 of FIG. 7 will be described. The area selection process is a process for selecting which of the subject distances of the subject distances calculated for each of the divided areas of the ranging area is to be used for focusing the photographing lens. In principle, the closest subject distance calculated in the divided areas other than the divided areas determined to be unable to be measured is employed. The subject distance in each divided area is obtained by the distance calculation process in step S26 of FIG. 7 based on the true maximum correlation shift amount x obtained by the interpolation value calculation process in step S22 of FIG.

一方、例外として、他の分割エリアと比較して左エリア又は右エリアのいずれか一方の被写体距離だけが極めて近距離となった場合には、その被写体距離は採用せず、他の分割エリアの被写体距離のうち最も近いものを採用する。   On the other hand, as an exception, when only the subject distance of either the left area or the right area is very close compared to other divided areas, that subject distance is not adopted and other divided areas are not used. Use the closest subject distance.

具体的に説明すると、被写体距離を超至近距離、近距離、中距離以遠の3区分に分割する基準値1、2を予め設定しておく。尚、基準値1は例えば50cm (近距離警告が発生する距離)、基準値2は例えば4mに設定される。今、測距エリアが5エリア設定となっている場合において、中央エリア、左中エリア、左エリア、右中エリア、右エリアのそれぞれにおいて被写体距離が算出されたとする。そして、左エリア又は右エリアのいずれか一方のみの被写体距離が基準値1より近い超至近距離となり、それ以外の分割エリア(左エリアと右エリアのうち被写体距離が超至近距離でない方の分割エリアも含む)の被写体距離が基準値2よりも遠い中距離以遠となったとする。この場合、超至近距離となった左エリア又は右エリアの被写体距離を採用せず、それ以外の分割エリアの被写体距離のうち最も近いものを採用する。もし、超至近距離となった左エリア又は右エリア以外の分割エリアにおいて1つでも超至近距離、又は、近距離となった被写体距離がある場合には、原則通り、全ての分割エリアの被写体距離のうち最も近い被写体距離を採用する。   More specifically, reference values 1 and 2 are set in advance for dividing the subject distance into three sections of the very close distance, the short distance, and the medium distance and beyond. The reference value 1 is set to, for example, 50 cm (distance at which a short distance warning occurs), and the reference value 2 is set to, for example, 4 m. Assume that the subject distance is calculated in each of the center area, the middle left area, the left area, the middle right area, and the right area when the distance measurement area is set to five areas. Then, the subject distance of only one of the left area and the right area is an extremely close distance that is closer than the reference value 1, and other divided areas (the divided areas of the left area and the right area that are not subject to an extremely close distance) Is included) and the subject distance is longer than the reference distance 2 and beyond the intermediate distance. In this case, the subject distance of the left area or the right area that is the very close distance is not adopted, and the nearest subject distance of the other divided areas is adopted. If at least one of the divided areas other than the left area or the right area, which is extremely close, has a subject distance that is very close or close, as a rule, subject distances of all the divided areas The closest subject distance is adopted.

具体例を挙げると、各分割エリアごとの被写体距離が、図89(A)に示すように左エリアの被写体距離のみが基準値1より近い超至近距離となり、それ以外の分割エリアでは基準値2よりも遠い中距離以遠になったとする。この場合、左エリア以外の分割エリアで得られた被写体距離のうち最も近い中央エリアの被写体距離を採用する。   As a specific example, the subject distance for each divided area is an extremely close distance in which only the subject distance in the left area is closer than the reference value 1 as shown in FIG. 89A, and in the other divided areas, the reference value 2 Suppose the distance is longer than the middle distance. In this case, the subject distance of the nearest central area among the subject distances obtained in the divided areas other than the left area is adopted.

一方、図89(B)に示すように左エリアの被写体距離が基準値1より近い超至近距離となり、中央エリアの被写体距離が基準値1より遠く、基準値2より近い近距離となり、それ以外の分割エリアの被写体距離が基準値2よりも遠い中距離以遠になったとする。この場合には、原則通り、最も近距離にある左エリアの被写体距離を採用する
図89(C)に示すように左エリアの被写体距離が基準値1よりも遠く、基準値2より近い近距離となり、それ以外の分割エリアの被写体距離が基準値2よりも遠い中距離以遠になったとする。この場合にも原則通り、最も近距離にある左エリアの被写体距離を採用する。
On the other hand, as shown in FIG. 89 (B), the subject distance in the left area is an extremely close distance nearer than the reference value 1, the subject distance in the central area is farther than the reference value 1 and closer than the reference value 2, and otherwise. It is assumed that the subject distance in the divided area is longer than the middle distance, which is farther than the reference value 2. In this case, as a general rule, the subject distance in the left area that is the closest is adopted. As shown in FIG. 89C, the subject distance in the left area is farther than the reference value 1 and closer to the reference value 2. Suppose that the subject distance in the other divided areas is longer than the middle distance that is longer than the reference value 2. In this case as well, as a general rule, the subject distance of the left area that is the closest is adopted.

右エリアに関しても全く同様であり、図89(D)に示すように右エリアの被写体距離のみが基準値1より近い超至近距離となり、それ以外の分割エリアでは基準値2よりも遠い中距離以遠になったとする。この場合、右エリア以外の分割エリアで得られた被写体距離のうち最も近い左エリアの被写体距離を採用する。   The same applies to the right area. As shown in FIG. 89D, only the subject distance in the right area is an extremely close distance that is closer than the reference value 1, and in the other divided areas, the intermediate distance is longer than the reference value 2. Suppose that In this case, the subject distance in the nearest left area among the subject distances obtained in the divided areas other than the right area is adopted.

一方、図89(E)に示すように右エリアの被写体距離が基準値1より近い超至近距離となり、左エリアの被写体距離が基準値1より遠く、基準値2より近い近距離となり、それ以外の分割エリアの被写体距離が基準値2よりも遠い中距離以遠になったとする。この場合には、原則通り、全ての分割エリアの被写体距離のうち最も近距離にある右エリアの被写体距離を採用する。   On the other hand, as shown in FIG. 89 (E), the subject distance in the right area is a very close distance nearer than the reference value 1, the subject distance in the left area is farther than the reference value 1 and closer than the reference value 2, and otherwise. It is assumed that the subject distance in the divided area is longer than the middle distance, which is farther than the reference value 2. In this case, as a general rule, the subject distance of the right area that is the closest among the subject distances of all the divided areas is adopted.

また、図89(F)に示すように右エリアの被写体距離が基準値1よりも遠く、基準値2より近い近距離となり、それ以外の分割エリアの被写体距離が基準値2よりも遠い中距離以遠になったとする。この場合にも原則通り、全ての分割エリアの被写体距離のうち最も近距離にある右エリアの被写体距離を採用する。   Also, as shown in FIG. 89 (F), the subject distance in the right area is longer than the reference value 1 and close to the reference value 2, and the subject distance in other divided areas is longer than the reference value 2. Suppose it is farther away. Also in this case, as a general rule, the subject distance of the right area that is the closest among the subject distances of all the divided areas is adopted.

以上の例外的処理は、測距エリアが3エリア設定の場合にも同様に適用できる。即ち、3エリア設定の場合に測距エリアを構成する中央エリア、右中エリア、左中エリアのうち両端の右中エリア又は左中エリアのいずれか一方のみで被写体距離が超至近距離となり、それ以外の分割エリアで被写体距離が中距離以遠になった場合には、超至近距離以外の被写体距離のうち最も近い被写体距離を採用するようにしてもよい。   The above exceptional processing can be similarly applied to the case where the distance measurement area is set to three areas. That is, in the case of three areas, the subject distance is very close to one of the right middle area and left middle area at both ends of the center area, right middle area, and left middle area constituting the ranging area. When the subject distance is more than the middle distance in the other divided areas, the closest subject distance among the subject distances other than the very close distance may be adopted.

以上、上記実施の形態は、AFセンサ74よりセンサデータを出力し、CPU60によりAFデータに変換し、相関値演算処理を実施する形態であったが、これに限らず、AFセンサ74において、センサデータをAFデータに変換した後、AFデータを出力し、CPU60にて相関値演算処理を実施する形態、及び、AFセンサ74において、センサデータをAFデータに変換し、相関値演算処理を実施した後,CPU60へ距離信号を出力する形態であってもよい。   In the above embodiment, the sensor data is output from the AF sensor 74, converted into AF data by the CPU 60, and the correlation value calculation process is performed. However, the present invention is not limited to this. After converting the data into AF data, the AF data is output, and the correlation value calculation process is performed by the CPU 60. In the AF sensor 74, the sensor data is converted into AF data, and the correlation value calculation process is performed. Thereafter, a form in which a distance signal is output to the CPU 60 may be employed.

また、上記実施の形態は、外光パッシブ方式の測距装置を例としたものであるが、本発明は、TTLのパッシブ位相差方式等にも適用できる。   The above embodiment is an example of an external light passive type distance measuring device, but the present invention can also be applied to a TTL passive phase difference method and the like.

更に、上記実施の形態におけるカメラの測距装置は、カメラに限らず他の用途に使用される測距装置にも適用できる。   Furthermore, the camera distance measuring device in the above embodiment can be applied not only to the camera but also to a distance measuring device used for other purposes.

図1は、本発明が適用されたカメラの正面斜視図である。FIG. 1 is a front perspective view of a camera to which the present invention is applied. 図2は、本発明が適用されたカメラの背面斜視図である。FIG. 2 is a rear perspective view of a camera to which the present invention is applied. 図3は、本発明が適用されたカメラの制御部を示したブロック図である。FIG. 3 is a block diagram showing a control unit of a camera to which the present invention is applied. 図4は、パッシブ方式によるAFセンサの構成を示した図である。FIG. 4 is a diagram showing a configuration of a passive AF sensor. 図5、AFセンサから被写体までの距離が近い場合のセンサ像(AFデータ)を例示した図である。FIG. 5 is a diagram illustrating a sensor image (AF data) when the distance from the AF sensor to the subject is short. 図6は、AFセンサから被写体までの距離が遠い場合のセンサ像(AFデータ)を例示した図である。FIG. 6 is a diagram illustrating a sensor image (AF data) when the distance from the AF sensor to the subject is long. 図7は、CPUにおけるAF測距の処理手順の概要を示すフローチャートである。FIG. 7 is a flowchart showing an outline of the AF ranging process procedure in the CPU. 図8は、Rセンサ及びLセンサのセンサ領域における分割エリアを示した図である。FIG. 8 is a diagram showing divided areas in the sensor area of the R sensor and the L sensor. 図9は、測距エリア設定処理の手順を示したフローチャートである。FIG. 9 is a flowchart showing the procedure of the distance measurement area setting process. 図10は、3エリア設定と5エリア設定の測距エリアを示した図である。FIG. 10 is a diagram showing a distance measurement area of 3 area setting and 5 area setting. 図11は、測距エリアを分けて個別に積分処理を行う場合の効果の説明に使用した説明図である。FIG. 11 is an explanatory diagram used to explain the effect when the integration process is performed separately for each distance measurement area. 図12は、相関値演算の説明に使用した説明図である。FIG. 12 is an explanatory diagram used for explaining the correlation value calculation. 図13は、AFデータ取得処理において設定されるピーク選択領域の態様を示した図である。FIG. 13 is a diagram showing a mode of the peak selection region set in the AF data acquisition process. 図14は、AFデータ取得処理の手順を示したフローチャートである。FIG. 14 is a flowchart showing the procedure of AF data acquisition processing. 図15は、3分割ゲイン高積分の処理手順を示したフローチャートである。FIG. 15 is a flowchart showing a processing procedure of three-division gain high integration. 図16は、CPUとAFセンサとの間の信号ラインを示した図である。FIG. 16 is a diagram illustrating signal lines between the CPU and the AF sensor. 図17は、CPUとAFセンサとの信号送受信に関する動作タイミングを示した動作タイミングチャートである。FIG. 17 is an operation timing chart showing operation timings related to signal transmission / reception between the CPU and the AF sensor. 図18は、ピーク選択領域設定データの説明に使用した説明図である。FIG. 18 is an explanatory diagram used for explaining the peak selection region setting data. 図19は、ピーク選択領域設定データの説明に使用した説明図である。FIG. 19 is an explanatory diagram used for explaining the peak selection region setting data. 図20は、ピーク選択領域数データの説明に使用した説明図である。FIG. 20 is an explanatory diagram used for explaining the peak selection area number data. 図21は、ピーク選択領域設定データの生成手順の説明に使用した説明図である。FIG. 21 is an explanatory diagram used for explaining the procedure for generating the peak selection region setting data. 図22は、ピーク選択領域設定データの生成手順の説明に使用した説明図である。FIG. 22 is an explanatory diagram used for explaining the procedure for generating the peak selection region setting data. 図23は、ピーク選択領域設定データの生成手順の説明に使用した説明図である。FIG. 23 is an explanatory diagram used for explaining the procedure for generating the peak selection region setting data. 図24は、ピーク選択領域設定データ及びピーク選択領域数データを示した説明図である。FIG. 24 is an explanatory diagram showing peak selection region setting data and peak selection region number data. 図25は、/AFEND信号が正常に出力されない場合の出力形態を示した図である。FIG. 25 is a diagram showing an output form when the / AFEND signal is not normally output. 図26は、被写体が明るい場合と暗い場合における/AFEND信号とMDATA信号の状態を例示した図である。FIG. 26 is a diagram illustrating the state of the / AFEND signal and the MDATA signal when the subject is bright and dark. 図27は、AFデータの読出し処理の説明に使用した説明図である。FIG. 27 is an explanatory diagram used for explaining the AF data reading process. 図28は、2画素差分データについて従来方式と新方式との説明に使用した説明図である。FIG. 28 is an explanatory diagram used for explaining the conventional method and the new method for the two-pixel difference data. 図29は、従来方式と新方式とで得た2画素差分データ(AFデータ)を例示した図である。FIG. 29 is a diagram illustrating two-pixel difference data (AF data) obtained by the conventional method and the new method. 図30は、相関値演算の実行時(実行中)においてAFデータを生成する場合における相関値演算の処理手順を示したフローチャートである。FIG. 30 is a flowchart showing a correlation value calculation processing procedure when AF data is generated when the correlation value calculation is executed (during execution). 図31は、相関値演算の実行前において予めAFデータを生成してRAMに格納しておいた場合における相関値演算の処理手順を示したフローチャートである。FIG. 31 is a flowchart showing a correlation value calculation processing procedure when AF data is generated and stored in the RAM in advance before the correlation value calculation is executed. 図32は、相関値演算の実行時(実行中)においてAFデータを生成する場合のデータの流れを示した図である。FIG. 32 is a diagram illustrating a data flow when AF data is generated during execution (during execution) of the correlation value calculation. 図33は、相関値演算の実行前において予めAFデータを生成してRAMに格納しておく場合のデータの流れを示した図である。FIG. 33 is a diagram showing a data flow when AF data is generated in advance and stored in the RAM before execution of the correlation value calculation. 図34は、従来方式におけるセンサデータの読出し処理を示したフローチャートである。FIG. 34 is a flowchart showing sensor data reading processing in the conventional method. 図35は、従来方式におけるセンサデータの読出し時のAFCLK信号及びAFDATAP信号を示したタイミングチャートである。FIG. 35 is a timing chart showing the AFCLK signal and the AFDATAP signal when reading sensor data in the conventional method. 図36は、新方式(本発明)におけるセンサデータの読出し処理を示したフローチャートである。FIG. 36 is a flowchart showing sensor data reading processing in the new method (the present invention). 図37は、新方式(本発明)におけるセンサデータの読出し時のAFCLK信号及びAFDATAP信号を示したタイミングチャートである。FIG. 37 is a timing chart showing the AFCLK signal and the AFDATAP signal at the time of reading sensor data in the new method (the present invention). 図38は、新方式(本発明)と従来方式との測距時間を比較して示した図である。FIG. 38 shows a comparison of distance measurement times between the new method (the present invention) and the conventional method. 図39は、極小値判断処理の説明に使用した説明図である。FIG. 39 is an explanatory diagram used for explaining the local minimum value determination process. 図40は、極小値判断処理の説明に使用した説明図である。FIG. 40 is an explanatory diagram used for explaining the local minimum value determination process. 図41は、i3つおき演算におけるRウインドウ94B及びLウインドウ96B内の採用セルのセル位置iを示した図である。FIG. 41 is a diagram showing cell positions i of adopted cells in the R window 94B and the L window 96B in every third i calculation. 図42は、通常演算により算出された相関値分布の例を示した図である。FIG. 42 is a diagram illustrating an example of the correlation value distribution calculated by the normal calculation. 図43は、i3つおき演算により算出された相関値分布の例を示した図である。FIG. 43 is a diagram showing an example of a correlation value distribution calculated by every third i operation. 図44は、i3つおき演算における再演算範囲を示した図である。FIG. 44 is a diagram showing a recalculation range in every third i3 calculation. 図45は、i3つおき演算により検出された暫定最小極小値が近距離警告範囲内であった場合の相関値分布の例を示した図である。FIG. 45 is a diagram showing an example of the correlation value distribution when the provisional minimum value detected by the calculation of every third i is within the short distance warning range. 図46は、通常演算により複数の極小値が検出される場合の相関値分布の例を示した図である。FIG. 46 is a diagram illustrating an example of a correlation value distribution when a plurality of minimum values are detected by normal calculation. 図47は、図46と同じAFデータに基づいてi3つおき演算を行った場合に得られる相関値分布を示した図である。FIG. 47 is a diagram showing a correlation value distribution obtained when every third i-th calculation is performed based on the same AF data as FIG. 図48は、図47の相関値分布に対して再演算を行った結果を示した図である。FIG. 48 is a diagram showing a result of recalculation on the correlation value distribution of FIG. 図49は、不足分再演算処理の処理手順を示したフローチャートである。FIG. 49 is a flowchart showing the processing procedure of the shortage recalculation processing. 図50(A)、(B)は、2画素差分演算により得たRセンサとLセンサのAFデータのうち、シフト量n=0におけるi3つおき演算で使用するAFデータを例示した図である。FIGS. 50A and 50B are diagrams exemplifying AF data used for every third i-th calculation when the shift amount is n = 0, among the AF data of the R sensor and the L sensor obtained by the two-pixel difference calculation. . 図51は、図50(A)、(B)のAFデータの例でi3つおき演算を行って相関値f(n)を算出した結果を示した図である。FIG. 51 is a diagram showing the result of calculating the correlation value f (n) by performing every i3 calculation in the AF data examples of FIGS. 50 (A) and 50 (B). 図52は、図50(A)、(B)のAFデータの例で通常演算を行って相関値f(n)を算出した結果を示した図である。FIG. 52 is a diagram showing a result of calculating a correlation value f (n) by performing normal calculation on the AF data examples of FIGS. 50 (A) and 50 (B). 図53は、図50のようなセンサデータの態様が実測で得られた場合にi3つおき演算で求めた相関値f(n)を示した図である。FIG. 53 is a diagram showing correlation values f (n) obtained by calculation every third i3 when the sensor data mode as shown in FIG. 50 is obtained by actual measurement. 図54は、n3つおき演算における採用シフト量nの例を示した説明図である。FIG. 54 is an explanatory diagram showing an example of the employed shift amount n in every third n3 calculation. 図55は、n3つおき演算における採用シフト量nのとり方に関する説明に使用した説明図である。FIG. 55 is an explanatory diagram used for explaining how to adopt the employed shift amount n in every third n3 calculation. 図56は、n3つおき演算における採用シフト量nのとり方に関する説明に使用した説明図である。FIG. 56 is an explanatory diagram used for explaining how to adopt the adopted shift amount n in every third calculation. 図57は、n3つおき演算における採用シフト量nのとり方に関する説明に使用した説明図である。FIG. 57 is an explanatory diagram used for explaining how to adopt the employed shift amount n in every third n3 calculation. 図58は、図56に示したn3つおき演算における再演算範囲の例を示した図である。FIG. 58 is a diagram showing an example of a recalculation range in every third n3 computation shown in FIG. 図59は、コントラスト検出処理1とコントラスト検出処理2による一連のコントラスト検出処理の全体手順を示したフローチャートである。FIG. 59 is a flowchart showing an overall procedure of a series of contrast detection processing by contrast detection processing 1 and contrast detection processing 2. 図60は、コントラスト検出処理により測距不能と判定される場合のAFデータ及び相関値分布の例を示した図である。FIG. 60 is a diagram showing an example of AF data and correlation value distribution when it is determined that distance measurement is impossible by contrast detection processing. 図61は、コントラスト検出処理により測距不能と判定される場合のAFデータ及び相関値分布の例を示した図である。FIG. 61 is a diagram showing an example of AF data and correlation value distribution when it is determined that distance measurement is impossible by contrast detection processing. 図62は、CPUにおけるL、Rチャンネル差補正処理の手順を示したフローチャートである。FIG. 62 is a flowchart showing a procedure of L and R channel difference correction processing in the CPU. 図63は、AFデータの補正をRセンサのAFデータとLセンサのAFデータの信号量差を補正して行う場合の処理手順を示したフローチャートである。FIG. 63 is a flowchart showing a processing procedure when AF data is corrected by correcting a signal amount difference between AF data of the R sensor and AF data of the L sensor. 図64は、L、Rチャンネル差補正処理による効果の説明に使用した説明図である。FIG. 64 is an explanatory diagram used for explaining the effect of the L and R channel difference correction processing. 図65は、L、Rチャンネル差補正処理におけるAFデータの補正を信号量差及びコントラスト比を補正して行うAFデータ補正処理の処理手順を示したフローチャートである。FIG. 65 is a flowchart showing the AF data correction processing procedure in which AF data correction in the L and R channel difference correction processing is performed by correcting the signal amount difference and the contrast ratio. 図66は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 66 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図67は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 67 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図68は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 68 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図69は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 69 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図70は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 70 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図71は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 71 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図72は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 72 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図73は、図65におけるAFデータ補正処理の効果の説明に使用した説明図である。FIG. 73 is an explanatory diagram used for explaining the effect of the AF data correction processing in FIG. 図74は、極小値判定の処理の説明に使用した説明図である。FIG. 74 is an explanatory diagram used for explaining the process of determining a minimum value. 図75は、極小値判定の処理の説明に使用した説明図である。FIG. 75 is an explanatory diagram used for explaining the process of determining a minimum value. 図76は、極小値判定の処理の説明に使用した説明図である。FIG. 76 is an explanatory diagram used for explaining the process of determining a minimum value. 図77は、補間値演算処理の説明に使用した説明図である。FIG. 77 is an explanatory diagram used for explaining the interpolation value calculation processing. 図78は、補間値演算処理の説明に使用した説明図である。FIG. 78 is an explanatory diagram used for explaining the interpolation value calculation processing. 図79は、補間値演算処理の説明に使用した説明図である。FIG. 79 is an explanatory diagram used for explaining the interpolation value calculation processing. 図80は、補間値演算処理の説明に使用した説明図である。FIG. 80 is an explanatory diagram used for explaining the interpolation value calculation processing. 図81は、補間値演算処理の説明に使用した説明図である。FIG. 81 is an explanatory diagram used for explaining the interpolation value calculation processing. 図82は、補間値演算処理の説明に使用した説明図である。FIG. 82 is an explanatory diagram used for explaining the interpolation value calculation processing. 図83は、補間値別演算処理の説明に使用した説明図である。FIG. 83 is an explanatory diagram used for explaining the calculation processing for each interpolation value. 図84は、補間値別演算処理の説明に使用した説明図である。FIG. 84 is an explanatory diagram used for explaining the calculation processing for each interpolation value. 図85は、補間値別演算処理の説明に使用した説明図である。FIG. 85 is an explanatory diagram used for explaining the calculation processing for each interpolation value. 図86は、補間値演算処理において補間値通常演算及び補間値別演算の処理タイプ1〜3を判別する手順を示したフローチャートである。FIG. 86 is a flowchart showing a procedure for discriminating between processing types 1 to 3 of the interpolation value normal calculation and the interpolation value-specific calculation in the interpolation value calculation process. 図87は、固定焦点処理の手順を示したフローチャートである。FIG. 87 is a flowchart showing the procedure of fixed focus processing. 図88は、固定焦点処理の手順を示したフローチャートである。FIG. 88 is a flowchart showing the procedure of fixed focus processing. 図89は、エリア選択処理の説明に使用した説明図である。FIG. 89 is an explanatory diagram used for explaining the area selection processing.

符号の説明Explanation of symbols

10…カメラ、34…シャッタボタン、60…CPU、72…ストロボ装置、74…AFセンサ、94…Rセンサ、96…Lセンサ、99…処理回路 DESCRIPTION OF SYMBOLS 10 ... Camera, 34 ... Shutter button, 60 ... CPU, 72 ... Strobe device, 74 ... AF sensor, 94 ... R sensor, 96 ... L sensor, 99 ... Processing circuit

Claims (8)

複数の受光素子からなる一対のラインセンサに測距対象物からの光を結像させ、各受光素子から得られた信号に基づいて相関値演算用の一対のAFデータを生成するAFデータ生成手段と、
前記一対のラインセンサのうちの測距に使用する一対の採用センサ範囲から一対のAFデータを取得するAFデータ取得手段と、
前記一対の採用センサ範囲内において、相関値演算に使用する一対のAFデータを取得するための一対のウインドウ範囲を決定し、該一対のウインドウ範囲を前記一対の採用センサ範囲内の最高相関を得るためにシフトさせながら順次相関値演算する第1の相関値演算手段であって、前記一対のウインドウ範囲内のAFデータのうちの所定間隔置きのAFデータを用いて相関値演算する第1の相関値演算手段と、
前記第1の相関値演算手段により得られた相関値のうちの最高相関値が得られたときの前記ウインドウ範囲のシフト量を基準とする前後の所定の範囲内で、前記一対のウインドウ範囲をシフトさせながら順次相関値演算する第2の相関値演算手段であって、前記一対のウインドウ範囲内の全てのAFデータを用いて相関値演算する第2の相関値演算手段と、
前記第2の相関値演算手段により得られた相関値のうちの最高相関値が得られたときの前記ウインドウ範囲のシフト量に基づいて測距対象物の距離を算出する測距対象物距離算出手段と、
を備えたことを特徴とする測距装置。
AF data generating means for forming a pair of AF data for calculating a correlation value based on a signal obtained from each light receiving element by forming an image of light from a distance measuring object on a pair of line sensors including a plurality of light receiving elements When,
AF data acquisition means for acquiring a pair of AF data from a pair of adopted sensor ranges used for ranging among the pair of line sensors;
Within the pair of adopted sensor ranges, a pair of window ranges for acquiring a pair of AF data used for correlation value calculation is determined, and the highest correlation within the pair of adopted sensor ranges is obtained for the pair of window ranges. First correlation value calculation means for sequentially calculating a correlation value while shifting for the first correlation to calculate a correlation value using AF data at predetermined intervals among the AF data in the pair of window ranges. Value calculation means;
The pair of window ranges are within a predetermined range before and after the shift amount of the window range when the highest correlation value among the correlation values obtained by the first correlation value calculating means is obtained. Second correlation value calculation means for sequentially calculating correlation values while shifting, second correlation value calculation means for calculating correlation values using all AF data within the pair of window ranges;
Distance measurement object distance calculation for calculating the distance of the distance measurement object based on the shift amount of the window range when the highest correlation value among the correlation values obtained by the second correlation value calculation means is obtained. Means,
A distance measuring device comprising:
前記第1の相関値演算手段は、前記採用センサ内の相関値演算により高い相関を示す極値が複数ある場合には、最も相関の高い極値を暫定第1極値とし、次に相関の高い極値を暫定第2極値として求め、
前記第2の相関値演算手段は、前記暫定第1極値と暫定第2極値との差が所定の基準値内の場合には、前記暫定第1極値が得られたときの前記ウインドウ範囲のシフト量を基準とする前後の所定の範囲内と、前記暫定第2極値が得られたときの前記ウインドウ範囲のシフト量を基準とする前後の所定の範囲内とでそれぞれ相関値演算を行うことを特徴とする請求項1の測距装置。
When there are a plurality of extreme values showing a high correlation by the correlation value calculation in the adopted sensor, the first correlation value calculating means sets the extreme value having the highest correlation as the temporary first extreme value, and then The high extreme value is obtained as the provisional second extreme value,
When the difference between the provisional first extreme value and the provisional second extreme value is within a predetermined reference value, the second correlation value calculation means is configured to display the window when the provisional first extreme value is obtained. Correlation value calculation within a predetermined range before and after the shift amount of the range as a reference and within a predetermined range before and after the shift amount of the window range when the provisional second extreme value is obtained The distance measuring apparatus according to claim 1, wherein:
前記第1の相関値演算手段により最高相関値が得られたときの前記ウインドウ範囲のシフト量と、前記第2の相関値演算手段により最高相関値が得られるときの前記ウインドウ範囲のシフト量との差を求める手段と、前記求めた差が所定のシフト量以上の場合には測距不能とする判定手段と、を有することを特徴とする請求項1の測距装置。   The shift amount of the window range when the highest correlation value is obtained by the first correlation value calculation means, and the shift amount of the window range when the highest correlation value is obtained by the second correlation value calculation means 2. The distance measuring apparatus according to claim 1, further comprising: a means for obtaining a difference between the two and a determining means for disabling distance measurement when the obtained difference is equal to or greater than a predetermined shift amount. 前記第1の相関値演算手段により暫定第1極値が得られたときの前記ウインドウ範囲の第1のシフト量及び暫定第2極値が得られたときの前記ウインドウ範囲の第2のシフト量と、前記第2の相関値演算手段により最高相関値が得られるときの前記ウインドウ範囲の第3のシフト量との差をそれぞれ求める手段と、前記求めた差のうちの小さい方の差が所定のシフト量以上の場合には測距不能とする判定手段と、を有することを特徴とする請求項2の測距装置。   The first shift amount of the window range when the temporary first extreme value is obtained by the first correlation value calculating means and the second shift amount of the window range when the temporary second extreme value is obtained. And a means for obtaining a difference between the window range and the third shift amount when the highest correlation value is obtained by the second correlation value calculating means, and a smaller difference among the obtained differences is predetermined. 3. A distance measuring apparatus according to claim 2, further comprising: a determination unit that disables distance measurement when the shift amount is greater than or equal to. 前記第1の相関値演算手段により最高相関値が得られたときの前記ウインドウ範囲のシフト量と、前記第2の相関値演算手段により最高相関値が得られるときの前記ウインドウ範囲のシフト量との差を求める手段を有し、
前記第2の相関値演算手段は、前記求めた差のシフト量の分だけ前記所定の範囲を越えて追加の相関値演算を行うことを特徴とする請求項1の測距装置。
The shift amount of the window range when the highest correlation value is obtained by the first correlation value calculation means, and the shift amount of the window range when the highest correlation value is obtained by the second correlation value calculation means Has a means to determine the difference between
2. The distance measuring apparatus according to claim 1, wherein the second correlation value calculation means performs an additional correlation value calculation beyond the predetermined range by an amount of the obtained difference shift amount.
前記測距対象物距離算出手段は、前記第2の相関値演算手段により得られた相関値のうちの最高相関値と、その前後の前記所定の範囲の相関値とに基づいて補間値演算によって真の最高相関値が得られるシフト量を求め、該シフト量に基づいて測距対象物の距離を算出することを特徴とする請求項1乃至5のいずれかに記載の測距装置。   The distance measuring object distance calculating means performs interpolation value calculation based on the highest correlation value among the correlation values obtained by the second correlation value calculating means and the correlation values in the predetermined range before and after the correlation value. 6. The distance measuring device according to claim 1, wherein a shift amount for obtaining a true maximum correlation value is obtained, and a distance of the distance measuring object is calculated based on the shift amount. 前記第1の相関値演算手段により最高相関値が得られたときの前記ウインドウ範囲のシフト量が、近距離側測距不要範囲内か否かを判断する判断手段と、前記判断手段によって近距離側測距不要範囲内と判断されると、前記第2の相関値演算手段による相関値演算を中止させる手段と、を有し、第1の相関値演算手段により得られた最高相関値をもとに測距対象物の距離を算出することを特徴とする請求項1乃至6のいずれかに記載の測距装置。   Determining means for determining whether or not the shift amount of the window range when the highest correlation value is obtained by the first correlation value calculating means is within the short distance side distance measurement unnecessary range; And a means for stopping the correlation value calculation by the second correlation value calculation means when it is determined that it is within the range not requiring distance measurement, the highest correlation value obtained by the first correlation value calculation means is also obtained. The distance measuring apparatus according to claim 1, wherein the distance of the object to be measured is calculated. 前記一対の採用センサは、前記一対のラインセンサの全測距エリアのセンサ、又は前記一対のラインセンサの全測距エリアを複数の分割エリアに分割した各分割エリアのセンサである請求項1乃至7のいずれかに記載の測距装置。   The pair of adopted sensors are sensors for all distance measuring areas of the pair of line sensors, or sensors for each divided area obtained by dividing the whole distance measuring area of the pair of line sensors into a plurality of divided areas. 8. The distance measuring device according to any one of 7 above.
JP2008192675A 2008-07-25 2008-07-25 Ranging device Expired - Fee Related JP4802223B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008192675A JP4802223B2 (en) 2008-07-25 2008-07-25 Ranging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008192675A JP4802223B2 (en) 2008-07-25 2008-07-25 Ranging device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2001373989A Division JP4200350B2 (en) 2001-12-07 2001-12-07 Ranging device

Publications (2)

Publication Number Publication Date
JP2009008686A true JP2009008686A (en) 2009-01-15
JP4802223B2 JP4802223B2 (en) 2011-10-26

Family

ID=40323874

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008192675A Expired - Fee Related JP4802223B2 (en) 2008-07-25 2008-07-25 Ranging device

Country Status (1)

Country Link
JP (1) JP4802223B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011136031A1 (en) * 2010-04-28 2011-11-03 富士フイルム株式会社 Imaging device
WO2012073728A1 (en) * 2010-11-30 2012-06-07 富士フイルム株式会社 Imaging device and focal position detection method
WO2012073729A1 (en) * 2010-11-30 2012-06-07 富士フイルム株式会社 Imaging device and focal position detection method
WO2019172102A1 (en) * 2018-03-08 2019-09-12 日立オートモティブシステムズ株式会社 Stereo camera device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62103615A (en) * 1985-10-30 1987-05-14 Minolta Camera Co Ltd Focus detector
JPH04200350A (en) * 1990-11-29 1992-07-21 Sadao Nakayama Production of cake and food subjected to surface treatment
JPH10160410A (en) * 1996-11-27 1998-06-19 Minolta Co Ltd Range finder
JPH1123957A (en) * 1997-07-03 1999-01-29 Olympus Optical Co Ltd Focus detector
JPH1123261A (en) * 1997-07-03 1999-01-29 Minolta Co Ltd Distance-measuring device
JPH11142723A (en) * 1997-11-05 1999-05-28 Canon Inc Image pickup device
JPH11258491A (en) * 1998-03-10 1999-09-24 Canon Inc Focus detecting device and its method and storage medium readable through computer
JPH11258492A (en) * 1998-03-10 1999-09-24 Canon Inc Focus detecting device and its method and storage medium readable through computer
JP2000121925A (en) * 1998-10-21 2000-04-28 Fujitsu Ltd Method for deciding parameter for automatic focusing device and storage medium storing its program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62103615A (en) * 1985-10-30 1987-05-14 Minolta Camera Co Ltd Focus detector
JPH04200350A (en) * 1990-11-29 1992-07-21 Sadao Nakayama Production of cake and food subjected to surface treatment
JPH10160410A (en) * 1996-11-27 1998-06-19 Minolta Co Ltd Range finder
JPH1123957A (en) * 1997-07-03 1999-01-29 Olympus Optical Co Ltd Focus detector
JPH1123261A (en) * 1997-07-03 1999-01-29 Minolta Co Ltd Distance-measuring device
JPH11142723A (en) * 1997-11-05 1999-05-28 Canon Inc Image pickup device
JPH11258491A (en) * 1998-03-10 1999-09-24 Canon Inc Focus detecting device and its method and storage medium readable through computer
JPH11258492A (en) * 1998-03-10 1999-09-24 Canon Inc Focus detecting device and its method and storage medium readable through computer
JP2000121925A (en) * 1998-10-21 2000-04-28 Fujitsu Ltd Method for deciding parameter for automatic focusing device and storage medium storing its program

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8976289B2 (en) 2010-04-28 2015-03-10 Fujifilm Corporation Imaging device
CN102870028A (en) * 2010-04-28 2013-01-09 富士胶片株式会社 Imaging device
WO2011136031A1 (en) * 2010-04-28 2011-11-03 富士フイルム株式会社 Imaging device
JP5592944B2 (en) * 2010-04-28 2014-09-17 富士フイルム株式会社 Imaging device
JPWO2011136031A1 (en) * 2010-04-28 2013-07-18 富士フイルム株式会社 Imaging device
WO2012073729A1 (en) * 2010-11-30 2012-06-07 富士フイルム株式会社 Imaging device and focal position detection method
JP5493010B2 (en) * 2010-11-30 2014-05-14 富士フイルム株式会社 Imaging apparatus and focus position detection method thereof
JP5493011B2 (en) * 2010-11-30 2014-05-14 富士フイルム株式会社 Imaging apparatus and focus position detection method thereof
WO2012073728A1 (en) * 2010-11-30 2012-06-07 富士フイルム株式会社 Imaging device and focal position detection method
CN103238098A (en) * 2010-11-30 2013-08-07 富士胶片株式会社 Imaging device and focal position detection method
US8780259B2 (en) 2010-11-30 2014-07-15 Fujifilm Corporation Image capturing apparatus and in-focus position detection method thereof
JPWO2012073728A1 (en) * 2010-11-30 2014-05-19 富士フイルム株式会社 Imaging apparatus and focus position detection method thereof
CN103238098B (en) * 2010-11-30 2015-04-15 富士胶片株式会社 Imaging device and focal position detection method
US9357120B2 (en) 2010-11-30 2016-05-31 Fujifilm Corporation Image capturing apparatus and in-focus position detection method thereof
JPWO2012073729A1 (en) * 2010-11-30 2014-05-19 富士フイルム株式会社 Imaging apparatus and focus position detection method thereof
JP6991307B2 (en) 2018-03-08 2022-01-12 日立Astemo株式会社 Stereo camera device
WO2019172102A1 (en) * 2018-03-08 2019-09-12 日立オートモティブシステムズ株式会社 Stereo camera device
JPWO2019172102A1 (en) * 2018-03-08 2021-01-07 日立オートモティブシステムズ株式会社 Stereo camera device

Also Published As

Publication number Publication date
JP4802223B2 (en) 2011-10-26

Similar Documents

Publication Publication Date Title
JP4802223B2 (en) Ranging device
JP4470065B2 (en) Ranging device
JP4580603B2 (en) Ranging device
JP4023778B2 (en) Ranging device
JP4612256B2 (en) Ranging device
JP4200350B2 (en) Ranging device
JP4231221B2 (en) Ranging device
JP3856295B2 (en) Ranging device
JP4000402B2 (en) Ranging device
JP4196560B2 (en) Ranging device
JP3988159B2 (en) Ranging device
JP3972290B2 (en) Ranging device
JP2003232627A (en) Distance measuring device
JP2007086084A (en) Distance measuring device
JP2006343348A (en) Range finder
US6701074B2 (en) Distance measuring apparatus
JP2003177302A (en) Distance measuring equipment
JP2003232983A (en) Ranging apparatus
JP2003177301A (en) Distance measuring equipment
JP2003232628A (en) Distance measuring device
JP2003232982A (en) Ranging apparatus
US6760547B2 (en) Rangefinder apparatus and camera equipped therewith
JP2003227995A (en) Camera
US6829434B2 (en) Distance measuring apparatus

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20100617

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110808

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

Free format text: PAYMENT UNTIL: 20140812

Year of fee payment: 3

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees