Shearing Plane Creation Method, Scanning Device, and Storage Medium
By analyzing the preview data of the scanned object, the shear surface is automatically created, which solves the problem of inefficient cutting surface creation in the existing technology, and achieves efficient and accurate shear surface generation.
Patent Information
- Application Number
- CN202510425545.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-04-07
AI Technical Summary
In the prior art, the creation of shear surfaces is inefficient, the operation is cumbersome, and it is easy to introduce artificial subjective errors.
By analyzing the preview data of the scanned object, determining the three-dimensional coordinates and normal vectors of feature points, using the clustering algorithm to filter candidate planes, selecting target planes in combination with the preset polyhedral structure, performing plane fitting and offset processing, and automatically creating a shear plane.
The shear surface creation process is simplified, the creation efficiency is improved, the error introduced by manual intervention is reduced, and the accuracy and efficiency of shear surface creation is improved.
Smart Images

Figure CN119963784B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of three-dimensional scanning, and particularly relates to a method for creating a clipping plane, a scanning device, and a storage medium. Background Art
[0002] Three-dimensional scanning technology has been widely applied in multiple fields, such as autonomous driving, robot autonomous navigation, cultural relics protection, architectural design, clinical medicine, etc. In a three-dimensional scanning scenario, creating a clipping plane (CP) is a key data processing and analysis means. By creating a clipping plane, non-concerned areas (such as occluded parts or redundant data) can be hidden, and the target area (such as the internal structure of a mechanical part, the damaged part of a cultural relic, etc.) can be analyzed intensively.
[0003] In related technologies, by performing three-dimensional scanning on a scanning object and selecting data in a manually boxed or semi-automatically assisted manner on the scanned data, the creation of a clipping plane can be achieved. However, the above methods are cumbersome to operate and the efficiency of creating a clipping plane is low. Summary of the Invention
[0004] Embodiments of this application provide a method for creating a clipping plane and related devices to solve the problem of low efficiency in creating a clipping plane.
[0005] In a first aspect, embodiments of this application provide a method for creating a clipping plane. The method for creating a clipping plane includes: determining three-dimensional coordinates and normal vectors corresponding to feature points on the scanning object according to preview data of the scanning object; determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors; selecting a target plane from the plurality of candidate planes according to the plane positions of the plurality of candidate planes and a preset polyhedron structure; performing plane fitting on the target plane to obtain an initial clipping plane; and performing an offset process on the initial clipping plane to obtain a target clipping plane of the scanning object.
[0006] In some embodiments, the determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors includes: performing clustering processing on the normal vectors according to the directions of the normal vectors to obtain a plurality of clustering clusters, and each clustering cluster corresponds to a number of normal vectors; determining the clustering clusters corresponding to the number of normal vectors greater than or equal to a first quantity threshold as target clustering clusters; and constructing the plurality of candidate planes according to the three-dimensional coordinates of each feature point in the target clustering clusters.
[0007] In some embodiments, constructing the multiple candidate planes based on the three-dimensional coordinates of each feature point in the target clustering cluster includes: constructing a feature point plane corresponding to each feature point based on the three-dimensional coordinates of each feature point in the target clustering cluster; determining a plurality of distances from each feature point plane to other feature points in the target clustering cluster, including: for any feature point plane corresponding to any feature point, calculating the distances from the other feature points in the target clustering cluster except the any feature point to the any feature point plane; and selecting the multiple candidate planes from the multiple feature point planes based on the plurality of distances corresponding to each feature point plane.
[0008] In some embodiments, constructing a feature point plane corresponding to each feature point based on the three-dimensional coordinates of each feature point in the target clustering cluster includes: determining an average normal vector corresponding to the target clustering cluster based on the normal vectors of each feature point in the target clustering cluster; and constructing a feature point plane corresponding to each feature point based on the average normal vector and the three-dimensional coordinates of each feature point.
[0009] In some embodiments, selecting the multiple candidate planes from the multiple feature point planes based on the plurality of distances corresponding to each feature point plane includes: counting the number of candidate feature points with distances less than or equal to a distance threshold from the plurality of distances corresponding to each feature point plane; and determining the candidate planes based on the number of candidate feature points, where the number of candidate feature points corresponding to the candidate planes is greater than or equal to a second quantity threshold.
[0010] In some embodiments, selecting a target plane from the multiple candidate planes based on the plane positions of the multiple candidate planes and a preset polyhedron structure includes: classifying the multiple candidate planes according to the polyhedron structure and the plane positions of the multiple candidate planes, where each class of candidate planes corresponds to one face in the polyhedron structure; and selecting a target plane from the classified multiple candidate planes according to the preset plane order corresponding to the polyhedron structure.
[0011] In some embodiments, performing plane fitting on the target plane to obtain an initial shear plane includes: obtaining the initial shear plane by using a preset fitting model based on the three-dimensional coordinates of multiple feature points in the target plane.
[0012] In some embodiments, performing an offset process on the initial shear plane to obtain a target shear plane of the scanned object includes: determining an offset distance according to the dimension information of the feature points corresponding to the scanned object; and moving the initial shear plane by the offset distance along the direction of the average normal vector corresponding to the initial shear plane to obtain the target shear plane, where the target shear plane is used for three-dimensional shearing.
[0013] In a second aspect, an embodiment of the present application provides a shear plane creation device, including: a data determination module, configured to determine the three-dimensional coordinates and normal vectors corresponding to feature points on the scanned object according to the preview data of the scanned object; a plane determination module, configured to determine a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors; a plane selection module, configured to select a target plane from the plurality of candidate planes according to the plane positions of the plurality of candidate planes and a preset polyhedron structure; a plane fitting module, configured to perform plane fitting on the target plane to obtain an initial shear plane; and an offset processing module, configured to perform offset processing on the initial shear plane to obtain the target shear plane of the scanned object.
[0014] In a third aspect, an embodiment of the present application provides a scanning device, including: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the shear plane creation method described in any one of the above is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the shear plane creation method described in any one of the above is implemented.
[0016] An embodiment of the present application provides a shear plane creation method, including: determining the three-dimensional coordinates and normal vectors corresponding to feature points on the scanned object according to the preview data of the scanned object; determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors; selecting a target plane from the plurality of candidate planes according to the plane positions of the plurality of candidate planes and a preset polyhedron structure; performing plane fitting on the target plane to obtain an initial shear plane; and performing offset processing on the initial shear plane to obtain the target shear plane of the scanned object. The above method analyzes the preview data of the scanned object to obtain a shear plane, without performing a scanning operation on the scanned object, which can simplify the shear plane creation process and improve the shear plane creation efficiency; and the above method analyzes the preview data to obtain the three-dimensional coordinates and normal vectors of the corresponding feature points of the scanned object, and automatically creates a shear plane according to the three-dimensional coordinates and normal vectors of the feature points, which can improve the shear plane creation efficiency. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.
[0018] Figure 1It is a schematic diagram of a device for implementing a shear plane creation method provided by an embodiment of the present application.
[0019] Figure 2 It is a flowchart of a shear plane creation method provided by an embodiment of the present application.
[0020] Figure 3 It is a schematic diagram of the construction of a candidate plane provided by an embodiment of the present application.
[0021] Figure 4 It is a schematic diagram of the selection of a target plane provided by an embodiment of the present application.
[0022] Figure 5 It is a schematic flowchart of a candidate plane construction method provided by an embodiment of the present application.
[0023] Figure 6 It is a schematic diagram of the structure of a shear plane creation device provided by an embodiment of the present application. Detailed implementation manners
[0024] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0025] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, illustration, or description. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that unless otherwise stated in this application, "at least one" means one or more. "A plurality" means two or more than two. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, a, b, and c, seven cases.
[0027] Figure 1 This is a schematic diagram of the application scenario of the shear plane creation method provided by an embodiment of this application. As Figure 1 shown, in the application scenario of the shear plane creation method, the scanning device 10 acquires preview data of the scanning object and completes the creation of the shear plane based on the preview data. Among them, the preview data may represent the point cloud data of the scanning object acquired by the scanning device 10 in the preview mode without performing a scanning operation.
[0028] In some embodiments, the scanning device 10 may be any three-dimensional scanning device with image processing capabilities and computing capabilities. For example, the scanning device 10 may include a fixed three-dimensional scanning device and a handheld three-dimensional scanning device. When the scanning device 10 is a fixed three-dimensional scanning device, the scanning object may include small-sized objects with high precision and detail requirements. For example, the scanning object may include, but is not limited to, precision die castings, forgings, plastic parts, hardware, and precision molds. When the scanning device 10 is a handheld three-dimensional scanning device, the scanning object may include medium and large-sized objects. For example, the scanning object may include, but is not limited to, large castings, clay models, external vehicle planes, automotive bent pipes, aircraft engine pipelines, drive shafts, and large blades, etc. An embodiment of this application will be described by taking the scanning device 10 as a fixed three-dimensional scanning device as an example. The scanning device 10 may include a binocular scanner, a multi-view scanner, etc., which are not limited herein.
[0029] In some embodiments, the scanning device 10 includes a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104, and a bus 105. The processor 103 is respectively coupled to the communication module 101, the memory 102, and the input / output interface 104 through the bus 105.
[0030] In some embodiments, the communication module 101 may include a wired communication module and / or a wireless communication module.
[0031] In some embodiments, the memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 103. The one or more computer programs include a plurality of instructions. When the plurality of instructions are executed by the processor 103, the shear plane creation method executable on the scanning device 10 can be implemented.
[0032] In some embodiments, the processor 103 provides computing and control capabilities. For example, the processor 103 is used to execute the computer program stored in the memory 102 to implement the above-mentioned shear plane creation method.
[0033] In some embodiments, the input / output interface 104 is used to provide channels for user input or output. For example, the input / output interface 104 can be used to connect various input and output devices, such as a mouse, a keyboard, a touch device, a display screen, etc., so that the user can input information or visualize information.
[0034] In some embodiments, in the application scenario of the shear plane creation method, the scanning object is placed within the field of view of the scanning device 10, so that the scanning device 10 can collect preview data of the complete scanning object. The preview data can represent a series of three-dimensional coordinate points on the surface of the scanning object, that is, the point cloud data of the scanning object. The scanning device 10 can create a shear plane of the scanning object (for ease of description, referred to as the "target shear plane" in this application) by performing data processing on the preview data. Based on the created target shear plane, the scanning device 10 hides non-concerned areas (such as occluded parts or redundant data) in the scanning object, so that the scanning device 10 can focus on analyzing the target area (such as the internal structure of a mechanical part, the damaged part of a cultural relic, etc.).
[0035] In the above application scenario, by analyzing the preview data of the scanning object by the scanning device 10, the shear plane corresponding to the scanning object is obtained, without performing a scanning operation on the scanning object, which can simplify the shear plane creation process and improve the shear plane creation efficiency. In addition, this application can realize automatic creation of the shear plane, without manually selecting or semi-automatically assisting to create the shear plane, improving the shear plane creation efficiency; in addition, by automatically creating the shear plane, the problem of introducing subjective errors due to manual intervention is reduced, and the accuracy of shear plane creation is improved.
[0036] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0037] Figure 2 is a flowchart of a shear plane creation method provided by an embodiment of this application. This shear plane creation method is applied to a scanning device (for example, Figure 1 the scanning device 10 in Figure 2 ). As
[0038] shown, the shear plane creation method includes the following steps. According to different requirements, the order of the steps in this flowchart can be changed, and some can be omitted.
[0039] In at least one embodiment of the present application, the scanning device may be a three-dimensional scanning device with image processing and computing capabilities. Through the camera of the scanning device, preview data of the scanning object can be obtained. The user can perform relevant operations on the physical buttons on the scanning device or the function controls in the touch area on the scanning device to execute the scanning operation. When the scanning device is not performing a scanning operation, the scanning device is in the preview mode, and point cloud data of the scanning object can be obtained. The preview data can represent the point cloud data of the scanning object obtained in the preview mode when the scanning device is not performing a scanning operation.
[0040] In some embodiments, the feature points on the scanning object may include fiducial points and position points on the surface of the scanning object with significant geometric or topological features. In some embodiments, multiple fiducial points may be provided on the surface of the scanning object. The fiducial points are used to enhance the recognition ability of the scanning device for the position and pose of the scanning object, and when the surface of the scanning object lacks texture or geometric features (such as a smooth plane, a single color), the fiducial points can be used to provide additional positioning information. In some embodiments, the fiducial points can be attached to the surface of the scanning object in a paste type, magnetic adsorption type, etc., according to a preset density. Among them, the preset density can be set according to actual needs. By setting the preset density, the problem of the fiducial points being too dense or too sparse on the surface of the scanning object can be avoided. In some embodiments, the position points on the surface of the scanning object with significant geometric or topological features are determined, where the position points with significant geometric features may include curvature extreme points, edge and ridge points, corner points, and transition points between convex and concave regions, and the position points with significant topological features may include connectivity key points and symmetry axis points.
[0041] In some embodiments, the curvature extreme points are used to represent the local maximum / minimum points of the surface curvature (Gaussian curvature, mean curvature, principal curvature) of the scanning object. For example, taking the scanning object as a mechanical part, the curvature extreme points may include the tooth tips and groove bottoms of gears. The edge and ridge points are used to represent the regions where the surface of the scanning object is discontinuous or the normal direction changes abruptly. For example, taking the scanning object as an industrial component, the edge and ridge points may include the edges of screw holes and the bending ridges of metal plates. The corner points are used to represent the intersection points of multiple-direction edges. For example, taking the scanning object as a cultural relic scan, the corner points may include the intersection nodes of the patterns on bronzeware. The transition points between convex and concave regions are used to represent the boundary line or turning point between the convex region and the concave region. For example, taking an organ model as an example, the transition points between convex and concave regions may include the boundary between the ventricles and atria on the surface of the heart model.
[0042] In some embodiments, connectivity key points are used to represent areas of surface bifurcation, closed loops, or topological structure changes of the scanned object. For example, taking a plant model as an example, the connectivity key points may include the bifurcation points of the branch model. The symmetry axis points can represent the intersection points of the symmetry axis of the scanned object and the surface. For example, taking an aircraft as an example, the symmetry axis points may include the connection points of the wing symmetry axis and the fuselage.
[0043] In some embodiments, the preview data may include point cloud data of multiple feature points on the surface of the scanned object. By parsing the preview data, the three-dimensional coordinates and normal vectors corresponding to the feature points can be obtained. Among them, the normal vector is used to describe the surface direction of the feature points in the scanned object. In some embodiments, any one feature point is selected, and the tangent plane of the feature point on the surface of the scanned object is determined. The unit vector perpendicular to the tangent plane and pointing to the outside of the scanned object (conforming to the right-hand rule) is used as the normal vector of the feature point. Based on this, the normal vector of each feature point on the scanned object can be obtained.
[0044] S12. Determine a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors.
[0045] In at least one embodiment of the present application, each feature point has corresponding three-dimensional coordinates and a normal vector, and each normal vector has corresponding direction information. By performing clustering processing on a plurality of normal vectors, classification processing of the feature points is realized. The feature points with the same or similar normal vector directions are placed in the same point set, and a plurality of point sets are obtained. The feature points in each point set are traversed, and according to the three-dimensional coordinates and the normal vectors, a feature point plane is constructed, and a plurality of feature point planes can be obtained. By screening a plurality of feature point planes, a plurality of candidate planes can be obtained. Among them, by determining the direction angle corresponding to any two normal vectors, it is possible to determine whether the directions of the two normal vectors are similar. For example, two normal vectors with a direction angle less than or equal to the angle threshold are determined to have similar directions, and two normal vectors with a direction angle greater than the angle threshold are determined to have a large direction difference. The direction angle can be determined according to the direction information of the two normal vectors, and the angle threshold can be set according to actual needs and is not limited here. The candidate plane can represent a potential shear plane estimate.
[0046] In some embodiments, the determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors includes: performing clustering processing on the normal vectors according to the directions of the normal vectors to obtain a plurality of clustering clusters, and each clustering cluster corresponds to a normal vector quantity; determining the clustering cluster corresponding to the normal vector quantity greater than or equal to the first quantity threshold as the target clustering cluster; and constructing the plurality of candidate planes according to the three-dimensional coordinates of each feature point in the target clustering cluster.
[0047] Among them, each normal vector has corresponding direction information. According to the direction of the normal vector, the preset clustering algorithm is used to divide the normal vectors with the same or similar directions into the same clustering cluster, and the normal vectors with different or greatly different directions are divided into different clustering clusters. The clustering algorithm can include but is not limited to the K-means clustering algorithm, the Partitioning Around Medoids Algorithm (PAM), and the Gaussian mixture clustering algorithm, which are not limited here.
[0048] Among them, the number of normal vectors can represent the number of normal vectors in the clustering cluster. The first quantity threshold can be set according to actual needs, which is not limited here. If the number of normal vectors in the clustering cluster is greater than or equal to the first quantity threshold, it indicates that in the local area of the surface of the scanned object, the normal vectors of more feature points are similar in direction, reflecting that the surface of this local area has relatively consistent orientation and geometric features. If the number of normal vectors in the clustering cluster is less than the first quantity threshold, it indicates that the local area of the surface of the scanned object may be in a transitional area. For example, the edges, corners of the scanned object, or the connection parts of different curved surfaces, etc. In the embodiment of the present application, by selecting the clustering cluster corresponding to the number of normal vectors greater than or equal to the first quantity threshold for analysis, the accuracy of the surface analysis of the scanned object can be improved, and then the accuracy of the shear plane creation can be improved, and the creation error caused by surface noise and irregularity can be reduced.
[0049] Among them, according to the three-dimensional coordinates of each feature point in the target clustering cluster, a feature point plane is constructed for each feature point in the target clustering cluster, and multiple feature point planes are obtained. By screening the multiple feature point planes, multiple candidate planes can be obtained.
[0050] Combined with Figure 3 Illustrate the schematic diagram of the construction of the candidate plane provided by the embodiment of the present application. As Figure 3As shown, the point cloud data of the scanned object includes feature points P1, P2, P3, …, Pn, and each feature point has a corresponding normal vector, denoted as normal vector F1, normal vector F2, normal vector F3, …, normal vector Fn respectively. According to the direction of each normal vector, clustering processing is performed on multiple normal vectors to obtain multiple clustering clusters. For example, clustering cluster C1, clustering cluster C2, clustering cluster C3, and clustering cluster C4. Select the clustering clusters whose number of normal vectors within the clustering cluster (for the convenience of description, simply referred to as "number of normal vectors" in this application) is greater than or equal to the first quantity threshold as the target clustering clusters. For example, after the above confirmation, clustering cluster C1 and clustering cluster C2 are determined as the target clustering clusters. Traverse each feature point in clustering cluster C1 to construct a feature point plane corresponding to the feature point; and traverse each feature point in clustering cluster C2 to construct a feature point plane corresponding to the feature point. Thus, multiple feature point planes can be obtained, and by screening the multiple feature point planes, multiple candidate planes can be obtained. Among them, for each feature point plane, it can be determined whether the feature point plane is a candidate plane according to the distance between other feature points in the clustering cluster corresponding to the feature point plane and the feature point plane.
[0051] The embodiment of this application uses the normal vectors of feature points for clustering processing, and can obtain a set of feature points (i.e., point set) with the same or similar directions of normal vectors. By constructing feature point planes for the feature points within the point set and screening to obtain candidate planes, the candidate planes can contain a relatively large number of feature points, improving the accuracy of shear plane construction.
[0052] S13. Select a target plane from the multiple candidate planes according to the plane positions of the multiple candidate planes and a preset polyhedron structure.
[0053] In at least one embodiment of this application, the preset polyhedron structure is used to assist in selecting a target plane from multiple candidate planes. The preset polyhedron structure includes multiple faces, and a plane order can be set for the multiple faces in advance. According to the plane order, assist in selecting a target plane from multiple candidate planes. Among them, the plane order can be determined according to the scanning posture of the scanning device, which is not limited here. The preset polyhedron structure can include a hexahedron structure, a tetrahedron structure, an octahedron structure, etc., which is not limited here. The selection of the polyhedron structure can be considered from perspectives such as calculation cost, adaptability to the scanned object, and interaction complexity. The embodiment of this application takes the preset polyhedron structure as a hexahedron structure as an example for illustration.
[0054] In some embodiments, according to the planar positions of multiple candidate planes, the multiple candidate planes are approximated into each face of the polyhedral structure. According to the preset planar order of the polyhedral structure, the candidate plane with the earliest planar order is selected as the target plane. Exemplarily, selecting a target plane from the multiple candidate planes according to the planar positions of the multiple candidate planes and the preset polyhedral structure includes: classifying the multiple candidate planes according to the polyhedral structure and the planar positions of the multiple candidate planes, and each class of candidate planes corresponds to one face of the polyhedral structure; selecting a target plane from the classified multiple candidate planes according to the preset planar order corresponding to the polyhedral structure.
[0055] Among them, the multiple candidate planes can be classified according to the planar angle between the candidate plane and each face of the polyhedral structure. The planar angle is used to evaluate the relative positional relationship between the candidate plane and each face of the polyhedral structure. The smaller the planar angle, the closer or more parallel the two planes are; the larger the planar angle, the more perpendicular or intersecting the two planes are. Based on this, the planar angles between the candidate plane and each face of the polyhedral structure are determined to obtain multiple planar angles; the face of the polyhedral structure corresponding to the smallest planar angle is selected as the face similar to the candidate plane.
[0056] Among them, after classifying the multiple candidate planes into each face of the polyhedral structure, since there is a planar order for each face of the polyhedral structure, accordingly, there is also a corresponding planar order for the candidate planes. The candidate plane with the earlier planar order is selected from the multiple candidate planes as the target plane. In some embodiments, the number of candidate planes with the earlier planar order can be 1, or can be multiple (that is, a certain face of the polyhedral structure corresponds to multiple candidate planes). When the number of candidate planes with the earlier planar order is multiple, any candidate plane can be selected as the target plane. The selection method can include random selection or designated selection, which is not limited herein.
[0057] Combined with Figure 4 Describe the schematic diagram of the selection of the target plane provided by the embodiments of the present application. The embodiments of the present application are described by taking the preset polyhedral structure as a hexahedral structure as an example, as Figure 4As shown, taking the scanning device as the coordinate center, a three-dimensional coordinate system is constructed according to the scanning posture of the scanning device (for example, the scanning device scans obliquely downward). In the three-dimensional coordinate system, a hexahedron structure is constructed. The hexahedron structure includes a D plane, a T plane, a B plane, an F plane, an L plane, and an R plane. Among them, the D plane is parallel to the T plane, the B plane is parallel to the F plane, and the L plane is parallel to the R plane. Considering that the scanning posture of the scanning device is to scan the scanning object obliquely downward, thus, the plane order from front to back can be set as the D plane - T plane - B plane - F plane - L plane - R plane. Among multiple candidate planes, the candidate plane approximated to the D plane is preferentially selected as the target plane. If there is no candidate plane approximated to the D plane, the candidate plane approximated to the T plane is taken as the target plane. And so on, until the target plane is selected from multiple candidate planes.
[0058] In the embodiment of the present application, by approximating multiple candidate planes to a preset polyhedron structure, according to the scanning posture of the scanning device, the plane order of multiple faces of the polyhedron structure is determined, and the candidate plane with a prior plane order is selected as the target plane according to the plane order, so that the target plane has a high adaptability to the scanning posture of the scanning device, improving the accuracy of target plane selection, and then improving the accuracy of shear plane construction.
[0059] S14, perform plane fitting on the target plane to obtain an initial shear plane.
[0060] In at least one embodiment of the present application, the target plane is selected from multiple candidate planes. The candidate plane is a feature point plane, that is, the target plane is used to represent a point-normal form plane constructed based on feature points. Among them, the point-normal form plane can represent a plane determined by a point in the plane and a non-zero vector perpendicular to the plane (i.e., the normal vector) in the space rectangular coordinate system. To improve the accuracy of shear plane construction, plane fitting is performed on the target plane based on multiple feature points in the target plane.
[0061] In some embodiments, the performing plane fitting on the target plane to obtain an initial shear plane includes: according to the three-dimensional coordinates of multiple feature points in the target plane, using a preset fitting model to obtain the initial shear plane. Among them, the preset fitting model can include the least squares method model, the random sample consensus algorithm, the principal component analysis method, the maximum likelihood estimation, the nonlinear optimization algorithm, and the deep learning fitting, etc., which are not limited herein.
[0062] In the embodiment of the present application, the preset fitting model is taken as the least squares method model for illustration. The goal of the least squares method model is to minimize the sum of the squares of the perpendicular distances from all feature points of the scanned object to the fitted initial shear plane. Exemplarily, based on the three-dimensional coordinates of multiple feature points in the target plane, a first plane is constructed; the distances from all feature points of the scanned object to the first plane are calculated, and the set of feature points whose distances are less than or equal to a preset value is recorded as the first feature point set; based on the first feature point set, plane fitting is performed again to obtain a second plane; the distances from all feature points of the scanned object to the second plane are calculated, and the set of feature points whose distances are less than or equal to a preset value is recorded as the second feature point set; if the number of feature points in the second feature point set is the same as the number of feature points in the first feature point set, the second plane is taken as the initial shear plane; if the number of feature points in the second feature point set is greater than the number of feature points in the first feature point set, plane fitting is performed again based on the second feature point set until the number of feature points in the obtained feature point set no longer increases. Among them, the preset value can be set according to actual needs and is not limited here. Feature points whose distances from the first plane are less than or equal to the preset value are determined to belong to the first plane, and feature points whose distances from the second plane are less than or equal to the preset value are determined to belong to the second plane.
[0063] In the embodiment of the present application, by performing plane fitting on the three-dimensional coordinates of multiple feature points in the target plane, the problem of low accuracy in plane construction caused by using a single feature point to construct a plane can be avoided, and the accuracy of shear plane construction can be improved.
[0064] S15. Perform an offset process on the initial shear plane to obtain the target shear plane of the scanned object.
[0065] In at least one embodiment of the present application, there may be a situation where some feature points are not in the initial shear plane. For example, some feature points are above the initial shear plane and some feature points are below the initial shear plane. To avoid the problem that some feature points cannot be sheared, the initial shear plane is offset so that as many feature points as possible can be sheared, which can improve the accuracy of shear plane determination.
[0066] In some embodiments, the offset processing of the initial shearing plane to obtain the target shearing plane of the scanned object includes: determining an offset distance based on the size information of the feature points corresponding to the scanned object; moving the initial shearing plane by the offset distance in the direction of the average normal vector corresponding to the initial shearing plane to obtain the target shearing plane, and the target shearing plane can be used as a basis for three-dimensional shearing. The embodiment of the present application determines the offset distance by determining the size information of the feature points corresponding to the scanned object, moves the initial shearing plane by the offset distance in the direction of the average normal vector corresponding to the initial shearing plane to obtain the target shearing plane, and uses the target shearing plane to achieve three-dimensional shearing, so that as many feature points corresponding to the scanned object as possible can be sheared, which can improve the accuracy of shearing plane determination.
[0067] The offset distance is determined according to the size information of the feature point, and the offset distance may be greater than or equal to the size of the feature point. For example, the offset distance may be 2 mm, 3 mm, 4 mm, etc., which is not limited here.
[0068] Among them, since the initial shearing surface is obtained by fitting the target plane, the target plane is selected from multiple candidate planes, and each candidate plane has a corresponding cluster. In this way, the cluster corresponding to the initial shearing surface is determined, and the average normal vector corresponding to the initial shearing surface can be obtained by summing and normalizing multiple normal vectors in the determined cluster.
[0069] Among them, using the target cutting plane to achieve three-dimensional cutting can include drawing the target cutting plane in the three-dimensional scene of the scanned object. If the scanning device detects that the user has performed a scanning operation, the scanned object is scanned to obtain scanning data, and the scanning data does not include the three-dimensional data below the target cutting plane. In some embodiments, if the user needs to add a cutting plane, the feature points below the target cutting plane of the scanned object can be removed, and the above steps S11 to S15 are repeated to create a new cutting plane.
[0070] An embodiment of the present application provides a method for creating a cutting surface, which obtains the cutting surface by analyzing the preview data of the scanned object. There is no need to perform a scanning operation on the scanned object, which can simplify the cutting surface creation process and improve the efficiency of cutting surface creation. The above method obtains the three-dimensional coordinates and normal vectors of the feature points corresponding to the scanned object by analyzing the preview data, and automatically creates the cutting surface based on the three-dimensional coordinates and normal vectors of the feature points, which can improve the efficiency of cutting surface creation.
[0071] In at least one embodiment of the present application, by clustering multiple normal vectors, classification processing of feature points is achieved. Feature points with the same or similar normal vector directions are placed in the same point set, and multiple point sets are obtained. Traverse the feature points in each point set, and based on the three-dimensional coordinates and normal vectors, construct a feature point plane, and multiple feature point planes can be obtained. By screening multiple feature point planes, multiple candidate planes can be obtained. Figure 5 is a schematic flowchart of a candidate plane construction method provided by an embodiment of the present application. The candidate plane construction method is applied to a scanning device. As Figure 5 shown, the method includes the following steps.
[0072] S21, construct a feature point plane corresponding to each feature point according to the three-dimensional coordinates of each feature point in the target clustering cluster.
[0073] In at least one embodiment of the present application, traverse each feature point in the target clustering cluster. According to the three-dimensional coordinates of each feature point and the normal vector of the plane where the point is located, a point-normal form plane corresponding to the feature point can be constructed, and the point-normal form plane is used as the feature point plane. In some embodiments, the step of constructing a feature point plane corresponding to each feature point according to the three-dimensional coordinates of each feature point in the target clustering cluster includes: determining an average normal vector corresponding to the target clustering cluster according to the normal vector of each feature point in the target clustering cluster; constructing a feature point plane corresponding to each feature point according to the average normal vector and the three-dimensional coordinates of each feature point.
[0074] Among them, by performing summation and normalization processing on multiple normal vectors in the target clustering cluster, the average normal vector of the target clustering cluster can be obtained. Exemplarily, perform summation processing on multiple normal vectors in the target clustering cluster to obtain a new vector, and perform normalization processing on the new vector to obtain the average normal vector of the target clustering cluster. Among them, the process of normalization processing can refer to the process of dividing the new vector by its vector length.
[0075] In the embodiment of the present application, by determining the average normal vector of each target clustering cluster and according to the average normal vector and the three-dimensional coordinates of each feature point, the feature point plane of each feature point can be constructed, improving the accuracy of feature point plane construction.
[0076] S22, determine multiple distances from each feature point plane to other feature points in the target clustering cluster, including: for any feature point plane corresponding to any feature point, calculate the distance between other feature points in the target clustering cluster except the any feature point and the any feature point plane.
[0077] In at least one embodiment of the present application, for any feature point plane corresponding to any feature point, calculate the distance between other feature points in the target clustering cluster except the any feature point and the any feature point plane. If the distance between other feature points and any feature point plane is less than or equal to the distance threshold, it indicates that the other feature points belong to the any feature point plane; if the distance between other feature points and any feature point plane is greater than the distance threshold, it indicates that the other feature points do not belong to the any feature point plane. Among them, the distance threshold can be set according to actual needs and is not limited here.
[0078] Continuing with the above embodiment, the target clustering cluster includes clustering cluster C1, where clustering cluster C1 includes feature point P1, feature point P2, feature point P3, feature point P4, and feature point P5. Feature point P1 corresponds to feature point plane M1, feature point P2 corresponds to feature point plane M2, feature point P3 corresponds to feature point plane M3, feature point P4 corresponds to feature point plane M4, and feature point P5 corresponds to feature point plane M5. For feature point plane M1, determine the distances from feature point P2, feature point P3, feature point P4, and feature point P5 to feature point plane M1 respectively. Among them, the distances from feature point P2, feature point P3, feature point P4, and feature point P5 to feature point plane M1 are less than or equal to the distance threshold. The distances from feature point P1, feature point P3, feature point P4 to feature point plane M2 are less than or equal to the distance threshold, and the distance from feature point P5 to feature point plane M2 is greater than the distance threshold. The distances from feature point P1, feature point P2, feature point P4 to feature point plane M3 are less than or equal to the distance threshold, and the distance from feature point P5 to feature point plane M3 is greater than the distance threshold. The distances from feature point P1, feature point P2, feature point P3 to feature point plane M4 are less than or equal to the distance threshold, and the distance from feature point P5 to feature point plane M4 is greater than the distance threshold. The distances from feature point P1, feature point P2, feature point P3 to feature point plane M5 are less than or equal to the distance threshold, and the distance from feature point P4 to feature point plane M5 is greater than the distance threshold.
[0079] S23. Based on the multiple distances corresponding to each feature point plane, select the multiple candidate planes from the multiple feature point planes.
[0080] In at least one embodiment of the present application, among the multiple distances corresponding to each feature point plane, the number of other feature points belonging to the feature point plane is counted, and the feature points belonging to the feature point plane are denoted as candidate feature points. In some embodiments, the selecting of the multiple candidate planes from the multiple feature point planes based on the multiple distances corresponding to each feature point plane includes: counting the number of candidate feature points with distances less than or equal to a distance threshold among the multiple distances corresponding to each feature point plane; determining the candidate plane based on the number of candidate feature points, where the number of candidate feature points corresponding to the candidate plane is greater than or equal to a second quantity threshold. The second quantity threshold can be set according to actual requirements and is not limited herein.
[0081] Continuing with the above embodiment, the candidate feature points corresponding to the feature point plane M1 include feature points P2, P3, P4, and P5, with a quantity of 4. The candidate feature points corresponding to the feature point plane M2 include feature points P1, P3, and P4, with a quantity of 3. The candidate feature points corresponding to the feature point plane M3 include feature points P1, P2, and P4, with a quantity of 3. The candidate feature points corresponding to the feature point plane M4 include feature points P1, P2, and P3, with a quantity of 3. The candidate feature points corresponding to the feature point plane M5 include feature points P1, P2, and P3, with a quantity of 3. If the second quantity threshold is 4, then the feature point plane M1 is taken as the candidate plane.
[0082] The embodiment of the present application determines multiple distances from each feature point plane to other feature points within the target clustering cluster, determines the number of feature points included in each feature point plane based on the multiple distances corresponding to each feature point plane, and selects multiple candidate planes from the multiple feature point planes, such that the candidate planes contain a relatively large number of feature points, improving the accuracy of shear plane construction.
[0083] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a shear plane creation device provided by an embodiment of the present application. In some embodiments, the shear plane creation device 20 may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the shear plane creation device 20 may be stored in the memory of the scanning device 10 and executed by at least one processor to perform the function of shear plane creation (as detailed in Figure 2 the description).
[0084] In this embodiment, the shear plane creation device 20 can be divided into multiple functional modules according to its executed functions. The functional modules may include: a data determination module 201, a plane determination module 202, a plane selection module 203, a plane fitting module 204, and an offset processing module 205. The module referred to in this application means a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0085] The data determination module 201 can be used to determine the three-dimensional coordinates and normal vectors corresponding to the feature points on the scanned object according to the preview data of the scanned object.
[0086] The plane determination module 202 can be used to determine multiple candidate planes according to the three-dimensional coordinates and the normal vectors.
[0087] The plane selection module 203 can be used to select a target plane from the multiple candidate planes according to the plane positions of the multiple candidate planes and a preset polyhedron structure.
[0088] The plane fitting module 204 can be used to perform plane fitting on the target plane to obtain an initial shear plane.
[0089] The offset processing module 205 can be used to perform offset processing on the initial shear plane to obtain the target shear plane of the scanned object.
[0090] It can be understood that the shear plane creation device 20 and the shear plane creation method in the above embodiment belong to the same inventive concept. The specific implementation manners of the modules of the shear plane creation device 20 correspond to the steps of the shear plane creation method in the above embodiment, and will not be elaborated herein.
[0091] The above-described module division is a logical function division, and there may be other division manners in actual implementation. In addition, the functional modules in each embodiment of this application can be integrated in the same processing unit, or each module can exist physically alone, or two or more modules can be integrated in the same unit. The above integrated modules can be implemented in the form of hardware, or in the form of a combination of hardware and software functional modules.
[0092] Next Figure 1Regarding the description of the scanning device 10, the wired communication module can provide one or more of the solutions for wired communication such as universal serial bus (USB), Controller Area Network (CAN), etc. The wireless communication module can provide one or more of the solutions for wireless communication such as wireless fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, frequency modulation (FM), near field communication (NFC), infrared (IR), etc.
[0093] In some embodiments, the memory 102 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 103, and can be used to store executable programs (such as machine instructions) of other running programs, and can also be used to store user and application data, etc. The random access memory can include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
[0094] In some embodiments, the non-volatile memory can also store executable programs and store user and application data, etc., and can be pre-loaded into the random access memory for direct reading and writing by the processor 103. The non-volatile memory can include disk storage devices, flash memory.
[0095] In other embodiments, the scanning device 10 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the scanning device 10.
[0096] In some embodiments, the processor 103 may include one or more processing units. For example, the processor 103 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0097] In some embodiments, the bus 105 is at least used to provide a communication channel for mutual communication between the communication module 101, the memory 102, the processor 103, and the input / output interface 104 in the scanning device 10.
[0098] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the scanning device 10. In other embodiments of the present application, the scanning device 10 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0099] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and the method implemented when the program instructions are executed may refer to the methods in the above various embodiments of the present application.
[0100] Among them, the computer-readable storage medium may be the internal memory of the scanning device described in the above embodiments, such as the hard disk or memory of the scanning device. The computer-readable storage medium may also be an external storage device of the scanning device, such as a plug-in hard disk equipped on the scanning device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc.
[0101] In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to the use of the scanning device, etc.
[0102] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation.
[0103] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, in each embodiment of this application, the functional modules can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0105] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in this application. Any appended drawing reference signs in the claims should not be regarded as limiting the claimed rights.
[0106] Furthermore, obviously, the term "including" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices described in this application can also be implemented by one unit or device through software or hardware. Words such as first and second are used to indicate names and do not represent any specific order.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and not to limit them. Although this application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of this application can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A method for creating a shear plane, characterized in that, The described shear plane creation method includes: Determining the three-dimensional coordinates and normal vectors corresponding to the feature points on the scanning object according to the preview data of the scanning object; Determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors; Selecting a target plane from the plurality of candidate planes according to the plane positions of the plurality of candidate planes and a preset polyhedron structure; Performing plane fitting on the target plane according to the three-dimensional coordinates of a plurality of feature points in the target plane to obtain an initial shear plane; Performing an offset process on the initial shear plane to obtain the target shear plane of the scanning object.
2. The shear plane creation method according to claim 1, characterized in that The determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vectors includes: Performing clustering processing on the normal vectors according to the directions of the normal vectors to obtain a plurality of clustering clusters, and each clustering cluster corresponds to a normal vector quantity; Determining the clustering clusters corresponding to the normal vector quantities greater than or equal to a first quantity threshold as target clustering clusters; Constructing the plurality of candidate planes according to the three-dimensional coordinates of each feature point in the target clustering clusters.
3. The shear plane creation method according to claim 2, wherein, The constructing the plurality of candidate planes according to the three-dimensional coordinates of each feature point in the target clustering clusters includes: Constructing a feature point plane corresponding to each feature point according to the three-dimensional coordinates of each feature point in the target clustering clusters; Determining a plurality of distances of each feature point plane corresponding to other feature points in the target clustering clusters, including: for any feature point plane corresponding to any feature point, calculating the distances between the other feature points in the target clustering clusters except the any feature point and the any feature point plane; Selecting the plurality of candidate planes from the plurality of feature point planes based on the plurality of distances corresponding to each feature point plane.
4. The shear plane creation method according to claim 3, wherein The constructing the feature point plane corresponding to each feature point according to the three-dimensional coordinates of each feature point in the target clustering clusters includes: Determining an average normal vector corresponding to the target clustering clusters according to the normal vectors of each feature point in the target clustering clusters; Constructing a feature point plane corresponding to each feature point according to the average normal vector and the three-dimensional coordinates of each feature point.
5. The shear plane creation method according to claim 3, characterized in that The selecting the plurality of candidate planes from the plurality of feature point planes based on the plurality of distances corresponding to each feature point plane includes: Counting the number of candidate feature points with distances less than or equal to a distance threshold from the plurality of distances corresponding to each feature point plane; Determining the candidate plane based on the number of candidate feature points, and the number of candidate feature points corresponding to the candidate plane is greater than or equal to a second quantity threshold.
6. The shear plane creation method according to claim 1, characterized in that The selecting a target plane from the plurality of candidate planes according to the plane positions of the plurality of candidate planes and a preset polyhedron structure includes: Classifying the plurality of candidate planes according to the polyhedron structure and the plane positions of the plurality of candidate planes, and each class of candidate planes corresponds to one face in the polyhedron structure; Selecting a target plane from the classified plurality of candidate planes according to the preset plane order corresponding to the polyhedron structure.
7. The shear plane creation method according to claim 1, characterized in that, The performing plane fitting on the target plane to obtain an initial shear plane includes: Based on the three-dimensional coordinates of multiple feature points in the target plane, an initial shear plane is obtained by using a preset fitting model.
8. The shear plane creation method according to claim 1, wherein The obtaining of the target shear plane of the scanned object by performing an offset process on the initial shear plane includes: Determining an offset distance according to the dimension information of the corresponding feature points of the scanned object; Moving the initial shear plane by the offset distance along the direction of the average normal vector corresponding to the initial shear plane to obtain the target shear plane, and the target shear plane is used as the basis for three-dimensional shearing.
9. A scanning device, characterized in that, It includes: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the shear plane creation method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the storage medium, and when the computer program is executed by a processor, the shear plane creation method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Mouth scanning dental model automatic cutting method, program, storage medium and electronic device
CN117934520A
Method and device for simulating earth surface excavation in Cesium
CN118070482A