Robot scanning viewpoint planning method and system for stone carving workpiece measurement
By planning the scanning viewpoints of 3D stone carving workpieces using an improved region growing algorithm and OBB bounding box technology, the problems of incomplete scanning and low efficiency are solved, and high-quality and efficient automated measurement is achieved.
Patent Information
- Application Number
- CN202310479933.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-04-28
AI Technical Summary
Existing technologies are unable to effectively plan the scanning viewpoints of 3D stone carving workpieces, resulting in incomplete scanning, low efficiency and insufficient accuracy.
An improved region growing algorithm is used to divide the STL model of the three-dimensional stone carving workpiece into regions, generate triangular facet clusters, and calculate the size of the triangular facets through the OBB bounding box. The scanning viewpoint is planned in combination with the field of view of the scanner, and the full scanning path is generated using a robotic arm and a cubic turntable.
The scanning quality, efficiency and integrity of 3D stone cutting workpieces are improved, and it is adaptable to 3D stone cutting workpieces of different shapes. The viewpoint planning algorithm is simple and efficient, and it is easy to realize automated measurement.
Smart Images

Figure CN116512806B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of three-dimensional measurement of stereoscopic stone sculpture, and particularly relates to a robot scanning viewpoint planning method and system for three-dimensional measurement of a stereoscopic stone sculpture cutting workpiece. BACKGROUND
[0002] Stereoscopic stone sculpture is a carrier of culture and art, has complex and variable contour shapes, and has many texture details, and has great processing technical difficulty, and is a stone sculpture product with high economic added value. Due to the strong flexibility and multiple degrees of freedom of a robot, robot stereoscopic stone sculpture processing has become a new trend in the development of the stone sculpture industry. In robot stereoscopic stone sculpture processing, there are mainly rope saw cutting rough machining and detail grinding finishing. Three-dimensional measurement of a stereoscopic stone sculpture cutting workpiece can be used to detect the surface quality of processing, optimize the processing technology, and guide the subsequent detail grinding finishing.
[0003] The robot three-dimensional scanning method for measuring a stereoscopic stone sculpture cutting workpiece has the advantages of high automation, high precision, high efficiency, non-contact, and no damage. However, due to the large changes in the structure of the stone sculpture cutting workpiece, a complete three-dimensional model of the stone sculpture cutting workpiece cannot be obtained by one-time scanning, and multiple scanning viewpoints must be planned. Therefore, how to plan the scanning viewpoints of the stereoscopic stone sculpture cutting workpiece is a very challenging task. SUMMARY
[0004] The main purpose of the present application is to overcome the above-mentioned defects in the prior art, and to provide a robot scanning viewpoint planning method and system for stone sculpture cutting workpiece measurement. The scanning viewpoint is planned according to the STL model of the stereoscopic stone sculpture cutting workpiece, so as to ensure the completeness, precision and efficiency of the scanning, and to realize the automatic measurement of the stereoscopic stone sculpture cutting workpiece.
[0005] The present application adopts the following technical solutions:
[0006] On the one hand, a robot scanning viewpoint planning method for stone sculpture cutting workpiece measurement includes:
[0007] S101, using an improved region growing algorithm to divide the surface of the STL model of the stereoscopic stone sculpture cutting workpiece into regions to obtain a triangular facet cluster;
[0008] S102, discretizing each triangular facet cluster after division into a three-dimensional point cloud to obtain a point cloud model;
[0009] S103, performing OBB bounding box calculation on each point cloud model to obtain the size of the OBB bounding box;
[0010] S104, according to the maximum middle plane size of the OBB bounding box and the field of view size of a single scanning of the scanner, four scanning cases are divided, and scanning view point planning is performed for each scanning case to obtain the position coordinates of each scanning view point in the workpiece coordinate system;
[0011] S105, the mechanical arm is limited to move on a single side of the three-dimensional stone sculpture cutting workpiece, the workpiece is rotated by the three-axis turntable every 90°, and a full-view scanning path of the cutting workpiece is generated;
[0012] S106, the generated scanning path is imported into the CAM software to generate a mechanical arm executable program for actual scanning.
[0013] Preferably, in S101, after the surface of the STL model of the three-dimensional stone sculpture cutting workpiece is divided into triangular facet clusters by using the improved region growing algorithm, the following steps are further included:
[0014] The divided facet clusters are optimized, and triangular facet clusters with an area less than a set threshold are merged into a cluster adjacent to the triangular facet cluster and having the smallest average normal vector angle, and the triangular facet clusters with scanning interference are removed after optimization and merging.
[0015] Preferably, S101 specifically includes:
[0016] reading three vertex coordinates and a normal vector n of each facet T i of the STL triangular facet model of the three-dimensional stone sculpture cutting workpiece i , and calculating related triangular facets T i having one or two common vertices with the triangular facet T j ;
[0017] The surface of the STL model of the three-dimensional stone sculpture cutting workpiece is divided into triangular facet clusters by using the improved region growing algorithm.
[0018] wherein, the cosine value Av(T i ) between the normal vectors of the triangular facet T j and one of its related triangular facets T i,j is represented as follows:
[0019] Av(T i,j ) = cos(f(T i ), f(T j ))
[0020] wherein, f(T i ) represents the normal vector of the triangular facet T i ; and f(T j ) represents the normal vector of the triangular facet Tj The normal vector of
[0021] Triangle patch T i The expected normal vectors of all its related triangles are E(T i ), which is expressed as follows:
[0022]
[0023] Triangle patch T i The variance of the normal vectors of all its related triangles D(T i ), which is expressed as follows:
[0024]
[0025] Where k is the triangle T i The number of related triangles.
[0026] Preferably, the S103 specifically includes:
[0027] For each triangular face cluster point cloud model, according to the spatial point P of the point cloud model m (x m ,y m ,z m ) calculates the mean μ(x,y,z) and uses it as the center of the OBB bounding box as follows:
[0028]
[0029] Among them, μ x represents the mean of the x-axis; μ y Indicates the mean of the y-axis; μ z represents the mean of the z-axis; P m1 Represents a spatial point P m x m ;P m2 Represents a spatial point P m of y m ;P m3 Represents a spatial point P m z m ; n represents the total number of spatial points in the point cloud model; m represents the mth spatial point;
[0030] Calculate the covariance cov(c i ,c j ),as follows:
[0031]
[0032] Where i, j = 1, 2, 3; u1 = μ x ,u2=μ y,u3=μ z ;c i ={c1,c2,c3}, c1 represents the x component, c2 represents the y component, and c3 represents the z component;
[0033] According to the covariance, the covariance matrix C can be obtained as follows:
[0034]
[0035] The eigenvalues and corresponding eigenvectors can be solved through the covariance matrix. Since the covariance matrix is a symmetric matrix, its three eigenvectors are mutually orthogonal. After normalization, they become the three main directions of the local coordinate system of the OBB bounding box.
[0036] Project all vertices of the model to the three main directions, find their maximum and minimum values, and determine the size of the OBB bounding box.
[0037] Preferably, the S104 specifically includes:
[0038] According to the length and width of the maximum middle plane of the OBB bounding box and the field of view of the scanner in a single scan, it is divided into four scanning situations, as follows:
[0039] (1) The length and width of the maximum middle plane of the OBB bounding box of the hole boundary are smaller than the length and width of the scanner's single scan. The entire hole area can be scanned in one scan. The calculation of is as follows:
[0040]
[0041]
[0042] in, is the unit vector of the Z' axis of the O'-X'Y'Z' coordinate system, is the rotation matrix of O'-X'Y'Z' relative to the O-XYZ coordinate system, O'-X'Y'Z' is the center coordinate system of the OBB bounding box, O-XYZ is the workpiece coordinate system, O' O-XYZ is the coordinate of the center point O' of the OBB bounding box under O-XYZ. The above parameters can be obtained when calculating the OBB bounding box. O'-X'Y'Z' (0,0,d) is the position coordinate of the viewpoint VP in the O'-X'Y'Z' coordinate system, and d is the scanning distance;
[0043] (2) The maximum middle plane of the OBB bounding box of the hole boundary is shorter than the length of the scanner's single scan, and its width is longer than the width of the scanner's single scan. Horizontal movement is required to scan the entire hole area. Specifically, two scanning viewpoints VP1 and VP2 need to be planned, and their scanning directions are The calculation of the coordinate value vp'(x', y', z') in the O'-X'Y'Z' coordinate system is as follows:
[0044]
[0045]
[0046] wherein w is the single scanning width of the scanner, d is the scanning distance, (x A ,y A ,0) is the coordinate value of the vertex A of the maximum intermediate plane in the O'-X'Y'Z' coordinate system; represents the scanning direction of the viewpoint VP1; represents the scanning direction of the viewpoint VP2; represents the unit vector opposite to the direction of the coordinate axis Z'; x'1 represents the x value of the scanning viewpoint VP1 in the O'-X'Y'Z' coordinate system; y'1 represents the y value of the scanning viewpoint VP1 in the O'-X'Y'Z' coordinate system; z'1 represents the z value of the scanning viewpoint VP1 in the O'-X'Y'Z' coordinate system; x'2 represents the x value of the scanning viewpoint VP2 in the O'-X'Y'Z' coordinate system; y'2 represents the y value of the scanning viewpoint VP2 in the O'-X'Y'Z' coordinate system; z'2 represents the z value of the scanning viewpoint VP2 in the O'-X'Y'Z' coordinate system;
[0047] After the coordinate value of the viewpoint in the O'-X'Y'Z' coordinate system is obtained, the scanning viewpoints VP i The position coordinate vp i (x i ,y i ,z i ) in the Q-XYZ coordinate system:
[0048]
[0049] (3) The length of the maximum intermediate plane of the OBB bounding box of the hole boundary is greater than the length of the single scanning of the scanner, and the width is less than the width of the single scanning of the scanner, and the scanning needs to be moved vertically to scan the whole hole region; specifically, two scanning viewpoints VP1 and VP2 need to be planned, and the scanning directions The calculation of the coordinate value vp'(x', y', z') in the O'-X'Y'Z' coordinate system is as follows:
[0050]
[0051]
[0052] wherein l is the single scanning length of the scanner, and the value of the scanning viewpoint in the Q-XYZ coordinate system can be obtained according to the above transformation;
[0053] (4) When the length and width of a single scan of the scanner are less than the length and width of the maximum middle plane of the OBB bounding box, multiple scanning viewpoints need to be planned, as follows:
[0054] Determine the total number of scanning viewpoints N:
[0055]
[0056] where b is the width of the maximum middle plane, and w is the width of a single scan of the scanner. According to the determined number of scanning viewpoints N, the scanning interval c is obtained:
[0057]
[0058] In the O'-X'Y'Z' coordinate system, the coordinates of the sampling point P i (x i P ,y i P ,z i P ) on the maximum middle plane are:
[0059]
[0060]
[0061] After obtaining the sampling point P i (x i P ,y i P ,z i P ), the scanning direction of the scanning viewpoint and the position coordinates vp′ i (x′ i , y′ i , z′ i ) in the O'-X'Y'Z' coordinate system are calculated:
[0062]
[0063]
[0064] According to the spatial transformation, the value of the scanning viewpoint in the Q-XYZ is obtained.
[0065] Preferably, the S105 specifically comprises:
[0066] The genetic algorithm is used to perform path optimization on the center points O' of the multiple OBB enclosures in each scan, and the optimal scanning path is calculated.
[0067] Preferably, the S106 specifically comprises:
[0068] The generated scanning path is imported into the CAM software, collision of the scanning path is detected through virtual simulation, and the viewpoints with collision are optimized and adjusted in the scanning direction until no collision occurs; finally, the safe and collision-free scanning path is compiled to generate an executable program of the mechanical arm, so as to realize automatic measurement of the three-dimensional stone carving cutting workpiece.
[0069] In another aspect, a robot scanning viewpoint planning system for three-dimensional stone carving cutting workpiece measurement comprises:
[0070] The region division module is configured to divide the surface of the STL model of the three-dimensional stone carving cutting workpiece by using the improved region growing algorithm to obtain a triangular facet cluster.
[0071] The point cloud model acquisition module is configured to discretize each triangular facet cluster after division into a three-dimensional point cloud to obtain a point cloud model.
[0072] The bounding box size acquisition module is configured to obtain the size of the OBB bounding box by performing OBB bounding box calculation on each point cloud model.
[0073] The position coordinate acquisition module is configured to divide four scanning situations according to the maximum intermediate plane size of the OBB bounding box and the field of view size of a single scanning of the scanner, plan scanning viewpoints for each scanning situation respectively, and obtain the position coordinates of the scanning viewpoints in the workpiece coordinate system.
[0074] The scanning path generation module is configured to limit the mechanical arm to move on a single side surface of the three-dimensional stone carving cutting workpiece, rotate the workpiece by 90 degrees each time through a three-stage turntable, and generate a full-view scanning path of the cutting workpiece.
[0075] The workpiece scanning module is configured to import the generated scanning path into the CAM software, generate an executable program of the mechanical arm, and perform actual scanning.
[0076] Compared with the prior art, the present application has the following advantages:
[0077] The three-dimensional stone carving cutting workpiece is composed of straight surfaces and has few texture details, and will not produce holes, local pits and other shapes. According to the surface characteristics of the three-dimensional stone carving cutting workpiece, the STL model of the three-dimensional stone carving cutting workpiece is reasonably divided and optimized by using the improved region growing algorithm, and different viewpoint planning is performed according to the maximum intermediate plane size of the OBB bounding box of different regions and the field of view size of a single scanning of the scanner, which effectively improves the quality, efficiency and integrity of the scanning, generates a good redundant viewpoint set, and has strong adaptability to different shapes of the three-dimensional stone carving cutting workpiece. The viewpoint planning algorithm is simple and efficient, and easy to implement. BRIEF DESCRIPTION OF DRAWINGS
[0078] Figure 1 A method flow chart of an embodiment of the present application;
[0079] Figure 2 A result map of a certain stereoscopic stone sculpture cutting workpiece after partition optimization using an improved region growing algorithm of an embodiment of the present application;
[0080] Figure 3 Four scanning situations of an embodiment of the present application; wherein (a) represents a first scanning situation, (b) represents a second scanning situation, (c) represents a third scanning situation, and (d) represents a fourth scanning situation;
[0081] Figure 4 Scanning viewpoint planning schematic diagrams for the four scanning situations of an embodiment of the present application; wherein (a) represents scanning viewpoint planning for the first scanning situation, (b) represents scanning viewpoint planning for the second scanning situation, (c) represents scanning viewpoint planning for the third scanning situation, and (d) represents scanning viewpoint planning for the fourth scanning situation;
[0082] Figure 5 A scanning viewpoint result map of a certain stereoscopic stone sculpture cutting workpiece after partition of an embodiment of the present application; wherein (a) represents viewpoint planning of face sheet cluster 3, and (b) represents viewpoint planning of face sheet cluster 4;
[0083] Figure 6 A scanning path planning result map of a certain stereoscopic stone sculpture cutting workpiece of an embodiment of the present application;
[0084] Figure 7 An automatic three-dimensional scanning schematic diagram of a certain stereoscopic stone sculpture cutting workpiece of an embodiment of the present application;
[0085] Figure 8 A system structure block diagram of an embodiment of the present application. DETAILED DESCRIPTION
[0086] The present application will be further described with specific embodiments. It should be understood that these embodiments are only used to illustrate the present application and not used to limit the scope of the present application. Furthermore, it should be understood that those skilled in the art can make various modifications or changes to the present application after reading the content taught by the present application, and these equivalent forms also fall within the scope of the appended claims of the present application.
[0087] Reference Figure 1 As shown in the drawings, the embodiment of the present application is a robot scanning viewpoint planning method for stone sculpture cutting workpiece measurement, which comprises:
[0088] S101, using an improved region growing algorithm to divide the surface of the STL model of the three-dimensional stone carving workpiece into regions to obtain triangular facet clusters;
[0089] S102, discretizing each divided triangular face cluster into a three-dimensional point cloud to obtain a point cloud model;
[0090] S103, performing OBB bounding box calculation on each point cloud model to obtain the size of the OBB bounding box;
[0091] S104, dividing the scanning conditions into four types according to the maximum middle plane size of the OBB bounding box and the field of view size of a single scan of the scanner, performing scanning viewpoint planning for each scanning condition, and obtaining the position coordinates of each scanning viewpoint in the workpiece coordinate system;
[0092] S105, limiting the robot arm to a single side of the three-dimensional stone carving workpiece for mobile scanning, and rotating the workpiece three times by the turntable, each rotation of 90 degrees, to generate a full-view scanning path of the cut workpiece;
[0093] S106, importing the generated scanning path into the CAM software to generate a robotic arm executable program for actual scanning.
[0094] The specific implementation of S101 is as follows.
[0095] Read each face T of the STL triangular face model i = (p1, p2, p3) three vertex coordinates and normal vector n i , and find all triangles T i Related triangles T of triangles that share one or two vertices j The improved region growing algorithm uses the cosine of the angle between the normal vectors of two triangles as the principle of region growing, and the variance of the normal vectors is used as the basis for selecting seed points. i and one of its associated triangles T j The cosine value between the normal vectors, that is, the normal vector cosine Av(T i,j ) can quantify the angle between adjacent normal vectors:
[0096] Av(T i,j )=cos(f(T i ),f(T j ))
[0097] Triangle patch T i The expected normal vectors of all its related triangles are E(T i ):
[0098]
[0099] Triangle patch T i The variance of the normal vectors of all its related triangles D(T i ):
[0100]
[0101] Among them, f(T i ) is a triangle patch T i Normal vector of triangle T j is a triangle patch T i The relevant triangles of k are triangles T i The number of related triangles.
[0102] After the improved region growing segmentation, there will be some clusters with small areas composed of a few triangular facets. Such clusters will lead to too many scanning viewpoints, reduce scanning efficiency, and affect the quality of scanning. Therefore, it is necessary to optimize the segmentation results. For the triangular facet clusters with an area smaller than the set threshold, they will be merged into the cluster adjacent to it with the smallest average normal vector angle. Among the optimized merged triangular facet clusters, some facet clusters with scanning interference are eliminated, and the results of regional division of the STL model of a three-dimensional stone carving workpiece are shown as follows. Figure 2 shown.
[0103] The specific implementation of S102 is as follows.
[0104] Each divided triangular face cluster is discretized into a three-dimensional point cloud model using existing graphics processing software.
[0105] The specific implementation of S103 is as follows.
[0106] For each triangular face cluster point cloud model, according to the spatial point P of the point cloud model m (x m ,y m ,z m ) calculates the mean μ(x,y,z) and uses it as the center of the OBB bounding box as follows:
[0107]
[0108] Among them, μ x represents the mean of the x-axis; μ y Indicates the mean of the y-axis; μ z represents the mean of the z-axis; P m1 Represents a spatial point P m x m ;P m2 Represents a spatial point P m of y m ;P m3 Represents a spatial point Pm z m ; n represents the total number of spatial points of the point cloud model; m represents the mth spatial point;
[0109] Then, the covariance is calculated from the mean μ, and the covariance is used to measure the degree of linear correlation between two variables. The greater the covariance, the closer the two variables are connected, that is, the greater the linear relationship.
[0110]
[0111] where i, j = 1, 2, 3; u1 = μ x , u2 = μ y , u3 = μ z ; c i = {c1, c2, c3}, c1 represents the x component, c2 represents the y component, and c3 represents the z component.
[0112] According to the covariance, the covariance matrix C can be obtained:
[0113]
[0114] The eigenvalues and corresponding eigenvectors can be solved by the covariance matrix. Since the covariance matrix is a symmetric matrix, its three eigenvectors are mutually orthogonal, and only need to be unitized to be the three main directions of the OBB bounding box local coordinate system. Finally, project all the vertices of the model onto the three main directions, and find the maximum and minimum values to determine the size of the OBB bounding box.
[0115] The specific implementation of S104 is as follows.
[0116] According to the length and width of the maximum intermediate plane of the OBB bounding box and the size of the field of view of the scanner in a single scan, four scanning situations can be divided, as shown in Figure 3 .
[0117] The first situation is that when the length and width of the maximum intermediate plane of the OBB bounding box of the hole boundary are less than the length and width of the single scan of the scanner, only one scan is needed to scan the whole hole region. Therefore, only one scanning viewpoint needs to be planned, as shown in Figure 4 (a). The calculation of the scanning viewpoint is as follows:
[0118]
[0119]
[0120] where, is the unit vector of the Z' axis of the O'-X'Y'Z' coordinate system, is a rotation matrix of O'-X'Y'Z' relative to O-XYZ, O'-X'Y'Z' is a coordinate system of the center of the OBB bounding box, O-XYZ is a workpiece coordinate system, O O-XYZ is a coordinate of the center point O' of the OBB bounding box under O-XYZ, the above parameters can be obtained when the OBB bounding box is calculated, and vp O'-X'Y'Z' (0, 0, d) is a position coordinate of the viewpoint VP under the O'-X'Y'Z' coordinate system, and d is a scanning distance.
[0121] In the second case, when the length of the maximum intermediate plane of the OBB bounding box of the hole boundary is less than the length of a single scanning of the scanner, and the width is greater than the width of a single scanning of the scanner, the hole region can be scanned by only moving the scanner horizontally. Therefore, only two scanning viewpoints VP1 and VP2 need to be planned, as shown in Fig. 3 (b). The scanning directions Figure 4 and the coordinate values vp'(x', y', z') under the O'-X'Y'Z' coordinate system are as follows:
[0122]
[0123]
[0124] wherein w is a single scanning width, d is a scanning distance, (x A , y A , 0) is a coordinate value of the vertex A of the maximum intermediate plane under the O'-X'Y'Z' coordinate system; represents a scanning direction of the viewpoint VP1; represents a scanning direction of the viewpoint VP2; represents a unit vector opposite to the direction of the coordinate axis Z'; x'1 represents an x value of the scanning viewpoint VP1 under the O'-X'Y'Z' coordinate system; y'1 represents a y value of the scanning viewpoint VP1 under the O'-X'Y'Z' coordinate system; z'1 represents a z value of the scanning viewpoint VP1 under the O'-X'Y'Z' coordinate system; x'2 represents an x value of the scanning viewpoint VP2 under the O'-X'Y'Z' coordinate system; y'2 represents a y value of the scanning viewpoint VP2 under the O'-X'Y'Z' coordinate system; and z'2 represents a z value of the scanning viewpoint VP2 under the O'-X'Y'Z' coordinate system.
[0125] After the coordinate value of the viewpoint under the O'-X'Y'Z' coordinate system is obtained, the scanning viewpoint VP i under the Q-XYZ coordinate system can be obtained. i (x i , y i , z i ).
[0126]
[0127] In the third case, when the maximum middle plane of the OBB bounding box of the hole boundary is longer than the length of the scanner's single scan and smaller than the width of the scanner's single scan, the entire hole area can be scanned by moving the scanner vertically. In this case, only two scanning viewpoints VP1 and VP2 need to be planned, as shown in the following example: Figure 4 (c) As shown. Its scanning direction And the coordinate value vp'(x',y',z') in the O'-X'Y'Z' coordinate system:
[0128]
[0129]
[0130] Among them, l is the length of a single scan. Similarly, the value of the scanning viewpoint under Q-XYZ can be obtained according to the above spatial transformation.
[0131] In the fourth case, when the length and width of a single scan by the scanner are smaller than the length and width of the maximum middle plane of the OBB bounding box, multiple scanning viewpoints need to be planned, such as Figure 4 (d) shown.
[0132] First determine the total number of scanning viewpoints n:
[0133]
[0134] Where b is the width of the maximum middle plane, and w is the single scan width of the scanner. Based on the determined number of scanning viewpoints n, the scanning spacing c can be obtained:
[0135]
[0136] In the O'-X'Y'Z' coordinate system, the sampling point P on its maximum midplane i (x i P ,y i P ,z i P )'s coordinates:
[0137]
[0138]
[0139] At the sampling point P i (x i P ,y i P ,z i P) can be used to calculate the scanning viewpoint Scan direction and the position coordinate vp in the O'-X'Y'Z' coordinate system i '(x i ',y i ',z i '):
[0140]
[0141]
[0142] Finally, the value of the scanning viewpoint under Q-XYZ can be obtained according to the above spatial transformation.
[0143] The above method is used to plan the scanning viewpoints of the point cloud model of each facet cluster for a certain three-dimensional stone sculpture workpiece, where the scanning viewpoint results calculated by facet cluster 3 and facet cluster 4 are as follows: Figure 5 (a) and 5(b).
[0144] The specific implementation of S105 is as follows.
[0145] The robot arm is restricted to a single side of a three-dimensional stone carving workpiece for mobile scanning. The workpiece is rotated by three turntables, each rotation is 90 degrees, to achieve a full picture scan of the cut workpiece. In order to improve the efficiency of scanning, a genetic algorithm is used to optimize the path of the center point O' surrounded by multiple OBBs in each scan to calculate the optimal scanning path. The optimal scanning path calculated for a certain three-dimensional stone carving workpiece is as follows Figure 6 shown.
[0146] The specific implementation of S106 is as follows.
[0147] The generated scanning path is imported into the CAM software. Through virtual simulation, the scanning path is checked for collisions. The viewpoints with collisions are optimized and the scanning direction is adjusted until no collision occurs. Finally, the safe and collision-free scanning path is compiled to generate an executable program for the robot arm to realize the automated measurement of 3D stone carving workpieces. The actual scanning results of a 3D stone carving workpiece are as follows: Figure 7 shown.
[0148] See also Figure 8 According to another aspect of the present invention, a robot scanning viewpoint planning system for measuring stone carving cutting workpieces is provided in this embodiment, comprising:
[0149] A region division module 801 is used to divide the surface of the STL model of the three-dimensional stone carving workpiece into regions using an improved region growing algorithm to obtain triangular facet clusters;
[0150] The point cloud model acquisition module 802 is configured to discretize each triangular facet cluster after the division into a three-dimensional point cloud to obtain a point cloud model;
[0151] The bounding box size acquisition module 803 is configured to perform OBB bounding box calculation on each point cloud model to obtain the size of the OBB bounding box.
[0152] The position coordinate acquisition module 804 is configured to divide four scanning conditions according to the maximum intermediate plane size of the OBB bounding box and the field of view size of a single scanning of the scanner, respectively plan scanning viewpoints for each scanning condition, and obtain the position coordinates of the scanning viewpoints in the workpiece coordinate system.
[0153] The scanning path generation module 805 is configured to limit the mechanical arm to move on a single side of the three-dimensional stone sculpture cutting workpiece, rotate the workpiece by three times of the rotating table, rotate 90° each time, and generate a full-view scanning path for cutting the workpiece.
[0154] The workpiece scanning module 806 is configured to import the generated scanning path into CAM software, generate a mechanical arm executable program, and perform actual scanning.
[0155] The specific implementation of the robot scanning viewpoint planning system for stone sculpture cutting workpiece measurement in the embodiment is the same as the robot scanning viewpoint planning method for stone sculpture cutting workpiece measurement, and the embodiment will not be repeated.
[0156] The above is only a specific embodiment of the present application, but the design concept of the present application is not limited to this. Any non-essential modification of the present application using this concept shall be deemed to be an infringement of the protection scope of the present application.
Claims
1. A robot scanning viewpoint planning method for measuring stone carving cutting workpieces, characterized in that: include: S101, using an improved region growing algorithm to divide the surface of the STL model of the three-dimensional stone carving workpiece into regions to obtain triangular facet clusters; S102, discretizing each divided triangular face cluster into a three-dimensional point cloud to obtain a point cloud model; S103, performing OBB bounding box calculation on each point cloud model to obtain the size of the OBB bounding box; S104, dividing the scanning conditions into four types according to the maximum middle plane size of the OBB bounding box and the field of view size of a single scan of the scanner, performing scanning viewpoint planning for each scanning condition, and obtaining the position coordinates of each scanning viewpoint in the workpiece coordinate system; S105, limiting the robot arm to a single side of the three-dimensional stone carving workpiece for mobile scanning, and rotating the workpiece three times by the turntable, each rotation of 90 degrees, to generate a full-view scanning path of the cut workpiece; S106, importing the generated scanning path into the CAM software to generate a robotic arm executable program for actual scanning; The S101 specifically includes: Read each facet T of the STL triangular facet model of the 3D stone carving workpiece i = (p1, p2, p3) three vertex coordinates and normal vector n i , and find all triangles T i Related triangles T of triangles that share one or two vertices j ; An improved region growing algorithm is used to divide the surface of the STL model of the three-dimensional stone carving workpiece into regions to obtain triangular facet clusters. Among them, the triangle patch T i and one of its associated triangles T j The cosine value Av(T i,j ), which is expressed as follows: Off(T i,j )=cos(f(T i ),f(T j )) Among them, f(T i ) represents the triangle patch T i Normal vector of f(T j ) represents the triangle patch T j The normal vector of Triangle patch T i The expected normal vectors of all its related triangles are E(T i ), which is expressed as follows: Triangle patch T i The variance of the normal vectors of all its related triangles D(T i ), which is expressed as follows: Where k is the triangle T i The number of relevant triangles; The S103 specifically includes: For each triangular face cluster point cloud model, according to the spatial point P of the point cloud model m (x m ,y m ,z m ) calculates the mean μ(x,y,z) and uses it as the center of the OBB bounding box as follows: Among them, μ x represents the mean of the x-axis; μ y Indicates the mean of the y-axis; μ z represents the mean of the z-axis; P m1 Represents a spatial point P m x m ;P m2 Represents a spatial point P m of y m ;P m3 Represents a spatial point P m z m ; n represents the total number of spatial points in the point cloud model; m represents the mth spatial point; Calculate the covariance cov(c i ,c j ),as follows: Where i, j = 1, 2, 3; u1 = μ x ,u2=μ y ,u3=μ z ;c i ={c1,c2,c3}, c1 represents the x component, c2 represents the y component, and c3 represents the z component; According to the covariance, the covariance matrix C can be obtained as follows: The eigenvalues and corresponding eigenvectors can be solved through the covariance matrix. Since the covariance matrix is a symmetric matrix, its three eigenvectors are mutually orthogonal. After normalization, they become the three main directions of the local coordinate system of the OBB bounding box. Project all vertices of the model to the three main directions, find their maximum and minimum values, and determine the size of the OBB bounding box.
2. The robot scanning viewpoint planning method for stone carving cutting workpiece measurement according to claim 1 is characterized in that: In S101, after the improved region growing algorithm is used to divide the surface of the STL model of the three-dimensional stone carving workpiece into regions to obtain triangular facet clusters, the method further includes: The divided face clusters are optimized, and the triangular face clusters with an area smaller than the set threshold are merged into the adjacent cluster with the smallest average normal vector angle. Among the optimized and merged triangular face clusters, the face clusters with scanning interference are eliminated.
3. The robot scanning viewpoint planning method for stone carving cutting workpiece measurement according to claim 1 is characterized in that: The S104 specifically includes: According to the length and width of the maximum middle plane of the OBB bounding box and the field of view of the scanner in a single scan, it is divided into four scanning situations, as follows: (1) The length and width of the maximum middle plane of the OBB bounding box of the hole boundary are smaller than the length and width of the scanner's single scan. The entire hole area can be scanned in one scan. The calculation of is as follows: in, is the unit vector of the Z' axis of the O'-X'Y'Z' coordinate system, is the rotation matrix of O'-X'Y'Z' relative to the O-XYZ coordinate system, O'-X'Y'Z' is the center coordinate system of the OBB bounding box, O-XYZ is the workpiece coordinate system, O' O-XYZ is the coordinate of the center point O' of the OBB bounding box under O-XYZ. The above parameters can be obtained when calculating the OBB bounding box. O'-X'Y'Z' (0,0,d) is the position coordinate of the viewpoint VP in the O'-X'Y'Z' coordinate system, and d is the scanning distance; (2) The maximum middle plane of the OBB bounding box of the hole boundary is shorter than the length of the scanner's single scan, and its width is longer than the width of the scanner's single scan. Horizontal movement is required to scan the entire hole area. Specifically, two scanning viewpoints VP1 and VP2 need to be planned, and their scanning directions are The calculation of the coordinate value vp'(x',y',z') in the O'-X'Y'Z' coordinate system is as follows: Among them, w is the single scan width, d is the scanning distance, (x A ,y A ,0) is the coordinate value of the vertex A of the maximum middle plane in the O'-X'Y'Z' coordinate system; Indicates the scanning direction of viewpoint VP1; Indicates the scanning direction of viewpoint VP2; Represents a unit vector in the opposite direction to the coordinate axis Z'; x'1 represents the x value of the scanning viewpoint VP1 in the O'-X'Y'Z' coordinate system; y'1 represents the y value of the scanning viewpoint VP1 in the O'-X'Y'Z' coordinate system; z'1 represents the z value of the scanning viewpoint VP1 in the O'-X'Y'Z' coordinate system; x'2 represents the x value of the scanning viewpoint VP2 in the O'-X'Y'Z' coordinate system; y'2 represents the y value of the scanning viewpoint VP2 in the O'-X'Y'Z' coordinate system; z'2 represents the z value of the scanning viewpoint VP2 in the O'-X'Y'Z' coordinate system; After obtaining the coordinate value of the viewpoint in the O'-X'Y'Z' coordinate system, the scanning viewpoint VP is obtained. i Position coordinate vp in the Q-XYZ coordinate system i (x i ,y i ,z i ): (3) The maximum middle plane of the OBB bounding box of the hole boundary is longer than the length of the scanner's single scan, and its width is smaller than the width of the scanner's single scan. It is necessary to move the scan vertically to scan the entire hole area. Specifically, two scanning viewpoints VP1 and VP2 need to be planned, and their scanning directions are The calculation of the coordinate value vp'(x',y',z') in the O'-X'Y'Z' coordinate system is as follows: Where l is the length of a single scan. The value of the scanning viewpoint under Q-XYZ can be obtained according to the spatial transformation; (4) When the length and width of a single scan by the scanner are smaller than the length and width of the maximum middle plane of the OBB bounding box, multiple scanning viewpoints need to be planned as follows: Determine the total number of scanning viewpoints N: Where b is the width of the maximum middle plane, w is the single scan width of the scanner; according to the determined number of scanning viewpoints N, the scanning spacing c is obtained: In the O'-X'Y'Z' coordinate system, the sampling point P on its maximum midplane i (x i P ,y i P ,z i P )'s coordinates: At the sampling point P i (x i P ,y i P ,z i P ), calculate the scanning viewpoint Scan direction and position coordinates vp' in the O'-X'Y'Z' coordinate system i (x' i ,y' i ,z' i ): The value of the scanning viewpoint under Q-XYZ is obtained according to the spatial transformation.
4. The robot scanning viewpoint planning method for stone carving cutting workpiece measurement according to claim 1 is characterized in that: The S105 specifically includes: A genetic algorithm is used to optimize the path of the center point O' surrounded by multiple OBBs in each scan and calculate the optimal scanning path.
5. The robot scanning viewpoint planning method for stone carving cutting workpiece measurement according to claim 1 is characterized in that: The S106 specifically includes: The generated scanning path is imported into the CAM software, and virtual simulation is used to detect whether there are collisions in the scanning path. The viewpoints with collisions are optimized and the scanning direction is adjusted until no collision occurs. Finally, the safe and collision-free scanning path is compiled to generate an executable program for the robotic arm, realizing the automated measurement of 3D stone carving workpieces.
6. A robot scanning viewpoint planning system for measuring stone carving cutting workpieces, characterized in that: Based on the robot scanning viewpoint planning method for stone carving cutting workpiece measurement according to any one of claims 1 to 5, the system includes: The region division module is used to divide the surface of the STL model of the three-dimensional stone carving workpiece into regions using an improved region growing algorithm to obtain triangular facet clusters; The point cloud model acquisition module is used to discretize each divided triangular face cluster into a three-dimensional point cloud to obtain a point cloud model; The bounding box size acquisition module is used to obtain the OBB bounding box of each point cloud model and obtain the size of the OBB bounding box; The position coordinate acquisition module is used to divide the scanning conditions into four types according to the maximum middle plane size of the OBB bounding box and the field of view size of a single scan of the scanner, plan the scanning viewpoints for each scanning condition, and obtain the position coordinates of each scanning viewpoint in the workpiece coordinate system; The scanning path generation module is used to restrict the robot arm to a single side of the 3D stone carving workpiece for mobile scanning. The workpiece is rotated by three turntables, each rotating 90 degrees, to generate a full-view scanning path for the cut workpiece. The workpiece scanning module is used to import the generated scanning path into the CAM software, generate the robot arm executable program, and perform actual scanning.