CN115953477B - Coordinate data processing method and device - Google Patents
Coordinate data processing method and device Download PDFInfo
- Publication number
- CN115953477B CN115953477B CN202211648538.4A CN202211648538A CN115953477B CN 115953477 B CN115953477 B CN 115953477B CN 202211648538 A CN202211648538 A CN 202211648538A CN 115953477 B CN115953477 B CN 115953477B
- Authority
- CN
- China
- Prior art keywords
- coordinate system
- inclinometer
- axis
- camera
- vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 10
- 238000006243 chemical reaction Methods 0.000 claims abstract description 58
- 238000000034 method Methods 0.000 claims abstract description 37
- 238000005259 measurement Methods 0.000 claims abstract description 20
- 239000013598 vector Substances 0.000 claims description 114
- 239000011159 matrix material Substances 0.000 claims description 59
- 230000009466 transformation Effects 0.000 claims description 47
- 238000004590 computer program Methods 0.000 claims description 16
- 230000001131 transforming effect Effects 0.000 claims description 13
- 238000004364 calculation method Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 10
- 238000012795 verification Methods 0.000 claims description 9
- 230000000694 effects Effects 0.000 abstract description 3
- 238000004422 calculation algorithm Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Landscapes
- Image Processing (AREA)
Abstract
The embodiment of the invention provides a coordinate data processing method and a device, wherein the method comprises the following steps: parameters of a camera coordinate system are obtained, and the camera coordinate system is converted into an inclinometer coordinate system according to a first conversion rule; acquiring parameters of an inclinometer coordinate system and parameters of a world coordinate system, and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule; and converting the point cloud data acquired by the camera into data of a world coordinate system through a first conversion rule and a second conversion rule. The method solves the problem of low accuracy of the coordinate fitting result of the building measurement equipment, and achieves the effect of improving the accuracy of the coordinate conversion result of the building measurement equipment.
Description
Technical Field
The embodiment of the invention relates to the field of data processing, in particular to a coordinate data processing method and device.
Background
The existing building measurement equipment has the measurement function that a 3D camera scans point clouds and evaluates the point clouds. In the measurement task, the measurement of the perpendicularity of the wall surface and the levelness of the ground is an important link, and the measurement needs to be completed in combination with the auxiliary inclinometer, and the perpendicularity of the wall surface and the levelness of the ground are fixedly installed together, and as shown in fig. 1, a camera is arranged above the inclinometer and an inclinometer is arranged below the inclinometer.
When the perpendicularity of the wall surface and the levelness of the ground are measured, the plane of the camera coordinate system XoY is kept horizontal, and in the actual measurement process, the posture of the camera and the inclinometer can be continuously changed along with the whole lower equipment, so that the camera and the inclinometer can not be always in a horizontal state, and therefore, the calibration task is to utilize known data to change the plane of the camera coordinate system XoY to be horizontal through a series of changes.
According to the traditional calibration method, three axes of two coordinate systems are aligned by shooting point clouds at multiple angles through an algorithm fitting transformation matrix, and meanwhile, the three axes are difficult to transform on the algorithm, long in sampling time and low in fitting result precision, so that the requirement of high precision in the field of building measurement cannot be met.
Therefore, the related art has the problem of low accuracy of the coordinate fitting result of the building measurement equipment.
In view of the above problems in the related art, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a coordinate data processing method and a coordinate data processing device, which at least solve the problem that the accuracy of a coordinate fitting result of building measurement equipment is low in the related technology.
According to an embodiment of the present invention, there is provided a coordinate data processing method applied to a 3D camera and inclinometer combined structure, including: parameters of a camera coordinate system are obtained, and the camera coordinate system is converted into the inclinometer coordinate system according to a first conversion rule; acquiring parameters of an inclinometer coordinate system and parameters of a world coordinate system, and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule; and converting the point cloud data acquired by the camera into data of the world coordinate system through the first conversion rule and the second conversion rule.
Further, obtaining parameters of an inclinometer coordinate system and parameters of a world coordinate system, converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule includes: acquiring an included angle alpha between the x axis of the inclinometer and the horizontal plane of the world coordinate system and an included angle beta between the y axis of the inclinometer and the horizontal plane of the world coordinate system; determining a normal vector of a horizontal plane of the world coordinate system, and determining a unit vector of an x axis of the inclinometer and a y axis vector of the inclinometer according to the included angle alpha and the included angle beta; performing direction constraint on the y-axis quantity of the inclinometer through preset parameters to obtain a constraint vector; calculating XoY plane normal vectors of the inclinometer coordinate system according to the constraint vector and the unit vector of the inclinometer x axis; calculating a basis transformation matrix according to XoY plane normal vectors of the inclinometer coordinate system, unit vectors of the world coordinate system x axis and vectors of the world coordinate system y axis; and transforming the basis transformation matrix to obtain an M matrix, wherein the M matrix is used for carrying out plane transformation on the inclinometer coordinate system XoY to be parallel to the horizontal plane of the world coordinate system.
Further, obtaining parameters of an inclinometer coordinate system and parameters of a world coordinate system, converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule includes: determining the unit vector of the x axis of the inclinometer asY-axis vector/>, of the inclinometerCalculating the included angle between the vector b and the world coordinate system horizontal plane through the formula (1): /(I)Formula (1); bringing the data of the vector a and the vector b into equation (1) to obtain equation (2)/>Formula (2); by parameter/>Performing direction constraint on the vector b to obtain a constraint vector/>Calculating XoY plane normal vector/>, of the inclinometer through formula (3)(Equation (3)); transforming the formula (3) to obtain the basis transformation matrix/>Using the basis transformation matrix to planar transform the inclinometer XoY to be parallel to world level: /(I)
Further, obtaining parameters of a camera coordinate system, converting the camera coordinate system into the inclinometer coordinate system according to a first conversion rule includes: performing parallel verification on the horizontal plane of the camera coordinate system and the XoY plane of the inclinometer coordinate system; in the case of verification passing, the passing matrixThe camera coordinate system is rotated by an angle gamma and then is in the same direction as the inclinometer coordinate system; by matrix/>The horizontal plane of the camera coordinate system is converted into the XoY plane of the inclinometer coordinate system.
Further, the parallel validation of the horizontal plane of the camera coordinate system and the XoY plane of the inclinometer coordinate system includes: after the camera and the inclinometer assembly are installed on the horizontal base, the horizontal base is adjusted to control the deflection angles of the X axis and the Y axis of the inclinometer to be 0 degrees; and acquiring a standard horizontal plane point cloud shot by a camera, acquiring a normal vector of a point cloud plane, and determining that the horizontal plane of the camera coordinate system is parallel to the XoY plane of the inclinometer coordinate system if the difference between the normal vector of the point cloud plane and the Z axis of the world coordinate system is smaller than a preset difference value.
Further, γ is determined by: and traversing each angle in a preset step length through codes in an [ -90 DEG, 90 DEG ] interval to carry out matrix MH to determine gamma, wherein the matrix MH is used for transforming the normal vector of each group of point cloud planes shot by the camera, and the angle gamma exists in the traversing process, so that the difference value between the normal vector of each point cloud plane after transformation and (0, 1) is in a preset range.
According to another embodiment of the present invention, there is provided a coordinate data processing apparatus applied to a 3D camera and inclinometer combined structure, including: the first acquisition unit is used for acquiring parameters of a camera coordinate system and converting the camera coordinate system into the inclinometer coordinate system according to a first conversion rule; the second acquisition unit is used for acquiring parameters of an inclinometer coordinate system and parameters of a world coordinate system and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule; and the conversion unit is used for converting the point cloud data acquired by the camera into the data of the world coordinate system through the first conversion rule and the second conversion rule.
Further, the second acquisition unit includes: the acquisition module is used for acquiring an included angle alpha between the x axis of the inclinometer and the horizontal plane of the world coordinate system and an included angle beta between the y axis of the inclinometer and the horizontal plane of the world coordinate system; the determining module is used for determining a normal vector of a horizontal plane of the world coordinate system, and determining a unit vector of an x axis of the inclinometer and a y axis vector of the inclinometer according to the included angle alpha and the included angle beta; the constraint module is used for carrying out direction constraint on the y-axis quantity of the inclinometer through preset parameters to obtain a constraint vector; the first calculation module is used for calculating XoY plane normal vectors of the inclinometer coordinate system according to the constraint vector and the unit vector of the inclinometer x axis; the second calculation module is used for calculating a basis transformation matrix according to the XoY plane normal vector of the inclinometer coordinate system, the unit vector of the world coordinate system x axis and the vector of the world coordinate system y axis; the transformation module is used for transforming the base transformation matrix to obtain an M matrix, wherein the M matrix is used for transforming the plane of the inclinometer coordinate system XoY to be parallel to the horizontal plane of the world coordinate system.
According to a further embodiment of the invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the invention, parameters of a camera coordinate system are obtained, and the camera coordinate system is converted into an inclinometer coordinate system according to a first conversion rule; acquiring parameters of an inclinometer coordinate system and parameters of a world coordinate system, and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule; the point cloud data acquired by the camera are converted into the data of the world coordinate system through the first conversion rule and the second conversion rule, so that the problem that the accuracy of the coordinate fitting result of the building measurement equipment is low in the related technology can be solved, and the effect of improving the accuracy of the coordinate conversion result of the building measurement equipment is achieved.
Drawings
Fig. 1 is a schematic structural view of the present embodiment;
Fig. 2 is a block diagram of a hardware structure of a mobile terminal of a coordinate data processing method according to an embodiment of the present invention;
FIG. 3 is a flow chart of a coordinate data processing method according to an embodiment of the present invention;
Fig. 4 is a schematic diagram of the positional relationship between two sets of coordinates in the present embodiment;
fig. 5 is a block diagram of a coordinate data processing apparatus according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the mobile terminal as an example, fig. 2 is a block diagram of a hardware structure of the mobile terminal according to an embodiment of the present application. As shown in fig. 2, the mobile terminal may include one or more (only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 2 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 2.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a coordinate data processing method in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-mentioned method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for processing coordinate data is provided, which is applied to a combined structure of a 3D camera and an inclinometer, and fig. 3 is a flowchart of the method for processing coordinate data according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
step S101, obtaining parameters of a camera coordinate system, and converting the camera coordinate system into an inclinometer coordinate system according to a first conversion rule;
Step S102, acquiring parameters of an inclinometer coordinate system and parameters of a world coordinate system, and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule;
Step S103, converting the point cloud data acquired by the camera into data of a world coordinate system through a first conversion rule and a second conversion rule.
The technical solution of this embodiment may be applied to a combination structure of a 3D camera and an inclinometer, in this embodiment, the inclinometer and the camera are fixedly installed together, and are used for scanning a building point cloud in building measurement, evaluating the point cloud to complete measurement, and evaluating the verticality of a wall surface and the levelness of the ground, so that it is required to convert the camera coordinate system into the inclinometer coordinate system according to parameters of the camera coordinate system and according to a certain rule, and convert the inclinometer coordinate system into a world coordinate system according to parameters of the inclinometer coordinate system and a second conversion rule. After the conversion mode is determined, point cloud data to be measured acquired through a camera can be converted into data of a world coordinate system through the two conversion rules, and the perpendicularity of the wall surface of a building to be measured, the levelness of the ground and the like can be judged through the data. The point cloud data can be data such as an image of a building to be measured, and the data conversion of the coordinate system is realized through the rule conversion, so that compared with the traditional algorithm fitting, the calculation amount of the data can be reduced, the conversion difficulty is reduced, the sampling time is reduced, and the calculation accuracy is improved.
In one exemplary embodiment, obtaining parameters of the inclinometer coordinate system and parameters of the world coordinate system, converting the inclinometer coordinate system to the world coordinate system according to the second conversion rule includes: acquiring an included angle alpha between an x axis of the inclinometer and the horizontal plane of the world coordinate system and an included angle beta between a y axis of the inclinometer and the horizontal plane of the world coordinate system; determining the normal vector of the horizontal plane of the world coordinate system, and determining the unit vector of the x axis of the inclinometer and the y axis vector of the inclinometer according to the included angle alpha and the included angle beta; performing direction constraint on the y-axis quantity of the inclinometer through preset parameters to obtain a constraint vector; calculating XoY plane normal vectors of an inclinometer coordinate system according to the constraint vector and a unit vector of an inclinometer x axis; calculating a basis transformation matrix according to XoY plane normal vectors of the inclinometer coordinate system, unit vectors of the world coordinate system x-axis and vectors of the world coordinate system y-axis; and transforming the basis transformation matrix to obtain an M matrix, wherein the M matrix is used for carrying out planar transformation on the inclinometer coordinate system XoY to be parallel to the horizontal plane of the world coordinate system.
In this embodiment, when the coordinate system is converted, the included angles between the x axis and the y axis of the inclinometer and the world coordinate system horizontal plane need to be obtained, the M matrix is calculated according to the included angles and various normal vectors, and the constraint relation is introduced, and the transformation relation is obtained by using the matrix, so that by such calculation, the XoY plane (XoY plane) of the inclinometer coordinate system can be transformed to be parallel to the world coordinate system horizontal plane, that is, the coordinate axes are the same or opposite, and since the rotation of the inclinometer around the world z axis does not affect the included angle with the world horizontal plane, the transformation of the z axis is not considered, and only the XoY plane of the inclinometer coordinate system needs to be transformed to the world coordinate system horizontal plane.
In one exemplary embodiment, obtaining parameters of the inclinometer coordinate system and parameters of the world coordinate system, converting the inclinometer coordinate system to the world coordinate system according to the second conversion rule includes: determining the unit vector of the x-axis of the inclinometer asY-axis vector of inclinometer/>Calculating the included angle between the vector b and the world coordinate system horizontal plane through the formula (1): /(I)Formula (1); bringing the data of vector a and vector b into equation (1) yields equation (2)/>Formula (2); by parameter/>The vector b is subjected to direction constraint to obtain a constraint vectorCalculating XoY plane normal vector of the inclinometer coordinate system through formula (3)(Equation (3)); transforming the formula (3) to obtain a basis transformation matrix/>Using the basis transformation matrix to planar transform the inclinometer XoY to be parallel to world level: /(I)Deforming the matrix M of the base transformation matrix to obtain a matrix M:
In one exemplary embodiment, obtaining parameters of a camera coordinate system, converting the camera coordinate system into an inclinometer coordinate system according to a first conversion rule includes: carrying out parallel verification on the horizontal plane of the camera coordinate system and the XoY plane of the inclinometer coordinate system; in the case of verification passing, the passing matrix The rotation angle gamma of the camera coordinate system is expressed and then is in the same direction as the coordinate system of the inclinometer; by matrix/>The horizontal plane of the camera coordinate system is converted to the XoY plane of the inclinometer coordinate system.
In this embodiment, the M matrix in the MH matrix is the M matrix obtained by the previous transformation, when the horizontal plane of the camera coordinate system is transformed into the XoY plane of the inclinometer coordinate system, the transformation rule between the parameters of the inclinometer coordinate system and the world coordinate system is needed, and the horizontal plane of the camera coordinate system can be transformed into the XoY plane of the inclinometer coordinate system through the MH matrix, so that the transformation from the camera coordinate system to the world coordinate system is finally realized, and the transformation accuracy is improved.
In one exemplary embodiment, parallel verification of the horizontal plane of the camera coordinate system (i.e., the XoY plane of the camera coordinate system) and the XoY plane of the inclinometer coordinate system includes: after the camera and the inclinometer assembly are installed on the horizontal base, the horizontal base is adjusted to control the deflection angles of the X axis and the Y axis of the inclinometer to be 0 degrees; and acquiring a standard horizontal plane point cloud shot by a camera, acquiring a normal vector of a point cloud plane, and determining that the horizontal plane of the camera coordinate system is parallel to the XoY plane of the inclinometer coordinate system if the difference between the normal vector of the point cloud plane and the Z axis of the world coordinate system is smaller than a preset difference value.
This embodiment enables conversion of the camera coordinate system to the inclinometer coordinate system, which requires alignment of the X-axis Y-axis of the camera coordinate system to the X-axis Y-axis of the inclinometer coordinate system. The existing data are: and (5) standard horizontal plane, horizontal plane point cloud data under a camera coordinate system and inclinometer data.
The traditional calibration algorithm has poor calibration precision for three shafts at the same time, and the embodiment can simplify the calibration process and improve the calibration precision. If the plane of the camera coordinate system XoY is parallel to the plane of the inclinometer coordinate system XoY, the camera coordinate system can make the two systems oriented in the same direction only by rotating around the Z axis by a certain angle, i.e. only one angle is required to be calibrated, so that the embodiment strictly requires that the planes of XoY of the two systems are parallel to each other after the camera and the inclinometer are assembled and fixed.
The assembled camera and inclinometer assembly is arranged on a horizontal base, the horizontal base is adjusted to control the deflection angles of an X axis and a Y axis of the inclinometer to be 0 degree, namely, the plane of the inclinometer XoY is horizontal, the adjustment can be automatic equipment adjustment or manual adjustment, the camera shoots a standard horizontal plane point cloud, the normal vector of the point cloud plane is obtained, and if the difference between the normal vector and a Z axis (0, 1) of a world coordinate system is extremely small (for example, less than 10 -5), the point cloud plane can be regarded as being parallel to the plane of the world coordinate system XoY.
In one exemplary embodiment, γ is determined by: and traversing each angle in a preset step length through codes in an interval of [ -90 degrees and 90 degrees to carry into a matrix MH to determine gamma, wherein the matrix MH is used for transforming the normal vector of each group of point cloud planes shot by a camera, and the angle gamma exists in the traversing process, so that the difference value between the normal vector of each point cloud plane after transformation and (0, 1) is in a preset range.
The camera adjusts various visual angles, and the point clouds of the standard horizontal plane are shot into a plurality of groups, and each group of point clouds meets the following conditions: after the transformation of the (MH matrix), the normal vector of the point cloud plane approaches (0, 1) infinitely. The gamma can be found out by a code traversing angle method, and within the interval of [ -90 degrees, 90 degrees ] the gamma is proper by taking a certain step length (for example, 0.01 degree) as a step and utilizing the normal vector of each group of point cloud planes to be transformed and leading the normal vector into a matrix to be established. If the system has no other significant errors, a certain angle gamma is necessarily present in the traversal process, each normal vector is infinitely close to (0, 1) after transformation, and the further the rotation angle is away from gamma, the larger the difference between the normal vector and (0, 1) is, so that the numerical value of gamma can be determined, and the calibration is completed.
The invention also provides a specific embodiment, and the technical scheme of the invention is described below in connection with the specific embodiment.
The calibration method (coordinate data conversion method) of the embodiment is divided into two stages, wherein the first stage is used for completing the calibration of the coordinate system of the inclinometer and the world coordinate system, and the second stage is used for completing the calibration of the coordinate system of the camera and the coordinate system of the inclinometer.
1. Inclinometer coordinate system and world coordinate system
Characteristics of the inclinometer: the inclinometer is internally provided with an X axis and a Y axis which are mutually perpendicular, and an included angle between the two axes and the horizontal plane is provided.
After the camera pose changes, both the x-axis and the y-axis of the inclinometer's internal coordinate system will be offset in direction from the world (absolute) coordinates.
In order to calculate the perpendicularity (relative to the world coordinate system level) of the point cloud, the point cloud needs to be transformed from the inclinometer coordinate system to the world coordinate system through the base, and the calculation of the perpendicularity and the levelness is independent of the rotation around the z axis, so that the XoY planes of the two systems only need to be parallel after transformation.
Theoretical solving:
1. The known conditions are: FIG. 4 is a schematic diagram showing the positional relationship between two sets of coordinates in the present embodiment, wherein the x-axis of the inclinometer forms an angle α with the world horizontal plane, and the y-axis of the inclinometer forms an angle β with the world horizontal plane;
2. the default level of the plane of the world coordinate system XoY is that the normal vector thereof is
3. Because the rotation of the inclinometer around the world z-axis does not affect the included angle between the inclinometer and the world horizontal plane, the inclinometer x-axis can be defaulted to be above the world x-axis and taken as a unit vector
4. Y-axis measurement of inclinometerThen there are:
Substituting data to obtain:
Irrespective of the modular length of the vector, x= -sin (α) can be made to constrain the direction, and parameters can be added according to the right-hand system and the actual rotation range The direction constraint is performed by:
5. the plane normal vector of the inclinometer XoY is:
The sum-up basis transformation matrix is:
the transformation of the inclinometer coordinate system XoY plane to horizontal can be accomplished by the following calculation:
2. Camera coordinate system and inclinometer coordinate system
This part of the calibration requires that the X-axis Y-axis of the camera coordinate system be aligned (in the same direction) with the X-axis Y-axis of the inclinometer coordinate system. The existing data are: and (5) standard horizontal plane, horizontal plane point cloud data under a camera coordinate system and inclinometer data.
The traditional calibration algorithm has poor calibration precision on three shafts at the same time, and the embodiment aims at simplifying the calibration process and improving the calibration precision. In fact, if the plane of the camera coordinate system XoY is parallel to the plane of the inclinometer coordinate system XoY, the camera coordinate system can be aligned by rotating the camera coordinate system only by a certain angle around the Z axis, i.e. only by calibrating an angle. Therefore, the present embodiment strictly requires that the planes XoY of the two systems are parallel to each other after the camera and the inclinometer are assembled and fixed. The method for verifying parallelism is as follows:
and mounting the assembled camera and inclinometer assembly on a horizontal base, and adjusting the horizontal base to control the deflection angles of an X axis and a Y axis of the inclinometer to be 0 degrees, namely, enabling the plane of the inclinometer XoY to be horizontal. The camera shoots a standard horizontal plane point cloud, acquires a normal vector of a point cloud plane, and if the difference between the normal vector and the Z axis (0, 1) of the world coordinate system is very small (for example, less than 10 -5 or other numerical values are set according to scene needs), the point cloud plane can be regarded as being parallel to the plane of the world coordinate system XoY.
Under the premise of parallelism, if the angle gamma exists so that the camera coordinate system can be in the same direction with the inclinometer coordinate system after rotating gamma, the rotation transformation can be expressed as follows:
The entire transformation process can be written as:
the rotation angle gamma calibration method comprises the following steps:
The camera adjusts various visual angles and shoots a plurality of groups of point clouds of a standard horizontal plane. Each group of point clouds should satisfy: after the transformation, the normal vector of the point cloud plane approaches (0, 1) infinitely.
And gamma can be found out by a code traversal angle method, and the normal vector of each group of point cloud planes is transformed by the above formula (MH matrix) by taking 0.01 degree as step length in the range of [ -90 degrees, 90 degrees ]. If the system has no other significant errors, a certain angle gamma is necessarily present in the traversal process, so that each normal vector is infinitely close to (0, 1) after transformation, and the further the rotation angle is away from gamma, the larger the difference between the normal vector and (0, 1) is.
And (5) finishing the calibration.
In summary, the calibration process utilizes two items of data of the inclinometer, point cloud data shot by the camera and a standard horizontal plane. After a calculation formula is deduced by the first-stage theory, the calibration tasks of different equipment can be completed by substituting the data of the inclinometer; in the second stage, the horizontal plane point cloud needs to be shot, the required data volume is small, and generally, high calibration precision can be obtained through 5 to 7 groups of point clouds.
In principle, the calibration method of the 3D camera and inclinometer combined structure of the embodiment does not depend on a complex optimization algorithm, and the calibration is completed based on a basic vector and matrix transformation principle, so that the form is concise; from the operation, the method can complete calibration by collecting a small amount of data, and can greatly reduce the labor and time cost; after the calibration according to the method, the measurement error of the wall perpendicularity and the ground levelness can be controlled within 0.1 degrees, and the industry leading level is achieved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiment also provides a coordinate data processing device, which is used for implementing the above embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 5 is a block diagram of a coordinate data processing apparatus according to an embodiment of the present invention, as shown in fig. 5, including:
A first obtaining unit 10, configured to obtain parameters of a camera coordinate system, and convert the camera coordinate system into an inclinometer coordinate system according to a first conversion rule;
a second obtaining unit 20 for obtaining parameters of the inclinometer coordinate system and parameters of the world coordinate system, and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule;
the conversion unit 30 is configured to convert the point cloud data acquired by the camera into data of a world coordinate system through a first conversion rule and a second conversion rule.
The embodiment acquires parameters of a camera coordinate system through the first acquisition unit 10, and converts the camera coordinate system into an inclinometer coordinate system according to a first conversion rule; the second acquisition unit 20 acquires parameters of the inclinometer coordinate system and parameters of the world coordinate system, and converts the inclinometer coordinate system into the world coordinate system according to a second conversion rule; the conversion unit 30 converts the point cloud data acquired by the camera into data of the world coordinate system through the first conversion rule and the second conversion rule, so that the problem of low accuracy of the coordinate fitting result of the building measurement equipment in the related technology can be solved, and the effect of improving the accuracy of the coordinate conversion result of the building measurement equipment can be achieved.
In one exemplary embodiment, the second acquisition unit 20 includes: the acquisition module is used for acquiring an included angle alpha between the x axis of the inclinometer and the horizontal plane of the world coordinate system and an included angle beta between the y axis of the inclinometer and the horizontal plane of the world coordinate system; the determining module is used for determining the normal vector of the horizontal plane of the world coordinate system, and determining the unit vector of the x axis of the inclinometer and the y axis vector of the inclinometer according to the included angle alpha and the included angle beta; the constraint module is used for carrying out direction constraint on the y-axis quantity of the inclinometer through preset parameters to obtain a constraint vector; the first calculation module is used for calculating XoY plane normal vectors of the inclinometer coordinate system according to the constraint vector and the unit vector of the inclinometer x axis; the second calculation module is used for calculating a basis transformation matrix according to the XoY plane normal vector of the inclinometer coordinate system, the unit vector of the world coordinate system x axis and the vector of the world coordinate system y axis; the transformation module is used for transforming the base transformation matrix to obtain an M matrix, wherein the M matrix is used for carrying out planar transformation on the inclinometer coordinate system XoY to be parallel to the horizontal plane of the world coordinate system.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; or the above modules may be located in different processors in any combination.
Embodiments of the present invention also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. The coordinate data processing method is applied to a combined structure of a 3D camera and an inclinometer, and is characterized by comprising the following steps:
Acquiring parameters of a camera coordinate system, converting the camera coordinate system into an inclinometer coordinate system according to a first conversion rule includes:
performing parallel verification on the horizontal plane of the camera coordinate system and the XoY plane of the inclinometer coordinate system;
In the case of verification passing, the passing matrix The camera coordinate system is rotated by an angle gamma and then is in the same direction as the inclinometer coordinate system;
Through matrix Converting the horizontal plane of the camera coordinate system into a XoY plane of the inclinometer coordinate system;
obtaining parameters of an inclinometer coordinate system and parameters of a world coordinate system, and converting the inclinometer coordinate system into the world coordinate system according to a second conversion rule comprises:
acquiring an included angle alpha between the x axis of the inclinometer and the horizontal plane of the world coordinate system and an included angle beta between the y axis of the inclinometer and the horizontal plane of the world coordinate system;
Determining a normal vector of a horizontal plane of the world coordinate system, and determining a unit vector of an x axis of the inclinometer and a y axis vector of the inclinometer according to the included angle alpha and the included angle beta;
Performing direction constraint on the y-axis quantity of the inclinometer through preset parameters to obtain a constraint vector;
Calculating XoY plane normal vectors of the inclinometer coordinate system according to the constraint vector and the unit vector of the inclinometer x axis;
calculating a basis transformation matrix according to XoY plane normal vectors of the inclinometer coordinate system, unit vectors of the world coordinate system x axis and vectors of the world coordinate system y axis;
transforming the base transformation matrix to obtain an M matrix, wherein the M matrix is used for carrying out plane transformation on the inclinometer coordinate system XoY to be parallel to the horizontal plane of the world coordinate system;
And converting the point cloud data acquired by the camera into data of the world coordinate system through the first conversion rule and the second conversion rule.
2. The method of claim 1, wherein obtaining parameters of an inclinometer coordinate system and parameters of a world coordinate system, converting the inclinometer coordinate system to the world coordinate system according to a second conversion rule comprises:
Determining the unit vector of the x axis of the inclinometer as Y-axis measurement of the inclinometer
Calculating the included angle between the vector b and the world coordinate system horizontal plane through the formula (1):
Bringing the data of the vector a and the vector b into formula (1) to obtain formula (2),
By parameters ofPerforming direction constraint on the vector b to obtain a constraint vector
Calculating the XoY plane XoY plane normal vector of the inclinometer coordinate system through a formula (3)
Transforming the formula (3) to obtain the base transformation matrixUsing the basis transformation matrix to planar transform the inclinometer XoY to be parallel to world level:
3. The method of claim 1, wherein verifying parallelism of a horizontal plane of the camera coordinate system and a XoY plane of the inclinometer coordinate system comprises:
After the camera and the inclinometer assembly are installed on the horizontal base, the horizontal base is adjusted to control the deflection angles of the X axis and the Y axis of the inclinometer to be 0 degrees;
And acquiring a standard horizontal plane point cloud shot by a camera, acquiring a normal vector of a point cloud plane, and determining that the horizontal plane of the camera coordinate system is parallel to the XoY plane of the inclinometer coordinate system if the difference between the normal vector of the point cloud plane and the Z axis of the world coordinate system is smaller than a preset difference value.
4. The method according to claim 1, characterized in that γ is determined by:
And traversing each angle in a preset step length through codes in an [ -90 DEG, 90 DEG ] interval to carry out matrix MH to determine gamma, wherein the matrix MH is used for transforming the normal vector of each group of point cloud planes shot by the camera, and the angle gamma exists in the traversing process, so that the difference value between the normal vector of each point cloud plane after transformation and (0, 1) is in a preset range.
5. The utility model provides a coordinate data processing device is applied to 3D camera and inclinometer integrated configuration, its characterized in that includes:
the first obtaining unit is configured to obtain parameters of a camera coordinate system, convert the camera coordinate system into the inclinometer coordinate system according to a first conversion rule, and include:
performing parallel verification on the horizontal plane of the camera coordinate system and the XoY plane of the inclinometer coordinate system;
In the case of verification passing, the passing matrix The camera coordinate system is rotated by an angle gamma and then is in the same direction as the inclinometer coordinate system;
Through matrix Converting the horizontal plane of the camera coordinate system into a XoY plane of the inclinometer coordinate system;
The second obtaining unit is configured to obtain parameters of an inclinometer coordinate system and parameters of a world coordinate system, and convert the inclinometer coordinate system into the world coordinate system according to a second conversion rule, where the second obtaining unit includes:
the acquisition module is used for acquiring an included angle alpha between the x axis of the inclinometer and the horizontal plane of the world coordinate system and an included angle beta between the y axis of the inclinometer and the horizontal plane of the world coordinate system;
The determining module is used for determining a normal vector of a horizontal plane of the world coordinate system, and determining a unit vector of an x axis of the inclinometer and a y axis vector of the inclinometer according to the included angle alpha and the included angle beta;
The constraint module is used for carrying out direction constraint on the y-axis quantity of the inclinometer through preset parameters to obtain a constraint vector;
the first calculation module is used for calculating XoY plane normal vectors of the inclinometer coordinate system according to the constraint vector and the unit vector of the inclinometer x axis;
The second calculation module is used for calculating a basis transformation matrix according to the XoY plane normal vector of the inclinometer coordinate system, the unit vector of the world coordinate system x axis and the vector of the world coordinate system y axis;
The transformation module is used for transforming the base transformation matrix to obtain an M matrix, wherein the M matrix is used for carrying out plane transformation on the inclinometer coordinate system XoY to be parallel to the horizontal plane of the world coordinate system;
and the conversion unit is used for converting the point cloud data acquired by the camera into the data of the world coordinate system through the first conversion rule and the second conversion rule.
6. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program, wherein the computer program is arranged to execute the method of any of the claims 1 to 4 when run.
7. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211648538.4A CN115953477B (en) | 2022-12-20 | 2022-12-20 | Coordinate data processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211648538.4A CN115953477B (en) | 2022-12-20 | 2022-12-20 | Coordinate data processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115953477A CN115953477A (en) | 2023-04-11 |
CN115953477B true CN115953477B (en) | 2024-05-14 |
Family
ID=87296701
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211648538.4A Active CN115953477B (en) | 2022-12-20 | 2022-12-20 | Coordinate data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115953477B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102152307A (en) * | 2011-01-24 | 2011-08-17 | 西安交通大学 | Inclination-angle-constraint-based kinematic calibration method for Stewart parallel robot |
WO2016123813A1 (en) * | 2015-02-07 | 2016-08-11 | 华为技术有限公司 | Attitude relationship calculation method for intelligent device, and intelligent device |
CN106813638A (en) * | 2017-03-15 | 2017-06-09 | 吉林大学 | A kind of 3RPS parallel robots geometric parameter discrimination method |
CN108645428A (en) * | 2018-05-10 | 2018-10-12 | 天津大学 | The monoblock type scaling method of six degree of freedom laser target |
CN110705433A (en) * | 2019-09-26 | 2020-01-17 | 杭州鲁尔物联科技有限公司 | Bridge deformation monitoring method, device and equipment based on visual perception |
CN114842090A (en) * | 2022-04-21 | 2022-08-02 | 天津大学 | Visual inertia calibration system based on precise angle reference and calibration method thereof |
-
2022
- 2022-12-20 CN CN202211648538.4A patent/CN115953477B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102152307A (en) * | 2011-01-24 | 2011-08-17 | 西安交通大学 | Inclination-angle-constraint-based kinematic calibration method for Stewart parallel robot |
WO2016123813A1 (en) * | 2015-02-07 | 2016-08-11 | 华为技术有限公司 | Attitude relationship calculation method for intelligent device, and intelligent device |
CN106813638A (en) * | 2017-03-15 | 2017-06-09 | 吉林大学 | A kind of 3RPS parallel robots geometric parameter discrimination method |
CN108645428A (en) * | 2018-05-10 | 2018-10-12 | 天津大学 | The monoblock type scaling method of six degree of freedom laser target |
CN110705433A (en) * | 2019-09-26 | 2020-01-17 | 杭州鲁尔物联科技有限公司 | Bridge deformation monitoring method, device and equipment based on visual perception |
CN114842090A (en) * | 2022-04-21 | 2022-08-02 | 天津大学 | Visual inertia calibration system based on precise angle reference and calibration method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN115953477A (en) | 2023-04-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105133840B (en) | A kind of construction method of hyperboloid furred ceiling | |
CN101100061A (en) | Measuring device and calibration method | |
CN104034514A (en) | Large visual field camera nonlinear distortion correction device and method | |
CN109465830B (en) | Robot monocular stereoscopic vision calibration system and method | |
CN110398208A (en) | Big data deformation monitoring method based on photographic measuring apparatus system | |
CN107480356B (en) | Component design and inspection integrated method based on CATIA and laser tracker | |
CN110868269B (en) | Method and device for determining synchronization between sensors, electronic equipment and storage medium | |
CN101271573B (en) | Image deformation calibration method irrespective with shooting apparatus | |
CN111381209A (en) | Distance measurement positioning method and device | |
CN111562563A (en) | Laser radar rotary table calibration method and device and computer readable storage medium | |
CN111932637B (en) | Vehicle body camera external parameter self-adaptive calibration method and device | |
CN109448040A (en) | A kind of machinery production manufacture displaying auxiliary system | |
CN103438872A (en) | Indoor and field integrated system based on dam three-dimension forward intersection measurement | |
CN115953477B (en) | Coordinate data processing method and device | |
CN116071496A (en) | Data processing system based on three-dimensional modeling technology | |
CN111429529A (en) | Calibration method for coordinate transformation, electronic equipment and computer storage medium | |
KR20210009019A (en) | System for determining position and attitude of camera using the inner product of vectors and three-dimensional coordinate transformation | |
CN115018922A (en) | Distortion parameter calibration method, electronic device and computer readable storage medium | |
CN109177138A (en) | A kind of alignment method and device of glass and diaphragm | |
CN112650095B (en) | Highly automated engineering measurement method | |
CN114608540A (en) | Measurement network type determining method of digital photogrammetric system | |
CN113850875A (en) | Gunlock calibration method and device and electronic equipment | |
CN114926545A (en) | Camera calibration precision evaluation method and device, electronic equipment and storage medium | |
CN115047438A (en) | Data correction method, data correction device, electronic equipment and storage medium | |
CN112001857A (en) | Image correction method, system and equipment based on binocular camera and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |