Background of the Invention
1. Field of the Invention
This invention relates to an in-focus detecting device suited to be used, for example, in an image pickup optical system of the video camera.
2. Description of the Related Art
The video cameras or the like have generally employed the device for detecting the focus of the optical system for the image pickup device by measuring the degree of image sharpness. To perform focusing of the optical system, for example, the video signals obtained from the image pickup element are processed to detect the degree of sharpness of an object image on the image pickup surface, and the optical system is moved into focus in such a way that the degree of sharpness becomes the highest. For this purpose, many methods have been proposed, the typical one of which is fundamentally in that the high frequency component of the video signal is extracted by the high pass filter or the differentiation circuit, and the degree of sharpness of the image is evaluated by the magnitude of the extracted high frequency component. When focusing is performed by such a method, the direction of driving of the optical system is determined by comparing the degrees of sharpness of two images of different focus states from each other obtained by having driven the opticald system, and the optical system is stopped in a position where the degree of sharpness has reached the maximum. Thus, the in-focus condition of the optical system is obtained.
FIG. 14 illustrates an example of the construction of the conventional in-focus detecting device employing such a method. In this figure, 1 is an image forming lens for forming an image of an object to be photographed on an image pickup plane; 2 is a drive circuit for driving an image pickup element 3; 4 is a gate circuit for defining a distance measuring area in the image pickup plane; 5 is a band pass filter for detecting a prescribed frequency band in the distance measuring area; 6 is a drive circuit for causing minute vibrations of the image forming lens 1 within its depth of focus; 10 is an actuator for driving the image forming lens 1 to be driven by the drive circuit 6; 7 is a microcomputer receptive of the output signal of the band pass filter 5 for determining the direction of driving of the lens 1 and the in-focus position; 8 is a drive circuit for controlling the focus position of the image forming lens 1 on the basis of the command of the microcomputer 7; 9 is an actuator to be driven by the drive circuit 8.
FIG. 15 illustrates that, as an image of some object is picked up, the frequency component obtained from the band pass filter 5 in its prescribed area varies as a function of the position of the lens 1. An in-focus point C is the position of the lens 1 in which the frequency component takes the maximum value as the figure shows. The focusing device of FIG. 14 controls the movement of the lens 1 so that it stops in the corresponding position to this in-focus point C.
To detect the above-described maximum value, a lens constituting part of the image forming lens 1 is made to vibrate minutely back and forth with variation of its frequency component.
FIG. 16 illustrates the variation of the frequency component across the in-focus point. The waveform on line A of this figure represents a drive signal for minute vibration of the lens 1. The waveforms on lines B to D represent the outputs of the band pass filter 5 when the lens 1 is positioned on the front side of the in-focus point, at the in-focus point and on the rear side of the in-focus position, respectively. As shown by the waveforms of B and D in comparison, the phase of variation of the output of the band pass filter component changes 180.degree. across the in-focus point. Where this phase inverts becomes the in-focus point at which the output no longer changes as shown on line C of this figure. So, the microcomputer 7 accepts the amplitude and phase of the output signal of the band pass filter 5 to determine the direction in which the image forming lens 1 is to be moved and sends a command of driving and stopping the image forming lens 1 to and in the in-focus position C to the drive circuit 8 for the actuator 9.
However, though such a conventional method is effective in the neighborhood of the in-focus condition of the object, it is in a largely defocused position, for example, point E of FIG. 15, that the component of the output of the band pass filter 5 does not largely change with variation of the lens position as shown on line E of FIG. 16, becoming indistinguishable from the in-focus signal. Therefore, the conventional device employing this method has an important drawback that when the image is largely defocused, the direction in which the image forming lens 1 is to be moved to bring the image into sharp focus is uncertain, so that there is no way of driving except to rely on the rule of trial and error.
Summary of the Invention
The present invention has been made to eliminate the above-described drawback, and its object is to provide an in-focus detecting device which, even when the lens lies at a large distance from the in-focus position with the image being largely defocused, enables determination of the direction in which the lens is to be moved to be made reliably.
To achieve this object, in an embodiment of the invention, the in-focus detecting device comprises a photo-electric converter element for converting an object image formed on the photo-electric converting surface with light entering through an image forming lens to an electrical signal, a lens drive mechanism for controlling the focus position of the image forming lens, an in-focus detecting circuit receptive of the output of the photo-electric converter element for determining the degree of focus in a prescribed fraction of a distance measuring area of the photo-electric converting surface and the degree of focus outside the aforesaid portion, and test means responsive to fall of the degree of focus in the aforesaid fraction of the distance measuring area detected by the in-focus detecting circuit below a prescribed level, or to excessive defocusing of the image, for comparing the degrees of focus inside and outside the fraction of the distance measuring area with each other when the direction in which the lens is to be moved to bring the image into focus is determined. Since, even when the object image in the fraction of the distance measuring area becomes largely out of focus, the direction of the lens to be driven can be determined by using the degree of focus in the other fraction of the distance measuring area than the aforesaid one. Thus, it is made possible to avoid misdirection in driving the lens and, therefore, to achieve a quick focus adjustment.
Other objects and features of the invention will become apparent from the following detailed description of embodiments thereof by reference to the drawings:
Brief Description of the Drawings
FIG. 1 is a block diagram illustrating the entire construction of an embodiment of the invention.
FIG. 2(A) is a block diagram illustrating the internal construction of the circuit for detecting the degree of focus of FIG. 1.
FIG. 2(B) is a block diagram illustrating the internal construction of the differentiation-integration circuit of FIG. 2(A).
FIGS. 3(A) to 3(C) illustrate where to locate a fraction of a distance measuring area within the field of view in the embodiment of the invention with FIG. 3(A) being a pictorial representation, FIG. 3(B) indicating a main distance measuring area and FIG. 3(C) indicating a pair of auxiliary distance measuring areas which take their places on horizontally either side of the main one.
FIGS. 4 and 5 are characteristic curves illustrating the relationship between the axial position of the lens and the degree of focus in the embodiment of the invention.
FIG. 6 is a flowchart illustrating the procedure of operations of the embodiment of the invention of FIG. 1.
FIG. 7 illustrates a different division method of the main and auxiliary distance measuring areas according to another embodiment of the invention.
FIG. 8 is characteristic curves illustrating the relationship between the lens position and the degree of focus when the method of FIG. 7 is employed.
FIG. 9 is a block diagram illustrating the entire construction of a circuit for detecting the degree of focus suited for use in another embodiment (FIGS. 7 and 8) of the invention.
FIG. 10 is a flowchart illustrating the procedure of operations of the second embodiment of the invention of FIG. 9.
FIGS. 11(A)-11(C), 12(A)-12(C), and 13(A)-13(C) are diagrams for explaining the principle of the in-focus detecting device of the invention, with FIGS. 11(A), 12(A) and 13(A) illustrating objects of different patterns from one another, FIGS. 11(B), 12(B) and 13(B) being waveforms of the video signal obtained in correspondence to the respective objects when in sharp focus, and FIGS. 11(C), 12(C) and 13(C) being waveforms when out of focus.
FIG. 14 is a block diagram of the conventional device.
FIG. 15 is a characteristic curve illustrating the relationship between the lens position and the frequency component in the conventional device.
FIG. 16 is waveforms illustrating how the frequency component varies with recycles of the minute vibration of the lens.
Detailed Description of the Preferred Embodiments
The present invention is next described in detail in connection with embodiments thereof by reference to the drawings.
FIG. 1 is a block diagram of the construction of an embodiment of an in-focus detecting device according to the present invention. In this figure, the in-focus detecting device comprises two gate circuits 41 and 42 for defining a prescribed distance measuring area within the TV picture frame and another one respectively, two degree-of-focus detecting circuits 51 and 52 for detecting the degrees of focus in the respective distance measuring areas, and two peak detecting circuits 61 and 62 for detecting when each of the degrees of focus reaches a maximum value. The gate circuits 41 and 42 pass those of the signals which come from the hatched areas shown in FIG. 3(B) and FIG. 3(C) respectively. Here, FIG. 3(A) shows an object image formed on the image receiving surface of the image pickup element 3. For note, the parts 1, 2, 3, 7, 8 and 9 are similar to those of the conventional device of FIG. 14. So, a more detailed explanation of them is omitted.
FIG. 2(A) illustrates an example of the circuit construction of the degree-of-focus detecting circuit 51, 52 of FIG. 1.
At first, the principle of the in-focus detecting device of the invention is briefly described.
In FIG. 11(B) and FIG. 11(C), as a video signal across an edge in the pattern of the object changes in its intensity I(x), its width .DELTA.x becomes a minimum value .DELTA.x.sub.0 when the object image is in focus, and increases as it is defocused. The width .DELTA.x depends on the diameter of a circle of confusion of the optical system, the resolving power of the image pickup element and the band width of the video signal processing circuit. Since the latter two have no relation to the focus state of the optical system, whether the optical system is in focus or out of focus can be determined by detecting the width .DELTA.x of the edge-dependent portion of the video signal. That is, if .DELTA.x.perspectiveto..DELTA.x.sub.0, the image is in focus. If .DELTA.x>.DELTA.x.sub.0, it is out of focus. This criterion is not affected by the average brightness of the edge portion or the contrast across the edge. In other words, by detecting the width in the edge portion of the object, determination can be made that when that width is wide the image is out of focus, and when that width is narrow, it is in focus.
Also, even in the case of a general object shown in FIG. 12(A), there is a discontinuous change of brightness in the contour portion of a person or thing or the like. Its neighborhood has a brightness distribution which resembles well that of the case of the edge pattern of FIG. 11(A). Therefore, by seeking the width .DELTA.x of the edge portion of the video signal I(x) as shown in FIG. 12(B) and FIG. 12(C), and then by comparing it with an already known value .DELTA.x.sub.0 or that value of the width which is taken when the optical system is in focus, whether the image is in focus or out of focus can be determined. For note, with an object having fine patterns as shown in FIG. 13(A), even when out of focus as shown in FIG. 13(C), the contributions from the two edges superimpose so that the width .DELTA.x does not increase. Therefore, the in-focus detection cannot be carried out. To make possible the in-focus detection, therefore, it is required that the width L of each of the white and black stripes forming the edges is somewhat larger than the value .DELTA.x.sub.0, being on the order of, for example, 2 to several times the value .DELTA.x.sub.0. Since the value .DELTA.x.sub.0 is as small as the minimum diameter of a circle of confusion of the optical system, the width L is considerably small compared with the size of the entire area of the picture frame. Hence, such an edge portion is present on almost any object. In almost all cases, therefore, the in-focus detection can be carried out.
In this embodiment, the width .DELTA.x of the aforesaid edge portion is sought in such a manner that the gradient dI/dx of brightness of the edge portion and the brightness difference .DELTA.I in the edge portion shown in FIG. 11(B) or FIG. 12(B) are found out from the video signal I(x) and their ratio q=(dI/dx)/.DELTA.I is computed. Thus, the width .DELTA.x of the edge portion is indirectly obtained. That is, q corresponds to the reciprocal of the width .DELTA.x of the edge portion, representing the steepness of the edge portion. Here, since the brightness difference .DELTA.I in the edge portion has a value which, even when the optical system is slightly out of focus, remains unchanged from when in focus, as shown in FIG. 11(B) or FIG. 11(C), detection is possible even if the image is out of focus, or the waveform of the video signal when in focus is uncertain. By using this brightness difference .DELTA.I in normalizing the gradient dI/dx of the edge portion which steeply changes between in focus and out of focus, the width .DELTA.x of the edge portion can be found. Further, such a width .DELTA.x does not depend on the average brightness and contrast of the object. Hence, it is possible to determine whether the optical system is in focus, or out of focus.
In this embodiment, whether in focus or out of focus is determined by computing the above-defined equation: q(x)=(dI/dx)/.DELTA.I(x) and comparing the computation result with a prescribed value q.sub.0 .perspectiveto.1/.DELTA.x.sub.0. Also, .DELTA.I(x) is computed based on the following formula: ##EQU1## Here, the width L has a value on the order of 2 to several times the minimum diameter of a circle of confusion of the optical system as has been described above, and, in case when the photo-electric transducer element is an image pickup element, the integration is performed over an area of several to 10 units in the number of picture elements. Such .DELTA.I(x) for the edge portion gives the difference .DELTA.I between the maximum and minimum brightnesses in a prescribed range of area with its edge at the center as shown in FIGS. 11(B) and 11(C). But, for the fine pattern as shown in FIG. 13(A), it always takes a larger value than the difference between the maximum and minimum values. As a result, the value of q(x) becomes smaller. Hence, there is no possibility of mistaking it for the sharp focus.
In FIG. 2(A), the circuit for detecting the degree of focus includes a differentiation circuit 102 for differentiating the video signal I(t) obtained from the image pickup element 3 to produce an output representing the gradient dI/dt of the video signal, an absolute value circuit 103, and a differentiation-integration circuit 104 for producing an output signal .DELTA.I(t) in correspondence to the brightness difference .DELTA.I(x) in the edge portion of the video signal. For note, t represents the time measured from the start of readout of the signal from the image pickup element 1.
FIG. 2(B) shows the construction of the differentiation-integration circuit 104 for computing .DELTA.I(t). In FIG. 2(B), 114 is a delay circuit for delaying the signal by a time T; 115 is a subtraction circuit; and 116 is an integration circuit. The subtraction circuit 115 produces an output signal representing the difference the input signal and its delayed signal: ##EQU2## Integrating this output signal, the integration circuit 116 produces an output signal .DELTA.I(t): ##EQU3##
The circuit of FIG. 2(A) further includes a delay circuit 106 for delaying the input signal ##EQU4## by about a time of T/2, two logarithmic circuits 105 and 107, and a difference circuit 108. By taking the difference between their logarithms, ##EQU5## is obtained.
That is, by taking the ratio of the gradient of brightness variation of the edge portion of the object image to the brightness difference of this edge portion, the width of the edge portion is detected. Based on the value q of this width, the degree of focus is determined. In particular, the feature of the detection of the degree of focus in the degree-of-focus detecting circuit 51, 52 is that the in-focus value q is found only from the video signal I(t), and further a constant value q.sub.0 is always presented at the in-focus point without being influenced by the shape and brightness of the object to be photographed.
And, the in-focus value q (because of its being the reciprocal of .DELTA.x, it takes a maximum value when .DELTA.x is minimum) produced from the degree-of-focus detecting circuit 51, 52 is applied to the peak detecting circuit 61, 62 in which a peak value in its prescribed period or time interval is detected. Its output is supplied to the microcomputer 7 in which a determination to be described below is carried out.
FIG. 4 depicts the relationship of the position of the image forming lens 1 with the degree of focus, which proves that the peak value q.sub.0 of the degree of focus (the reciprocal of .DELTA.x.sub.0) is constant regardless of the object whatever. Therefore, by setting a slice level q.sub.1 as the upper limit, the reach of the degree of focus to this limit q.sub.1 can be taken as when the in-focus condition is established. Conversely when the degree of focus falls below a lower limit or slice level q.sub.2, the optical system is determined to be largely out of focus.
Now assuming that an object image as shown in FIG. 3(A) is to be picked up, the principal interest in the general case (in this instance, a person) lies within the central distance measuring area, and its outside very often contains a farther landscape than the subject of principal interest. The degree of focus of such a scene is expressed in FIG. 5, where the waveform shown by the solid line curve represents the variation of the degree of focus in the one of the distance measuring areas which is assigned to the gate circuit 41 (the hatched portion of FIG. 3(B)), and the waveform shown by the dashed line curve represents the variation of the degree of focus in the pair of other distance measuring areas assigned to the gate circuit 42 (the hatched portions of FIG. 3(C)). As is understandable from these figures also, compared with the in-focus point P.sub.1 in the main distance measuring area, the in-focus point P.sub.2 in its outer distance measuring areas is deviated. It is the former in-focus point P.sub.1 that corresponds to the forward moved position of the lens 1.
Now, if the degree of focus in the main distance measuring area is lower than the level q.sub.2, or the image of the subject or person of principal interest is largely defocused, the concurrent position of the lens 1 can be determined to lie either on the right hand side of a point A of FIG. 5, or on the left hand side of a point B. Then, the degree of focus outside the main distance measuring area is compared with the degree of focus in the main distance measuring area. If the former is larger than the latter, the position of the lens 1 can be determined to lie on the left hand side of the point B. To bring the subject image into focus, the lens 1 must be moved forward. Conversely if the former is smaller than the latter, the position of the lens 1 can be determined to lie on the right hand side of the point A. Therefore, the lens 1 must be moved rearward to focus. In such a manner, for the large defocusing which heretofore resulted in the difficulty of determining the direction of the lens to be driven, the degree of focus in the pair of auxiliary distance measuring areas is used to facilitate determination of the direction in which the lens must be moved to bring the image portion in the main distance measuring area into focus easily and quickly.
FIG. 6 illustrates an example of a program for the determination of the direction of the lens to be moved when a very low degree of focus is detected by the device of this embodiment of the invention. At first, in a step S1, the degree of focus P.sub.F in the main distance measuring area is detected on the basis of the output of the first peak detecting circuit 61. In the next step S2, whether or not the value of the degree of focus P.sub.F is smaller than the prescribed lower limit slice level (threshold) q.sub.2 is examined. If the step S2 is "yes" answer, as a large defocus occurs, then the degree of focus P.sub.E in the auxiliary distance measuring areas is detected on the basis of the output of the second peak detecting circuit 62 in a step S3. In the next step S4, the detected values P.sub.F and P.sub.E are compared with each other. If P.sub.E >P.sub.F, then the lens 1 is moved axially forward through the drive circuit 8 and the actuator 9 in a step S5. On the other hand, if not so, then the lens 1 is moved rearward in another step S6. For note, if, in the step S2, P.sub.F <q.sub.2 is determined as not true, then advance to a step S7. Since the image is not very unsharp, determination of the direction of the lens 1 to be driven is made by the minute vibration of the lens 1.
Also, in the present invention, as shown in FIG. 7, even from a degree of focus in another areas (indicated by hatching) vertically outside the central distance measuring area, the direction of the lens 1 to be driven can be determined when the large defocus has occurred.
Usually, in most of the outdoor or like photographic situations, the sky or a farther scene than the subject of principal interest enters the upper marginal zone of the field of view, while the lower marginal zone contains a road or a closer scene than the subject. On this account, if the auxiliary distance measuring area outside the main distance measuring area W.sub.0 is taken at the upper side W.sub.2 and the lower side W.sub.1, three peaks appear in the variation of the degree of focus at respective curves W.sub.2, W.sub.0 and W.sub.1 as shown in FIG. 8. With the subject image located in the main distance measuring area W.sub.0, if a large defocus occurs, the lens 1 will probably lie, similarly to the above-described first embodiment, either on the right hand side of the point A of FIG. 8, or on the left hand side of the point B of FIG. 8. Then, the degrees of focus W.sub.1 and W.sub.2 from the auxiliary areas W.sub.1 and W.sub.2 are detected. If W .sub.1 >W.sub.2, it can be determined that the lens 1 is focused on the foreground. So, the lens 1 must be moved rearward to effect focusing up to the subject. Conversely if W.sub.2 >W.sub.1, the lens 1 can be determined to have been focused on the background. Then, the lens 1 must be moved forward. In order to operate focusing of the lens 1 in such a way, for each of the main distance measuring area W.sub.0, the upper area W.sub.2 and the lower area W.sub.1, a gate circuit 41, 43, 44, a degree-of-focus detecting circuit 51, 53, 54, and a peak detecting circuit 61, 63, 64 are provided as shown in FIG. 9. Then, the outputs of the three series-connected circuits are applied in parallel to the microcomputer 7. The other constituent parts are similar to those shown in FIG. 1.
Also, a program for the determination of the direction of the lens to be driven at the time of a large defocus in the second embodiment of the invention is shown in FIG. 10.
Its basic algorithm is identical with that described in connection with the first embodiment shown in FIG. 6. In a step S1', the degree of focus P.sub.F in the main distance measuring area is detected. In a step S2', the detected value of the degree of focus P.sub.F is compared with the prescribed value q.sub.2. If it is below the prescribed level value, or a large defocus occurs, then advance to a step S3' to detect the degree of focus W.sub.2 of the upper area and the degree of focus W.sub.1 of the lower area. In the next step S4', both are compared with each other.
And, if W.sub.1 >W.sub.2, then advance to a step S6' to move the lens 1 axially rearward. If W.sub.1 <W.sub.2, then advance to another step S5' to move the lens 1 axially forward. In such a manner, the direction in which the lens 1 must be moved to bring the subject image into sharp focus is determined.
Also, if, in the step S2', the subject image is determined as not very unsharp, then advance to a step S7'. Therefore, determination of the direction of the lens to be moved is made by the conventional method of minute vibration of the lens.