Embodiment
The exemplary embodiments that embodies feature ﹠ benefits of the present invention will be described in detail in the following description.Be understood that the present invention can have at different embodiment various variations, its neither departing from the scope of the present invention, and explanation wherein and accompanying drawing be when the usefulness that explain in itself, but not in order to limit the present invention.
The below specifically introduces coordinate transform data disposal route and the device of the preferred embodiment of the present invention take the measurement data of a plurality of different erect-positions of processing surveying instrument as example, and surveying instrument for example is laser tracker.
The coordinate transform data disposal route of the embodiment of the invention, it mainly comprises following three steps:
Step S1: the coordinate data in described former rectangular coordinate system and these two coordinate systems of described target rectangular coordinate system that receives described common point, described coordinate data with part or all of described common point is constructed regression function with least square method, and draws by iteration and make described regression function obtain the Iterative Matrix of minimum value solution;
Step S2: with not calculating coordinate conversion parameter initial value between described former rectangular coordinate system and described target rectangular coordinate system at three common points on the same straight line;
Step S3: the described coordinate conversion parameter initial value that calculates with described step S1 carries out iteration as the initial value of described Iterative Matrix, and iteration obtains the actual coordinate transformation parameter when satisfying desired precision;
Step S4: the actual coordinate transformation parameter that obtains with step S3 obtains the coordinate of have a few in described target rectangular coordinate system of described former rectangular coordinate system.
In coordinate data to be processed when being surveying instrument from measurement data that a plurality of erect-positions gather, the described measurement data of each described erect-position is based on a rectangular coordinate system of erect-position separately, the rectangular coordinate of selecting one of them erect-position is the target rectangular coordinate system, with the described measurement data of all the other erect-positions successively through above-mentioned steps S1, step S2, step S3 and step S4, can draw the coordinate of have a few in described target rectangular coordinate system of each erect-position, then gather and namely get the coordinate of each erect-position have a few in the target rectangular coordinate system.
That is to say, the measurement data of a plurality of different erect-positions of surveying instrument to be dealt with, the rectangular coordinate of selecting one of them erect-position is target-based coordinate system, and the measurement data of other erect-positions all is converted to coordinate in chosen target-based coordinate system, processes to finish the coordinate conversion data.
Coordinate transform for the measurement data of each erect-position, be configured to obtain by the regression function of each former coordinate system to same target-based coordinate system coordinate conversion parameter with this erect-position and the part or all of common point that is chosen to be the erect-position of target rectangular coordinate system, building method is as follows:
According to the least square ratio juris, according to known rectangular coordinate system coordinate transform formula, be coordinate system rotation, translation formula, above-mentioned match need to obtain six parameters of coordinate transform: namely around anglec of rotation jx, the jy of X, Y, Z axis, jz with along translation distance kx, ky, the kz of X, Y, Z axis.
The below is the bright solved function that how to obtain for instance.
Be provided with one group of spatial point, their coordinates in two rectangular coordinate system in space are respectively:
In first (target) rectangular coordinate system:
A1 (a1x, a1y, a1z), a2 (a2x, a2y, a2z) ..., an (anx, any, anz); A1, a2, an are the sign of spatial point, and aix, aiy, aiz are respectively x, y, the z coordinate (i=1 of an ai ... n).
In second (former) rectangular coordinate system:
B1 (b1x, b1y, b1z), b2 (b2x, b2y, b2z) ..., bn (bnx, bny, bnz); Equally, b1, b2, bn are the sign of spatial point, and bix, biy, biz are respectively x, y, the z coordinate (i=1 of a b1 ... n).
Now with bi to ai(i=1 ... n) match.
The coordinate system rotation translation formula is as follows:
Wherein jx, jy, jz are respectively the corners around X, Y, Z coordinate axis, and kx, ky, kz are that coordinate origin is along X, Y, Z translation of axes amount.
For a bi, it satisfies following formula through the coordinate figure after the coordinate transform:
Make di equal the difference of ai and bi '
We wish bi(i=1 ... n) should as far as possible near ai, because more near ai, show that the coordinate transform formula of constructing is more accurate through the coordinate figure after the coordinate transform.With least square method constructed fuction F (jx, jy, jz, kx, ky, kz):
Problem has just become and has asked jx, j y, jz, kx, ky, the kz that makes function F (jx, jy, jz, kx, ky, kz) obtain minimum value like this.
At first make function F that variable jx, j y, jz, kx, ky, kz are got respectively the single order partial derivative for minimizing, set up system of equations (5):
Because system of equations (5) is Nonlinear System of Equations, can use iterative algorithm to find the solution, here take Newton method as example.
Order
If simply set one group of initial value: jx0, jy0, jz0, kx0, ky0, kz0 bring system of equations (5) into and obtain
Make ki=fi (jx, jy, jz, kx, ky, kz) (i=1 ... 6); Then have:
Make Δ ki=ki-ki0(i=1 ... 6), Δ jx=jx-jx0, Δ jy=jy-jy0, Δ jz=jz-jz0, Δ kx=kx-kx0, Δ ky=ky-ky0, Δ kz=kz-kz0
Write as matrix form:
System of equations (8) is system of linear equations, can adopt the full pivoting elimination method of Gauss to find the solution Δ jx, Δ jy, Δ jz, Δ kx, Δ ky, Δ kz.
With Δ jx, Δ jy, Δ jz, Δ kx, Δ ky, Δ kz initial value is revised, is made initial value:
jx0=jx0+Δjx;jy0=jy0+Δjy;jz0=jz0+Δjz;kx0=kx0+Δkx;ky0=ky0+Δky;kz0=kz0+Δkz;
New initial value substitution formula (8) is continued to find the solution, until Δ ki is less than permissible accuracy, thereby draw the value of six parameters of transformation matrix of coordinates, thereby obtain the coordinate of have a few in same coordinate system of measurement data.
Yet, the precondition of being obtained desired solution by system of equations (5) is to provide one group of suitable initial value for it, obtain the solution of coming if the initial value that provides is improper and can only make function F (jx, jy, jz, kx, ky, kz) in its a certain field of definition, obtain minimal value, but can not make function F obtain minimum value in global scope, like this, carry out the purpose that coordinate transform just is difficult for reaching our data fitting with the solution of system of equations (5).
Therefore, need to provide one group of suitable initial value in the iterative process, just can obtain converging to the solution that makes function F obtain minimum value, thereby carry out fast and accurately.
Below, emphasis describes in detail to the acquisition of iterative initial value among the step S2:
Iterative initial value of the prior art, because therefore the arbitrariness of its value causes it not obtain minimum value in global scope, therefore, the present invention considers to go out to send the more suitable initial value of searching from common point.
Because three points not on same straight line can be determined the locus of a rectangular coordinate system, therefore, the present invention then uses first any three corresponding common points in two groups of data (coordinate of each common point in former rectangular coordinate system and target-based coordinate system), and must be point-blank three common points not, come the parameters in the rough calculation coordinate transform, then with it as initial value substitution Iterative Matrix iterative.
Choose not three points on same straight line, be respectively the first common point, the second common point and the 3rd common point, these three points can be the parts of the common point that the structure regression function is used among the step S1, also can not be the common points that the structure regression function is used among the step S 1.In conversion process, the coordinate of these three common points in the target rectangular coordinate system is a1 (a1x, a1y, a1z), a2 (a2x, a2y, a2z), a3 (a3x, a3y, a3z); The coordinate of these three common points in former rectangular coordinate system is b1 (b1x, b1y, b1z), b2 (b2x, b2y, b2z), b3 (b3x, b3y, b3z).As shown in Figure 1, we divide six parameters of nine step calculating coordinate changes, also namely obtain the iterative initial value of iteration function:
Step S21: the origin translation with these two coordinate systems arrives separately one of them common point place of coordinate system respectively.
For example move to first common point place, the changes in coordinates of these three common points is like this: a1 (0,0,0), a2 (a2x-a1x, a2y-a1y, a2z-a1z), a3 (a3x-a1x, a3y-a1y, a3z-a1z); B1 (0,0,0), b2 (b2x-b 1x, b2y-b1y, b2z-b1z), b3 (b3x-b1x, b3y-b1y, b3z-b1z).
Step S22: in two coordinate systems, utilize three common points separately to set up respectively a plane.
Plane equation is respectively:
(a2y*a3z-a2z*a3y)*x+(a3x*a2z-a2x*a3z)*y+(a2x*a3y-a3x*a2y)*z=0(9)
(b2y*b3z-b2z*b3y)*x+(b3x*b2z-b2x*b3z)*y+(b2x*b3y-b3x*b2y)*z=0(10)
Step S23: around the X-axis anglec of rotation jix (i=1,2) of coordinate system separately, the Y-axis of coordinate system is separately rotated in the plane of 3 foundation, recomputate the coordinate figure of the second common point and the 3rd common point after the rotation.
Wherein, anglec of rotation jix acquiring method is as follows:
Obtain separately the YZ plane of coordinate system and the intersection on 3 planes:
(a3x*a2z-a2x*a3z)*y+(a2x*a3y-a3x*a2y)*z=0;(11)
(b3x*b2z-b2x*b3z)*y+(b2x*b3y-b3x*b2y)*z=0;(12)
Obtain the separately angle jix (i=1,2) of Y-axis and this intersection.
Step S24: use the method identical with step S23 around the Y-axis anglec of rotation jiy (i=1,2) of coordinate system separately, X-axis is rotated in the plane that three common points set up, recomputate the coordinate figure of the second common point and the 3rd common point after the rotation.
Step S25: on the Z axis anglec of rotation jiz (i=1,2) of coordinate system separately rotates to X-axis separately the second common point.Recomputate the coordinate figure of rear the second common point of rotation and the 3rd common point.
Angle jiz can try to achieve by the coordinate figure of current the second common point.
Step S26: judge according to the second common point separately and the coordinate figure of the 3rd common point whether the current attitude of two coordinate systems is consistent, by coordinate system rotation coordinate system 2 to be become consistent with coordinate system 1 as inconsistent, the attitude here is inconsistent, the direction that mainly is the Z axis of two coordinate systems may be opposite, if opposite, the Z axis Rotate 180 degree of one of them coordinate system is got final product, and the below is to describe the Z axis Rotate 180 degree of former coordinate system as example.
Above step S21-step S26 is in fact by translation of axes and rotary manipulation, so that consistent with the attitude of target right angle two coordinate systems by the determined former rectangular coordinate system of described three common points; When carrying out translation and rotary manipulation, so long as it is consistent to reach attitude at last, do not limit the order between translation and the rotation, do not limit the rotation order to each coordinate axis yet.
Step S27: calculate the rotational transform matrix from former coordinate system transformation to target-based coordinate system.
If:
[RiX]: around the rotational transform matrix (i=1,2) of the X-axis of coordinate system i;
[RiY]: around the rotational transform matrix of the Y-axis of coordinate system i;
[RiZ]: around the rotational transform matrix of the Z axis of coordinate system i;
[R2M]: the attitude correction rotational transform matrix of former coordinate system.
Then can calculate from coordinate system 2 and transform to the rotational transform matrix [MZ] of coordinate system 1=[R1X] * [R1Y] * [R1Z] * [R2M] * [R2Z] * [R2Y] * [R2X], wherein the corner in each step is obtained in front the step.
Step S28: calculate from former coordinate system transformation to target-based coordinate system the rotational transform matrix jx, jy, jz.
[MZ] can simplify the following form that is expressed as:
We know the transformation matrix around three coordinate axis rotations of fixed coordinate system:
Utilize formula (13), (14) the anti-jx of solving, jy, jz from rotational transform matrix [MZ].
This is one group of transcendental equation, and 3 unknown numbers are arranged, and totally 9 equations wherein have 6 equations not independent, therefore can utilize 3 equations wherein to solve 3 unknown numbers.
Can find out:
If cosjy ≠ 0 then obtains the arc tangent expression formula at each angle:
jx=Atan2(r
32,r
33);
jz=Atan2(r
21,r
11);
Step S29: calculate translational movement kx, ky, kz from former coordinate system transformation to target-based coordinate system.
Former coordinate system is done rotational transform, makes former coordinate system parallel with original target-based coordinate system, asks at this moment in the former coordinate system position relationship of the first common point, then translational movement in the first common point and target-based coordinate system:
kx=a1x-b1x;
ky=a1y-b1y;
kz=a1z-b1z;
We have just obtained six whole initial values like this, whole six parameters of the transformation matrix of target rectangular coordinate system have also namely been obtained transforming to from former rectangular coordinate system, with these six parameters, as one group of initial value, be brought into system of equations (5) as initial value, obtain the Iterative Matrix (8) based on above-mentioned initial value, carry out iteration, until Δ ki less than permissible accuracy, can obtain the actual coordinate transformation parameter.
Obtain after the actual coordinate transformation parameter, namely can carry out coordinate transform according to coordinate conversion parameter, and then finish the coordinate system unification of impact point measurement data.
The below introduces the coordinate transform data treating apparatus of the embodiment of the invention again.
As shown in Figure 2, the coordinate transform data treating apparatus of the embodiment of the invention, the same coordinate data conversion process that is used for former rectangular coordinate system is the data in the target rectangular coordinate system, and require former rectangular coordinate system and described target rectangular coordinate system to have the not common point on the same straight line more than at least three, described coordinate transform data treating apparatus comprises constructing module, initial value module, iteration module and conversion module.
Constructing module, in order to receive the coordinate data in former rectangular coordinate system and these two coordinate systems of target rectangular coordinate system of common point, described coordinate data with part or all of described common point is constructed regression function with least square method, and draws by iteration and make regression function obtain the Iterative Matrix of minimum value solution; The initial value module is used for not calculating coordinate conversion parameter initial value between former rectangular coordinate system and target rectangular coordinate system at three common points on the same straight line; Iteration module: the described coordinate conversion parameter initial value that calculates with described initial value module carries out iteration as the initial value of the described Iterative Matrix that described constructing module obtains, and iteration obtains the actual coordinate transformation parameter when satisfying desired precision; Conversion module: the actual coordinate transformation parameter that obtains with described iteration module obtains the coordinate of have a few in the target rectangular coordinate system of former rectangular coordinate system.
Preferably, in described iteration module, comprise the authentication unit of verifying described actual coordinate transformation parameter accuracy with the described coordinate data of the described common point of part.In addition, described initial value module can comprise attitude adjustment submodule and calculating sub module, and wherein, attitude is adjusted submodule, be used for by translation of axes and rotary manipulation, so that consistent with the attitude of target right angle two coordinate systems by the determined former rectangular coordinate system of described three common points; And calculating sub module is used for calculating the rotational transform matrix from former coordinate system transformation to target-based coordinate system, and further calculates described coordinate conversion parameter initial value.
From the angle of refinement, the initial value module can comprise nine unit, is respectively: translation unit, be used for choosing not three common points on the same straight line, and the origin translation with described two coordinate systems arrives separately one of them common point place of coordinate system respectively; The unit is set up on the plane, sets up respectively a plane in order to utilize described three common points at described two coordinate systems; The first computing unit is in order to recomputate at the coordinate figure that the Y-axis of coordinate system is separately rotated to two other common point after described plane is set up in the plane of setting up the unit around the X-axis of coordinate system separately; The second computing unit rotates to X-axis the coordinate figure of described two other common point after described plane is set up in the plane of being set up the unit in order to recomputate behind the coordinate figure that calculates described two other common point at the first computing unit with the method identical with described the first computing unit around the Y-axis of coordinate system separately; The 3rd computing unit is in order to recomputate the coordinate figure of described two other common point after the Z axis of coordinate system separately rotates to X-axis one of separately described two other common point behind the coordinate figure that calculates described two other common point at the second computing unit; The attitude adjustment unit, in order to judging according to the coordinate figure of described two other common point whether the current attitude of described two coordinate systems consistent behind the coordinate figure that calculates described two other common point at the 3rd computing unit, as inconsistent then make by the Z axis that rotates one of them coordinate system as described in the attitude of two coordinate systems consistent; The 4th computing unit is in order to calculate the rotational transform matrix that transforms to the target rectangular coordinate system from former rectangular coordinate system; The 5th computing unit, in order to calculate from former rectangular coordinate system transform to the target rectangular coordinate system the rotational transform matrix each rotation parameter; The 6th computing unit is in order to calculate the translation parameters that transforms to the target rectangular coordinate system from former rectangular coordinate system.
The coordinate transform data treating apparatus of the embodiment of the invention, also can comprise and select module and summarizing module, for the treatment of the measurement data of surveying instrument from a plurality of erect-positions collections, the described measurement data of each described erect-position is based on a rectangular coordinate system of erect-position separately, it is the target rectangular coordinate system that described selection module is selected the rectangular coordinate of one of them erect-position, with the described measurement data of all the other erect-positions through described constructing module, described initial value module, described iteration module and described conversion module, the described summarizing module that is connected by described conversion module output terminal draws the coordinate of have a few in described target rectangular coordinate system of each erect-position.
Coordinate transform data disposal route and the device of the embodiment of the invention, utilize a large amount of measured datas and Lay Ka, FARO tracker Survey Software to compare, all verified accuracy and the high efficiency of coordinate transform data disposal route of the present invention, the below lifts one group of representational data declaration:
The point that one group of space distribution is arranged, wherein P1-P11 is for participating in the common point of match, and M1-M8 is the common point that carries out the data accuracy checking, and their coordinates in the target rectangular coordinate system are as shown in table 1:
Table 1
Point identification |
X |
Y |
Z |
P1 |
1816.1716 |
-2191.3525 |
3005.5751 |
P2 |
1813.7387 |
-2189.4396 |
2934.1564 |
P3 |
1814.056 |
-2260.0048 |
2927.3241 |
P4 |
1377.6407 |
-2191.0715 |
2987.4365 |
P5 |
978.0035 |
-2261.187 |
2910.2497 |
P6 |
1940.7238 |
-2191.02 |
2983.943 |
P7 |
1660.9106 |
-2191.4248 |
3009.215 |
P8 |
1660.5513 |
-2188.8867 |
2923.074 |
P9 |
1661.7163 |
-2259.5642 |
2916.1043 |
P10 |
1513.9315 |
-2259.6447 |
2912.1118 |
P11 |
1243.1777 |
-2191.0945 |
2987.0547 |
M1 |
1478.3761 |
-2257.8882 |
3014.2295 |
M2 |
1432.6217 |
-2257.9923 |
3017.7572 |
M3 |
1434.1124 |
-2258.5225 |
3035.8522 |
M4 |
1479.6889 |
-2258.4188 |
3032.3254 |
M5 |
1412.2861 |
-2260.4429 |
3031.4108 |
M6 |
1396.428 |
-2260.3072 |
3027.4152 |
M7 |
1400.0576 |
-2261.0156 |
3050.8963 |
M8 |
1414.0208 |
-2260.7404 |
3042.2607 |
Their coordinates in former rectangular coordinate system are as shown in table 2:
Table 2
Point identification |
X |
Y |
Z |
P1 |
324.28122 |
12988.851 |
-1799.2815 |
P2 |
392.00748 |
12978.787 |
-1778.737 |
P3 |
403.38715 |
13047.491 |
-1765.4518 |
P4 |
221.57278 |
12923.802 |
-1377.5492 |
P5 |
190.89428 |
12927.087 |
-965.68525 |
P6 |
379.12206 |
13003.982 |
-1912.1745 |
P7 |
278.27544 |
12967.093 |
-1652.5528 |
P8 |
360.65256 |
12955.096 |
-1630.261 |
P9 |
372.40376 |
13024.017 |
-1617.7275 |
P10 |
335.76861 |
13002.5 |
-1476.1252 |
P11 |
185.11783 |
12904.533 |
-1249.5642 |
M1 |
227.93949 |
13006.884 |
-1469.1289 |
M2 |
212.03197 |
13000.823 |
-1426.5127 |
M3 |
195.11505 |
13003.543 |
-1432.5418 |
M4 |
210.97294 |
13009.579 |
-1474.989 |
M5 |
193.52799 |
13001.82 |
-1410.3087 |
M6 |
193.00955 |
12998.978 |
-1394.2116 |
M7 |
171.52278 |
13002.77 |
-1403.6441 |
M8 |
183.6133 |
13003.551 |
-1414.7269 |
The difference of two cover coordinates is as shown in table 3:
Table 3
Point identification |
△X |
△Y |
△Z |
P1 |
1491.8904 |
-15180.203 |
4804.8566 |
P2 |
1421.7312 |
-15168.226 |
4712.8934 |
P3 |
1410.6689 |
-15307.495 |
4692.7759 |
P4 |
1156.0679 |
-15114.874 |
4364.9858 |
P5 |
787.10922 |
-15188.274 |
3875.9349 |
P6 |
1561.6017 |
-15195.002 |
4896.1175 |
P7 |
1382.6352 |
-15158.518 |
4661.7678 |
P8 |
1299.8987 |
-15143.983 |
4553.335 |
P9 |
1289.3125 |
-15283.581 |
4533.8317 |
P10 |
1178.1629 |
-15262.145 |
4388.237 |
P11 |
1058.0599 |
-15095.627 |
4236.6189 |
M1 |
1250.4366 |
-15264.772 |
4483.3583 |
M2 |
1220.5897 |
-15258.816 |
4444.27 |
M3 |
1238.9974 |
-15262.066 |
4468.394 |
M4 |
1268.716 |
-15267.998 |
4507.3144 |
M5 |
1218.7581 |
-15262.263 |
4441.7195 |
M6 |
1203.4185 |
-15259.285 |
4421.6269 |
M7 |
1228.5348 |
-15263.786 |
4454.5404 |
M8 |
1230.4075 |
-15264.291 |
4456.9877 |
Point in the former rectangular coordinate system is changed in the target rectangular coordinate system, got common point P1 ~ P11 and do match, the result of transformation result and common point M1-M8 is as shown in table 4:
Table 4
Point identification |
X |
Y |
Z |
P1 |
1816.1716 |
-2191.3525 |
3005.5751 |
P2 |
1813.7387 |
-2189.4396 |
2934.1564 |
P3 |
1814.056 |
-2260.0048 |
2927.3241 |
P4 |
1377.6407 |
-2191.0715 |
2987.4365 |
P5 |
978.0035 |
-2261.187 |
2910.2497 |
P6 |
1940.7238 |
-2191.02 |
2983.943 |
P7 |
1660.9106 |
-2191.4248 |
3009.215 |
P8 |
1660.5513 |
-2188.8867 |
2923.074 |
P9 |
1661.7163 |
-2259.5642 |
2916.1043 |
P10 |
1513.9315 |
-2259.6447 |
2912.1118 |
P11 |
1243.1777 |
-2191.0945 |
2987.0547 |
M1 |
1478.3761 |
-2257.8882 |
3014.2295 |
M2 |
1432.6217 |
-2257.9923 |
3017.7572 |
M3 |
1434.1124 |
-2258.5225 |
3035.8522 |
M4 |
1479.6889 |
-2258.4188 |
3032.3254 |
M5 |
1412.2861 |
-2260.4429 |
3031.4108 |
M6 |
1396.428 |
-2260.3072 |
3027.4152 |
M7 |
1400.0576 |
-2261.0156 |
3050.8963 |
M8 |
1414.0208 |
-2260.7404 |
3042.2607 |
Six drawn parameters of coordinate transform data disposal route through the embodiment of the invention are:
The angle of rotating around X, the Y of former coordinate system, Z axis is (radian):
RX 2.7420 RY 1.2850 RZ -0.2404
True origin along the distance that X, Y, Z axis move is:
X -1843.3988 Y 10305.0729 Z 1424.5272
Utilize the difference of coordinate after above-mentioned six parameters conversion and the coordinate of the described common point of table 2 in target-based coordinate system as shown in table 5:
Table 5
Call the roll |
△X |
△Y |
△Z |
P1 |
0 |
0 |
0 |
P2 |
0 |
0 |
0 |
P3 |
0 |
0 |
0 |
P4 |
0 |
0 |
0 |
P5 |
0 |
0 |
0 |
P6 |
0 |
0 |
0 |
P7 |
0 |
0 |
0 |
P8 |
0 |
0 |
0 |
P9 |
0 |
0 |
0 |
P10 |
-0.000001 |
0 |
0 |
P11 |
0 |
0 |
0 |
M1 |
0 |
0.000001 |
0 |
M2 |
0 |
0 |
0 |
M3 |
0 |
0 |
0 |
M4 |
0 |
0 |
0 |
M5 |
0 |
0.000001 |
0 |
M6 |
0 |
0 |
0 |
M7 |
0 |
0.000001 |
0 |
M8 |
0 |
0 |
0 |
The data of table 5 show, coordinate transform data disposal route of the present invention and device have higher accuracy, and the time of iteration convergence has also shortened, and have therefore improved the efficient of coordinate transform data processing.
Those skilled in the art should recognize change and the retouching of doing in the situation that does not break away from the scope and spirit of the present invention that the appended claim of the present invention discloses, all belong within the protection domain of claim of the present invention.