Point cloud data determination method and apparatus, device, and medium
By sampling according to the size characteristic values in the discrete mesh model of the CAD model, the problem of low coarse registration accuracy caused by sparse mesh in the prior art is solved, and the effect of improving sampling point density and detection accuracy without reducing rendering processing efficiency is achieved.
Patent Information
- Application Number
- PCT/CN2024/116989
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-07
- Filing Date
- 2024-09-05
- Publication Date
- 2025-03-13
AI Technical Summary
In the prior art, in order to improve the efficiency of rendering processing of CAD model, relatively sparse mesh is usually used for discrete processing, resulting in lower subsequent coarse registration accuracy. How to improve the density of the corresponding sampling point of the CAD model without reducing the rendering processing efficiency has become an urgent problem.
By discretizing the preset computer-aided design model, a discrete grid model is generated, and sampling inside the target discrete grid based on the size characteristic value of the model is used to obtain sampled point cloud data, thereby increasing the density of the sampling point without increasing the grid density.
Without reducing the efficiency of rendering and processing of CAD models, the sampling point density corresponding to the CAD model is improved, so that the sampled point cloud data can better retain the characteristics of the original CAD model and improve the accuracy of subsequent detection.
Smart Images

Figure CN2024116989_13032025_PF_FP_ABST
Abstract
Description
Point cloud data determination method, device, equipment and medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 7, 2023, with application number 202311157078.X, and invention name “Point cloud data determination method, device, equipment and medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for determining point cloud data. Background Art
[0003] In the actual production process, a Computer Aided Design (CAD) model is used as a sample, and a production part is produced based on this sample. After the production part is completed, it is inspected. First, the production part needs to be scanned to obtain scanned point cloud data. The CAD model is discretized to obtain a discrete mesh model. The vertices in the scanned point cloud model and the discrete mesh model are coarsely aligned, and subsequent inspection is based on this coarse alignment result.
[0004] To prevent dense mesh processing from reducing CAD model rendering efficiency, related technologies discretize CAD models using a sparse mesh. The resulting vertices are also sparse, resulting in lower coarse registration accuracy. Improving the density of sampling points corresponding to CAD models without reducing rendering efficiency has become a pressing issue.
[0005] Summary of the Invention
[0006] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a point cloud data determination method, device, equipment and medium.
[0007] The present disclosure provides a method for determining point cloud data, including:
[0008] Discretizing a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids;
[0009] Determine a size characteristic value of the computer-aided design model, and perform sampling inside a target discrete grid according to the size characteristic value to obtain sampling point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids.
[0010] The present disclosure also provides a point cloud data determination device, comprising:
[0011] A discrete processing module is configured to discretize a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids;
[0012] A sampling module is configured to determine a size characteristic value of the computer-aided design model, and perform sampling inside a target discrete grid according to the size characteristic value to obtain sampling point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids.
[0013] An embodiment of the present disclosure also provides an electronic device, which includes: a processor, a memory, and instructions stored in the memory and executable by the processor. The processor reads the instructions from the memory and implements the point cloud data determination method provided in the embodiment of the present disclosure when executing the instructions.
[0014] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the point cloud data determination method provided in the embodiment of the present disclosure is implemented.
[0015] The technical solution provided by the embodiment of the present disclosure has the following advantages over the prior art: the point cloud data determination solution provided in the embodiment of the present disclosure includes: discretizing a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes multiple discrete grids; determining the size characteristic value of the computer-aided design model, sampling inside the grid of the target discrete grid according to the size characteristic value, and obtaining sampled point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids. Using the above technical solution, sampling is performed on the grid inside of the discrete grid according to the size characteristic value of the CAD model, and without discretizing the CAD model to a denser grid, new sampling points are reasonably added inside the grid based on the size of the CAD model, so that the sampling points corresponding to the CAD model are denser, and the sampled point cloud data can better retain the characteristics of the original CAD model. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0017] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] FIG1 is a schematic diagram of a flow chart of a method for determining point cloud data provided by an embodiment of the present disclosure;
[0019] FIG2 is a schematic diagram of a flow chart of another method for determining point cloud data provided by an embodiment of the present disclosure;
[0020] FIG3 is a flow chart of another method for determining point cloud data provided by an embodiment of the present disclosure;
[0021] FIG4 is a schematic diagram of sampling a to-be-processed mesh having a regular triangle shape provided by an embodiment of the present disclosure;
[0022] FIG5 is a schematic diagram of dividing a to-be-processed grid in the shape of a narrow and long triangle provided by an embodiment of the present disclosure;
[0023] FIG6 is a schematic diagram of dividing a to-be-processed mesh in the shape of a target polygon provided by an embodiment of the present disclosure;
[0024] FIG7 is a flow chart of another method for determining point cloud data provided by an embodiment of the present disclosure;
[0025] FIG8 is a schematic structural diagram of a point cloud data determination device provided by an embodiment of the present disclosure;
[0026] FIG9 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0028] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0029] With the rapid development of industrial technology, the demand for intelligence and digitalization in the industrial field is becoming increasingly strong. Among them, automated industrial testing is the core of improving testing accuracy and efficiency.
[0030] In the actual production process, a Computer Aided Design (CAD) model is used as a sample, and production parts are produced based on this sample. The production part is then scanned to obtain scanned point cloud data. Furthermore, the CAD model is discretized to obtain a discrete mesh model. To detect differences between the sample and the production part, a coarse registration is first performed between the vertices in the discrete mesh model and the scanned cloud data. This coarse registration ensures that the approximate poses of the vertices in the discrete mesh model and the scanned cloud data overlap.
[0031] To achieve accurate coarse registration, the discrete mesh model needs to have a sufficiently large number of vertices, thus requiring a dense mesh. However, in related technologies, to improve the efficiency of rendering CAD models, the mesh obtained by discretizing the CAD model is relatively sparse, resulting in low subsequent coarse registration accuracy. How to appropriately increase the density of sampling points corresponding to the CAD model without reducing rendering efficiency has become a pressing issue.
[0032] In order to solve the above problems, an embodiment of the present disclosure provides a method for determining point cloud data, which is introduced below in conjunction with specific embodiments.
[0033] FIG1 is a flow chart of a method for determining point cloud data according to an embodiment of the present disclosure. The method may be executed by a point cloud data determining device or a target client. The device may be implemented using software and / or hardware and may generally be integrated into an electronic device. As shown in FIG1 , the method for determining point cloud data includes:
[0034] Step 101 : discretize a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids.
[0035] Among them, the CAD model can be a model drawn by computer-aided design software, and the CAD model can be a three-dimensional model for designing a production part. This embodiment does not limit the type of production part corresponding to the CAD model. For example, the production part can be an industrial part, etc. The CAD model can be understood as a sample corresponding to the production part. The discrete grid model is also called a digital-analog grid model. The discrete grid model can be a model obtained after meshing the CAD model. The discrete grid can be a grid in the discrete grid model. This embodiment does not limit the shape of the discrete grid. For example, the discrete grid can be a triangle, or the discrete grid can be other polygons with a side number greater than 3.
[0036] In the embodiment of the present disclosure, the user produces a production part based on a CAD model. In order to determine the difference between the production part and the CAD model, it is necessary to determine the point cloud data corresponding to the CAD model. First, the CAD model is discretized into a discrete grid model according to a preset grid density by meshing, and the discrete grid model includes multiple discrete grids. Among them, the preset grid density can be a value less than the preset grid density, so that the discretization processing is performed with a smaller grid density, which improves the efficiency of model rendering. In addition, there are many ways to discretize the CAD model, which are not limited in this embodiment.
[0037] Step 102 : determining the size characteristic value of the computer-aided design model, and sampling inside the target discrete grid according to the size characteristic value to obtain sampling point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids.
[0038] The size characteristic value may be a value representing the size of the space occupied by the CAD model. There are multiple size characteristic values, which are not limited in this embodiment. For example, the size characteristic value may be the length of the line connecting the farthest points of the CAD model. The size characteristic value may also be understood as a density value for subsequent sampling. The interior of the target discrete grid may be within the area surrounded by the target discrete grid. The sampling point cloud may be a point cloud composed of multiple points obtained by sampling the interior of the grid, and the sampling point cloud data may be data recording the sampling point cloud.
[0039] In the disclosed embodiments, there are various methods for determining the size characteristic value, which are not limited in this embodiment. For example, the point cloud data determination device can determine the size characteristic value of the CAD model based on the size of the space occupied by the CAD model. Alternatively, the point cloud data determination device can determine the size characteristic value of the corresponding CAD model based on the size of the space occupied by the discrete grid model.
[0040] After determining the size characteristic value, the point cloud data determination device may determine all discrete grids as target discrete grids, perform point sampling on the interior of all discrete grids according to the size characteristic value to obtain a sampled point cloud, and record the sampled point cloud data of the sampled point cloud. Alternatively, the point cloud data determination device may determine a portion of the discrete grids as target discrete grids, perform point sampling on the interior of the portion of the discrete grids according to the size characteristic value to obtain a sampled point cloud, and record the sampled point cloud data of the sampled point cloud.
[0041] In some embodiments of the present disclosure, determining a dimensional characteristic value of a computer-aided design model includes:
[0042] Determine a model bounding volume of a computer-aided design model and determine a size parameter value of the model bounding volume; input the size parameter value into a preset feature calculation function to obtain a size feature value; wherein the feature calculation function includes a preset adjustment constant and a base constant, and in the feature calculation function, an exponent of the base constant is determined according to the size parameter value and the adjustment constant.
[0043] The model bounding volume may be a geometric body that encloses the CAD model. This embodiment does not limit the type of the model bounding volume. For example, the model bounding volume may be a bounding box or a bounding sphere. The size parameter value may be a value representing the size of the space occupied by the model bounding volume.
[0044] The feature calculation function may be a function that can calculate the size feature value of the CAD model based on the size parameter value of the model bounding volume. The adjustment constant may be a constant for systematically adjusting the feature calculation function. The adjustment constant may be set according to user needs, application scenarios, etc., and is not limited in this embodiment. The base constant may be a constant used as the base in the feature calculation function. The base constant may be set according to user needs, application scenarios, etc., and is not limited in this embodiment. For example, the base constant may be a natural constant. For example, in the feature calculation function, the base may be a base constant, and the exponent may be the inverse of the product of the size parameter value and the adjustment constant. For example, the feature calculation function may be y=1-e -kr , where e is the base constant, k is the adjustment constant, r is the size parameter value, and y is the size characteristic value.
[0045] In this embodiment, different types of model bounding volumes may have corresponding size parameter value calculation methods. For example, if the model bounding volume is a sphere, the size parameter value may be the radius of the sphere. If the model bounding volume is a box, the size parameter value may be a value determined based on one or more of the length, width, and height of the box.
[0046] The size parameter value is input into the feature calculation function, and the size feature value of the CAD model is obtained through calculation of the feature calculation function.
[0047] In this approach, the model bounding volume provides a more accurate representation of the size of the space occupied by the CAD model. The size parameter values are converted into size feature values using a feature calculation function. The adjustment constants in this feature calculation function can be set based on the application scenario of the CAD model to meet the sampling point density requirements in different application scenarios.
[0048] In some embodiments of the present disclosure, after the sampling point cloud data is determined, a coarse registration may be performed based on the sampling point cloud data. There are many methods for implementing the coarse registration, which are not limited in this embodiment. Examples are as follows:
[0049] In an optional implementation, the point cloud data determination method further includes: acquiring scanned point cloud data of the target production part, and performing coarse registration on the scanned point cloud data and the sampled point cloud data.
[0050] In another optional embodiment, the point cloud data determination method also includes: obtaining scanning point cloud data of the target production part; determining the vertex data of each discrete grid, merging the vertex data into the sampled point cloud data to obtain grid point cloud data; and performing coarse alignment on the scanning point cloud data and the grid point cloud data.
[0051] The target production part may be a production part produced using a computer-aided design model as a sample; the vertex data may be data recording the vertices of a discrete mesh. The mesh point cloud data may include sampled point cloud data and vertex data. The mesh point cloud data may be understood as the comprehensive point cloud data of the currently determined CAD model.
[0052] In this embodiment, the user uses a CAD model as a sample to produce a corresponding target production part, thus requiring inspection of the target production part based on the CAD model. During the inspection process, a coarse registration is first required. Specifically, the point cloud data determination device can scan the target production part to determine the scanned point cloud data for the target production part. Alternatively, the point cloud data determination device can directly obtain existing scanned point cloud data of the target production part.
[0053] For each discrete mesh in the discrete mesh model, the point cloud data determination device obtains vertex data for each discrete mesh and then merges the vertex data with the sampled point cloud data to generate mesh point cloud data corresponding to the CAD model. Furthermore, a coarse registration is performed based on the mesh point cloud data of the CAD model and the scanned point cloud data of the target production part.
[0054] In the above scheme, the grid point cloud data includes both the point cloud data obtained by sampling inside the grid and the vertex data of the grid, which can more comprehensively characterize the shape of the CAD model. Therefore, the accuracy of the rough alignment based on the grid point cloud data is higher.
[0055] The point cloud data determination method provided by the embodiment of the present disclosure includes: discretizing a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes multiple discrete grids; determining the size characteristic value of the computer-aided design model, sampling inside the grid of the target discrete grid according to the size characteristic value, and obtaining sampled point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids. Using the above technical solution, sampling is performed on the grid inside of the discrete grid according to the size characteristic value of the CAD model. Without discretizing the CAD model to a denser grid, new sampling points are reasonably added inside the grid based on the size of the CAD model, so that the sampling points corresponding to the CAD model are denser, and the sampled point cloud data can better retain the characteristics of the original CAD model.
[0056] FIG2 is a flow chart of another method for determining point cloud data provided by an embodiment of the present disclosure. As shown in FIG2 , before sampling within the target discrete grid based on the size characteristic value, the method further includes: determining a to-be-processed area in the discrete grid model that satisfies a preset grid sparsity condition, and determining the discrete grid within the to-be-processed area as the target discrete grid. The method includes:
[0057] Step 201 : discretize a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids.
[0058] Step 202 : determining a region to be processed that meets a preset grid sparse condition in the discrete grid model, and determining the discrete grid in the region to be processed as a target discrete grid.
[0059] The grid sparse condition may be a condition for determining whether the discrete grid within a region is sparse. There are various grid sparse conditions, which are not limited in this embodiment. For example, the grid sparse condition may be: if the number of discrete grid vertices included in the region is less than a preset vertex number threshold, then the region is determined to meet the grid sparse condition. Alternatively, the grid sparse condition may be: if the number of mesh edges of the discrete grid included in the region is less than a preset edge number threshold, then the region is determined to meet the grid sparse condition. The area to be processed may be an area where point sampling is to be performed due to the sparse discrete grid.
[0060] In this embodiment, the point cloud data determination device can divide the discrete grid model into multiple candidate areas, each candidate area corresponds to a part of the discrete grid model, and for each candidate area, it is determined whether the candidate area meets the grid sparse condition. If so, the candidate area is determined as the area to be processed, and the discrete grid within the area to be processed is determined as the target discrete grid.
[0061] In some embodiments of the present disclosure, determining an area to be processed in a discrete grid model that meets a preset grid sparsity condition includes: determining a candidate area in the discrete grid model; determining the total number of grid side lengths in the candidate area, and a statistical number of target grid side lengths greater than a side length threshold; if the ratio of the statistical number to the total number is greater than the ratio threshold, the candidate area is determined as the area to be processed.
[0062] Among them, the total number of grid side lengths can be the total number of multiple grid side lengths of multiple discrete grids included in the candidate area. The side length threshold can be a pre-set value for determining whether the grid side length is too long. The side length threshold can be set according to user needs, etc., and is not limited in this embodiment. The target grid side length can be the grid side length in the candidate area that is longer than the side length threshold, and the statistical number can be the number of the target grid side lengths. The quantity ratio can be a value determined by using the statistical number as the numerator and the total number as the denominator. The ratio threshold can be a pre-set maximum value of the quantity ratio for determining that the grids in the candidate area are non-sparse.
[0063] In this embodiment, the point cloud data determination device may divide the discrete mesh model into multiple candidate regions, each candidate region corresponding to a portion of the discrete mesh model. For each candidate region, the total number of mesh side lengths within the candidate region is determined, and each mesh side length within the candidate region is compared with a side length threshold to determine target mesh side lengths greater than the side length threshold. The target mesh side lengths are then counted to obtain a statistical number.
[0064] Furthermore, the ratio of the statistical number to the total number is calculated to obtain a quantity ratio, and it is determined whether the quantity ratio is greater than a ratio threshold. If so, it indicates that there are too many discrete grids with long grid lengths in the candidate area. It can be understood that discrete grids with long grid lengths usually have larger enclosed areas and are relatively sparse. Therefore, the candidate area with a quantity ratio greater than the ratio threshold is determined as a to-be-processed area that meets the grid sparse condition. If the quantity ratio is not greater than the ratio threshold, it indicates that there are too few discrete grids with long grid lengths in the candidate area, and it is determined that the candidate area does not meet the grid sparse condition.
[0065] Step 203 : determining the size characteristic value of the computer-aided design model, and performing sampling inside the target discrete grid according to the size characteristic value to obtain sampling point cloud data.
[0066] In the above scheme, the discrete grid in the area with relatively sparse grids is determined as the target discrete grid, and point sampling is subsequently performed on the target discrete grid instead of performing point sampling on all discrete grids. This avoids sampling the part of the grid that is already relatively dense, and reasonably saves computing power resources.
[0067] In some embodiments of the present disclosure, for a to-be-processed mesh having a regular triangular shape, the to-be-processed mesh may be directly sampled. In the above embodiment, sampling is performed inside the target discrete mesh according to the size eigenvalue to obtain sampled point cloud data, including:
[0068] The target discrete grid is determined as the grid to be processed, and the shape of the grid to be processed is determined; if the shape of the grid to be processed is a regular triangle, the coordinate axes in the first coordinate system are established according to two edges of the grid to be processed in the grid to be processed, and the size characteristic value is used as the unit length in the first coordinate system; wherein, a regular triangle is a triangle in which the multiple of the longest side and the shortest side is less than a multiple threshold; and the interior of the grid to be processed is sampled according to the first coordinate system.
[0069] In some embodiments of the present disclosure, for a mesh to be processed that is in the shape of a narrow and long triangle, the mesh to be processed may be divided into multiple triangles, and subsequent sampling is performed based on the multiple triangles. The point cloud data determination device further includes:
[0070] If the shape of the mesh to be processed is a long and narrow triangle, determine the target vertex angle perpendicular to the maximum vertex angle in the mesh to be processed; divide the mesh to be processed into multiple new meshes to be processed using the target vertex angle perpendicular, and return the shape of each new mesh to be processed. A long and narrow triangle is a triangle in which the multiple of the longest side to the shortest side is greater than or equal to the multiple threshold.
[0071] In some embodiments of the present disclosure, for a to-be-processed mesh having a target polygonal shape, the to-be-processed mesh may be divided into a plurality of triangles, and subsequent sampling is performed based on the plurality of triangles. The point cloud data determination apparatus further includes:
[0072] If the shape of the mesh to be processed is a target polygon, the mesh to be processed is divided into multiple new meshes to be processed each having a triangular shape, and the shape of each new mesh to be processed is determined. The target polygon is a polygon with more than 3 sides.
[0073] FIG3 is a flow chart of another method for determining point cloud data provided by an embodiment of the present disclosure. As shown in FIG3 , sampling is performed inside a target discrete grid according to size eigenvalues to obtain sampled point cloud data, including:
[0074] Step 301: Determine the target discrete grid as the grid to be processed. The grid to be processed may be a grid of a shape type to be determined.
[0075] In this embodiment, the target discrete grid that needs to be sampled inside the grid is determined as the grid to be processed.
[0076] Step 302: determine the shape of the grid to be processed.
[0077] In step 303, if the shape of the mesh to be processed is a regular triangle, coordinate axes in the first coordinate system are established based on two edges of the mesh to be processed, and the size characteristic value is used as the unit length in the first coordinate system; wherein, a regular triangle is a triangle in which the multiple of the longest side length and the shortest side length is less than a multiple threshold.
[0078] The regular triangle may be any triangle other than a narrow triangle. The first coordinate system may be the coordinate system used to sample the mesh to be processed. The multiple threshold may be the minimum multiple of the longest side length to the shortest side length when the triangle is a narrow triangle. The multiple threshold may be set based on user needs and is not limited in this embodiment. For example, the multiple threshold may be 3 or 5 times.
[0079] In this embodiment, if the number of grid side lengths of the grid to be processed is 3, the grid to be processed is determined to be a triangle, and the longest side length and the shortest side length of the grid to be processed are further determined, and the multiple of the longest side length and the shortest side length is determined. If the multiple of the longest side length and the shortest side length is less than the multiple threshold, the shape of the grid to be processed is determined to be a regular triangle.
[0080] Furthermore, if the maximum angle of the mesh to be processed is not a right angle, two coordinate axes of the first coordinate system are determined based on the longest and shortest sides, and the intersection of the longest and shortest sides of the mesh to be processed is used as the origin of the first coordinate system. If the maximum angle of the mesh to be processed is a right angle, two coordinate axes of the first coordinate system are determined based on the two right-angled sides, and the right-angle vertex is used as the origin of the first coordinate system. Furthermore, the first coordinate system is established using the size characteristic value as the unit length of the first coordinate system.
[0081] Step 304 : Sampling the interior of the grid to be processed according to the first coordinate system to obtain sampling point cloud data.
[0082] In this embodiment, after determining the first coordinate system, a coordinate point in the grid whose horizontal and vertical coordinates are multiples of the unit length is determined, the coordinate point is determined as a sampling point, and point cloud data recording the sampling point is generated.
[0083] FIG4 is a schematic diagram of sampling a grid to be processed in the shape of a regular triangle provided by an embodiment of the present disclosure. As shown in FIG4 , in FIG4 , the dots inside the grid to be processed are sampling points, and the short lines are scales of the first coordinate system.
[0084] In the above scheme, uniform sampling inside the regular triangular mesh is achieved based on the size eigenvalue.
[0085] Step 305 : If the shape of the mesh to be processed is a narrow triangle, determine the target vertex perpendicular line of the maximum vertex angle in the mesh to be processed; wherein the narrow triangle is a triangle whose multiple of the longest side length and the shortest side length is greater than or equal to the multiple threshold.
[0086] The maximum vertex angle in the to-be-processed grid may be an obtuse angle in the to-be-processed grid, and the target vertex angle perpendicular line may be a perpendicular line from the maximum vertex angle to the opposite side.
[0087] In this embodiment, if the number of mesh sides of the mesh to be processed is 3, the mesh to be processed is determined to be a triangle. The longest and shortest sides of the mesh to be processed are further determined, and the multiple of the longest and shortest sides is determined. If the multiple of the longest and shortest sides is not less than a multiple threshold, the shape of the mesh to be processed is determined to be a long, narrow triangle. For the mesh to be processed that is a long, narrow triangle, a perpendicular line from the maximum vertex angle to the target vertex angle of the opposite side is determined.
[0088] Step 306: Divide the to-be-processed mesh into a plurality of new to-be-processed meshes based on the vertical line of the target vertex angle. Return to step 302.
[0089] In this embodiment, the grid to be processed is divided into a plurality of new grids to be processed based on the vertical line of the target vertex, and the process returns to step 302 to determine the shape of each new grid to be processed.
[0090] Figure 5 is a schematic diagram of dividing a to-be-processed mesh in the shape of a long and narrow triangle provided by an embodiment of the present disclosure. As shown in Figure 5, the shape of the to-be-processed mesh ABC is a long and narrow triangle, the maximum vertex angle of the to-be-processed mesh ABC is angle B, the target vertex angle perpendicular is BD, and the new to-be-processed meshes obtained by the division include: to-be-processed mesh ABD and to-be-processed mesh CBD.
[0091] In step 307 , if the shape of the mesh to be processed is a target polygon, the mesh to be processed is divided into a plurality of new meshes to be processed each having a triangular shape; wherein the target polygon is a polygon with more than 3 sides. Return to step 302 .
[0092] In this embodiment, if the number of mesh edges of the mesh to be processed is greater than 3, the mesh to be processed is determined to be a target polygon. Using a pre-set target polygon partitioning algorithm, the mesh to be processed is divided into multiple new meshes to be processed each having a triangular shape. The process then returns to step 302 to determine the shape of each new mesh to be processed.
[0093] Figure 6 is a schematic diagram of dividing a to-be-processed mesh having a target polygon shape provided by an embodiment of the present disclosure. As shown in Figure 6 , the shape of the to-be-processed mesh EFGH is the target polygon, and the new to-be-processed meshes obtained by dividing the to-be-processed mesh EFGH include: a to-be-processed mesh EFG and a to-be-processed mesh GHE.
[0094] In the above solution, the target polygonal mesh to be processed is divided into a new triangular mesh to be processed, which expands the applicable scenarios of the point cloud data determination method.
[0095] Next, the point cloud data determination method in the embodiment of the present disclosure will be further described through a specific example. FIG7 is a flow chart of another point cloud data determination method provided by the embodiment of the present disclosure. As shown in FIG7,
[0096] Step 701: discretize the CAD model with a relatively low discrete precision to obtain a discrete grid model.
[0097] Step 702: Sample each discrete grid in the discrete grid model.
[0098] Specifically, the size characteristic value is determined according to the size parameter value of the bounding sphere of the CAD model, so as to realize the adaptive adjustment of the density of the sampling points according to the actual size of the CAD model. If y is the size characteristic value, then y = 1-e -kr , where e is the base constant, k is the adjustment constant, and r is the size parameter value.
[0099] Each discrete grid is determined as a grid to be processed.
[0100] If the shape of the grid to be processed is a regular triangle, starting from the angle between the longest side and the shortest side of the grid to be processed, the interior of the grid to be processed is sampled along its longest side and shortest side, and the sampling interval is the size characteristic value.
[0101] If the mesh to be processed is a narrow triangle, a perpendicular line is drawn from the vertex with the largest angle of the mesh to the opposite side to obtain the target vertex perpendicular line. The mesh to be processed is then split into two new meshes along the foot of the perpendicular line to the target vertex. The interior of the new meshes is sampled along the right-angled sides of the new meshes, with the sampling interval being the size characteristic value.
[0102] The sampling points obtained by the above sampling method are relatively uniform and regular, and can better preserve the characteristic information of the original CAD model.
[0103] Step 703 : determining sampling point cloud data of the CAD model based on the sampling points obtained by sampling, scanning the production part to obtain scanning point cloud data, and using the sampling point cloud data and the scanning point cloud data for coarse registration.
[0104] In the above scheme, by sampling uniformly and densely on the CAD model, the sampling points can represent the feature information of the original CAD model, and the sampling point cloud data determined based on the sampling points can achieve relatively accurate coarse registration with the scanned point cloud data.
[0105] FIG8 is a schematic diagram of the structure of a point cloud data determination device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device or applied to a target client. As shown in FIG8 , the device includes:
[0106] The discrete processing module 801 is configured to discretize a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids;
[0107] The sampling module 802 is configured to determine the size characteristic value of the computer-aided design model, and sample inside the grid of the target discrete grid according to the size characteristic value to obtain sampling point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids.
[0108] Optionally, the sampling module 802 is configured to:
[0109] Determining a model bounding volume of the computer-aided design model and determining size parameter values of the model bounding volume;
[0110] The size parameter value is input into a preset feature calculation function to obtain the size characteristic value; wherein the feature calculation function includes a preset adjustment constant and a base constant, and in the feature calculation function, the exponent of the base constant is determined according to the size parameter value and the adjustment constant.
[0111] Optionally, the device further comprises:
[0112] The target discrete grid determination module is configured to determine a to-be-processed area in the discrete grid model that satisfies a preset grid sparsity condition before sampling is performed inside the target discrete grid according to the size characteristic value, and determine the discrete grid within the to-be-processed area as the target discrete grid.
[0113] Optionally, the target discrete grid determination module is configured to:
[0114] determining a candidate region in the discrete grid model;
[0115] Determine the total number of grid side lengths in the candidate area and the statistical number of target grid side lengths greater than a side length threshold. If a ratio of the statistical number to the total number is greater than the ratio threshold, determine the candidate area as the area to be processed.
[0116] Optionally, the sampling module 802 is configured to:
[0117] Determining the target discrete grid as a grid to be processed, and determining the shape of the grid to be processed;
[0118] If the shape of the to-be-processed mesh is a regular triangle, establishing coordinate axes in a first coordinate system based on two to-be-processed mesh edges in the to-be-processed mesh, and using the size characteristic value as a unit length in the first coordinate system; wherein the regular triangle is a triangle in which the multiple of the longest side length and the shortest side length is less than a multiple threshold;
[0119] The interior of the grid to be processed is sampled according to the first coordinate system to obtain the sampled point cloud data.
[0120] Optionally, the sampling module 802 is further configured to:
[0121] If the shape of the grid to be processed is a narrow triangle, determining a target vertex perpendicular line of the maximum vertex angle in the grid to be processed;
[0122] The grid to be processed is divided into multiple new grids to be processed by the perpendicular line of the target vertex, and the shape of each of the new grids to be processed is returned to determine; wherein the narrow triangle is a triangle whose multiple of the longest side length and the shortest side length is greater than or equal to a multiple threshold.
[0123] Optionally, the sampling module 802 is further configured to:
[0124] If the shape of the to-be-processed mesh is a target polygon, the to-be-processed mesh is divided into a plurality of new to-be-processed meshes each having a triangular shape, and the shape of each of the new to-be-processed meshes is returned to determine; wherein the target polygon is a polygon having more than 3 sides.
[0125] Optionally, the device further comprises:
[0126] A scanning module configured to obtain scan point cloud data of a target production part;
[0127] a merging module configured to determine vertex data of each of the discrete grids, and merge the vertex data into the sampled point cloud data to obtain grid point cloud data;
[0128] The registration module is configured to perform coarse registration on the scan point cloud data and the grid point cloud data.
[0129] The point cloud data determination device provided in the embodiments of the present disclosure can execute the point cloud data determination method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0130] FIG9 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. As shown in FIG9 , the electronic device 900 includes one or more processors 901 and a memory 902 .
[0131] The processor 901 may be a central processing unit (CPU) or other forms of processing units having point cloud data determination capability and / or instruction execution capability, and may control other components in the electronic device 900 to perform desired functions.
[0132] The memory 902 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 901 may execute the program instructions to implement the point cloud data determination method of the embodiment of the present disclosure described above and / or other desired functions. The computer-readable storage medium may also store various contents such as input signals, signal components, noise components, etc.
[0133] In one example, the electronic device 900 may further include an input device 903 and an output device 904 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0134] In addition, the input device 903 may also include, for example, a keyboard, a mouse, and the like.
[0135] The output device 904 can output various information to the outside, including determined distance information, direction information, etc. The output device 904 can include, for example, a display, a speaker, a printer, a communication network and its connected remote output device, etc.
[0136] Of course, for the sake of simplicity, FIG9 only shows some of the components related to the present disclosure in the electronic device 900, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 900 may further include any other appropriate components according to specific application scenarios.
[0137] In addition to the above-mentioned method and device, the embodiment of the present disclosure may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the point cloud data determination method provided by the embodiment of the present disclosure.
[0138] The computer program product may be written in any combination of one or more programming languages to implement the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0139] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor executes the point cloud data determination method provided by the embodiment of the present disclosure.
[0140] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0141] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0142] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein. Industrial Applicability
[0143] In the point cloud data determination method provided by the present invention, the interior of the discrete grid is sampled according to the size characteristic value of the CAD model. Without discretizing the CAD model into a denser grid, new sampling points are reasonably added inside the grid based on the size of the CAD model, so that the sampling points corresponding to the CAD model are denser, and the sampled point cloud data can better retain the characteristics of the original CAD model, which has strong industrial practicality.
Claims
1. A method for determining point cloud data, wherein: include: Discretizing a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids; Determine the size characteristic value of the computer-aided design model, and perform sampling inside a target discrete grid according to the size characteristic value to obtain sampling point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids.
2. The method according to claim 1, wherein: Determining the dimension characteristic value of the computer-aided design model includes: Determining a model bounding volume of the computer-aided design model, and determining a size parameter value of the model bounding volume; The size parameter value is input into a preset feature calculation function to obtain the size feature value; wherein the feature calculation function includes a preset adjustment constant and a base constant, and in the feature calculation function, the exponent of the base constant is determined according to the size parameter value and the adjustment constant.
3. The method according to claim 1, wherein: Before sampling inside the grid of the target discrete grid according to the size characteristic value, the method further includes: A region to be processed that meets a preset grid sparse condition in the discrete grid model is determined, and a discrete grid in the region to be processed is determined as the target discrete grid.
4. The method according to claim 3, wherein: The determining of the area to be processed in the discrete grid model that meets the preset grid sparse condition includes: determining a candidate region in the discrete grid model; Determine the total number of grid side lengths in the candidate area and the statistical number of target grid side lengths greater than a side length threshold. If the ratio of the statistical number to the total number is greater than the ratio threshold, determine the candidate area as the area to be processed.
5. The method according to claim 1, wherein: The step of sampling inside the target discrete grid according to the size characteristic value to obtain sampling point cloud data includes: Determine the target discrete grid as a grid to be processed, and determine the shape of the grid to be processed; If the shape of the to-be-processed mesh is a regular triangle, a coordinate axis in a first coordinate system is established according to two to-be-processed mesh edges in the to-be-processed mesh, and the size characteristic value is used as a unit length in the first coordinate system; wherein the regular triangle is a triangle whose multiple of the longest side length and the shortest side length is less than a multiple threshold; The interior of the grid to be processed is sampled according to the first coordinate system to obtain the sampled point cloud data.
6. The method according to claim 5, wherein: Also includes: If the shape of the to-be-processed mesh is a narrow and long triangle, determine the target vertex angle perpendicular line of the maximum vertex angle in the to-be-processed mesh; wherein the narrow and long triangle is a triangle whose multiple of the longest side length and the shortest side length is greater than or equal to the multiple threshold; The target vertex perpendicular line is used to divide the to-be-processed grid into a plurality of new to-be-processed grids, and the new The shape of the mesh to be processed.
7. The method according to claim 5, wherein: Also includes: If the shape of the to-be-processed mesh is a target polygon, the to-be-processed mesh is divided into a plurality of new to-be-processed meshes having triangular shapes, and the shape of each of the new to-be-processed meshes is returned to determine; wherein the target polygon is a polygon having more than 3 sides.
8. The method according to claim 1, wherein: Also includes: Obtain scanning point cloud data of the target production part; Determine vertex data of each discrete grid, merge the vertex data into the sampling point cloud data, and obtain grid point cloud data; The scanned point cloud data and the grid point cloud data are roughly aligned.
9. A point cloud data determination device, wherein: include: A discrete processing module is configured to discretize a preset computer-aided design model to generate a discrete grid model; wherein the discrete grid model includes a plurality of discrete grids; A sampling module is configured to determine the size characteristic value of the computer-aided design model, and perform sampling inside the grid of the target discrete grid according to the size characteristic value to obtain sampling point cloud data; wherein the target discrete grid includes all or part of the multiple discrete grids.
10. An electronic device, wherein: The electronic device comprises: A processor, a memory, and instructions stored in the memory and executable by the processor; The processor reads the instruction from the memory, and implements the point cloud data determination method described in any one of claims 1 to 8 when executing the instruction.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the point cloud data determination method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
CAD model and triangular mesh full-automatic registration method and device
CN112381862A
Point cloud data sampling method and device, computer equipment and readable storage medium
CN114170401A
Three-dimensional scanning data processing method and device, electronic equipment and storage medium
CN115439631A
Crushing model generation method and device, electronic equipment and storage medium
CN115601524A
Point cloud data determination method and device, equipment and medium
CN117390714A
Cited By
Dividing method of vehicle collision test obstacle avoidance finite element model and electronic equipment
CN120562212A