1. Field of the Invention
The present invention relates to image processing technology, and in particular to stereo image rectification technology.
2. Description of the Related Art
A warping matrix is often used to remap feature points from one image to the other. With the warping matrix, the corresponding feature points on the two images can be calibrated to be on the same scan line, as shown in
then multiply the matrix A with its transpose AT to obtain an 9×9 matrix; and finally performing the single value decomposition (SVD) on the 9×9 matrix to obtain the fundamental matrix and further the warping matrix.
However, this computational procedure gets more and more complex as the number of the feature points increases. In addition, since this manner requires extensive use of multiplexers, it is almost impossible to be implemented by the hardware.
The present invention provides a stereo image rectification apparatus, comprises: an input unit, for receiving a first image from a first camera and a second image from a second camera, wherein the first and the second camera are affine cameras; a feature point determination unit, coupled to the input unit, for determining at least one first feature point on the first image and at least one second feature point on the second image, wherein both the first feature point on the first image and the second feature point on the second image correspond to the same imaginary object; and a warping matrix establishing unit, coupled to the feature point determination unit, for establishing a warping matrix for mapping the first image to the second image by: calculating the elements of the warping matrix in regard to the mapping between the x- and y-coordinates of the first feature points and the y-coordinates of the second feature points.
The present invention also provides a stereo image rectification method, comprising the steps of: receiving a first image from a first camera and a second image from a second camera, wherein the first and the second cameras are affine cameras; determining at least one first feature point on the first image and at least one second feature point on the second image, wherein both the first feature point on the first image and the second feature point on the second image correspond to the same imaginary object; and establishing a warping matrix for mapping the first image to the second image by: calculating the elements of the warping matrix in regard to the mapping between the x- and y-coordinates of the first feature points and the y-coordinates of the second feature points.
A detailed description is given in the following embodiments with reference to the accompanying drawings.
The present invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
To overcome the defects in the prior art, the present invention provides a stereo image rectification apparatus and a stereo image rectification method, which will be described in the following in accordance with the drawings.
Please refer to
Where the symbols “x1” and “y1” respectively represent the x- and y-coordinates of the feature point P1; and the symbols “x2” and “y2” respectively represent the x- and y-coordinates of the feature point P2. In addition, the symbols “m0, m1 and t0” are the elements of the warping matrix in regard to the mapping between the x- and y-coordinates of the first feature point P1 and the “x-coordinate” of the second feature point P2; and the symbols “m3, m4 and t1” are the elements of the warping matrix in regard to the mapping between the x- and y-coordinates of the first feature points P1 and the “y-coordinate” of the second feature points P2. Note that the x- and y-coordinates of the feature points P1 and P2 hereinafter mean the horizontal and vertical positions thereof, and, since the first and the second cameras are affine cameras, the corresponding feature points P1 and P2 have the same depth position (i.e., the same z-coordinate).
In the present invention, to improve computational efficiency, the warping matrix is established according to the following rules: (1) ignoring the elements of the warping matrix in regard to the mapping between the x- and y-coordinates of the first feature points and the x-coordinates of the second feature points; and (2) calculating the elements of the warping matrix in regard to the mapping between the x- and y-coordinates of the first feature points and the y-coordinates of the second feature points. In this embodiment, the elements “m0, m1 and t0” are ignored and respectively given values of “1, 0, and 0”. Then, the present invention focuses on the calculation of the elements “m3, m4 and t1”, in order to make the corresponding feature points on two different images have the same y-coordinates. Specifically, the elements “m3, m4 and t1” can be calculated as follows:
where the matrix
the matrix
and the matrix
The computational procedure can be seen as an over-determined issue, and the matrix
can be easily solved using the following equation:
x=(ATA)−1ATb.
The stereo image rectification apparatus of the present invention can easily calibrate stereo images without using the single value decomposition (SVD) technique, thus greatly improving computational efficiency.
In addition to the stereo image rectification apparatus, the present invention also provides a stereo image rectification method.
While the invention has been described by way of example and in terms of the preferred embodiments, it is to be understood that the invention is not limited to the disclosed embodiments. On the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.