Straddle-type monorail finger plate image segmentation and bolt loosening detection method and system
By acquiring 3D point cloud images through line laser scanning and segmenting bolt regions using an improved Euclidean clustering method, combined with template matching and normalized cross-correlation coefficient localization, the automation and accuracy issues of loosening detection of finger plate bolts in straddle-type monorail transit were solved, achieving efficient and low-cost automatic detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2024-02-01
- Publication Date
- 2026-06-23
Smart Images

Figure CN118071693B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit inspection technology, and in particular to a method and system for image segmentation and bolt loosening detection of straddle-type monorail finger plates. Background Technology
[0002] The development of urban rail transit presents a diversified and coexisting trend. Besides traditional modes like subways and trams, straddle-type monorails, with their medium-to-low capacity, have garnered significant attention in recent years and are expected to become an important option for the coordinated development of various rail transit modes. Compared to other medium-capacity rail transit systems, straddle-type monorails have advantages in construction costs and energy conservation. Their construction costs are only 1 / 3 to 1 / 2 of subway systems, and their noise levels are 10% to 20% lower than traditional steel wheel and rail systems. Currently, more than 30 cities have included straddle-type monorails in their urban transportation trunk line planning studies, but research on their intelligent construction is relatively limited. With the release of the "Outline for the Development of Smart Urban Rail Transit in China," intelligent monitoring methods, maintenance systems, and operation and maintenance strategies will become key technical means to ensure line safety. In the future, the development trend of straddle-type monorail transit will become more intelligent and digital.
[0003] PC track beams serve as both load-bearing beams for the elevated structure and support surfaces for vehicle movement. Adjacent PC track beams are connected by finger plates made of ductile iron. To ensure smooth train passage over these finger plates and reduce tire wear and energy consumption, long-term maintenance and adjustment of the finger plate flatness are necessary. However, in actual operation, it has been found that the bolts securing the finger plates may loosen or fall off, causing misalignment between adjacent track beams and seriously threatening safe train operation. Currently, finger plate inspection in straddle-type monorail transit mainly relies on manual inspection, which suffers from poor safety, high labor intensity, low efficiency, and insufficient accuracy and standardization.
[0004] Therefore, it is of great significance to study a scheme that can automatically detect defects in the finger bolts of straddle-type monorails.
[0005] Currently, bolt condition detection mainly employs two methods: contact and non-contact. Contact methods detect changes in the bolt's physical properties, including piezoresistive impedance analysis and ultrasonic testing. While contact methods have achieved good results in bolt loosening detection, they are significantly affected by environmental and temperature factors, easily leading to errors in engineering practice. With the development of image processing technology, non-contact bolt detection methods based on machine vision have attracted considerable attention due to their low cost and high efficiency. The basic principle is to use a computer to process and analyze bolt images captured by a camera, extracting and identifying image features indicating bolt loosening or missing bolts to achieve bolt fault detection. Since bolt loosening causes a certain angle of rotation, Zhou et al. proposed a bolt loosening rotation angle measurement method based on machine vision technology, which can effectively detect the angular rotation that occurs after early loosening of the bolt. However, the measurement results of the bolt loosening rotation angle are easily affected by factors such as shooting angle and lighting. To improve the robustness of the measurement, Zhao et al. proposed a deep learning-based method that uses a target detection algorithm to detect features on the bolt surface and calculate the rotation angle, thereby achieving bolt loosening detection. Building upon this, Lao et al. comprehensively considered the influence of shooting angle and lighting conditions on bolt detection and angle measurement, proposing a bolt loosening rotation angle measurement method applicable to different imaging conditions. Furthermore, to overcome the measurement error caused by camera perspective in monocular vision detection methods, Wang et al. proposed a bolt loosening rotation angle measurement method based on binocular vision. Addressing the bolt missing problem, Zhao et al. used convolutional neural networks to process bolt missing images for detection. To more accurately determine the number and location of missing bolts in the image, Zhou et al. utilized object detection technology to automatically extract bolt missing image features from the bolt missing image dataset, thereby achieving automatic bolt missing detection.
[0006] In summary, among current bolt loosening detection methods, contact-based methods are greatly affected by environmental factors and require a large number of sensors, resulting in high costs and limiting their widespread application. In contrast, image-based methods can identify bolt loosening or missing bolts at long distances, offering advantages in efficiency and low cost. However, current bolt loosening measurement methods mainly focus on measuring rotation angles. Since most bolts are hexagonal, if they have rotated exactly 60 degrees after loosening, the planar image will overlap with the original image, thus reducing detection accuracy. Therefore, using two-dimensional images for bolt loosening detection has some shortcomings. Summary of the Invention
[0007] In view of this, the purpose of the present invention is to provide a method and system for image segmentation and bolt loosening detection of straddle-type monorail finger plates. The method uses an improved Euclidean clustering method to segment the bolt area of the finger plate into instances, and analyzes its height to achieve automatic detection of the bolt status of the finger plate.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] The present invention provides a method for image segmentation of a straddle-type monorail fingerboard, wherein the fingerboard image segmentation is performed using an improved Euclidean clustering algorithm, and the improved Euclidean clustering algorithm is performed according to the following steps:
[0010] S1: Obtain the image data of the single-rail fingerboard and set the label of each pixel in the image data to 0;
[0011] S2: Set the label of the current image point to 1.
[0012] S3: Set the radius of the image point search, and search for neighboring points within the radius centered on the current image point. If there are no non-zero labels within the neighboring points, set all the searched neighboring points as the current label, and then increment the label. Proceed to step S5.
[0013] S4: If there is a non-zero label among the searched neighboring points, determine the smallest non-zero label among the searched neighboring points, then set the other image points with labels greater than the smallest non-zero label and their neighboring points as the smallest non-zero label value, then increment the label, and proceed to step S5.
[0014] S5: By iterating through each unlabeled pixel, the segmentation of all pixels is eventually completed.
[0015] Furthermore, the single-track fingerboard image data is obtained according to the following steps: acquiring a three-dimensional point cloud image of the fingerboard region; mapping the three-dimensional point cloud along the height Z direction into a grayscale image on a two-dimensional XY plane, wherein the grayscale image is the single-track fingerboard image data, and the grayscale value is the Z coordinate value of each point on the point cloud image.
[0016] Furthermore, the finger-shaped region is located using a grayscale-based template matching method, employing a template matching principle based on normalized cross-correlation coefficients. Specifically, the following steps are performed:
[0017] Suppose that the template image in the two images to be matched is t(r, c), and the detection image is i(r, c), where r is the row of the image and c is the column of the image;
[0018] The matching score is then the normalized cross-correlation coefficient between template t(r, c) and image i(r, c):
[0019]
[0020] Where n represents the number of pixels in the template, and R represents the region of the template;
[0021] m t The average grayscale value of the template:
[0022]
[0023] It is the variance of the grayscale values of the template:
[0024]
[0025] m i (r, c) is the mean gray value of the region of the image that overlaps with the template at position (r, c):
[0026]
[0027] It is the variance of the gray values of the region of the image that overlaps with the template at position (r, c):
[0028]
[0029] NCC indicates the degree of correspondence between the measurement template and the image at a specific point (r, c).
[0030] The present invention provides a method for detecting bolt loosening using the above-mentioned straddle-type monorail finger plate image segmentation method, comprising the following steps:
[0031] Obtain a 3D point cloud image of the straddle-type monorail finger plate, including part of the beam surface area;
[0032] Get the finger-shaped area;
[0033] The bolt region was segmented from the finger plate region by improving the Euclidean clustering algorithm;
[0034] Calculate the bolt height value in the bolt area, and determine whether the difference between the bolt height value and the normal bolt height value exceeds a preset threshold. If it does, it indicates that the bolt is in a loose state, and outputs bolt loose information; if not, the bolt is in a normal state, and outputs bolt normal information.
[0035] Furthermore, the difference between the bolt height value and the normal bolt height value is calculated according to the following formula:
[0036] |NM|>ε;
[0037] Where N is the average height of the bolt area under normal conditions; M is the average height of the segmented bolt point cloud; and ε is the height difference threshold.
[0038] Furthermore, after dividing the bolt area, the following steps are also included:
[0039] The bolt area is divided to obtain the number of bolts; it is then determined whether the number of bolts has reached the preset number. If not, it indicates that there are loose bolts in the threaded area, and the bolt loosening information is output.
[0040] If so, proceed to calculate the bolt height value in the bolt area and determine the bolt loosening status.
[0041] Furthermore, the average height of the bolt area is determined according to the following steps:
[0042] The bolt region is segmented from the finger plate image data. The corresponding point cloud data is obtained from the bolt region. The height information of the bolt region is obtained from the corresponding point cloud data. The average height information of the bolt region is calculated from the height information.
[0043] The straddle-type single-track finger plate image segmentation system provided by the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-mentioned method.
[0044] The straddle-type monorail finger plate bolt loosening detection system provided by the present invention includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, it implements the above-mentioned method.
[0045] The beneficial effects of this invention are as follows:
[0046] The present invention provides a method and system for image segmentation and bolt loosening detection of straddle-type monorail finger plates. It acquires three-dimensional point cloud images of the straddle-type monorail finger plates using line laser scanning. The initial point cloud images are preprocessed to eliminate noise. An improved Euclidean clustering method is used to segment the bolt regions of the finger plates, and the bolt status is automatically detected by analyzing their height. This method overcomes the shortcomings of two-dimensional images in bolt loosening detection. It is simple to operate, has low computational complexity, and can accurately determine the tightness of the finger plate bolts by setting different thresholds, thus meeting detection requirements.
[0047] This invention proposes a method for detecting loose bolts on straddle-type monorail finger plates using line structured light scanning. First, a three-dimensional point cloud image of the straddle-type monorail finger plate is acquired using line laser scanning. Then, the acquired initial point cloud image is preprocessed to eliminate noise. Finally, an improved Euclidean clustering method is used to segment the finger plate bolt area, and the bolt status is automatically detected by analyzing their height. This method is simple to operate, has low computational complexity, and can accurately determine the tightness of the finger plate bolts by setting different thresholds, meeting the detection requirements.
[0048] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from an examination of the following embodiments, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0049] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the following figures are provided for illustration:
[0050] Figure 1 This is a schematic diagram of acquiring point cloud images of a straddle-type monorail finger plate using line structured light scanning.
[0051] Figure 2 This is a schematic diagram of the radius filtering principle;
[0052] Figure 3 Before and after noise reduction of point clouds;
[0053] Figure 4 Mapping point clouds to grayscale images;
[0054] Figure 5 A schematic diagram of the template matching and positioning fastener area;
[0055] Figure 6 The finger-shaped area is used as the template positioning result;
[0056] Figure 7 This is a schematic diagram of the Euclidean clustering process;
[0057] Figure 8 A schematic diagram for improving Euclidean clustering of point clouds;
[0058] Figure 9 To improve the flowchart of Euclidean clustering point cloud segmentation;
[0059] Figure 10 This is a diagram comparing the effects of different segmentation algorithms;
[0060] Figure 11This is a flowchart for detecting loose or missing bolts. Detailed Implementation
[0061] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0062] Example 1
[0063] like Figure 1 As shown, Figure 1 This diagram illustrates the acquisition of point cloud images of straddle-type monorail fingerboards using line structured light scanning. In this embodiment, the 3D point cloud image of the straddle-type monorail fingerboard is acquired using line structured laser scanning. The basic principle of line structured light laser scanning is to project line structured light onto the object's surface using a structured light projector, making the line structured light plane tangent to the object's surface, thus forming a light stripe on the object's surface. By capturing the structured light stripe image from another angle, the 3D information of the object's surface can be calculated using the geometric relationship between the line laser, the camera, and the object being measured. To achieve 3D scanning of the entire object's surface, relative motion needs to be introduced between the line structured light and the object. In a coordinate system defined as the Y-axis as the scanning direction, the X-axis perpendicular to the scanning direction, and the Z-axis perpendicular to the beam plane, as the inspection vehicle moves forward, the camera is controlled to scan the fingerboard at equal intervals using equidistant sampling signals provided by a photoelectric encoder. This obtains a series of fingerboard contour data. Arranging these contour data at equal intervals according to the actual sampling interval yields the 3D point cloud data of the fingerboard surface. Ultimately, this data can be used to detect defects such as loose finger plate bolts.
[0064] Point cloud preprocessing: During data acquisition, some outliers are introduced due to vibrations or lighting conditions caused by the movement of the detection vehicle. Most of these outliers are useless and, if left unprocessed, will severely impact the speed and accuracy of subsequent anomaly detection. Therefore, the primary task is to preprocess the acquired raw point cloud data using filtering methods to remove noise. This also reduces the amount of data and improves the accuracy and efficiency of subsequent processing algorithms.
[0065] like Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the principle of radius filtering. This embodiment uses radius filtering to remove outliers. Its principle is as follows: Based on the characteristics of the point cloud data and different filtering objectives, set appropriate radius thresholds *r* and *n* (the number of points within the radius's neighborhood). Iterate through each data point and search for the number of points within its *r*-neighborhood. If the number of points within a point's *r*-neighborhood is less than *n*, the point is considered far from the main model and is deleted; conversely, if the number of points within a point's wide neighborhood is greater than *n*, the point is determined to be within the main model and is retained. If each point *p* is set...i If the radius r is at least four points, i.e., n=3, then point p2 is an outlier; if n=4, then both p2 and p3 are outliers and need to be removed.
[0066] Since radius filtering requires point-by-point radius search, setting a large radius threshold r significantly reduces the algorithm's computational efficiency. In this embodiment, after multiple experiments and while keeping r as small as possible, r and n were ultimately set to 0.8 and 9 respectively for filtering. The test results for one point cloud image are shown below. Figure 3 As shown, the original point cloud image has 1,889,280 points. Radius filtering removed 84,793 points, greatly reducing the impact of noise on subsequent processing. Figure 3 The images show a comparison of the point cloud before and after denoising. a is the original point cloud image, and b is the point cloud image after radius filtering.
[0067] Finger plate area localization: In this embodiment, the point cloud image of the finger plate area of the metal material is acquired by controlling the proximity switch. However, the acquired point cloud image includes images of part of the beam surface area. Therefore, the finger plate area needs to be located by the localization algorithm before subsequent detection.
[0068] Directly using 3D point cloud matching for fingerboard region localization often requires multiple iterations to find the correspondence between the source and target point clouds, resulting in a long algorithm consumption time, which does not meet the needs of industrial online inspection. In contrast, template matching based on 2D images avoids the complex calculations required when processing 3D data by finding local features of the target object in the 2D image. This method has a faster response speed, does not require multiple iterations, significantly improves the real-time performance of the localization algorithm, and performs well under different scenes and lighting conditions. Therefore, in this embodiment, when locating the fingerboard region, the 3D point cloud image is first mapped to a grayscale image on the 2D XY plane, such as... Figure 4 As shown, Figure 4 The point cloud is mapped to a grayscale image. In this two-dimensional image, the grayscale value of each pixel corresponds to the Z-coordinate value of the three-dimensional point cloud image. Subsequently, template matching is used to locate the finger-shaped area, further improving the execution efficiency of the algorithm.
[0069] Template matching refers to using one or more regions of interest (ROIs) as template images, sliding the template images across the images to be matched according to a specific search strategy, and calculating the similarity between the template and the current image patch using defined similarity criteria. This method finds the most similar location in the image to the template image and is widely used in object detection and tracking. Current template matching methods are mainly divided into image grayscale-based methods and image feature-based methods. Grayscale-based methods are simple in principle, performing matching by calculating the difference or similarity between the search image and the template image. Similarity measurement methods generally employ the Normalized Cross-Correlation (NCC) matching algorithm, which has high accuracy and adaptability, and is also illumination-invariant, making it a very practical matching algorithm for uncomplicated scenes. The effectiveness of image feature-based methods depends on the extracted features. Provided that enough stable features can be extracted, these methods are more robust than grayscale-based methods. When the image undergoes a certain degree of deformation, significant features such as points, lines, and regions are extracted from the original image as matching primitives for feature matching. However, the matching accuracy is not high.
[0070] Since the object to be matched in this embodiment is a grayscale image projected from a 3D point cloud image, and in this application scenario where image acquisition is performed using line structured light scanning, the camera height is fixed. Therefore, the image to be matched often does not have scale variations, occlusions, or severe deformations. Grayscale-based methods are unaffected by the type of image and are the preferred method for this type of scenario. Therefore, a grayscale-based template matching method is used for finger-shaped region localization, with NCC used as the similarity measurement method.
[0071] The principle of template matching based on normalized cross-correlation coefficients is as follows: Assume the template image is t(r, c) and the detection image is i(r, c), where r is the row and c is the column. Then the matching score is the normalized cross-correlation coefficient between template t(r, c) and image i(r, c).
[0072]
[0073] Where n represents the number of pixels in the template, and R represents the region of the template.
[0074] m t The average grayscale value of the template:
[0075] It is the variance of the grayscale values of the template:
[0076] m i(r, c) is the mean gray value of the region of the image that coincides with the template at position (r, c) (i.e., the template point is shifted by (r, c)):
[0077] It is the variance of the gray values of the region of the image that coincides with the template at position (r, c) (i.e., template point shift (r, c)):
[0078] NCC measures the degree of correspondence between a template and an image at a specific point (r, c), assuming the value is between -1 and 1. The larger the absolute value of the correlation, the greater the correspondence between the template and the image.
[0079] A value of 1 indicates that the grayscale values in the image are a linear transformation of the grayscale values in the template.
[0080] i(r+u,c+v)=a·t(u,v)+b
[0081] The entire algorithm is implemented in the following steps:
[0082] Obtain the template pixels and calculate the mean and standard deviation;
[0083] Based on the template size, the window is moved from left to right and from top to bottom on the target image. The NCC value of the pixel in the window and the template pixel is calculated after each pixel movement. The value is compared with a threshold. If the value is greater than the threshold, the position is recorded. Based on the obtained position information, the position with the highest score is selected as the matching result, and the recognition result is marked with a graphic.
[0084] The normalized cross-correlation coefficient method is less affected by lighting conditions and, unlike classic grayscale-based matching algorithms, is significantly faster. It can retrieve images with subtle shape variations, complex textures, or blurred focus.
[0085] In this embodiment, the target to be detected is the loosening or detachment of the fasteners on the straddle-type monorail finger plate. Therefore, the fastener image is used as a template, and template matching is performed on the grayscale image obtained after projecting the point cloud image to locate the fastener area. The result is as follows. Figure 5 As shown, Figure 5 This diagram illustrates the template matching and location of the fastener region. Image a shows the template image, and image b shows the matching result. It can be seen that because the fastener region occupies a small proportion of the entire image, and the grayscale image to be matched is obtained by projecting the point cloud height values, the height value of the finger-shaped region is similar to that of a normal fastener. Therefore, the matching result shows that in addition to matching the fastener region, other regions were incorrectly matched. For these reasons, this embodiment uses the entire finger-shaped plate region as a template to first locate the finger-shaped plate region in the original image, and then maps the matching result back to the point cloud image, accurately extracting the fastener region through point cloud segmentation. Figure 6 As shown, Figure 6 The results of using the finger-shaped area as a template for localization and matching show that using the finger-shaped area as a template increases the proportion of the template image in the entire image, thereby improving the matching accuracy.
[0086] Point cloud Euclidean clustering segmentation: After matching and locating the finger plate region, point cloud segmentation methods are used to accurately segment the bolt region. Through the preprocessed finger plate point cloud image, it is observed that point clouds of different components cluster together. To facilitate subsequent defect detection, a point cloud clustering algorithm is used to segment each bolt instance. Currently, traditional clustering segmentation methods for point cloud data mainly include kmeans clustering, meanshift clustering, density clustering (DBSCAN), and Euclidean clustering. Clustering segmentation algorithms treat point cloud data as a multidimensional data set with certain correlation attributes, and cluster the point cloud data according to the same attributes. Although these methods have the advantages of flexible parameter settings and good robustness, they suffer from slow convergence speed and low efficiency.
[0087] Euclidean clustering is an algorithm that uses Euclidean distance for clustering, and the KD-Tree-based nearest neighbor search algorithm is an important preprocessing method to accelerate Euclidean clustering. The specific process of using KD-Tree to segment point clouds using Euclidean clustering is as follows: For each spatial point, the KD-Tree nearest neighbor search algorithm finds the n nearest points to a given point, and then clusters points whose distance is less than a preset threshold together. If the number of points in a cluster no longer increases, the clustering process ends. Otherwise, another point is selected to replace it, and the above process is repeated until the number of points in a cluster no longer increases. The specific process is as follows: Figure 7 As shown, Figure 7 This is a schematic diagram of the Euclidean clustering process.
[0088] Traditional Euclidean clustering algorithms require continuous iteration and recalculation of cluster centers during the clustering process, which significantly impacts efficiency, especially when dealing with point cloud data with a large number of points. Therefore, this embodiment addresses the geometric features of straddle-type monorail fingerboards and improves upon traditional Euclidean point cloud clustering segmentation. A label-based point cloud segmentation method is proposed.
[0089] Its main process is as follows Figure 8 As shown, Figure 8 To improve the Euclidean clustering point cloud segmentation diagram, firstly, each point in the point cloud is initialized, with its label set to 0. Then, the segmentation label is set to 1, and segmentation begins. Similarly, a KD-Tree is constructed to efficiently query neighboring points within a specified radius. For unlabeled points (p... iIf `.lab=0`, search for neighboring points within a certain radius. If no non-zero label exists among the neighboring points, set all the found neighboring points as the current segmentation label, increment the label, and continue segmentation. If a non-zero label exists among the found neighboring points, it means that the neighborhood of the current point has already been segmented. Therefore, determine the smallest non-zero label among the found neighboring points, and then set other points with labels greater than the smallest non-zero label and their neighboring points as the smallest non-zero label value, further expanding the previously segmented area. By continuously traversing each unlabeled point, the segmentation of the entire point cloud is finally completed.
[0090] like Figure 9 As shown, Figure 9 To improve the Euclidean clustering point cloud segmentation flowchart, this embodiment provides an improved Euclidean clustering point cloud segmentation method, which includes the following steps:
[0091] S1: Obtain the original point cloud P;
[0092] S2: Initialize the label of each point in the point cloud to 0, the current segmentation label to 1, and specify the search radius r for each point;
[0093] S3: Select the point with label 0 and search for all points within its radius r;
[0094] S4: Determine if the labels of all points within the radius r are 0. If so, the minimum segmentation label is the current segmentation label, and proceed to step S5.
[0095] If not, the minimum segmentation label is the minimum value between the current segmentation label and the existing segmentation labels, and proceed to step S6;
[0096] S5: Prove that none of the searched points are segmented. Set the segmentation label of all points within the radius r of the searched points to the minimum segmentation label and proceed to step S7.
[0097] S6: Prove that there are already segmented points among the searched points. Set the segmentation label of the points without segmentation labels within the searched radius r as the minimum segmentation label, and also set the labels of all points within the radius r of the points that already have segmentation labels as the minimum segmentation label. Proceed to step S7.
[0098] S7: The current segmentation label is incremented.
[0099] S8: Determine if there are any unsegmented points with a label of 0. If not, return to step S3; if yes, output point cloud data with segmentation labels.
[0100] To verify the segmentation performance of the algorithm in this embodiment, several classic clustering algorithms were compared, including K-means clustering, Mean Shift clustering, density-based clustering (DBSCAN), and Euclidean clustering. These algorithms were applied to the preprocessed finger-shaped point cloud, and the segmentation results were then compared with those of the algorithm in this embodiment. The comparison results are as follows: Figure 10 As shown, Figure 10 This diagram illustrates the comparison of the effects of different segmentation algorithms. All subsequent algorithm implementations ran on a 64-bit Windows 11 operating system, using an AMD Ryzen 7 5800H CPU, 16GB of memory, and Open3D (Python version) as the point cloud processing library.
[0101] Experimental results show that K-means clustering requires pre-determining the number of clusters to be formed during segmentation, but it is often difficult to accurately determine the value of K. Furthermore, because this algorithm uses an iterative method for clustering, the results obtained are only locally optimal, such as... Figure 10 As shown in (a), the desired segmentation effect was not achieved. In contrast, while Mean Shift clustering does not require pre-setting the number of clusters, its performance is highly dependent on the choice of bandwidth parameter, and finding a suitable bandwidth can be difficult. Furthermore, this algorithm assumes that clusters consist of high-density regions, which are typically spherical, thus making it unsuitable for segmenting finger-shaped bolts, as shown in (a). Figure 10 As shown in (b) in the diagram. From Figure 10 As shown in (c), DBSCAN clustering can effectively segment the finger plate bolt region, but the algorithm is very sensitive to the neighborhood radius and density threshold. Furthermore, the computational complexity may be high due to the need to calculate the distance matrix when determining the core point and density reachable point.
[0102] Euclidean clustering uses Euclidean distance as a metric and is suitable for situations with high point cloud density, relatively regular object shapes, and clear cluster boundaries. For example... Figure 10 As shown in (d) above, Euclidean clustering performs well in effectively dividing finger-shaped and bolt-shaped regions. However, this method is inefficient because it requires continuous iteration and recalculation of cluster centers during the clustering process. The improved Euclidean clustering algorithm in this embodiment achieves the following segmentation results: Figure 10 As shown in (e), it can be seen that it also achieves good results in dividing the finger-shaped area and the bolt area.
[0103] To further verify the time efficiency improvement of the algorithm in this embodiment, 10 preprocessed point cloud images were processed using both the traditional Euclidean clustering algorithm and the improved algorithm of this embodiment, and the processing time was recorded. The results show that the traditional Euclidean clustering algorithm takes an average of 46.345 seconds to segment a single finger-shaped point cloud image, while the improved algorithm of this embodiment takes only 2.396 seconds. Therefore, compared to the traditional Euclidean clustering point cloud segmentation algorithm, the improved algorithm of this embodiment achieves better segmentation results while significantly improving processing speed. This is of great significance for applications requiring real-time or large-scale point cloud data processing.
[0104] After segmenting the bolt area through the above operations, since the point cloud data contains height information, the average height information of the bolt area can be calculated, and a specific threshold can be set to determine whether the bolt has become loose.
[0105] Example 2
[0106] like Figure 11 As shown, Figure 11 This embodiment provides a flowchart for detecting loose or missing bolts in a straddle-type monorail finger plate, including the following steps:
[0107] Obtain a 3D point cloud image of a straddle-type monorail finger plate;
[0108] The acquired 3D point cloud images are preprocessed to eliminate the influence of noise.
[0109] Get the finger-shaped area;
[0110] The bolt region was segmented from the finger plate region by improving the Euclidean clustering algorithm;
[0111] The bolt area is divided to obtain the number of bolts; it is then determined whether the number of bolts has reached the preset number. If not, it indicates that there are loose bolts in the threaded area, and the bolt loosening information is output.
[0112] If yes, calculate the bolt height value in the bolt area, and determine whether the difference between the bolt height value and the normal bolt height value exceeds the preset threshold. If yes, it indicates that the bolt is in a loose state, and output bolt loose information; if no, the bolt is in a normal state, and output bolt normal information.
[0113] In this embodiment, the difference between the bolt height value and the normal bolt height value is calculated according to the following formula:
[0114] |NM|>ε;
[0115] Where N is the average height of the bolt area under normal conditions; M is the average height of the segmented bolt point cloud; ε is the height difference threshold; generally, ε ranges from 10 to 15, and these two parameters are obtained according to specific circumstances. This embodiment achieves automatic detection of the status of finger plate bolts by analyzing bolt height.
[0116] The bolt loosening detection method proposed in this embodiment uses line structured light scanning technology to acquire three-dimensional point cloud images of the finger plate. By improving the Euclidean clustering segmentation method of the point cloud, the bolt area of the finger plate can be quickly located without affecting the bolt segmentation effect, enabling online detection. After segmenting the bolt area through the above operations, since the point cloud data contains height information, the average height information of the bolt area can be calculated. By setting a specific threshold, it can be determined whether the bolt has become loose.
[0117] The above-described embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention. The scope of protection of the present invention is defined by the claims.
Claims
1. A straddle-type single-track finger-shaped plate image segmentation method, characterized in that: The finger-shaped image segmentation is performed using an improved Euclidean clustering algorithm, which is carried out according to the following steps: S1: Obtain the point cloud image data of the single-track fingerboard and set the label of each pixel in the image data to 0; S2: Set the label of the current image point to 1. S3: Set the radius of the image point search, and search for neighboring points within the radius centered on the current image point. If there are no non-zero labels within the neighboring points, set all the searched neighboring points as the current label, and then increment the label. Proceed to step S5. S4: If there is a non-zero label among the searched neighboring points, determine the smallest non-zero label among the searched neighboring points, then set the other image points with labels greater than the smallest non-zero label and their neighboring points as the smallest non-zero label value, then increment the label, and proceed to step S5. S5: By iterating through each unlabeled pixel, the segmentation of all pixels is eventually completed; The monorail fingerboard image data is obtained according to the following steps: acquiring a three-dimensional point cloud image of the fingerboard area; mapping the three-dimensional point cloud image along the height Z direction into a grayscale image on a two-dimensional XY plane, wherein the grayscale image is the monorail fingerboard image data, and the grayscale value is the Z coordinate value of each point on the point cloud image.
2. The straddle-type monorail finger-shaped plate image segmentation method as described in claim 1, characterized in that: The finger-shaped area is located using a grayscale-based template matching method, employing a template matching principle based on normalized cross-correlation coefficients. The specific steps are as follows: Assume the template image in the two images being matched is The detected image is , For rows of the image, Columns for images; The matching score is the template. With images Normalized cross-correlation coefficient: in, This indicates the number of pixels in the template. The area representing the template; The average grayscale value of the template: ; It is the variance of the grayscale values of the template: ; Is the image in position The average grayscale value of the area overlapping with the template: Is the image in position Variance of grayscale values in the area overlapping with the template: NCC indicates that the measurement template and image are at a specific point. The degree of correspondence.
3. A method for detecting bolt loosening using the straddle-type monorail finger plate image segmentation method described in any one of claims 1 to 2, characterized in that: Includes the following steps: Obtain the original 3D point cloud image of the straddle-type monorail finger plate, including part of the beam surface area; Get the finger-shaped area; The bolt region was segmented from the finger plate region by improving the Euclidean clustering algorithm; Calculate the bolt height value in the bolt area, and determine whether the difference between the bolt height value and the normal bolt height value exceeds a preset threshold. If it does, it indicates that the bolt is in a loose state, and outputs bolt loose information; if not, the bolt is in a normal state, and outputs bolt normal information.
4. The bolt loosening detection method as described in claim 3, characterized in that: The difference between the bolt height value and the normal bolt height value is calculated according to the following formula: |NM|>ε; Where N is the average height of the bolt area under normal conditions; M is the average height of the segmented bolt point cloud; and ε is the height difference threshold.
5. The bolt loosening detection method as described in claim 3, characterized in that: After dividing the bolt area, the following steps are also included: The bolt area is divided to obtain the number of bolts; it is then determined whether the number of bolts has reached the preset number. If not, it indicates that a bolt has fallen off, and the bolt falling off information is output. If so, proceed to calculate the bolt height value in the bolt area and determine the bolt loosening status.
6. The bolt loosening detection method as described in claim 3, characterized in that: The average height of the bolt area is determined according to the following steps: The bolt region is segmented from the finger plate image data. The corresponding point cloud data is obtained from the bolt region. The height information of the bolt region is obtained from the corresponding point cloud data. The average height information of the bolt region is calculated from the height information.
7. A straddle-type single-track finger-shaped image segmentation system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 2.
8. A straddle-type monorail finger plate bolt loosening detection system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 3 to 6.