Disclosure of Invention
(one) solving the technical problems
Aiming at the defects of the prior art, the invention provides a method and a system for generating a three-dimensional real scenic spot cloud model, which are characterized in that a world coordinate system is established by taking an initial acquisition point as an origin, a laser scanner is used for scanning a target real scene, and spot cloud data are acquired; calculating the coordinates of the next acquisition point in the world coordinate system by measuring the distance between the last acquisition point and the next acquisition point and the angle in the three axial directions of the world coordinate system X, Y, Z; performing primary transformation on the acquired point cloud data coordinates through the angle between the laser scanner coordinate system and the world coordinate system X, Y, Z, performing secondary transformation on the acquired point cloud data coordinates through the coordinates of the current acquisition point positioned in the world coordinate system, and calculating the coordinates of each point in the world coordinate system; combining all the point cloud data into a complete point cloud data set; and generating a three-dimensional real-scene point cloud model by using the preprocessed point cloud data and using a three-dimensional reconstruction algorithm, so that the defects in the background technology are overcome.
(II) technical scheme
In order to achieve the above purpose, the invention is realized by the following technical scheme: the method for generating the three-dimensional scenic spot cloud model comprises the following steps of:
determining a target live-action, establishing an initial acquisition point in the direction right south of the target live-action, establishing a world coordinate system by taking the initial acquisition point as an original point, scanning the target live-action by a laser scanner, and acquiring point cloud data;
after the data acquisition of the initial acquisition point is completed, the data acquisition device moves to the next acquisition point, and the coordinates of the next acquisition point in the world coordinate system are calculated by measuring the distance between the previous acquisition point and the next acquisition point and the angles of the three axes of the world coordinate system X, Y, Z;
scanning the target live-action again by using a laser scanner, recording three-dimensional coordinates of each point in a laser scanner coordinate system, carrying out primary transformation on the acquired point cloud data coordinates through angles between the laser scanner coordinate system and the three axes of a world coordinate system X, Y, Z, carrying out secondary transformation on the acquired point cloud data coordinates through the coordinates of the current acquisition point in the world coordinate system, and calculating the coordinates of each point in the world coordinate system;
moving to the next acquisition point to continue to acquire point cloud data of the target live-action until the point cloud data acquisition of all the acquisition points is completed and the point cloud data are converted into coordinates of a world coordinate system, and combining all the point cloud data into a complete point cloud data set;
and generating a three-dimensional real-scene point cloud model by using a three-dimensional reconstruction algorithm through the preprocessed point cloud data, carrying out detail enhancement on the generated three-dimensional real-scene point cloud model, optimizing the enhanced three-dimensional real-scene point cloud model, and exporting the optimized three-dimensional real-scene point cloud model.
Further, determining a target real scene for generating a three-dimensional real scene point cloud model; selecting an acquisition point in the direct south of the target live-action as an initial acquisition point for establishing a world coordinate system; establishing a world coordinate system by taking an initial acquisition point as an origin, taking an east-west direction as an X-axis direction, taking a north-south direction as a Y-axis direction and taking an up-down direction as a Z-axis direction; and scanning the target live-action by using a laser scanner, and recording the three-dimensional coordinates of each point to form point cloud data.
Further, the coordinates of the next acquisition point in the world coordinate system are calculated by the distance between the previous acquisition point and the next acquisition point and the angle in the three-axis direction with the world coordinate system X, Y, Z, and the calculation formula is as follows:
;
wherein,、/>、/>respectively show the followingThe coordinates of one acquisition point in the X, Y, Z axis direction, S representing the distance between the last acquisition point and the next acquisition point,/for>、/>、/>Respectively representing the angles of the three axes of the previous acquisition point to the next acquisition point and the world coordinate system X, Y, Z.
Further, through the angle between the laser scanner coordinate system and the world coordinate system X, Y, Z, the current acquisition point is taken as an original point, the coordinate of the world coordinate system is taken as a direction, the acquired point cloud data coordinate is transformed once, the coordinate of each point is calculated, and the calculation formula is as follows:
;
wherein,、/>、/>respectively represents the coordinate of each point in the X, Y, Z axial direction after one transformation, +.>、/>、/>Respectively representing the coordinates of each point in the direction of the axis of the laser scanner coordinate system X, Y, Z, +.>、/>、/>The angles between the three axes of the laser scanner coordinate system and the world coordinate system X, Y, Z are shown, respectively.
Further, the coordinates of each point in the world coordinate system are calculated by performing secondary transformation on the acquired point cloud data coordinates through the coordinates of the current acquisition point in the world coordinate system, and the calculation formula is as follows:
;
wherein,、/>、/>representing the coordinates of each point in the direction of the axis of the world coordinate system X, Y, Z, respectively, +.>、/>、/>Respectively represents the coordinate of each point in the X, Y, Z axial direction after one transformation, +.>、/>、/>Respectively indicate whenThe front acquisition point is located at the coordinates in the direction of the axis of the world coordinate system X, Y, Z.
Further, moving to the next acquisition point to continuously acquire point cloud data of the target live-action until the point cloud data acquisition of all the acquisition points is completed, and converting the coordinates of the point cloud data into coordinates of a world coordinate system;
combining the point cloud data of all the acquired points into a complete point cloud data set, wherein the combined point cloud data set contains three-dimensional coordinate information of all the points in the target live-action;
preprocessing the combined point cloud data, including removing noise, filtering redundant data and removing overlapped data.
Further, generating a three-dimensional real scenic spot cloud model by using a three-dimensional reconstruction algorithm through the preprocessed spot cloud data;
carrying out detail enhancement on the generated three-dimensional scenic spot cloud model, including adding surface detail and texture mapping operation;
adopting an iterative optimization algorithm, and optimizing the enhanced three-dimensional scenic spot cloud model by continuously adjusting parameters and structures of the model;
and exporting the optimized three-dimensional scenic spot cloud model.
The system for generating the three-dimensional scenic spot cloud model comprises a data acquisition module, an acquisition coordinate conversion module, a spot cloud coordinate conversion module and a three-dimensional reconstruction module; wherein:
the data acquisition module scans the target live-action through the laser scanner, acquires point cloud data, and moves to the next acquisition point to continuously acquire the point cloud data of the target live-action until the point cloud data acquisition of all the acquisition points is completed;
the acquisition coordinate conversion module is used for moving to the next acquisition point after completing data acquisition of the initial acquisition point, and calculating the coordinate of the next acquisition point in the world coordinate system by measuring the distance between the previous acquisition point and the next acquisition point and the angle in the three-axis direction of the world coordinate system X, Y, Z;
the point cloud coordinate conversion module is used for carrying out primary conversion on the collected point cloud data coordinates through the angle between the laser scanner coordinate system and the world coordinate system X, Y, Z, carrying out secondary conversion on the collected point cloud data coordinates through the coordinates of the current collecting point positioned in the world coordinate system, and calculating the coordinates of each point in the world coordinate system;
the model generation module is used for generating a three-dimensional real scenic spot cloud model through the preprocessed point cloud data by using a three-dimensional reconstruction algorithm, carrying out detail enhancement on the generated three-dimensional real scenic spot cloud model, optimizing the enhanced three-dimensional real scenic spot cloud model, and exporting the optimized three-dimensional real scenic spot cloud model.
(III) beneficial effects
The invention provides a method and a system for generating a three-dimensional scenic spot cloud model, which have the following beneficial effects:
(1) By establishing the world coordinate system, the position relation of each point in space can be determined, a unified reference frame is provided for subsequent point cloud data processing and model generation, and meanwhile, the establishment of the world coordinate system is also beneficial to realizing fusion and registration between different data sources, and the precision and the integrity of the model are improved.
(2) The distance between the last acquisition point and the next acquisition point and the angle in the three-axis direction of the world coordinate system X, Y, Z can be accurately measured respectively by using the distance meter and the angle meter, and compared with a GPS and other positioning methods, the method has the advantages of being higher in precision, free from the influence of signal interference, capable of performing stable work in various environments and beneficial to improving the accuracy and stability of subsequent coordinate calculation.
(3) The world coordinate system can be used for describing the positions and the movements of various objects, various three-dimensional data processing and analysis can be conveniently carried out by converting the point cloud data into the world coordinate system, the subsequent three-dimensional modeling point cloud data splicing is facilitated, complex calculation is reduced, and modeling efficiency is improved.
(4) The coordinates of the point cloud data are converted into the coordinates of the world coordinate system, the data of different acquisition points can be ensured to have the same reference coordinate system, the point cloud data of different positions can be integrated together, unified analysis and processing are carried out, and meanwhile, the world coordinate system is convenient for subsequent application and visualization, so that the data are more visual and easier to understand.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1 and 2, the present invention provides a method for generating a three-dimensional scenic spot cloud model, which includes the following steps:
step one: determining a target live-action, establishing an initial acquisition point in the direction right south of the target live-action, establishing a world coordinate system by taking the initial acquisition point as an original point, scanning the target live-action by a laser scanner, and acquiring point cloud data;
the first step comprises the following steps:
step 101: determining a target real scene for generating a three-dimensional real scene point cloud model, wherein the target real scene comprises any object or scene with three-dimensional characteristics such as a building, a terrain, a scene and the like;
step 102: selecting an acquisition point in the direct south of the target live-action as an initial acquisition point for establishing a world coordinate system;
step 103: establishing a world coordinate system by taking an initial acquisition point as an origin, taking an east-west direction as an X-axis direction, taking a north-south direction as a Y-axis direction and taking an up-down direction as a Z-axis direction;
step 104: and scanning the target live-action by using a laser scanner, and recording the three-dimensional coordinates of each point to form point cloud data.
It should be noted that, a collection point is selected in the direction right south of the target live-action as an initial collection point, the selection of the collection point is critical to the subsequent establishment of the world coordinate system and the collection of the point cloud data, and by selecting a suitable initial collection point, the accurate relative position relationship between the established world coordinate system and the target live-action can be ensured, so that a reliable foundation is provided for the subsequent point cloud data processing and model generation.
In use, the contents of steps 101 to 104 are combined:
by establishing the world coordinate system, the position relation of each point in space can be determined, a unified reference frame is provided for subsequent point cloud data processing and model generation, and meanwhile, the establishment of the world coordinate system is also beneficial to realizing fusion and registration between different data sources, and the precision and the integrity of the model are improved.
Step two: after the data acquisition of the initial acquisition point is completed, moving to the next acquisition point, and calculating the coordinate of the next acquisition point in the world coordinate system by measuring the distance between the previous acquisition point and the next acquisition point and the angle in the three-axis direction of the world coordinate system X, Y, Z;
the second step comprises the following steps:
step 201: after completing the data acquisition of the initial acquisition point, moving to the next acquisition point;
step 202: measuring the distance between the last acquisition point and the next acquisition point by using a range finder, and measuring the angles of the last acquisition point to the next acquisition point and the world coordinate system X, Y, Z in the three-axis direction by using an angle meter;
step 203: the coordinates of the next acquisition point in the world coordinate system are calculated through the distance between the last acquisition point and the next acquisition point and the angle between the three axial directions of the world coordinate system X, Y, Z, and the calculation formula is as follows:
;
wherein,、/>、/>respectively representing the coordinates of the next acquisition point in the X, Y, Z axial direction, S represents the distance between the last acquisition point and the next acquisition point, +.>、/>、/>Respectively representing the angles of the three axes of the previous acquisition point to the next acquisition point and the world coordinate system X, Y, Z.
It should be noted that a laser range finder or an ultrasonic range finder is generally used to measure the distance between two acquisition points. The instrument can accurately measure the distance, has good stability for different environmental conditions (such as illumination, weather and the like) and is not easy to be disturbed by the environment.
In use, the contents of steps 201 to 203 are combined:
the distance between the last acquisition point and the next acquisition point and the angle in the three-axis direction of the world coordinate system X, Y, Z can be accurately measured respectively by using the distance meter and the angle meter, and compared with a GPS and other positioning methods, the method has the advantages of higher precision, no influence of signal interference, capability of performing stable work in various environments and contribution to improving the accuracy and stability of subsequent coordinate calculation.
Step three: scanning the target live-action again by using a laser scanner, recording three-dimensional coordinates of each point in a laser scanner coordinate system, carrying out primary transformation on the acquired point cloud data coordinates through angles between the laser scanner coordinate system and the three axes of a world coordinate system X, Y, Z, carrying out secondary transformation on the acquired point cloud data coordinates through the coordinates of the current acquisition point in the world coordinate system, and calculating the coordinates of each point in the world coordinate system;
the third step comprises the following steps:
step 301: scanning the target live-action by using the laser scanner again, and recording the three-dimensional coordinates of each point in a coordinate system of the laser scanner to form point cloud data;
the world coordinate system uses an initial acquisition point as an origin, uses an east-west direction as an X-axis direction, uses a north-south direction as a Y-axis direction, uses an up-down direction as a Z-axis direction, uses a laser emission center as an origin, uses a scanning plane initial direction as an X-axis, uses a direction vertical to a scanning plane as a Y-axis, and uses a direction vertical to the scanning plane and the Y-axis as a Z-axis;
step 302: measuring the angle between the coordinate system of the laser scanner and the three axes of the world coordinate system X, Y, Z by using an angle measuring instrument, carrying out primary transformation on the collected point cloud data coordinates by taking the current collected point as an original point and taking the coordinate axis of the world coordinate system as a direction, and calculating the coordinates of each point according to the following calculation formula:
;
wherein,、/>、/>respectively represents the coordinate of each point in the X, Y, Z axial direction after one transformation, +.>、/>、/>Respectively representing the coordinates of each point in the direction of the axis of the laser scanner coordinate system X, Y, Z, +.>、/>、/>Respectively representing the angles between the three axes of the laser scanner coordinate system and the world coordinate system X, Y, Z;
step 303: and carrying out secondary transformation on the acquired point cloud data coordinates through the coordinates of the current acquisition point in the world coordinate system, and calculating the coordinates of each point in the world coordinate system, wherein the calculation formula is as follows:
;
wherein,、/>、/>representing the coordinates of each point in the direction of the axis of the world coordinate system X, Y, Z, respectively, +.>、/>、/>Respectively represents the coordinate of each point in the X, Y, Z axial direction after one transformation, +.>、/>、/>Respectively representing the coordinates of the current acquisition point in the direction of the axis of the world coordinate system X, Y, Z.
The coordinates of each point after one transformation were calculated by rotating the laser scanner coordinate system so that the X, Y, Z axis of the laser scanner coordinate system and the X, Y, Z axis of the world coordinate system were in the same direction.
In use, the contents of steps 301 to 303 are combined:
the world coordinate system is a universal and unified coordinate reference system, can be used for describing the positions and movements of various objects, can conveniently process and analyze various three-dimensional data by converting the point cloud data into the world coordinate system, is beneficial to the splicing of the point cloud data of the subsequent three-dimensional modeling, reduces complex calculation and improves modeling efficiency.
Step four: moving to the next acquisition point to continue to acquire point cloud data of the target live-action until the point cloud data acquisition of all the acquisition points is completed and the point cloud data are converted into coordinates of a world coordinate system, and combining all the point cloud data into a complete point cloud data set;
the fourth step comprises the following steps:
step 401: moving to the next acquisition point to continuously acquire point cloud data of the target live-action until the point cloud data acquisition of all the acquisition points is completed, and converting the coordinates of the point cloud data into coordinates of a world coordinate system;
step 402: combining the point cloud data of all the acquired points into a complete point cloud data set, wherein the combined point cloud data set contains three-dimensional coordinate information of all the points in the target live-action;
step 403: preprocessing the combined point cloud data, including removing noise, filtering redundant data, removing overlapped data and the like;
specifically, noise is removed: noise may come from various factors in the scanning process, such as equipment errors, environmental interference and the like, and is realized through some filtering algorithms, including bilateral filtering, gaussian filtering and the like, and the algorithms can effectively smooth point cloud data and reduce the influence of noise;
filtering the redundant data: in the point cloud data, redundant points possibly exist, which have no practical meaning for the construction of a model, but increase the calculation amount and the complexity of the model, and the redundant data is removed by setting a threshold value or compressing and simplifying the point cloud data by using some algorithms (such as VoxelGrid filtering);
removing overlapping data: in the point cloud data, there may be some overlapped points, which may cause misleading during model construction, affect the accuracy of the model, and by calculating the distance between adjacent points, setting a threshold value, removing the points with too close distance, thereby removing the overlapped data.
It should be noted that, the point cloud data acquisition is performed on the target live-action until the point cloud data acquisition of all the acquisition points is completed, and the coordinate conversion of the point cloud data into the coordinate of the world coordinate system can be completed by repeating the second to third steps, and since the coordinate conversion of all the point cloud data into the coordinate of the world coordinate system is completed, the data registration of the point cloud data is not required any more, and the merging operation of the point cloud data can be directly completed.
In use, the contents of steps 401 to 403 are combined:
the coordinates of the point cloud data are converted into the coordinates of the world coordinate system, the data of different acquisition points can be ensured to have the same reference coordinate system, the point cloud data of different positions can be integrated together, unified analysis and processing are carried out, and meanwhile, the world coordinate system is convenient for subsequent application and visualization, so that the data are more visual and easier to understand.
Step five: and generating a three-dimensional real-scene point cloud model by using a three-dimensional reconstruction algorithm through the preprocessed point cloud data, carrying out detail enhancement on the generated three-dimensional real-scene point cloud model, optimizing the enhanced three-dimensional real-scene point cloud model, and exporting the optimized three-dimensional real-scene point cloud model.
The fifth step comprises the following steps:
step 501: generating a three-dimensional real scenic spot cloud model by using a three-dimensional reconstruction algorithm through the preprocessed spot cloud data;
step 502: carrying out detail enhancement on the generated three-dimensional scenic spot cloud model, including operations such as adding surface details, texture mapping and the like;
specifically, the enhancement of the surface detail is realized by increasing the density of point clouds, optimizing the ordering of the point clouds, removing redundant data and the like, and the surface precision of the model is improved by increasing the number of sampling points; sorting the point cloud data, removing noise and redundant data, and improving the stability and efficiency of the model; optimizing the point cloud data by using an optimization algorithm, reducing redundant data, and improving the efficiency and the precision of the model;
specifically, in the texture mapping process, texture information is mapped to the surface of a three-dimensional model, and a texture image is loaded and mapped to a three-dimensional scenic spot cloud model, so that the visual effect and the authenticity of the model are improved, and the texture image and the surface of the model are aligned and mapped by using a texture mapping algorithm, so that the texture is correctly mapped and displayed;
step 503: adopting an iterative optimization algorithm, and optimizing the enhanced three-dimensional scenic spot cloud model by continuously adjusting parameters and structures of the model;
step 504: and (3) exporting the optimized three-dimensional scenic spot cloud model, wherein the formats of the three-dimensional scenic spot cloud model comprise obj, stl and the like.
It should be noted that, in detail enhancement and optimization, a balance between accuracy and detail performance of the model needs to be considered. Excessive enhancement and optimization may result in the model losing its original details and features, while too simple enhancement and optimization may not meet the application requirements, so a suitable enhancement and optimization method needs to be selected according to the specific application scenario and requirements to obtain the best effect.
In use, the contents of steps 501 to 503 are combined:
by using a three-dimensional reconstruction algorithm to generate a three-dimensional real-scene point cloud model and performing detail enhancement and optimization, a high-quality and vivid three-dimensional real-scene model can be obtained, and better support is provided for subsequent three-dimensional modeling, visualization, space analysis and other applications.
Referring to fig. 3, the present invention further provides a system for generating a three-dimensional scenic spot cloud model, which includes a data acquisition module, an acquisition coordinate conversion module, a spot cloud coordinate conversion module, and a three-dimensional reconstruction module; wherein:
the data acquisition module scans the target live-action through the laser scanner, acquires point cloud data, and moves to the next acquisition point to continuously acquire the point cloud data of the target live-action until the point cloud data acquisition of all the acquisition points is completed;
the acquisition coordinate conversion module is used for moving to the next acquisition point after completing data acquisition of the initial acquisition point, and calculating the coordinate of the next acquisition point in the world coordinate system by measuring the distance between the previous acquisition point and the next acquisition point and the angle in the three-axis direction of the world coordinate system X, Y, Z;
the point cloud coordinate conversion module is used for carrying out primary conversion on the collected point cloud data coordinates through the angle between the laser scanner coordinate system and the world coordinate system X, Y, Z, carrying out secondary conversion on the collected point cloud data coordinates through the coordinates of the current collecting point positioned in the world coordinate system, and calculating the coordinates of each point in the world coordinate system;
the model generation module is used for generating a three-dimensional real scenic spot cloud model through the preprocessed point cloud data by using a three-dimensional reconstruction algorithm, carrying out detail enhancement on the generated three-dimensional real scenic spot cloud model, optimizing the enhanced three-dimensional real scenic spot cloud model, and exporting the optimized three-dimensional real scenic spot cloud model.
In the application, the related formulas are all the numerical calculation after dimensionality removal, and the formulas are one formulas for acquiring a large amount of data and performing software simulation to obtain the latest real situation, and coefficients in the formulas are set by a person skilled in the art according to the actual situation.
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application.