Automated laser 3D scanning trajectory planning method
By automatically planning the laser 3D scanning trajectory and using triangle discretization and projection data, the problem of low detection accuracy of structured light 3D scanners on metal surfaces and low efficiency of manual hand-holding of laser 3D scanners is solved, achieving efficient and accurate detection of complex curved surfaces.
Patent Information
- Application Number
- CN202211031066.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-08-26
AI Technical Summary
In the existing technology, structured light 3D scanners cause poor raster image quality, low accuracy, and insufficient flexibility due to specular reflection when detecting metal parts, while laser 3D scanners rely on manual hand-holding, resulting in operator fatigue, high costs, and low detection efficiency. , and trajectory planning is complex and cumbersome, requiring automated solutions.
By discretizing the surface to be measured into triangles, inserting new vertices, constructing a total vertex set, and planning the scanning path based on the scanning reference plane projection data, the robot is used to realize automated laser three-dimensional scanning and reduce the complexity of trajectory planning.
It achieves efficient and accurate detection of complex curved surface parts, reduces dependence on operator experience, improves automated scanning efficiency, and obtains high-quality surface point cloud data.
Smart Images

Figure CN115325962B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional scanning, and in particular to a planning method for an automated laser three-dimensional scanning trajectory. Background Art
[0002] As an emerging visual inspection instrument, the 3D scanner can detect the surface of parts using laser or structured light, obtain the surface point cloud of parts through image data solution, and then compare it with the 3D digital model of the parts to complete the full-size tolerance inspection of the parts. Among them, the 3D scanner using structured light is also called a photographic 3D scanner. During measurement, the scanner is fixed, and grating stripes with coded information are projected from the projection device to the inspected parts. The camera captures the image to decode and calculate the phase of the grating stripes to obtain the point cloud of the local surface of the part. Through multiple shots from multiple angles, the local surfaces of the parts are spliced to obtain the surface point cloud of the entire part. During the scanning process of the photographic scanner, experienced operators are relied on to judge the placement angle and position of the scanner. In many cases, repeated adjustments and attempts to splice are required, and the flexibility is poor. In addition, when the structured light is irradiated to the metal surface, mirror reflection will occur, which makes the grating image quality obtained by the scanner poor, resulting in low scanning data accuracy, or even no data can be scanned. Metal parts account for the majority of industrial inspection fields. Therefore, the photographic 3D scanner has certain limitations in the field of industrial inspection.
[0003] Laser 3D scanners can avoid the reflection of metal surfaces to the greatest extent and obtain high-precision measurement results; and the scanning speed is fast, usually reaching dozens of frames per second, with high real-time performance; at the same time, the body itself is small and less restricted by the use environment, and can scan almost any complex irregular surface, with high flexibility. However, since laser 3D scanners usually rely on manual hand-held scanning, when conducting large-scale parts inspection, the labor cost will increase significantly, and the operator will be fatigued after long-term hand-held scanning, and the inspection efficiency will be greatly reduced, increasing the possibility of errors; when introducing robots to cooperate with scanners to achieve automated inspection, it can solve problems such as personnel fatigue and errors and improve inspection efficiency. However, the use of automated inspection requires planning the scanning trajectory in advance, and experienced operators perform manual trajectory planning according to the characteristics of the parts to be tested. The process of manual trajectory planning is complicated and cumbersome, and it is necessary to make multiple trial and error improvements based on the actual scanning effect to continuously approach the optimal trajectory. Therefore, a trajectory planning method is needed to avoid dependence on operator experience and reduce the complexity of trajectory planning. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method for planning an automated three-dimensional laser scanning trajectory to solve the defects of the prior art.
[0005] To achieve the above object, the present invention provides a method for planning an automated three-dimensional laser scanning trajectory, comprising the following steps:
[0006] S1. According to the three-dimensional digital model of the object to be scanned, each surface to be measured of the object to be scanned is discretized into triangles, the vertex coordinates of each triangle are obtained, a new vertex is inserted into the plane of the triangle, the coordinates of the new vertex are obtained, the normal vector of the triangle and the normal vector of the new vertex are calculated, and a total vertex set is constructed;
[0007] S2, establishing at least one scanning reference plane, projecting the vertices in the total vertex set onto the corresponding scanning reference planes, respectively constructing vertex sets corresponding to the respective scanning reference planes, and acquiring projection data of the corresponding scanning reference planes according to the respective vertex sets;
[0008] S3. Planning scanning paths of various scanning reference planes according to the projection data and the effective scanning range of the scanner used.
[0009] Furthermore, the step S1 specifically includes:
[0010] S101, discretizing the surface of the object to be scanned into triangles according to the three-dimensional digital model of the object to be scanned, constructing an initial vertex coordinate list composed of vertex coordinates of all triangles, and constructing a vertex coordinate index list corresponding to the vertex coordinates constituting each triangle;
[0011] S102, calculating the normal vector of the plane where each triangle is located, and superimposing the calculated normal vector of the plane on the normal vector of each vertex of the corresponding triangle to construct an initial vertex normal vector list corresponding to the initial vertex coordinate list;
[0012] S103. Insert a new vertex in the plane where each triangle is located, obtain the coordinates of the new vertex, and calculate the normal vector of the new vertex. Add the new vertex coordinates and the normal vector of the new vertex to the initial vertex coordinate list and the initial vertex normal vector list respectively, construct a total vertex coordinate list and a total vertex normal vector list to form a total vertex set.
[0013] Furthermore, the new vertex inserted in step S103 meets the following requirements:
[0014] The normal vector of the inserted new vertex is equal to the normal vector of the triangle plane.
[0015] Furthermore, in step S103, the method of inserting the new vertex is a triangle subdivision method, specifically:
[0016] Calculate the projected area of each triangle on three coordinate planes of the spatial rectangular coordinate system, select the projected triangle with the largest projected area, and construct a projected circumscribed rectangle of the projected triangle, wherein each side of the projected circumscribed rectangle is parallel to the coordinate axis;
[0017] Insert plane points at equal intervals at a preset density within the projection circumscribed rectangle, calculate three vectors from the plane point to the three vertices of the projection triangle, and perform cross multiplication of the three vectors in sequence to obtain three perpendicular vectors. If the directions of the three perpendicular vectors are consistent, retain the plane point; if they are inconsistent, delete the plane point;
[0018] A spatial straight line is established through the retained plane points and perpendicular to the coordinate plane where the projected triangle is located, and the intersection point of the spatial straight line and the plane where the triangle corresponding to the projected triangle is located is calculated, and the intersection point is the inserted new vertex.
[0019] Furthermore, the step S2 specifically includes:
[0020] S201, selecting any normal vector in the total vertex normal vector list as a reference vertex normal vector, and the corresponding vertex coordinates in the total vertex coordinate list as the reference vertex coordinates;
[0021] S202, using the reference vertex normal vector as a plane normal vector, and establishing a scanning reference plane along the direction of the reference vertex normal vector at a position where the distance from the reference vertex coordinates is a scanning reference distance;
[0022] S203, selecting corresponding vertex coordinates in the total vertex coordinate list according to preset conditions to form an extracted vertex set;
[0023] S204, projecting the vertices in the extracted vertex set to the scanning reference plane, calculating the projection point coordinates of all vertices in the vertex set on the scanning reference plane, and obtaining the projection circumscribed rectangle projected to the scanning reference plane;
[0024] S205 , repeating the above steps S202 - S204 until the total vertex normal vector list is empty, obtaining all scanning reference planes and the extracted vertex sets projected to each scanning reference plane and the projected circumscribed rectangle.
[0025] Furthermore, the step S204 further includes the following steps:
[0026] S204-1, calculating the distance between each vertex in the extracted vertex set and the scanning reference plane, and combining the projection point coordinates to obtain spatial distribution information of the extracted vertex set on the scanning reference plane;
[0027] S204-2, judging, based on the spatial distribution information, whether there are blocked vertices and blocked vertices whose projections overlap in the scanning reference plane;
[0028] If it exists, the average normal vector and average coordinate of the obscured vertex are calculated, and the obscured vertex is removed from the extracted vertex set and put back into the total vertex set; the average normal vector of the obscured vertex is deflected by a preset angle, and the deflected average normal vector is used as a new reference vertex normal vector, and the average coordinates are new reference vertex coordinates;
[0029] If the blocked vertex does not exist, according to preset conditions, a vertex normal vector is selected from the remaining normal vectors in the total vertex normal vector list as a new reference vertex normal vector, and the corresponding vertex coordinates in the total vertex coordinate list are new reference vertex coordinates.
[0030] Furthermore, the step S3 specifically includes:
[0031] S301, comparing the size of the projection circumscribed rectangle in the scanning reference plane with the effective scanning range of the scanner;
[0032] S302,
[0033] Among them, in the scanner coordinate system, the effective scanning range is a rectangle with a side length of A along the X-axis direction and a side length of B along the Y-axis direction, and the short side length of the projected circumscribed rectangle is S, and the long side length is L;
[0034] If S<B, the starting point of the scanning path is the midpoint of the first short side of the projection circumscribed rectangle, the end point of the scanning path is the midpoint of the second short side, the scanning path is a straight line path from the starting point to the end point, and the scanning path based on the scanning reference plane is obtained; wherein, the points intersecting with each short side during the movement are scanning path points;
[0035] If S≥B, the starting point of the scanning path is: the first vertex where the first long side and the first short side of the projected circumscribed rectangle intersect, and the scanning path is: moving along the first long side to the second vertex where the second short side and the first long side intersect, after moving to the second vertex, moving along the direction of the second short side by a set distance to a point on the second short side, and then moving along the direction parallel to the first long side by a set distance to a point on the first short side, and so on, until the second long side is covered by the effective scanning range and ends, and the scanning path based on the scanning reference plane is obtained; wherein, the points intersecting with each short side during the movement are scanning path points;
[0036] S303, repeating the above steps S301-S302 until a scanning path based on all scanning reference planes is obtained.
[0037] Furthermore, before step S303, the following pre-steps are also included:
[0038] S303-01, judging whether there are points beyond the scanning path according to the spatial distribution information;
[0039] S303-02, if it does not exist, directly execute step S303;
[0040] If it exists, obtain the excess point set that exceeds the scanning path, construct the projected circumscribed rectangle of the excess point set on the scanning reference plane, calculate the average distance from each vertex in the excess point set to the scanning reference plane, move the projected circumscribed rectangle of the excess point set perpendicular to the scanning reference plane, and the moving distance is the average distance from each vertex in the excess point set to the scanning reference plane minus the reference distance of the scanner. For the projected circumscribed rectangle of the moved excess point set, execute the above steps S301-S302 to obtain the supplementary scanning path of the scanning reference plane.
[0041] Furthermore, the step S3 further includes the following steps:
[0042] S304. Calculate the coordinates of the corner points of the projected circumscribed rectangle within the remaining scanning reference planes, calculate the distance from the coordinates of the corner points to the end point of the scanning path of the first scanning reference plane, select the scanning reference plane where the nearest corner point is located, and repeat the above steps S301-S302 until the final scanning path based on all scanning reference planes is planned, thereby obtaining the scanning path of all surfaces to be measured of the scanned object to be planned.
[0043] Furthermore, the step S3 further includes the following steps:
[0044] S305, calculating the scanning posture according to the scanning reference plane where each scanning path point is located, transforming the scanning path point and the corresponding scanning posture into a coordinate system, and solving them into waypoints to complete the trajectory planning of the automated three-dimensional scanning.
[0045] The automatic laser 3D scanning trajectory planning method provided by the present invention completes the scanning trajectory planning according to the 3D digital model of the scanned object and the parameter characteristics of the laser 3D scanner. In practical applications, the planning method provided by the present invention can guide the robot to drive the scanner to automatically scan and obtain the surface point cloud data of the scanned object; it solves the problem of the scanning trajectory planning in automated detection relying on the operator's experience, reduces the difficulty of manual trajectory planning, can quickly obtain the optimal trajectory, further improves the efficiency of automated scanning, effectively obtains the surface point cloud data of parts, and efficiently completes the large-scale detection of complex curved surface parts. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flowchart of a method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention;
[0047] Figure 2 It is a schematic diagram of the overall process of the method for planning the automated three-dimensional laser scanning trajectory according to an embodiment of the present invention;
[0048] Figure 3 It is a first schematic diagram of the scanning range of the scanner of the method for planning the automated laser three-dimensional scanning trajectory according to an embodiment of the present invention;
[0049] Figure 4 is a second schematic diagram of the scanning range of the scanner in the method for planning the automated laser three-dimensional scanning trajectory according to an embodiment of the present invention;
[0050] Figure 5 It is a flowchart of step 2 in the method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention;
[0051] Figure 6 is a first schematic diagram of a scanning path of the method for planning an automated laser three-dimensional scanning trajectory according to an embodiment of the present invention;
[0052] Figure 7 It is a second schematic diagram of the scanning path of the method for planning the automated laser three-dimensional scanning trajectory according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following is a further detailed description of the embodiments of the present invention in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] Figure 1 A schematic diagram showing a flow chart of a method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention; Figure 2 The overall process diagram of the method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention is shown; Figure 3 A first schematic diagram showing the scanning range of a scanner in the method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention; Figure 4 A second schematic diagram showing the scanning range of the scanner of the method for planning the automated three-dimensional laser scanning trajectory according to an embodiment of the present invention; Figure 5 A schematic flow chart of step S2 of the method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention is shown; Figure 6 A first schematic diagram showing a scanning path of the method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention; Figure 7A second schematic diagram of the scanning path of the method for planning an automated three-dimensional laser scanning trajectory according to an embodiment of the present invention is shown.
[0055] The embodiment of the present invention provides a method for planning an automated three-dimensional laser scanning trajectory, such as Figure 1 and 2 As shown, the following steps are included:
[0056] S1. According to the three-dimensional digital model of the object to be scanned, each surface to be measured of the object to be scanned is discretized into triangles, the vertex coordinates of each triangle are obtained, a new vertex is inserted into the plane of the triangle, the coordinates of the new vertex are obtained, the normal vector of the triangle and the normal vector of the new vertex are calculated, and a total vertex set consisting of the normal vector of the triangle and the normal vector of the new vertex is constructed. In the embodiment of the present invention, the Delaunay triangulation method is used to discretize each surface to be measured into triangles, that is, each surface to be measured of the object to be scanned is discretized into a point cloud, so other triangulation methods in the prior art can also be used to discretize each surface to be measured.
[0057] S2. Establish at least one scanning reference plane. The number of scanning reference planes established in the embodiment of the present invention depends on the specific situation of the object to be scanned, so the embodiment of the present invention does not limit this and can be determined according to the specific situation of the object to be scanned in actual situations. Project the vertices in the total vertex set onto the corresponding scanning reference planes, respectively construct the vertex sets corresponding to the scanning reference planes, and obtain the corresponding projection data of the scanning reference planes according to the vertex sets.
[0058] S3. Planning scanning paths of various scanning reference planes according to the projection data and the effective scanning range of the scanner used.
[0059] In the embodiment of the present invention, a robot clamps a laser 3D scanner to form an automated 3D scanning device, and the object to be scanned is placed on a scanning fixture, and the scanning fixture and the robot are relatively fixed. The effective scanning range of the laser 3D scanner is obtained by scanning the field of view, scanning depth of field, scanning reference distance, laser line length, number of laser lines, and laser line spacing of the laser 3D scanner. The specific parameters of the scanner are subject to actual use. The present invention does not limit this, and only gives an example to illustrate the embodiment of the present invention in detail.
[0060] The laser line length of the scanner used in the embodiment of the present invention is J, the laser line spacing is K, the size of J and K varies linearly with the distance from the scanner within the depth of field of the scanner, the number of laser lines is N, and N is greater than 0. Figure 3 As shown, it is a set of laser lines parallel to the Y-axis of the scanner rectangular coordinate system. Figure 2The number of laser lines in is only for illustration and is not limited by this number in the specific implementation. Then the laser line distribution range is E = (N-1) * K, F = J, where E is along the X-axis direction of the scanner rectangular coordinate system and F is along the Y-axis direction of the scanner rectangular coordinate system. Figure 4 As shown, there is a set of intersecting laser lines with an angle θ with the Y axis. Figure 3 The number of laser lines and angles in the figure are for illustration only, and the specific implementation is not limited thereto. The laser line distribution range is E = (N-1) * K / cosθ, F = J * cosθ, where E is along the X-axis direction of the scanner rectangular coordinate system, and F is along the Y-axis direction of the scanner rectangular coordinate system. The intersection of the field of view range and the laser line distribution range is the effective scanning range, which is A along the X-axis direction of the scanner rectangular coordinate system and B along the Y-axis direction. Combined with the depth of field distribution, it constitutes an effective scanning space. When the number of laser lines N = 1, the effective scanning space degenerates into an effective scanning plane.
[0061] To facilitate detailed description of the embodiments of the present invention, a rectangular coordinate system O-XYZ of the scanner is established, with the midpoint of the line connecting the centers of the two lenses of the scanner as the origin O of the coordinate system, the X-axis parallel to the line connecting the centers of the two lenses and pointing to the second lens, the Z-axis perpendicular to the line connecting the centers of the two lenses and pointing outward in the irradiation direction of the scanner, and the Y-axis is established in accordance with the right-hand rule.
[0062] The embodiment of the present invention provides a method for planning an automated three-dimensional laser scanning trajectory, such as Figure 4 As shown, the following steps are included:
[0063] S101. Based on the three-dimensional digital model of the object to be scanned, the surface to be scanned is divided into triangles using the Delaunay triangulation method, and an initial vertex coordinate list consisting of the vertex coordinates of all triangles is constructed, and a vertex coordinate index list corresponding to the vertex coordinates of each triangle is constructed. The discretized vertex spacing depends on the resolution of the scanner, which is usually smaller than the scanning resolution, that is, the larger the scanning resolution setting, that is, the larger the vertex spacing, the less details of the surface to be measured.
[0064] S102. According to the vertex index list, determine the vertex coordinates that constitute each triangle from the initial vertex coordinate list, calculate the normal vector of the plane where each triangle is located, superimpose the calculated normal vector of the plane on the normal vector of each vertex of the corresponding triangle, and construct an initial vertex normal vector list corresponding to the initial vertex coordinate list.
[0065] S103, inserting new vertices in the plane where each triangle is located at a spacing smaller than the scanner resolution, and the normal vectors of the inserted new vertices are equal to the normal vectors of the triangle plane. Calculating the normal vectors of the new vertices, adding the new vertex coordinates and the normal vectors of the new vertex normals to the initial vertex coordinate list and the initial vertex normal vector list, respectively, constructing a total vertex coordinate list and a total vertex normal vector list to form a total vertex set.
[0066] Calculate the projected area of each triangle on the three coordinate planes of the spatial rectangular coordinate system, select the projected triangle with the largest projected area, and construct the projected circumscribed rectangle of the projected triangle, with the sides of the projected circumscribed rectangle parallel to the coordinate axis. Insert plane points at equal intervals in the projected circumscribed rectangle at a preset density, calculate the three vectors from the plane points to the three vertices of the projected triangle, and cross-multiply the three vectors in sequence to obtain three perpendicular vectors. If the directions of the three perpendicular vectors are consistent, the plane point is retained, and if they are inconsistent, the plane point is deleted; establish a spatial straight line through the retained plane points and perpendicular to the coordinate plane where the projected triangle is located, calculate the intersection of the spatial straight line and the plane where the triangle corresponding to the projected triangle is located, and the intersection is the inserted new vertex.
[0067] The technical solution implemented in the present invention inserts new vertices by using the triangulation method, further accurately reduces the vertex spacing, and effectively avoids the adverse effects of the insertion points on the scanning trajectory caused by the methods in the prior art. The surface planning of complex surfaces is more accurate, and the scanning trajectory is further accurate, which can more accurately reflect the details of the surface to be measured.
[0068] In the embodiment of the present invention, the first scanning reference plane is taken as an example for detailed description. The establishment of other scanning reference planes and subsequent processing after the establishment are the same and can be processed in the same way, so the embodiment of the present invention will not be described in detail.
[0069] S201, such as Figure 5 As shown, any normal vector in the total vertex normal vector list is selected as the reference vertex normal vector, and the corresponding vertex coordinates in the total vertex coordinate list are the reference vertex coordinates;
[0070] S202, using the reference vertex normal vector as the plane normal vector, and establishing a first scanning reference plane along the direction of the reference vertex normal vector at a position where the distance from the reference vertex coordinates is the scanning reference distance;
[0071] S203, extract the vertex normal vectors in the total vertex normal vector list whose angle with the normal vector of the first scanning reference plane is less than or equal to 45 degrees, and select the corresponding vertex coordinates in the total vertex coordinate list to form an extracted vertex set. The preset condition for extracting the vertex normal vector from the total vertex normal vector list in the embodiment of the present invention is: the vertex normal vector whose angle with the normal vector of the first scanning reference plane is less than or equal to 45 degrees. According to the preset conditions of the embodiment of the present invention, it can be ensured that the scanning path planned based on two adjacent scanning reference planes will not be omitted during the scanning process, and the planned scanning path covers more completely, that is, there is an overlap between the surfaces to be measured corresponding to the projections in the adjacent scanning reference planes.
[0072] S204 , projecting the vertices in the extracted vertex set to a first scanning reference plane, calculating the projection point coordinates of all vertices in the vertex set on the first scanning reference plane, and obtaining a projection circumscribed rectangle projected onto the first scanning reference plane.
[0073] S204-1. In the calculation step S203, the distance from each vertex in the vertex set to the first scanning reference plane is extracted, and combined with the projection point coordinates, the spatial distribution of the extracted vertex set in the scanning reference plane is obtained.
[0074] S204-2, judging whether there are blocked vertices and blocked vertices whose projections overlap in the scanning reference plane according to the spatial distribution information, that is, whether there are such vertices, the coordinates of the projected points and the surrounding adjacent projected points are less than the preset density, but the distance to the first scanning reference plane is greatly different from the surrounding adjacent projected points.
[0075] If it exists, the average normal vector and average coordinates of the occluded vertices on the occluded surface are calculated, and the occluded vertices are removed from the extracted vertex set and put back to the total vertex set; the average normal vector of the occluded vertex is deflected by 45 degrees, and the deflected average normal vector is used as the new reference vertex normal vector, and the average coordinates are the new reference vertex coordinates. In the embodiment of the present invention, the average normal vector of the occluded vertex is deflected by 45 degrees, which can ensure that the scanning path planned based on two adjacent scanning reference planes will not be missed during the scanning process, and the coverage is more complete, so that the occluded part of the surface to be measured can be projected into the new reference plane.
[0076] If there is no occluded vertex, select a vertex normal vector from the remaining normal vectors in the total vertex normal vector list, which satisfies the angle between the vertex normal vector and the normal vector of the first scanning reference plane and is close to 90 degrees, as the new reference vertex normal vector, and the corresponding vertex coordinates in the total vertex coordinate list are the new reference vertex coordinates.
[0077] In the embodiment of the present invention, the occlusion and occluded points involved are for the convenience of description. The principle is that the points close to the reference plane block the points far away, that is, the points far away from the reference plane are occluded points. In the embodiment of the present invention, the preset condition is: the selected vertex normal vector satisfies the angle of the normal vector of the first scanning reference plane close to 90 degrees, so that the angle of the normal vectors of the two adjacent scanning reference planes can be 90 degrees, so that more complete adjacent surfaces can be covered, so that there will be no omissions during the scanning process, and the scanning trajectory planned by the automatic laser three-dimensional scanning trajectory planning method in the embodiment of the present invention is more complete.
[0078] S205 , repeating the above steps S202 - S204 until the total vertex normal vector list is empty, obtaining all scanning reference planes and the extracted vertex sets projected to each scanning reference plane and the projected circumscribed rectangle.
[0079] In the method for planning an automated three-dimensional laser scanning trajectory in the embodiment of the present invention, step S3 specifically includes:
[0080] In the embodiment of the present invention, the first scanning reference plane is used as an example for detailed description, and the scanning principles of other scanning reference planes are the same, so the embodiment of the present invention will not be repeated. In order to better implement the present invention, the scanning path is planned based on the scanning reference plane based on the projection of the corresponding surface to be measured in each scanning reference plane passing through the effective scanning space, combined with the projection circumscribed rectangle.
[0081] S301 , comparing the sizes of the short side S1 of the projection circumscribed rectangle and the side B of the effective scanning range.
[0082] S302,
[0083] like Figure 6 As shown, the effective scanning space is at the scanning reference distance, and the rectangle along the X-axis direction of the scanner rectangular coordinate system is the A side, and along the Y-axis direction is the B side is the effective scanning range. In the embodiment of the present invention, for the first scanning reference plane, the X-axis of the scanner rectangular coordinate system is parallel to the long side L1 of the projection circumscribed rectangle, and the Y-axis is parallel to the short side S1 of the projection circumscribed rectangle.
[0084] If the short side of the projected circumscribed rectangle is less than B, that is, S1<B, such as Figure 6 As shown, the origin O of the scanner rectangular coordinate system is set at the midpoint Q1 of the first short side of the projection circumscribed rectangle, that is, Q1 is the starting point of the scanning path, and it moves along the long side L1 of the projection circumscribed rectangle to the second short side S2, that is, it moves to Q2 and ends. The first scanning path of the planned scanner moving in the first scanning reference plane is obtained. Q1 and Q2 are scanning path points, and Q2 is the end point of the scanning path.
[0085] If the short side of the projected circumscribed rectangle is greater than or equal to B, that is, S1 ≥ B, such as Figure 7As shown, the origin O of the scanner rectangular coordinate system is set at the first vertex Q1 where the first long side L1 and the first short side S1 of the projection circumscribed rectangle intersect, and Q1 is used as the starting point of the scanning path. Move L1 along the first long side to the second vertex Q2 where the second short side S2 and the first long side intersect. Then move along the second short side S2 to the other long side L2, the distance of which is B / 2, to obtain the scanning path point Q3, that is, the distance of half of the effective scanning range B side of the scanner's effective scanning space at the reference distance. Again, move back to the first short side S1 parallel to the first long side L1 to obtain the scanning path point Q4, and repeat this process until the second long side L2 is covered by the effective scanning range, that is, it ends after passing through the path points Q5 and Q6, and obtains the first scanning path of the scanner moving in the first scanning reference plane. Among them, Q1-Q6 are scanning path points. Q6 is the end point of the scanning path.
[0086] The embodiment of the present invention also provides a preferred solution, which can better supplement the parts that are omitted in steps S301 and S302 due to exceeding the effective scanning space, so that the scanning planning path coverage is more complete, and there will be no omissions in the planning process of the scanning trajectory, so that the scanning trajectory planned by the automated laser three-dimensional scanning method in the embodiment of the present invention is more complete.
[0087] S303-01. Calculate the distance from each vertex in the extracted vertex set to the first scanning reference plane, and then determine by calculation whether there are n point sets that exceed the entire space covered by the effective scanning space along the first scanning path, where n is greater than or equal to 0.
[0088] S303-02: If it does not exist, directly execute step S303.
[0089] If there is, obtain the excess point set that exceeds the scanning path, each of which consists of a group of adjacent points. Construct the projected circumscribed rectangle of the excess point set on the scanning reference plane, calculate the average distance from each vertex in the excess point set to the scanning reference plane, move the projected circumscribed rectangle of the excess point set perpendicular to the scanning reference plane, and move the distance equal to the average distance from each vertex in the excess point set to the scanning reference plane minus the reference distance of the scanner. Execute the above steps S301-S302 for the projected circumscribed rectangle of the moved excess point set to obtain the supplementary scanning path of the scanning reference plane. The first scanning path and the supplementary scanning path together constitute the final scanning path based on the first scanning reference plane.
[0090] S303, repeating the above steps S301-S302 until a scanning path based on all scanning reference planes is obtained.
[0091] The embodiment of the present invention further provides a preferred solution, wherein step S3 further includes the following steps:
[0092] S304. Calculate the coordinates of the corner points of the projected circumscribed rectangle within the remaining scanning reference planes, and calculate the distance from the coordinates of each corner point to the end point of the final scanning path based on the first scanning reference plane, select the scanning reference plane where the nearest corner point is located, and repeat the above steps S301-S302 until all final scanning paths based on various scanning reference planes are planned, thereby obtaining the scanning path of all surfaces to be measured of the scanned object to be planned.
[0093] S305, calculate the scanning posture according to the scanning reference plane where each scanning path point is located, transform the scanning path point and the corresponding scanning posture into a coordinate system, and solve it into a robot waypoint to complete the trajectory planning of the automated 3D scanning. The robot clamps the laser 3D scanner and automatically scans to obtain the surface point cloud of the object to be scanned.
[0094] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0095] Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. Those skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0096] The above specific implementations of the present invention do not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for planning an automated three-dimensional laser scanning trajectory, characterized in that: The following steps are involved: S1. According to the three-dimensional digital model of the object to be scanned, each surface to be measured of the object to be scanned is discretized into triangles, the vertex coordinates of each triangle are obtained, a new vertex is inserted into the plane of the triangle, the coordinates of the new vertex are obtained, the normal vector of the triangle and the normal vector of the new vertex are calculated, and a total vertex set is constructed; S2, establishing at least one scanning reference plane, projecting the vertices in the total vertex set onto the corresponding scanning reference planes, respectively constructing vertex sets corresponding to the respective scanning reference planes, and acquiring projection data of the corresponding scanning reference planes according to the respective vertex sets; S3. Planning scanning paths of various scanning reference planes according to the projection data and the effective scanning range.
2. The method for planning an automated three-dimensional laser scanning trajectory according to claim 1, characterized in that: The step S1 specifically includes: S101, discretizing the surface of the object to be scanned into triangles according to the three-dimensional digital model of the object to be scanned, constructing an initial vertex coordinate list composed of vertex coordinates of all triangles, and constructing a vertex coordinate index list corresponding to the vertex coordinates constituting each triangle; S102, calculating the normal vector of the plane where each triangle is located, and superimposing the calculated normal vector of the plane on the normal vector of each vertex of the corresponding triangle to construct an initial vertex normal vector list corresponding to the initial vertex coordinate list; S103. Insert a new vertex in the plane where each triangle is located, obtain the coordinates of the new vertex, and calculate the normal vector of the new vertex. Add the new vertex coordinates and the normal vector of the new vertex to the initial vertex coordinate list and the initial vertex normal vector list respectively, and construct a total vertex set consisting of a total vertex coordinate list and a total vertex normal vector list.
3. The method for planning an automated three-dimensional laser scanning trajectory according to claim 2, characterized in that: The new vertex inserted in step S103 meets the following requirements: The normal vector of the inserted new vertex is equal to the normal vector of the triangle plane.
4. The method for planning an automated three-dimensional laser scanning trajectory according to claim 3, characterized in that: In step S103, the method of inserting the new vertex is the triangle subdivision method, specifically: Calculate the projected area of each triangle on three coordinate planes of the spatial rectangular coordinate system, select the projected triangle with the largest projected area, and construct a projected circumscribed rectangle of the projected triangle, wherein each side of the projected circumscribed rectangle is parallel to the coordinate axis; Insert plane points at equal intervals at a preset density within the projection circumscribed rectangle, calculate three vectors from the plane point to the three vertices of the projection triangle, and perform cross multiplication of the three vectors in sequence to obtain three perpendicular vectors. If the directions of the three perpendicular vectors are consistent, retain the plane point; if they are inconsistent, delete the plane point; A spatial straight line is established through the retained plane points and perpendicular to the coordinate plane where the projected triangle is located, and the intersection point of the spatial straight line and the plane where the triangle corresponding to the projected triangle is located is calculated, and the intersection point is the inserted new vertex.
5. The method for planning an automated three-dimensional laser scanning trajectory according to claim 4, characterized in that: The step S2 specifically includes: S201, selecting any normal vector in the total vertex normal vector list as a reference vertex normal vector, and the corresponding vertex coordinates in the total vertex coordinate list as the reference vertex coordinates; S202, using the reference vertex normal vector as a plane normal vector, and establishing a scanning reference plane along the direction of the reference vertex normal vector at a position where the distance from the reference vertex coordinates is a scanning reference distance; S203, selecting corresponding vertex coordinates in the total vertex coordinate list according to preset conditions to form an extracted vertex set; S204, projecting the vertices in the extracted vertex set to a corresponding scanning reference plane, calculating the projection point coordinates of all vertices in the vertex set on the corresponding scanning reference plane, and obtaining a projection circumscribed rectangle projected to the corresponding scanning reference plane; S205 , repeating the above steps S202 - S204 until the total vertex normal vector list is empty, obtaining all scanning reference planes and the extracted vertex sets projected to each scanning reference plane and the projected circumscribed rectangle.
6. The method for planning an automated three-dimensional laser scanning trajectory according to claim 5, characterized in that: The step S204 further includes the following steps: S204-1, calculating the distance between each vertex in the extracted vertex set and the scanning reference plane, and combining the projection point coordinates to obtain spatial distribution information of the extracted vertex set on the scanning reference plane; S204-2, judging, based on the spatial distribution information, whether there are blocked vertices and blocked vertices whose projections overlap in the scanning reference plane; If so, the average normal vector and average coordinate of the blocked vertex are calculated, and the blocked vertex is removed from the extracted vertex set and put back into the total vertex set; Deflecting the average normal vector of the blocked vertex by a preset angle, using the deflected average normal vector as a new reference vertex normal vector, and the average coordinates as new reference vertex coordinates; If the blocked vertex does not exist, according to preset conditions, a vertex normal vector is selected from the remaining normal vectors in the total vertex normal vector list as a new reference vertex normal vector, and the corresponding vertex coordinates in the total vertex coordinate list are new reference vertex coordinates.
7. The method for planning an automated three-dimensional laser scanning trajectory according to claim 6, characterized in that: The step S3 specifically includes: S301, comparing the size of the projection circumscribed rectangle in the scanning reference plane with the effective scanning range of the scanner; S302、 In the scanner coordinate system, the effective scanning range is a rectangle with a side length of A along the X-axis direction and a side length of B along the Y-axis direction. The short side length of the projected circumscribed rectangle is S, and the long side length is L. If S<B, the starting point of the scanning path is the midpoint of the first short side of the projection circumscribed rectangle, the end point of the scanning path is the midpoint of the second short side, the scanning path is a straight line path from the starting point to the end point, and the scanning path based on the scanning reference plane is obtained; wherein, the points intersecting with each short side during the movement are scanning path points; If S≥B, the starting point of the scanning path is: the first vertex where the first long side and the first short side of the projected circumscribed rectangle intersect, and the scanning path is: moving along the first long side to the second vertex where the second short side and the first long side intersect, after moving to the second vertex, moving along the direction of the second short side by a set distance to a point on the second short side, and then moving along the direction parallel to the first long side by a set distance to a point on the first short side, and so on, until the second long side is covered by the effective scanning range and ends, and the scanning path based on the scanning reference plane is obtained; wherein, the points intersecting with each short side during the movement are scanning path points; S303, repeating the above steps S301-S302 until a scanning path based on all scanning reference planes is obtained.
8. The method for planning an automated three-dimensional laser scanning trajectory according to claim 7, characterized in that: Before step S303, the following pre-steps are also included: S303-01, judging whether there are points beyond the scanning path according to the spatial distribution information; S303-02, if it does not exist, directly execute step S303; If it exists, obtain the excess point set that exceeds the scanning path, construct the projected circumscribed rectangle of the excess point set on the scanning reference plane, calculate the average distance from each vertex in the excess point set to the scanning reference plane, move the projected circumscribed rectangle of the excess point set perpendicular to the scanning reference plane, and the moving distance is the average distance from each vertex in the excess point set to the scanning reference plane minus the reference distance of the scanner. For the projected circumscribed rectangle of the moved excess point set, execute the above steps S301-S302 to obtain the supplementary scanning path of the scanning reference plane.
9. The method for planning an automated three-dimensional laser scanning trajectory according to claim 8, characterized in that: The step S3 also includes the following steps: S304. Calculate the coordinates of the corner points of the projected circumscribed rectangle within the remaining scanning reference planes, calculate the distance from the coordinates of the corner points to the end point of the scanning path of the first scanning reference plane, select the scanning reference plane where the nearest corner point is located, and repeat the above steps S301-S302 until the final scanning path based on all scanning reference planes is planned, thereby obtaining the scanning path of all surfaces to be measured of the scanned object to be planned.
10. The method for planning an automated three-dimensional laser scanning trajectory according to claim 9, characterized in that: The step S3 also includes the following steps: S305, calculating the scanning posture according to the scanning reference plane where each scanning path point is located, transforming the scanning path point and the corresponding scanning posture into a coordinate system, and solving them into waypoints to complete the trajectory planning of the automated three-dimensional scanning.
