Method and device for extracting centerline of quasi-cylinder by using point cloud
Through a statistical robustness method, the center line of a large circular structure is directly extracted by using three-dimensional point cloud scanning and ring two-dimensional image probabilistic calculation, which solves the problems of low efficiency and accuracy dependence in the existing technology, and realizes the Efficient and accurate centerline extraction.
Patent Information
- Application Number
- CN202411451824.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art is less efficient when extracting the centerline of large circular structures, and the accuracy is easily affected by the technical level of the operator, and requires filtering and noise processing of the original point cloud.
The centerline extraction method based on statistical robustness is adopted to form a ring two-dimensional image through three-dimensional point cloud scanning and equal interval cutting, and the probability of occurrence of each distance is calculated. The original point cloud is used for center point extraction, and the center point is connected to form a center. Wire.
It improves the extraction accuracy and efficiency of the cylinder-like centerline, reduces the dependence on noise and technical level, and has good robustness and flexibility.
Smart Images

Figure CN119417882A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and a device for extracting the center line of a quasi-cylinder by using a point cloud, and belongs to the technical field of circular structure detection. Background Art
[0002] Project quality inspection is an important part of controlling project quality and an important basis for evaluating project quality. It plays an important role in ensuring the quality of construction projects in areas such as quality inspection of large circular steelmaking furnaces, workpieces composed of several parts of circular components, and extraction of tunnel center lines.
[0003] Centerline extraction is an important image processing technology that can effectively describe and analyze complex shapes in images. At present, the main methods for extracting the centerline of large circular structures are: 1. Image centerline extraction method. There are many methods for extracting the centerline of an image, among which the more commonly used methods include distance transform-based methods, skeleton-based methods, edge tracking-based methods, etc. Among them, the distance transform-based method is the most commonly used one. It calculates the distance from the pixel to the nearest edge to obtain a distance transform image, and then calculates the position of the centerline based on this distance transform image. The skeleton-based method performs a series of erosion and expansion operations on the binary image to obtain an image representing the image skeleton, and then extracts the centerline from this skeleton image. The edge tracking-based method starts from the edge of the image and tracks according to certain rules to obtain a curve representing the centerline. Second, the centerline extraction method based on point cloud, based on the centerline extracted from the scanned point cloud or the centerline of the designed structure, realizes the point cloud interval division by setting the point cloud interval extraction interval, converts the point cloud interval into a two-dimensional point cloud and denoises it, and uses the center of gravity, direction vector and projection vector corresponding to the centerline of the track surface or the centerline of the designed structure of the point cloud interval to calculate the structural center point of each interval and connect them to form the structural centerline. The current centerline extraction method for large-scale circular structures also uses conventional instruments such as total stations, section meters, and convergence meters to measure the centerline calculation. However, the traditional method of using point cloud extraction requires filtering the original point cloud, removing noise, etc. The entire operation process takes a long time and the accuracy is easily affected by the technical level of the operator. Therefore, although these methods are highly accurate, they are less efficient.
[0004] Based on this, the present invention proposes a method and device for extracting the center line of a quasi-cylinder using point cloud. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a method and device for extracting the center line of a quasi-cylinder using a point cloud, which can improve the extraction accuracy and efficiency of the center line of the quasi-cylinder.
[0006] The technical solution adopted by the present invention to solve the technical problem is:
[0007] In a first aspect, an embodiment of the present invention provides a method for extracting a center line of a quasi-cylinder using a point cloud, comprising the following steps:
[0008] Step S1, obtaining a quasi-circular target whose center line is to be extracted, and performing a three-dimensional point cloud scan on the quasi-circular target to obtain three-dimensional point cloud data;
[0009] Step S2, cutting the point cloud at equal intervals along the center line direction of the target in the three-dimensional point cloud data to form a plurality of annular point clouds with noise;
[0010] Step S3, projecting the noisy annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image;
[0011] Step S4, calculating the distances from all points inside the annular two-dimensional image to external points on the projection image;
[0012] Step S5, calculate the probability of each distance, and obtain the pixel corresponding to the maximum probability of a certain distance as the plane center point (x, y) of the annular point cloud corresponding to the two-dimensional image; associate the z value when the annular point cloud is cut in the center line direction (z represents the position of the annular point cloud when it is cut at equal intervals in the center line direction, and the position is defined as the coordinate z value) to form the three-dimensional coordinates (x, y, z) of the center point;
[0013] Step S6, connecting the three-dimensional coordinates (x, y, z) of all the center points of the equally spaced cut annular point cloud to obtain the center line of the cylinder.
[0014] As a possible implementation of this embodiment, in step S1, when multiple point cloud sites are required to perform three-dimensional point cloud scanning on a quasi-circular target, point clouds of all sites are unified into the same coordinate system through point cloud matching technology.
[0015] As a possible implementation of this embodiment, in step S4, the step size is in pixels, and the distances from all points inside the annular two-dimensional image to the external points on the projection image are gradually calculated in order from small to large radius:
[0016]
[0017] Where, d it represents the distance between pixel i and pixel t; (x i ,y i ) represents the two-dimensional coordinates of pixel i on the non-two-dimensional image in the center of the image (the black part inside the white image in the image); (X t , Y t) represents the two-dimensional image coordinates of t on the two-dimensional projection image (the white part in the image).
[0018] As a possible implementation of this embodiment, step S5 includes the following steps:
[0019] S51, with d it The radius is gradually increased by 1 pixel, and the number of pixels (x i ,y i ) as the origin, with d it and d it +1 Pixels in the ring area (X t , Y t )Probability of occurrence:
[0020]
[0021] Where: p n represents the probability corresponding to the number n of radius increasing from the center outward; n represents the probability that the radius r increases by 1 pixel in d it and d it +1 the number of pixels that appear between; d min In order to increase the calculation speed, the minimum value of the probability is calculated starting from a number greater than 0; d r Indicates d it By 1 pixel length;
[0022] S52, using the maximum probability calculation formula to count the pixel coordinates (x i ,y i ), get the center point (x) of the two-dimensional image i0 ,y i0 ), r>d it And r <d it +1.
[0023] As a possible implementation of this embodiment, the maximum probability calculation formula is:
[0024]
[0025] In the formula, p i Indicates p n The probability at pixel i.
[0026] As a possible implementation of this embodiment, in step S52, the pixel point (x i0 ,y i0 ) is the center point of the two-dimensional projection plane.
[0027] As a possible implementation of this embodiment, in step S6, if there are multiple annular two-dimensional images, there are corresponding multiple two-dimensional circular center coordinates (x im ,y im ), where m is the number of annular two-dimensional images.
[0028] In a second aspect, an embodiment of the present invention provides a device for extracting a center line of a quasi-cylindrical object using a point cloud, comprising:
[0029] A point cloud scanning module is used to obtain a quasi-circular target whose center line is to be extracted, and to perform a three-dimensional point cloud scanning on the quasi-circular target to obtain three-dimensional point cloud data;
[0030] The point cloud cutting module is used to cut the point cloud at equal intervals along the center line direction of the target in the three-dimensional point cloud data to form multiple ring point clouds with noise;
[0031] A point cloud projection module is used to project the noisy annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image;
[0032] A distance calculation module, used to calculate the distances from all points inside the annular two-dimensional image to external points on the projected image;
[0033] The probability calculation module is used to calculate the probability of each distance, and the corresponding pixel position when the probability of a certain distance is the maximum is the plane center point (x, y) of the corresponding annular point cloud of the two-dimensional image; the z value when the annular point cloud is cut in the center line direction is associated to form the three-dimensional coordinates (x, y, z) of the center point;
[0034] The centerline acquisition module is used to connect the three-dimensional coordinates (x, y, z) of all the center points of the equally spaced cut annular point cloud to obtain the centerline of the cylinder.
[0035] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform any of the steps of the above-mentioned method for extracting the center line of a quasi-cylinder using a point cloud.
[0036] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for extracting the center line of a quasi-cylinder using a point cloud are executed.
[0037] The beneficial effects of the technical solution of the embodiment of the present invention are as follows:
[0038] The present invention adopts a centerline extraction method based on statistical robustness, and uses a movable laser scanner to perform three-dimensional scanning on the extraction target object to obtain a three-dimensional point cloud with a unified coordinate system; then the point cloud is cut into multiple sections to form multiple ring-like two-dimensional images; finally, the two-dimensional image is statistically center-point extracted, and multiple center points are connected to form the centerline of a quasi-circular structure or a large workpiece, thereby improving the extraction accuracy of the centerline of a quasi-cylindrical object and the reliability of the centerline extraction.
[0039] The present invention is not limited to conditions such as location, size of the extracted target, roundness of the circular structure, etc., as long as it is an approximately circular target, it has good flexibility.
[0040] Compared with the traditional method of extracting using point clouds, the present invention has high efficiency in extracting the center line of a cylindrical object.
[0041] The present invention is based on statistical probability. In the process of center extraction, there is no need to perform noise filtering on the original point cloud. The original point cloud is directly used, and the original point cloud is equally spaced and divided in the longitudinal direction and the center line is extracted according to the density. Therefore, the present invention has strong robustness and is insensitive to point cloud noise, circular incompleteness, and even not-so-circular structures.
[0042] A device for extracting the center line of a quasi-cylinder using a point cloud according to the technical solution of an embodiment of the present invention has the same beneficial effects as a method for extracting the center line of a quasi-cylinder using a point cloud according to the technical solution of an embodiment of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of a method for extracting the center line of a quasi-cylinder using a point cloud according to an exemplary embodiment;
[0044] Figure 2 is a schematic diagram of a device structure for extracting the center line of a quasi-cylinder using a point cloud according to an exemplary embodiment;
[0045] Figure 3 is a three-dimensional point cloud diagram of a steelmaking furnace according to an exemplary embodiment;
[0046] Figure 4 is a schematic diagram of a ring-shaped two-dimensional image according to an exemplary embodiment;
[0047] Figure 5 is a radius-probability graph shown according to an exemplary embodiment. DETAILED DESCRIPTION
[0048] In order to more clearly illustrate the technical features of the solution of the present invention, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0049] like Figure 1 As shown, a method for extracting the center line of a quasi-cylinder using a point cloud provided by an embodiment of the present invention includes the following steps:
[0050] Step S1, obtaining a quasi-circular target whose center line is to be extracted, and performing a three-dimensional point cloud scan on the quasi-circular target to obtain three-dimensional point cloud data;
[0051] Step S2, cutting the point cloud at equal intervals along the center line direction of the target in the three-dimensional point cloud data to form a plurality of annular point clouds with noise;
[0052] Step S3, projecting the noisy annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image;
[0053] Step S4, calculating the distances from all points inside the annular two-dimensional image to external points on the projection image;
[0054] Step S5, calculating the probability of occurrence of each distance, and obtaining the pixel corresponding to the maximum probability of occurrence of a certain distance as the plane center point (x, y) of the corresponding annular point cloud of the two-dimensional image; associating the z value when the annular point cloud is cut in the center line direction to form the three-dimensional coordinates (x, y, z) of the center point;
[0055] Step S6, connecting the three-dimensional coordinates (x, y, z) of all the center points of the equally spaced cut annular point cloud to obtain the center line of the cylinder.
[0056] As a possible implementation of this embodiment, in step S1, when multiple point cloud sites are required to perform three-dimensional point cloud scanning on a quasi-circular target, point clouds of all sites are unified into the same coordinate system through point cloud matching technology.
[0057] As a possible implementation of this embodiment, in step S4, the step size is in pixels, and the distances from all points inside the annular two-dimensional image to the external points on the projection image are gradually calculated in order from small to large radius:
[0058]
[0059] Where, d it represents the distance between pixel i and pixel t; (x i ,y i ) represents the two-dimensional coordinates of pixel i on the non-two-dimensional image in the center of the image (the black part inside the white image in the image); (X t , Y t ) represents the two-dimensional image coordinates of t on the two-dimensional projection image (the white part in the image).
[0060] As a possible implementation of this embodiment, step S5 includes the following steps:
[0061] S51, with d it The radius is gradually increased by 1 pixel, and the number of pixels (x i ,y i ) as the origin, with d it and d it +1 Pixels in the ring area (X t , Y t )Probability of occurrence:
[0062]
[0063] Where: p n represents the probability corresponding to the number n of radius increasing from the center outward; n represents the probability that the radius r increases by 1 pixel in d it and d it +1 the number of pixels that appear between; d min In order to increase the calculation speed, the minimum value of the probability is calculated starting from a number greater than 0; d r Indicates d it By 1 pixel length;
[0064] S52, using the maximum probability calculation formula to count the pixel coordinates (x i ,y i ), get the center point (x) of the two-dimensional image i0 ,y i0 ), r>d it And r <d it +1.
[0065] As a possible implementation of this embodiment, the maximum probability calculation formula is:
[0066]
[0067] In the formula, p i Indicates p n The probability at pixel i.
[0068] As a possible implementation of this embodiment, in step S52, the pixel point (x i0 ,y i0 ) is the center point of the two-dimensional projection plane.
[0069] As a possible implementation of this embodiment, in step S6, if there are multiple annular two-dimensional images, there are corresponding multiple two-dimensional circular center coordinates (x im ,yim ), where m is the number of annular two-dimensional images.
[0070] like Figure 2 As shown, an embodiment of the present invention provides a device for extracting the center line of a quasi-cylindrical object using a point cloud, comprising:
[0071] A point cloud scanning module is used to obtain a quasi-circular target whose center line is to be extracted, and to perform a three-dimensional point cloud scanning on the quasi-circular target to obtain three-dimensional point cloud data;
[0072] The point cloud cutting module is used to cut the point cloud at equal intervals along the center line direction of the target in the three-dimensional point cloud data to form multiple ring point clouds with noise;
[0073] A point cloud projection module is used to project the noisy annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image;
[0074] A distance calculation module, used to calculate the distances from all points inside the annular two-dimensional image to external points on the projected image;
[0075] The probability calculation module is used to calculate the probability of each distance, and the corresponding pixel position when the probability of a certain distance is the maximum is the plane center point (x, y) of the corresponding annular point cloud of the two-dimensional image; the z value when the annular point cloud is cut in the center line direction is associated to form the three-dimensional coordinates (x, y, z) of the center point;
[0076] The centerline acquisition module is used to connect the three-dimensional coordinates (x, y, z) of all the center points of the equally spaced cut annular point cloud to obtain the centerline of the cylinder.
[0077] The following uses a steelmaking furnace as an example to describe the specific process of detecting the center line of a cylindrical object.
[0078] Step 1: Scan the 3D point cloud of a circular target. If the target is large and requires multi-station scanning, the multi-station clouds must be unified into the same coordinate system through point cloud matching technology, such as Figure 3 shown.
[0079] Step 2: According to the size of the target object, the point cloud is cut at equal intervals along the center line to form n annular noisy point clouds.
[0080] Step 3: Project the annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image, such as Figure 4 As shown in the figure, due to the characteristics of scanning and target, an incomplete projection image will appear, but it will not affect the center point extraction.
[0081] Step 4: Calculate the distance from all points inside the annular image to the projected image. The distance step is in pixels, and the radius is calculated gradually from small to large:
[0082]
[0083] Where, d it represents the distance between pixel i and pixel t; (x i ,y i ) represents the two-dimensional coordinates of pixel i on the non-two-dimensional image in the center of the image (the black part inside the white image in the image); (X t , Y t ) represents the two-dimensional image coordinates of t on the two-dimensional projection image (the white part in the image).
[0084] Step 5: Calculate the probability of occurrence of each distance, and the corresponding pixel position when the probability of occurrence of a certain distance is the maximum is the center point of the two-dimensional image.
[0085] The specific steps of the fifth step are as follows:
[0086] 1) With d it The radius is gradually increased by 1 pixel, and the number of pixels (x i ,y i ) as the origin, with d it and d it +1 Pixels in the ring area (X t , Y t ) probability value, considering that as the radius increases, d it and d it +1 The more pixels there are in the annular area, the more weight p of the radius correction must be increased. n ,but:
[0087]
[0088] Where: p n represents the probability corresponding to the number n of radius increasing from the center outward; n represents the probability that the radius r increases by 1 pixel in d it and d it +1 the number of pixels that appear between; d min In order to increase the calculation speed, the minimum value of the probability is calculated starting from a number greater than 0; d r Indicates d it By 1 pixel length;
[0089] 2) Count the distance of a certain radius (r>d it And r <d it +1)The pixel coordinate (x i ,y i ) is the center point of the two-dimensional image (x i0 ,yi0 ), the maximum probability calculation formula is:
[0090]
[0091] In the formula, p i Indicates p n The probability at pixel i.
[0092] like Figure 5 As shown, the probability is the largest at the radius r = 130, and the corresponding pixel point (x i0 ,y i0 ) is the center point of the two-dimensional projection plane.
[0093] Step 6: If there are m annular 2D images, then there are m 2D circular center coordinates (x im ,y im ), connecting all the center points is the center line of the cylinder.
[0094] The centerline extraction technology for large-scale quasi-circular structures or workpieces proposed in the present invention adopts a centerline extraction method based on statistical robustness, and uses a movable laser scanner to perform three-dimensional scanning on the extraction target object to obtain a three-dimensional point cloud with a unified coordinate system; then the point cloud is cut into multiple sections to form multiple quasi-circular two-dimensional images; finally, the two-dimensional image is statistically center-point extracted, and multiple center points are connected to form the centerline of the quasi-circular structure or large workpiece.
[0095] Compared with the prior art, the present invention has the following advantages:
[0096] 1. Good flexibility. The present invention is not limited to the location, size of the extracted target, roundness of the circular structure and other conditions, as long as it is an approximately circular target.
[0097] 2. High extraction efficiency. The traditional method of extracting point clouds requires filtering the original point clouds, removing noise, etc. The entire operation process is time-consuming and the accuracy is easily affected by the technical level of the operator. Compared with the traditional method of extracting point clouds, the present invention has high efficiency in extracting the center line of a cylindrical object.
[0098] 3. It has strong robustness and is insensitive to point cloud noise, circular incompleteness, and even structures that are not very circular. The present invention is based on statistical probability. In the process of center extraction, it is not necessary to filter the original point cloud for noise. The original point cloud is directly used, and the original point cloud is divided into equal intervals in the vertical direction and the center line is extracted according to the density.
[0099] An embodiment of the present invention provides an electronic device, including a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform any step of the above-mentioned method for extracting the center line of a cylindrical object using a point cloud.
[0100] Specifically, the above-mentioned memory and processor can be general-purpose memory and processor, which are not specifically limited here. When the processor runs the computer program stored in the memory, the above-mentioned method of extracting the center line of a quasi-cylinder using a point cloud can be executed.
[0101] Those skilled in the art will appreciate that the structure of the computer device does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.
[0102] In some embodiments, the computer device may also include a touch screen that can be used to display a graphical user interface (e.g., a startup interface of an application) and receive user operations on the graphical user interface (e.g., startup operations on an application). The specific touch screen may include a display panel and a touch panel. The display panel may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. The touch panel may collect the user's contact or non-contact operations on or near it, and generate pre-set operation instructions, for example, the user uses any suitable object such as a finger, stylus, or accessories on or near the touch panel. In addition, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation and posture, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into information that the processor can process, and then sends it to the processor, and can receive and execute commands from the processor. In addition, the touch panel can be implemented by various types such as resistive, capacitive, infrared and surface acoustic wave, and any technology developed in the future can also be used to implement the touch panel. Further, the touch panel can cover the display panel, and the user can operate on or near the touch panel covered on the display panel according to the graphical user interface displayed on the display panel. After the touch panel detects the operation on or near it, it is transmitted to the processor to determine the user input, and then the processor provides corresponding visual output on the display panel in response to the user input. In addition, the touch panel and the display panel can be implemented as two independent components or integrated.
[0103] Corresponding to the method for starting the above-mentioned application, an embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for extracting the center line of a cylindrical object using a point cloud are executed.
[0104] The application startup device provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present application, its implementation principle and the technical effect produced are the same as those in the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0105] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0106] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0107] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0108] In addition, each functional module in the embodiments provided in the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0109] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0110] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for extracting the center line of a quasi-cylindrical object using a point cloud, characterized in that: The steps include: Step S1, obtaining a quasi-circular target whose center line is to be extracted, and performing a three-dimensional point cloud scan on the quasi-circular target to obtain three-dimensional point cloud data; Step S2, cutting the point cloud at equal intervals along the center line direction of the target in the three-dimensional point cloud data to form a plurality of annular point clouds with noise; Step S3, projecting the noisy annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image; Step S4, calculating the distances from all points inside the annular two-dimensional image to external points on the projection image; Step S5, calculating the probability of occurrence of each distance, and obtaining the pixel corresponding to the maximum probability of occurrence of a certain distance as the plane center point (x, y) of the corresponding annular point cloud of the two-dimensional image; associating the z value when the annular point cloud is cut in the center line direction to form the three-dimensional coordinates (x, y, z) of the center point; Step S6, connecting the three-dimensional coordinates (x, y, z) of all the center points of the equally spaced cut annular point cloud to obtain the center line of the cylinder.
2. The method for extracting the center line of a quasi-cylinder using a point cloud according to claim 1, characterized in that: In step S1, when multiple point cloud sites are required to perform three-dimensional point cloud scanning on a quasi-circular target, the point clouds of all sites are unified into the same coordinate system through point cloud matching technology.
3. The method for extracting the center line of a quasi-cylindrical object using a point cloud according to claim 1, characterized in that: In step S4, the step size is in pixels, and the distances from all points inside the annular two-dimensional image to the external points on the projection image are gradually calculated in order from small to large radius: Where, d it represents the distance between pixel i and pixel t; (x i ,y i ) represents the two-dimensional coordinates of pixel i on the non-two-dimensional image in the center of the image; (X t , Y t ) represents the two-dimensional image coordinates of t on the two-dimensional projection image.
4. The method for extracting the center line of a quasi-cylindrical object using a point cloud according to claim 3, characterized in that: The step S5 comprises the following steps: S51, with d it The radius is gradually increased by 1 pixel, and the number of pixels (x i ,y i ) as the origin, with d it and d it +1 Pixels in the ring area (X t , Y t )Probability of occurrence: Where: p n represents the probability corresponding to the number n of radius increasing from the center outward; n represents the probability that the radius r increases by 1 pixel in d it and d it +1 the number of pixels that appear between d min Indicates that the minimum value of the probability calculation starts from a number greater than 0; d r Indicates d it By 1 pixel length; S52, using the maximum probability calculation formula to count the pixel coordinates (x i ,y i ), get the center point (x) of the two-dimensional image i0 ,y i0 ), r>d it And r <d it +1.
5. The method for extracting the center line of a quasi-cylindrical object using a point cloud according to claim 4, characterized in that: The maximum probability calculation formula is: In the formula, p i Indicates p n The probability at pixel i.
6. The method for extracting the center line of a quasi-cylindrical object using a point cloud according to claim 4, characterized in that: In step S52, the pixel point (x i0 ,y i0 ) is the center point of the two-dimensional projection plane.
7. The method for extracting the center line of a quasi-cylindrical object using a point cloud according to claim 5, characterized in that: In step S6, if there are multiple annular two-dimensional images, there are corresponding multiple two-dimensional circular center coordinates (x im ,y im ), where m is the number of annular two-dimensional images.
8. A device for extracting the center line of a cylindrical object using a point cloud, characterized in that: include: A point cloud scanning module is used to obtain a quasi-circular target whose center line is to be extracted, and to perform a three-dimensional point cloud scanning on the quasi-circular target to obtain three-dimensional point cloud data; The point cloud cutting module is used to cut the point cloud at equal intervals along the center line direction of the target in the three-dimensional point cloud data to form multiple ring point clouds with noise; A point cloud projection module is used to project the noisy annular point cloud onto a two-dimensional plane perpendicular to the center line to form an annular two-dimensional image; A distance calculation module, used to calculate the distances from all points inside the annular two-dimensional image to external points on the projected image; The probability calculation module is used to calculate the probability of each distance, and the corresponding pixel position when the probability of a certain distance is the maximum is the plane center point (x, y) of the corresponding annular point cloud of the two-dimensional image; the z value when the annular point cloud is cut in the center line direction is associated to form the three-dimensional coordinates (x, y, z) of the center point; The centerline acquisition module is used to connect the three-dimensional coordinates (x, y, z) of all the center points of the equally spaced cut annular point cloud to obtain the centerline of the cylinder.
9. An electronic device, characterized in that: It includes a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the method for extracting the center line of a quasi-cylinder using a point cloud as described in any one of claims 1-7.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, executes the steps of the method for extracting the center line of a quasi-cylinder using a point cloud as described in any one of claims 1 to 7.
Citation Information
Cited By
Cylinder detection method and device, electronic equipment and storage medium
CN119887767A
Three-dimensional point cloud-based taproot system main root point cloud extraction method, system and device
CN120708212A
A method, system and device for extracting a main root point cloud of a taproot system based on a three-dimensional point cloud
CN120708212B