Point cloud and CAD model alignment method and device, electronic equipment, medium and product
By using a preset three-coordinate detection strategy and a rotation and translation matrix alignment method, the alignment accuracy and stability of point clouds and CAD models are improved, and the measurement result deviation problem existing in the prior art is solved.
Patent Information
- Application Number
- CN202510855383.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-10-21
AI Technical Summary
The existing technology lacks sufficient accuracy and stability in aligning point cloud data with CAD models. It is affected by factors such as scanning error, point cloud sparsity, noise, and computational complexity, resulting in deviations in measurement results.
A preset three-coordinate detection strategy is used to initially align the scanned point cloud and the model point cloud, extract reference points, and perform final alignment using a rotation and translation matrix to improve alignment accuracy and stability.
It improves the accuracy and applicability of point cloud and CAD model alignment, and solves the problem of measurement result deviation caused by scanning error, point cloud sparsity, noise and computational complexity.
Smart Images

Figure CN120823245A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of 3D point cloud technology, and in particular to a method, device, electronic equipment, medium and product for aligning a point cloud with a CAD model. Background Art
[0002] With the continuous development of 3D scanning technology, especially in the automotive manufacturing industry, many automotive components can now be scanned using high-precision 3D scanning equipment to obtain precise point cloud data. This point cloud data effectively reflects the actual workpiece geometry and is widely used in subsequent quality inspection, reverse engineering, and digital manufacturing. In order to use this point cloud data for actual measurement work, it is often necessary to align the scanned point cloud data with a standard digital model to ensure that they are in a unified coordinate system.
[0003] In related technologies, the alignment of point clouds and CAD models usually relies on certain existing algorithms, such as the iterative closest point (ICP) algorithm, to obtain alignment results.
[0004] However, the accuracy of alignment between point cloud data and CAD models in related technologies is often affected by multiple factors such as scanning errors, point cloud sparsity, noise, and computational complexity, which leads to certain deviations in the measurement results. The accuracy and stability are not sufficient to meet the needs of actual production and quality control, which needs to be urgently addressed. Summary of the Invention
[0005] The present invention provides a method, device, electronic device, medium and product for aligning point clouds and CAD models, so as to solve the problem in related technologies that the alignment accuracy is affected by multiple factors such as scanning errors, point cloud sparsity, noise and computational complexity, resulting in certain deviations in measurement results and insufficient accuracy and stability, thereby improving the accuracy and applicability of the point cloud and CAD model alignment method.
[0006] The first aspect of the present invention provides an alignment method for a point cloud and a CAD model, comprising the following steps: acquiring a scanned point cloud and a model point cloud; performing preliminary alignment processing on the scanned point cloud and the model point cloud based on a preset three-coordinate detection strategy, and obtaining the scanned point cloud and the model point cloud after the preliminary alignment; based on a preset three-coordinate detection strategy, extracting reference points from both the scanned point cloud and the model point cloud after the preliminary alignment, and performing final alignment based on the reference point extraction results. Further, in some embodiments, the method based on the preset three-coordinate detection strategy simultaneously extracts reference points in the scan point cloud after the initial alignment and the model point cloud after the initial alignment, and performs final alignment according to the reference point extraction results, including: based on the preset three-coordinate detection strategy, extracting at least one pair of reference points in the scan point cloud after the initial alignment and the model point cloud after the initial alignment, wherein the at least one pair of reference points includes at least one first reference point of the scan point cloud after the initial alignment and at least one second reference point of the model point cloud after the initial alignment; calculating the position relationship according to the at least one pair of reference points to obtain the rotation and translation matrix from the scan point cloud to the model point cloud; extracting at least one third reference point from the model point cloud after the initial alignment, and performing final alignment according to the rotation and translation matrix, the at least one third reference point and the at least one second reference point.
[0007] Furthermore, in some embodiments, the final alignment based on the rotation and translation matrix, the at least one third reference point and the at least one second reference point includes: calculating the deviation of the at least one third reference point and the at least one second reference point one by one to obtain the reference point deviation calculation result; and performing the final alignment based on the rotation and translation matrix and the reference point deviation calculation result.
[0008] Furthermore, in some embodiments, the final alignment based on the rotation and translation matrix and the reference point deviation calculation result includes: judging whether the reference point deviation calculation result meets the deviation requirement based on a preset deviation threshold; if the reference point deviation calculation result does not meet the deviation requirement, performing the final alignment based on the rotation and translation matrix.
[0009] Further, in some embodiments, the at least one third reference point and the at least one second reference point are both six points, wherein the final alignment based on the rotation and translation matrix includes: based on the first translation strategy determined by the rotation and translation matrix, translating the first point of the third reference point to the first point of the second reference point; based on the first rotation strategy determined by the rotation and translation matrix, aligning the second point of the third reference point to the line between the first point of the second reference point and the second point of the second reference point; based on the second rotation strategy determined by the rotation and translation matrix, rotating the third point of the third reference point to align it to the plane corresponding to the first point of the second reference point, the second point of the second reference point, and the third point of the second reference point; based on the second translation strategy determined by the rotation and translation matrix, translating the fourth point of the third reference point to the fourth point of the second reference point; based on the third rotation strategy determined by the rotation and translation matrix, aligning the fifth point of the third reference point to the line between the fourth point of the second reference point and the fifth point of the second reference point; based on the fourth translation strategy determined by the rotation and translation matrix, translating the sixth point of the third reference point to the sixth point of the second reference point. .
[0010] Furthermore, in some embodiments, the obtaining of the model point cloud includes: obtaining a standard digital model to be converted; converting the standard digital model to be converted into a triangulated model, refining the triangulated model, and converting the refined triangulated model into point cloud data to obtain the model point cloud.
[0011] According to the point cloud and CAD model alignment method provided by an embodiment of the present invention, the scanned point cloud and the model point cloud are first obtained, and then the two types of point clouds are initially aligned according to a preset three-coordinate detection strategy. Finally, based on the preset three-coordinate detection strategy, reference points are extracted from the initially aligned point cloud, and the final alignment is completed based on the extraction results. This solves the problem in related technologies that the alignment accuracy is affected by multiple factors such as scanning errors, point cloud sparsity, noise, and computational complexity, which leads to certain deviations in the measurement results and insufficient accuracy and stability. This improves the accuracy and applicability of the point cloud and CAD model alignment method.
[0012] The second aspect of the present invention provides an alignment device for a point cloud and a CAD model, the device comprising: an acquisition module for acquiring a scanned point cloud and a model point cloud; a preprocessing module for performing preliminary alignment processing on the scanned point cloud and the model point cloud based on a preset three-coordinate detection strategy, and the scanned point cloud and the model point cloud after preliminary alignment; an alignment module for extracting reference points from both the scanned point cloud and the model point cloud after preliminary alignment based on a preset three-coordinate detection strategy, and performing final alignment based on the reference point extraction results.
[0013] Furthermore, in some embodiments, the alignment module is specifically used to: based on a preset three-coordinate detection strategy, extract at least one pair of reference points from the scan point cloud after the initial alignment and the model point cloud after the initial alignment, wherein the at least one pair of reference points includes at least one first reference point of the scan point cloud after the initial alignment and at least one second reference point of the model point cloud after the initial alignment; calculate the position relationship based on the at least one pair of reference points to obtain the rotation and translation matrix from the scan point cloud to the model point cloud; extract at least one third reference point from the model point cloud after the initial alignment, and perform final alignment based on the rotation and translation matrix, the at least one third reference point and the at least one second reference point.
[0014] Furthermore, in some embodiments, the alignment module is also used to: calculate the deviation of the at least one third reference point and the at least one second reference point in a one-to-one correspondence to obtain the reference point deviation calculation result; and perform final alignment according to the rotation and translation matrix and the reference point deviation calculation result.
[0015] Furthermore, in some embodiments, the alignment module is also used to: determine whether the reference point deviation calculation result meets the deviation requirement based on a preset deviation threshold; if the reference point deviation calculation result does not meet the deviation requirement, perform final alignment based on the rotation and translation matrix.
[0016] Further, in some embodiments, the at least one third reference point and the at least one second reference point are both six points, wherein the alignment module is further used to: translate the first point of the third reference points to the first point of the second reference points based on the first translation strategy determined by the rotation and translation matrix; align the second point of the third reference points to the line between the first point of the second reference points and the second point of the second reference points based on the first rotation strategy determined by the rotation and translation matrix; rotate the third point of the third reference points to align them to the plane corresponding to the first point of the second reference points, the second point of the second reference points, and the third point of the second reference points based on the second rotation strategy determined by the rotation and translation matrix; translate the fourth point of the third reference points to the fourth point of the second reference points based on the second translation strategy determined by the rotation and translation matrix; align the fifth point of the third reference points to the line between the fourth point of the second reference points and the fifth point of the second reference points based on the third rotation strategy determined by the rotation and translation matrix; and translate the sixth point of the third reference points to the sixth point of the second reference points based on the fourth translation strategy determined by the rotation and translation matrix.
[0017] Furthermore, in some embodiments, the acquisition module is also used to: acquire the standard digital model to be converted; convert the standard digital model to be converted into a triangulated model, refine the triangulated model, and convert the refined triangulated model into point cloud data to obtain the model point cloud.
[0018] According to the point cloud and CAD model alignment device provided by the embodiment of the present invention, the scanned point cloud and the model point cloud are first obtained, and then the two types of point clouds are initially aligned according to the preset three-coordinate detection strategy. Finally, based on the preset three-coordinate detection strategy, reference points are extracted from the initially aligned point cloud, and the final alignment is completed according to the extraction results. This solves the problem in related technologies that the alignment accuracy is affected by multiple factors such as scanning errors, point cloud sparsity, noise, and computational complexity, which leads to certain deviations in the measurement results and insufficient accuracy and stability. It improves the accuracy and applicability of the point cloud and CAD model alignment method.
[0019] A third aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for aligning a point cloud and a CAD model as described in the above embodiment.
[0020] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the method for aligning a point cloud and a CAD model as described in the above embodiment.
[0021] A fifth aspect of the present invention provides a computer program product, comprising a computer program, which is executed to implement the method for aligning a point cloud and a CAD model as described in the above embodiment.
[0022] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which: Figure 1 A flowchart of a method for aligning a point cloud and a CAD model according to an embodiment of the present invention; Figure 2 A block diagram of an apparatus for aligning a point cloud and a CAD model according to an embodiment of the present invention; Figure 3 A schematic structural diagram of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.
[0025] The following describes the point cloud and CAD model alignment method, device, electronic device, medium and product of the embodiment of the present invention with reference to the accompanying drawings. In view of the problem that the alignment accuracy in the related art mentioned in the above background technology is affected by multiple factors such as scanning error, point cloud sparsity, noise and computational complexity, resulting in a certain deviation in the measurement result, causing insufficient precision and stability, the present invention provides a point cloud and CAD model alignment method, first obtaining the scanned point cloud and the model point cloud, then performing an initial alignment on the two types of point clouds according to a preset three-coordinate detection strategy, and finally extracting reference points from the initially aligned point cloud based on the preset three-coordinate detection strategy, and completing the final alignment according to the extraction result, solving the problem that the alignment accuracy in the related art is affected by multiple factors such as scanning error, point cloud sparsity, noise and computational complexity, resulting in a certain deviation in the measurement result, causing insufficient precision and stability, and improving the precision and applicability of the point cloud and CAD model alignment method.
[0026] Specifically, Figure 1 The figure is a flow chart of a method for aligning a point cloud and a CAD model according to an embodiment of the present invention.
[0027] like Figure 1 As shown, the method for aligning the point cloud and the CAD model includes the following steps: In step S101 , a scanning point cloud and a model point cloud are obtained.
[0028] Among them, the scanning point cloud refers to the point set composed of a large number of discrete point coordinates obtained by sampling the surface of the actual object with a three-dimensional scanning device, and the model point cloud refers to the point cloud data converted from the standard digital model through an algorithm.
[0029] Furthermore, in some embodiments, obtaining the model point cloud includes: obtaining a standard digital model to be converted; converting the standard digital model to be converted into a triangulated model, refining the triangulated model, and converting the refined triangulated model into point cloud data to obtain a model point cloud.
[0030] Among them, the triangulated model refers to the discretization of the three-dimensional digital model into a mesh model composed of a large number of triangular facets through a triangulation algorithm, and the refinement processing refers to the operation of mesh optimization of the triangulated model. It should be noted that the refinement processing of the triangulated model should include triangulation processing and point denser processing.
[0031] In step S102, based on a preset three-coordinate detection strategy, the scan point cloud and the model point cloud are initially aligned to obtain the scan point cloud and the model point cloud after the initial alignment.
[0032] Among them, the preset three-coordinate detection strategy refers to a precise measurement method when inspecting workpieces, and alignment processing refers to making three-dimensional data from different sources, such as scan point clouds and model point clouds, achieve spatial position matching in a unified coordinate system to eliminate position deviations between data.
[0033] Specifically, the scanned point cloud and the converted point cloud are first coarsely aligned, and then the result of the coarse alignment is accurately finely aligned. At this time, the scanned point cloud data obtained is roughly aligned with the original standard digital model. It should be noted that since the point cloud registration algorithm is not based on the datum plane priority method used in industrial manufacturing, using point cloud for measurement at this time does not meet actual needs and is inaccurate.
[0034] For example, the goal of coarse registration is to eliminate the macroscopic position difference between the scanned point cloud and the model point cloud. Therefore, the principal component analysis method can be used to achieve alignment through the geometric main direction of the point cloud. The goal of fine registration is to reduce the alignment error of the two point clouds to the detection accuracy range through an iterative algorithm to achieve microscopic matching between the point clouds. For example, the iterative closest point algorithm can be used to minimize the distance error between the two point clouds by continuously searching for the nearest point pair and optimizing the transformation matrix, thereby obtaining the initially aligned scanned point cloud and the initially aligned model point cloud.
[0035] In step S103 , based on a preset three-coordinate detection strategy, reference points are extracted from both the scanned point cloud and the model point cloud after the initial alignment, and final alignment is performed based on the reference point extraction results. Among them, reference points refer to feature points that can be accurately identified in both the scanned point cloud and the CAD model. It should be noted that all reference points must meet the 3-2-1 coordinate system establishment principle, that is, a unique rectangular coordinate system is defined by selecting three points (surfaces), two points (axes) and one point (origin).
[0036] Furthermore, in some embodiments, based on a preset three-coordinate detection strategy, reference point extraction is performed simultaneously in the scan point cloud after initial alignment and the model point cloud after initial alignment, and final alignment is performed based on the reference point extraction results, including: based on a preset three-coordinate detection strategy, at least one pair of reference points is extracted simultaneously in the scan point cloud after initial alignment and the model point cloud after initial alignment, wherein the at least one pair of reference points includes at least one first reference point of the scan point cloud after initial alignment and at least one second reference point of the model point cloud after initial alignment; positional relationship calculation is performed based on at least one pair of reference points to obtain a rotation and translation matrix from the scan point cloud to the model point cloud; at least one third reference point is extracted from the model point cloud after initial alignment, and final alignment is performed based on the rotation and translation matrix, at least one third reference point and at least one second reference point.
[0037] Specifically, the positional relationship is calculated using the first reference point of the scanned point cloud after initial alignment to obtain the rotation and translation matrix of the scanned point cloud to the model point cloud. Then, the reference point on the model point cloud is guaranteed to remain unchanged, and a new third reference point or reference direction on the scanned point cloud is extracted again to calculate the deviation of each pair of reference points, and the rotation and translation matrix is used for movement.
[0038] For example, 6 pairs of reference points or reference directions are used to calculate the positional relationship to obtain the rotation and translation matrix from the scanned point cloud to the model point cloud, and the rotation and translation matrix is used for movement; then, the reference points on the model point cloud are guaranteed to remain unchanged, and 6 new reference points or reference directions on the scanned point cloud are extracted again to calculate the deviation of each pair of reference points, and the movement is performed based on the rotation and translation matrix.
[0039] Among them, in some embodiments, the final alignment is performed based on the rotation and translation matrix, at least one third reference point and at least one second reference point, including: calculating the deviation of at least one third reference point and at least one second reference point one by one to obtain the reference point deviation calculation result; and performing the final alignment based on the rotation and translation matrix and the reference point deviation calculation result.
[0040] For example, the second reference point can be recorded as P i (i=1,2,...,6), the third reference point is recorded as Q i (i=1,2,...,6), then the first point of the third reference point Q 1 to the first point of the second reference point P The deviation value of 1 can be recorded as Δ T 1= P 1- Q 1. Similarly, the sixth point of the third reference point Q 6 Sixth point to the second reference point P The deviation value of 6 can be recorded as ΔT 6= P 6- Q 6.
[0041] Furthermore, in some embodiments, final alignment is performed based on the rotation and translation matrix and the reference point deviation calculation results, including: based on a preset deviation threshold, judging whether the reference point deviation calculation result meets the deviation requirement; if the reference point deviation calculation result does not meet the deviation requirement, performing final alignment based on the rotation and translation matrix.
[0042] It should be noted that after completing a round of rotation and translation, the deviation may still be large. At this time, it is necessary to calculate the reference point deviation and align it through the rotation and translation matrix so that the deviation value reaches the preset threshold to improve the alignment accuracy.
[0043] Further, in some embodiments, the at least one third reference point and the at least one second reference point are both six points, wherein the alignment module is further used to: translate the first point of the third reference points to the first point of the second reference points based on the first translation strategy determined by the rotation and translation matrix; align the second point of the third reference points to the line between the first point of the second reference points and the second point of the second reference points based on the first rotation strategy determined by the rotation and translation matrix; rotate the third point of the third reference points to align them to the plane corresponding to the first point of the second reference points, the second point of the second reference points, and the third point of the second reference points based on the second rotation strategy determined by the rotation and translation matrix; translate the fourth point of the third reference points to the fourth point of the second reference points based on the second translation strategy determined by the rotation and translation matrix; align the fifth point of the third reference points to the line between the fourth point of the second reference points and the fifth point of the second reference points based on the third rotation strategy determined by the rotation and translation matrix; and translate the sixth point of the third reference points to the sixth point of the second reference points based on the fourth translation strategy determined by the rotation and translation matrix.
[0044] Among them, the translation strategy refers to a transformation strategy that adjusts the position of the third reference point to coincide with the second reference point through linear displacement in three-dimensional space. The rotation strategy refers to a transformation strategy that rotates and adjusts the posture of the scanned point cloud around a certain axis in three-dimensional space so that the third reference point is consistent with the direction or plane of the corresponding feature of the model.
[0045] For example, the second reference point can be recorded as P i (i=1,2,...,6), the third reference point is recorded as Q i (i=1,2,...,6), first perform an initial translation, and move the first point of the third reference point toQ 1 Move to the first point of the second reference point P 1, Δ T 1= P 1- Q 1, Q i ′= Q i +Δ T 1( i =1,2,...,6), where Δ T 1 is from Q 1 to P 1 translation vector, Q i ′ represents the updated position of the third reference point.
[0046] Further, rotate the second point in the third reference point Q 2, align it to the first point in the second reference point P 1 and the second point in the second reference point P Line 2 P 1 -P 2, in P 1, P 2, and Q On the plane defined by 2′, let Q 2′ around P 1 Rotate until it is located P 1 and P 2, define the plane normal vector n 12 =(P 2 -P 1 )×(Q 2 ′-P 1 ) , then calculate the rotation angle θ :
[0047] Calculated Further derive the angle , so that through the rotation matrix To achieve rotation, the rotation matrix Through the rotation axis and angles To express, that is:
[0048] Apply the rotation matrix to the third reference point , get the new third reference point after rotation , the rotation operation is:
[0049] Through this rotation, the new third reference point will be aligned with the second point in the second reference point More aligned in space.
[0050] Further, rotate the third point in the third reference point Q 3. Align it to the first point in the second reference point P 1. The second point in the second reference point P 2 and the third point in the second reference point P 3 planes P 1- P 2- P 3 up, around P 1- P 2-axis rotation Q 3′′, so that it is located P 1, P 2 and P In the plane defined by 3, first define the axis vector a 12 = P 2- P 1, then calculate the rotation angle , where the rotation angle It's through the point arrive and points The angle between them is calculated as follows:
[0051] Applying a rotation matrix , the rotation matrix Use the rotation axis vector a 12 and rotation angle , point Rotate into plane:
[0052] Get the rotated point :
[0053] Further, the translation makes the fourth point in the third reference point Q 4 Align to the fourth point in the second reference point P 4 up:
[0054]
[0055] Further, the rotation makes the fifth point in the third reference point Q5 align to the line between the fourth point in the second reference point and the fifth point in the second reference point P 4- P 5, in P 4. P 5 and Q 5 (4) On the defined plane, let Q 5 (4) Around P 4 Rotate until it is located P 4 and P 5, use the above rotation angle calculation method to calculate the new rotation angle and apply the rotation matrix.
[0056] Further, the translation makes the sixth point in the third reference point Q 6 Align to the sixth point in the second reference point P 6:
[0057]
[0058] Therefore, the sixth point in the third reference point Q 6 is precisely aligned to the sixth point in the second reference point P 6, precise alignment of point clouds and CAD models is achieved.
[0059] According to the point cloud and CAD model alignment method provided by an embodiment of the present invention, the scanned point cloud and the model point cloud are first obtained, and then the two types of point clouds are initially aligned according to a preset three-coordinate detection strategy. Finally, based on the preset three-coordinate detection strategy, reference points are extracted from the initially aligned point cloud, and the final alignment is completed based on the extraction results. This solves the problem in related technologies that the alignment accuracy is affected by multiple factors such as scanning errors, point cloud sparsity, noise, and computational complexity, which leads to certain deviations in the measurement results and insufficient accuracy and stability. This improves the accuracy and applicability of the point cloud and CAD model alignment method.
[0060] Next, a device for aligning a point cloud and a CAD model according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0061] Figure 2 The block diagram is a device for aligning a point cloud and a CAD model according to an embodiment of the present invention.
[0062] like Figure 2 As shown, the point cloud and CAD model alignment device 10 includes: an acquisition module 100, a pre-processing module 200 and an alignment module 300.
[0063] Among them, the acquisition module 100 is used to acquire the scanning point cloud and the model point cloud; the preprocessing module 200 is used to perform initial alignment processing on the scanning point cloud and the model point cloud based on a preset three-coordinate detection strategy, and the scanning point cloud after the initial alignment and the model point cloud after the initial alignment; the alignment module 300 is used to extract reference points in the scanning point cloud after the initial alignment and the model point cloud after the initial alignment based on a preset three-coordinate detection strategy, and perform final alignment according to the reference point extraction results.
[0064] Furthermore, in some embodiments, the alignment module 300 is specifically used to: based on a preset three-coordinate detection strategy, extract at least one pair of reference points from the scan point cloud after the initial alignment and the model point cloud after the initial alignment, wherein the at least one pair of reference points includes at least one first reference point of the scan point cloud after the initial alignment and at least one second reference point of the model point cloud after the initial alignment; calculate the position relationship based on the at least one pair of reference points to obtain the rotation and translation matrix from the scan point cloud to the model point cloud; extract at least one third reference point from the model point cloud after the initial alignment, and perform final alignment based on the rotation and translation matrix, the at least one third reference point and the at least one second reference point.
[0065] Furthermore, in some embodiments, the alignment module 300 is also used to: calculate the deviation of the at least one third reference point and the at least one second reference point in a one-to-one correspondence to obtain the reference point deviation calculation result; and perform final alignment according to the rotation and translation matrix and the reference point deviation calculation result.
[0066] Furthermore, in some embodiments, the alignment module 300 is also used to: determine whether the reference point deviation calculation result meets the deviation requirement based on a preset deviation threshold; if the reference point deviation calculation result does not meet the deviation requirement, perform final alignment based on the rotation and translation matrix.
[0067] Further, in some embodiments, the at least one third reference point and the at least one second reference point are both six points, wherein the alignment module 300 is further used to: translate the first point of the third reference points to the first point of the second reference points based on the first translation strategy determined by the rotation and translation matrix; align the second point of the third reference points to the line between the first point of the second reference points and the second point of the second reference points based on the first rotation strategy determined by the rotation and translation matrix; rotate the third point of the third reference points to align them to the plane corresponding to the first point of the second reference points, the second point of the second reference points, and the third point of the second reference points based on the second rotation strategy determined by the rotation and translation matrix; translate the fourth point of the third reference points to the fourth point of the second reference points based on the second translation strategy determined by the rotation and translation matrix; align the fifth point of the third reference points to the line between the fourth point of the second reference points and the fifth point of the second reference points based on the third rotation strategy determined by the rotation and translation matrix; and translate the sixth point of the third reference points to the sixth point of the second reference points based on the fourth translation strategy determined by the rotation and translation matrix.
[0068] Furthermore, in some embodiments, the acquisition module 100 is also used to: acquire the standard digital model to be converted; convert the standard digital model to be converted into a triangulated model, refine the triangulated model, and convert the refined triangulated model into point cloud data to obtain the model point cloud.
[0069] It should be noted that the above explanation of the embodiment of the method for aligning a point cloud and a CAD model is also applicable to the device for aligning a point cloud and a CAD model in this embodiment, and will not be repeated here.
[0070] According to the point cloud and CAD model alignment device provided by the embodiment of the present invention, the scanned point cloud and the model point cloud are first obtained, and then the two types of point clouds are initially aligned according to the preset three-coordinate detection strategy. Finally, based on the preset three-coordinate detection strategy, reference points are extracted from the initially aligned point cloud, and the final alignment is completed according to the extraction results. This solves the problem in related technologies that the alignment accuracy is affected by multiple factors such as scanning errors, point cloud sparsity, noise, and computational complexity, which leads to certain deviations in the measurement results and insufficient accuracy and stability. It improves the accuracy and applicability of the point cloud and CAD model alignment method.
[0071] Figure 3 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention. The electronic device may include: Memory 301 , processor 302 , and computer programs stored in the memory 301 and executable on the processor 302 .
[0072] When the processor 302 executes the program, the method for aligning the point cloud and the CAD model provided in the above embodiment is implemented.
[0073] Furthermore, the electronic device further includes: The communication interface 303 is used for communication between the memory 301 and the processor 302 .
[0074] The memory 301 is used to store computer programs that can be run on the processor 302 .
[0075] The memory 301 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0076] If the memory 301, processor 302, and communication interface 303 are implemented independently, the communication interface 303, memory 301, and processor 302 can be interconnected via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0077] Optionally, in a specific implementation, if the memory 301, the processor 302 and the communication interface 303 are integrated on a chip, the memory 301, the processor 302 and the communication interface 303 can communicate with each other through an internal interface.
[0078] The processor 302 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0079] In addition, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned method for aligning a point cloud and a CAD model when executed by a processor.
[0080] In addition, an embodiment of the present invention further provides a computer program product, including a computer program, which is executed to implement the above-mentioned method for aligning a point cloud with a CAD model.
[0081] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0082] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "N" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0083] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a custom logical function or step of a process, and the scope of the preferred embodiments of the invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of the invention pertain.
[0084] It should be understood that various components of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logical functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.
[0085] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
Claims
1. A method for aligning a point cloud and a CAD model, characterized in that: The following steps are involved: Get scanning point cloud and model point cloud; Based on a preset three-coordinate detection strategy, the scanned point cloud and the model point cloud are preliminarily aligned, and the preliminarily aligned scanned point cloud and the preliminarily aligned model point cloud are preliminarily aligned; Based on a preset three-coordinate detection strategy, reference points are extracted from the scanned point cloud and the model point cloud after the initial alignment, and final alignment is performed based on the reference point extraction results.
2. The method according to claim 1, characterized in that The method of extracting reference points from the scanned point cloud and the model point cloud after the initial alignment based on the preset three-coordinate detection strategy and performing final alignment based on the reference point extraction results includes: Based on a preset three-coordinate detection strategy, extract at least one pair of reference points from the scan point cloud after the initial alignment and the model point cloud after the initial alignment, wherein the at least one pair of reference points includes at least one first reference point of the scan point cloud after the initial alignment and at least one second reference point of the model point cloud after the initial alignment; Calculating the positional relationship of the at least one pair of reference points to obtain a rotation and translation matrix from the scanned point cloud to the model point cloud; At least one third reference point is extracted from the initially aligned model point cloud, and final alignment is performed based on the rotation and translation matrix, the at least one third reference point, and the at least one second reference point.
3. The method according to claim 2, characterized in that The performing final alignment according to the rotation and translation matrix, the at least one third reference point, and the at least one second reference point comprises: Calculating deviations of the at least one third reference point and the at least one second reference point in a one-to-one correspondence to obtain reference point deviation calculation results; Final alignment is performed based on the rotation and translation matrix and the reference point deviation calculation results.
4. The method according to claim 3, characterized in that The final alignment according to the rotation and translation matrix and the reference point deviation calculation result includes: Based on a preset deviation threshold, determining whether the reference point deviation calculation result meets the deviation requirement; If the reference point deviation calculation result does not meet the deviation requirement, a final alignment is performed based on the rotation and translation matrix.
5. The method according to claim 4, characterized in that The at least one third reference point and the at least one second reference point are both six points, wherein the final alignment based on the rotation and translation matrix includes: Based on a first translation strategy determined by the rotation and translation matrix, translate a first point in the third reference points to a first point in the second reference points; aligning a second point among the third reference points to a line between a first point among the second reference points and a second point among the second reference points based on a first rotation strategy determined by the rotation-translation matrix; Based on a second rotation strategy determined by the rotation-translation matrix, rotate the third point in the third reference points to align it with a plane corresponding to the first point in the second reference points, the second point in the second reference points, and the third point in the second reference points; Based on a second translation strategy determined by the rotation and translation matrix, translate a fourth point among the third reference points to a fourth point among the second reference points; Aligning a fifth point among the third reference points to a line between a fourth point among the second reference points and a fifth point among the second reference points based on a third rotation strategy determined by the rotation-translation matrix; Based on a fourth translation strategy determined by the rotation and translation matrix, a sixth point among the third reference points is translated to a sixth point among the second reference points.
6. The method according to claim 1, wherein: The obtaining of the model point cloud comprises: Obtain the standard digital model to be converted; The standard digital model to be converted is converted into a triangulated model, the triangulated model is refined, and the refined triangulated model is converted into point cloud data to obtain the model point cloud.
7. A point cloud and CAD model alignment device, characterized in that: The device comprises: Acquisition module, used to acquire scanning point cloud and model point cloud; A preprocessing module is used to perform preliminary alignment processing on the scan point cloud and the model point cloud based on a preset three-coordinate detection strategy, and the scan point cloud and the model point cloud after preliminary alignment are pre-aligned; The alignment module is used to extract reference points from the scan point cloud and the model point cloud after the initial alignment based on a preset three-coordinate detection strategy, and perform final alignment according to the reference point extraction results.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for aligning a point cloud and a CAD model according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method for aligning a point cloud and a CAD model as described in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for aligning a point cloud and a CAD model according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Cross-view-angle point cloud alignment method and system for optical element defects
CN121482051A
Method and system for aligning cross-azimuth point clouds of optical element defects
CN121482051B
Visual positioning-based wallboard defect detection method, device, equipment and medium
CN121582250A
