[detailed description of the invention]
Below in conjunction with detailed description of the invention and compare accompanying drawing the present invention is described in further details.
Insight of the invention is that in binocular three-dimensional model reconstruction method, the main error of reconstructing three-dimensional model comes from three
Dimension module does not meets the point of practical situation.In process of reconstruction, characteristic extraction procedure is easily subject in environment extensively deposit
Various noises and twin-lens distortion correction error impact, occur due to feature similarity during causing characteristic matching
Error hiding, and then cause, during reconstruct, the above-mentioned point not meeting practical situation occurs.By using Epipolar geometry in the present invention
Constraint detection, thus effectively remove the feature point pairs of error hiding.
As it is shown in figure 1, be the flow chart of the method for reconstructing three-dimensional model of this detailed description of the invention, comprise the following steps:
1) use the image capture device of two same model gather the image of object to be reconstructed obtain respectively left image and
Right image.
Specifically, arranging binocular imaging system, image capture device can be camera or projector.When gathering image,
Guaranteeing that two image capture devices have identical CCD size, identical lens parameters, its camera lens horizontal parallel is placed,
When putting, the optical axis of camera lens in the same plane, and planar angle between two camera lens optical axis less than or equal to 30 °,
And object to be reconstructed described in all comprising in two images gathered.
2) demarcate and calibrate: using chessboard method to demarcate described image capture device, calculate the inside and outside ginseng of image capture device
Number and distortion coefficients of camera lens, and according to described inside and outside parameter and distortion coefficients of camera lens, two images are respectively processed, go
Except the distortion in image.
3) extract characteristic point: to step 2) process after two images carry out feature extraction, obtain the feature of two width images
Point.
In this step, extract the characteristic point in image, the autocorrelation matrix detection image point of interest of luminosity function can be used
As characteristic point.Specifically:
In each image, (x, y), with I, (x, y) represents its gray value given picture point, sets local and is translated towards
Amount (then auto-correlation function is for Δ x, Δ y):
G (x, y)=∑ [I (and x, y)-I (x+ Δ x, y+ Δ y)]2
Wherein, [I (x, y)-I (x+ Δ x, y+ Δ y)]2For luminance picture Grad.(x y) is Gaussian window to given g
Function, then feature point detection functions is:
R (Δ x, Δ y)=∑ g (x, y) [I (and x, y)-I (x+ Δ x, y+ Δ y)]2
Window function g (x, y) in, if eigenvalue R (Δ x, Δ y) more than set threshold value, then explanation find characteristic point.Need
Illustrating, the method extracting characteristic point is more, is not limited to the autocorrelation matrix detection method of above-mentioned luminosity function, its
Its method will not enumerate.
4) matching characteristic point: utilize step 3) in characteristic point in two width images, carry out Feature Points Matching, obtain spy
It is a little right to levy.Nearest-neighbor matching process such as can be used to carry out Feature Points Matching, obtain feature point pairs.
5) to step 4) in the feature point pairs that obtains, carry out epipolar-line constraint detection, remove the feature point pairs of error hiding.
In this step, the feature point pairs obtained after aforementioned coupling is carried out Epipolar geometry constraint detection, remove by noise or
The feature point pairs being unsatisfactory for constraint that person's distortion causes, thus improve the accuracy of follow-up three-dimensional reconstruction.
In this detailed description of the invention, Epipolar geometry constraint detection comprises epipolar-line constraint process.Specifically, it is judged that characteristic point
The epipolar-line constraint value of two characteristic points of centering the most respectively less than sets threshold value, in this way, then retains;As no, then for mistake
The feature point pairs joined.
As in figure 2 it is shown, be the ultimate principle figure of Epipolar geometry involved in three-dimensional rebuilding method.Wherein, m1, m2
A pair feature point pairs obtained for coupling, Xw is characterized a little to m1, m2Corresponding point in world coordinate system, then point
Xw subpoint in the view image of left and right two is respectively m1, m2。x1-y1It is the Epipolar geometry coordinate system in left view,
x2-y2It it is the Epipolar geometry coordinate system in right view.L1, L2 are respectively the optical axis of the camera lens of two image capture devices,
O1、O2For camera lens photocentre position, e1、e2It is respectively O1、O2Subpoint (also referred to as limit) in another view,
I.e. e1For O2Subpoint in left view image, e2For O1Subpoint in right view image.
It is respectively polar curve,For baseline.Epipolar-line constraint condition is i.e.: some Xw subpoint m on left view image1On the right side
Subpoint in lateral-view image (is set to m1') inevitable at right side view polar curveGo up or and polar curveInterval one
Relatively short distance, puts Xw subpoint m on right view image2Subpoint on left side view image (is set to m2') must
So at left side view polar curveGo up or and polar curveUpper interval one relatively short distance.If distance is beyond certain limit,
Then it is considered as the feature point pairs of error hiding.
According to Epipolar geometry principle, by feature point pairs m1, m2Coordinate be normalized, m1=[xl,yl]TNormalization
Form2=[xr,yr]TIt is normalized toIn like manner, characteristic point is regarded at another
Subpoint coordinate in figure is normalized, m1′、m2' be normalized toBy feature point pairs at world coordinates
Corresponding point X in systemWThree-dimensional coordinate be normalized, XW=[X, Y, Z]TIt is normalized to
By subpoint e1、e2Coordinate be also normalized toAccording to step 2) obtain during calibration and calibration for cameras
Inside and outside parameter, the basis matrix F in inner parameter1、F2With external parameter matrix Q1、Q2, can obtain following relational expression:
According to position relationship shown in Fig. 2, there is planar linear equation matrix P1、P2Make:
For ease of calculating, definition vector p1=P1(1 1 0)T, p2=P2(1 1 0)T, then characteristic point is obtained
m1Polar curve value C on the left view image at place1And polar curve value C on the right view image at characteristic point place2It is respectively as follows:
Set CthresFor epipolar-line constraint threshold value, when it meets C1≤Cthres, C2≤CthresTime, it is determined that this feature point
To meeting epipolar-line constraint, retained.Otherwise, then it is assumed that this feature point, to for error hiding feature point pairs, is removed.
To sum up, detected, according to characteristic point m by epipolar-line constraint in Epipolar geometry constraint detection1On right side view image
Subpoint (be set to m1') inevitable at right side view polar curveGo up or and polar curveIt is spaced a relatively short distance, special
Levy a m2Subpoint on left side view image (is set to m2') inevitable at left side view polar curveGo up or and polar curveThe principle of upper interval one relatively short distance, the detection proceeded as described above judges, can not meet the spy of mentioned above principle
Levy a little to being removed, thus remove the feature point pairs of error hiding.
Preferably, Epipolar geometry constraint detection also includes the degree of depth seriality detection process of characteristic point.Specifically, it is judged that
In feature point pairs, whether two characteristic points are satisfied by the degree of depth condition of continuity, in this way, then retain;As no, permit beyond error
Permitted scope, be then considered as the feature point pairs of error hiding.
In this detailed description of the invention, set reference view and be characterized a m1The view at place, reference-view is characterized a little
m2The view at place.For given characteristic point m in reference view1If its coordinate is (xl,yl), calculate depth information,
The depth value that can obtain this point is d (xl,yl).Similarly, for characteristic point m in reference-view2If its coordinate is
(xr,yr), calculating depth information, the depth value that can obtain this point is d (xr,yr)。
K characteristic direction is set, on the s characteristic direction, it is assumed that given characteristic point m1Having of around existing is deep
The point of degree information is at (xl+Δxs,yl+ΔysIn the range of), calculate Δ Ei=(Δ xs+Δys)2, demarcate and make Δ EsIt is worth
Little point is the measuring point to be checked on this s characteristic direction.If any k characteristic direction, then there is k measuring point to be checked,
The most corresponding 1st characteristic direction, the 2nd characteristic direction ..., the s characteristic direction ..., kth
Characteristic direction, wherein s=1,2,3 ... k.
DefinitionIt is the continuity constraint direction character on the s characteristic direction,
Set TthresAs direction threshold value, calculate and meet Ts≤TthresThe maximum n of condition, will have during maximum n value corresponding
N group Δ xi, Δ yiValue as each Δ x to be solvedi, Δ yiValue.N herein i.e. represents feature point pairs m1, m2
Corresponding point in world coordinate system are corresponding on the s characteristic direction meets above-mentioned Ts≤TthresInstitute's energy during condition
Choose the maximum number of offset point, Δ xiRepresent the transversal displacement of i-th point in n point, Δ yiRepresent in n point
The vertical misalignment amount of i-th point.
On the s characteristic direction, definition datum image characteristic point m1, coordinate is (xl,yl) the degree of depth seriality detection
Value is:
Characteristic point m on definition reference picture2, coordinate is (xr,yr) degree of depth seriality detected value be:
Wherein, d (xl+Δxi,yl+Δyi) represent solve obtain n put in deep in reference view of i-th point
Angle value, d (xr+Δxi,yr+Δyi) represent the depth value solving the i-th point obtained in n point in reference-view.
Set DthresThreshold value is detected for degree of depth seriality.On the s characteristic direction, when meeting Ds(xl,yl)≤Dthres,
Then characteristic point m on benchmark image1The s characteristic direction has degree of depth seriality;When it meets
Ds(xr,yr)≤Dthres, then characteristic point m on reference picture2The s characteristic direction has degree of depth seriality.
As feature point pairs m1, m2, at s=1,2,3 ... in the case of k, when being satisfied by identical degree of depth seriality, sentence
Fixed this meets continuity constraint to feature point pairs.Otherwise, then it is assumed that this is error hiding feature point pairs to feature point pairs, gives
To remove.
Usually, if characteristic point m1Benchmark image meets the degree of depth on certain characteristic direction continuous, then characteristic point m2
Meet the degree of depth on this feature direction on a reference continuous;If characteristic point m2Meet on a reference in certain feature
On direction, the degree of depth is continuous, then characteristic point m1Benchmark image also meets the degree of depth on this feature direction continuous.According to this
One principle, the seriality detection carrying out above-mentioned further setting judges, can be entered by the feature point pairs that not meet mentioned above principle
Row is removed, thus the feature point pairs of removable error hiding.
It is further preferred that Epipolar geometry constraint detection also includes that sequence constraint detects process: to two couples of feature point pairs m1,
m2And w1, w2, it is judged that when characteristic point m1Abscissa more than characteristic point w1Abscissa time, if existing characteristics point
m2Abscissa more than characteristic point w2Abscissa;And when characteristic point m1Vertical coordinate more than characteristic point w1Vertical coordinate,
Whether existing characteristics point m2Vertical coordinate more than characteristic point w2Vertical coordinate.As all, then keeping characteristics point is to m1,
m2;As no, then feature point pairs m1, m2Feature point pairs for error hiding.Due to the nothing at benchmark image Yu reference picture
Shield portions, any two pairs of characteristic points, meet and there is identical relative position relation, therefore carry out according to this principle on
The sequence constraint detection stating process judges, can be removed by the feature point pairs not meeting mentioned above principle, thus remove by mistake
The feature point pairs of coupling.
To sum up, by step 5) the middle Epipolar geometry constraint detection process arranged, can effectively remove the characteristic point of error hiding
Right, thus improve the accuracy of later reconstitution result.
6) step 5 is utilized) two-dimensional coordinate of feature point pairs that retains afterwards is calculated feature point pairs in world coordinate system
The three-dimensional coordinate of corresponding point.After calculated three-dimensional coordinate, threedimensional model can be reconstructed.
To sum up, the binocular three-dimensional reconstruction method of this detailed description of the invention, by carrying out the pole geometric match of feature point pairs about
Bundle detection, it is Mismatching point that demarcation does not meets the feature point pairs of Epipolar geometry constraint, removes the characteristic point of these error hiding
Carrying out three-dimensional model reconfiguration after to, thus effectively reduce error hiding rate, that reduces during three-dimensional coordinate calculates is improper
Point, obtains accurate three-dimensionalreconstruction model.
Above content is to combine concrete preferred implementation further description made for the present invention, it is impossible to assert
Being embodied as of the present invention is confined to these explanations.For general technical staff of the technical field of the invention,
Make some replacements or obvious modification without departing from the inventive concept of the premise, and performance or purposes are identical, all answer
When being considered as belonging to protection scope of the present invention.