Distance measuring device

Abstract: Light projected by a light projecting portion and reflected by an object is received by two sensor arrays (105, 106). Difference signals between signals respectively added by ring CCDs (113b, 114b) in correspondence with the ON and OFF states of the light projecting portion are calculated, and the distance to the object to be measured is calculated on the basis of the relative values of the positions of the difference signals on the sensor arrays (105, 106). The two sensor arrays (105, 106) form the base length, and the light projecting portion (104) is disposed at a position offset from the base length.

Description: BACKGROUND OF THE INVENTION The present invention relates to a distance measuring device for measuring the distance to an object to be measured and, for example, to a device suitably applied to the AF mechanism of a camera. Conventionally, a distance measuring device which performs a trigonometrical measurement by projecting a light spot onto an object to be measured, the distance to which is to be measured, and receiving light reflected by the object using a position detection means such as a PSD (position sensitive detector) or the like, is known. On the other hand, another distance measuring device which circulates an accumulated charge using a ring-shaped CCD to integrate reflected light of ON/OFF-projected light spots, and skims a predetermined amount of charges of external light components other than the light spot has been proposed by Japanese Patent Provisional Publication (KOKAI) No. 60-105270. As a distance measuring device using a PSD, a device shown in Fig. 23 is known well. More specifically, a light spot is projected from an infrared light-emitting diode (IRED) 204 serving as a light spot projecting means onto an object to be measured (not shown) via a projection lens 202, and light reflected by the object is received by a position detection element (PSD) 203 via a light-receiving lens 201. The distance between the optical axes of the projection lens 202 and the light-receiving lens equals the base length. If the base length and the distance from the light-receiving lens 201 to the sensor surface of the PSD 203 are constant, the position of the projected light spot image on the sensor surface of the PSD 203 changes in correspondence with the distance to the object to be measured. For example, when the object is vary far, incident light is incident in a direction substantially parallel to the optical axis of the light-receiving lens 201, and an image is formed near a terminal B. On the other hand, as the object draws nearer, since incident light is incident from the obliquely right direction, the image approaches the terminal A side. The two terminals A and B of the PSD 203 output current signals corresponding to the light-receiving position, and the distance to the object to be measured can be detected based on the current ratio. However, as shown in Fig. 24, when only half of a finite light spot 212 having a predetermined size is projected onto an object 211 to be measured, the broken line portion of a received light image 213 on the PSD 203 is omitted. Since the PSD 203 detects the barycentric position of the received light image as the position of an image, it detects a barycentric position G2 in place of an original barycentric position G1. For this reason, errors are generated in the distance to the object to be measured. This problem cannot be solved even when a sensor array is used in place of the PSD 203. In order to correct errors caused by movement of the barycentric position of the received light image, as shown in Figs. 25A and 25B (in these figures, the object to be measured is present in a direction perpendicular to the plane of the drawing), an arrangement in which second light-receiving portions 223 and 224 for correction are added as a light-receiving lens and a PSD in addition to a light projecting portion 221 and a light-receiving portion 222, has been proposed. Note that an alternate long and short dashed line 220 in Figs. 25A and 25B indicates a base. Fig. 26A shows a PSD 225 of the light-receiving portion 222, and Fig. 26B shows a PSD 226 of the light-receiving portions 223 and 224. In the distance measuring device shown in Fig. 25A, the light-receiving portion 223 for correction is disposed at a position offset from the light projecting portion 221 in a direction perpendicular to the base direction, as shown in Fig. 26B. For this reason, the PSD 226 can have a short length. However, since the optical axis of the light projecting portion 221 does not agree with that of the light-receiving portion 223, they have a base length in the vertical direction, and the received light image on the PSD 226 moves in the vertical direction in correspondence with the distance to the object to be measured. To cope with such movement, the width of the PSD 226 must be increased vertically. On the other hand, in the distance measuring device shown in Fig. 25B, errors are corrected by inserting the light projecting portion 221 between the two light-receiving portions 222 and 224, and as a result, a size reduction of the device is limited. Therefore, a size reduction of the device cannot be attained even when the S/N ratio of the light-receiving portion is improved or a device having a high position detection resolution is used. In still another distance measuring device, a distance measurement is performed on the basis of the correlation between image signals, generated based on the pattern of an object to be measured, on two sensor arrays separated by a distance equal to the base length without projecting any light spot onto an object at a far distance or an object having a low reflectance. However, in this case, if the object to be measured has no pattern, image signals cannot be obtained, thus disturbing the distance measurement. Furthermore, since no light spot is projected, no image signals are obtained in a dark place. On the other hand, when image signals suffer perspective conflict, an accurate distance measurement cannot be attained. When a distance measurement is performed over a broad range to cope with perspective conflict, the length of each sensor array must be increased, and it becomes impossible to attain the distance measurement. SUMMARY OF THE INVENTION It is a concern of the present invention to provide a compact distance measuring device which can accurately perform a distance measurement suffering less errors even when a portion of a projected light image is omitted. It is another concern of the present invention to provide a distance measuring device which can accurately measure the distance to an object at a far distance or an object having a low reflectance. European Patent Specification No. EP-A-0 730 167 discloses a distance measurement device reflected light projected onto an object the distance of which is to be measured is received on two sensor arrays which each comprise a plurality of sensors, the distance of the object being calculated on the basis of relative values of positions of the difference signals on the two sensors. According to the present invention, there is provided a distance measuring device as set out in claim 1. Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention. Fig. 1 is a schematic view showing a distance measuring device according to an embodiment of the present invention; Fig. 2 is a view showing principal part of the distance measuring device shown in Fig. 1; Fig. 3 is a schematic view showing the operations of an integral portion and an accumulation portion in the device shown in Fig. 2; Fig. 4 is a timing chart showing the operation timings of the respective portions when a charge is transferred from each sensor block to a linear CCD in the device shown in Fig. 2; Fig. 5 is a timing chart showing the operation timing of the respective portions of a ring CCD in the device shown in Fig. 2; Fig. 6 is a view showing the layout of the distance measuring device according to the first embodiment; Fig. 7 is a view showing the positional relationship between the sensor array and the image signal in Fig. 6; Fig. 8 is a view for explaining a narrow distance measuring range; Fig. 9 is a view for explaining a broad distance measuring range; Fig. 10 is a view for explaining the distance measuring range in an embodiment of the present invention; Figs. 11A, 11B, and 11C are views for explaining the effects of the device shown in Fig. 10; Fig. 12 is a view showing an embodiment in which two ring CCDs have opposite charge rotation directions; Figs. 13A and 13B are views for comparing the effects of the devices shown in Figs. 12 and 1; Fig. 14 is a schematic view showing a distance measuring device for realizing multi-point distance measurements according to the second embodiment; Figs. 15A to 15E are views for explaining the operation of the device shown in Fig. 14; Fig. 16 is a schematic view showing a distance measuring device according to another embodiment of the present invention; Fig. 17 is a schematic view showing a distance measuring device according to still another embodiment of the present invention; Fig. 18 is a view showing another layout of the device of the present invention; Fig. 19 is a block diagram showing the arrangement of the distance measuring device; Fig. 20 is a block diagram showing the arrangement of a correlation calculation unit; Fig. 21 is a graph showing an example of the correlation calculation procedure; Figs. 22A and 22B are views showing the distance measurement principle of the distance measuring device; Fig. 23 is a schematic view showing the measurement principle of a conventional distance measuring device; Fig. 24 is a view for explaining the error generation principle of the device shown in Fig. 23; Figs. 25A and 25B are views showing examples of the layouts of the conventional devices; Figs. 26A and 26B are views showing light-receiving portions (PSDs) of the devices shown in Figs. 25A and 25B; Fig. 27 is a flow chart showing the operation of the distance measuring device of the third embodiment; Fig. 28 is a flow chart showing the light projection distance measuring operation in Fig. 27; Fig. 29 is a flow chart showing a non-projection distance measuring operation in Fig. 27; Fig. 30 is a schematic view showing principal part of a distance measuring device according to still another embodiment of the present invention; Fig. 31 is a view for explaining the low-pass filter function in Fig. 30; Fig. 32 is a timing chart for explaining the operation timings of the device shown in Fig. 30; Fig. 33 is a view for explaining the principle of increasing the contrast in a distance measuring device according to still another embodiment of the present invention; and Fig. 34 is a flow chart showing the operation of the device described in Fig. 33. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The preferred embodiments of the present invention will be described hereinafter with reference to the accompanying drawings. [FIRST EMBODIMENT] Fig. 1 is a schematic view mainly showing a sensor unit of a distance measuring device according to an embodiment of the present invention. Note that the arrangement of the overall device will be described later with reference to Fig. 19. <Arrangement of Light-receiving Unit> Referring to Fig. 1, first and second light-receiving lenses 101 and 102 respectively form first and second optical paths. A projection lens 103 focuses light emitted by a light-emitting element 104, which projects a light spot, onto an object to be measured (not shown). First and second sensor arrays 105 and 106 comprise sensor blocks (see Fig. 2) each consisting of a plurality of photoelectric conversion elements. First and second clear portions 107 and 108 have an electronic shutter function of clearing charges photoelectrically converted by the sensor blocks of the first and second sensor arrays 105 and 106 at the timings of pulses ICG. Each of first and second charge accumulation units 109 and 110 has ON and OFF accumulation portions, as will be described later, which respectively accumulate charges corresponding to ON and OFF periods of the light-emitting element 104 and supplied from the first and second sensor arrays 105 and 106 at the timings of pulses ST 1 and ST 2 in units of pixels. First and second transfer gates 111 and 112 parallelly transfer charges accumulated in the first and second charge accumulation units 109 and 110 to linear CCDs 113a and 114a at the timings of pulses SH, respectively. First and second charge transfer units 113 and 114 are respectively constituted by the linear CCDs 113a and 114a having portions opposing the first and second charge transfer gates 111 and 112, and ring CCDs 113b and 114b (ring-shaped charge transfer portions), which are formed in an annular shape to be contiguous with the linear CCDs 113a and 114a. In these ring CCDs 113b and 114b, charges corresponding to the ON and OFF periods of the light-emitting element 104 are sequentially added when charges circulate. First and second initialization circuits 115 and 116 initialize the ring CCDs 113b and 114b by clearing all the charges therein in response to pulses CCDCLR. First and second skim circuits 117 and 118 skim a predetermined amount of charges from the ring CCDs 113b and 114b. SKOS signal output circuits 119 and 120 read out charges in the ring CCDs 113b and 114b in a non-destructive manner, and respectively output signals SKOS 1 and SKOS 2 used for discriminating whether or not a charge skimming operation is to be performed in the first and second skim circuits 117 and 118. OS signal output circuits 121 and 122 sequentially read out charges in the ring CCDs 113b and 114b and respectively output signals OS 1 and OS 2 . The detailed arrangement of the first and second sensor arrays 105 and 106, and the first and second charge transfer units 113 and 114 illustrated in Fig. 1 will be described below with reference to Fig. 2. A sensor array 11 (corresponding to the first and second sensor arrays 105 and 106 in Fig. 1) consists of five sensor blocks S 1 to S 5 , and signal charges photoelectrically converted by the sensor blocks S 1 to S 5 are integrated by integral portions 12. Note that the number of pixels in the sensor array 11 is not limited to five in this embodiment, but the sensor array 11 may have N pixels (N: natural number). The integral portions 12 have clear portions 13 driven by the pulses ICG. In this embodiment, as shown in Fig. 2, first and second accumulation portions 15 and 14 (corresponding to the first and second charge accumulation units 109 and 110) are alternately arranged in a direction parallel to the sensor array 11, and each integral portion 12 corresponds to a pair of accumulation units 14 and 15. Charges integrated by each integral portion 12 are alternately transferred to a corresponding pair of accumulation units 14 and 15 in response to the pulses ST 1 and ST 2 . The output terminals of the pair of accumulation portions 14 and 15 are connected to a linear CCD 17 (corresponding to the linear CCDs 113a and 114a) of a charge transfer portion via corresponding shift portions 16 (corresponding to the first and second charge transfer gates 111 and 112) driven by the pulses SH. The linear CCD 17 is coupled to a ring CCD 18 (corresponding to the ring CCDs 113b and 114b) of the charge transfer portion. Each stage of the linear CCD 17 and the ring CCD 18 is constituted by a two-phase CCD cell driven by two-phase clocks CK 1 and CK 2 . Note that each stage may comprise a three-phase CCD cell, four-phase CCD cell, or the like. The ring CCD 17 is constituted by 12 stages, i.e., CCD cells 1 A to 12 A , and the ring CCD 18 is also constituted by 12 stages, i.e., CCD cells 1 B to 12 B . When the sensor array 11 has N pixels, each of the linear CCD 17 and the ring CCD 18 has (2N+2) stages. The charge transfer operation from the sensor array 11 to the linear CCD 17 will be described below with reference to Figs. 3 and 4. Signal charges photoelectrically converted by the sensor blocks S 1 to S 5 in the sensor array 11 are transferred to and integrated by the integral portions 12. Prior to these integral operations, as shown in Fig. 4, charges in the integral portions 12 are cleared by pulses ICG transmitted at predetermined periods, thus initializing the integral portions 12 (a bold arrow in Fig. 3). After charges are transferred from the sensor blocks S 1 to S 5 in the sensor array 11 and are integrated by the integral portions 12 during a light-projection ON period of a light-emitting diode (IRED; not shown), they are transferred to the first accumulation portions 15 in response to a pulse ST 1 (a thin arrow 301 in Fig. 3). Subsequently, the IRED is turned off. After charges are transferred from the sensor blocks S 1 to S 5 in the sensor array 11 and are integrated by the integral portions 12 during a light-projection OFF period of the IRED, they are transferred to the second accumulation portions 14 in response to a pulse ST 2 (a wavy arrow 302 in Fig. 3). Therefore, a total of periods t 1 and t 2 from the clearing operation of the integral portions 12 in response to the pulses ICG until charge transfer in response to the pulses ST 1 and ST 2 corresponds to the integral time. More specifically, the clear portions 13 provided to the integral portions 12 also have an electronic shutter function of controlling the integral time in the integral portions 12 in accordance with the generation timings of the pulses ICG. For example, the timing of the pulse ICG is advanced or delayed in correspondence with the luminance of an object to be measured, and as the luminance becomes higher, the timing of the pulse ICG is set closer to the timing of the pulse ST 1 or ST 2 so as to shorten the integral time. In this manner, each first accumulation portion 15 accumulates charges corresponding to both infrared light reflected by an object and external light, and each second accumulation portion 14 accumulates charges corresponding to only external light. The charges which correspond to external light + infrared light reflected by an object during the light-projection ON period and are transferred to the first accumulation portions 15 in response to the pulses ST 1 , and the charges which correspond to only external light during the light-projection OFF period and are transferred to the second accumulation portions 14 in response to the pulses ST 2 , are respectively transferred to the CCD cells 3 A to 12 A of the linear CCD 17 in response to pulses SH. With this operation, for example, a charge generated by the sensor block S 1 during the light-projection OFF period is transferred to the CCD cell 3 A , a charge generated by the sensor block S 1 during the light-projection ON period is transferred to the CCD cell 4 A , a charge generated by the sensor block S 2 during the light-projection OFF period is transferred to the CCD cell 5 A ,.... In this manner, charges in the light-projection OFF and ON periods are alternately transferred to the CCD cells 3 A to 12 A of the linear CCD 17. The charges transferred to the CCD cells 3 A to 12 A are transferred inside the linear CCD 17 in response to clocks CK 1 and CK 2 . At this time, in this embodiment, since the charges generated in the light-projection ON and OFF periods are transferred via different accumulation portions 14 and 15, any unbalance between the dark currents in the accumulation portions in the light-projection ON and OFF periods can be eliminated. Since the charges generated in the light-projection ON and OFF periods are delayed by a predetermined period of time in the accumulation portions 14 and 15, and are simultaneously transferred to the linear CCD 17, the clocks CK 1 and CK 2 that drive the linear CCD 17 need not have any stop period. Since the charges can be transferred to the linear CCD 17 in synchronism with one-shot clock CK 1 , the degree of freedom upon designing the timings of the pulses ST 1 and ST 2 is high. When the pulses ST 1 and ST 2 are generated in correspondence with the ON/OFF state of an IRED signal, even when the light-projection ON and OFF periods replace each other, charge pairs generated in one sensor block can always be transferred in the order of OFF → ON. In Fig. 2, the CCD cells 1 A and 2 A of the linear CCD 17 are added in terms of the coupling layout between the linear CCD 17 and the ring CCD 18, and may be used in offset adjustment as empty CCD cells. More specifically, charges go around the ring CCD 18 in the order of cell 12 B → 11 B → 10 B → ··· → 2 B → 1 B → 12 B . The pulses SH used for transferring charges from the second or first accumulation portions 14 or 15 to the linear CCD 17 are synchronized with the cycle of one round of the ring CCD 18. More specifically, as shown in Fig. 4, the pulse SH is generated every 12 clocks CK 1 (the same applies to CK 2 ) used for transferring charges inside the ring CCD 18. On the other hand, the light-projection ON and OFF periods and the pulses ST 1 and ST 2 synchronous with these periods are synchronized with the pulses SH. Hence, the signal charges generated by the sensor blocks S 1 to S 5 in the light-projection ON and OFF periods are added to charges that go around the ring CCD 18 every round. Since the number of stages of the linear CCD 17 is 12, the linear CCD 17 can be driven by the same clocks CK 1 and CK 2 as those for the ring CCD 18. More specifically, since the CCD cells 1 A and 2 A are added to 10 stages of CCD cells 3 A to 12 A for receiving charges from the pairs of accumulation portions 14 and 15 in the linear CCD 17 to obtain 12 stages, the CCD cells 1 A and 2 A serve as offset adjustment CCD cells between the linear CCD 17 and the ring CCD 18. Of the ring CCD 18, the gate of the CCD cell 9 B is a floating gate, and is connected to an output portion 20. The output portion 20 converts a charge amount in the CCD cell 9 B into a voltage, and outputs the voltage as a signal OS via an amplifier 101. RD is the reset potential, the charge amount in the CCD cell 9 B is directly transferred to the CCD cell 8 B without being destructed, and the floating gate of the CCD cell 9 B is reset via a MOS gate driven by a pulse RS 1 . A CCDCLR terminal provided to the CCD cell 1 B of the ring CCD 18 is used for clearing a charge in the CCD cell 1 B by the pulse CCDCLR. Upon initializing a device, this portion clears the charges in the linear CCD 17 and the ring CCD 18 (see Fig. 5). Upon initialization, when a pulse CCDCLR is input to the CCD in synchronism with clocks CK 1 and CK 2 , charges that go around the ring CCD are cleared. Upon integrating charges, the pulse CCDCLR is kept at LOW level. The arrangement of a skim portion 19 arranged in the ring CCD 18 will be described below. The CCD cells 5 B and 4 B of the ring CCD 18 are respectively constituted as skim elements SK 1 and SK 2 . More specifically, the first skim element SK 1 is formed with a potential well for storing only a predetermined amount of charges. When the amount of charges transferred from the previous CCD cell 6 B exceeds the capacity of the well, overflowing charges flow into an element DC 1 . After charges from the CCD cell 6 B are distributed to the first skim element SK 1 and the element DC 1 , these charges are respectively transferred to the second skim element SK 2 and an element DC 2 in response to a pulse CK 2 . The second skim element SK 2 is formed with a potential well having a capacity smaller than that of the first skim element SK 1 , and charges overflowing from this well flow into the element DC 2 and are added to those transferred from the element DC 1 . An amplifier 102 arranged in this skim portion 19 has the same arrangement as that of the amplifier 101 in the above-mentioned output portion 20. That is, the amplifier 102 converts the charge amount transferred from the element DC 2 to the output-stage CCD cell of the skim portion 19 into a voltage, and outputs the voltage as a signal SKOS. The floating gate of the output-stage CCD cell of the skim portion 19 is reset to the level RD by a reset signal RS 2 . By checking the output SKOS from the amplifier 102, whether or not charges overflow in the skim elements SK 1 and SK 2 can be determined. When charges overflow, the charges transferred from the second skim element SK 2 to the next CCD cell 3 B are cleared by a pulse SKCLR. Furthermore, the overflowing charges in the element DC 2 are transferred to the CCD cell 2 B , and go around the ring CCD 18. On the other hand, when charges do not overflow in the skim elements SK 1 and SK 2 , no pulse SKCLR is formed, and charges in the second skim element SK 2 go around the ring CCD 18. <Description of Skim Operation> The skim operation will be described in detail below. Charges corresponding to the light-projection ON and OFF periods alternately go around the ring CCD 18, so that charges corresponding to the OFF period go ahead of those corresponding to the ON period in units of cells. First, the output SKOS is checked in an OFF portion to determine if a pulse SKCLR is to be output. If the output SKOS is detected in the OFF portion, a pulse SKCLR is generated to clear charges transferred from the second skim element SK 2 to the CCD cell 3 B . On the other hand, charges corresponding to the light-projection ON period are subjected to the same clear processing by generating a pulse SKCLR only when it is determined in the previous OFF portion that charges are to be cleared. With this operation, the same amount of charges are decreased from a pair of charges sensed by the identical sensor and corresponding to the light-projection ON and OFF periods. More specifically, charges corresponding to external light components accumulated during the light-projection OFF period are excluded from a signal which is being transferred, and charges corresponding to reflected light of projected light overflow from the skim elements and are integrated while going around the ring CCD 18. Therefore, when the difference between the pair of charge outputs corresponding to the ON and OFF periods is calculated finally, signal light can be detected. Note that the CCD cells 5 B to 2 B serving as the first skim element constitute the skim portion 19. The charge transfer operation by the ring CCD and the signal output control procedure will be described below with reference to Fig. 5. In Fig. 5, each of a pulse RS 1 and an output OS has two modes, i.e., normal and difference modes. In these modes, depending on the output timing of the pulse RS 1 from the output portion 20, the absolute value of each CCD cell is to be output or the difference between the pair of charges corresponding to the light-projection ON and OFF periods is to be output. More specifically, in the former case, when the CCD cell 9 B as the output stage that stores no charge is reset by outputting a pulse RS 1 , the absolute values of transferred charges are sequentially output. On the other hand, in the latter case, when the CCD cell 9 B that stores charges corresponding to the light-projection OFF period is reset by outputting a pulse RS 1 , and when charges corresponding to the light-projection ON period are transferred in turn, a difference signal obtained by subtracting the charges corresponding to the light-projection OFF period from those corresponding to the light-projection ON period is output. The charge transfer operation in the CCD will be explained below with reference to Fig. 5. Charges in the CCD are transferred to a neighboring cell on a predetermined side in synchronism with clock signals CK 1 and CK 2 . When a pulse CCDCLR is input, charges in the CCD cell 1 B are cleared. For this reason, upon initializing the CCD, as shown in the upper chart of the signal CCDCLR in Fig. 5, when a pulse CCDCLR is input in synchronism with a clock signal CK 1 , cleared charges in the CCD cell 1 B , i.e., a charge amount = 0 is added to the amount of charges transferred from the linear CCD 17, and the charges from the linear CCD are directly transferred to the ring CCD. For this reason, in order to clear charges in the entire CCD upon initialization, a signal ICG is applied to the clear portions 13 to clear charges in the linear CCD 17, and charges are transferred while generating pulses CCDCLR in synchronism with clocks CK 1 until charges from the linear CCD 17 go around the ring CCD 18 once. On the other hand, when no pulse CCDCLR is output, i.e., when the pulse CCDCLR is kept at LOW level, as shown in the lower chart of the signal CCDCLR in Fig. 5, every time charges go around the ring CCD 18, they are added to those transferred from the linear CCD 17. In the arrangement shown in Fig. 2, since the number of cells in the ring CCD and that of the linear CCD are equal to each other, i.e., 12, charge transfer to the linear CCD 17 is performed every 12 clocks. Hence, charges accumulated by identical accumulation portions are added to each other. How to pick up an output signal OS will be explained below. The output signal OS has a voltage corresponding to charges in the CCD cell, i.e., a voltage corresponding to the intensity of light detected by the sensor array 11. For this reason, an image projected onto the sensor array is recognized as the voltage level of the signal OS. The distance to an object is measured by a principle to be described later using this image. Since charges accumulated in correspondence with the intensity of light detected by the sensor array represent the intensity of light, charges accumulated in the cell or a voltage output in correspondence with the accumulated charges will be simply referred to as light components. For example, when light projected from the IRED and reflected by an object is detected, and charges corresponding to the detected light are accumulated in the CCD, the accumulated charges or an output voltage corresponding to these charges will be simply referred to as "reflected light components" hereinafter. On the other hand, charges corresponding to external light or an output signal corresponding to these charges will be simply referred to as "external light components" hereinafter. In the normal mode, charges in the CCD cell 10 B are transferred to the floating portion 9 B in response to a transfer pulse CK A . Before this transfer operation, the voltage in the floating portion is set to RD in response to a reset signal RS 1 . When charges in the cell 10 B are transferred to the cell 9 B in response to a transfer pulse CK A , a voltage is output from the amplifier 101 in correspondence with the amount of transferred charges. In Fig. 5, assume that the cell 10 B initially stores a signal in the light projection OFF period. Therefore, as the signal OS, a signal corresponding to the intensity of ambient light, i.e., external light, is output. Thereafter, charges in the cell 9 B are transferred to the cell 8 B in response to a transfer pulse CK B . Subsequently, the cell 9 B is reset to the level RD by a reset signal RS 1 . When charges corresponding to the intensity of light detected by the sensor array in the IRED ON state are transferred from the cell 10 B to the cell 9 B in response to the next clock of the transfer pulse CK A , a voltage corresponding the charges transferred to the cell 9 B , i.e., (external light components + reflected light components of projected light), is output in turn as the signal OS. More specifically, in the normal mode, charges in the ring CCD 18 are transferred each clock, and an output corresponding to (external light components) and an output corresponding to (external light components + reflected light components) are alternately obtained as the output signal OS. On the other hand, when the reset signal RS 1 is driven in the difference mode, the signal OS is reset to the level RD while a signal corresponding to external light components is transferred to the cell 9 B . More specifically, the signal OS is output with reference to charges corresponding to external light components as the reference level RD. Thereafter, when charges (level RD) in the cell 9 B are transferred to the cell 8 B in response to a transfer pulse CK B , the potential of the signal OS becomes higher by external light components lost by transfer than the level RD. Subsequently, when charges corresponding to (external light components + reflected light components) arrive at the cell 9 B in response to a transfer pulse CK A , a signal corresponding to only (reflected light components) is output as a signal OS lower than the level RD. Therefore, when the reset signal is driven in the difference mode, only reflected light components corresponding to projected light are output as the signal OS upon every other transfer operations. On the other hand, if charges sequentially transferred from the cell 9 B to the cell 8 B go around the ring CCD 18 several times and are accumulated, charges that overflow the capacity of the skim element 5 B (SK 1 ) flow into and are stored in the cell DC 1 . Furthermore, charges in the cell 5 B are transferred to the cell 4 B with a smaller capacity in response to the next transfer pulse. Charges that overflow from the cell 4 B flow into the cell DC 2 , and are added to charges transferred from the cell DC 1 . More specifically, charges stored in the cell 6 B decrease by the capacity of the cell 4 B , and thereafter, are stored in the cell DC 2 . Note that the capacity of the cell 4 B is abbreviated as Cskm. In response to the next transfer pulse CK A , charges in the cell DC 2 are supplied to the input terminal of the amplifier 102, and charges in the cell 4 B are transferred to the cell 3 B . Prior to this transfer operation, the input terminal of the amplifier 102 is reset by a reset signal RS 2 . When charges in the cell DC 2 are transferred to the input terminal of the amplifier 102 in response to the transfer pulse CK A , charges (external light components -Cskm) that overflow from the cell 4 B are detected as the voltage of a skim output signal SKOS. When it is determined that this voltage level is higher than a predetermined value, the cell 3 B is cleared by a clear signal SKCLR. In response to the next transfer pulse CK B , charges at the input terminal of the amplifier 102 and those in the cell 3 B are transferred to the cell 2 B . At this time, if the cell 3 B has been cleared, charges corresponding to only (external light components -Cskm) are accumulated in the cell 2 B . In response to the next transfer pulse CK A , charges corresponding to (external light components + reflected light components - Cskm) are transferred in turn to the input terminal of the amplifier 102. At this time as well, the Cskm components transferred from the cell 4 B are cleared from the cell 3 B . For this reason, charges corresponding to (external light components + reflected light components - Cskm) are transferred to the cell 2 B . In this manner, when the amount of charges transferred to the skim portion 19 exceeds a predetermined amount, a predetermined amount of charges is skimmed therefrom. With this operation, even when dark currents are accumulated to increase while charges go around the ring CCD 18, they can be removed. For this reason, the signal to noise (S/N) ratio of signals that go around the ring CCD is free from deterioration. With the above-mentioned arrangement, since the ring CCD 18 is arranged on a device, and charges can be added when they go around the ring CCD 18, the S/N ratio can be improved. Also, since the skim portion 19 for skimming external light components from the ring CCD 18 is arranged, the ring CCD 18 can be prevented from being saturated due to addition of charges, and the S/N ratio can be further improved. Fig. 6 shows an example of the layout of the distance measuring device shown in Fig. 1 in correspondence with Figs. 25A and 25B that show the prior art. Referring to Fig. 6, light-receiving portions 71 and 72 correspond to the light-receiving lenses 101 and 102 shown in Fig. 1. A light projecting portion 73 corresponds to the projection lens 103 shown in Fig. 1, and is disposed at a position offset from a straight line representing the base length formed by the light-receiving portions 71 and 72. Although not shown in Fig. 6, a sensor array of the light-receiving portion 71 is disposed along the same straight line as a sensor array of the light-receiving portion 72, so that the longitudinal direction of the sensor array of the light-receiving portion 71 agrees with that of the sensor array of the light-receiving portion 72. Fig. 6 is illustrated in the same scale as in Figs. 25A and 25B, and a size reduction of the device can be attained in this embodiment using the device shown in Fig. 1. In Fig. 6, the light-receiving portions 71 and 72, and the light projecting portion 73 can be reduced in size as compared to those shown in Figs. 25A and 25B for the following reason. More specifically, the performance of a device that receives a projected signal and performs a distance measurement is determined by the S/N ratio between the signal and noise. In this embodiment, since no circuit noise is generated upon accumulating signals unlike in the conventional device, and only signal components are skimmed, noise components become very small. Therefore, since signal components can be decreased accordingly to obtain the same S/N ratio as in the conventional device, a size reduction of the light-receiving portions 71 and 72, and the light projecting portion 73 can be realized. Also, in Fig. 6, the base length formed by the light-receiving portions 71 and 72 can be shortened as compared to those in Figs. 25A and 25B for the following reason. More specifically, when a PSD is used as a sensor as in the conventional device, the moving amount of an image must be detected within the total length of the sensor. For this reason, if a relatively large moving amount of an image on the sensor cannot be assured, the distance measurement precision corresponding to the moving amount is impaired. In contrast to this, in this embodiment, since the light-receiving portion uses a sensor array, each sensor can have a small width, and can sensitively detect movement of an image. That is, this arrangement is equivalent to an arrangement using a single sensor which is divided into a plurality of sensors to attain high resolution. For this reason, the moving distance of an image can be obtained with high precision, i.e., the distance measurement precision can be improved, and the base length can be shortened. In Fig. 6, even when the light projecting portion 73 is offset from the base length formed by the light-receiving portions 71 and 72, the entire arrangement is designed, so that a received light image 82 includes the height direction of a sensor with respect to a sensor array 81, as shown in Fig. 7. Hence, the distance measurement can be realized without sacrificing any performance. As can be understood from this fact, in this embodiment, the degree of freedom in the layout of the light projecting portion with respect to the light-receiving portions is high, thus allowing an efficient layout even in a small apparatus such as a camera. <Distance Measuring Range> The distance measuring range of the distance measuring apparatus of this embodiment will be described below. A case will be described below wherein the sensor array is short. Fig. 8 illustrates objects a, b, and c within the photographing region of a camera, and the distance measuring region of the distance measuring device indicated by "[" 92 and "]" 91. Note that an arrow 90 represents the relative length of the sensor array described in Figs. 1 and 2. In this case, since the sensor array is short, only object b can be subjected to a distance measurement, and when this distance measuring device is built in a camera to attain focusing control, objects a and c having different distances from that of object b are in an out-of-focus state. Furthermore, when object b is not present, the focusing state of the camera is adjusted to the infinity distance, resulting in a picture in a considerable out-of-focus state. A case will be described below with reference to Fig. 9 wherein the distance measuring range is broadened by increasing the length of the sensor array. In Fig. 9, the distance measuring region of the distance measuring device is indicated by "[" 94 and "]" 93, and the relative length of the sensor array is indicated by an arrow 95. In this case, two sensor arrays respectively output image signals, as shown in Fig. 11B. In this case, the positions of the image signals from the two sensor arrays are offset in the right-and-left direction by amounts corresponding to distances from the camera to objects a, b, and c, and these offset amounts (relative values of the positions) represent the distances. However, when the correlation is calculated using the entire image signal, perspective conflict occurs, and the distance measurement is disabled. On the other hand, although a method of narrowing the correlation calculation region upon occurrence of perspective conflict has been proposed, processing is complicated. In this case, only the image signals of objects a, b, and c are illustrated. However, in practice, since a background pattern also appears as an image signal, it is very difficult to specify a region that does not cause any perspective conflict. Fig. 10 shows a case wherein the light projecting portion uses a plurality of light-emitting portions that emit multiple beams in the distance measuring device shown in Fig. 1. Projected images 61, 62, and 63 are selectively or simultaneously projected from the light projecting portion, and appear as signals in regions 98, 99, and 100 in the sensor array. The distance measuring device of this embodiment senses an image in both the light-projection ON and OFF periods. Image signals in the light-projection ON period appear, as shown in Fig. 11A, and image signals in the light-projection OFF period appear, as shown in Fig. 11B. Since the distance measuring device of this embodiment detects the position of a signal obtained in the light-projection ON period, the relative values of the positions of the image signals are calculated by performing a correlation calculation using image signals shown in Fig. 11C as the difference between those shown in Figs. 11A and 11B. As can be seen from Fig. 11C, the image signals shown in Fig. 11C include only information of the distances to objects a, b, and c, and pattern information of objects a, b, and c is canceled. That is, the distance measuring region is specified by image signals from the regions 98, 99, and 100 even when the region to be subjected to distance measurement is not specified. By selectively projecting light spots, the regions 98, 99, and 100 can be arbitrarily selected, and a distance measurement can be attained even when a correlation calculation region is not selected. Even when a plurality of light beams are simultaneously emitted, peaks of correlation values are merely generated at three positions, and the distances to objects a, b, and c can be obtained by calculating the distances on the basis of the relative values of the positions of the respective peak values. When the luminance of external light is high, and the integral time is shortened, or when the object is far and has a low reflectance, it is often difficult to detect signals shown in Fig. 11C since the projected light signal obtained by a single measurement is very weak. Therefore, in order to realize the above-mentioned effect, a device preferably comprises a function of adding charges and skimming a predetermined amount of charges using the ring CCD, as has been described above with reference to Fig. 2. <Principle of Correlation Distance Measurement> The distance measuring device of the present invention performs correlation distance measurements by calculating the correlation between images sensed by two sensor arrays, and the calculating the distance on the basis of the relative positional relationship between the images on the two sensors. The principle of correlation distance measurement will be briefly described below. Fig. 22A shows the layout of two line sensors 1 and 2 serving as light-receiving portions, and a light-emitting portion. Line sensors 1 and 2 detect images imaged by a light-receiving lens (not shown). In this case, the relative positions of images differ depending on the base length of the two line sensors, as shown in Fig. 22B. On line sensor 1, images are formed at the right end in correspondence with objects X1 and X2. On line sensor 2, an image of object X1 is formed at nearly the central position, and an image of object X2 is formed at the left end. Based on offset amounts y1 and y2 between the positions of the images on the two sensors, the distances to objects X1 and X2 are determined. <Arrangement of Distance Measuring Device and Distance Measurement Procedure> The distance measuring device that realizes the above-mentioned distance measurement procedure and principle have an arrangement shown in Fig. 19. Referring to Fig. 19, a control unit 1901 controls the entire device, and controls a sensor unit 1905 and the IRED 104, as shown in Fig. 4 or 5 above, thus picking up the output signal OS from the CCD. The sensor unit 1905 has the arrangement shown in Fig. 1, and the intensities of light detected by the sensor arrays 105 and 106 are circulated and accumulated as charges through the ring CCDs 113 and 114. Outputs OS 1 and OS 2 from the two CCDs 113 and 114 represent images projected onto the sensor arrays. A correlation calculation unit 1902 calculates a distance yc between an image of an object detected by the sensor array 105 and an image of an object detected by the sensor array 106 on the basis of a principle to be described later. A distance table 1903 registers the distance yc and a distance L to an object corresponding to the distance yc. The distance table 1903 converts the distance yc between the images calculated by the correlation calculation unit 1902 into the distance L to an object. An optical system drive unit 1904 drives the optical system in correspondence with the calculated distance L to the object, thus attaining a focusing operation. The procedure of measuring the distance using the above-mentioned arrangement will be explained below. The correlation calculation unit 1902 includes a circuit shown in Fig. 20. As the output signal OS 2 , pixels of images respectively detected in the IRED ON and OFF periods are alternately output in units of clocks. In this case, the reset signal RS 1 is driven at the timing of the difference mode. That is, the signal OS 2 represents a value obtained by subtracting the value of an image signal obtained in the IRED OFF period from the value of an image signal obtained in the IRED ON period, and corresponds to that shown in Fig. 11C. At the same timing as the transfer timing of a signal to a shift register 202, the contents of the shift register 202 are shifted. The number of digits of the shift register 202 is equal to that of the sensor array. In this manner, the shift register 202 stores only reflected light components corresponding to the IRED ON periods, i.e., the signal shown in Fig. 11C. This shift register is assumed to be a multi-value shift register, one digit of which indicates the output level of the output signal OS. In the case of a binary shift register, one digit is constituted by a plurality of bits. The signal OS 2 has been described, and the same applies to the signal OS 1 . However, a shift register 201 can shift its contents by a required number of digits to calculate the correlation. The shift register 201 receives a value y from a counter 204, and shifts its contents to the right by y digits. OS 1 (y) represents the signal OS 1 which has been shifted by y digits. A subtracter 203 subtracts the contents of the shift register 201 from those of the shift register 202 in units of digits. In Figs. 19 and 20, each sensor array has 200 pixels, and the number of digits of each shift register is also 200. For example, when the signal OS 2 from line sensor 2 is expressed by a curve 2102 in Fig. 21, and the signal OS 1 from line sensor 1 is expressed by a curve 2101 in Fig. 21, the signals OS 1 and OS 2 are respectively temporarily stored in the shift registers 201 and 202, and thereafter, Z(y) = OS 2 - OS 1 (y) is calculated by the subtracter 203. Since the initial value of the shift amount y is zero, Z(0) is initially obtained. Since Z(y) is obtained in units of digits, a value representing the correlation is obtained by adding the absolute values of Z(y) for all the digits. The count value of the counter is incremented by 1 in response to a clock to set y = 1, thereby shifting data in the shift register 201 by one digit. In the shift register 201, data are shifted to the right by one digit, i.e., one pixel of the sensor array, and a curve 2103 shown in Fig. 21 is obtained. On the other hand, since the signal OS 2 is stored in the shift register 202 without being shifted, when Z(1) = OS 2 - OS 1 (1) is calculated by the subtracter 203, the value Z(1) at that time is obtained. The obtained value is stored and held. By executing this step sequentially, values Z(0) to Z(100) shifted by 100 digits to the right are obtained. Of these values Z(0) to Z(100), a minimum value is obtained, and a shift amount y corresponding to this minimum value becomes the distance yc between the image sensed by the sensor array 105 and the image sensed by the sensor array 106. For example, if Z(50) yields a minimum value, it is determined that the signals OS 1 and OS 2 are offset by 50 pixels, and yc = 50 is obtained. By performing a correlation calculation between the two image signals OS 1 and OS 2 , and searching for y with the highest correlation, the offset amount between the two images is detected. A distance corresponding to the obtained distance yc is read out from the distance table 1903, thereby obtaining the distance L from the distance measuring device to the object. Note that the relationship between yc and the distance L to the object is measured in advance, and is stored in advance in the distance table 1903. This procedure will be described below with reference to the flow chart shown in Fig. 28. Fig. 28 shows the control procedure of the control unit 1901 upon executing the above-mentioned distance measurement. In step S501, the ON/OFF operation of the IRED is started. The ON/OFF timing is as shown in Fig. 4. In step S502, the difference mode is selected. In the difference mode, the signal RS 1 is driven in the difference mode. Therefore, as the output signal OS 1 , a signal with reference to the signal level of an image sensed in the IRED OFF period is output. In step S503, the respective signals are controlled, as described above with reference to Figs. 4 and 5. More specifically, image signals are circulated through the ring CCDs 113b and 114b, while the signals in the linear CCDs 113a and 114a are added in synchronism with the circulation, and signal components corresponding to dark currents are removed by the skim portions 117 and 118. In this manner, while signal charges are accumulated, the output signal OS is monitored and is compared with a predetermined value. When the signal OS exceeds the predetermined value, the IRED is turned off in step S504. Finally, in step S505, the distance to the object is measured using the correlation calculation unit 1902 and the distance table 1903. In the above description, the correlation calculation is performed using Z(y) = OS 2 - OS 1 (y). However, the present invention is not limited to this. For example, a correlation calculation may be performed using W(y) = OS 2 x OS 1 (y). In this case, the shift amount that yields a maximum sum of W(y) for the respective digits corresponds to a maximum correlation between two images. In this manner, the distance to an object can be measured. In the distance measuring device of this embodiment, the correlation between two images sensed by the two sensor arrays is calculated, and the distance to an object is measured based on the offset amount between the two images, i.e., the relative positional relationship therebetween. For this reason, even when the barycentric position of an image on the sensor array is offset, high-precision distance measurement can be realized. Since the ring CCDs are used, the S/N ratio of the detected image signal can be improved, thus allowing a size reduction of the device. Images corresponding to both the light-projection ON and OFF states are detected, and the difference between these images is used for determining the relative positional relationship of an object. For this reason, when light is projected onto an object, the distance to which is to be measured, the distance to the object can be precisely measured without causing any perspective conflict. An example in which the two ring CCDs shown in Fig. 1 have opposite charge rotation directions will be explained below with reference to Fig. 12. Referring to Fig. 12, reference numerals 131 and 132 denote first and second sensor arrays; 133 and 134, first and second charge accumulation units; and 135 and 136, first and second charge transfer units. In a ring CCD 137 of the first charge transfer unit 135, charges go around counterclockwise, and in a ring CCD 138 of the second charge transfer unit 136, charges go around clockwise. Fig. 13B shows image signals obtained in this arrangement. Referring to Fig. 13B, L indicates an image signal from the ring CCD 137, and R indicates an image signal from the ring CCD 138. In Fig. 13B, the solid curves represent image signals obtained when the transfer efficiency of the ring CCDs 137 and 138 is 100%. However, if the transfer efficiency of the ring CCDs 137 and 138 is lower than 100%, image signals gradually leak to the transfer stages on the rear side, and image signals indicated by the broken curves are obtained. As a result, the barycentric positions of images are offset inwardly, as indicated by arrows (→, ←), and a wrong distance is obtained. On the other hand, since projected light spot images corrupt in opposite directions, errors are generated upon calculating the correlation. On the other hand, when the two ring CCDs have the same charge transfer direction, as shown in Fig. 1, even when the transfer efficiency of the ring CCDs is lower than 100%, as shown in Fig. 13A, since the barycentric positions of image signals L and R move in the same direction, correct distance information can be obtained. Therefore, image signals need not be corrected by a calculation. Furthermore, since the image signals of projected light spots change similarly, the correlation can be calculated using these signals. As described above, when the two ring CCDs have the same rotation direction, as shown in Fig. 1, the distance measurement result is not influenced by signal leakage. [SECOND EMBODIMENT] Another embodiment of the present invention will be described below. In this embodiment, a multi-point distance measurement with a broad field of view is realized without increasing the sensor array length. Referring to Fig. 14, reference numerals 151 and 152 denote light-receiving lenses each having a plurality of (three) optical axes, and images corresponding to the three optical axes are received on each of sensor arrays 154 and 155 (corresponding to the sensor arrays 105 and 106 in Fig. 1). Reference numerals 156 and 157 denote charge accumulation units (corresponding to the charge accumulation units 109 and 110 in Fig. 1); and 158 and 159, charge transfer units (corresponding to the charge transfer units 113 and 114 in Fig. 1) such as CCDs having ring-shaped portions. Reference numeral 153 denotes a projection lens (corresponding to the projection lens 103 in Fig. 1); and 160, a light-emitting element which has a plurality of (three) light-emitting portions and can project light spots in three directions via the projection lens 153. The light-emitting element 160 selectively or simultaneously projects light spots under the control of a control unit. Image signals on the sensor arrays 154 and 155 in the distance measuring device shown in Fig. 14 will be described below with reference to Figs. 15A to 15E. Fig. 15A shows an image signal from the central optical axis of each of the light-receiving lenses 151 and 152, and a hatched projecting portion 181 represents the reflected light signal of a projected light spot. Fig. 15B shows an image signal from the left optical axis of each of the light-receiving lenses 151 and 152, and a projecting portion 182 represents the reflected light signal of a projected light spot. Fig. 15C shows an image signal from the right optical axis of each of the light-receiving lenses 151 and 152, and a projecting portion 183 represents the reflected light signal of a projected light spot. Image signals shown in Figs. 15A to 15C formed by external light other than the projecting portions 181, 182, and 183 are different from each other since the three optical axes have different incident angles on each of the sensor arrays 154 and 155. More specifically, an image signal corresponding to the light-projection OFF period is obtained by excluding the projecting portions 181, 182, and 183 from the entire image signals shown in Figs. 15A to 15C. Since an actual image signal is obtained by superposing the signals shown in Figs. 15A to 15C, as shown in Fig. 15D, and external light 184 is a signal as a pile of perspective conflicts, this image signal cannot be used in distance measurements. However, an image signal obtained by calculating the difference between signals corresponding to the light-projections ON and OFF periods has no external light components, as shown in Fig. 15E, and the distances of the respective projected light spots can be calculated using this signal. The arrangement for realizing this calculation is the same as that shown in Figs. 19 and 20. Note that the length of each of the sensor arrays 154 and 155 is set not to substantially overlap the angles of the three optical axes. For this reason, a light spot projected from one point of the light-emitting element 160 is received on each of the sensor arrays 154 and 155 from only one of three portions (corresponding to the three optical axes) of each of the light-receiving lenses 151 and 152. Therefore, since only one image is generated in correspondence with one light spot, the distance can be easily calculated. Even when a plurality of images are generated by one light spot, since the three optical axes of each of the light-receiving lenses 151 and 152 have different angles, the images of the projected light spot are generated at sufficiently separated positions on each of the sensor arrays 154 and 155. Therefore, an image to be subjected to a correlation calculation can be easily extracted from each of the sensor arrays 154 and 155. Another arrangement of the charge transfer units 113 and 114 shown in Fig. 1 will be explained below with reference to Figs. 16 and 17. This example can be applied to all the embodiments other than this embodiment. In the arrangement shown in Fig. 16, a charge transfer unit 161 is constituted by a linear CCD 161a which opposes the sensor array 154 and the charge accumulation unit 156, a linear CCD 161b which opposes the sensor array 155 and the charge accumulation unit 157, and a ring CCD 161c which is formed into an annular shape to be contiguous with the linear CCDs 161a and 161b. The ring CCD 161c may have an initialization circuit, a skim portion, an OS signal output portion, and the like, which are described above with reference to Fig. 1 and are used commonly to charge signals from the two sensor arrays 154 and 155. In the ring CCD 161c, signals received from the sensor array 154 via the linear CCD 161a, and signals received from the sensor array 155 via the linear CCD 161b may be independently and sequentially added. In this manner, only one ring CCD can be used as long as it has cells that can accumulate signals from the two sensor arrays. In the arrangement shown in Fig. 17, a charge transfer unit 171 is formed into a single ring shape as a whole, so that a portion opposing the sensor array 154 and the charge accumulation unit 156, and a portion opposing the sensor array 155 and the charge accumulation unit 157 are contiguous with each other. The charge transfer unit 171 may also have an initialization circuit, a skim portion, an OS signal output portion, and the like, which are described above with reference to Fig. 1 and are used commonly to charge signals from the two sensor arrays 154 and 155. In the charge transfer unit 171, signals from the sensor array 154, and signals from the sensor array 155 may be independently and sequentially added. In this manner, a single ring CCD having no linear CCD portion can be used as long as charges from the sensor arrays are added to those in the CCD. Fig. 18 shows an example in which a plurality of light projecting portions 211 and 214 used for multi-point distance measurements are disposed at positions offset from the base length, as shown in Fig. 6. The distance measuring device of this embodiment has a high degree of freedom since it measures the distance on the basis of the positional relationship between images on two light-receiving portions. Hence, a flexible layout shown in Fig. 18 is allowed, and the device can be easily built in a compact equipment such as a camera. As described above, according to the present invention, since two sensor arrays are used, even when an image of projected light is partially omitted, errors can be canceled, and accurate distance measurements can be attained. Also, the degree of freedom in layout of the device can be increased, and a size reduction of the device can be attained. [THIRD EMBODIMENT] The operation of a distance measuring device according to the third embodiment of the present invention will be described below. For example, the control procedure for measuring the distance to an object in, e.g., a camera will be explained below with reference to Fig. 27. The device of this embodiment has the same arrangement as in the first embodiment shown in Figs. 1 to 5 and Fig. 19, and Figs. 27 to 29 show the control sequence of the control unit 1901. When the distance measurement is started, it is checked in step S101 if the amount of charges from the sensor arrays 101 and 102 per light projection, which amount is determined by the luminance of external light and the electronic shutter function of the clear portions 107 and 108, is smaller than the predetermined charge skimming amount in the skim portions 117 and 118. If Y (YES) in step S101, the ring CCDs 113b and 114b are allowed to add charge signals corresponding to reflected light of the projected light spot, and the flow advances to step S102. On the other hand, if N (NO) in step S101, the flow advances to step S104. Note that light, reflected by an object, of the projected light spot will also be simply called a projected light spot hereinafter. In step S102, a distance measurement is performed on the basis of the correlation using an image signal output as the difference between images corresponding to the light-projection ON and OFF periods (see Fig. 28), and the flow advances to step S103. It is checked in step S103 if the distance measurement value is obtained in step S102. When a signal of the projected light spot cannot be obtained since, for example, the object to be measured is located at a position separated by a far distance or has a low reflectance, it is determined that the distance measurement is impossible to attain, and the flow advances to step S104. Otherwise, the distance measurement ends. In step S104, the projection of a light spot is stopped, an image signal of the object to be measured is obtained without projecting any light spot, and a distance measurement is performed based on the correlation (see Fig. 29) to obtain a distance measurement value, thus ending the distance measurement. In this case, charges are neither circulated through the ring CCDs nor added to charges from the linear CCDs. Fig. 28 is a flow chart showing the operation of the light-projection distance measurement (first processing) executed in step S102 in Fig. 27. This distance measurement method is nothing but a method executed by the device of the first embodiment. In step S501, the ON/OF projection operation of a light spot is started. In step S502, the output mode of the output signal OS shown in Fig. 5 is switched to the difference mode. In step S503, the ring CCDs 113b and 114b add charges in synchronism with the ON/OFF periods of the projected light spots. The ring CCDs 113b and 114b are prevented from being saturated by skimming external light components using the skim portions 117 and 118. When the difference output OS exceeds a predetermined amount while monitoring the signal output OS, the projection operation is turned off in step S504. In step S505, the correlation of the projected light spot signals is calculated based on the difference outputs output from the two light-receiving portions, thus obtaining a distance measurement value (correlation distance measurement). More specifically, the distance to the object to be measured is calculated using the principle of the trigonometric measurement on the basis of the difference between the relative values of the positions on the two sensor arrays. Fig. 29 is a flow chart showing the operation of the non-projection distance measurement (second processing) executed in step S104 in Fig. 27. In step S601, the output mode of the output signal OS in Fig. 5 is switched from the difference mode to the normal mode. In step S602, the charge skimming operation is inhibited. That is, a charge in the cell 3 B is not cleared irrespective of the value of the signal SKOS. In step S603, charges go around the ring CCDs 113b and 114b once to obtain image signals for one light projection from the sensor arrays 105 and 106 as output signals OS. In step S604, the correlation of the image signals obtained by the two sensor arrays in step S603 is calculated, thereby obtaining a distance measurement value (correlation distance measurement). More specifically, the distance to the object to be measured is calculated using the principle of the trigonometric measurement on the basis of the relative values of the positions on the sensor arrays of the signals from the two sensor arrays. This step is executed in the same manner as in Fig. 28. Note that the reason why signal charges are caused to go around the CCDs once is to prevent generation of distance measurement errors due to an offset of image signals and to assure accurate distance measurements. The correlation distance measurement method in step S505 in Fig. 28 and in step S604 in Fig. 29 will be explained below. In this correlation distance measurement, after the signal OS is read out from the output portion 20 shown in Fig. 2, A/D conversion is started in response to a signal SH to read out data for a round of the ring CCD 18. Furthermore, after corresponding signals in the cells 1 A and 2 A in the linear CCD 17 are cleared, a correlation calculation is performed to obtain the distance to the object to be measured. The reason why the corresponding signals in the cells 1 A and 2 A in the linear CCD 17 are invalidated is that they need not be added since no charges are shifted to these cells, i.e., since no charges are transferred from the sensor array 11 even when charges are to be added to those in the ring CCD 18. The same applies to the first embodiment. As described above, reflected light of light emitted by the light projecting portion is sensed, and when the amount of charges to be transferred to the CCD is smaller than the capacity of the skim element, the light projection of the IRED is stopped. Otherwise, an image signal is obtained using the IRED in the same manner as in the first embodiment. The distance to the object is measured on the basis of image data of the object obtained in this manner. For this reason, the distance can be accurately measured irrespective of an offset of the barycentric position of an image caused by the use of the IRED, and distance measurements can be prevented from being disabled due to perspective conflict, thus allowing accurate distance measurements. When sufficient reflected light cannot be obtained even by projecting light, e.g., when the object is present at a very far position or when light projected by the IRED is not effective since the object has a very low reflectance, since the received light amount is small, signal charges must be circulated several times through the ring CCD to accumulate signals in the method of the first embodiment. For this reason, the offset amount of an image generated upon transferring charges through the cells of the CCD becomes very large, thus disturbing accurate distance measurements. Hence, an output signal is obtained without projecting any light and circulating charges, and the distance is measured based on the obtained output signal. For this reason, any offset of an image upon transferring charges through the CCD can be prevented from being accumulated, and accurate distance measurements are guaranteed. <Modification of Third Embodiment> Another embodiment of the present invention will be described below. Fig. 30 shows a distance measuring device in which the device structure shown in Fig. 2 is partially modified, and a portion of the ring CCD 18 is not shown. Fig. 32 is a timing chart of this device. Referring to Fig. 30, reference numeral 71 denotes OFF charge shift portions for shifting charges in the second accumulation portions (OFF charge accumulation portions) 14 to the linear CCD 17 in response to a pulse SH 2 . Reference numeral 72 denotes ON charge shift portions for shifting charges in the first accumulation portions (ON charge accumulation portions) 15 to the linear CCD 17 in response to a pulse SH 1 . As can be seen from the timing chart in Fig. 32, in this embodiment, since the light-emitting element 104 that projects a light spot does not emit light at all, a pulse IRED is kept at LOW level. The timing chart in Fig. 32 is different from that shown in Fig. 4 in that the pulse SH is divided into two pulses (SH 1 and SH 2 ). When a low-pass filter function is enabled (with a low-pass filter), the pulse SH 2 is output at the same timing as the pulse SH in Fig. 4, and the pulse SH 1 is output at the timing of the next pulse CK. With this control, signal charges of a pair of adjacent sensor blocks can be added by the linear CCD 17. Therefore, a wrong distance measurement value can be prevented by the low-pass filter function from being obtained. For example, signal charges from the sensor block S 2 are stored in the charge accumulation portions 14 and 15. Charges in the accumulation portion 14 are transferred to the cell 5 A in response to the pulse SH 2 . Charges in the cell 5 A are transferred to the cell 4 A in response to the next clock. At the same time, charges from the sensor block S 1 are added to those in the cell 4 A in response to the pulse SH 1 . When the low-pass filter function is disabled (without a low-pass filter), the pulses SH 1 and SH 2 are generated at the same timings as those of the pulses SH, and the same operation as in Fig. 4 is performed. The effects with and without the low-pass filter will be explained below with reference to Fig. 31. Referring to Fig. 31, in the case without a low-pass filter, outputs a to e from the five sensor blocks S 1 to S 5 are independently shifted to the linear CCD 17. In the case with a low-pass filter, signal charges from adjacent ones of the sensor blocks S 1 to S 5 of the linear CCD 17 are added to each other (a + b, b + c, c + d, and d + e). Using this image signal, the low-pass filter effect as that obtained when the sensor blocks overlap each other is obtained, and an image signal can be prevented from changing even when spatial frequency components higher than the sensor pitch are received. At this time, outputs to which signal charges from adjacent ones of the sensor blocks S 1 to S 5 are not added may be invalidated in a correlation calculation. With this processing, error-free distance measurements can be assured. Signals transferred to the CCD are processed in the same procedure as in the non-projection distance measurement procedure shown in Fig. 29. Still another embodiment of the present invention will be described below with reference to Figs. 33 and 34. Fig. 33 is a view for explaining the method of amplifying an image signal on the device to emphasize its contrast in the non-projection distance measurement operation using the charge skimming function. Referring to Fig. 33, curves indicated by "once", "twice", "four times", and "eight times" respectively represent image signals of the accumulated charge amounts added by the ring CCDs 113b and 114b. Although the contrast of the image signal increases when charges are added by the ring CCD in this manner, the dynamic range must also be broadened accordingly. If the actual dynamic range is a range a, only signal charges for one light projection are not saturated, and signal charges added twice or more disturb a distance measurement operation. However, it is almost impossible to perform a distance measurement based on the correlation using a signal with such low contrast. In this embodiment, charges are evenly skimmed by the skim portions 117 and 118 from image signals that are circulated through the CCDs 113b and 114b. When charges are added twice, a charge amount apparently in a range b can be output without being saturated, and only the range where the contrast of an image signal added twice is generated can be output as an image signal. Similarly, when the ring CCDs 113b and 114b add charges four times and the charge skimming operation of the skim portions 117 and 118 is performed twice while monitoring the level of the signal output, an image signal output in a range c can be obtained. Likewise, when addition is performed up to eight times, an image signal output in a range d is obtained, and the contrast portion of the image signal is amplified to eight times. As a result, distance measurements based on the correlation can be easily attained. Fig. 34 is a flow chart showing the non-projection distance measurement operation of the distance measuring device of this embodiment. In step S111, the output mode of the output signal OS in Fig. 5 is switched to the normal mode. In step S112, charge signals from the sensor arrays 105 and 106 are shifted to the charge transfer unit (ring CCDs 113b and 114b). In step S113, it is checked by monitoring the outputs from the ring CCDs 113b and 114b if an image signal has a predetermined level or higher. If N in step S113, the flow advances to step S117; otherwise, the flow advances to step S114. Note that the predetermined level indicates a level corresponding to the amount of charges to be skimmed by one skimming operation of the skim portions 117 and 118. In step S117, charges from the sensor arrays 105 and 106 are shifted again to the charge transfer unit (ring CCDs 113b and 114b), and the flow advances to step S113. It is monitored in step S114 if the contrast is high enough to calculate the correlation of the image signals. If Y in step S114, the flow advances to step S115. In step S115, a correlation calculation is performed to obtain a distance measurement value. If it is determined in step S114 that the contrast is insufficient, the flow advances to step S116, and charges for one round of the ring CCDs 113b and 114b are unconditionally skimmed by the skim portions 117 and 118. Thereafter, the flow advances to step S117. By executing the above-mentioned steps, the contrast can be emphasized, and distance measurements based on a correlation can be easily attained. Hence, even when the output from the sensor array has a low contrast, distance measurements can be performed. As another mode of this embodiment, a light projecting portion may be arranged, and when the amount of charges to be removed by the skim portions 117 and 118 is larger than that from the sensor array, the processing shown in Fig. 34 may be selected and executed; otherwise, the processing shown in Fig. 28 may be executed. With this control, even when the luminance of external light is high, distance measurements can be reliably performed. As described above, according to the device of the third embodiment, the two different distance measurement methods, i.e., the first processing executed in a state wherein the ON/OFF operation of the projected light spot is performed, and the second processing executed in a state wherein the projection of a light spot is turned off can be executed by a single device. In the second processing, signal charges are circulated through the ring portion while disabling the projection of a light spot and the operation of the skim portions, and the difference between signals from the two sensor arrays is not calculated. For this reason, distance measurements can be performed even for an object at a far distance or an object with a low reflectance from which a signal of the projected light spot is hardly obtained or when the luminance of external light is high. Even when a distance measurement is performed in the light-projection OFF state, an accurate distance measurement can be performed without using any optical low-pass filter. Furthermore, when a distance measurement is performed in the light-projection OFF state, even when the received light image has a low contrast, an accurate distance measurement can be performed without requiring any high-precision device or arithmetic processing such as correction.

