【Specific implementation mode】
With reference to embodiment and compares attached drawing the present invention is described in further details.
Idea of the invention is that:In binocular three-dimensional model reconstruction method, the main error of reconstructing three-dimensional model comes from three
The point of actual conditions is not met in dimension module.In reconstruction process, characteristic extraction procedure is easy by being widely present in environment
Various noises and twin-lens distortion correction error influence, and characteristic matching is caused error hiding occur since feature is similar in the process,
And then lead to the above-mentioned point for not meeting actual conditions occur when reconstruct.It constrains and detects by using Epipolar geometry in the present invention, from
And effectively remove the characteristic point pair of error hiding.
As shown in Figure 1, the flow chart of the method for reconstructing three-dimensional model for present embodiment, includes the following steps:
1) image for using the image capture device of two same models to acquire object to be reconstructed obtains left image respectively
And right image.
Specifically, binocular imaging system is set, and image capture device can be camera or projecting apparatus.When acquiring image, really
Two image capture devices CCD sizes having the same, identical lens parameters are protected, camera lens horizontal parallel is placed, when putting, mirror
Head optical axis in the same plane, and planar the angle between two camera lens optical axis be less than or equal to 30 °, and acquire two images
In include the object to be reconstructed.
2) it demarcates and calibrates:Described image collecting device is demarcated using chessboard method, calculates the inside and outside ginseng of image capture device
Number and distortion coefficients of camera lens, and be respectively processed according to the inside and outside parameter and two image of distortion coefficients of camera lens pair, removal figure
Distortion as in.
3) characteristic point is extracted:Feature extraction is carried out to step 2) treated two images, obtains the characteristic point of two images.
In the step, the characteristic point in image is extracted, the autocorrelation matrix detection image point of interest of luminance function can be used
As characteristic point.Specifically:
In each image, given image point (x, y), gray value is indicated with I (x, y), the local translation vector of setting (Δ x,
Δ y), then auto-correlation function be:
G (x, y)=∑ [I (x, y)-I (x+ Δs x, y+ Δ y)]2
Wherein, [I (x, y)-I (x+ Δs x, y+ Δ y)]2For luminance picture Grad.Given g (x, y) is Gauss function,
Then feature point detection functions are:
R (Δ x, Δ y)=∑ g (x, y) [I (x, y)-I (x+ Δs x, y+ Δ y)]2
In window function g (x, y), if (Δ x, Δ y) are more than given threshold to characteristic value R, then illustrate to find characteristic point.It needs
Illustrate, the method for extracting characteristic point is more, is not limited to the autocorrelation matrix detection method of above-mentioned luminance function, other methods
It will not enumerate.
4) matching characteristic point:Using the characteristic point in two images in step 3), Feature Points Matching is carried out, characteristic point is obtained
It is right.Such as nearest-neighbor matching process can be used and carry out Feature Points Matching, obtain characteristic point pair.
5) to the characteristic point pair obtained in step 4), epipolar-line constraint detection is carried out, the characteristic point pair of error hiding is removed.
In the step, to the characteristic point that is obtained after aforementioned matching to carrying out Epipolar geometry constraint detection, removal by noise or
Person is unsatisfactory for the characteristic point pair of constraint caused by distorting, to improve the accuracy of follow-up three-dimensional reconstruction.
In present embodiment, Epipolar geometry constraint detection includes epipolar-line constraint process.Specifically, judging characteristic point pair
In two characteristic points epipolar-line constraint value whether be respectively less than given threshold, if so, then retaining;If not, for the feature of error hiding
Point pair.
As shown in Fig. 2, for the basic principle figure of Epipolar geometry involved in three-dimensional rebuilding method.Wherein, m1, m2For
With obtained a pair of of characteristic point pair, Xw is characterized a little to m1, m2Corresponding points in world coordinate system, then point Xw two regarded in left and right
Subpoint in figure image is respectively m1, m2。x1-y1It is the Epipolar geometry coordinate system in left view, x2-y2It is pair in right view
Pole geometric coordinate system.L1, L2 are respectively the optical axis of the camera lens of two image capture devices, O1、O2For camera lens optical center position, e1、
e2Respectively O1、O2Subpoint (also referred to as pole) in another view, i.e. e1For O2Subpoint in left view image, e2For
O1Subpoint in right view image.Respectively polar curve,For baseline.Epipolar-line constraint condition is:
Point Xw subpoint m on left view image1Subpoint on right side view image (is set as m1') inevitable in right side view polar curveUpper or and polar curveIt is spaced a relatively short distance, point Xw subpoint m on right view image2On left side view image
Subpoint (be set as m2') inevitable in left side view polar curveUpper or and polar curveOne relatively short distance of upper interval.If away from
From beyond a certain range, then it is considered as the characteristic point pair of error hiding.
According to Epipolar geometry principle, by characteristic point to m1, m2Coordinate be normalized, m1=[xl,yl]TIt is normalized tom2=[xr,yr]TIt is normalized toSimilarly, the throwing by characteristic point in another view
Shadow point coordinates is normalized, m1′、m2' be normalized toBy characteristic point to the corresponding points X in world coordinate systemW
Three-dimensional coordinate be normalized, XW=[X, Y, Z]TIt is normalized toBy subpoint e1、e2Coordinate
It is normalized toAccording to obtained inside and outside parameter during step 2) calibration and calibration for cameras, the basis in inner parameter
Matrix F1、F2With external parameter matrix Q1、Q2, following relational expression can be obtained:
Position relationship is it is found that there are planar linear equation matrix P according to Fig.2,1、P2So that:
For ease of calculating, definition vector p1=P1(1 1 0)T, p2=P2(1 1 0)T, then characteristic point m is obtained1The left side at place
Polar curve value C in view image1And the polar curve value C on the right view image where characteristic point2Respectively:
Set CthresFor epipolar-line constraint threshold value, when it meets C1≤Cthres, C2≤CthresWhen, judgement this feature point is to meeting
Epipolar-line constraint is retained.It is on the contrary, then it is assumed that this feature point is to for error hiding characteristic point pair, removal.
To sum up, it is detected by epipolar-line constraint in Epipolar geometry constraint detection, according to characteristic point m1On right side view image
Subpoint (be set as m1') inevitable in right side view polar curveUpper or and polar curveIt is spaced a relatively short distance, characteristic point m2
Subpoint on left side view image (is set as m2') inevitable in left side view polar curveUpper or and polar curveUpper interval
The principle of one relatively short distance, the detection that proceeds as described above judge, can not will meet the characteristic point of mentioned above principle to being removed,
To remove the characteristic point pair of error hiding.
Preferably, Epipolar geometry constraint detection further includes the depth continuity detection process of characteristic point.Specifically, judge spy
Whether sign point two characteristic points of centering are satisfied by the depth condition of continuity, if so, then retaining;If not, exceeding allowable range of error, then
It is considered as the characteristic point pair of error hiding.
In present embodiment, setting reference view is characterized point m1The view at place, reference-view are characterized point m2Institute
View.For the given characteristic point m in reference view1If its coordinate is (xl,yl), depth information is calculated, can be somebody's turn to do
The depth value of point is d (xl,yl).Similarly, for the characteristic point m in reference-view2If its coordinate is (xr,yr), calculate depth
Information, the depth value that can obtain the point are d (xr,yr)。
K characteristic direction is set, on s-th of characteristic direction, it is assumed that given characteristic point m1Surrounding is existing to have depth
The point of information is in (xl+Δxs,yl+Δys) in the range of, calculate Δ Ei=(Δ xs+Δys)2, demarcating makes Δ EsThe minimum point of value
For the measuring point to be checked on s-th of characteristic direction.If any k characteristic direction, then there are k measuring points to be checked, correspond to the 1st spy respectively
Sign direction, the 2nd characteristic direction ... ..., s-th of characteristic direction ... ..., k-th of characteristic direction, wherein s=1,2,3 ... ...
k。
DefinitionIt is special for the continuity constraint direction on s-th of characteristic direction
Sign sets TthresAs direction threshold value, calculates and meet Ts≤TthresThe maximum n of condition, corresponding n when will have maximum n values
Group Δ xi, Δ yiValue as each Δ x to be solvedi, Δ yiValue.N herein indicates characteristic point to m1, m2In world coordinates
Corresponding points in system are corresponding on s-th of characteristic direction to meet above-mentioned Ts≤TthresOffset point can be chosen when condition most
Big number, Δ xiIndicate i-th point of transversal displacement in n point, Δ yiIndicate i-th point of vertical misalignment in n point
Amount.
On s-th of characteristic direction, benchmark image characteristic point m is defined1, coordinate is (xl,yl) depth continuity detected value
For:
Define characteristic point m on reference picture2, coordinate is (xr,yr) depth continuity detected value be:
Wherein, d (xl+Δxi,yl+Δyi) indicate to solve the i-th point of depth in reference view in n obtained point
Angle value, d (xr+Δxi,yr+Δyi) indicate that solution obtains the i-th point of depth value in reference-view in n point.
Set DthresFor depth continuity detection threshold value.On s-th of characteristic direction, when meeting Ds(xl,yl)≤Dthres,
The then characteristic point m on benchmark image1There is depth continuity on s-th of characteristic direction;When it meets Ds(xr,yr)≤Dthres,
The then characteristic point m on reference picture2There is depth continuity on s-th of characteristic direction.
When characteristic point is to m1, m2, in the case of s=1,2,3 ... ... k, when being satisfied by identical depth continuity, judgement should
To characteristic point to meeting continuity constraint.It is on the contrary, then it is assumed that this is to characteristic point to for error hiding characteristic point pair, being removed.
Usually, if characteristic point m1It is continuous to meet the depth on certain characteristic direction on benchmark image, then characteristic point m2Joining
It is continuous to examine satisfaction depth on this feature direction on image;If characteristic point m2Meet on a reference deep on certain characteristic direction
Degree is continuous, then characteristic point m1It is continuous also to meet the depth on this feature direction on benchmark image.According to this principle, carry out
It states the continuity detection being further arranged to judge, can not will meet the characteristic point of mentioned above principle to being removed, to can remove
The characteristic point pair of error hiding.
It is further preferred that Epipolar geometry constraint detection further includes sequence constraint detection process:To two pairs of characteristic points to m1,
m2And w1, w2, judge to work as characteristic point m1Abscissa be more than characteristic point w1Abscissa when, if existing characteristics point m2Abscissa
More than characteristic point w2Abscissa;And work as characteristic point m1Ordinate be more than characteristic point w1Ordinate, if existing characteristics point m2
Ordinate be more than characteristic point w2Ordinate.As being that then keeping characteristics point is to m1, m2;If not, characteristic point is to m1, m2For
The characteristic point pair of error hiding.Since in the unobstructed part of benchmark image and reference picture, arbitrary two pairs of characteristic points, satisfaction has
Identical relative position relation, therefore detected and judged according to the sequence constraint that the principle proceeds as described above, it can not will meet
The characteristic point of principle is stated to being removed, to remove the characteristic point pair of error hiding.
To sum up, detection process is constrained by the Epipolar geometry being arranged in step 5), the characteristic point of error hiding can be effectively removed
It is right, to improve the accuracy of later reconstitution result.
6) characteristic point is calculated in world coordinate system in the two-dimensional coordinate of the characteristic point pair retained afterwards using step 5)
Corresponding points three-dimensional coordinate.After the three-dimensional coordinate being calculated, you can reconstruct threedimensional model.
To sum up, the binocular three-dimensional reconstruction method of present embodiment, by carrying out the pole geometric match of characteristic point pair about
Beam detects, and calibration does not meet the characteristic point of Epipolar geometry constraint to for Mismatching point, removing the characteristic point of these error hidings to rear
Carry out three-dimensional model reconfiguration, to effectively reduce error hiding rate, reduce three-dimensional coordinate calculating process in improper point, obtain compared with
For accurate three-dimensionalreconstruction model.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that
The specific implementation of the present invention is confined to these explanations.For those of ordinary skill in the art to which the present invention belongs, exist
Several alternative or obvious variations are made under the premise of not departing from present inventive concept, and performance or use is identical, all should be considered as
It belongs to the scope of protection of the present invention.