A method and system for detecting multiple types of holes on a surface of a rotating body
By downsampling the 3D point cloud data of the rotating body surface and parametrically unfolding the cylinder, combined with multi-feature fusion rules, 3D wireframe models of multiple types of holes are identified and generated. This solves the problems of surface curvature interference and single detection type in the existing technology, and achieves high-precision and efficient hole detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF SCI & TECH
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies struggle to simultaneously identify other types of holes on the surface of a rotating body besides circular holes, and the curvature of the surface interferes with detection accuracy, failing to meet high-precision requirements.
By acquiring 3D point cloud data of the surface of the rotating body, performing downsampling and normal estimation preprocessing, fitting a cylindrical model, unfolding it into 2D point cloud data, using multi-feature fusion rules to determine the hole type, and generating a 3D wireframe model through inverse coordinate transformation.
It eliminates surface curvature interference, improves detection accuracy, breaks through the limitation of single detection type, reduces computational complexity, and ensures the reliability and visualization of detection results.
Smart Images

Figure CN122199456A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and system for detecting multiple types of holes on the surface of a rotating body. Background Technology
[0002] In aerospace, petrochemical, nuclear, and shipbuilding industries, rotating components with surface perforations are widely used, such as missile hulls, pressure vessels, oil pipelines, and nuclear reactor cooling pipes. These perforations are used to install functional components such as sensors, valves, connectors, and observation windows, and their positional and dimensional accuracy directly affects the overall assembly quality and performance. Therefore, high-precision automated inspection of perforations on the surfaces of rotating bodies has significant engineering application value.
[0003] Currently, by converting the point cloud of the circular hole detection area into a point cloud depth map, a point cloud region matching the circular hole features is constructed using Haar features. This region is then projected onto a planar projection map to calculate the circumferential gradient, thereby locating the center of the hole. The hole location is quickly determined on the point cloud using Haar feature templates, and cascaded boost classification technology is used for precise hole localization. Combining this with 2D image edge detection improves detection accuracy.
[0004] However, existing technologies mainly target circular holes and cannot simultaneously identify other types of holes such as rectangular holes, resulting in a relatively limited range of detection types. Furthermore, existing technologies directly process 3D point clouds, and for holes on curved surfaces such as cylinders, the curvature of the surface can interfere with the extraction of hole features, affecting detection accuracy and making it difficult to meet the requirements for high-precision detection. Summary of the Invention
[0005] To address the limitations of existing technologies, which primarily target circular holes and struggle to simultaneously identify other hole types such as rectangular holes, resulting in a limited range of detection types; furthermore, existing technologies directly process 3D point clouds, and for holes on curved surfaces such as cylinders, the curvature of the surface can interfere with the extraction of hole features, affecting detection accuracy and failing to meet the demands for high-precision detection, this invention provides a method and system for detecting multiple types of holes on the surface of a rotating body.
[0006] The technical solutions provided by the embodiments of the present invention are as follows: The first aspect of this invention provides a method for detecting multiple types of pores on the surface of a rotating body, comprising: S1: Obtain the three-dimensional point cloud data of the surface of the rotating body; S2: Preprocessing of 3D point cloud data by downsampling and normal estimation; S3: Based on the preprocessed 3D point cloud data, fit the cylinder model using the least squares algorithm to obtain the cylinder parameters; S4: Based on the cylinder parameters, the three-dimensional coordinates of each point in the preprocessed three-dimensional point cloud data are parameterized and expanded into two-dimensional coordinates through the local UV coordinate system of the cylinder surface to obtain two-dimensional point cloud data; S5: Perform image processing on the two-dimensional point cloud data to obtain the two-dimensional contour information of each hole region; S6: Based on two-dimensional contour information, the type of hole is determined through multi-feature fusion rules; S7: Calculate the two-dimensional geometric parameters of each type of hole according to the hole type; S8: Through inverse coordinate transformation, the two-dimensional geometric parameters are mapped back to three-dimensional space to generate three-dimensional wireframe models of various types of holes; S9: Overlays the 3D wireframe model with the 3D point cloud data and outputs the detection results of multiple types of holes on the surface of the rotating body.
[0007] A second aspect of the present invention provides a multi-type hole detection system for the surface of a rotating body, comprising: processor; A memory storing computer-readable instructions, which, when executed by the processor, implement the method for detecting multiple types of holes on the surface of a rotating body as described in the first aspect.
[0008] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for detecting multiple types of holes on the surface of a rotating body as described in the first aspect.
[0009] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, the three-dimensional point cloud is isometrically transformed into a two-dimensional planar point cloud by parametric unfolding of a cylindrical surface, eliminating the interference of surface curvature on hole detection and improving detection accuracy. Multi-feature fusion classification rules simultaneously identify circular holes, rectangular holes, and other types of holes, overcoming the limitation of existing technologies that only detect a single type. By reducing the three-dimensional problem to two-dimensional image processing, computational complexity is reduced and detection efficiency is improved. Finally, the detection results are mapped back to three-dimensional space for visualization verification through inverse coordinate transformation, ensuring the reliability of the detection results. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1This is a flowchart illustrating a method for detecting multiple types of pores on the surface of a rotating body, as provided in an embodiment of the present invention.
[0012] Figure 2 This is a schematic diagram of a three-dimensional back-projection visualization of hole detection results provided in an embodiment of the present invention.
[0013] Figure 3 This is a schematic diagram of a multi-type hole detection system for the surface of a rotating body provided in an embodiment of the present invention. Detailed Implementation
[0014] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0015] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0016] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0017] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Reference manual attached Figure 1 The diagram shows a flowchart of a method for detecting multiple types of holes on the surface of a rotating body according to an embodiment of the present invention.
[0020] This invention provides a method for detecting multiple types of holes on the surface of a rotating body. This method can be implemented using a device for detecting multiple types of holes on the surface of a rotating body, which can be a terminal or a server. The processing flow of the method for detecting multiple types of holes on the surface of a rotating body may include the following steps: S1: Obtain the three-dimensional point cloud data of the surface of the rotating body.
[0021] Among them, 3D point cloud data refers to a set of data that represents the geometric information of an object's surface in the form of discrete points, obtained by devices such as 3D laser scanners, line structured light sensors, or depth cameras.
[0022] S2: Perform downsampling and normal estimation preprocessing on the 3D point cloud data.
[0023] Downsampling refers to reducing the number of points in a point cloud by using a specific sampling strategy while preserving the key geometric features of the point cloud, thereby reducing the computational complexity of subsequent processing.
[0024] In one possible implementation, S2 specifically includes sub-steps S201 and S202: S201: Downsampling the 3D point cloud data. Specific downsampling methods include voxel meshing, random sampling, and uniform sampling.
[0025] S202: Based on downsampled 3D point cloud data, a spatial index is constructed using the KD-Tree algorithm to estimate the normal vector of each point and unify the direction of the normal vector.
[0026] KD-Tree refers to a data structure used to partition k-dimensional space, short for k-dimensional tree. By recursively dividing the space into two subspaces and constructing a tree-like index structure, it can efficiently support operations such as nearest neighbor search and radius search.
[0027] Specifically, the 3D point cloud of the input solid of revolution surface is downsampled to reduce the amount of data while preserving geometric features. This invention provides three downsampling methods for selection: the voxel mesh method divides the space into a regular mesh, replacing the original points with the geometric centers of the points within the mesh; the random sampling method directly selects a specified number of points randomly from the original point cloud; and the uniform sampling method uses DBSCAN density clustering to select the center point from each cluster, achieving a uniform spatial distribution. After downsampling, a KD-Tree spatial index is constructed to estimate the normal vector of each point and unify the normal direction.
[0028] DBSCAN density clustering refers to a density-based spatial clustering algorithm, short for Density-Based Spatial Clustering of Applications with Noise. This algorithm groups spatially densely connected points into clusters by setting two parameters: neighborhood radius and minimum number of points, and can also identify noise points.
[0029] In this embodiment of the invention, downsampling significantly reduces the amount of data while preserving key geometric features, thereby lowering the computational complexity of subsequent processing. Local geometric properties of the point cloud are obtained through normal estimation, providing necessary basic information for accurate cylinder fitting and improving overall processing efficiency.
[0030] S3: Based on the preprocessed 3D point cloud data, fit the cylinder model using the least squares algorithm to obtain the cylinder parameters.
[0031] The least squares algorithm is a mathematical optimization technique that finds the best function fit for data by minimizing the sum of squared errors. In cylinder fitting, the least squares algorithm iteratively optimizes the cylinder parameters (axial direction, center, radius) to minimize the sum of squared distances from all points to the fitted cylinder surface, thus obtaining the optimal cylinder model.
[0032] In one possible implementation, S3 specifically includes sub-steps S301 to S304: S301: Set the initial cylinder parameters based on the preprocessed 3D point cloud data.
[0033] S302: Construct the objective function to minimize the sum of squares of the differences between the distance from a point to the axis of the cylinder and the fitted radius.
[0034] S303: The objective function is iteratively optimized using the Levenberg-Marquardt nonlinear least squares algorithm to obtain the cylinder parameters. These parameters include the axial vector, center point, and radius.
[0035] The Levenberg-Marquardt nonlinear least squares algorithm is an optimization algorithm that combines gradient descent and Gauss-Newton methods, specifically designed to solve nonlinear least squares problems.
[0036] Specifically, a least-squares method based on Levenberg-Marquardt nonlinear optimization is used to fit the cylindrical model. The objective function is to minimize the sum of the squares of the differences between the distances from a point to the axis and the fitted radius. This yields the cylinder's axial vector *a*, center point coordinates *c*, and radius *r*, providing the geometric basis for subsequent surface development. The cylinder fitting uses the objective function of minimizing the error in the distance from the point to the axis, and the optimal cylinder parameters are solved through nonlinear optimization.
[0037] Furthermore, the objective function for fitting the cylinder is: in, Let represent the objective function for fitting the cylinder. This represents the distance from the i-th point to the axis of the cylinder. Let represent the radius of the cylinder. The Levenberg-Marquardt nonlinear least squares algorithm is used for iterative optimization. The initial axis vector is set to (0,0,1), the initial center is set to the centroid of the point cloud, and the initial radius is estimated by the standard deviation of the projection of the point cloud onto a plane perpendicular to the initial axis.
[0038] In this embodiment of the invention, a nonlinear least squares algorithm is used to accurately fit the cylindrical model, obtain accurate axial vector, center point and radius parameters, provide accurate geometric reference for subsequent surface development, and fundamentally ensure detection accuracy.
[0039] S4: Based on the cylinder parameters, the three-dimensional coordinates of each point in the preprocessed three-dimensional point cloud data are parameterized and expanded into two-dimensional coordinates through the local UV coordinate system of the cylinder surface to obtain two-dimensional point cloud data.
[0040] The local UV coordinate system of a cylindrical surface refers to an orthogonal coordinate system established on a cylindrical surface, used to map points on a three-dimensional cylindrical surface to a two-dimensional plane. This coordinate system uses the cylinder axis as a reference and constructs two orthogonal basis vectors u and v, such that u is perpendicular to the axial direction and v is perpendicular to both the axial direction and u, together with the axial vector a, to form a right-handed orthogonal coordinate system.
[0041] In one possible implementation, S4 specifically includes sub-steps S401 to S406: S401: Based on the axial vector in the cylinder parameters, establish a local UV coordinate system for the cylindrical surface to obtain mutually orthogonal basis vectors.
[0042] In one possible implementation, S401 specifically includes sub-steps S4011 to S4013: S4011: Select a temporary vector that is linearly independent of the axial vector.
[0043] S4012: Based on the axial vector and the temporary vector, the first orthogonal basis vector is calculated through the cross product operation.
[0044] The cross product operation, also known as the vector product or cross product, is a binary operation in three-dimensional vector space.
[0045] S4013: The second orthogonal basis vector is calculated by cross product operation based on the axial vector and the first orthogonal basis vector.
[0046] Specifically, a temporary vector t is selected that is linearly independent of the axial vector a, when If the condition is met, then t = (1, 0, 0); otherwise, t = (0, 1, 0). This is achieved through cross product operations. Obtain the first orthogonal basis vector u and normalize it, then... We obtain the second orthogonal basis vector v, such that {u,v,a} form a right-handed orthogonal coordinate system.
[0047] S402: Calculate the vector from each 3D point in the 3D point cloud data to the center point of the cylinder.
[0048] S403: Calculate the axial projection height of a 3D point on the axial direction of the cylinder based on the dot product of the vector and the axial vector.
[0049] S404: Calculate the radial vector of a three-dimensional point on the cross-section of a cylinder based on the vector and its axial projection component.
[0050] S405: Calculate the circumferential angle of a 3D point on the cylinder circumference based on the dot product of the radial vector and the basis vector.
[0051] S406: Determine the two-dimensional coordinates and obtain two-dimensional point cloud data based on the product of the circumferential angle and the cylinder radius, as well as the axial projection height.
[0052] Specifically, using the fitted cylindrical axial vector 'a' as the reference, a local UV-orthogonal coordinate system is established on the cylindrical surface. A temporary vector 't', linearly independent of the axial vector, is selected, and orthogonal basis vectors 'u' and 'v' are obtained through two cross product operations, such that {u,v,a} constitute a right-handed orthogonal coordinate system.
[0053] Furthermore, for each 3D point p in the point cloud, first calculate the vector from the point to the center of the cylinder: Then calculate the axial projection height: Next, calculate the radial vector vr and determine the circumferential angle: in, Representing a three-dimensional point, Indicates the center point of the cylinder. This represents the vector from the point to the center of the cylinder. This represents the axial vector of the cylinder. Indicates the axial projection height. Indicates the circumferential angle. Represents the bivariate arctangent function. This represents the radial vector of point p on the cross-section of the cylinder. These represent the orthogonal basis vectors obtained from two cross product operations.
[0054] Furthermore, utilizing the mathematical properties of developable cylindrical surfaces, the three-dimensional coordinates (x, y, z) are parametrically transformed into two-dimensional coordinates (x, y, z). ,h): in, This represents the circumferential coordinates of a 3D point on a 2D plane after it has been unfolded. This represents the axial coordinates of a 3D point on a 2D plane after it has been unfolded. This represents the radius of the cylinder. This transformation preserves the arc length relationship on the cylinder surface, achieving equidistant unfolding, so that the geometric dimensions of the unfolded hole are consistent with the actual dimensions.
[0055] In this embodiment of the invention, the mathematical properties of the developable cylindrical surface are utilized to unfold the three-dimensional surface point cloud into a two-dimensional planar point cloud at equal intervals, completely eliminating the interference of surface curvature on the extraction of hole geometric features, so that the size of the unfolded hole is consistent with the actual size, and significantly improving the detection accuracy.
[0056] S5: Perform image processing on the two-dimensional point cloud data to obtain the two-dimensional contour information of each hole region.
[0057] In one possible implementation, S5 specifically includes sub-steps S501 to S505: S501: Combines a preset scaling factor to rasterize two-dimensional point cloud data into a binary image.
[0058] It should be noted that those skilled in the art can set the size of the preset scaling factor according to actual needs, and this invention does not limit it.
[0059] S502: Perform morphological closing operations on a binary image using a rectangular structuring element.
[0060] Among them, morphological closing operation refers to a basic morphological operation in image processing, which consists of two steps: dilation and erosion.
[0061] S503: Perform color inversion on the processed image to obtain a white connected component.
[0062] S504: Extract the boundary contours of the white connected domains using a contour detection algorithm.
[0063] S505: Combine the minimum area threshold to filter the boundary contour and obtain the two-dimensional contour information of each hole region.
[0064] Specifically, the unfolded 2D point cloud is rasterized into a binary image according to a set scaling factor. Pixels covered by the point cloud are set to white, and pixels not covered by the point cloud are set to black. Due to the discreteness of point cloud sampling, gaps exist between points in the directly generated image. Morphological closing operations (dilation followed by erosion) are used to fill these gaps iteratively m times with n×n rectangular structuring elements, so that points belonging to the same surface region form continuous white areas. The processed image is then inverted to make the hole regions (areas originally not covered by the point cloud) appear as white-zero connected components. Finally, a contour detection algorithm is used to extract the boundary contours of each hole region, and a minimum area threshold is set to filter out small regions caused by noise.
[0065] It should be noted that those skilled in the art can set the minimum area threshold according to actual needs, and this invention does not limit it.
[0066] Furthermore, the value of n ranges from 3 to 7, and the value of m ranges from 2 to 5. The specific values are adjusted according to the point cloud density and the hole size.
[0067] In this embodiment of the invention, the two-dimensional point cloud is converted into a binary image, and mature image processing algorithms are used for morphological operations and contour detection. This can efficiently and accurately extract the boundary contours of the hole region, laying the foundation for subsequent hole classification and parameter calculation.
[0068] S6: Based on two-dimensional contour information, the type of hole is determined through multi-feature fusion rules.
[0069] In one possible implementation, S6 specifically includes sub-steps S601 to S604: S601: Calculate the roundness feature, rectangle angle feature, and area ratio feature based on the information of each two-dimensional contour.
[0070] S602: Based on the roundness characteristics and the average error of least-squares circle fitting of the contour points, determine whether the two-dimensional contour information meets the criteria for a circular hole. If yes, the contour is determined to be a circular hole. Otherwise, proceed to step S603.
[0071] Least squares circle fitting is a method for estimating the parameters of a circle based on the least squares principle. It is used to find the optimal fitted circle from a discrete set of contour points.
[0072] Specifically, the least squares circle fitting method is as follows: For the contour point set Establish an overdetermined system of linear equations: Solving for the parameters (a, b, c) using the least squares method, the center coordinates are (a, b), and the radius is: in, and Let x and y represent the two-dimensional x-coordinate and y-coordinate of the i-th point on the contour, respectively. Let represent the radius of the fitted circle, and a and b represent the x-coordinate and y-coordinate of the circle's center, respectively, after fitting. This represents the intermediate parameters to be solved.
[0073] Calculate the distance error from all contour points to the fitted circle. When the average distance error is less than 17% of the fitted radius, it is confirmed as a circular hole.
[0074] S603: Based on the rectangular angle features and area ratio features, determine whether the two-dimensional contour information meets the criteria for a rectangular hole. If yes, determine that the contour is a rectangular hole. Otherwise, proceed to step S604.
[0075] S604: When neither the circular hole determination condition nor the rectangular hole determination condition is met, the determination contour is other types of holes.
[0076] Specifically, for each extracted contour, three types of discriminative features are calculated: roundness feature C, rectangle angle feature A, and area ratio feature R. Intelligent classification of hole types is achieved through multi-feature fusion rules: Circular hole discrimination: When roundness C > 0.3 and the average error of the least-squares circle fitting is less than a set threshold proportion of the fitted radius, it is determined to be a circular hole. Rectangular hole discrimination: When all four interior angles of the smallest bounding rectangle are within a set angle range, and the ratio of the contour area to the rectangle area is greater than a set threshold, it is determined to be a rectangular hole. Other types of holes: Contours that do not meet the above conditions are classified as other types of holes.
[0077] It should be noted that those skilled in the art can set the size of the ratio threshold according to actual needs, and this invention does not limit it.
[0078] Furthermore, for each detected contour, three types of discriminative features are extracted for multi-feature fusion classification, specifically as follows: Roundness characteristics : in, S represents the roundness characteristic, S represents the contour area, L represents the contour perimeter, and the roundness value of a standard circle is 1.
[0079] The angular characteristic A of the rectangle refers to the degree of deviation of the four interior angles of the smallest circumscribed rectangle from 90°.
[0080] Specifically, the method for calculating the rectangular angle feature A is as follows: Connect the four vertices of the smallest bounding rectangle in order to form four edge vectors. Calculate the angle between adjacent edge vectors: in, This represents the angle between two adjacent edge vectors, i.e., the interior angle of a rectangle. Represents the inverse cosine function. This represents the i-th edge vector among the four edge vectors. Indicates and The next adjacent edge vector, This indicates the length of the vector.
[0081] The contour is considered to have rectangular characteristics when all included angles αᵢ satisfy 80° < αᵢ < 100°. Simultaneously, the ratio of the contour area to the area of the smallest bounding rectangle must be greater than 0.8 to exclude false positives for non-rectangular contours.
[0082] The area ratio feature R is the ratio of the outline area to the area of the smallest bounding rectangle.
[0083] In this embodiment of the invention, by using multi-feature fusion classification of roundness features, rectangular angle features and area ratio features, combined with the least squares circle fitting error criterion and rectangular interior angle constraint conditions, it is possible to simultaneously and accurately identify circular holes, rectangular holes and other types of holes, breaking through the limitation of the existing technology in detecting only one type.
[0084] S7: Calculate the two-dimensional geometric parameters of each type of hole according to the hole type.
[0085] In one possible implementation, S7 specifically refers to: For the outline determined to be a circular hole, the two-dimensional coordinates of the circle's center and the circle's radius are calculated by least-squares circle fitting.
[0086] For the outline determined to be a rectangular hole, calculate the minimum bounding rectangle to obtain the two-dimensional coordinates of the rectangle's center, the rectangle's width, the rectangle's height, and the rectangle's rotation angle.
[0087] Furthermore, the classification rules are as follows: First, determine the roundness of the hole; if the roundness... Furthermore, after performing least-squares circle fitting on the contour points, if the average distance error from all contour points to the fitted circle is less than 17% of the fitted radius, then it is determined to be a circular hole. Otherwise, a rectangular hole is determined. If the four interior angles of the smallest bounding rectangle are all within the range of 80° to 100°, and the ratio of the contour area to the rectangle area is greater than 0.8, then it is determined to be a rectangular hole. All other cases are determined to be other types of holes.
[0088] In this embodiment of the invention, corresponding parameter calculation methods are used for different types of holes. For circular holes, the center coordinates and radius are output, and for rectangular holes, the center coordinates, width, height and rotation angle are output, providing accurate two-dimensional geometric data for subsequent three-dimensional reconstruction.
[0089] S8: Through inverse coordinate transformation, the two-dimensional geometric parameters are mapped back to three-dimensional space to generate three-dimensional wireframe models of various types of holes.
[0090] In this context, a 3D wireframe model refers to a geometric model that uses vertices and edges (line segments) to represent the shape of a 3D object. It describes the structure of the object only through its edges and contours, without including surface filling information.
[0091] In one possible implementation, S8 specifically refers to: Based on the two-dimensional coordinates of the circle's center and the circle's radius, the three-dimensional coordinates of each point on the boundary of the circular hole are calculated through inverse coordinate transformation, generating a three-dimensional wireframe model of the circular hole.
[0092] Based on the two-dimensional coordinates of the rectangle's center, width, height, and rotation angle, the two-dimensional coordinates of the four vertices of the rectangular hole are calculated. Then, through inverse coordinate transformation, the three-dimensional coordinates of each vertex of the rectangular hole are calculated, and these coordinates are connected to generate a three-dimensional wireframe model of the rectangular hole.
[0093] Specifically, for holes determined to be circular, a standard circle is fitted using the least squares method to calculate the two-dimensional coordinates of the center and the radius. For holes determined to be rectangular, the two-dimensional coordinates of the center, width, height, and rotation angle of the smallest bounding rectangle are calculated. The two-dimensional geometric parameters are then mapped back to three-dimensional space through an inverse coordinate transformation: Let... Then the three-dimensional coordinates are: in, This represents the circumferential coordinates of the hole on the two-dimensional unfolded plane. This represents the axial height coordinate of the hole on the two-dimensional unfolded plane. Indicates the radius of the cylinder. This represents the angular coordinates of the hole in the circumference of the cylinder. This indicates the height coordinate of the hole along the axial direction of the cylinder. Represents the coordinates of the center point of the cylinder. This represents the unit vector along the axis of the cylinder. This represents the three-dimensional coordinates of a point on the hole after it has been mapped back to three-dimensional space. Represents the cosine function. This represents the sine function.
[0094] Furthermore, the precise location and size of the hole on the original cylindrical surface are obtained using the above formula. Simultaneously, a 3D wireframe model of the hole's boundary is generated. For the circular hole, a green closed wireframe is formed by uniformly sampling the circumference at 60 points, while for the rectangular hole, a red closed wireframe is formed by connecting the four vertices.
[0095] In this embodiment of the invention, a two-way coordinate mapping relationship from two-dimensional to three-dimensional is established, and the detected two-dimensional geometric parameters are accurately mapped back to the original cylindrical surface to generate a three-dimensional wireframe model of the hole, thereby realizing the accurate positioning and visualization of the detection results in three-dimensional space.
[0096] Reference manual attached Figure 2 The diagram shows a schematic representation of a three-dimensional back-projection visualization of hole detection results provided by an embodiment of the present invention.
[0097] S9: Overlays the 3D wireframe model with the 3D point cloud data and outputs the detection results of multiple types of holes on the surface of the rotating body.
[0098] In this embodiment of the invention, the generated 3D wireframe model is superimposed on the original point cloud for display. Circular holes are presented with green wireframes and rectangular holes with red wireframes, thereby realizing the visual verification of the detection results, ensuring the reliability and traceability of the detection results, and making it easy for users to intuitively confirm the location and size of the holes.
[0099] For example, firstly, a voxel mesh downsampling method is used, with the voxel size set to 1.0 mm, reducing the number of point clouds to approximately 50,000 points. Then, a KD-Tree is used to construct a spatial index for the point cloud, with a search radius of 5.0 mm and a maximum number of nearest neighbors of 30, to estimate the normal vector of each point and unify the normal direction.
[0100] Furthermore, the cylinder fitting employed the Levenberg-Marquardt nonlinear least squares method, with the objective function being to minimize the sum of squares of the differences between the distance from a point to the cylinder's axis and the fitted radius. Initial parameters were set as follows: initial value for the axial vector (0,0,1), initial value for the center point being the centroid of the point cloud, and initial value for the radius being the standard deviation of the point cloud's projection onto the XY plane. The maximum number of iterations was set to 1000. Fitting results: cylinder radius r = 152.3 mm, axial vector a = (0.002, -0.001, 0.999), center point c = (0.5, -0.3, 175.0) mm.
[0101] Furthermore, a local UV coordinate system is established for the cylindrical surface. A temporary vector t=(1,0,0) is selected. Since |a·t|<0.9, u=a×t=(0.001,0.999,0.001) is directly calculated. After normalization, v=a×u=(-0.999,0.001,0.002).
[0102] Furthermore, for each point p in the original point cloud (unsampling, preserving details), a parametric unfolding transformation is performed: Calculate the point-to-center vector. Calculate the axial height. Calculate the radial vector after axial projection. Calculate the circumferential angle. Output two-dimensional coordinates. The unfolded two-dimensional point cloud ranges as follows: x-direction [-478.5, 478.5] mm (corresponding to the circumference), y-direction [0, 350] mm (corresponding to the axial length of the cabin).
[0103] Furthermore, a scaling factor of scale=10 was set to rasterize the 2D point cloud into a binary image of 9570×3500 pixels. Pixels covered by the point cloud were set to white (255), and pixels not covered by the point cloud were set to black (0). Due to the discreteness of point cloud sampling, small gaps exist in the white areas. A morphological closing operation was performed using a 5×5 rectangular structuring element, iterated 3 times, to fill the gaps and form continuous white areas on the surface. The processed image was then inverted to make the hole areas appear as white connected regions. A contour detection algorithm was used to detect the outer contour of the white connected regions, and a contour area threshold of min was set. area =50 pixels 2 Small noise areas were filtered out. In this embodiment, a total of 23 valid contours were detected.
[0104] Specifically, for each detected contour, three types of discriminative features are calculated: Roundness characteristic calculation: C=4πS / L 2 , where S is the area of the contour and L is the perimeter of the contour.
[0105] Least squares circle fitting: Establish an overdetermined system of equations for the contour point set, and solve for the center and radius r of the circle. Calculate the distance from all contour points to the fitted circle, and determine the mean distance error. dist .
[0106] Minimum bounding rectangle analysis: Calculate the minimum bounding rectangle, obtaining the coordinates of its four vertices, center, width, height, and rotation angle. Calculate the included angles between adjacent edge vectors to determine if they are close to 90°.
[0107] Furthermore, the classification decision is: if C > 0.3 and mean dist If the radius is less than 0.17r, it is determined to be a circular hole. If all four interior angles are within the range of [80°, 100°], and the ratio of the outline area to the rectangle area is greater than 0.8, and the rectangle area is greater than 600 × scale, then the hole is considered a circular hole. 2 Pixels 2 The selected holes were classified as rectangular. The rest were classified as other types of holes. The classification results for this embodiment are: 15 circular holes, 6 rectangular holes, and 2 other types.
[0108] Furthermore, for a circular hole, output the 2D coordinates of the center and the radius r, then convert them back to the actual dimensions (divided by the scale factor). Typical circular hole measurement results: radius r = 8.2 mm, position (θ = 45°, h = 120 mm). For a rectangular hole, output the 2D coordinates of the center, width w, height h, and rotation angle angle. Typical rectangular hole measurement results: width w = 25.5 mm, height h = 15.3 mm, position (θ = 180°, h = 200 mm).
[0109] Furthermore, a 3D back-projection transformation is performed to inversely transform the 2D coordinates into 3D coordinates, generating a 3D wireframe of the hole boundaries: for circular holes, 60 points are uniformly sampled around the circumference to form a green closed wireframe. For rectangular holes, the 3D coordinates of the four vertices are connected to form a red closed wireframe. The wireframes are then overlaid with the original point cloud for visualization verification.
[0110] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, a three-dimensional point cloud is isometrically transformed into a two-dimensional planar point cloud through parameterized unfolding of a cylindrical surface, eliminating the interference of surface curvature on hole detection and improving detection accuracy. Multi-feature fusion classification rules simultaneously identify circular holes, rectangular holes, and other types of holes, overcoming the limitation of existing technologies that only detect a single type. By reducing the three-dimensional problem to two-dimensional image processing, computational complexity is reduced, and detection efficiency is improved. Furthermore, inverse coordinate transformation maps the detection results back to three-dimensional space for visualization verification, ensuring the reliability of the detection results.
[0111] Reference manual attached Figure 3 The diagram shows a structural schematic of a multi-type hole detection system for the surface of a rotating body provided by the present invention.
[0112] The present invention also provides a multi-type hole detection system 20 for the surface of a rotating body, applied to the above-mentioned multi-type hole detection method for the surface of a rotating body, comprising: Processor 201.
[0113] The memory 202 stores computer-readable instructions, which, when executed by the processor 201, implement the method for detecting multiple types of holes on the surface of a rotating body as described in the method embodiment.
[0114] The rotating body surface multi-type hole detection system 20 provided by the present invention can perform the above-mentioned rotating body surface multi-type hole detection method and achieve the same or similar technical effects. To avoid repetition, the present invention will not elaborate further.
[0115] It should be understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0116] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0117] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0118] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0119] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.
[0120] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0121] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0122] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0123] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0124] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0125] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0126] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0127] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for detecting multiple types of holes on the surface of a rotating body as described in the method embodiment.
[0128] The present invention provides a computer-readable storage medium that can implement the steps and effects of the method for detecting multiple types of holes on the surface of a rotating body as described in the above-described method embodiments. To avoid repetition, the present invention will not elaborate further.
[0129] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0130] The following points need to be explained: (1) The accompanying drawings of the embodiments of the present invention only involve the structures involved in the embodiments of the present invention. Other structures can refer to the general design.
[0131] (2) For clarity, the thickness of layers or regions is enlarged or reduced in the drawings used to describe embodiments of the invention, i.e., these drawings are not drawn to scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being “above” or “below” another element, the element may be “directly” located “above” or “below” the other element or there may be intermediate elements.
[0132] (3) Where there is no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.
[0133] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting multiple types of holes on the surface of a rotating body, characterized in that, include: S1: Obtain the three-dimensional point cloud data of the surface of the rotating body; S2: Perform downsampling and normal estimation preprocessing on the three-dimensional point cloud data; S3: Based on the preprocessed 3D point cloud data, fit the cylinder model using the least squares algorithm to obtain the cylinder parameters; S4: Based on the cylinder parameters, the three-dimensional coordinates of each point in the preprocessed three-dimensional point cloud data are parameterized and expanded into two-dimensional coordinates through the local UV coordinate system of the cylinder surface to obtain two-dimensional point cloud data. S5: Perform image processing on the two-dimensional point cloud data to obtain the two-dimensional contour information of each hole region; S6: Based on the two-dimensional contour information, determine the type of hole using multi-feature fusion rules; S7: Calculate the two-dimensional geometric parameters of each type of hole according to the hole type; S8: By inverse coordinate transformation, the two-dimensional geometric parameters are mapped back to three-dimensional space to generate three-dimensional wireframe models of various types of holes; S9: Overlay the three-dimensional wireframe model with the three-dimensional point cloud data and output the detection results of multiple types of holes on the surface of the rotating body.
2. The method for detecting multiple types of holes on the surface of a rotating body according to claim 1, characterized in that, S2 specifically includes: S201: Perform downsampling processing on the three-dimensional point cloud data; wherein, the downsampling methods specifically include voxel mesh method, random sampling method and uniform sampling method; S202: Based on downsampled 3D point cloud data, a spatial index is constructed using the KD-Tree algorithm to estimate the normal vector of each point and unify the direction of the normal vector.
3. The method for detecting multiple types of holes on the surface of a rotating body according to claim 1, characterized in that, S3 specifically includes: S301: Set the initial cylinder parameters based on the preprocessed 3D point cloud data; S302: Construct an objective function that minimizes the sum of squares of the differences between the distance from a point to the axis of the cylinder and the fitted radius; S303: The objective function is iteratively optimized and solved using the Levenberg-Marquardt nonlinear least squares algorithm to obtain the cylinder parameters; wherein, the cylinder parameters include the axial vector, the center point, and the radius.
4. The method for detecting multiple types of holes on the surface of a rotating body according to claim 1, characterized in that, S4 specifically includes: S401: Based on the axial vector in the cylinder parameters, establish the local UV coordinate system of the cylinder surface to obtain mutually orthogonal basis vectors; S402: Calculate the vector from each three-dimensional point in the three-dimensional point cloud data to the center point of the cylinder; S403: Calculate the axial projection height of the three-dimensional point in the axial direction of the cylinder based on the dot product of the vector and the axial vector; S404: Calculate the radial vector of the three-dimensional point on the cross-section of the cylinder based on the vector and the axial projection component of the vector; S405: Calculate the circumferential angle of the three-dimensional point on the cylinder circumference based on the dot product of the radial vector and the basis vector; S406: Determine the two-dimensional coordinates based on the product of the circumferential angle and the cylinder radius, and the axial projection height, to obtain the two-dimensional point cloud data.
5. The method for detecting multiple types of holes on the surface of a rotating body according to claim 4, characterized in that, Specifically, S401 includes: S4011: Select a temporary vector that is linearly independent of the axial vector; S4012: Based on the axial vector and the temporary vector, the first orthogonal basis vector is calculated through the cross product operation; S4013: Based on the axial vector and the first orthogonal basis vector, the second orthogonal basis vector is calculated through the cross product operation.
6. The method for detecting multiple types of holes on the surface of a rotating body according to claim 1, characterized in that, S5 specifically includes: S501: Combine a preset scaling factor to rasterize the two-dimensional point cloud data into a binary image; S502: Perform morphological closing operation on the binary image using rectangular structuring elements; S503: Perform color inversion on the processed image to obtain the white connected component; S504: Extract the boundary contour of the white connected domain using a contour detection algorithm; S505: Combine the minimum area threshold to filter the boundary contour and obtain the two-dimensional contour information of each hole region.
7. The method for detecting multiple types of holes on the surface of a rotating body according to claim 1, characterized in that, S6 specifically includes: S601: Calculate the roundness feature, rectangle angle feature, and area ratio feature based on the two-dimensional contour information; S602: Based on the roundness characteristics and the average error of least-squares circle fitting of the contour points, determine whether the two-dimensional contour information meets the criteria for a circular hole; if so, determine that the contour is a circular hole; otherwise, proceed to step S603. S603: Based on the rectangular angle feature and the area ratio feature, determine whether the two-dimensional contour information meets the rectangular hole determination condition; if yes, determine that the contour is a rectangular hole; otherwise, proceed to step S604. S604: When neither the circular hole determination condition nor the rectangular hole determination condition is met, the outline is determined to be another type of hole.
8. The method for detecting multiple types of holes on the surface of a rotating body according to claim 7, characterized in that, Specifically, S7 is: For the outline determined to be the circular hole, the two-dimensional coordinates of the circle center and the circle radius are calculated by the least squares circle fitting. For the outline determined to be the rectangular hole, calculate the minimum bounding rectangle to obtain the two-dimensional coordinates of the rectangle's center, the rectangle's width, the rectangle's height, and the rectangle's rotation angle.
9. The method for detecting multiple types of holes on the surface of a rotating body according to claim 8, characterized in that, Specifically, S8 is: Based on the two-dimensional coordinates of the circle's center and the circle's radius, the three-dimensional coordinates of each point on the boundary of the circular hole are calculated through the inverse coordinate transformation, thereby generating a three-dimensional wireframe model of the circular hole. Based on the two-dimensional coordinates of the center of the rectangle, the width of the rectangle, the height of the rectangle, and the rotation angle of the rectangle, the two-dimensional coordinates of the four vertices of the rectangular hole are calculated; and through the inverse coordinate transformation, the three-dimensional coordinates of each vertex of the rectangular hole are calculated, and the coordinates are connected to generate a three-dimensional wireframe model of the rectangular hole.
10. A multi-type hole detection system for the surface of a rotating body, characterized in that, include: processor; A memory storing computer-readable instructions, which, when executed by the processor, implement the method for detecting multiple types of holes on the surface of a rotating body as described in any one of claims 1 to 9.