A point cloud segmentation method, device and storage medium
By filtering and optimizing endpoint pairs, and combining Euclidean distance and pass-through filtering, the problem of insufficient point cloud segmentation accuracy of steel plates was solved, and high-precision point cloud segmentation effect was achieved.
Patent Information
- Application Number
- CN202411988046.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing 3D point cloud processing methods suffer from insufficient accuracy in steel plate point cloud segmentation, especially when the point cloud data of thin steel plates and worktables are close together, making segmentation difficult. Furthermore, existing algorithms such as RANSAC, region growing, and Euclidean clustering perform poorly in this situation.
By acquiring endpoint pairs of the workbench and the object to be detected, seed endpoint pairs are filtered, and the endpoints to be optimized are optimized using index points. By combining Euclidean distance and pass-through filtering, the point cloud data is refined and optimized to improve segmentation accuracy.
It achieves precise segmentation of the point cloud of steel plate and worktable, improves the accuracy of steel plate contour acquisition, and meets the requirements of high-efficiency and high-precision inspection.
Smart Images

Figure CN119919427B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D point cloud detection, and more particularly to a point cloud segmentation method, device and storage medium. Background Technology
[0002] Steel plates are one of the most important materials in the field of engineering machinery processing and manufacturing. With the deepening of industrial intelligence, informatization and automation, relevant component manufacturers have put forward higher requirements for manufacturing, processing and assembly processes, which in turn puts forward higher requirements for the quality of raw materials such as steel plates. In view of the contradiction between the production requirements of high quality, high efficiency and high efficiency and the low efficiency and high error detection methods of traditional manual measurement, a method based on visual inspection technology to obtain point cloud data of steel plate appearance and using 3D point cloud processing algorithms to complete the quality inspection of steel plates is proposed.
[0003] Existing 3D point cloud processing generally uses the Random Sample Consensus (RANSAC) algorithm to perform planar fitting on the point cloud data of steel plates, and segments the steel plate point cloud based on the distance threshold from the point to the plane. However, since the size and model of the steel plate are not fixed and the plane is not ideal, the segmented steel plate point cloud is not accurate. At the same time, for relatively thin steel plates, the distance between the collected steel plate point cloud data and the point cloud data of the worktable will be very close, making it more difficult to segment the steel plate point cloud. Summary of the Invention
[0004] This application provides a point cloud segmentation method, device, and storage medium. Based on point cloud data from a workbench and point cloud data of an object to be detected, endpoint pairs of the point cloud data are obtained. These endpoint pairs include endpoint pairs corresponding to the workbench and endpoint pairs of the object to be detected. Therefore, the endpoint pairs of the object to be detected need to be filtered out, and seed endpoint pairs are determined based on the filtered endpoint pairs. One endpoint in the seed endpoint pair is used as an index point. Finally, the endpoint to be optimized is optimized based on the distance between the index point and the endpoint to be optimized, until the optimization of the object to be detected is completed. According to the above, the point cloud segmentation accuracy of the object to be detected can be improved by finely dividing the point cloud data of the workbench and the point cloud data of the object to be detected, and by more finely optimizing the contour of the object to be detected, thereby improving the detection accuracy of the object.
[0005] Firstly, this application provides a point cloud segmentation method, including:
[0006] Based on a first point cloud set containing point cloud data of the workbench and point cloud data of the object to be detected, multiple endpoint pairs are obtained from the first point cloud set, wherein the object to be detected is placed on the surface of the workbench; the endpoint pair refers to two points on opposite sides along the laser line direction.
[0007] Calculate the average value of the Euclidean distances corresponding to the multiple endpoint pairs, and filter out the endpoint pairs corresponding to the object to be detected based on the average value. Select one endpoint pair from the endpoint pairs corresponding to the object to be detected as a seed endpoint pair using a preset method.
[0008] For multiple endpoint pairs in the first point cloud set, any seed point in the seed endpoint pair is used as an index point. The endpoint to be optimized is optimized according to the distance between the index point and the endpoint to be optimized until the optimization of the object to be detected is completed. The endpoint to be optimized is the previous frame endpoint and / or the next frame endpoint on the same side as the index point.
[0009] In one or more possible embodiments, optimizing the endpoint to be optimized based on the distance between the index point and the endpoint to be optimized includes:
[0010] When the distance between the index point and the endpoint to be optimized is determined to be greater than or equal to a preset distance, a preset number of first candidate points are selected based on the distance between the index point and all points in the previous frame point cloud data and / or the next frame point cloud data.
[0011] The first candidate point that is closest to the index point among the first candidate points is taken as the new index point, and the optimization of the endpoint to be optimized is completed.
[0012] In one or more possible embodiments, optimizing the endpoint to be optimized based on the distance between the index point and the endpoint to be optimized includes:
[0013] When it is determined that the distance between the index point and the endpoint to be optimized is greater than or equal to a preset distance, a second point cloud set is determined based on the point cloud data of the frame corresponding to the index point, as well as the point cloud data of the previous preset frame and the point cloud data of the next preset frame.
[0014] The second point cloud set is cropped according to the direct filtering method to obtain a point cloud that meets the first preset range, and the point cloud is then fitted to a plane.
[0015] Based on the distance between the first candidate point and the fitted plane, if the number of second candidate points that satisfy the second preset range is greater than or equal to a preset value, then one point is selected from the second candidate points as an index point.
[0016] In one or more possible embodiments, selecting a point from the second candidate points as the index point includes:
[0017] Based on the positional relationship between the second candidate point and the index point, a second candidate point that satisfies a third preset range is selected as the index point.
[0018] In one or more possible embodiments, it also includes:
[0019] If the number of second candidate points that meet the second preset range is less than a preset value, then the first candidate point that is closest to the index point among the first candidate points is taken as the new index point.
[0020] In one or more possible embodiments, optimizing the endpoint to be optimized based on the distance between the index point and the endpoint to be optimized includes:
[0021] When it is determined that the distance between the index point and the endpoint to be optimized is less than a preset distance, the endpoint to be optimized is taken as a new index point, and it is determined that the optimization of the endpoint to be optimized is completed.
[0022] In one or more possible embodiments, obtaining multiple endpoint pairs in the first point cloud set includes:
[0023] For any frame of point cloud in the first point cloud set, search from the left / right end of the point cloud in any frame toward the center according to the Euclidean distance between two adjacent points;
[0024] If two adjacent points less than or equal to a preset threshold are found, the point farthest from the center of any frame point cloud is taken as the left / right endpoint of any frame point cloud.
[0025] The endpoint pair corresponding to any frame point cloud is determined based on the left / right endpoints of any frame point cloud.
[0026] Secondly, this application provides a point cloud segmentation device, comprising:
[0027] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the methods in the first aspect.
[0028] Thirdly, this application provides a computer storage medium storing a computer program for causing a computer to perform any of the methods described in the first aspect.
[0029] According to the point cloud segmentation method, device and storage medium provided in this application, the point cloud of steel plate and workbench can be accurately segmented. The point cloud data of workbench and steel plate are optimized based on selected seed points, and the point cloud data of workbench and steel plate are finely divided to improve the accuracy of steel plate contour acquisition. Attached Figure Description
[0030] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.
[0031] Figure 1 This is a schematic diagram of a point cloud data acquisition device according to an embodiment;
[0032] Figure 2 This is a flowchart of a point cloud segmentation method provided according to an embodiment;
[0033] Figure 3 This is a schematic diagram of a first point cloud set according to an embodiment;
[0034] Figure 4 This is a schematic diagram of endpoint pairs obtained from a first point cloud set according to an embodiment;
[0035] Figure 5 This is a schematic diagram showing the optimized end point of a steel plate according to an embodiment.
[0036] Figure 6 This is a schematic diagram of a point cloud segmentation device according to an embodiment;
[0037] Figure 7 This is a schematic diagram of a computer storage medium provided according to an embodiment. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0039] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0040] Furthermore, in the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0041] Steel plates are one of the most important materials in the field of engineering machinery processing and manufacturing. With the deepening of industrial intelligence, informatization and automation, relevant component manufacturers have put forward higher requirements for manufacturing, processing and assembly processes, which in turn puts forward higher requirements for the quality of raw materials such as steel plates. In view of the contradiction between the production requirements of high quality, high efficiency and high efficiency and the low efficiency and high error detection methods of traditional manual measurement, a method based on visual inspection technology to obtain point cloud data of steel plate appearance and using 3D point cloud processing algorithms to complete the quality inspection of steel plates is proposed.
[0042] Existing 3D point cloud processing generally uses the Random Sample Consensus (RANSAC) algorithm to perform planar fitting on the point cloud data of steel plates, and segments the steel plate point cloud based on the distance threshold from the point to the plane. However, since the size and model of the steel plate are not fixed and the plane is not ideal, the segmented steel plate point cloud is not accurate. At the same time, for relatively thin steel plates, the distance between the collected steel plate point cloud data and the point cloud data of the worktable will be very close, making it more difficult to segment the steel plate point cloud.
[0043] Meanwhile, existing point cloud segmentation methods also include the following categories:
[0044] Region growing algorithms have high computational complexity, while the number of steel plate point clouds is large, making the operation very slow and the cycle time difficult to meet the requirements. Furthermore, the segmentation effect of region growing is highly dependent on the accuracy of the point cloud normal vector calculation. When the steel plate point cloud and the workpiece stage point cloud are close, this method is difficult to complete the segmentation accurately.
[0045] Euclidean clustering algorithms typically require significant gaps between point clouds, but there are no significant gaps between the point clouds of thin steel plates and the point clouds of the workpiece stage.
[0046] like Figure 1 The diagram shown is a simple point cloud data acquisition device provided in this application. The device consists of a guide rail, a frame, a line scan camera, and a worktable. The worktable is composed of several rollers with uniform spacing. A steel plate can be placed statically on the worktable. A line scan camera is installed on the frame to scan the steel plate. The guide rail is used to ensure that the camera moves smoothly along the direction of motion, that is, the longitudinal direction.
[0047] On the gantry, several 3D line scanning cameras are installed side by side in a straight line, and the laser coverage area can be adjusted by adding or removing 3D line scanning cameras as needed. Figure 1 The paper presents a scheme for installing one 3D line scanning camera. It is foreseeable that the more 3D line scanning cameras (for ease of description, cameras will be used to replace 3D line scanning cameras in this application) installed side by side on the rack, the wider the coverage area that can be achieved along the laser line direction, that is, the horizontal direction (parallel to the roller mentioned above). The vertical scanning range (parallel to the guide rail mentioned above) is determined according to the length of the guide rail and the workpiece stage.
[0048] First, this application proposes a point cloud segmentation method, such as... Figure 2 As shown, it includes:
[0049] Step 201: Based on the first point cloud set containing the workbench point cloud data and the object to be detected point cloud data, obtain multiple endpoint pairs in the first point cloud set, wherein the object to be detected is placed on the workbench surface; the endpoint pair refers to two points on opposite sides along the laser line direction.
[0050] In one or more possible embodiments, the first point cloud data set mentioned above includes point cloud data of the steel plate obtained after scanning by the 3D line scan camera and point cloud data of the worktable. The point cloud data of the worktable refers to the point cloud data of the roller scanned by the camera, such as... Figure 3 The diagram shown is a schematic of the first point cloud set mentioned above. The white area represents dense point cloud data, composed of multiple frames of point cloud data scanned by the camera. It can be clearly seen that the point cloud data of the roller and the steel plate are mixed together. For ease of description, in... Figure 3 The text also shows the x-direction (horizontal) and y-direction (vertical);
[0051] In one or more possible embodiments, the raw point cloud data (cloud_org) obtained from camera scanning generally cannot be directly segmented because invalid points and noise inevitably occur during the camera scanning process. Therefore, after acquiring the point cloud data obtained from camera scanning, preprocessing is required to remove invalid points and outliers. The number of points in a single frame of point cloud data from the camera is fixed, which is the camera resolution. The length of the point cloud on a single laser line is the product of the number of points in a single frame minus 1 and the distance between the points. When the length of the point cloud exceeds the maximum field of view at the current depth of field, the points on both sides of the laser outline that exceed the field of view are invalid points. In addition, points that exceed the depth of field when the laser hits the air are also invalid points and are removed. Invalid points can reduce the number of point clouds, save computing resources, and avoid anomalies during subsequent point cloud computing. The point cloud data after removing invalid points from the original point cloud data cloud_org is denoted as cloud_valid. At the same time, due to the reflection of the object to be detected, i.e., the steel plate, and the interference of the laser, floating noise points will occur in space. The RANSAC algorithm is used to perform plane fitting on the point cloud data cloud_valid, and points in the point cloud data cloud_valid that are more than 'a' away from the fitted plane are removed to obtain the point cloud data cloud_inliers. The above 'a' is a fixed value that can be determined according to the flatness of the steel plate. For example, the value of 'a' can be 1.5 times or 2 times the flatness of the steel plate, etc. There is no specific restriction here.
[0052] In one or more possible embodiments, after obtaining the point cloud data cloud_inliers, it is necessary to sort the point cloud data cloud_inliers to obtain ordered point cloud data vector_profile_cloud. The specific sorting method is as follows:
[0053] Each point in the point cloud data cloud_inliers has a three-dimensional coordinate (x, y, z) to represent its position. In this application, the y values in a frame of point cloud data are all equal, while the x values are not equal. The point cloud data cloud_inliers is sorted according to the y values in ascending order to obtain several frames of point cloud data. Then, each frame of point cloud data is sorted according to the x values in ascending order. In this way, the point cloud data cloud_inliers can be transformed into ordered point cloud data vector_profile_cloud.
[0054] In one or more possible embodiments, it is determined that the point cloud schematic diagram after obtaining the ordered point cloud may contain useless workbench data, specifically as follows: Figure 3As shown, there are two point cloud datasets of workbenches that do not interact with the steel plate. Therefore, these two useless point cloud datasets need to be filtered out, and the start and end frames at both ends of the steel plate need to be determined. The steel plate is placed on the rollers. If there is no steel plate between the two rollers, the point cloud data between the two rollers will be empty. In this case, the difference in y between the point cloud of frame i and the point cloud of frame i+1 will be large. Based on the above principle, the start and end frames of the steel plate point cloud can be determined. The specific method is as follows:
[0055] For example, the ordered point cloud data vector_profile_cloud contains M frames of point cloud data. The first frame of point cloud data is used as the first start frame, and the Mth frame of point cloud data is used as the last end frame. If the difference in y between two adjacent frames m and m+1 is greater than the threshold b, it means that there is a gap between the two adjacent point cloud frames. Then, the mth frame of point cloud data is used as an end frame, and the m+1th frame of point cloud data is used as a start frame. Starting from the first start frame, the point cloud data between a start frame and an end frame is grouped together. A group of point cloud data is a continuous object (roller or steel plate) scanned by the camera. The difference in y between the start frame and the end frame in several groups of point cloud data is calculated. When the difference is greater than the threshold L, the group of point cloud data is determined to be point cloud data containing the steel plate, which is the first point cloud set mentioned above.
[0056] In one or more possible embodiments, multiple endpoint pairs in the first point cloud set are determined as follows: For any frame of point cloud in the first point cloud set, based on the Euclidean distance between two adjacent points, a search is performed sequentially from the left / right end of the point cloud frame towards the center; if two adjacent points less than or equal to a preset threshold are found, the point farthest from the center of the point cloud frame is taken as the left / right endpoint of the point cloud frame; the endpoint pair corresponding to the point cloud frame is determined based on the left / right endpoint of the point cloud frame; firstly, for any frame of point cloud, the Euclidean distance between two adjacent points is calculated, for example, starting from the left side where x is smallest, the distance between point x1 and point x2 is calculated; if the distance is greater than a preset threshold d, it indicates that... If x2 is not the left endpoint, continue calculating the distance between x2 and x3. If the distance is still greater than the preset threshold d, continue searching towards the center until two adjacent points xi and x(i+1) less than or equal to the preset threshold d are found. These xi points are then taken as the left endpoint. Similarly, starting from the right side where x is largest, calculate the distance between point xn and point x(n-1). If the distance is greater than the preset threshold d, it means that point xn is not the right endpoint. Continue calculating the distance between point x(n-1) and point x(n-2). If the distance is less than or equal to the preset threshold d, point x(n-1) is taken as the right endpoint; otherwise, continue searching. Based on the identified left and right endpoints, determine the endpoint pair corresponding to any of the above frame point clouds, such as... Figure 4The diagram shown is a schematic of the endpoint pairs obtained from the first point cloud set, including the endpoint pairs of the steel plate and the endpoint pairs of the roller.
[0057] Step 202: Calculate the average value of the Euclidean distances corresponding to the above multiple endpoint pairs, and filter out the endpoint pairs corresponding to the object to be detected based on the above average value. Select one endpoint pair from the endpoint pairs corresponding to the object to be detected as a seed endpoint pair using a preset method.
[0058] In one or more possible embodiments, such as Figure 4 As shown, the first point cloud set contains multiple endpoint pairs, with P... L (x L ,y L ,z L P is the left endpoint. R (x R ,y R ,z R Let '(N)' be the right endpoint. Calculate the distance between each pair of endpoints, denoted as the width, and use the following formula to calculate the mean of the N widths:
[0059]
[0060] Endpoint pairs whose width exceeds the average are removed. In other words, the remaining endpoint pairs are all endpoint pairs corresponding to the steel plate. The average width of the endpoint pairs corresponding to the steel plate is calculated again. The endpoint pair with the smallest deviation from the average width is taken as the seed endpoint pair. It is worth noting that the seed endpoint pair contains two seed points, namely the seed point on the left and the seed point on the right.
[0061] Step 203: For the multiple endpoint pairs in the first point cloud set, take any seed point in the seed endpoint pair as an index point, and optimize the endpoint to be optimized according to the distance between the index point and the endpoint to be optimized until the optimization of the object to be detected is completed; wherein, the endpoint to be optimized is the endpoint of the previous frame and / or the endpoint of the next frame on the same side as the index point.
[0062] In one or more possible embodiments, the multiple endpoint pairs in the first point cloud set include endpoint pairs of steel plates and endpoint pairs of rollers. The process of optimizing the endpoints is actually to correct the endpoints of actual non-steel plate edge points to endpoints of steel plate edges, while the endpoints of steel plate edges remain unchanged. The aforementioned seed endpoint pairs contain two seed points, which are used as index points to search in the start frame and end frame containing the steel plate point cloud to optimize the endpoints of non-steel plate edge points, as follows:
[0063] Taking the optimization of any seed point towards the termination frame as an example, the seed point is used as the index point current_index. After optimization begins, the Euclidean distance between the current index point current_index and the endpoint of the next frame on the same side (the endpoint to be optimized) is calculated. If the calculated Euclidean distance is less than the preset distance, it means that the endpoint of the next frame on the same side is also the endpoint of the steel plate. The endpoint of the next frame on the same side is then used as the new index point, confirming that the endpoint to be optimized has been optimized and the search and optimization can continue to the next frame. If the distance between the above index point and the endpoint to be optimized is greater than or equal to the preset distance, it means that the endpoint to be optimized is the endpoint corresponding to the roller, and therefore the endpoint corresponding to the roller needs to be optimized.
[0064] In one or more possible embodiments, a preset number of first candidate points can be determined based on the distance between the above index point and all points in the previous frame point cloud data and / or the next frame point cloud data. Taking the optimization of any seed point towards the termination frame as an example, the distance between the above index point and all points in the next frame point cloud data is calculated. If the next frame point cloud data contains N points, N distances will be obtained. Then, several first candidate points with smaller distances are selected. In this application, a KD tree (K-Dimensional Tree) is used to search for the 20 first candidate points closest to the current endpoint. The first candidate point with the smallest distance, goal_point, can be directly used as the endpoint of the steel plate point cloud, and the selected first candidate point goal_point is used as the next new index point.
[0065] In one or more possible embodiments, when it is determined that the distance between the above index point and the endpoint to be optimized is greater than or equal to a preset distance, a second point cloud set is determined based on the point cloud data of the frame corresponding to the above index point, as well as the point cloud data of the previous preset frame and the point cloud data of the next preset frame. Specifically, based on the index position of the current endpoint, several frames of point cloud data in the contour point cloud can be extracted and merged into a whole point cloud cloud_temp. In this application, the point cloud data of the first three frames and the last three frames of the point cloud of the frame where the current endpoint is located are selected, for a total of seven frames of point cloud data, to obtain the second point cloud set cloud_temp.
[0066]
[0067] Clip the above second point cloud set according to the direct filtering method to obtain the point cloud that meets the first preset range. Specifically, use direct filtering to clip the second point cloud set in the x direction to obtain the point cloud cloud_temp_seg. All points in the point cloud cloud_temp_seg have x values that satisfy the first preset range value_min < x < value_max, where value_min is the lower threshold of direct filtering and value_max is the upper threshold; use the plane fitting algorithm to fit the plane of the point cloud cloud_temp_seg to obtain the fitted plane coefficient; the above plane fitting algorithm can select RANSAC, the least squares method, etc., and no specific restrictions are made here;
[0068] Based on the distance distance between the above first candidate point and the above fitted plane coefficient, select the second candidate points that satisfy the second preset range -0.5 ≤ distance ≤ 2.0. If it is determined that the number of second candidate points is greater than or equal to the preset value 2, then select one point from the second candidate points as the index point;
[0069] The specific method for selecting the index point is as follows: According to the positional relationship between the above second candidate point and the above index point, select the second candidate point that satisfies the third preset range as the index point. The third preset range is as follows:
[0070]
[0071] where n is the number of candidate second candidate points and current_point is the current index point;
[0072] If the number of second candidate points after screening by the third preset range is still greater than or equal to the preset value 2, then further screen by the difference in z between the current index point and the second candidate point. For example, select the second candidate point with a difference less than 0.2, or directly select the second candidate point corresponding to the smallest difference; and take the selected second candidate point as the next index point; if the number of second candidate points obtained is less than the preset value 2, then directly take the first candidate point goal_point as the next index point.至此,从任一种子点向终止帧方向进行优化的步骤完成,同样采用相同的方式对任一种子点向起始帧方向进行优化,直至整个钢板优化完成;如 Figure 5 As shown, it is a schematic diagram after the optimization of the endpoints of the entire steel plate is completed, and the segmentation of the steel plate point cloud and the workbench point cloud is also completed.
[0073] Embodiment 2
[0074] Corresponding to the above point cloud segmentation method, the present invention also proposes a point cloud segmentation device, such as Figure 6 As shown, it includes:
[0075] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the point cloud segmentation method described above.
[0076] like Figure 6 As shown, the device includes a processor 601, a memory 602, a communication interface 603, and a bus 604. The processor 601, memory 602, and communication interface 603 are interconnected via the bus 604.
[0077] Processor 601 is configured to read instructions from memory 602 and execute them, so that at least one processor can execute the point cloud segmentation method provided in the above embodiments.
[0078] The memory 602 is used to store various instructions and programs for the point cloud segmentation method provided in the above embodiments.
[0079] Bus 604 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0080] Processor 601 can be a central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), or any combination of CPU, NP, and GPU. It can also be a hardware chip. The aforementioned hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0081] Since the device embodiments of the present invention correspond to the method embodiments described above, details not disclosed in the device embodiments can be referred to in the method embodiments described above, and will not be repeated in the present invention.
[0082] Example 3
[0083] In addition, this application also provides a computer-readable storage medium, such as Figure 7 As shown, the computer storage medium stores a computer program that is used to cause the computer to perform any of the methods described in the above embodiments.
[0084] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) 701 and / or cache memory 702, and may further include read-only memory (ROM) 703.
[0085] The memory may also include a program / utility 705 having a set (at least one) of program modules 704, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0086] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0090] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A point cloud segmentation method, characterized in that, include: Based on a first point cloud set containing point cloud data of the workbench and point cloud data of the object to be detected, multiple endpoint pairs are obtained from the first point cloud set, wherein the object to be detected is placed on the surface of the workbench; the endpoint pair refers to two points on opposite sides along the laser line direction. Calculate the average value of the Euclidean distances corresponding to the multiple endpoint pairs, and filter out the endpoint pairs corresponding to the object to be detected based on the average value. Select one endpoint pair from the endpoint pairs corresponding to the object to be detected as a seed endpoint pair using a preset method. For multiple endpoint pairs in the first point cloud set, any seed point in the seed endpoint pair is used as an index point. The endpoint to be optimized is optimized according to the distance between the index point and the endpoint to be optimized until the optimization of the object to be detected is completed. The endpoint to be optimized is the previous frame endpoint and / or the next frame endpoint on the same side as the index point.
2. The method according to claim 1, characterized in that, The endpoint to be optimized is optimized based on the distance between the index point and the endpoint to be optimized, including: When the distance between the index point and the endpoint to be optimized is determined to be greater than or equal to a preset distance, a preset number of first candidate points are selected based on the distance between the index point and all points in the previous frame point cloud data and / or the next frame point cloud data. The first candidate point that is closest to the index point among the first candidate points is taken as the new index point, and the optimization of the endpoint to be optimized is completed.
3. The method according to claim 2, characterized in that, The endpoint to be optimized is optimized based on the distance between the index point and the endpoint to be optimized, including: When it is determined that the distance between the index point and the endpoint to be optimized is greater than or equal to a preset distance, a second point cloud set is determined based on the point cloud data of the frame corresponding to the index point, as well as the point cloud data of the previous preset frame and the point cloud data of the next preset frame. The second point cloud set is cropped according to the direct filtering method to obtain a point cloud that meets the first preset range, and the point cloud is then fitted to a plane. Based on the distance between the first candidate point and the fitted plane, if the number of second candidate points that satisfy the second preset range is greater than or equal to a preset value, then one point is selected from the second candidate points as an index point.
4. The method according to claim 3, characterized in that Selecting a point from the second candidate points as the index point includes: Based on the positional relationship between the second candidate point and the index point, a second candidate point that satisfies a third preset range is selected as the index point.
5. The method according to claim 3 or 4, characterized in that, Also includes: If the number of second candidate points that meet the second preset range is less than a preset value, then the first candidate point that is closest to the index point among the first candidate points is taken as the new index point.
6. The method according to claim 1, characterized in that, The endpoint to be optimized is optimized based on the distance between the index point and the endpoint to be optimized, including: When it is determined that the distance between the index point and the endpoint to be optimized is less than a preset distance, the endpoint to be optimized is taken as a new index point, and it is determined that the optimization of the endpoint to be optimized is completed.
7. The method according to claim 1, characterized in that, The step of obtaining multiple endpoint pairs in the first point cloud set includes: For any frame of point cloud in the first point cloud set, search from the left / right end of the point cloud in any frame toward the center according to the Euclidean distance between two adjacent points; If two adjacent points less than or equal to a preset threshold are found, the point farthest from the center of any frame point cloud is taken as the left / right endpoint of any frame point cloud. The endpoint pair corresponding to any frame point cloud is determined based on the left / right endpoints of any frame point cloud.
8. A point cloud segmentation device, characterized in that, The device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the methods claimed in claims 1-7.
9. A computer storage medium, characterized in that, The computer storage medium stores a computer program that causes the computer to perform any one of the methods claimed in claims 1-7.
Citation Information
Patent Citations
Method for determining pose of target object, electronic equipment and storage medium
CN117372518A
Workpiece detection method and device, visual detection equipment and storage medium
CN119006470A