The present invention is related to a method that obtains pairs of images having parallax by photographing a subject with two imaging means, and measures the distances of points within the images based on the images.
The present invention is also related to an apparatus for executing the aforementioned distance measuring method.
There are known methods, in which a subject is photographed by two imaging means provided with a predetermined baseline length therebetween to obtain two images having parallax, and the distances of points within the images are measured based on the images, as disclosed in Japanese Unexamined Patent Publication No. 2000-283753, for example. This type of distance measuring method is utilized to generate stereoscopic images, and to obtain three dimensional positional data of objects which are the targets of measurement.
However, there are cases in which large errors are generated in the distance data, which are calculated based on amounts of parallax, within a specific range of amounts of parallax within the photographed subject, in the conventional distance measuring methods that employ two imaging means, as described above.
Japanese Unexamined Patent Publication No. 8(1996)-075456 discloses an invention, in which a pair of imaging means are moved slightly, to correct distance data based on shifting of feature points (amounts of movement in units of sub pixels), in order to improve the accuracy of measured distance data. However, this correction is troublesome, and the correcting process is time consuming.
The present invention has been developed in view of the foregoing circumstances. It is an object of the present invention to provide a distance measuring method that employs two imaging means, which is capable of preventing large errors from being generated in a simple manner.
It is another object of the present invention to provide a distance measuring apparatus that can execute the distance measuring method.
A distance measuring method of the present invention is a distance measuring method, for obtaining distance data regarding corresponding points within pairs of images of a subject, which have been obtained by photographing the subject with two imaging means provided with a predetermined baseline length therebetween, based on the amounts of parallax among the corresponding points, characterized by:
a first photography operation being performed with the baseline length at a desired value;
n photography operations being performed after the first photography operation, while varying the baseline length by L(m+1/n), L(m+2/n) . . . L(m+(n−1)/n) at each photography operation, wherein L is a pixel pitch of the imaging means, m is an arbitrary natural number, and n is an integer greater than or equal to 2;
amounts of parallax within a predetermined range common to each photography operation being extracted from among the amounts of parallax which are obtained by the n photography operations; and
the distance data being obtained based on the extracted amounts of parallax.
Note that a technique, in which three or more images having parallax are photographed and distance data is obtained based on corresponding points within these images, is known. In this case as well, if each of the processes described above are administered with respect to pairs of images from among the three or more images, such a method is included in the scope of the present invention.
In the distance measuring method of the present invention, it is desirable for one of the imaging means to be fixed when varying the baseline length. The variations of the baseline length may be decreases or increases in the baseline length.
In the distance measuring method of the present invention, it is also desirable for the extracted amounts of parallax to be subject to a correcting process that compensates for variations due to the differences in baseline lengths; and for the distance data to be obtained based on the processed amounts of parallax.
In the distance measuring method of the present invention, it is further desirable for the value of n to be changed according to one of a desired distance output accuracy and a desired distance output speed.
Meanwhile, a distance measuring apparatus of the present invention comprises:
two imaging means, which are provided with a predetermined baseline length therebetween; and
calculating means, for obtaining distance data regarding corresponding points within pairs of images of a subject, which have been obtained by photographing the subject with the two imaging means, based on the amounts of parallax among the corresponding points; characterized by further comprising:
moving means, for relatively moving the two imaging means so as to perform n photography operations while varying the baseline length by L(m+1/n), L(m+2/n). . . L(m+(n−1)/n) at each photography operation, wherein L is a pixel pitch of the imaging means, m is an arbitrary natural number, and n is an integer greater than or equal to 2, after a first photography operation, during which the baseline length is set at a desired value, is performed; and
the calculating means being configured to extract amounts of parallax within a predetermined range common to each photography operation from among the amounts of parallax which are obtained by the n photography operations and to obtain the distance data based on the extracted amounts of parallax.
Here as well, the variations of the baseline length may be decreases or increases in the baseline length.
Note that in the distance measuring apparatus of the present invention, it is desirable for the moving means to move one of the imaging means, while maintaining the other imaging means in a fixed state.
It is describable for the distance measuring apparatus of the present invention to further comprise:
correcting means, for administering a correcting process that compensates for variations due to the differences in baseline lengths on the extracted amounts of parallax.
There are cases in which large errors are generated in distance data, which are calculated based on amounts of parallax, within a specific range of amounts of parallax within the photographed subject in distance measuring methods that employ two imaging means. The range of amounts of parallax at which these large errors are generated appear periodically at periods corresponding to the pixel pitches of the imaging means.
The distance measuring method of the present invention was developed in view of the foregoing fact. That is, a first photography operation is performed with the baseline length set at an arbitrary value. Thereafter, n photography operations are performed, while varying the baseline length by L(m+1/n), L(m+2/n) . . . L(m+(n−1)/n) at each photography operation, wherein L is a pixel pitch of the imaging means, m is an arbitrary natural number, and n is an integer greater than or equal to 2. Then, amounts of parallax within a predetermined range common to each photography operation are extracted from among the amounts of parallax which are obtained by the n photography operations. Finally, the distance data are obtained based on the extracted amounts of parallax. Therefore, amounts of parallax that do not result in large errors in the distance data being generated can be utilized to obtain the distance data, by setting the predetermined range appropriately.
Note that in the distance measuring method of the present invention, a configuration may be adopted, in which one of the imaging means is fixed while varying the baseline length. In this case, the origin of a three dimensional space can be correlated to the fixed imaging means. Therefore, combining of amounts of parallax and combining of distance data, to be described later, can be facilitated.
In addition, in the distance measuring method of the present invention, a configuration may be adopted, in which the extracted amounts of parallax are subject to a correcting process that compensates for variations due to the differences in baseline lengths; and the distance data are obtained based on the processed amounts of parallax. In this case, errors being generated due to the changes in baseline lengths can be prevented, and it becomes possible to obtain accurate distance data.
In the distance measuring method of the present invention, a configuration may be adopted, wherein: the value of n is changed according to one of a desired distance output accuracy and a desired distance output speed. In this case, realization of the desired distance output accuracy or the desired distance output speed can be facilitated. That is, if the value of n is increased, the number of photography operations increases. Therefore, the amount of time required until measured distances are ultimately output becomes long, and the distance output speed decreases. However, the greater the value of n is, amounts of parallax that have smaller amounts of error can be extracted and utilized, and therefore the distance output accuracy is improved. In contrast to the above, if the value of n is decreased, the distance output speed is improved, while the distance output accuracy deteriorates. Because of these trends, realization of the desired distance output accuracy or the desired distance output speed can be facilitated by setting the value of n to be large in the case that the desired distance output accuracy is high, and by setting the value of n to be small in the case that the desired distance output speed is high.
As described above, the distance measuring apparatus of the present invention comprises:
the two imaging means, which are provided with the predetermined baseline length therebetween; and
the calculating means, for obtaining distance data regarding corresponding points within pairs of images of a subject, which have been obtained by photographing the subject with the two imaging means, based on the amounts of parallax among the corresponding points; characterized by further comprising:
the moving means, for relatively moving the two imaging means so as to perform n photography operations while varying the baseline length by L(m+1/n), L(m+2/n) . . . L(m+(n−1)/n) at each photography operation, wherein L is a pixel pitch of the imaging means, m is an arbitrary natural number, and n is an integer greater than or equal to 2, after a first photography operation, during which the baseline length is set at a desired value, is performed; and
the calculating means being configured to extract amounts of parallax within a predetermined range common to each photography operation from among the amounts of parallax which are obtained by the n photography operations and to obtain the distance data based on the extracted amounts of parallax. Therefore, the distance measuring apparatus of the present invention is capable of executing the distance measuring method of the present invention.
A configuration may be adopted, wherein the distance measuring apparatus of the present invention further comprises: the correcting means, for administering a correcting process that compensates for variations due to the differences in baseline lengths on the extracted amounts of parallax. In this case, errors being generated due to the changes in baseline lengths can be prevented, and it becomes possible to obtain accurate distance data.
Hereinafter, embodiments of the present invention will be described with reference to the attached drawings.
The distance measuring apparatus of the first embodiment is applied to a three dimensional measuring apparatus as an example. As illustrated in
As illustrated in
Next, the flow of a distance measuring process performed by the control device 20 will be described with reference to
At step ST3, the control device 20 calculates the amounts of parallax for corresponding points within each pair of images employing the parallax calculating section 23 of
Next, the control device 20 performs the processes of steps ST4 through ST7, employing the recording judgment section 24 of
Next, the control device 20 performs the processes of steps ST8 through ST10, employing the distance calculating section 25 of
Note that the data, which are recorded in the recording section 26 and represent the distances, are utilized to generate data representing the distances from the stereoscopic camera 10, that is, depth data, when obtaining three dimensional positional data regarding each point on the surface of the measurement target 14.
As illustrated here, the errors vary basically periodically corresponding to the amount of parallax, and the period of variation is a single pixel pitch. Hereinafter, the pixel pitch will be referred to as “L”.
In order to employ amounts of parallax having small amounts of errors to calculate distances, first, N is designated to be a positive integer from an amount of parallax related to a pair of images obtained by the first photography operation (refer to the diagram indicated by the number 2 in
The diagram indicated by the number 3 in
Here, the baseline length is changed by L/2 between the first photography operation and the second photography operation. Therefore, the distances indicated by the ranges of the amounts of parallax which are extracted from the diagram indicated by the number 3 in
By combining the amounts of parallax extracted from the diagram indicated by the number 2 in
Next, an alternate embodiment of the present invention will be described with reference to the diagrams indicated by numbers 4 through 7 in
In this case, the amounts of parallax which are extracted and deleted from among the amounts of parallax obtained by the first, second, third, and fourth photography operations are the white rectangles and the hatched portions indicated in the diagrams indicated by numbers 4 through 7 in
Hereinafter, the amounts of parallax which are extracted and deleted in the alternate embodiment will be described in greater detail. Parallax properties G as illustrated in the graph at the upper left of
In the present embodiment, however, the four photography operations are performed from different positions. Therefore, the amounts of parallax which are deleted and extracted are those indicated by the hatched portions and the portions between the hatched portions illustrated in the diagrams indicated by numbers 1 through 4 in
Next, a distance measuring apparatus according to a second embodiment of the present invention will be described with reference to
The apparatus of the second embodiment enables selection of two position photography, four position photography, and the like. A control device 120 is provided with a movement amount setting section 30. The apparatus of the second embodiment differs from that illustrated in
Next, the processes performed by the apparatus of the second embodiment will be described with reference to
On the other hand, in the case that the judgment result at step ST20 is a ¼ pixel, that is, in the case that the value of n is 4, the process proceeds to step ST22. At step ST22, a first photography operation, in which the digital camera 11A is provided at an initial position, a second photography operation, in which the digital camera 11A is moved from the initial position to shorten the baseline length for a distance corresponding to ¼ pixel, that is, L/4, a third photography operation, in which the digital camera 11A is moved from the initial position to shorten the baseline length for a distance of 2L/4, and a fourth photography operation, in which the digital camera 11A is moved from the initial position to shorten the baseline length for a distance of 3L/4, are performed.
After the photography operations from two positions or from four positions are completed, the control device 120 obtains pairs of image data sets formed by image data output from the digital cameras 11A and 11B, at step ST23. Then, threshold values for extracting amounts of parallax are set, corresponding to the movement amounts of the digital camera 11A. The threshold values may be those described previously for photography from two positions and photography from four positions, for example. The process then proceeds to step ST3, which is the same as step ST3 of
Next, a distance measuring apparatus according to a third embodiment of the present invention will be described with reference to
Next, the processes performed by the apparatus of the third embodiment will be described with reference to
Next, at step ST10, the control device 220 judges whether the processes from step ST1 through ST30 have been completed for all pairs of images. In the case that the processes have not been completed for all pairs of images, the process returns to step ST3, and in the case that the processes have been completed for all pairs of images, the process proceeds to step ST32.
At step ST32, the control device 220 obtains data that represent amounts of movement of the digital camera 11A from a reference position (the position during the first photography operation) for the second and subsequent photography operations. In the case that the amounts of movement are specified by an operator via the interface or the like, the movement amount data are obtained form a memory or the like in which the data are stored. Next, at step ST33, the control device 220 corrects the amounts of parallax, which were obtained during each photography operation, were designated as targets for recording, and are stored in the memory, based on the obtained movement amount data. The correction process is the same as that described previously with reference to FIG. 6 and
Thereafter, the control device 220 employs the distance calculating section 25 of
Next, at step ST36, the control device 220 records the combined distance data in the recording section 26 of
Embodiments in which the values of n were set as 2 and 4 have been described. However, the value of n is not limited to these values, and other positive integers having a value of 3 or greater may be applied. Further, the value of m was set as 0 in the embodiments described above. However, the value of m may be any integer having a value of 1 or greater.
Number | Date | Country | Kind |
---|---|---|---|
2009-073555 | Mar 2009 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2010/001992 | 3/19/2010 | WO | 00 | 9/24/2011 |