1. Field of the Invention
The present invention generally relates to triangulation, and more particularly to correcting an image before projection by using triangulation.
2. Description of Related Art
Triangulation or reconstruction is used in computer vision to determine a point in 3D space given its projections onto two or more images. In ideal situation, a pair of projection lines generated by image points should intersect at a point in 3D space, and the coordinates of that point can be computed by algebraic technique. In practice, however, the pair of projection lines does not intersect in 3D space due to noise, such as lens distortion or other distortions.
There are methods in the literature for optimally determining a point in 3D space when noise is involved. For example, polynomial, linear least square (linear-LS), iterative-LS and mid-point are commonly used, among which the polynomial method has highest accuracy and computation complexity, and the mid-point method has the lowest accuracy and computation complexity.
Due to high computation complexity, most methods such as linear-LS (e.g., singular value decomposition or SVD), iterative-LS and polynomial cannot be put into practice at low cost. A need has thus arisen to propose an improved scheme for improving, for example, the mid-point method to greatly obtain higher accuracy while substantially maintaining its low computation complexity.
In view of the foregoing, it is an object of the embodiment of the present invention to provide a method of determining a projection point, based on which an image to be projected may be corrected beforehand and perceived without distortion. The method of the embodiment has higher accuracy than conventional mid-point method.
According to one embodiment, a first vector originating from a first imaging device through a first feature point on a first image provided by the first imaging device is obtained, and a second vector originating from a second imaging device through a second feature point on a second image provided by the second imaging device is obtained. A third vector with minimum length is obtained, the third vector being perpendicular to both the first vector and the second vector. A candidate point vector along the third vector is obtained. The candidate point vector is reprojected onto the first image at a first reprojected point, and the candidate point vector is reprojected onto the second image at a second reprojected point. The optimal point is determined by minimizing a sum of a first squared distance between the first reprojected point and the first feature point, and a second square distance between the second reprojected point and the second feature point. Alternatively, a first epipolar line that connects the first feature point and a first epipolar point is obtained, and a second epipolar line that connects the second feature point and a second epipolar point is obtained. The optimal point is determined by minimizing a sum of a first squared distance between the first epipolar line and the first feature point, and a second square distance between the second epipolar line and the second feature point.
In practice, an image (e.g., a white rectangle 21 as shown in
Methods of determining the projection point X will be detailed in the following. It is appreciated that the methods described in the specification may be adapted to applications other than that mentioned above. Generally speaking, the projector 11 in
B sent invention.
In step 31, a first vector 301 is obtained that originates from the projector 11 through a first feature point ur (
In step 32, a third vector 303 with minimum length is obtained that is perpendicular to both the first vector 301 and the second vector 302. The first vector 301, the second vector 302, the third vector 303 and a translation vector (between the projector 11 and the camera 13) 304 may form a closed vector path, which may be expressed as
aP
1
+w−bR
T
P
r
=T (1)
where Pr has the same direction as the first vector 301, Pl has the same direction as the second vector 302, w is the third vector 303, T is the translation vector 304, R is a rotation matrix, and a and b are constants.
In step 33, a candidate point vector P is then defined along the third vector 303 (or w) as
P=aP
1
+cw (2)
where c is a variable with a value in a range of 0 and 1.
In step 34, the candidate point vector P is reprojected onto the first image 12 at a first reprojected point ûr:
û
r
=K
C2
[R|t]{aP
l
+cw} (3)
where KC2 is 3D-to-2D transformation matrix, and t is translation vector between camera and projector 3D coordinate system. It is noted that the first reprojected point ûr is a function of c, that is, ûr(c).
Similarly, the candidate point vector P is reprojected onto the second image 14 at a second reprojected point ûl:
û
l
=K
C1
{aP
1
+cw} (4)
where KC1 is 3D-to-2D transformation matrix. It is noted that the second reprojected point ûl is a function of c, that is, û1(c).
Finally, in step 35, a value of the variable c is found that minimizes a sum of a first squared distance between the first reprojected point ûr and the first feature point ur, and a second square distance between the second reprojected point ûl and the second feature point ul, that is
arg minc=0-1{d(ûr(c),ur)2+d(ûl(c), ul)2} (5)
In one exemplary embodiment, (5) may approximately be quadratic formula, e.g., f(c)=a1c2+a2c+a3, which has a single local minimum value, which may be obtained, for example, by substituting at least three points into the quadratic formula. The value of c found in (5) may thus determine an optimal projection point P.
Steps 31 to 34 of
Subsequently, in step 36, a first epipolar line lr, which connects the first feature point Ur and a first epipolar point er (that is an intersection point of the translation vector T and the first image 12). Similarly, a second epipolar line ll, which connects the second feature point ul and a second epipolar point el (that is an intersection point of the translation vector T and the second image 14). The first epipolar line lr may be obtained according to the second reprojected point ûl, and the second epipolar line ll may be obtained according to the first reprojected point ûr:
l
r(c)=Fûl(c)
l
l(c)=Fûr(c) (6)
Finally, in step 37, a value of the variable c is found that minimizes a sum of a first squared distance between the first epipolar line lr and the first feature point ur, and a second square distance between the second epipolar line ll and the second feature point ul, that is
arg minc=0-1{d(lr(c),ur)2+d(l1(c),u1)2} (7)
In one exemplary embodiment, (7) may approximately be quadratic formula, e.g., f(c)=a1c2+a2c+a3, which has a single local minimum value, which may be obtained, for example, by substituting at least three points into the quadratic formula. The value of c found in (7) may thus determine an optimal projection point P.
Although specific embodiments have been illustrated and described, it will be appreciated by those skilled in the art that various modifications may be made without departing from the scope of the present invention, which is intended to be limited solely by the appended claims.