1. Field of the Invention
The present invention relates to a method for measuring a position and an orientation of an object.
Recently, methods for measuring a position and an orientation of an object in a three-dimensional space have been extensively studied for realizing functions of human eyes by an unmanned mechanism. In such a measuring method, an object is captured as an image by using a camera, and then three-dimensional information is obtained on a position or an orientation of a point, a line segment, or the like which constitutes a contour of an object, e.g., a position or an orientation of a point, or a line segment from the position of the camera.
The above measuring method in a three-dimensional space is used, in particular, in an environment recognition apparatus in a robot. For example, in a movable robot, the robot must be equipped with an environment recognition apparatus for the robot to recognize an environment of the robot, and this environment may include an object. For example, the robot needs three-dimensional information on a position and an orientation of an object when the robot works with the object. Therefore, progress is required in the method for measuring a position and an orientation of an object in a three-dimensional space.
2. Description of the Related Art
Responding to the above requirement, a three-dimensional measuring method according to a so-called stereo method, has been studied. In the stereo method, as shown in FIG. 1, two cameras are arranged apart from each other by a predetermined distance, and a three-dimensional measurement is carried out in accordance with the principle of trigonometrical survey using parallaxes which are obtained from images caught by the cameras. However, it is difficult to determine correspondence between points in the two images, and results of the measurement are unstable.
A light projection method has been proposed as another three-dimensional method. That method is realized by replacing one of the cameras in the above stereo method with a light projector as shown in FIG. 2. For example, a distance from a camera to an object can be obtained based on the position of the camera and a direction of the projected light in accordance with the principle of trigonometrical survey, by projecting a spot light onto the object, and then taking an image of the object including a reflected light from the object. Other patterns of light, e.g., a slit pattern and the like, have been proposed in addition to the above spot light. The above light projection method is superior to the stereo method in reliability because the problem of the difficulty to obtain the correspondence of the points in the two images does not exist. However, the light projection method is not suitable for measurement of a large distance, and is liable to be affected by a surface condition of an object.
Further, a three-dimensional measuring method based on the principle of a moving stereographic view has been proposed as an other three-dimensional measuring method which does not contain the above problems. That technique is disclosed in the Japanese Unexamined Patent Publication Nos. 59-184973 and 63-113782.
In the above three-dimensional measuring method based on the principle of moving stereographic view, a position and an orientation of an object in the environment of a camera is three-dimensionally measured by taking images of the object while moving the camera, as shown in FIG. 3.
For example, a method for measuring a position and an orientation of a line segment based on the above-disclosed principle of moving stereographic view, contains the following steps. First, an image of contours is generated by preprocessing an original image, and projecting the contour image onto a sphere. Then, a projected point S is extracted which is generated by further spherically projecting a projected line segment which is projected on the sphere. Next, an orientation of the line segment is measured based on the projected points S.sup.0, S.sup.1, S.sup.2, . . . which are obtained at a plurality of positions of taking an image (shooting the object). Finally, a distance is measured to the line segment based on the projected points S.sup.0, S.sup.1, S.sup.2, . . . , and the information on the orientation of the line segment.
In the above processes of extraction of the contours and spherical projection, a line segment L in a three-dimensional space, is projected onto a sphere to obtain a projected line segment 1, as shown in FIG. 4. In the above process of extracting a line segment, an accumulating intersection point S is obtained (hereinafter called projected point S) of great circles which are obtained by spherically projecting respective points constituting the projected contour 1 onto the sphere as shown in FIG. 5, is obtained, where spherical projection of a point onto a sphere means to generate a great circle having its pole at the point which is to be projected (similar to the correspondence between the equator and the north pole on the earth) as shown in FIG. 6. The line segment in a three-dimensional space is projected onto a point on a sphere by obtaining the above accumulating intersection point (projected point) S, where the projected point S is a pole of a great circle which contains a projected line segment 1.
Next, in the above process of measuring an orientation of a line segment, as shown in FIG. 7, the projected points S.sup.0, S.sup.1, S.sup.2, . . . which are obtained at a plurality of positions for taking an image (shooting the object), are respectively further spherically projected onto a sphere, i.e., great circles respectively having their poles at the above projected points S.sup.0, S.sup.1, S.sup.2, . . . are generated, and then an accumulating intersection point SS (hereinafter called projected point SS) is extracted therefrom. Since in this case, a direction of a vector directing from the center of the sphere to the projected point SS, accords with the orientation of the line segment L, the orientation of the line segment L in the three-dimensional space can be obtained from the coordinate of the projected point SS on the sphere.
Finally, in the process of measuring a distance to the line segment, as shown in FIG. 8, each direction Sh.sup.t (t=0, 1, 2, . . .) of a perpendicular line which is dropped from each shooting point C.sup.t (t=0, 1, 2, . . . , each position of the camera) to the line segment L is obtained based on each of the above projected points S.sup.t (t=0, 1, 2, . . .) and the projected point SS, and then, shooting points .tau..sup.t (t=0, 1, 2, . . .) are obtained on the sphere by projecting the above shooting points C.sup.t (t=0, 1, 2, . . .) of the camera onto the sphere, respectively. Then, each shooting point .tau..sup.t (t=0, 1, 2, . . .) and a corresponding direction Sh.sup.t (t=0, 1, 2, . . .) of the perpendicular line are connected by a great circle on the sphere. Since the accumulating intersection point Q of these great circles indicates the foot of the perpendicular line which is dropped from each shooting point C.sup.t (t=0, 1, 2, . . . , each position of the camera) to the line segment L, the position of the line segment L in the three-dimensional space (the distance to the line segment) can be obtained by reversely projecting the accumulating intersection point Q onto a measurement plane .pi..
However, in the above method, there is a drawback that an environment having complicated scenery is liable to lead an erroneous measuring result. That is, since, in the above process for measuring the orientation of a line segment in the three-dimensional space, accumulating intersection points are obtained by spherically projecting many projected points which have been obtained for many line segments in the three-dimensional space by moving the camera, onto a sphere, is liable to lead to an erroneous accumulating intersection point being obtained from the projected points for different line segments.
As explained above, the above method by the moving stereographic view does not stably function in an environment having complicated scenery.