Focus detecting device in camera
BACKGROUND OF THE INVENTION 
     This invention relates to a device for carrying out focus detection by utilizing the fact that the contrast signal of the image of an object reaches a maximum value when the correct focus is obtained. 
     The optical intensity of each spatial frequency of the image of an object, or the power spectrum, reaches a maximum value when the focus is obtained and the degree in variation of the power spectrum is most significant in a high spatial frequency range. A focus detecting device based on this characteristic has been proposed in that art. In this prior art device, the optical intensity signal in the high spatial frequency range of an object image is extracted, so that, when the signal thus extracted is at a maximum, the focus is detected. For instance, an automatic focussing device has been provided, in which an image object is mechanically or electrically scanned by using a photoelectric transducing element to convert the spatial brightness distribution of the object image into a time series signal. Then, the high frequency components of the waveform thereof are extracted by using a differentiation circuit or a high-pass filter. The lens is held in position when the output signal thereof is at its maximum value. 
     Recently, a method of utilizing a self-scanning type photoelectric element has been proposed as such a scanning technique. In this known method, a self-scanning type photoelectric element is disposed in the image forming plane of the lens, so that the spatial brightness distribution of the object image is converted into a discrete time series signal. This signal is converted into an analog signal by using a sample and hold circuit and a smoothing circuit. Then the analog signal is subjected to differentiation or the like to detect the focus. However, this conventional method is disadvantageous in that, because a low-pass filter is included in the smoothing circuit, the necessary high frequency components are eliminated. As a result, it is difficult to reproduce an analog waveform equivalent to the brightness distribution of the object image, and the circuit itself is unduly large. 
     SUMMARY OF THE INVENTION 
     Accordingly, an object of this invention is to provide a focus detecting device in which all of the above-described difficulties accompanying a conventional device have been eliminated. 
     More specifically, an object of the invention is to provide a focus detecting in which instead of converting the output signal of the self-scanning type photoelectric element into an analog waveform, contrast information is extracted with the discrete signal as it is, thereby to automatically carry out the focus detection. 
     These and other objects of this invention are accomplished by means of a focus detecting device in a camera, having a self-scanning type photoelectric device having a number of elements disposed at a position equivalent to the position of the image forming plane of a lens. A drive circuit drives the photoelectric element and a delay circuit delays a discrete output waveform of the photoelectric element the time corresponding to the scanning period for one or two elements. A difference circuit detects an output difference between the delayed waveform and the undelayed waveform. An absolute value circuit detects the absolute value of a difference output from the difference circuit. A peak value holding circuit holds a peak value in an absolute value waveform provided by the absolute value circuit in one scanning period of the photoelectric element, in such a manner that an output difference between elements is detected with a discrete photoelectric transducing output as it is. The maximum peak value output is provided when focus is obtained. 
     This invention will be described with reference to its preferred embodiment shown in the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a graphical representation of the principle of a focus detecting mechanism according to this invention; 
     FIG. 2 is a block diagram of a circuit practicing a focus detecting method according to the invention; 
     FIGS. 3(A)-(D) are graphical representations indicating the variations of a photoelectric output waveform in the circuit shown in FIG. 2; 
     More specifically, FIG. 3(A) shows an original waveform in one scanning period which is outputted by a self-scanning type photoelectric device; 
     FIG. 3(B) shows a waveform which is obtained by delaying the original waveform the time corresponding to two elements; 
     FIG. 3(C) shows the waveform of the difference output between the two waveforms and; 
     FIG. 3(D) shows the waveform of the absolute value of the difference output; and 
     FIG. 4 is a graphical representation indicating the variations of a peak value when the lens is moved back and forth. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 is a graphical representation indicating the relationship between the photoelectric outputs of three given adjacent elements in a self-scanning type photoelectric element and the brightness distribution of the image of an object. In FIG. 1, reference characters P 1 , P 2  and P 3  designates the three elements. When an object image having a bright distribution as indicated by the solid line 1 is applied to the photoelectric element, a pulsive discrete output is obtained. 
     It is assumed that the brightness distribution (solid line 1) of the object image is represented by f(x). When the discrete output is converted into an analog waveform, then a distribution equivalent to the solid line 1 is reproduced. If the analog waveform is subjected to differentiation, then a distribution equivalent to the differential coefficient f&#39; (x) can be obtained. However, a value approximate to the differential coefficient f&#39; (x) can be extracted by numerical differentiation with the dispersed output, infiltered, that is as it is. Stated differently, a function f (x j ) at a point s j  can be expressed with a function at a point x i  other than the point x j  and the differential coefficient by Taylor&#39;s expansion. ##EQU1## 
     From this equation, the following f i , approximation equation can be obtained: 
     
         f.sub.i &#39;≈1/h(f.sub.i+1 -f.sub.i)                  (1) 
    
     
         f.sub.i &#39;≈1/2h(f.sub.i+1 -f.sub.i-1)               (2) 
    
     The equation (1) includes an error of about -h/2f i  &#34;, and the equation (2) includes an error of about -h 2  /6f i  &#39;&#34;. Thus, the equation (2) is more approximate to the correct differential coefficient f i  &#39;. Since equation (1) represents the output difference between two adjacent photoelectric elements, equation (1) corresponds to obtaining the gradient of the dotted line 2. Because equation (2) expresses the output difference between two photoelectric elements which are picked up every two elements, equation (2) corresponds to obtaining the gradient of the one-dot chain line 3. 
     A focus detecting device according to this invention is arranged as shown in FIG. 2. The above-described approximation equation is applied for the output of a self-scanning type photoelectric device 6 having a number of elements. The image of an object 4 is formed on the self-scanning type photoelectric element 6 with the aid of a lens 5. The self-scanning type photoelectric device 6 is driven by a drive circuit 7, so that the object image is electrically scanned. As a result, the brightness distribution is transduced photoelectrically to provide a discrete time series signal. 
     The output wave form of the self-scanning type photoelectric device 6 is amplified by an amplifier 8, and is then delayed by the time corresponding to the scanning period for one or two elements by a delay circuit 9. The waveform thus delayed is compared with the waveform which does not pass through the delay circuit 9, in a difference circuit 10. As a result a voltage value corresponding to the voltage difference between the two waveforms is produced. 
     The difference output is converted into a positive or negative voltage value by an absolute value circuit 11. The maximum value of the absolute value output in one scanning period is detected and held by a peak value holding circuit 12. The peak value output of the peak value holding circuit 12 is a signal indicating the status of focus. 
     FIGS. 3(A)-(D) show the variations of the waveform. More specifically, FIG. 3(A) shows the output signal of the amplifier circuit 8, FIG. 3(B) shows the waveform which is obtained by delaying the output signal of the amplifier circuit 8 the time corresponding two elements by the delay circuit 9, FIG. 3(C) shows the difference output waveform corresponding to the voltage difference between the two waveforms, and FIG. 3(D) shows a waveform indicating the absolute value of the difference output obtained by the absolute value circuit. 
     In FIG. 3, the difference between the output of an element P11 and the output of an element P9 is the greatest, and therefore the peak value 13 appears in the absolute value output waveform (FIG. 3(D)). With a flat object, the absolute value output between each pair of elements shows the maximum value, when the focus is obtained. With a deep object, the brightness distribution concerning the minute parts of the object must be selectively extracted. If the peak value 13 is held, then only the part indicating the maximum contrast in the measurement range is extracted. Thus, the focus can also be detected for the deep object. 
     FIG. 4 shows the variations of the peak value in one scanning period when the lens is moved back and forth. In FIG. 4, T 1 , T 2 , . . . and T n  designates scanning periods of the self-scanning type photoelectric device 6, respectively. The peak value in one scanning period is held until another peak value is provided in the next scanning period. Thus, FIG. 4 indicates the fact that the maximum peak value is obtained in the scanning period T 5 , and at this time instant the lens reaches the proper focus position. 
     The self-scanning type photoelectric element can provide a large photoelectric output because it stores the quantity of incident light in one scanning period. If the scanning speed is decreased, then a high photoelectric output can be obtained from light low in intensity. 
     Because the self-scanning type photoelectric device is employed in the present invention as described above, the invention can achieve focus detection of high sensitivity when compared with the system which uses a photoelectric element array, in which no scanning is effected, to detect the photoelectric differences between the elements thereof. Furthermore, in the invention, the discrete photoelectric output is directly processed without analog waveform conversion. Therefore, the circuitry is relatively compact. In addition, the invention does not suffer from the elimination of high frequency components which may result in digital-to-analog conversion. Thus, the focus detecting device according to the invention is considerably higher in detection sensitivity.