Claims: A distance measuring device comprising: light projecting means (104) for projecting light onto an object to be measured; first and second sensor arrays (105, 106; 154, 155) each array comprising a plurality of sensors, said first and second sensor arrays in operation receiving light beams reflected by the object to be measured via first and second optical paths, and photoelectrically converting the light beams into respective electric signals; characterised in : signal transfer means (113, 114, 161, 167), having at least a portion coupled in a ring shape, for transferring signal charges from the sensors of said first and second sensor arrays; and means (1901, 1902, 1903) for selectively performing a first processing in which two difference signals between signals acquired in ON and OFF states of said light projecting sensor arrays, and the distance to the object to be measured is calculated on the basis of relative values of positions of the difference signals on said first and second sensor arrays, and a second processing in which two signals from said first and second arrays in an OFF state of said light projecting means are respectively obtained, and the distance to the object to be measured is calculated on the basis of relative values of difference signals from said first and second sensor arrays. A device according to claim 1, wherein said signal transfer means comprises first ring-shaped signal transfer means for sequentially adding signals from said first and second array, and second ring-shaped signal transfer means for sequentially adding signals from said first and second sensor array. A device according to claim 1, wherein signals in said first and second ring-shaped signal transfer means have the same direction of rotation. A device according to claim 1, wherein said signal transfer means comprises single ring-shaped signal transfer means. A device according to any preceding claim, further comprising skim means for removing a predetermined amount of signals from the signals transferred by said signal transfer means. A device according to any preceding claim, wherein first sensor array is disposed on the same straight line as said second array, so that the longitudinal direction of said first sensor array agrees with the longitudinal direction of said second sensors array, and said light projecting means is disposed at a position offset from the straight line, and received light images of the light reflected by the object to be measured on said first and second sensor arrays include the sensors of said first and second sensor arrays within a predetermined distance measuring range. A device according to claim 6, wherein said light projecting means comprise a plurality of light projecting elements (211, 214) disposed at positions offset from the straight line. A device according to claim 7, including means for selecting signals on said first and second sensor arrays corresponding to selected ones of the plurality of light projecting elements. A device according to any preceding claim, wherein each of the first and second optical paths has a plurality of optical axes, and the plurality of optical axes are imaged on said first and second sensor arrays to be in operation substantially superposed on each other. A device according to any preceding claim, wherein light-receiving lenses each having a plurality of optical axes are arranged in front of said first and second sensor arrays, and the length of each of said first and second sensor arrays is determined so that the plurality of the optical axes of each light-receiving lens do not receive an identical field of view. A device according to claim 1, wherein, in the first processing, the signals are circulated through the ring portion only once. A device according to any preceding claim, further comprising: pairs of signal accumulation means (109, 110), parallelly disposed between the sensors of said first and second sensor arrays and said signal transfer means, for temporarily holding signals transferred from said first and second sensor arrays to said signal transfer means, first signal accumulation means of each of said pairs of signal accumulation means for holding signals obtained from said first and second sensor arrays in the ON state of said light projecting means, and second signal accumulation means thereof for holding signals obtained from said first and second sensor arrays in the OFF state of said light projection means; and pairs of signal shift means (111, 112), each pair including ON signal shift means for shifting the signal accumulated in said first signal accumulation means to said signal transfer means, and OFF signal shift means for shifting the signal accumulated in said second signal accumulation means to said signal transfer means, and wherein after signals are shifted from said OFF signal shift means to said signal transfer means, said signal transfer means is advanced by one stage, and signals are shifted from said ON signal shift means to said signal transfer means, so that signals of adjacent sensors of said first and second sensor arrays can be added to each other by said signal transfer means. A device according to claim 12, wherein the output of a stage to which no signals are shifted in said signal transfer means is invalidated.

Inventors: EGAWA AKIRA, EGAWA, AKIRA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1996
Main classification: G01S17
IPC codes: G01S17, G01S7