Shear surface creation method, scanning equipment and storage medium
By analyzing the preview data of the scanned objects in three-dimensional scanning technology, the three-dimensional coordinates and normal vectors of feature points are automatically determined, candidate planes are constructed and selected, and plane fitting and offset processing are performed, the problem of inefficient shear surface creation in the existing technology is solved, and efficient and accurate shear surface creation is achieved.
Patent Information
- Application Number
- CN202510425545.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-07
AI Technical Summary
In the existing three-dimensional scanning technology, the shear surface creation is inefficient and cumbersome, making it difficult to quickly hide non-focused areas and concentrate on analyzing the target areas.
By analyzing the preview data of the scanned object, determining the three-dimensional coordinates and normal vectors of feature points, building candidate planes, selecting target planes for plane fitting, obtaining the initial shear surface, and obtaining the target shear surface through offset processing.
The shear surface creation process is simplified, the shear surface creation efficiency is improved, and the shear surface creation can be automatically created, reducing manual intervention and improving accuracy.
Smart Images

Figure CN119963784A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of three-dimensional scanning technology, and in particular, relates to a shearing surface creation method, a scanning device and a storage medium. Background Art
[0002] 3D scanning technology has been widely used in many fields, such as autonomous driving, robot autonomous navigation, cultural relic protection, architectural design, clinical medicine, etc. In 3D scanning scenarios, creating clipping planes (CP) is a key data processing and analysis method. By creating clipping planes, non-interest areas (such as occluded parts or redundant data) can be hidden, and target areas (such as the internal structure of mechanical parts, damaged parts of cultural relics, etc.) can be analyzed in a centralized manner.
[0003] In the related art, a cutting surface can be created by performing a three-dimensional scan on the scanned object and selecting data on the scanned data by manual selection or semi-automatic assistance. However, the above method is cumbersome to operate and the efficiency of cutting surface creation is low. Summary of the invention
[0004] The embodiments of the present application provide a cutting surface creation method and related devices to solve the problem of low efficiency in cutting surface creation.
[0005] In a first aspect, an embodiment of the present application provides a method for creating a cutting surface, the method comprising: determining three-dimensional coordinates and normal vectors corresponding to feature points on the scanning object based on preview data of the scanning object; determining multiple candidate planes based on the three-dimensional coordinates and the normal vectors; selecting a target plane from the multiple candidate planes based on the plane positions of the multiple candidate planes and a preset polyhedron structure; performing plane fitting on the target plane to obtain an initial cutting surface; and performing offset processing on the initial cutting surface to obtain a target cutting surface of the scanning object.
[0006] In some embodiments, the determining of multiple candidate planes based on the three-dimensional coordinates and the normal vector includes: clustering the normal vector according to the direction of the normal vector to obtain multiple clusters, each cluster corresponding to a number of normal vectors; determining the cluster corresponding to the number of normal vectors greater than or equal to a first number threshold as a target cluster; and constructing the multiple candidate planes based on the three-dimensional coordinates of each feature point in the target cluster.
[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 multiple distances between each feature point plane and other feature points in the target clustering cluster, including: for any feature point plane corresponding to any feature point, calculating the distance between the other feature points in the target clustering cluster except the any feature point and the any feature point plane; based on the multiple distances corresponding to each feature point plane, selecting the multiple candidate planes from multiple feature point planes.
[0008] In some embodiments, constructing a feature point plane corresponding to each feature point in the target cluster based on the three-dimensional coordinates of each feature point in the target cluster includes: determining an average normal vector corresponding to the target cluster based on the normal vector of each feature point in the target 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, the selecting 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 whose distances are less than or equal to a distance threshold from the multiple distances corresponding to each feature point plane; determining the candidate plane based on the number of candidate feature points, the number of candidate feature points corresponding to the candidate plane being greater than or equal to a second number 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 based on the polyhedron structure and the plane positions of the multiple candidate planes, each type of candidate plane corresponds to a face in the polyhedron structure; and selecting a target plane from the classified multiple candidate planes based on a preset plane order corresponding to the polyhedron structure.
[0011] In some embodiments, performing plane fitting on the target plane to obtain an initial cutting surface includes: obtaining the initial cutting surface using a preset fitting model according to three-dimensional coordinates of a plurality of feature points in the target plane.
[0012] In some embodiments, the initial shearing plane is offset to obtain the target shearing plane of the scanned object, including: determining an offset distance based on size information of 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, wherein the target shearing plane is used for three-dimensional shearing.
[0013] In a second aspect, an embodiment of the present application provides a cutting surface creation device, which includes: a data determination module, which is used to determine the three-dimensional coordinates and normal vectors corresponding to the feature points on the scanned object based on the preview data of the scanned object; a plane determination module, which is used to determine multiple candidate planes based on the three-dimensional coordinates and the normal vectors; a plane selection module, which is used to select a target plane from the multiple candidate planes based on the plane positions of the multiple candidate planes and a preset polyhedron structure; a plane fitting module, which is used to perform plane fitting on the target plane to obtain an initial cutting surface; and an offset processing module, which is used to perform offset processing on the initial cutting surface to obtain a target cutting surface of the scanned object.
[0014] In a third aspect, an embodiment of the present application provides a scanning device, comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, a cutting surface creation method as described in any one of the above items 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. When the computer program is executed by a processor, any of the above-mentioned methods for creating a cutting surface is implemented.
[0016] The embodiment of the present application provides a method for creating a cutting surface, including: 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 multiple candidate planes according to the three-dimensional coordinates and the normal vectors; selecting a target plane from the multiple candidate planes according to the plane positions of the multiple candidate planes and a preset polyhedron structure; performing plane fitting on the target plane to obtain an initial cutting surface; performing offset processing on the initial cutting surface to obtain a target cutting surface of the scanning object. The above method obtains the cutting surface by analyzing the preview data of the scanning object, without performing a scanning operation on the scanning object, which can simplify the process of creating the cutting surface and improve the efficiency of creating the cutting surface; and the above method obtains the three-dimensional coordinates and normal vectors corresponding to the feature points of the scanning object by analyzing the preview data, and automatically creates the cutting surface according to the three-dimensional coordinates and normal vectors of the feature points, which can improve the efficiency of creating the cutting surface. BRIEF 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 use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1It is a schematic diagram of a device for executing a cutting surface creation method provided in an embodiment of the present application.
[0019] Figure 2 It is a flow chart of a method for creating a shearing surface provided in an embodiment of the present application.
[0020] Figure 3 It is a schematic diagram of constructing a candidate plane provided in an embodiment of the present application.
[0021] Figure 4 It is a schematic diagram of selecting the target plane provided in an embodiment of the present application.
[0022] Figure 5 It is a flowchart of the candidate plane construction method provided in an embodiment of the present application.
[0023] Figure 6 It is a structural schematic diagram of a shearing surface creation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art in the technical field in this application. 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 specified in this application, "at least one" refers to one or more. "Multiple" refers to 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 situations.
[0027] Figure 1 Schematic diagram of the application scenario of the method for creating a shearing surface provided in the embodiment of the present application. Figure 1 As shown, in the application scenario of the cutting surface creation method, the scanning device 10 obtains preview data of the scanned object and completes the creation of the cutting surface based on the preview data. The preview data may represent the point cloud data of the scanned object obtained by the scanning device 10 in the preview mode without performing a scanning operation.
[0028] In some embodiments, the scanning device 10 can be any three-dimensional scanning device with image processing and computing capabilities. For example, the scanning device 10 can 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 can include small-sized objects with high requirements for accuracy and detail. For example, the scanning object can 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 can include medium and large objects. For example, the scanning object can include but is not limited to large castings, clay models, car exterior planes, car bends, aircraft engine pipelines, transmission shafts, and large blades. The embodiment of the present application is described by taking the scanning device 10 as a fixed three-dimensional scanning device as an example. The scanning device 10 can include a binocular scanner, a multi-eye scanner, etc., which are not limited here.
[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 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 multiple instructions, and when the multiple instructions are executed by the processor 103, the cutting surface creation method executed 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 a computer program stored in the memory 102 to implement the above-mentioned cutting surface creation method.
[0033] In some embodiments, the input / output interface 104 is used to provide a channel 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, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.
[0034] In some embodiments, in the application scenario of the shearing surface creation method, the scanned object is placed in the field of view of the scanning device 10, so that the scanning device 10 can collect preview data of the complete scanned object. The preview data can represent a series of three-dimensional coordinate points on the surface of the scanned object, that is, the point cloud data of the scanned object. The scanning device 10 can create a shearing surface of the scanned object (for ease of description, referred to as the "target shearing surface" in this application) by processing the preview data. Based on the created target shearing surface, the scanning device 10 hides non-concern areas (such as occluded parts or redundant data) in the scanned object, so that the scanning device 10 can focus on analyzing the target area (such as the internal structure of mechanical parts, damaged parts of cultural relics, etc.).
[0035] In the above application scenario, the preview data of the scanned object is analyzed by the scanning device 10 to obtain the cut surface corresponding to the scanned object, without performing a scanning operation on the scanned object, which can simplify the creation process of the cut surface and improve the efficiency of the cut surface creation. In addition, the present application can realize the automatic creation of the cut surface, without the need for manual selection or semi-automatic assistance to create the cut surface, thereby improving the efficiency of the cut surface creation; in addition, by automatically creating the cut surface, the problem of subjective errors introduced by human intervention is reduced, and the accuracy of the cut surface creation is improved.
[0036] The present application will describe the technical solution of the present application in detail through specific embodiments below. 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 described in detail in some embodiments.
[0037] Figure 2 is a flowchart of a cutting surface creation method provided in an embodiment of the present application, the cutting surface creation method is applied to a scanning device (for example, Figure 1 Scanning device 10 in FIG. Figure 2 As shown, the shearing surface creation method includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0038] S11, determining 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.
[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, and preview data of the scanned object may be obtained through the camera of the scanning device. The user may perform a scanning operation by performing relevant operations on physical buttons on the scanning device or on functional controls in the touch area of the scanning device. When no scanning operation is performed on the scanning device, the scanning device is in a preview mode, and point cloud data of the scanned object may be obtained. The preview data may represent point cloud data of the scanned object obtained by the scanning device in the preview mode when the scanning operation is not performed.
[0040] In some embodiments, the feature points on the scanned object may include marker points and position points where the surface of the scanned object has significant geometric features or topological features. In some embodiments, a plurality of marker points may be set on the surface of the scanned object, and the marker points are used to enhance the scanning device's ability to recognize the position and posture of the scanned object, and when the surface of the scanned object lacks texture or geometric features (such as a smooth plane, a single color), the marker points can be used to provide additional positioning information. In some embodiments, the marker points can be attached to the surface of the scanned object according to a preset density by means of adhesive, magnetic suction, etc. Among them, the preset density can be set according to actual needs. By setting the preset density, the problem of marker points being too dense or too sparse on the surface of the scanned object can be avoided. In some embodiments, the position points where the surface of the scanned object has significant geometric features or topological features are determined, wherein the position points with significant geometric features may include curvature extreme points, edge and ridge points, corner points and concave-convex area transition points, and the position points with significant topological features may include connectivity key points and symmetry axis points.
[0041] In some embodiments, the curvature extreme point is used to represent the local maximum / minimum point of the surface curvature (Gaussian curvature, mean curvature, principal curvature) of the scanned object. For example, taking the scanned object as a mechanical part, the curvature extreme point may include the gear tooth top and the groove bottom. Edge and ridge points are used to represent the area where the surface of the scanned object is discontinuous or the normal direction changes suddenly. For example, taking the scanned object as an industrial component, the edge and ridge points may include the edge of the screw hole and the bending ridge of the metal plate. Corner points are used to represent the intersection of edges in multiple directions. For example, taking the scanned object as a cultural relic, the corner point may include the intersection node of bronze decoration. Concave-convex area transition point is used to represent the boundary line or turning point between the raised area and the recessed area. For example, taking the organ model as an example, the concave-convex area transition point may include the boundary between the ventricle and the atrium on the surface of the heart model.
[0042] In some embodiments, connectivity key points are used to represent surface bifurcations, closed loops, or areas of topological changes of the scanned object. For example, taking a plant model as an example, connectivity key points may include bifurcations of a tree branch model. Symmetry axis points may represent intersections of the symmetry axis of the scanned object and the surface. For example, taking an aircraft as an example, symmetry axis points may include connection points between the symmetry axis of the wing 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 analyzing 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 point in the scanned object. In some embodiments, any feature point is selected to determine the tangent plane of the feature point on the surface of the scanned object. The unit vector perpendicular to the tangent plane and pointing to the outside of the scanned object (in accordance with 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, determining a plurality of candidate planes according to the three-dimensional coordinates and the normal vector.
[0045] In at least one embodiment of the present application, each feature point has a corresponding three-dimensional coordinate and a normal vector, and each normal vector has corresponding direction information. By clustering multiple normal vectors, the feature points are classified, and the feature points with the same or similar normal vector directions are placed in the same point set to obtain multiple point sets. Traversing the feature points in each point set, constructing a feature point plane based on the three-dimensional coordinates and the normal vector, multiple feature point planes can be obtained. By screening multiple feature point planes, multiple candidate planes can be obtained. Among them, by determining the direction angle corresponding to any two normal vectors, it can be determined whether the directions of the two normal vectors are similar. For example, two normal vectors whose direction angle is less than or equal to the angle threshold are determined as having similar directions, and two normal vectors whose direction angle is greater than the angle threshold are determined as having a large direction difference. The direction angle can be determined based on the direction information of the two normal vectors, and the angle threshold can be set according to actual needs, and there is no restriction here. The candidate plane can represent a potential shear surface estimate.
[0046] In some embodiments, the determining of multiple candidate planes based on the three-dimensional coordinates and the normal vector includes: clustering the normal vector according to the direction of the normal vector to obtain multiple clusters, each cluster corresponding to a number of normal vectors; determining the cluster corresponding to the number of normal vectors greater than or equal to a first number threshold as a target cluster; and constructing the multiple candidate planes based on the three-dimensional coordinates of each feature point in the target cluster.
[0047] Among them, the corresponding direction information of each normal vector is divided into the same clustering clusters by using a preset clustering algorithm according to the direction of the normal vector, and the normal vectors with different directions or large differences are divided into different clustering clusters. The clustering algorithm may 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 cluster cluster, and the first number threshold can be set according to actual needs and is not limited here. If the number of normal vectors in the cluster cluster is greater than or equal to the first number threshold, it indicates that in the local area of the surface of the scanned object, there are many feature points with similar normal vector directions, reflecting that the surface of the local area has relatively consistent orientation and geometric characteristics. If the number of normal vectors in the cluster cluster is less than the first number threshold, it indicates that the local area of the surface of the scanned object may be in a transitional area. For example, the edge, corner or connection between different surfaces of the scanned object. The embodiment of the present application can improve the accuracy of the surface analysis of the scanned object by selecting the cluster cluster corresponding to the number of normal vectors greater than or equal to the first number threshold for analysis, thereby improving the accuracy of the creation of the shearing surface and reducing the creation error caused by surface noise and irregularity.
[0049] According to the three-dimensional coordinates of each feature point in the target cluster, a feature point plane is constructed for each feature point in the target cluster to obtain multiple feature point planes. By screening the multiple feature point planes, multiple candidate planes can be obtained.
[0050] Combination Figure 3 The following is a schematic diagram of constructing a candidate plane provided in an embodiment of the present application. Figure 3As shown, the point cloud data of the scanned object includes feature points P1, feature points P2, feature points P3, ..., feature points Pn, and each feature point has a corresponding normal vector, which are respectively recorded as normal vector F1, normal vector F2, normal vector F3, ..., normal vector Fn. According to the direction of each normal vector, multiple normal vectors are clustered to obtain multiple clusters. For example, cluster C1, cluster C2, cluster C3 and cluster C4. The cluster whose number of normal vectors in the cluster (for ease of description, this application abbreviates it as "the number of normal vectors") is greater than or equal to the first quantity threshold is selected as the target cluster. For example, after the above confirmation, cluster C1 and cluster C2 are determined as target clusters. Each feature point in cluster C1 is traversed to construct a feature point plane corresponding to the feature point; and each feature point in cluster C2 is traversed to construct a feature point plane corresponding to the feature point. Thus, multiple feature point planes can be obtained, and multiple candidate planes can be obtained by screening the multiple feature point planes. For each feature point plane, whether the feature point plane is a candidate plane can be determined based on the distance between the feature point plane and other feature points in the cluster corresponding to the feature point plane.
[0051] The embodiment of the present application utilizes the normal vectors of feature points for clustering processing, and can obtain a set of feature points (i.e., a point set) with the same or similar normal vector directions. By constructing a feature point plane for the feature points in the point set, candidate planes are screened so that the candidate planes contain a large number of feature points, thereby improving the accuracy of shear surface construction.
[0052] S13: selecting 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 the present application, a preset polyhedron structure is used to assist in selecting a target plane from multiple candidate planes. The preset polyhedron structure includes multiple faces, and the plane order can be set in advance for the multiple faces, and the target plane is assisted in selecting from multiple candidate planes according to the plane order. 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 may include a hexahedron structure, a tetrahedron structure, an octahedron structure, etc., which are not limited here. The selection of the polyhedron structure can be based on considerations such as computational cost, compatibility with the scanned object, and interaction complexity. The embodiment of the present application takes the preset polyhedron structure as a hexahedron structure as an example for explanation.
[0054] In some embodiments, based on the plane positions of the multiple candidate planes, the multiple candidate planes are approximated to each face of the polyhedron structure. Based on the preset plane order of the polyhedron structure, the candidate plane with the first plane order is selected as the target plane. Exemplarily, based on the plane positions of the multiple candidate planes and the preset polyhedron structure, the target plane is selected from the multiple candidate planes, including: based on the polyhedron structure and the plane positions of the multiple candidate planes, the multiple candidate planes are classified, each type of candidate plane corresponds to a face in the polyhedron structure; based on the preset plane order corresponding to the polyhedron structure, the target plane is selected from the classified multiple candidate planes.
[0055] Among them, multiple candidate planes can be classified according to the plane angle between the candidate plane and each face of the polyhedral structure. The plane angle is used to evaluate the relative position relationship between the candidate plane and each face of the polyhedral structure. The smaller the plane angle, the closer or parallel the two planes are; the larger the plane angle, the perpendicular or intersecting the two planes. Based on this, the plane angle between the candidate plane and each face of the polyhedral structure is determined to obtain multiple plane angles; the face of the polyhedral structure corresponding to the smallest plane angle is selected as the face close to the candidate plane.
[0056] Among them, after classifying multiple candidate planes into each face of the polyhedron structure, since each face of the polyhedron structure has a plane order, the candidate planes also have a corresponding plane order. A candidate plane with an earlier plane order is selected from multiple candidate planes as the target plane. In some embodiments, the number of candidate planes with an earlier plane order can be 1 or more (that is, a certain face of the polyhedron structure corresponds to multiple candidate planes). When the number of candidate planes with an earlier plane order is more than one, any candidate plane can be selected as the target plane. The selection method may include random selection or specified selection, which is not limited here.
[0057] Combination Figure 4 The present invention provides a schematic diagram of selecting a target plane. The present invention takes the preset polyhedral structure as a hexahedral structure as an example. Figure 4As shown, with 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 hexahedral structure is constructed, and the hexahedral structure includes a D plane, a T plane, a B plane, an F plane, an L plane, and an R plane, wherein 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, the plane sequence from front to back can be set to D plane-T plane-B plane-F plane-L plane-R plane. Among multiple candidate planes, the candidate plane that is close to the D plane is preferentially selected as the target plane. If there is no candidate plane close to the D plane, the candidate plane that is close to the T plane is selected as the target plane. And so on, until the target plane is selected from multiple candidate planes.
[0058] The embodiment of the present application approximates multiple candidate planes to a preset polyhedron structure, determines the plane order of multiple faces of the polyhedron structure according to the scanning posture of the scanning device, and selects the candidate plane with the first plane order as the target plane according to the plane order, so that the target plane is highly compatible with the scanning posture of the scanning device, improves the accuracy of target plane selection, and then improves the accuracy of shear plane construction.
[0059] S14, performing plane fitting on the target plane to obtain an initial shearing plane.
[0060] In at least one embodiment of the present application, the target plane is selected from multiple candidate planes, and the candidate plane is a feature point plane, that is, the target plane is used to represent a point normal plane constructed based on the feature points. Among them, the point normal plane can represent a plane determined by a point in the plane and a non-zero vector (i.e., a normal vector) perpendicular to the plane in a spatial rectangular coordinate system. In order to improve the accuracy of constructing the shear plane, the target plane is plane-fitted based on multiple feature points in the target plane.
[0061] In some embodiments, performing plane fitting on the target plane to obtain an initial shearing plane includes: obtaining the initial shearing plane using a preset fitting model based on the three-dimensional coordinates of multiple feature points in the target plane. The preset fitting model may include a least squares model, a random sampling consistency algorithm, a principal component analysis method, a maximum likelihood estimation, a nonlinear optimization algorithm, and a deep learning fitting, etc., which are not limited here.
[0062] The embodiment of the present application is explained by taking the preset fitting model as the least squares model as an example. The goal of the least squares model is to minimize the sum of the squares of the vertical distances from all feature points of the scanned object to the initial shearing plane after fitting. Exemplarily, a first plane is constructed based on the three-dimensional coordinates of multiple feature points in the target plane; the distances from all feature points of the scanned object to the first plane are calculated, and a set of feature points whose distances are less than or equal to the preset value are recorded as the first feature point set; based on the first feature point set, the plane is refitted to obtain a second plane; the distances from all feature points of the scanned object to the second plane are calculated, and a set of feature points whose distances are less than or equal to the preset value are 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 used as the initial shearing 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, the plane is refitted 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. It is determined that a feature point whose distance to the first plane is less than or equal to a preset value belongs to the first plane, and it is determined that a feature point whose distance to the second plane is less than or equal to a preset value belongs to the second plane.
[0063] The embodiment of the present application can avoid the problem of low accuracy of plane construction caused by constructing a plane using a single feature point by performing plane fitting on the three-dimensional coordinates of multiple feature points in the target plane, thereby improving the accuracy of shear surface construction.
[0064] S15, performing an offset process on the initial cutting plane to obtain a target cutting plane of the scanned object.
[0065] In at least one embodiment of the present application, some feature points may not be in the initial shearing plane, for example, some feature points are above the initial shearing plane, and some feature points are below the initial shearing plane. To avoid the problem that feature points cannot be sheared, the initial shearing plane is offset so that as many feature points as possible are sheared, which can improve the accuracy of shearing 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, feature points are classified, and feature points with the same or similar normal vector directions are placed in the same point set to obtain multiple point sets. The feature points in each point set are traversed, and feature point planes are constructed based on three-dimensional coordinates and normal vectors to obtain multiple feature point planes. By screening multiple feature point planes, multiple candidate planes can be obtained. Figure 5 is a flow chart of a candidate plane construction method provided in an embodiment of the present application, and the candidate plane construction method is applied to a scanning device. Figure 5 As shown, the following steps are included.
[0072] S21, constructing a feature point plane corresponding to each feature point in the target cluster according to the three-dimensional coordinates of each feature point in the target cluster.
[0073] In at least one embodiment of the present application, each feature point of the target cluster is traversed, and a point normal plane corresponding to the feature point can be constructed based on the three-dimensional coordinates of each feature point and the normal vector of the plane where the point is located, and the point normal plane is used as the feature point plane. In some embodiments, the feature point plane corresponding to each feature point in the target cluster is constructed based on the three-dimensional coordinates of each feature point in the target cluster, including: determining the average normal vector corresponding to the target cluster based on the normal vector of each feature point in the target cluster; and constructing the feature point plane corresponding to each feature point based on the average normal vector and the three-dimensional coordinates of each feature point.
[0074] By summing and normalizing multiple normal vectors in the target cluster, the average normal vector of the target cluster can be obtained. Exemplarily, multiple normal vectors in the target cluster are summed to obtain a new vector, and the new vector is normalized to obtain the average normal vector of the target cluster. The normalization process may refer to the process of dividing the new vector by its vector length.
[0075] The embodiment of the present application determines the average normal vector of each target cluster, and constructs a feature point plane for each feature point based on the average normal vector and the three-dimensional coordinates of each feature point, thereby improving the accuracy of feature point plane construction.
[0076] S22, determining multiple distances between each feature point plane and other feature points in the target cluster, including: for any feature point plane corresponding to any feature point, calculating the distance between the other feature points in the target 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, the distance between other feature points in the target cluster except the any feature point and the any feature point plane is calculated. If the distance between other feature points and any feature point plane is less than or equal to the distance threshold, it means that the other feature points belong to any feature point plane; if the distance between other feature points and any feature point plane is greater than the distance threshold, it means that the other feature points do not belong to any feature point plane. The distance threshold can be set according to actual needs and is not limited here.
[0078] Continuing from the above embodiment, the target cluster includes cluster C1, wherein 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, the distances from feature point P2, feature point P3, feature point P4, and feature point P5 to feature point plane M1 are determined 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: Select the multiple candidate planes from the multiple feature point planes based on the multiple distances corresponding to each feature point plane.
[0080] In at least one embodiment of the present application, from 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 recorded as candidate feature points. In some embodiments, the multiple candidate planes are selected from multiple feature point planes based on the multiple distances corresponding to each feature point plane, including: from the multiple distances corresponding to each feature point plane, counting the number of candidate feature points whose distance is less than or equal to the distance threshold; based on the number of candidate feature points, determining the candidate plane, the number of candidate feature points corresponding to the candidate plane is greater than or equal to a second number threshold. The second number threshold can be set according to actual needs and is not limited here.
[0081] Continuing with the above embodiment, the candidate feature points corresponding to the feature point plane M1 include feature point P2, feature point P3, feature point P4 and feature point P5, which are 4 in number. The candidate feature points corresponding to the feature point plane M2 include feature point P1, feature point P3, feature point P4, which are 3 in number. The candidate feature points corresponding to the feature point plane M3 include feature point P1, feature point P2, feature point P4, which are 3 in number. The candidate feature points corresponding to the feature point plane M4 include feature point P1, feature point P2, feature point P3, which are 3 in number. The candidate feature points corresponding to the feature point plane M5 include feature point P1, feature point P2, feature point P3, which are 3 in number. If the second quantity threshold is 4, the feature point plane M1 is used as the candidate plane.
[0082] The embodiment of the present application determines multiple distances between each feature point plane and other feature points in the target cluster, determines the number of feature points contained 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, so that the candidate planes contain a larger number of feature points, thereby improving the accuracy of shear surface construction.
[0083] See also Figure 6 , Figure 6 2 is a schematic diagram of a structure of a cutting surface creation device provided in an embodiment of the present application. In some embodiments, the cutting surface creation device 20 may include a plurality of functional modules composed of computer program segments. The computer programs of the various program segments in the cutting surface creation device 20 may be stored in the memory of the scanning device 10 and executed by at least one processor to execute (see Figure 2 Description) Functionality for clipping surface creation.
[0084] In this embodiment, the shearing surface creation device 20 can be divided into multiple functional modules according to the functions it performs. 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 refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which 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 may 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 may be configured to determine a plurality of candidate planes according to the three-dimensional coordinates and the normal vector.
[0087] The plane selection module 203 may be 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.
[0088] The plane fitting module 204 may be used to perform plane fitting on the target plane to obtain an initial shearing plane.
[0089] The offset processing module 205 may be used to perform an offset process on the initial cutting plane to obtain a target cutting plane of the scanned object.
[0090] It can be understood that the shearing surface creation device 20 and the shearing surface creation method of the above embodiment belong to the same inventive concept, and the specific implementation method of each module of the shearing surface creation device 20 corresponds to the steps of the shearing surface creation method in the above embodiment, which will not be repeated in this application.
[0091] The module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, the functional modules in each embodiment of the present application may be integrated in the same processing unit, or each module may exist physically separately, or two or more modules may be integrated in the same unit. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0092] then Figure 1In the description of the scanning device 10, the wired communication module can provide one or more wired communication solutions such as universal serial bus (USB), controller area network bus (CAN, Controller Area Network). The wireless communication module can provide one or more wireless communication solutions such as wireless fidelity (wireless fidelity, Wi-Fi), Bluetooth (Bluetooth, BT), mobile communication network, frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (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. The random access memory may 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 may also store executable programs and user and application data, etc., which may be pre-loaded into the random access memory for direct reading and writing by the processor 103. The non-volatile memory may include a disk storage device and a 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 processor (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. Different processing units may be independent devices or integrated into one or more processors.
[0097] In some embodiments, the bus 105 is at least used to provide a channel for mutual communication among the communication module 101 , the memory 102 , the processor 103 , and the input / output interface 104 in the scanning device 10 .
[0098] It is understood that the structure illustrated in the embodiment 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 shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0099] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the methods in the above-mentioned embodiments of the present application.
[0100] The computer-readable storage medium may be the internal memory of the scanning device described in the above embodiment, 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 memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc.
[0101] In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application 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 the 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 only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0103] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0105] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present application is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present application. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0106] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in this application can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A method for creating a shearing surface, characterized in that: The shearing surface creation method comprises: 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; Determine a plurality of candidate planes according to the three-dimensional coordinates and the normal vector; Selecting a target plane from the multiple candidate planes according to the plane positions of the multiple candidate planes and a preset polyhedron structure; Performing plane fitting on the target plane to obtain an initial shearing plane; The initial cutting surface is subjected to an offset process to obtain a target cutting surface of the scanned object.
2. The method for creating a shearing surface according to claim 1, wherein: The determining of a plurality of candidate planes according to the three-dimensional coordinates and the normal vector comprises: According to the direction of the normal vector, the normal vector is clustered to obtain a plurality of clusters, each cluster corresponding to a number of normal vectors; Determine a cluster corresponding to a number of normal vectors greater than or equal to a first number threshold as a target cluster; The multiple candidate planes are constructed according to the three-dimensional coordinates of each feature point in the target cluster.
3. The method for creating a shearing surface according to claim 2, wherein: The step of constructing the plurality of candidate planes according to the three-dimensional coordinates of each feature point in the target cluster comprises: According to the three-dimensional coordinates of each feature point in the target cluster, construct a feature point plane corresponding to each feature point; Determining a plurality of distances between each feature point plane and other feature points in the target cluster, comprising: for any feature point plane corresponding to any feature point, calculating the distance between the other feature points in the target cluster except the any feature point and the any feature point plane; The plurality of candidate planes are selected from the plurality of feature point planes based on the plurality of distances corresponding to each feature point plane.
4. The method for creating a shearing surface according to claim 3, wherein: 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 cluster includes: Determine the average normal vector corresponding to the target cluster according to the normal vector of each feature point in the target cluster; A feature point plane corresponding to each feature point is constructed according to the average normal vector and the three-dimensional coordinates of each feature point.
5. The method for creating a shearing surface according to claim 3, wherein: 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 comprises: From the multiple distances corresponding to each feature point plane, counting the number of candidate feature points whose distances are less than or equal to the distance threshold; The candidate plane is determined based on the number of the candidate feature points, and the number of candidate feature points corresponding to the candidate plane is greater than or equal to a second number threshold.
6. The method for creating a shearing surface according to claim 1, wherein: The step of 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 multiple candidate planes according to the plane positions of the polyhedral structure and the multiple candidate planes, each type of candidate plane corresponds to a face of the polyhedral structure; According to the preset plane order corresponding to the polyhedral structure, a target plane is selected from the classified multiple candidate planes.
7. The method for creating a shearing surface according to claim 1, wherein: The performing plane fitting on the target plane to obtain an initial shearing plane includes: The initial shearing plane is obtained according to the three-dimensional coordinates of a plurality of feature points in the target plane using a preset fitting model.
8. The method for creating a shearing surface according to claim 1, wherein: The performing offset processing on the initial cutting surface to obtain the target cutting surface of the scanned object includes: Determining an offset distance according to size information of a feature point corresponding to the scanned object; The initial shearing surface is moved by the offset distance in the direction of the average normal vector corresponding to the initial shearing surface to obtain the target shearing surface, and the target shearing surface is used as a basis for three-dimensional shearing.
9. A scanning device, characterized in that: include: 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 cutting surface creation method according to any one of claims 1 to 8 is implemented.
10. 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 cutting surface 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
Automatically generating appropriate near and far clipping planes for a 3D scene while guaranteeing minimum of Z-buffer precision
US20070216710A1
System and method for generating planar section 3D shape representations
US20160092605A1
Method and apparatus for clipping an object element in accordance with a clip volume
US6507348B1