Summary of the invention
The invention provides a kind of measuring three-dimensional profile method based on phase method, measuring method of the present invention can be provided with arbitrarily the video camera of three-dimension measuring system and the relative position relation of projection arrangement, implement to measure and demarcate, have system constructing simple, demarcate fast convenient and precision advantage of higher.
Technical scheme of the present invention is as follows: three-dimensional measurement and the scaling method that video camera and projection arrangement relative position relation can be set arbitrarily of the present invention comprises: calibrating camera parameters at first; Utilize the three-dimensional coordinate and the phase value of each point on the plane template method calibrating template then, obtain the sample point set.To the relative position of video camera and projection arrangement three-dimensional space structure modeling arbitrarily, sample point is gathered in the substitution model, obtain parameter.With the picpointed coordinate and the phase value substitution model of subject image, obtain object three-dimensional contour outline when measuring at last.
The operation steps of this method is:
Step 1: with nonlinear method calibrating camera inner parameter;
Step 2: make up measuring system: projector, video camera are linked to each other with computing machine respectively, adjust the position of projector and video camera, make the view field of projector and the visual field of video camera can cover the surf zone that testee need be measured simultaneously;
Step 3: set up the systematic survey relational expression: utilize projector projection grating striped, obtain raster image by video camera, obtain the phase value of each picture point on the image again with phase method, set up the measurement relational expression between phase place and the object point three-dimensional coordinate then, this measurement relational expression is:
Wherein, (X
c, Y
c, Z
c) be the three-dimensional coordinate of object point in camera coordinate system, θ is a phase value, a
1, a
2, a
3, a
4, a
5, a
6, a
7And a
8Be systematic parameter to be calibrated;
Step 4: calibration system parameter: scaling board (as shown in Figure 2) is positioned over certain optional position in the measurement range, obtains the image of scaling board with video camera, by each calibration point Q on the scaling board
i(a
i, b
i) picpointed coordinate (m
i, n
i) (i=1,2 ..., k), and scaling board coordinate system, the relative rotation of camera coordinate system, translation relation, the image coordinate put on the scaling board (m is n) with corresponding object point coordinate (X
c, Y
c, Z
c) mapping relations, use projector projection grating striped again, video camera is taken stripe pattern, (m, phase value θ n) is with point on the image (m, n) Dui Ying object point coordinate and phase place, i.e. (X to obtain each point on the image by phase method
c, Y
c, Z
cθ), be called a sample point, traversing graph obtains different sample points as each point, again scaling board is positioned over 2~3 diverse locations, obtain the sample point under each position, all sample points are gathered, obtain the sample point set, the sample point that finally obtains is gathered in the systematic survey relational expression of substitution step 3 foundation, solved systematic parameter a
1, a
2, a
3, a
4, a
5, a
6, a
7And a
8, above-mentioned measurement range is defined as the view field of projector and the equitant part in the visual field of video camera;
Step 5: measure testee: testee is positioned in the measurement range, with projection device phase-shifted grating striped, take stripe pattern by video camera, obtain different picture point (m on the image by phase method, n) phase value θ, with picpointed coordinate (m, n) and phase value θ substitution step 3 in systematic survey relational expression and video camera pin-hole model, can solve (m, n) three-dimensional coordinate (X of Dui Ying object point
c, Y
c, Z
c), obtain the three-D profile of object.
Compared with prior art, the present invention has following advantage:
(1) among the present invention video camera and projection arrangement be there is no the parallel of any strictness, vertical or crossing requirement.The relative position relation of video camera and projection arrangement can be placed arbitrarily among the present invention, does not need strict correction position relation like this in the building process of measuring system, and system constructing is convenient and swift on the one hand, saves time; Avoided on the other hand having improved system accuracy owing to the position is concerned the systematic error that strict requirement causes.
(2) the present invention is in calibration process, the position of demarcating the plane there is not strict requirement yet, do not need accurate mobile target, do not need the worktable of a stationkeeping or workplace to demarcate like this, do not require the relative position relation of accurate adjustment demarcation plane and video camera, projector yet, make on-the-spot calibration process simple and efficient, reduced requirement, keep higher precision again worktable, face.
(3) used plane reference object to demarcate among the present invention, plane reference object is three-dimensional to be demarcated thing and has and make simply, and the precision advantages of higher has reduced in the calibration process the dependence of high-precision calibrating thing, has simplified calibration process.
Embodiment
With reference to the accompanying drawings, specific embodiments of the present invention are made more detailed description:
Referring to Fig. 1,2, measuring system of the present invention comprises computing machine, the video camera that links to each other with computing machine by graph card, and by computer-controlled projection arrangement (projector) and scaling board.Position relation between projection arrangement and the video camera does not have the parallel of any strictness arbitrarily, vertical or crossing requirement, and timing signal does not have strict requirement to the position of scaling board yet.As shown in Figure 2, array distribution has the known round monumented point Q of two-dimensional coordinate on the scaling board
i(i=1,2 ..., k), its two-dimensional coordinate is (a
i, b
i).
Referring to Fig. 3, Ω
w, Ω
cRepresent reference frame, camera coordinate system respectively, O
P, O
cRepresent projection centre and photocentre respectively.o
1Mn represents video camera imaging areal coordinate system, (m, n) image coordinate of expression picture point.Reference frame OXYZ, i.e. Ω
wSet up according to projection arrangement: the OXY plane parallel is in the projecting plane, and Y-axis is parallel to grating fringe, and the Z beam warp is crossed projection centre O
PMatrix R
w, T
wBe to describe Ω
wAnd Ω
cBetween rotation, the translation matrix of relative position relation.
Referring to Fig. 4, Ω
w, Ω
0Represent reference frame, scaling board coordinate system respectively.Ω
0The Z axle perpendicular to the scaling board face.
Concrete steps are as follows:
(1) Camera calibration
At first intrinsic parameters of the camera is demarcated.The three-dimensional geometric information of body surface point and its mutual relationship between the corresponding point on the image are that the process of setting up this geometric model is exactly the solution procedure of camera parameters, i.e. camera calibration by the decision of the imaging model of video camera.The camera model that we adopt is widely used pin-hole model, and is as described below:
If object point is at camera coordinate system Ω
cIn three-dimensional coordinate be (X
c, Y
c, Z
c), its picpointed coordinate on image is that (m n), has
ρ is scale factor, wherein A in the formula
cBe parameter matrix,
m
0, n
0Be principal point coordinate on the video camera imaging face, f
m, f
nBe respectively the axial amplification coefficient of imaging surface m axle and n, γ is the diaxon coefficient skewness.(m, n), (m
d, n
d) be respectively desirable orthoscopic image coordinate (m, n) and the relation between the actual fault image coordinate, k
1, k
2Be camera lens radial distortion parameter.
m
0, n
0, f
m, f
n, γ, k
1, k
2It is exactly intrinsic parameters of the camera.
Among the present invention, use nonlinear method calibrating camera inner parameter earlier, as described below:
Given one group of calibration point that three-dimensional coordinate is known is taken the image that this organizes calibration point with video camera, obtains its picpointed coordinate.
The three-dimensional coordinate of bidding fixed point on target is (X
b, Y
b, Z
b), at camera coordinate system Ω
cIn coordinate be (X
c, Y
c, Z
c), the distorted image point coordinate of the reality that obtains on image is (m
d, n
d), the target coordinate of calibration point and the coordinate transform relational expression of camera coordinates are:
In the formula,
Be unit quadrature rotation matrix.
Be translation matrix.
(R
bT
b) be called the external parameter in the camera calibration, rotation and the translation relation of video camera to the target coordinate system described.
In calibration process, the three-dimensional coordinate (X of calibration point on target
b, Y
b, Z
b) known, its picpointed coordinate (m
d, n
d) (actual distorted image point coordinate) obtain in image.(X with a series of calibration points
b, Y
b, Z
b) and (m
d, n
d) substitution (1), (2) formula, can get one group of nonlinear equation, its unknown number is exactly intrinsic parameters of the camera m to be calibrated
0, n
0, f
m, f
n, γ, k
1, k
2And external parameter r
B1, r
B2, r
B3, r
B4, r
B5, r
B6, r
B7, r
B8, r
B9, t
B1, t
B2And t
B3Solve this Nonlinear System of Equations, promptly obtain intrinsic parameters of the camera, demarcation finishes.
It is pointed out that the picpointed coordinate that directly obtains is (m from image
d, n
d), with (m
d, n
d) substitution (1b) formula obtain desirable orthoscopic image coordinate (m, n).If no special instructions, among the present invention said picpointed coordinate all be meant desirable orthoscopic image coordinate (m, n).
(2) structure of measuring system
Constructing system as shown in Figure 1, links to each other projector, video camera respectively with computing machine, can go out grating fringe by the computer control projection, and video camera is used for photographic images, and the image of shooting is imported computing machine via image pick-up card.Adjust the position of projector and video camera, as described below:
Earlier testee is placed (be placed on the ground, on the desk or on other platforms all can), adjust the distance and the direction of projector and testee, make the view field of projector can cover the surf zone that testee need be measured; Adjust the distance and the direction of video camera and testee, make the visual field of video camera can cover the surf zone that testee need be measured; Like this, when projector during to testee projection grating striped, video camera can photograph the image of the striped that projects to body surface, carries out surveying work.For the relative position relation of projector and video camera, there is no other requirements, as parallel, vertical, coplane etc.
Among the present invention measurement range is defined as the view field of projector and the equitant part in the visual field of video camera.When body surface was positioned at measurement range, grating fringe can project on the object, and the stripe pattern of projection also can be photographed by video camera simultaneously.
The system constructing process flow diagram is seen accompanying drawing 6.
(3) foundation of systematic survey relational expression
As shown in Figure 1, with system constructing well after, the projection grating striped is to body surface, takes raster image by video camera.To raster image, the present invention adopts phase method to obtain the phase value of raster image, then the relation of phase value and object point three-dimensional coordinate is carried out modeling, sets up the systematic survey relational expression.
In the phase method, adopt phase-shifting method from the projection grating stripe pattern that video camera is taken, to extract the quantitative distribution of the field of behaviour usually.The present invention adopts 4 width of cloth figure phase-shift methods commonly used, and is as described below.
By accurate mobile projector grating, make the field of behaviour phase shift of grating fringe image, obtain 4 width of cloth stripe patterns, each image can be expressed as:
I
i(m,n)=I
0(m,n)+γ(m,n)cos[θ(m,n)+α
i]?i=1,2,3,4 (3)
I represents the i time phase shift, I in the formula
i(m n) is (m, gray-scale value n), I on the i width of cloth phase shift figure
0(m n) is the bar graph background value, and (m n) is the modulate intensity function to γ, and (m n) is the field of behaviour to be asked to θ, i.e. point (m, phase value n).α
iIt is the phase-shift value of i width of cloth figure.Make phase shift be respectively α
1=0, α
2=pi/2, α
3=π, α
4=3 pi/2s are got by (3)
To the following formula tangent of negating, by separating the method for phase place, can obtain complete phase value θ again.
Like this, phase value θ just obtains by phase method.After obtaining θ, by analysis, set up the systematic survey relational expression to the system space relation, as described below.
As shown in Figure 3, camera coordinate system Ω
cWith reference frame Ω
wRelative position relation be arbitrarily, as figure, both do not required O
cBe positioned at the OXZ plane, also do not require O
cO
PBe parallel to the OXY plane, also do not require Z
cAxle intersects at the O point with the Z axle.
If object point P is at reference frame Ω
wIn coordinate be (X, Y, Z), at camera coordinate system Ω
cIn coordinate be (X
c, Y
c, Z
c), have:
In the formula,
Be unit quadrature rotation matrix.
Be translation matrix.
(R
wT
w) rotation and the translation relation of video camera to reference frame described.
In the accompanying drawing 3, the P point in the video camera imaging face, image in p (m, n), phase place is θ, P ' is the projection of object point P on the OXY plane.O
PP and OXY plane meet at the D point.P ", D " is respectively P ', the D projection on the X-axis on OXY plane.
By P ' and O is respectively P and O
pProjection on the OXY plane, thus PP ' //O
pO, △ DP ' P ∽ △ DOO
P, obtain
P " and D " is respectively P ' and the projection of D on the X-axis on OXY plane, so P " P ' //D " D, △ OP " P ' ∽ △ OD " D obtains
(6) (7) simultaneous,
In the formula, OO
P=l; Because P ' is the projection of P on the OXY plane, P " being the projection of P ' on the X-axis on OXY plane, so OP ", P ' P is respectively X and the Z coordinate of P point in the OXYZ coordinate system; Because the phase place of D " be the projection of D on the Y-axis on OXY plane, and the Y-axis of OXY face being parallel to grating orientation, so D " equals the phase value of D, also equal the phase theta of P, so:
θ in the formula
0Be the phase place of initial point O, λ
0Be the grid line pitch.
With above-mentioned relation substitution (8) formula,
With (5) formula substitution (10) formula,
In the formula,
(11) formula is promptly measured relational expression, has described phase place and object point three-dimensional coordinate (at Ω
cIn three-dimensional coordinate) between relation, a in the formula
1, a
2, a
3, a
4, a
5, a
6, a
7, a
8Be systematic parameter.
(4) demarcation of systematic parameter
Scaling board is positioned over certain optional position in the measurement range, as shown in Figure 4.Video camera is taken the scaling board image, obtains each calibration point Q by image
i(a
i, b
i) picpointed coordinate (m
i, n
i) (i=1,2 ..., k).(a is b) at scaling board coordinate system Ω then to put Q on the scaling board
0In three-dimensional coordinate be (a, b, 0), at Ω
cIn coordinate be
In the formula, R
0, T
0Expression Ω
0To Ω
cRotation relationship and translation relation.R
0Be 3 * 3 unit rotation matrix, T
0It is 3 * 1 translation matrix.r
1, r
2Be rotation matrix R
0Preceding 2 row.So have:
‖r
1‖
2=1,‖r
2‖
2=1,r
1·r
2=0 (13)
In the formula, " ‖ r ‖
2" represents 2 norms of vectorial r, " " expression inner product.
By (1), (13), Q (a, b) and its picture point q (m, pass n) is:
ρ ' is a scale factor in the formula, H=A
c(r
1r
2T
0) be 3 * 3 matrixes.Order
By (14), (15)
With each calibration point Q
i(a
i, b
i) and by the picpointed coordinate (m in the image
i, n
i) (i=1,2 ..., k).Substitution (16) formula,
Following formula is one and contains 9 unknown number (g
1... g
9, i.e. 9 of the G matrix elements) system of homogeneous linear equations.When k 〉=4, can solve one and contain separating of scale factor.By (13) formula, obtain scale factor again, obtain the G matrix.
(15), (16) substitution (12) formula,
(m, n) ((m, n) image coordinate of expression point) is with (m, n) substitution (18) formula promptly obtain corresponding object point coordinate (X for the each point on the image
c, Y
c, Z
c).Use projector projection grating striped again, video camera is taken stripe pattern, obtains each point on the image (m, phase value θ n) by phase method.With point on the image (m, n) Dui Ying object point coordinate and phase place, i.e. (X
c, Y
c, Z
c, θ), be called a sample point.Traversing graph is as each point, obtain different sample points, again scaling board is positioned over 2~3 diverse locations, obtain the sample point under each position, all sample points are gathered, obtain the sample point set, the sample point that finally obtains is gathered in the systematic survey relational expression of substitution step 3 foundation, solve systematic parameter a
1, a
2, a
3, a
4, a
5, a
6, a
7And a
8
Above-mentioned measurement range is exactly the measurement range of definition in the step 2, the i.e. equitant part in the visual field of the view field of projector and video camera.
The parameter calibration process flow diagram is seen accompanying drawing 7.Wherein the process flow diagram of " collection sample point " step is seen accompanying drawing 8.
(5) Measuring Object profile
Shown in accompanying drawing (1), scaling board is withdrawn, testee is positioned in the measurement range,, takes stripe pattern by video camera with projection device phase-shifted grating striped, obtain different picture point (m on the image by phase method, n) phase value θ, with picpointed coordinate (m, n) and phase value θ substitution step 3 in systematic survey relational expression (i.e. (11) formula) and video camera pin-hole model (i.e. (1) formula), can solve (m, n) three-dimensional coordinate (X of Dui Ying object point
c, Y
c, Z
c), obtain the three-D profile of object.
The measuring process process flow diagram is seen accompanying drawing 9.