Scanning path generation method and device, electronic equipment and storage medium
By generating an isomorphic surface model using the rolling ball method and combining it with the characteristics of the scanner, the scanning path is directly planned, which solves the problem of path planning failure in complex models by 3D scanners and achieves robust scanning path generation.
Patent Information
- Application Number
- CN202511367207.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2025-12-23
AI Technical Summary
In existing technologies, 3D scanners are prone to path planning failures when faced with scanned objects that have abrupt changes such as holes. Furthermore, they are mainly designed for simple workpiece models and cannot effectively plan for complex models.
The rolling ball method is used to generate an isomorphic surface model. By using the cutting spacing and viewing angle of the target scanner, the scanning path is directly planned, avoiding interference from abrupt features, preserving the trend of change, and generating a robust motion trajectory.
It improves the success rate of scanning path planning, adapts to complex models, avoids planning failures caused by abrupt changes, and generates orderly motion trajectories that meet scanning requirements.
Smart Images

Figure CN121190673A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a scanning path generation method and device, electronic equipment and storage medium. BACKGROUND
[0002] At present, three-dimensional scanning technology has been widely used in many fields, such as cultural relic protection, reverse engineering, three-dimensional measurement, etc. Therefore, how to automatically plan the scanning path of the three-dimensional scanner so that the mechanical arm controls the three-dimensional scanner to perform scanning becomes a key technical means.
[0003] In the related art, discrete viewpoints are usually planned first, and then the viewpoints are connected to generate the scanning path of the three-dimensional scanner.
[0004] However, the connection mode of the viewpoints depends on the distance of the viewpoints, which has certain unpredictability, and at present, the planning is mainly for relatively simple workpiece models such as surfaces, and for scanning objects involving sudden features such as holes, the path planning cannot be well performed, and the sudden features may cause the planning to fail. SUMMARY
[0005] Therefore, the embodiments of the present application provide a scanning path generation method and device, electronic equipment and storage medium to solve the problem that the connection mode of the viewpoints depends on the distance of the viewpoints, which has certain unpredictability, and at present, the planning is mainly for relatively simple workpiece models such as surfaces, and for scanning objects involving sudden features such as holes, the path planning cannot be well performed, and the sudden features may cause the planning to fail.
[0006] In a first aspect, the embodiments of the present application provide a scanning path generation method, comprising:
[0007] obtaining an initial three-dimensional model of a to-be-scanned object;
[0008] determining a plurality of rolling ball feature points from the initial three-dimensional model, and constructing an isosurface model according to the plurality of rolling ball feature points, the plurality of rolling ball feature points being feature points obtained by rolling a target rolling ball along the surface of the initial three-dimensional model;
[0009] cutting the isosurface model according to a cutting interval corresponding to a target scanner to obtain a cutting curve of the isosurface model;
[0010] obtaining pose information of a sampling point on the cutting curve and a viewing angle direction of the target scanner at the sampling point;
[0011] According to the pose information of the sampling point and the view direction, a scanning path of the target scanner is generated, so that the target scanner scans the object to be scanned based on the scanning path to obtain a scanned three-dimensional model.
[0012] In an optional implementation, the cutting of the isosurface model according to the cutting interval corresponding to the target scanner to obtain a cutting curve of the isosurface model comprises:
[0013] A three-dimensional coordinate system of the isosurface model is constructed, and a model bounding box of the isosurface model is obtained;
[0014] According to the length of the model bounding box in the three-dimensional coordinate system, a cutting plane is determined;
[0015] According to the cutting interval and the cutting plane, the isosurface model is cut to obtain the cutting curve.
[0016] In an optional implementation, the determination of the cutting plane according to the length of the model bounding box in the three-dimensional coordinate system comprises:
[0017] If the value of the model bounding box on the first coordinate axis in the three-dimensional coordinate system is greater than the value of the model bounding box on the second coordinate axis in the three-dimensional coordinate system, the second coordinate axis is determined as the normal of the cutting plane;
[0018] If the value of the model bounding box on the first coordinate axis is less than or equal to the value of the model bounding box on the second coordinate axis, the first coordinate axis is determined as the normal of the cutting plane;
[0019] The cutting plane is determined according to the normal of the cutting plane.
[0020] In an optional implementation, before the cutting of the isosurface model according to the cutting interval corresponding to the target scanner to obtain a cutting curve of the isosurface model, the method further comprises:
[0021] According to the field of view parameter and the overlap parameter of the target scanner, the cutting interval is obtained.
[0022] In an optional implementation, the cutting of the isosurface model according to the cutting interval and the cutting plane to obtain the cutting curve comprises:
[0023] According to the cutting interval and the cutting plane, the isosurface model is cut to obtain a plurality of cutting points on the isosurface model;
[0024] According to the plurality of cutting points, a curve fitting is performed to generate the cutting curve.
[0025] In an optional implementation, the acquiring the pose information of the sampling point on the cutting curve and the view direction of the target scanner at the sampling point comprises:
[0026] acquiring the position information and the pose information of the plurality of cutting points;
[0027] acquiring the position information of the sampling point according to the position information of two adjacent cutting points of the sampling point on the cutting curve;
[0028] acquiring the pose information of the sampling point according to the position information and the pose information of the two adjacent cutting points and the included angle between the two adjacent cutting points;
[0029] acquiring the view direction according to the position information of the sampling point and the positions of the two adjacent cutting points.
[0030] In an optional implementation, the generating the scanning path of the target scanner according to the pose information of the sampling point and the view direction comprises:
[0031] generating a two-dimensional array according to the pose information of the sampling point and the view direction;
[0032] performing inverse sequence transformation on the two-dimensional array to generate a target array, and generating the scanning path according to the target array.
[0033] In a second aspect, the embodiments of the present application further provide a scanning path generation device, comprising:
[0034] an acquiring module configured to acquire an initial three-dimensional model of an object to be scanned;
[0035] a processing module configured to determine a plurality of rolling ball feature points from the initial three-dimensional model, and construct an isosurface model according to the plurality of rolling ball feature points, the plurality of rolling ball feature points being feature points obtained by rolling a target rolling ball along a surface of the initial three-dimensional model;
[0036] the processing module is further configured to cut the isosurface model according to a cutting interval corresponding to a target scanner to obtain a cutting curve of the isosurface model;
[0037] the acquiring module is further configured to acquire pose information of a sampling point on the cutting curve and a view direction of the target scanner at the sampling point;
[0038] The generating module is configured to generate a scanning path of the target scanner according to the pose information of the sampling points and the view direction of the target scanner, so that the target scanner scans the object to be scanned based on the scanning path to obtain a scanned three-dimensional model.
[0039] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a bus. The memory stores machine readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus. The processor executes the machine readable instructions to perform the method of any one of the first aspect.
[0040] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program. When the computer program is run by a processor, the method of any one of the first aspect is performed.
[0041] The present application provides a scanning path generation method, device, electronic device, and storage medium. The method includes: obtaining an initial three-dimensional model of an object to be scanned, determining a plurality of rolling ball feature points from the initial three-dimensional model, constructing an isosurface model according to the plurality of rolling ball feature points, cutting the isosurface model according to a cutting interval corresponding to a target scanner to obtain a cutting curve of the isosurface model, obtaining pose information of a sampling point on the cutting curve and a view direction of the target scanner at the sampling point, and generating a scanning path of the target scanner according to the pose information of the sampling point and the view direction, so that the target scanner scans the object to be scanned based on the scanning path to obtain a scanned three-dimensional model. The scanning path is directly planned, which has better robustness. The isosurface model is generated for a scanning object with a hole or other mutation features, the change trend at the mutation feature is retained, and the scanning path planning success rate is improved. BRIEF DESCRIPTION OF DRAWINGS
[0042] To make the technical solutions of the embodiments of the present application clearer, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. Other related drawings can also be obtained by those skilled in the art without creative labor.
[0043] Figure 1 Flowchart of the scanning path generation method provided by the embodiments of the present application Figure One ;
[0044] Figure 2 Schematic diagram of the initial three-dimensional model provided by the embodiments of the present application
[0045] Figure 3 A schematic diagram of an isosurface model provided for an embodiment of the present application;
[0046] Figure 4 A flowchart of a scanning path generation method provided for an embodiment of the present application Figure Two ;
[0047] Figure 5 A model cutting schematic provided for an embodiment of the present application Figure One ;
[0048] Figure 6 A model cutting schematic provided for an embodiment of the present application Figure Two ;
[0049] Figure 7 A flowchart of a scanning path generation method provided for an embodiment of the present application Figure Three ;
[0050] Figure 8 A schematic diagram of a cutting curve provided for an embodiment of the present application;
[0051] Figure 9 A flowchart of a scanning path generation method provided for an embodiment of the present application Figure Four ;
[0052] Figure 10 A coordinate interpolation schematic provided for an embodiment of the present application;
[0053] Figure 11 A schematic diagram of a sampling point position and normal provided for an embodiment of the present application;
[0054] Figure 12 A schematic diagram of a sampling point position and normal superimposed with an isosurface model provided for an embodiment of the present application;
[0055] Figure 13 A viewing angle orientation definition schematic provided for an embodiment of the present application;
[0056] Figure 14 A global sampling point distribution diagram on a scanning path provided for an embodiment of the present application;
[0057] Figure 15 A flowchart of a scanning path generation method provided for an embodiment of the present application Figure Five ;
[0058] Figure 16 A structure schematic of a scanning path generation apparatus provided for an embodiment of the present application;
[0059] Figure 17 A structure schematic of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0061] Currently, the research on scanning paths mainly focuses on single-line structured light scanners and surface structured light scanners. The surface structured light scanner belongs to fixed-point scanning because it needs to pause during the acquisition process. The single-line structured light scanner has a relatively simple structure and only needs to focus on the state of a single laser line. However, due to the need to consider more stringent scanning angles, fields of view, depths of field, and other factors, many sensor constraints need to be added during the related research process, which limits the efficiency of planning and has limited adaptability to complex models. The idea of scanning path planning for these two types of scanners is to first plan discrete viewpoints and then connect the viewpoints. The viewpoint connection generally uses the shortest path planning method. This method may obtain the shortest connection path, and the connection method of the viewpoints depends on the distance between them, which has a certain unpredictability and may lead to path planning failure. Moreover, the current planning mainly targets relatively simple workpiece models such as surfaces, and cannot well plan the scanning objects with holes and other mutation characteristics, which may cause planning failure.
[0062] Therefore, the present application changes the idea of first planning discrete viewpoints and then connecting the viewpoints in the traditional method, and proposes a direct method for planning motion trajectories. This method takes full advantage of the flexibility of the scanner and fully considers the surface change trend of the scanned object to adjust the scanning pose in real time, better considers the direction change trend of each target surface while quickly acquiring scanning data, has better robustness, improves the success rate of scanning path planning, and for scanning objects with holes and other mutation characteristics, uses the rolling ball method to generate an isosurface model, which not only avoids the interference of the mutation characteristics, but also retains the change trend at the mutation characteristics. Even the scanning path at the mutation characteristics also meets the scanning requirements, avoiding the problem of planning failure caused by the interference of the mutation characteristics. The method can directly plan the motion trajectory with an order, without the need for sorting using the shortest path algorithm, and has better robustness.
[0063] Figure 1A flowchart of a scanning path generation method provided by an embodiment of the present application Figure One The execution subject of the embodiment can be an electronic device, such as a computer device.
[0064] As shown in the method can include Figure 1
[0065] S101, obtaining an initial three-dimensional model of a to-be-scanned object.
[0066] The to-be-scanned object may, for example, be an artifact, a building, or a design workpiece. A three-dimensional data set of the to-be-scanned object is obtained, and an initial three-dimensional model of the to-be-scanned object is constructed according to the three-dimensional data set. The three-dimensional data set may, for example, be a discrete point cloud, a triangular mesh, or other forms of spatial sampling data.
[0067] If the to-be-scanned object is a design workpiece, a three-dimensional data set of the design workpiece can be obtained from design data of the to-be-scanned object. If the to-be-scanned object is an artifact or a building, a three-dimensional data set of the to-be-scanned object can be obtained by using other rough scanning methods. The three-dimensional data set obtained by using other rough scanning methods is relatively rough.
[0068] That is, the initial three-dimensional model of the to-be-scanned object is a CAD model designed, a model obtained by rough scanning, or a model obtained by past scanning and now needs to be updated. Therefore, the to-be-scanned object can be finely scanned by using the method provided in the present solution.
[0069] In some embodiments, the three-dimensional data set of the to-be-scanned object can also be preprocessed, for example, to remove noise, fill holes, and the like.
[0070] S102, determining a plurality of rolling ball feature points from the initial three-dimensional model, and constructing an isosurface model according to the plurality of rolling ball feature points.
[0071] The plurality of rolling ball feature points are feature points obtained by rolling a target ball along the surface of the initial three-dimensional model, for example, the center point of the ball when the target ball rolls along the surface of the initial three-dimensional model to a stable position.
[0072] It should be noted that in computational geometry and computer graphics, the rolling ball method is usually used to generate isosurfaces. This method simulates the process of a virtual small ball rolling on the surface to identify key feature points of the surface, and constructs an isosurface based on these points.
[0073] According to the isosurface model to be constructed, a target ball with a ball radius R is selected, R determines the feature scale to be extracted, and then an initial seed point is selected from the initial three-dimensional model as the starting point of the target ball. The initial seed point can be pre-specified or detected at a key position, such as a position with a significant change in curvature. A larger R is suitable for capturing macro features, and a smaller R is suitable for capturing detailed features. The specific selection can be made according to actual conditions, and the embodiment does not make special limitations.
[0074] The target ball is placed at the initial seed point, and the target ball is controlled to roll along the surface of the initial three-dimensional model, moving a small step each time while keeping the target ball in contact with the model surface. When the target ball reaches a stable position, the ball center point of the target ball at this position is taken as a ball feature point, and the position is taken as the initial seed point. The process is repeated until the surface of the initial three-dimensional model is traversed or a preset stopping condition is reached. If the target ball contacts a preset number of points on the surface of the initial three-dimensional model, the target ball stops, that is, the target ball reaches a stable position. The preset number can be, for example, 3. Then, based on the collected plurality of ball feature points, an interpolation method or other surface reconstruction method (Delaunay triangulation) is used to construct an isosurface model.
[0075] In some embodiments, the constructed isosurface model can also be smoothed, simplified, or otherwise post-processed to improve the visual effect or reduce the computational complexity. Thus, the ball method is used to effectively extract a representative isosurface model from a three-dimensional data set, where the isosurface model is also a distance convex hull surface model, and the distance between the points on the surface of the isosurface model and the points on the surface of the initial three-dimensional model is R.
[0076] Figure 2 A schematic diagram of an initial three-dimensional model provided for the embodiments of the present application is shown in Figure 3 A schematic diagram of an isosurface model provided for the embodiments of the present application is shown in Figure 2 As shown in FIG. 1, the initial three-dimensional model is a model with a hole and other abrupt features. Figure 3 As shown in FIG. 2, the isosurface model retains the trend of change of the initial three-dimensional model.
[0077] S103, according to the cutting interval corresponding to the target scanner, cutting the isosurface model to obtain a cutting curve of the isosurface model.
[0078] According to the cutting interval corresponding to the target scanner, cutting the isosurface model, and taking the cutting lines on the surface of the isosurface model as cutting curves, where the number of cutting curves is multiple, that is, a sequence of cutting curves.
[0079] In an optional implementation, before step S103 above, which involves cutting the isomorphic surface model according to the cutting spacing corresponding to the target scanner to obtain the cutting curve of the isomorphic surface model, the method may include:
[0080] The cutting spacing is obtained based on the field of view parameters and overlap parameters of the target scanner.
[0081] The target scanner is a scanner used to scan the object to be scanned, and the field of view parameter of the target scanner is the field of view height (V). H The overlap parameter of the target scanner is δ, and the cutting interval Step corresponding to the target scanner is V. H ×δ.
[0082] S104. Obtain the pose information of the sampling points on the cutting curve and the orientation of the target scanner at the sampling points.
[0083] Equally spaced points are sampled on the cutting surface to obtain sampling points on the cutting curve. There are multiple sampling points. Then, the pose information of the sampling points on the cutting curve and the visual orientation of the target scanner at the sampling points are obtained. The pose information of the sampling points includes: the position information and the orientation information of the sampling points. The orientation information of the sampling points is used to indicate the normal information of the sampling points. The normal information of the sampling points refers to the normal vector of the triangular facet on the initial 3D model where the sampling points are located.
[0084] It is understandable that the location information of the sampling point is used to indicate the scanning position of the target scanner when scanning the object to be scanned. This scanning position can be the position of the object to be scanned in the three-dimensional coordinate system, where the three-dimensional coordinate system of the object to be scanned is a three-dimensional coordinate system established with the center of the object to be scanned as the origin.
[0085] S105. Based on the pose information of the sampling points and the orientation of the viewing angle, generate the scanning path of the target scanner so that the target scanner can scan the object to be scanned based on the scanning path and obtain the scanned three-dimensional model.
[0086] The scanning path of the target scanner is a scanning path based on the object to be scanned. This scanning path includes the pose information of the sampling points and the visual orientation of the target scanner at the sampling points. The target scanner is used to scan the object to be scanned based on this scanning path to obtain a three-dimensional model of the object to be scanned.
[0087] In some embodiments, the target scanner is mounted on a motion mechanism (such as a robotic arm), and the motion mechanism can also be path-planned based on the scanning path so that the motion mechanism drives the target scanner to scan the object to be scanned based on the scanning path.
[0088] In addition, the normal information of the sampling points can be offset according to the actual situation. Furthermore, when planning the path of the motion mechanism, the scanning path can be converted to the visual sensor of the motion mechanism or other defined coordinate system. During the conversion, the deviation of the isomorphic surface model from the initial three-dimensional model by a distance of R should also be considered.
[0089] In the scanning path generation method provided in this embodiment, for scanning models with abrupt changes such as holes, the rolling ball method is used to generate an isosurface model. This not only avoids the interference of abrupt changes but also retains the trend of change at the abrupt changes. Even if the scanning path at the abrupt changes meets the scanning requirements, it avoids the problem of planning failure caused by interference from abrupt changes. It can directly plan an ordered motion trajectory without the need to use shortest path algorithms for sorting, and has better robustness.
[0090] Figure 4 A flowchart illustrating the scan path generation method provided in this application embodiment. Figure Two ,like Figure 4 As shown, in an optional embodiment, step S103 above, which involves cutting the isomorphic surface model according to the cutting spacing corresponding to the target scanner to obtain the cutting curve of the isomorphic surface model, may include:
[0091] S201. Construct the three-dimensional coordinate system of the isosurface model and obtain the model bounding box of the isosurface model.
[0092] The three-dimensional coordinate system of the isosurface model is constructed using principal component analysis (PCA) transformation rules. See [link / reference]. Figure 3 The X-axis points upwards from the paper, the Y-axis points to the left from the paper, and the Z-axis points perpendicular to the paper.
[0093] Obtain the bounding box of the isomorphic surface model in the 3D coordinate system. The bounding box is used to enclose the isomorphic surface model. The maximum position information of the bounding box on each coordinate axis in the 3D coordinate system is greater than or equal to the maximum position information of the isomorphic surface model on each coordinate axis in the 3D coordinate system.
[0094] S202. Determine the cutting plane based on the length of the model's bounding box in the three-dimensional coordinate system.
[0095] The length of the model bounding box in the three-dimensional coordinate system includes the values of each coordinate axis of the model bounding box in the three-dimensional coordinate system.
[0096] Based on the values of each coordinate axis of the model bounding box in the 3D coordinate system, the normal of the cutting surface is determined. The normal of the cutting surface is the normal vector of the cutting plane. Then, the cutting plane is determined based on the normal of the cutting surface.
[0097] In an optional implementation, step S202 above, determining the cutting plane based on the length of the model bounding box in the three-dimensional coordinate system, may include:
[0098] If the value of the first coordinate axis of the model bounding box in the 3D coordinate system is greater than the value of the second coordinate axis of the model bounding box in the 3D coordinate system, then the second coordinate axis is determined as the cutting plane normal; if the value of the first coordinate axis of the model bounding box is less than or equal to the value of the second coordinate axis of the model bounding box, then the first coordinate axis is determined as the cutting plane normal; the cutting plane is determined according to the cutting plane normal.
[0099] The first coordinate axis can be the X-axis, and the second coordinate axis can be the Y-axis. If the value of the model's bounding box on the X-axis (L... x ) greater than the model bounding box value on the Y-axis (L) y If the Y-axis is determined to be the normal to the cutting plane, and the value of the model bounding box on the X-axis is (L) x ) less than or equal to the model bounding box value on the Y-axis (L) y If the X-axis is determined as the normal to the cutting surface, then the cutting plane is determined based on the normal to the cutting surface.
[0100] If the X-axis is the normal to the cutting surface, then the cutting plane is parallel to the YZ plane. If the Y-axis is the normal to the cutting surface, then the cutting plane is parallel to the XZ plane. In other words, the long side of the model's bounding box is selected for cutting, thereby minimizing the number of turns in the final trajectory (scanning path) to improve the scanning efficiency of the target scanner and the execution efficiency of the motion mechanism. Experiments show that this scanning method can achieve better results.
[0101] S203. Cut the isomorphic surface model according to the cutting spacing and cutting plane to obtain the cutting curve.
[0102] The isomorphic surface model is cut according to the cutting spacing and cutting plane to obtain the cutting curve on the surface of the isomorphic surface model. There are multiple cutting planes, that is, an orthogonal cutting plane array.
[0103] In some embodiments, after constructing the three-dimensional coordinate system of the isosurface model, in order to avoid possible interference between the upper and lower layers, the upper surface of the isosurface model Z≥0 can be truncated to determine the cutting plane and cutting process of the upper surface. The same steps are performed for the lower surface of the isosurface model Z≥0.
[0104] Figure 5 Schematic diagram of model cutting provided for embodiments of this application Figure One , Figure 6 Schematic diagram of model cutting provided for embodiments of this application Figure Two ,like Figure 5As shown, the cutting spacing is 12cm. The initial 3D model is cut according to this spacing to obtain cutting curves on its surface. These cutting curves are marked in blue, and the cutting plane is the plane corresponding to the yellow line. Figure 6 As shown, the white part is the cutting plane.
[0105] Figure 7 A flowchart illustrating the scan path generation method provided in this application embodiment. Figure Three ,like Figure 7 As shown, in an optional embodiment, step S203 above, which involves cutting the isomorphic surface model according to the cutting spacing and the cutting plane to obtain the cutting curve, may include:
[0106] S301. Cut the isomorphic surface model according to the cutting spacing and cutting plane to obtain multiple cutting points on the isomorphic surface model.
[0107] The isosurface model retains the variation trend of the initial 3D model. For example, it retains abrupt features such as holes. Then, by cutting the isosurface model according to the cutting spacing and cutting plane, multiple cutting points can be obtained on the surface of the isosurface model. Among them, holes and the like do not have cutting points on the isosurface model.
[0108] S302. Perform curve fitting based on multiple cutting points to generate a cutting curve.
[0109] A cutting curve is generated by curve fitting through multiple cutting points.
[0110] Figure 8 A schematic diagram of the cutting curve provided in the embodiments of this application, such as Figure 8 As shown, in Figure 5 Based on this, it can be seen that the holes have no cutting points on the isosurface model, that is, there are gaps.
[0111] Figure 9 A flowchart illustrating the scan path generation method provided in this application embodiment. Figure Four ,like Figure 9 As shown, in an optional implementation, step S104 above, obtaining the pose information of the sampling points on the cutting curve and the viewing angle orientation of the target scanner at the sampling points, may include:
[0112] S401. Obtain the position and orientation information of multiple cutting points.
[0113] Among them, the position information of the cutting point is the position information of the cutting point in the three-dimensional coordinate system of the isomorphic surface model, and the orientation information of the cutting point is used to indicate the normal information of the cutting point. The normal information of the cutting point refers to the normal vector of the triangular facet on the isomorphic surface model where the cutting point is located.
[0114] S402. Obtain the position information of the sampling point based on the position information of two adjacent cutting points on the cutting curve.
[0115] The two adjacent cut points of the sampling point include the left adjacent cut point and the right adjacent cut point of the sampling point. Based on the position information of the two adjacent cut points, the position information of the sampling point is calculated by interpolation method.
[0116] Figure 10 This is a schematic diagram of coordinate interpolation provided in the embodiments of this application, such as... Figure 10 As shown, the sampling point is P, the left adjacent cutting point is A, and the right adjacent cutting point is B.
[0117] Location information of point P (P T ) is represented as:
[0118] P T =(1-k)A T +kB T
[0119] Among them, A T For the location information of point A, B T The location information of point B is given by k, which is equal to the distance of PA divided by the distance of AB, where k∈[0,1].
[0120] S403. Based on the position information, attitude information, and included angle between two adjacent cutting points, obtain the attitude information of the sampling point.
[0121] Based on the position information, attitude information, and included angle of two adjacent cutting points, the attitude information of the sampling points is calculated using an interpolation method.
[0122] See Figure 10 The pose information of point P (P R ) is represented as:
[0123]
[0124]
[0125] Where the angle between A and B is β, A R Given the pose information of point A, B R Here is the attitude information for point B, and arccos is the inverse cosine function.
[0126] Figure 11 This is a schematic diagram showing the location and normal of the sampling points provided in the embodiments of this application. Figure 12 The location of the sampling points and the schematic diagram of the superposition of the normal and the isosurface model provided in the embodiments of this application are shown below. Figure 11 , Figure 12As shown, red dots represent sampling points, and lines represent the normals of the sampling points.
[0127] S404. Obtain the viewing direction based on the location information of the sampling point and the positions of two adjacent cutting points.
[0128] For sampling point P, in addition to knowing the location information, it is also necessary to define the viewing direction of the target scanner at that location, where the viewing direction of the target scanner at point P is the opposite direction to the normal of point P.
[0129] In the scanning path generation method provided in this embodiment, the direct planning method can obtain trajectory points (sampling points) that are more in line with the scanning characteristics of the scanner and the motion law of the motion mechanism, and has better robustness.
[0130] In some embodiments, if only the viewing angle of the target scanner is determined (assuming it is the Z-axis direction), the target scanner's posture is not unique, as it can also rotate around the Z-axis. Therefore, in order to uniquely determine the posture of the target scanner, it is also necessary to define the three-dimensional coordinate system in which the target scanner is located, so that the target scanner can scan the object to be scanned in the three-dimensional coordinate system based on the pose information of the sampling points and the viewing angle. The three-dimensional coordinate system in which the target scanner is located is a three-dimensional coordinate system with the sampling points as the origin.
[0131] Figure 13 A schematic diagram illustrating the definition of the viewing angle provided in the embodiments of this application, such as... Figure 13 As shown, the sampling point is P, the left adjacent cutting point is A, and the right adjacent cutting point is B. The normal direction of point P is defined as the Z-axis direction. Connecting P and A yields a vector. The X-axis direction is determined by the cross product of vectors. Determined, the Y-axis direction is determined by Confirmed. Specifically, the X-axis direction is always parallel to the first component of the target scanner, and the Y-axis direction is always parallel to the second component of the target scanner. This ensures stable scanning of the target scanner when it scans the object based on its viewing angle, achieving a smooth transition in the target scanner's posture between adjacent viewpoints.
[0132] Figure 14 The global sampling point distribution map on the scanning path provided in the embodiments of this application is as follows: Figure 14 As shown, red represents the X-axis, green represents the Y-axis, and blue represents the Z-axis. P1 represents the first sampling point, P2 represents the second sampling point, P3 represents the third sampling point, and so on.
[0133] Figure 15 A flowchart illustrating the scan path generation method provided in this application embodiment. Figure Five ,like Figure 15As shown, in an optional implementation, step S105, which generates the scanning path of the target scanner based on the pose information of the sampling points and the viewing angle, may include:
[0134] S501. Generate a two-dimensional array based on the pose information of the sampling points and the orientation of the viewpoint.
[0135] S502. Perform reverse transformation on the two-dimensional array to generate the target array, and generate the scan path based on the target array.
[0136] The two-dimensional array includes the pose information of multiple sampling points and the corresponding view orientation. One cutting curve corresponds to one two-dimensional array, and the sequence of cutting curves corresponds to multiple two-dimensional arrays arranged from top to bottom. The first two-dimensional array has a frequency of 1, the second two-dimensional array has a frequency of 2, and so on, with the nth two-dimensional array having a frequency of n.
[0137] The pose information and corresponding view orientation of multiple sampling points in the even-order array are reversed to change the data order. For example, the pose information and view orientation of the first and last sampling points in the even-order array are swapped, the pose information and view orientation of the second sampling point are swapped with the pose information and view orientation of the second-to-last sampling point, and so on, until the reverse transformation of the even-order array is completed.
[0138] Of course, the pose information of multiple sampling points in the odd-order array and their corresponding view orientation can also be reversed to change the data order. For details, please refer to the above description.
[0139] Then, a scanning path is generated based on the target array. Compared with the original method of scanning adjacent cutting curves from left to right, which resulted in an excessively large span between the beginning and end of the target scanner and affected the movement of the target scanner and the motion mechanism, the reverse transformation allows the target scanner to be arranged in a zigzag pattern for adjacent cutting curves, which is more in line with the motion characteristics of the target scanner and the motion mechanism.
[0140] In the scanning path generation method provided in this embodiment, in order to avoid the large span between the beginning and end of the sampling points on adjacent cutting curves affecting the movement of the target scanner and the motion mechanism, Zigzag processing is performed on multiple sets of line sequence poses (multiple two-dimensional arrays) to obtain globally continuous path points, which is more in line with the motion characteristics of the target scanner and the motion mechanism.
[0141] Figure 16 This is a schematic diagram of the scanning path generation device provided in an embodiment of this application. The device can be integrated into an electronic device.
[0142] like Figure 16 As shown, the device may include:
[0143] Acquisition module 601 is used to acquire the initial 3D model of the object to be scanned;
[0144] The processing module 602 is used to determine multiple rolling ball feature points from the initial three-dimensional model and construct an isomorphic surface model based on the multiple rolling ball feature points. The multiple rolling ball feature points are feature points obtained by rolling the target rolling ball along the surface of the initial three-dimensional model.
[0145] The processing module 602 is also used to cut the isomorphic surface model according to the cutting spacing corresponding to the target scanner, so as to obtain the cutting curve of the isomorphic surface model;
[0146] The acquisition module 601 is also used to acquire the pose information of the sampling points on the cutting curve and the viewing angle orientation of the target scanner at the sampling points;
[0147] The generation module 603 is used to generate the scanning path of the target scanner based on the pose information of the sampling points and the orientation of the viewing angle, so that the target scanner can scan the object to be scanned based on the scanning path to obtain the scanned 3D model.
[0148] In an optional implementation, the processing module 602 is specifically used for:
[0149] Construct a three-dimensional coordinate system for the isosurface model and obtain the model bounding box of the isosurface model;
[0150] Determine the cutting plane based on the length of the model's bounding box in the 3D coordinate system;
[0151] The isomorphic surface model is cut according to the cutting spacing and the cutting plane to obtain the cutting curve.
[0152] In an optional implementation, the processing module 602 is specifically used for:
[0153] If the value of the first coordinate axis of the model bounding box in the 3D coordinate system is greater than the value of the second coordinate axis of the model bounding box in the 3D coordinate system, then the second coordinate axis is determined to be the cutting surface normal.
[0154] If the value of the model bounding box on the first coordinate axis is less than or equal to the value of the model bounding box on the second coordinate axis, then the first coordinate axis is determined to be the cutting plane normal.
[0155] The cutting plane is determined based on the normal to the cutting surface.
[0156] In an optional implementation, the acquisition module 601 is further configured to:
[0157] The cutting spacing is obtained based on the field of view parameters and overlap parameters of the target scanner.
[0158] In an optional implementation, the processing module 602 is specifically used for:
[0159] The isomorphic surface model is cut according to the cutting spacing and cutting plane to obtain multiple cutting points on the isomorphic surface model;
[0160] A cutting curve is generated by curve fitting based on multiple cutting points.
[0161] In an optional implementation, the acquisition module 601 is specifically used for:
[0162] Obtain the position and orientation information of multiple cutting points;
[0163] The position information of the sampling point is obtained based on the position information of two adjacent cutting points on the cutting curve;
[0164] Based on the position information, attitude information, and included angle between two adjacent cutting points, the attitude information of the sampling point is obtained.
[0165] The viewing direction is obtained based on the location information of the sampling point and the location of two adjacent cutting points.
[0166] In an optional implementation, the generation module 603 is specifically used for:
[0167] A two-dimensional array is generated based on the pose information of the sampling points and the orientation of the viewpoint;
[0168] Perform a reverse transformation on the two-dimensional array to generate the target array, and then generate a scan path based on the target array.
[0169] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0170] Figure 17 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 17 As shown, the device may include a processor 701, a memory 702, and a bus 703. The memory 702 stores machine-readable instructions that can be executed by the processor 701. When the electronic device is running, the processor 701 communicates with the memory 702 through the bus 703, and the processor 701 executes the machine-readable instructions to perform the above-described method.
[0171] This application also provides a computer-readable storage medium storing a computer program, which is executed by a processor to perform the above-described method.
[0172] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0173] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] In addition, the functional units in the embodiments provided in this 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.
[0176] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0177] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0178] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for generating a scan path, characterized in that, include: Obtain the initial 3D model of the object to be scanned; Multiple rolling ball feature points are determined from the initial three-dimensional model, and an isomorphic surface model is constructed based on the multiple rolling ball feature points. The multiple rolling ball feature points are feature points obtained by rolling a target ball along the surface of the initial three-dimensional model. The isomorphic surface model is cut according to the cutting spacing corresponding to the target scanner to obtain the cutting curve of the isomorphic surface model; Acquire the pose information of the sampling points on the cutting curve and the viewing orientation of the target scanner at the sampling points; Based on the pose information of the sampling points and the orientation of the viewing angle, a scanning path for the target scanner is generated, so that the target scanner can scan the object to be scanned based on the scanning path to obtain a scanned three-dimensional model.
2. The method according to claim 1, characterized in that, The step of cutting the isomorphic surface model according to the cutting spacing corresponding to the target scanner to obtain the cutting curve of the isomorphic surface model includes: Construct a three-dimensional coordinate system for the isosurface model and obtain the model bounding box of the isosurface model; The cutting plane is determined based on the length of the model bounding box in the three-dimensional coordinate system; The isomorphic surface model is cut according to the cutting spacing and the cutting plane to obtain the cutting curve.
3. The method according to claim 2, characterized in that, Determining the cutting plane based on the length of the model bounding box in the three-dimensional coordinate system includes: If the value of the first coordinate axis of the model bounding box in the three-dimensional coordinate system is greater than the value of the second coordinate axis of the model bounding box in the three-dimensional coordinate system, then the second coordinate axis is determined to be the cutting surface normal. If the value of the model bounding box on the first coordinate axis is less than or equal to the value of the model bounding box on the second coordinate axis, then the first coordinate axis is determined to be the cutting surface normal. The cutting plane is determined based on the normal of the cutting surface.
4. The method according to claim 1, characterized in that, Before cutting the isosurface model according to the cutting spacing corresponding to the target scanner to obtain the cutting curve of the isosurface model, the method further includes: The cutting spacing is obtained based on the field of view parameters and overlap parameters of the target scanner.
5. The method according to claim 2, characterized in that, The step of cutting the isomorphic surface model according to the cutting spacing and the cutting plane to obtain the cutting curve includes: The isomorphic surface model is cut according to the cutting spacing and the cutting plane to obtain multiple cutting points on the isomorphic surface model; The cutting curve is generated by curve fitting based on the multiple cutting points.
6. The method according to claim 5, characterized in that, The step of acquiring the pose information of the sampling points on the cutting curve and the viewing angle orientation of the target scanner at the sampling points includes: Obtain the position and orientation information of the multiple cutting points; The position information of the sampling point is obtained based on the position information of two adjacent cutting points of the sampling point on the cutting curve; Based on the position information, attitude information, and included angle between the two adjacent cutting points, the attitude information of the sampling point is obtained. The viewing angle is obtained based on the location information of the sampling point and the positions of the two adjacent cutting points.
7. The method according to claim 1, characterized in that, The step of generating the scanning path of the target scanner based on the pose information of the sampling points and the viewing angle includes: A two-dimensional array is generated based on the pose information of the sampling points and the orientation of the viewpoint; The two-dimensional array is reversed to generate a target array, and the scan path is generated based on the target array.
8. A scanning path generation device, characterized in that, include: The acquisition module is used to acquire the initial 3D model of the object to be scanned; The processing module is used to determine multiple rolling ball feature points from the initial three-dimensional model and construct an isomorphic surface model based on the multiple rolling ball feature points, wherein the multiple rolling ball feature points are feature points obtained by rolling a target rolling ball along the surface of the initial three-dimensional model; The processing module is also used to cut the isomorphic surface model according to the cutting spacing corresponding to the target scanner, so as to obtain the cutting curve of the isomorphic surface model; The acquisition module is also used to acquire the pose information of the sampling points on the cutting curve and the viewing angle orientation of the target scanner at the sampling points; The generation module is used to generate a scanning path for the target scanner based on the pose information of the sampling points and the viewing angle orientation, so that the target scanner can scan the object to be scanned based on the scanning path to obtain a scanned three-dimensional model.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method according to any one of claims 1 to 7.