Space coordinate registration method and device of point cloud data based on three-dimensional scanning
By using control point marks with encoded information in three-dimensional scanning technology, the problem of lack of unique marks in the control point marks in the prior art is solved, and automatic spatial coordinate registration of point cloud data is realized, efficiency and accuracy are improved, and cost is reduced.
Patent Information
- Application Number
- CN202410618658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2025-04-15
AI Technical Summary
In the existing three-dimensional scanning technology, the control point mark lacks coding information, resulting in the inability to realize unique identification, requiring manual interpretation and operation, which is inefficient and difficult to achieve full automation.
By setting control point marks with coded information, the coordinate relationship between point cloud data and measurement data is established, the spatial coordinates of point cloud data are automatically registered with coded information, and the difficulty of identifying control point marks is reduced through the conversion from three-dimensional to two-dimensional and then to three-dimensional.
Automatic spatial coordinate registration of point cloud data is realized, efficiency and accuracy are improved, manpower and material costs are reduced, and the problem of automatically identifying complex QR code control point marks in the prior art is avoided.
Smart Images

Figure CN119832030A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional scanning technology, and in particular to a spatial coordinate alignment method, device, equipment and storage medium based on three-dimensional scanning point cloud data. Background Art
[0002] 3D scanning is a common method for collecting spatial data such as topography, buildings, production lines, chemical plants, grottoes, and ancient sites in digital twins and 3D digitization of cultural relics. According to national and industry standards, 3D scanning must first determine the spatial reference to be used before conducting control measurements, including: laying out the control network, setting control point markers, and measuring control point coordinates; finally, 3D scanning is performed, and the scanned data is aligned to the determined spatial reference through control measurement data.
[0003] The control point markers used in the existing 3D scanning control point layout do not contain coding information; since the control point markers do not contain coding information, the uniqueness of the control point markers cannot be achieved; as a result, the control point marker information of 3D scanning cannot be identified and determined through unique identification codes under the existing industry specifications. When aligning 3D scanning data to the spatial reference, manual interpretation and operation are required to achieve the correspondence of control point markers and the assignment of measurement data. The work is cumbersome, inefficient, and difficult to achieve fully automated processing. However, if control point markers containing coding information are used, existing point cloud processing software will find it difficult to identify control point markers containing coding information. Summary of the invention
[0004] The present invention provides a method, device, equipment and storage medium for spatial coordinate registration of point cloud data based on three-dimensional scanning; by setting control point marks with coded information, a coordinate relationship between point cloud data and measurement data can be established, and automatic registration of the spatial coordinates of point cloud data can be achieved through the coordinate relationship, and the three-dimensional control point mark coordinates are converted from three-dimensional to two-dimensional and then to three-dimensional, which reduces the difficulty of identifying the control point marks, improves efficiency and accuracy, and reduces manpower and material costs.
[0005] In a first aspect, an embodiment of the present invention provides a spatial coordinate registration method for point cloud data based on three-dimensional scanning, and the coordinate registration method for point cloud data based on three-dimensional scanning includes:
[0006] Setting control point marks on the object to be scanned according to preset requirements;
[0007] The preset requirements include: the size of the control point mark, the number of the control point marks and the position of the control point marks;
[0008] The positions of the control point marks are measured in the measurement coordinate system to obtain the measurement file;
[0009] The measurement file includes: a unique identifier of the control point mark and the coordinates of the control point mark;
[0010] Perform three-dimensional scanning on the object to be scanned to obtain point cloud data of multiple scanning stations;
[0011] The spatial coordinates in the point cloud data are registered according to the preset registration algorithm and the measurement file to obtain the spatial coordinates corresponding to the spatial coordinates in the point cloud data in the measurement coordinate system.
[0012] Optionally, setting control point marks on the object to be scanned according to preset requirements includes:
[0013] Determine the size of the control point mark according to the resolution and scanning distance of the three-dimensional scan;
[0014] The location and number of control point markers are set based on the specifications of 3D scanning;
[0015] The coding information of the control point mark includes: a unique identifier of the control point mark and the coordinates of the control point mark.
[0016] Optionally, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and the measurement file includes:
[0017] Randomly load the point cloud data of a scanning station to obtain the first point cloud;
[0018] Calculate the number and coordinates of control point markers in the first point cloud according to a preset algorithm;
[0019] If the number of control point markers in the first point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the first point cloud are aligned according to a preset method.
[0020] Optionally, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and a measurement file also includes:
[0021] If the number of control point marks in the first point cloud is less than the number threshold, point cloud data of a scanning station adjacent to the scanning station corresponding to the first point cloud is loaded to obtain a second point cloud;
[0022] Calculate the number and coordinates of control point markers in the second point cloud according to a preset algorithm;
[0023] If the number of control point markers in the second point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the second point cloud are aligned according to a preset method.
[0024] Optionally, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and a measurement file also includes:
[0025] If the number of control point markers in the second point cloud is less than the number threshold, a first transformation matrix for splicing the second point cloud to the first point cloud is calculated according to the I CP or NDT algorithm;
[0026] splicing the second point cloud to the first point cloud according to the first transformation matrix to obtain a third point cloud;
[0027] Calculate the number and coordinates of control point markers in the third point cloud according to a preset algorithm;
[0028] If the number of control point markers in the third point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the third point cloud are aligned according to a preset method.
[0029] Optionally, the number and coordinates of control point markers in the point cloud are calculated according to a preset algorithm, including:
[0030] The virtual camera is placed at the center point of the scanner during scanning, and multiple point cloud images with different shooting angles are collected by shooting at multiple preset angles.
[0031] Traversing the point cloud image and identifying the unique identifier corresponding to the control point mark in the point cloud image and the coordinates of the four corner points of the control point mark in the image plane coordinate system;
[0032] Wherein, the number of control point markers is determined by the number of unique identifiers extracted;
[0033] The azimuth and elevation angles of the four corner points marked by the control points in the point cloud are calculated according to the coordinates of the four corner points and the shooting parameters of the virtual camera;
[0034] According to the azimuth angle of the field of view, the pitch angle of the field of view, the coordinates of the virtual camera, and the coordinates of the four corner points, the straight line equations of the four rays from the coordinate point of the virtual camera to the four corner points are established;
[0035] Encapsulate the point cloud according to the triangulated network and build a mesh model of the point cloud;
[0036] Calculate and obtain four intersection points between the four rays and the grid model; wherein the four intersection points constitute four spatial triangular faces;
[0037] Project the points of the point cloud onto each triangular face along the normal direction of the spatial triangular face; wherein all the points of the point cloud whose projection points are within the spatial triangular face are the point cloud set marked by the control points;
[0038] The center coordinates of the control point marker in the point cloud are determined based on the point cloud set of the control point marker.
[0039] Optionally, if the number of control point markers in the point cloud is greater than or equal to a number threshold, the spatial coordinates corresponding to the point cloud are aligned according to a preset method, including:
[0040] According to the unique identifier of the control point mark, the coordinates of the control point mark in the measurement file are matched with the coordinates of the control point mark in the corresponding point cloud data of the point cloud;
[0041] Calculate a second transformation matrix from coordinates of control point marks in the matched point cloud corresponding point cloud data to coordinates of control point marks in the measurement file;
[0042] The spatial coordinates corresponding to the point cloud are registered to the measurement coordinate system according to the second transformation matrix.
[0043] In a second aspect, an embodiment of the present invention provides a spatial coordinate registration device based on point cloud data of three-dimensional scanning, and the coordinate registration device based on point cloud data of three-dimensional scanning includes:
[0044] A setting module, used to set control point marks on the object to be scanned according to preset requirements;
[0045] The preset requirements include: the size of the control point mark, the number of the control point marks and the position of the control point marks;
[0046] A measurement module is used to measure the position of the control point mark in a measurement coordinate system to obtain a measurement file;
[0047] The measurement file includes: a unique identifier of the control point mark and the coordinates of the control point mark;
[0048] The scanning module is used to perform three-dimensional scanning on the scanned object to obtain point cloud data of multiple scanning stations; the registration module is used to register the spatial coordinates in the point cloud data according to the preset registration algorithm and the measurement file to obtain the spatial coordinates corresponding to the spatial coordinates in the point cloud data in the measurement coordinate system.
[0049] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the program, the method described in any implementation manner in the first aspect is implemented.
[0050] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method as described in any implementation manner in the first aspect.
[0051] The present invention provides a method, device, equipment and storage medium for spatial coordinate registration of point cloud data based on three-dimensional scanning, the method is as follows: setting control point marks on the object to be scanned according to preset requirements; wherein the preset requirements include: the size of the control point marks, the number of control point marks and the position of the control point marks; measuring the position of the control point marks in the measurement coordinate system to obtain a measurement file; wherein the measurement file includes: the unique identifier of the control point marks and the coordinates of the control point marks; performing three-dimensional scanning on the object to be scanned to obtain point cloud data of multiple scanning stations; registering the spatial coordinates in the point cloud data according to the preset registration algorithm and the measurement file, and obtaining the spatial coordinates corresponding to the spatial coordinates in the point cloud data in the measurement coordinate system. The present invention establishes a coordinate relationship between point cloud data and measurement data by setting control point marks with coded information, and can realize automatic registration of the spatial coordinates of point cloud data through the coordinate relationship, thereby improving efficiency and accuracy and reducing manpower and material costs.
[0052] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements.
[0054] Figure 1 A flowchart of a method for spatial coordinate registration of point cloud data based on three-dimensional scanning according to an embodiment of the present invention;
[0055] Figure 2 This is an example diagram of a control point mark according to an embodiment of the present invention;
[0056] Figure 3 A point cloud schematic diagram of an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of the corresponding relationship between the focal length of a camera lens and the diagonal viewing angle of the image field according to an embodiment of the present invention;
[0058] Figure 5 A schematic diagram of a camera shooting angle of view according to an embodiment of the present invention;
[0059] Figure 6 A schematic diagram of a camera taking point cloud images at different angles according to an embodiment of the present invention;
[0060] FIG7 is a schematic diagram of a point cloud image collected by a camera according to an embodiment of the present invention;
[0061] Figure 8 A schematic diagram of camera shooting parameters according to an embodiment of the present invention;
[0062] FIG9 is a schematic diagram of a point cloud mesh model according to an embodiment of the present invention;
[0063] Fig.10 A schematic diagram of adjusting a point cloud screen display and then selecting a control point mark according to an embodiment of the present invention;
[0064] Fig.11 A flow chart of a spatial coordinate registration method according to an embodiment of the present invention;
[0065] Fig.12 It is a structural schematic diagram of a spatial coordinate registration device based on point cloud data of three-dimensional scanning according to an embodiment of the present invention;
[0066] Fig.13 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0068] It should be noted that the description of the embodiments of the present invention is only for more clearly illustrating the technical solutions of the embodiments of the present invention, and does not constitute a limitation on the technical solutions provided by the embodiments of the present invention.
[0069] Figure 1 FIG. 1 is a flow chart of a method for spatial coordinate registration of point cloud data based on three-dimensional scanning according to an embodiment of the present invention. Figure 1 As shown, including:
[0070] S101: Setting control point marks on the object to be scanned according to preset requirements.
[0071] The preset requirements include: the size of the control point mark, the number of the control point mark and the position of the control point mark.
[0072] Optionally, setting control point marks on the object to be scanned according to preset requirements includes:
[0073] Determine the size of the control point mark according to the resolution and scanning distance of the three-dimensional scan;
[0074] The location and number of control point markers are set based on the specifications of 3D scanning;
[0075] The coding information of the control point mark includes: a unique identifier of the control point mark and the coordinates of the control point mark.
[0076] Specifically, Figure 2 As shown:
[0077] Two-dimensional codes that can carry coded information, such as April Tags, Chili Tags, QR Code or Schneider Tags (Ci rcul lar Code), can be used as control point marks; the unique identification (ID) information of each control point mark is used as the mark code.
[0078] Optionally, the size of the control point mark is determined according to the resolution and scanning distance of the three-dimensional scan, and after the three-dimensional scanning requirements are met, the program can identify the mark in the scanned point cloud and obtain the coding information.
[0079] It should be noted that, when the size of the control point marks is the same, the control point marks made using Chili Tags, April Tags and Schneider Tags are easier to meet the resolution required for the point cloud to be recognized by the program, but their encoding capacity is also relatively small.
[0080] Optionally, before performing a three-dimensional scan, the control point marks are printed or sprayed on a material that does not deform after placement, such as hard paper or hard plastic, and are cut into individual pieces one by one. A certain amount of blank space is left on the four sides during cutting to fix the control point marks during placement, so as to avoid blocking the mark symbols by gluing, carding, pressing, etc. during placement.
[0081] Exemplarily, when arranging control point marks, methods such as pressing the corners or edges with heavy objects, or removable sticking can be used in horizontal places, and methods such as embedding and removable sticking can be used in non-horizontal places, so that the placement and removal of control point marks do not have a harmful effect on the work object itself; the control point marks need to remain stable, without moving or deforming, before the corresponding data collection work is completed.
[0082] S102. Measure the positions of the control point marks in a measurement coordinate system to obtain a measurement file.
[0083] The measurement file includes: a unique identifier of the control point mark and the coordinates of the control point mark.
[0084] Specifically, measurements are performed according to the requirements of the corresponding specifications to obtain the coordinates of each control point mark, record the control point code, and form a measurement file Fc. The file format is: mark ID code, X coordinate, Y coordinate, and Z coordinate.
[0085] S103, performing three-dimensional scanning on the object to be scanned to obtain point cloud data of multiple scanning stations.
[0086] Specifically, the object to be scanned with control point marks arranged is sequentially placed at different scanning stations for three-dimensional scanning according to the specification requirements of three-dimensional scanning to obtain multiple sets of point cloud data.
[0087] S104, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and the measurement file to obtain the spatial coordinates corresponding to the spatial coordinates in the point cloud data in the measurement coordinate system.
[0088] Optionally, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and the measurement file includes:
[0089] Randomly load the point cloud data of a scanning station to obtain the first point cloud;
[0090] Calculate the number and coordinates of control point markers in the first point cloud according to a preset algorithm;
[0091] If the number of control point markers in the first point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the first point cloud are aligned according to a preset method.
[0092] For example, the first point cloud obtained by randomly loading point cloud data can be as follows: Figure 3 shown.
[0093] Optionally, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and a measurement file also includes:
[0094] If the number of control point marks in the first point cloud is less than the number threshold, point cloud data of a scanning station adjacent to the scanning station corresponding to the first point cloud is loaded to obtain a second point cloud;
[0095] Calculate the number and coordinates of control point markers in the second point cloud according to a preset algorithm;
[0096] If the number of control point markers in the second point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the second point cloud are aligned according to a preset method.
[0097] Optionally, registering the spatial coordinates in the point cloud data according to a preset registration algorithm and a measurement file also includes:
[0098] If the number of control point markers in the second point cloud is less than the number threshold, a first transformation matrix for splicing the second point cloud to the first point cloud is calculated according to the I CP or NDT algorithm;
[0099] splicing the second point cloud to the first point cloud according to the first transformation matrix to obtain a third point cloud;
[0100] Calculate the number and coordinates of control point markers in the third point cloud according to a preset algorithm;
[0101] If the number of control point markers in the third point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the third point cloud are aligned according to a preset method.
[0102] Exemplarily, the transformation matrix Mj of splicing the second point cloud to the first point cloud can be obtained by using methods such as Iterative Closest Point Neighbor (ICP) or Normal Distribution Transform (NDT);
[0103] The second point cloud is spliced to the first point cloud using the transformation matrix Mj to obtain a third point cloud, and the coordinate changes corresponding to the control point marks of the second point cloud and the number of control point marks are recorded in the point cloud coordinate file of the control point marks of the first point cloud, so as to form a new point cloud coordinate file of the control point marks of the third point cloud;
[0104] Then, the spatial coordinates corresponding to the third point cloud are aligned according to the preset algorithm and preset method.
[0105] Optionally, the number and coordinates of control point markers in the point cloud are calculated according to a preset algorithm, including:
[0106] The virtual camera is placed at the center point of the scanner during scanning, and multiple point cloud images with different shooting angles are collected by shooting at multiple preset angles.
[0107] Traversing the point cloud image and identifying the unique identifier corresponding to the control point mark in the point cloud image and the coordinates of the four corner points of the control point mark in the image plane coordinate system;
[0108] Wherein, the number of control point markers is determined by the number of unique identifiers extracted;
[0109] The azimuth and elevation angles of the four corner points marked by the control points in the point cloud are calculated according to the coordinates of the four corner points and the shooting parameters of the virtual camera;
[0110] According to the azimuth angle of the field of view, the pitch angle of the field of view, the coordinates of the virtual camera, and the coordinates of the four corner points, the straight line equations of the four rays from the coordinate point of the virtual camera to the four corner points are established;
[0111] Encapsulate the point cloud according to the triangulated network and build a mesh model of the point cloud;
[0112] Calculate and obtain four intersection points between the four rays and the grid model; wherein the four intersection points constitute four spatial triangular faces;
[0113] Project the points of the point cloud onto each triangular face along the normal direction of the spatial triangular face; wherein all the points of the point cloud whose projection points are within the spatial triangular face are the point cloud set marked by the control points;
[0114] The center coordinates of the control point marker in the point cloud are determined based on the point cloud set of the control point marker.
[0115] For example, a virtual camera is created, and the focal length of the camera lens is set to 35 mm. According to the relationship diagram between the focal length of the lens and the diagonal viewing angle of the image field, the specific method can be as follows: Figure 4 As shown; at this time, the diagonal field of view (DFOV, denoted as H fov ) is 63 degrees. If the virtual camera takes pictures with an aspect ratio of 4:3, the horizontal field of view (HFOV, denoted as V fov ) is 50.4 degrees, and the vertical field of view (VFOV) is 37.8 degrees. Figure 5 shown.
[0116] For example, the virtual camera is placed at the center point of the scanner during scanning, that is, the coordinate origin O (X0, Y0, Z0) of the scanned point cloud of the station, and the horizontal pixel H is set pix and vertical pixel V pix , with a horizontal field of view angle H fov = 40 degrees and vertical field of view V fov =30 degrees is taken as the shooting unit, and the working mode of the scanner is to scan in the full field of view of 360 degrees horizontally and 360 degrees vertically, and 9×12 (360 / 40=9, 360 / 30=12) point cloud photos of the full field of view are taken. Figure 6 As shown, save the photos to form a photo file set Fi, which can be specifically shown in Figure 7; save the photo file name, shooting location coordinates, azimuth angle φ and pitch angle θ of the field of view ray of the lower left corner of the photo in the point cloud to the file Fv; the shooting parameters of the virtual photo can be as shown in Figure 8 shown.
[0117] It should be noted that since the horizontal field of view of the virtual camera is 50.4 degrees and the vertical field of view is 37.8 degrees, and the horizontal field of view of each shooting unit in the actually planned point cloud photos is 40 degrees and the vertical field of view is 30 degrees, the actual field of view is more than 20% larger than the planned field of view, and the virtually taken point cloud photos will have an overlap of more than 20%, which can ensure that the control point marks in the point cloud will appear completely at least once in one point cloud photo, ensuring that the control point marks are not missed.
[0118] Exemplarily, a program is written in C++ to iterate over each photo in the point cloud photo set Fi, identify whether there is a control point mark in the photo, and if so, extract the ID code of the mark and the coordinates of the four corner points in the photo plane coordinate system (x1, y1), (x2, y2), (x3, y3), (x4, y4).
[0119] Specifically, the identification and extraction adopt public methods and open source software, for example, the April Tag logo adopts the method and source code of https: / / github.com / P-Chao / apr i ltags-cpp-win, and the QR Code logo adopts the method and source code of https: / / github.com / WeChatCV / opencv_3rdparty).
[0120] For example, the azimuth of the field of view ray of the lower left corner of the photo in the point cloud is read from the Fv file. and pitch angle θ, according to the coordinates of the four corner points in the photo and the known horizontal pixel H of the photo pix and vertical pixel V pix , horizontal field of view H fov and vertical field angle V fov , find the azimuth of the ray in the field of view marking the four corner points in the point cloud and the pitch angle θ i :
[0121]
[0122]
[0123] Then the direction vector m of the straight line equation is established from the shooting position point and the four corner points of the mark i 、n i 、p i for:
[0124]
[0125]
[0126]
[0127] Accordingly, the equations of the straight lines from the shooting position to the four corner points of the mark are:
[0128]
[0129] Exemplarily, the Open3D open source library is used to encapsulate the point cloud according to the triangulated mesh (surface) to construct a mesh (surface) model of the point cloud, which may be specifically shown in FIG. 9 .
[0130] For example, using the Open3D open source library, the four intersection points of the four rays and the mesh model are calculated through the straight line equations of the four rays; the four intersection points form four triangular faces in space, and the normal of each triangular face is calculated. The point of the point cloud is projected to each triangular face along the direction of the normal of the triangular face. If the projection point is within the triangular face, the point of the point cloud is recorded as a valid point. All valid points are obtained, which is the point cloud set marked by the QR code control point. Fig.10 As shown; use the point cloud set of the two-dimensional code control point mark to obtain the center coordinates of the mark, that is, the coordinates of the center of the control point mark in the point cloud S1, save the mark ID code and center coordinates, and form the point cloud coordinate file Fp1 of the control point mark.
[0131] Optionally, if the number of control point markers in the point cloud is greater than or equal to a number threshold, the spatial coordinates corresponding to the point cloud are aligned according to a preset method, including:
[0132] According to the unique identifier of the control point mark, the coordinates of the control point mark in the measurement file are matched with the coordinates of the control point mark in the corresponding point cloud data of the point cloud;
[0133] Calculate a second transformation matrix from coordinates of control point marks in the matched point cloud corresponding point cloud data to coordinates of control point marks in the measurement file;
[0134] The spatial coordinates corresponding to the point cloud are registered to the measurement coordinate system according to the second transformation matrix.
[0135] Exemplarily, the measurement file Fc and the point cloud coordinate file Fp marked with control points are read, and the transformation matrix Mc between the point cloud coordinates and the measurement coordinates is calculated based on the relationship between the measurement coordinates and the point cloud coordinates marked with the same ID code through matching the control point mark ID code;
[0136] The transformation matrix Mc is used to transform the point cloud point by point, converting the scanning coordinates of the point cloud into coordinates in the measurement coordinate system to achieve spatial coordinate alignment of the point cloud.
[0137] For example, Fig.11 Flow chart of a spatial coordinate registration method according to an embodiment of the present invention; Fig.11 As shown:
[0138] It should be noted that the coordinate registration process can refer to step S104 and will not be described in detail here.
[0139] The embodiment of the present invention provides a spatial coordinate registration method for point cloud data based on 3D scanning, which uses a two-dimensional code to carry ID coding information, so that after the control point mark is automatically identified in the point cloud data processing, the association between the point cloud coordinates of the control point mark and the measured coordinates of the control point mark can be automatically established through ID coding matching, while the non-coded control point marks given in the existing 3D scanning specifications need to be manually assigned with ID codes and recorded after the control point marks are arranged. After the coded marks are automatically identified in the point cloud data processing, since the marks are the same, it is necessary to manually match the corresponding ID codes in the measurement data records one by one to establish an association relationship with the measurement data. Compared with the prior art, the present invention The technical solution in the invention significantly improves the processing efficiency and accuracy; and the present invention uses the "3D-2D-3D" dimensional conversion method to avoid the identification of complex 2D code control point marks in 3D point clouds, and obtain the ID codes and center coordinates of the control point marks in the 3D point clouds, solving the problem that only simple geometric pattern control point marks and center coordinates can be automatically identified in 3D scanning point clouds, but complex 2D code control point marks and center coordinates are difficult to automatically identify; in summary, the present invention uses the ID code in the 2D code control point mark as a matching keyword to automatically establish the conversion relationship between the point cloud coordinates of the control point mark and the measured coordinates of the control point mark, thereby realizing full automation of point cloud alignment.
[0140] The following combination Fig.12 The device provided by the embodiment of the present invention that can execute the above-mentioned spatial coordinate registration method of point cloud data based on three-dimensional scanning is described in detail.
[0141] For example, Fig.12 FIG. 4 is a schematic diagram of a spatial coordinate registration device based on three-dimensional scanning point cloud data according to an embodiment of the present invention; Fig.12 As shown, the registration device 120 includes:
[0142] A setting module 1201 is used to set control point marks on the object to be scanned according to preset requirements;
[0143] The preset requirements include: the size of the control point mark, the number of the control point marks and the position of the control point marks;
[0144] The measurement module 1202 is used to measure the position of the control point mark in the measurement coordinate system to obtain a measurement file;
[0145] The measurement file includes: a unique identifier of the control point mark and the coordinates of the control point mark;
[0146] The scanning module 1203 is used to perform three-dimensional scanning on the object to be scanned to obtain point cloud data of multiple scanning stations;
[0147] The registration module 1204 is used to register the spatial coordinates in the point cloud data according to a preset registration algorithm and a measurement file, and obtain the spatial coordinates corresponding to the spatial coordinates in the point cloud data in the measurement coordinate system.
[0148] Optionally, the setting module 1201 is further used to determine the size of the control point mark according to the resolution and scanning distance of the three-dimensional scanning; and to set the position and number of the control point mark based on the specification requirements of the three-dimensional scanning;
[0149] The coding information of the control point mark includes: a unique identifier of the control point mark and the coordinates of the control point mark.
[0150] Optionally, the registration module 1204 is also used to randomly load the point cloud data of a scanning station to obtain a first point cloud; calculate the number and coordinates of control point markers in the first point cloud according to a preset algorithm; if the number of control point markers in the first point cloud is greater than or equal to a quantity threshold, register the spatial coordinates corresponding to the first point cloud according to a preset method.
[0151] Optionally, the registration module 1204 is also used to load the point cloud data of a scanning station adjacent to the scanning station corresponding to the first point cloud to obtain a second point cloud if the number of control point markers in the first point cloud is less than a quantity threshold; calculate the number and coordinates of the control point markers in the second point cloud according to a preset algorithm; and register the spatial coordinates corresponding to the second point cloud according to a preset method if the number of control point markers in the second point cloud is greater than or equal to the quantity threshold.
[0152] Optionally, the registration module 1204 is also used to calculate a first transformation matrix for splicing the second point cloud to the first point cloud according to the ICP or NDT algorithm if the number of control point markers in the second point cloud is less than a quantity threshold; splice the second point cloud to the first point cloud according to the first transformation matrix to obtain a third point cloud; calculate the number and coordinates of control point markers in the third point cloud according to a preset algorithm; and register the spatial coordinates corresponding to the third point cloud according to a preset method if the number of control point markers in the third point cloud is greater than or equal to the quantity threshold.
[0153] Optionally, the registration module 1204 is further used to place the virtual camera at the center point of the scanner during scanning, and to capture multiple point cloud images at different shooting angles by shooting according to multiple preset angles; to traverse the point cloud image and identify the unique identifier corresponding to the control point mark in the point cloud image and the coordinates of the four corner points of the control point mark in the image plane coordinate system; wherein the number of the control point marks is determined by the number of unique identifiers extracted; to calculate and determine the field of view azimuth and field of view pitch angle of the four corner points of the control point mark in the point cloud according to the coordinates of the four corner points and the shooting parameters of the virtual camera; and to calculate and determine the field of view azimuth and field of view pitch angle of the four corner points of the control point mark in the point cloud according to the field of view azimuth. The straight line equations of the four rays from the coordinate point of the virtual camera to the four corner points are established by using the position angle, pitch angle of the field of view, coordinates of the virtual camera and coordinates of the four corner points; the point cloud is encapsulated as a triangulated network to construct a mesh model of the point cloud; the four intersection points of the four rays and the mesh model are calculated; wherein the four intersection points constitute four spatial triangular faces; the points of the point cloud are projected onto each triangular face along the normal direction of the spatial triangular face; wherein the points of all point clouds whose projection points are within the spatial triangular face are the point cloud set marked by the control point; the center coordinates of the control point mark in the point cloud are determined by calculating the point cloud set marked by the control point.
[0154] Optionally, the registration module 1204 is also used to match the coordinates of the control point marker in the measurement file with the coordinates of the control point marker in the point cloud data corresponding to the point cloud according to the unique identifier of the control point marker; calculate a second transformation matrix from the coordinates of the control point marker in the point cloud data corresponding to the matched point cloud to the coordinates of the control point marker in the measurement file; and register the spatial coordinates corresponding to the point cloud to the measurement coordinate system according to the second transformation matrix.
[0155] An embodiment of the present invention further provides a computer electronic device, Fig.13 FIG. 1 shows a schematic diagram of the structure of an electronic device to which an embodiment of the present invention can be applied. Fig.13 As shown, the computer electronic device includes a central processing module (CPU) 1301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1302 or the program loaded from the storage part 1308 to the random access memory (RAM) 1303. In the RAM 1303, various programs and data required for system operation are also stored. The CPU 1301, the ROM 1302 and the RAM 1303 are connected to each other through a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.
[0156] The following components are connected to the I / O interface 1305: an input section 1306 including a keyboard, a mouse, etc.; an output section 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, a modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that a computer program read therefrom is installed into the storage section 1308 as needed.
[0157] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0158] The modules or modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules or modules described may also be set in a processor, for example, it may be described as: a processor includes a setting module 1201, a measurement module 1202, a scanning module 1203 and a registration module 1204, wherein the names of these modules do not constitute a limitation on the modules themselves under certain circumstances, for example, the setting module 1201 may also be described as "a setting module 1201 for setting control point marks on the object to be scanned according to preset requirements".
[0159] As another aspect, the present invention further provides a computer-readable storage medium, which may be a computer-readable storage medium included in a spatial coordinate registration device for point cloud data based on three-dimensional scanning described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into an electronic device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute a spatial coordinate registration method for point cloud data based on three-dimensional scanning described in the present invention.
[0160] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.
Claims
1. A spatial coordinate registration method for point cloud data based on three-dimensional scanning, characterized in that: The coordinate registration method based on point cloud data of three-dimensional scanning includes: Setting control point marks on the object to be scanned according to preset requirements; the preset requirements include: the size of the control point marks, the number of control point marks and the position of the control point marks; The position of the control point mark is measured in a measurement coordinate system to obtain a measurement file; the measurement file includes: a unique identifier of the control point mark and the coordinates of the control point mark; Performing three-dimensional scanning on the object to be scanned to obtain point cloud data of multiple scanning stations; The spatial coordinates in the point cloud data are registered according to a preset registration algorithm and the measurement file to obtain the spatial coordinates in the point cloud data corresponding to the spatial coordinates in the measurement coordinate system.
2. The spatial coordinate registration method of point cloud data based on three-dimensional scanning according to claim 1, characterized in that: The step of setting a control point mark on the object to be scanned according to preset requirements includes: Determining the size of the control point mark according to the resolution and scanning distance of the three-dimensional scan; The position and number of the control point marks are set based on the specification requirements of the three-dimensional scanning; The coding information of the control point mark includes: a unique identifier of the control point mark and the coordinates of the control point mark.
3. The spatial coordinate registration method based on three-dimensional scanning point cloud data according to claim 1, characterized in that: The registering the spatial coordinates in the point cloud data according to the preset registration algorithm and the measurement file includes: Randomly load the point cloud data of a scanning station to obtain the first point cloud; Calculate the number and coordinates of control point markers in the first point cloud according to a preset algorithm; If the number of control point markers in the first point cloud is greater than or equal to a quantity threshold, the spatial coordinates corresponding to the first point cloud are aligned according to a preset method.
4. The spatial coordinate registration method of point cloud data based on three-dimensional scanning according to claim 3, characterized in that: The registering the spatial coordinates in the point cloud data according to the preset registration algorithm and the measurement file also includes: If the number of control point marks in the first point cloud is less than a quantity threshold, point cloud data of a scanning station adjacent to the scanning station corresponding to the first point cloud is loaded to obtain a second point cloud; Calculate the number and coordinates of control point markers in the second point cloud according to the preset algorithm; If the number of control point markers in the second point cloud is greater than or equal to the number threshold, the spatial coordinates corresponding to the second point cloud are aligned according to the preset method.
5. The spatial coordinate registration method based on three-dimensional scanning point cloud data according to claim 4, characterized in that: The registering the spatial coordinates in the point cloud data according to the preset registration algorithm and the measurement file also includes: If the number of control point markers in the second point cloud is less than a quantity threshold, a first transformation matrix for splicing the second point cloud to the first point cloud is calculated according to an ICP or NDT algorithm; splicing the second point cloud to the first point cloud according to the first transformation matrix to obtain a third point cloud; Calculate the number and coordinates of control point markers in the third point cloud according to the preset algorithm; If the number of control point markers in the third point cloud is greater than or equal to the number threshold, the spatial coordinates corresponding to the third point cloud are aligned according to the preset method.
6. The spatial coordinate registration method based on point cloud data of three-dimensional scanning according to any one of claims 3 to 5, characterized in that: Calculating the number and coordinates of control point markers in the point cloud according to the preset algorithm includes: The virtual camera is placed at the center point of the scanner during scanning, and multiple point cloud images with different shooting angles are collected by shooting at multiple preset angles. Traversing the point cloud image and identifying a unique identifier corresponding to a control point mark in the point cloud image and the coordinates of four corner points of the control point mark in the image plane coordinate system; Wherein, the number of control point marks is determined by the number of unique identifiers extracted; Calculate and determine the field of view azimuth and field of view pitch angle of the four corner points marked by the control point in the point cloud according to the coordinates of the four corner points and the shooting parameters of the virtual camera; Establish straight line equations of four rays from the coordinate point of the virtual camera to the four corner points according to the field of view azimuth angle, the field of view pitch angle, the coordinates of the virtual camera, and the coordinates of the four corner points; Encapsulate the point cloud according to the triangulated network and build a mesh model of the point cloud; Calculate and obtain four intersection points between the four rays and the grid model; wherein the four intersection points constitute four spatial triangular faces; Projecting the points of the point cloud onto each triangular face along the normal direction of the spatial triangular face; wherein all the points of the point cloud within the spatial triangular face whose projection points are located are the point cloud set marked by the control point; The center coordinates of the control point mark in the point cloud are determined by calculation based on the point cloud set of the control point mark.
7. The spatial coordinate registration method based on point cloud data of three-dimensional scanning according to any one of claims 3 to 5, characterized in that: If the number of control point markers in the point cloud is greater than or equal to the number threshold, the spatial coordinates corresponding to the point cloud are aligned according to the preset method, including: Matching the coordinates of the control point mark in the measurement file with the coordinates of the control point mark in the point cloud data corresponding to the point cloud according to the unique identifier of the control point mark; Calculate a second transformation matrix from coordinates of control point marks in the matched point cloud corresponding point cloud data to coordinates of control point marks in the measurement file; The spatial coordinates corresponding to the point cloud are aligned to the measurement coordinate system according to the second transformation matrix.
8. A spatial coordinate registration device based on point cloud data of three-dimensional scanning, characterized in that: The coordinate registration device based on point cloud data of three-dimensional scanning comprises: A setting module, used to set control point marks on the object to be scanned according to preset requirements; the preset requirements include: the size of the control point marks, the number of control point marks and the position of the control point marks; A measurement module, used to measure the position of the control point mark in a measurement coordinate system to obtain a measurement file; the measurement file includes: a unique identifier of the control point mark and the coordinates of the control point mark; A scanning module, used for performing a three-dimensional scan on the object to be scanned to obtain point cloud data of multiple scanning stations; The registration module is used to register the spatial coordinates in the point cloud data according to a preset registration algorithm and the measurement file to obtain the spatial coordinates corresponding to the spatial coordinates in the point cloud data in the measurement coordinate system.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.