Summary of the invention
The objective of the invention is to overcome the deficiencies in the prior art, a kind of shortcoming to the initial value sensitivity, the right method for correcting polar line of stereo-picture of dependence fundamental matrix computational accuracy within reason again simultaneously can overcome optimization the time are provided.
In order to reach the foregoing invention purpose, the method for correcting polar line that stereo-picture of the present invention is right may further comprise the steps:
(1), utilize the match point of two right width of cloth images of stereo-picture to calculate fundamental matrix and limit separately;
(2), utilize the limit of first width of cloth image to calculate the degree of depth rotating shaft of first width of cloth image, again according to fundamental matrix, calculate the degree of depth rotating shaft of second width of cloth image;
(3), calculate two width of cloth images degree of depth rotation transformation matrix separately according to two width of cloth images degree of depth rotating shaft separately;
(4), calculate two width of cloth images through the degree of depth postrotational new limit, obtain two width of cloth images polar curve rotation transformation matrix separately according to new limit according to two width of cloth images degree of depth rotation transformation matrix and limit separately;
(5), two width of cloth images degree of depth spin matrix and the polar curve rotation transformation matrix separately that obtain of the fundamental matrix that obtains according to step (1), step (3), (4), obtain the fundamental matrix after two width of cloth planes of delineation become parallel plane and polar curve level, go out to become conversion ratio peaceful the move amount of second width of cloth image of two width of cloth images after parallel plane and the polar curve level according to this matrix computations again for first width of cloth image;
(6), two width of cloth images that step (1) is obtained separately the peaceful amount of moving of conversion ratio that obtains of coordinate, coordinate that step (2) obtains second width of cloth picture depth rotating shaft and the step (5) of limit as initial value, adopt nonlinear least square method that initial value is optimized, obtain their optimal value;
(7), according to the optimal value that obtains, calculate two width of cloth images projective transformation matrix separately, then two width of cloth images are carried out conversion, the stereo-picture after obtaining proofreading and correct is right.
The present invention makes when carrying out optimization owing to introduce degree of depth rotation transformation matrix when determining to carry out optimized parameter, and the number that is used for optimized parameter has reduced at least 7 by at least 10 of conventional method, thereby has saved amount of calculation.Simultaneously, the initial value of parameter is by calculating based on the method for fundamental matrix fully, guaranteed the precision of initial value, thus when having overcome optimization to the shortcoming of initial value sensitivity.Owing to obtain also will carrying out nonlinear optimization behind the initial value of parameter to it, therefore relatively complete method, the precision of the present invention's dependence fundamental matrix within reason again based on fundamental matrix.
Embodiment
For understanding the present invention better, the present invention is more described in detail below in conjunction with embodiment.In the following description, when perhaps the detailed description of existing prior art can desalinate subject content of the present invention, these were described in here and will be left in the basket.
In the present embodiment, two right width of cloth images are respectively I to set up volume image
0And I
1, F is its corresponding fundamental matrix.H
0, H
1Represent I respectively
0, I
1Corresponding projective transformation matrix.If I
0And I
1Limit be respectively e
0And e
1, u
0jAnd u
1jThe homogeneous coordinates of representing a pair of match point, j=1 ..., N.
(1), according to the match point u of two width of cloth images
0jAnd u
1j(j=1 ..., N, altogether N to) adopt improved 8 algorithms to calculate fundamental matrix F, first width of cloth image I
0Limit
With second width of cloth image I
1Limit
E wherein
0 x, e
0 y, e
1 x, e
1 yThe expression homogeneous coordinates value of trying to achieve, subscript x, y represent coordinate on the x axle and the coordinate on the y axle respectively, T represents transposition.
(2), according to first width of cloth image I
0Limit e
0Coordinate figure, the coordinate that calculates its degree of depth rotating shaft is:
With calculate d
0 xAnd d
0 yThe substitution formula 1.
①
According to m, the n that 1. formula obtains, 2. the substitution formula calculates second width of cloth image I
1The coordinate of degree of depth rotating shaft.
②
In the present embodiment, also further will calculate second width of cloth image I
1The coordinate d of degree of depth rotating shaft
1 xAnd d
1 y3. the substitution formula obtains angle parameter α:
③
(3), according to two width of cloth image I that calculate in limit coordinate that calculates in the step (1) and the step (2)
0, I
1The coordinate d of degree of depth rotating shaft separately
0 x, d
0 yAnd d
1 x, d
1 y, 4. according to formula
④
Calculate two width of cloth image I
0, I
1Degree of depth anglec of rotation θ separately
0And θ
1Value.
Then 5., according to formula
⑤
Calculate two width of cloth image I
0, I
1Degree of depth rotation transformation matrix separately
With
(4), according to two width of cloth image I
0, I
1Degree of depth rotation transformation matrix separately
With
With limit e
0And e
16. calculate two width of cloth image I according to formula
0, I
1Through the postrotational new limit e ' of the degree of depth
0And e '
1
⑥
Then, 7. according to formula
⑦
Obtain two width of cloth image I
0, I
1The anglec of rotation φ of polar curve
0, φ
1, by formula 8.:
⑧
Get two width of cloth image I
0, I
1Polar curve rotation transformation matrix
(5), two width of cloth images degree of depth spin matrix separately that obtains of the fundamental matrix F that obtains according to step (1), step (3), (4)
With
With polar curve rotation transformation matrix
Obtain the fundamental matrix F ' after two width of cloth planes of delineation become parallel plane and polar curve level:
⑨
Become second width of cloth image I of two width of cloth images after parallel plane and the polar curve level again according to this matrix F ' calculate
1For the first sub-picture I
0Conversion ratio a and translational movement b.Be specially:
It is not 0 scale factor that F ' is multiplied by one, makes the element of its 3rd row the 2nd row equal 1.The opposite number of the element of the 2nd row the 3rd row of the matrix behind the convergent-divergent is conversion ratio a, and the opposite number of the element of the 3rd row the 3rd row is translational movement b.If a<0 o'clock illustrates that then the order up and down of polar curve is opposite in two width of cloth images, just image has been put upside down, this moment anglec of rotation Ф
1Needing increases π, promptly uses Ф
1+ π replaces original Ф
1Recomputate.
(6), two width of cloth images that step (1) the is obtained homogeneous coordinates e of limit separately
0 x, e
0 y, e
1 x, e
1 yAnd step (2) obtains second width of cloth image I
1The coordinate d of degree of depth rotating shaft
1 xAnd d
1 yAnd the conversion ratio a that obtains of step (5) and translational movement b adopt nonlinear least square method that initial value is optimized as initial value, obtains their optimal value.
In the present embodiment, angle parameter α is replaced second width of cloth image I
1The coordinate d of degree of depth rotating shaft
1 xAnd d
1 y
Like this, finally obtained the initial value of 7 parameters, they are α, a, b, e
0 x, e
0 y, e
1 xAnd e
1 yIf target function is:
⑩
Wherein:
10. adopt the Levenberg-Marquardt algorithm that f is minimized the initial value substitution formula of 7 parameters, obtain the optimal value of these parameters.
(7) according to 7 parameter alpha, a, b, the e that obtain
0 x, e
0 y, e
1 xAnd e
1 yOptimal value, calculate two width of cloth image I
0, I
1Projective transformation matrix H separately
0And H
1, then to two width of cloth image I
0, I
1Carry out conversion, the stereo-picture after obtaining proofreading and correct is to H
0I
0, H
1I
1
Obtain projective transformation matrix H
0And H
1Afterwards, to two width of cloth image I
0, I
1Image after the enforcement conversion just can obtain proofreading and correct is to H
0I
0, H
1I
1Can make new images to H but do like this
0I
0, H
1I
1In some point can not be at original image I
0, I
1In find corresponding point, thereby produce " cavity (holes) " phenomenon.
In the present embodiment, the projective transformation matrix H that obtains in the step (7)
0And H
1To two width of cloth image I
0, I
1Implement conversion, the stereo-picture after adopting the method for reverse mapping to obtain proofreading and correct is right, thereby eliminates cavitation.
Fig. 1 is the particular flow sheet of reverse mapping method, and step is as follows:
(a), two width of cloth image I
0, I
1Respectively with separately projective transformation matrix H
0, H
1Multiply each other, obtain stereo-picture H
0I
0, H
1I
1
(b), find the solution the H of image separately that obtains after multiplying each other
0I
0, H
1I
1Minimum boundary rectangle Rect
0, Rect
1
(c), to minimum boundary rectangle Rect
0, Rect
1Carry out translation respectively, make the point in its upper left corner move to the initial point of coordinate system separately; Then, compare two width of cloth image H
0I
0, H
1I
1Minimum boundary rectangle at the translational movement Δ y of vertical direction
0, Δ y
1, the minimum boundary rectangle that translational movement is little in vertical direction translation again, makes the translational movement of the big minimum boundary rectangle of its translational movement and translational movement identical.Δ y even
0<Δ y
1, Rect then
0At vertical direction translation Δ y again
1-Δ y
0Otherwise Rect
1At vertical direction translation Δ y
0-Δ y
1
(d), with from left to right, from top to bottom order, calculate each the some u in the minimum boundary rectangle of two width of cloth images
0', u
1' at original image I separately
0, I
1Corresponding points u in the plane
0, u
1, check corresponding points u
0, u
1Whether drop on original image I
0, I
1In the scope; If, then with original image I
0, I
1Corresponding points u in the plane
0, u
1Corresponding pixel copies corresponding points u in the minimum boundary rectangle to
0', u
1' the position; Otherwise with corresponding points u in the minimum boundary rectangle
0', u
1' become black color dots, it is right to obtain reverse stereo-picture of hinting obliquely at after the correction.
Image H after the correction
0I
0, H
1I
1With original image I
0, I
1Compare, size may change.
Table 1 is the correction accuracy contrast table that method for correcting polar line of the present invention is compared with Francesco method for correcting polar line of the prior art, Mallon method for correcting polar line.
The bearing calibration correction accuracy
Francesco?Method 0.75000
Mallon?Method 0.62692
Method for correcting polar line 0.25424 of the present invention
Table 1
Adopt in the table 1 and proofread and correct back two width of cloth image H
0I
0, H
1I
1The mean value of the vertical parallax of characteristic of correspondence point is weighed correction accuracy.From table 1 we as can be seen, compare with Francesco method, Mallon method, correction accuracy improves a lot.
Although above the illustrative embodiment of the present invention is described; but should be understood that; the invention is not restricted to the scope of embodiment; to those skilled in the art; as long as various variations appended claim limit and the spirit and scope of the present invention determined in; these variations are conspicuous, and all utilize innovation and creation that the present invention conceives all at the row of protection.