Self-adaptive segmentation method for steel rail surface defect image

By collecting images with high-resolution industrial cameras and synchronized light source equipment, combined with multi-step pre-processing and feature extraction technology, the problem of low equipment resolution and inflexible light source control in traditional methods is solved, and high accuracy of rail surface defect detection is achieved and high efficiency.

CN118799302AInactive Publication Date: 2024-10-18NANJING INST OF RAILWAY TECH
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202411072231.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-10-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional rail surface defect detection methods have low equipment resolution, inflexible light source control, insufficient image clarity and detail, poor preprocessing effects, and single edge feature extraction and segmentation algorithms, resulting in low segmentation accuracy and low classification accuracy, which affects detection. Effect.

Method used

Use high-resolution industrial cameras and synchronously controlled light source equipment to collect images, perform multi-step image preprocessing, edge feature extraction and preliminary segmentation. Combined with morphological operations and feature extraction technology, adaptive thresholds and classification algorithms are used for accurate segmentation and Identify.

Benefits of technology

It improves the accuracy and efficiency of defect detection, reduces missed detections and false detections, ensures image clarity and comprehensive coverage, enhances the ability to identify defective areas, and generates detailed detection reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799302A_ABST
    Figure CN118799302A_ABST
Patent Text Reader

Abstract

The invention provides a steel rail surface defect image adaptive segmentation method, and relates to the technical field of steel rail surface defect image adaptive segmentation, and the method comprises the following steps: S1, obtaining a steel rail surface image, and shooting the steel rail surface through an industrial camera and a light source device; s2, image preprocessing: denoising, graying and enhancing; S3, edge feature extraction: extracting edge features of the image by using an edge detection algorithm; according to the method, a high-resolution industrial camera and synchronously-controlled light source equipment are used for comprehensively collecting steel rail surface images at different angles and under different illumination conditions, suspected defect areas are accurately extracted through multi-step image preprocessing, edge feature extraction and preliminary segmentation, morphological operation and a feature extraction technology are combined, and the detection accuracy is improved. According to the method, accurate segmentation and classification identification of the defect area are realized, a detection result and a report are quickly output, and the systematic and automatic processing flow remarkably improves the accuracy and the efficiency of steel rail surface defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of adaptive segmentation of rail surface defect images, and in particular to an adaptive segmentation method of rail surface defect images. Background Art

[0002] Traditional methods have some shortcomings in rail surface defect detection. First, due to the low resolution of the equipment, the clarity and details of the collected images are insufficient, and small defects are easily missed. Secondly, the light source control is not flexible enough, the quality of the image under different lighting conditions is unstable, and it is difficult to fully cover the rail surface. In the preprocessing step, the denoising algorithm is simple, the effect is not good, and the image details are easily lost. The edge feature extraction and image segmentation algorithms are single and cannot adapt to complex defect morphology, resulting in low segmentation accuracy. In addition, the traditional method lacks systematic feature extraction and classification means, the classification accuracy is not high, and the recognition results are unstable. In general, the traditional method has deficiencies in multiple links such as image acquisition, preprocessing, segmentation and recognition, which affects the overall effect of rail surface defect detection and needs to be optimized and improved. Summary of the invention

[0003] The purpose of the present invention is to solve the technical problems raised in the above background technology.

[0004] The present invention adopts the following technical solution: a method for adaptive segmentation of rail surface defect images, the method comprising the following steps:

[0005] S1. Obtain the rail surface image, and use an industrial camera and light source equipment to photograph the rail surface;

[0006] S2. Image preprocessing, including denoising, grayscale conversion and enhancement;

[0007] S3. Edge feature extraction, using edge detection algorithm to extract edge features of the image;

[0008] S4. Preliminary image segmentation: using a segmentation algorithm to perform preliminary segmentation on the image;

[0009] S5. Extraction of suspected defect areas: extracting suspected defect areas based on the preliminary segmentation results;

[0010] S6. Feature extraction, extracting the shape, texture and grayscale features of the suspected defect area;

[0011] S7. Adaptive threshold accurate segmentation, further accurately segmenting the defect area;

[0012] S8. Defect classification and identification, using classification algorithms to classify and identify defect areas;

[0013] S9. Result output, output defect detection results and generate report.

[0014] Preferably, the step S1 of acquiring the rail surface image specifically includes:

[0015] S1.1 uses an industrial camera installed on the rail inspection equipment to capture rail surface images, ensuring high resolution and clarity of the images;

[0016] S1.2 collects images at different angles and lighting conditions through synchronously controlled light source equipment to ensure full coverage of the rail surface and highlight defect features;

[0017] The resolution of the S1.3 industrial camera is 45-50 million pixels, and the acquisition time is no more than 100-150 milliseconds. Here, through the high-resolution industrial camera and image acquisition at different angles and lighting conditions, the clarity and comprehensive coverage of the image are ensured, the possibility of missed detection and false detection is reduced, and the reliability of defect detection is improved.

[0018] Preferably, the S2 image preprocessing specifically includes:

[0019] S2.1 Denoising: Use a median filter or a Gaussian filter to remove noise from the image;

[0020] S2.1.1 Median filter is used to remove salt and pepper noise in the image, with a window size of 3x3-5x5;

[0021] S2.1.2 Gaussian filter is used to smooth the image and reduce the influence of Gaussian noise, and the standard deviation is set between 1.0 and 2.0;

[0022] S2.2 Grayscale processing: converting a color image into a grayscale image;

[0023] S2.2.1 The color image is converted into a grayscale image using the weighted average method, and the weights are set to 0.2989, 0.5870, and 0.1140 respectively;

[0024] S2.3 Image enhancement: Use histogram equalization or contrast stretching method to enhance the contrast of the image;

[0025] S2.3.1 The grayscale distribution of the image is adjusted using a histogram equalization method, with the calculation time not exceeding 50 milliseconds;

[0026] S2.3.2 uses the contrast stretching method to perform linear transformation according to the grayscale range of the image. Here, through efficient denoising, grayscale and image enhancement processing, the image quality is improved, making subsequent processing more accurate and efficient, ensuring clear display and accurate identification of defective areas.

[0027] Preferably, the S3 edge feature extraction specifically includes:

[0028] S3.1 uses the Canny edge detection algorithm:

[0029] S3.1.1 Perform Gaussian smoothing on the image to reduce noise;

[0030] S3.1.2 calculate the image gradient strength and direction;

[0031] S3.1.3 Remove non-edge points by non-maximum suppression;

[0032] S3.1.4 Use a dual threshold detection method to connect edges, and the total processing time of the Canny edge detection algorithm does not exceed 200 milliseconds;

[0033] S3.2 or use the Sobel edge detection algorithm to detect the edge by calculating the gradient of the image. Here, by using the Canny or Sobel edge detection algorithm, the edge features of the rail surface are accurately extracted to ensure the accuracy and efficiency of edge detection, which is helpful for subsequent segmentation and feature extraction.

[0034] Preferably, the S4 preliminary image segmentation specifically includes:

[0035] S4.1 uses the Otsu threshold segmentation algorithm to automatically determine the optimal threshold by maximizing the inter-class variance and segment the image into foreground and background. The calculation time is 80-100 milliseconds;

[0036] S4.2 or adopts a segmentation algorithm based on region growing, by selecting seed points and gradually expanding the region according to the similarity criterion, image segmentation is achieved. Here, by adopting the Otsu threshold segmentation algorithm or the segmentation algorithm based on region growing, the accurate preliminary segmentation of the rail surface image can be achieved, and the preliminary recognition capability of the defective area is improved.

[0037] Preferably, the S5 suspected defect area extraction specifically includes:

[0038] S5.1 uses morphological operations:

[0039] S5.1.1 Etching operation, used to remove noise and small non-defective areas;

[0040] S5.1.2 Expansion operation is used to fill small voids and defective areas of broken connections;

[0041] S5.1.3 Opening operation (erosion followed by dilation) is used to separate adjacent suspected defect areas;

[0042] S5.1.4 Closing operation (dilation followed by erosion) is used to fill small holes in defective areas;

[0043] S5.1.5 The processing time of the morphological operation is 100-150 milliseconds. Here, through morphological operations such as corrosion, expansion, opening operation and closing operation, the suspected defect area is effectively extracted, the noise and non-defect area are excluded, and the accuracy of defect extraction is improved.

[0044] Preferably, the S6 feature extraction specifically includes:

[0045] S6.1 Shape features: Use contour analysis method to extract the shape features of the defect area;

[0046] S6.1.1 Calculate the perimeter, area, aspect ratio, etc. of the defect area;

[0047] S6.2 Texture features: The texture features of the defect area are extracted using the gray level co-occurrence matrix (GLCM);

[0048] S6.2.1 Calculate eigenvalues ​​such as energy, contrast, and entropy;

[0049] S6.3 Grayscale features: Calculate the grayscale features such as the average grayscale value and variance of the defect area. Here, through detailed shape, texture and grayscale feature extraction, the characteristics of the suspected defect area are fully described to ensure the accuracy of classification and identification.

[0050] Preferably, the S7 adaptive threshold precise segmentation specifically includes:

[0051] S7.1 uses OtsuMethod:

[0052] S7.1.1 Determine the optimal threshold by maximizing the between-class variance;

[0053] S7.2 uses adaptive histogram equalization:

[0054] S7.2.1 Dynamically adjust the threshold according to the grayscale distribution of the local area. Here, the defect area is further accurately segmented by the Otsu method or the adaptive histogram equalization method, so as to improve the segmentation accuracy and reduce misjudgment and missed judgment.

[0055] Preferably, the S8 defect classification and identification specifically includes:

[0056] S8.1 uses support vector machine (SVM) for classification:

[0057] S8.1.1 Construct an appropriate feature space, including shape, texture, and grayscale features;

[0058] S8.1.2 Select an appropriate kernel function and train the SVM model with a classification time of 180-200 milliseconds;

[0059] S8.2 uses convolutional neural network (CNN) for classification:

[0060] S8.2.1 Automatically extract features through multi-layer convolution and pooling operations;

[0061] S8.2.2 uses the fully connected layer to classify the features, and the classification time is 450-500 milliseconds. Here, the two classification methods of SVM and CNN are used to ensure efficient classification and identification of defect areas, further improving the accuracy and reliability of the detection results.

[0062] Preferably, the S9 result output specifically includes:

[0063] S9.1 Output defect detection results, including but not limited to defect type, location and size details;

[0064] S9.2 generates a test report, which includes the test time, test equipment model, and test parameter setting information. The report generation time is 70-100 milliseconds. Here, through detailed result output and report generation, comprehensive defect detection information is provided to facilitate subsequent maintenance and management, and improve the transparency and traceability of the test process.

[0065] Compared with the prior art, the advantages and positive effects of the present invention are:

[0066] In the present invention, a high-resolution industrial camera and a synchronously controlled light source device are used to comprehensively collect rail surface images under different angles and lighting conditions. Through multi-step image preprocessing, edge feature extraction and preliminary segmentation, suspected defect areas are accurately extracted. Morphological operations and feature extraction techniques are combined to achieve accurate segmentation and classification identification of defect areas, and quickly output detection results and reports. This systematic and automated processing flow significantly improves the accuracy and efficiency of rail surface defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 The present invention provides a schematic diagram of the overall process of an adaptive segmentation method for rail surface defect images. DETAILED DESCRIPTION

[0068] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0069] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.

[0070] Unless otherwise specified, the reagents, methods and equipment used in the present invention are conventional reagents, methods and equipment in the technical field.

[0071] Embodiment 1

[0072] The present invention provides a technical solution: a method for adaptive segmentation of rail surface defect images. First, an industrial camera (with a resolution of 50 million pixels) installed on a rail inspection device is used to capture rail surface images within 100 milliseconds to ensure high resolution and clarity of the image. Images are collected under different angles and lighting conditions by a synchronously controlled light source device to ensure full coverage of the rail surface and highlight defect features. Then, image preprocessing is performed, including using a median filter with a window size of 3x3 and a Gaussian filter with a standard deviation of 1.5 to remove image noise, converting a color image into a grayscale image (the weights of the weighted average method are 0.2989, 0.5870 and 0.1140, respectively), and using histogram equalization and contrast stretching methods to enhance image contrast (the histogram equalization calculation time is 50 milliseconds). Then, the Canny edge detection algorithm is used to perform Gaussian smoothing, gradient calculation, non-maximum suppression and double threshold detection on the image, and the total processing time is 200 milliseconds to extract the edge features of the image. Subsequently, the Otsu threshold segmentation algorithm was used to perform preliminary image segmentation within 100 milliseconds to segment the image into foreground and background. The suspected defect area was extracted by morphological operations (erosion, expansion, opening and closing operations, with a total processing time of 150 milliseconds). Next, the shape features of the defect area were extracted using the contour analysis method, the texture features were extracted by calculating the gray level co-occurrence matrix (GLCM), and the grayscale features such as the average gray value and variance of the defect area were calculated. Then, the Otsu method and the adaptive histogram equalization method were used for adaptive threshold accurate segmentation. In the defect classification and recognition steps, the support vector machine (SVM) was first used to construct the feature space and select the kernel function, with a classification time of 200 milliseconds. Secondly, the convolutional neural network (CNN) was used to automatically extract features through multi-layer convolution and pooling operations, with a classification time of 500 milliseconds. Finally, the defect detection results, including the defect type, location and size details, were output, and a detection report was generated (generated in 100 milliseconds), including the detection time, detection equipment model and detection parameter setting information.

[0073] Embodiment 2

[0074] An adaptive segmentation method for rail surface defect images is proposed. First, an industrial camera (with a resolution of 45 million pixels) installed on a rail inspection device is used to capture rail surface images within 150 milliseconds to ensure high resolution and clarity of the image. Images are collected under different angles and lighting conditions by a synchronously controlled light source device to ensure full coverage of the rail surface and highlight defect features. Then, image preprocessing is performed, including removing image noise using a median filter with a window size of 5x5 and a Gaussian filter with a standard deviation of 2.0, converting color images into grayscale images (the weights of the weighted average method are 0.2989, 0.5870, and 0.1140, respectively), and enhancing image contrast using histogram equalization and contrast stretching methods (the calculation time of histogram equalization is 50 milliseconds). Then, the edge features of the image are extracted by gradient calculation using the Sobel edge detection algorithm. Subsequently, a segmentation algorithm based on region growing is used to achieve image segmentation by selecting seed points and gradually expanding the region according to the similarity criterion. Suspected defect regions are extracted through morphological operations (erosion, dilation, opening and closing operations, with a total processing time of 150 milliseconds). Next, the contour analysis method is used to extract the shape features of the defect area, the gray level co-occurrence matrix (GLCM) is calculated to extract the texture features, and the grayscale features such as the average grayscale value and variance of the defect area are calculated. Then, the Otsu Method and the adaptive histogram equalization method are used for adaptive threshold precise segmentation. In the defect classification and recognition steps, the support vector machine (SVM) is first used to construct the feature space and select the kernel function, and the classification time is 180 milliseconds. Secondly, the convolutional neural network (CNN) is used to automatically extract features through multi-layer convolution and pooling operations, and the classification time is 450 milliseconds. Finally, the defect detection results are output, including the defect type, location and size details, and a detection report is generated (generation time is 70 milliseconds), including the detection time, detection equipment model and detection parameter setting information.

[0075] Embodiment 3

[0076] An adaptive segmentation method for rail surface defect images is proposed. First, an industrial camera (with a resolution of 48 million pixels) installed on a rail inspection device is used to capture rail surface images within 120 milliseconds to ensure high resolution and clarity of the image. Images are collected at three different angles and under two different lighting conditions by a synchronously controlled light source device to ensure full coverage of the rail surface and highlight defect features. Image preprocessing is then performed, including removing image noise using a median filter with a window size of 4x4 and a Gaussian filter with a standard deviation of 1.8, converting color images into grayscale images (the weights of the weighted average method are 0.2989, 0.5870, and 0.1140, respectively), and enhancing image contrast using histogram equalization and contrast stretching methods (the calculation time for histogram equalization is 45 milliseconds). Then, the Canny edge detection algorithm is used to perform Gaussian smoothing, gradient calculation, non-maximum suppression, and double threshold detection on the image, with a total processing time of 190 milliseconds to extract edge features of the image. Subsequently, the Otsu threshold segmentation algorithm was used to perform preliminary image segmentation within 90 milliseconds to divide the image into foreground and background. The suspected defect area was extracted through morphological operations (erosion, expansion, opening and closing operations, with a total processing time of 140 milliseconds). Next, the shape features of the defect area were extracted using the contour analysis method, the texture features were extracted by calculating the gray level co-occurrence matrix (GLCM), and the grayscale features such as the average gray value and variance of the defect area were calculated. Then, the Otsu method and the adaptive histogram equalization method were used for adaptive threshold accurate segmentation. In the defect classification and recognition steps, the support vector machine (SVM) was first used to construct the feature space and select the kernel function, with a classification time of 190 milliseconds. Secondly, the convolutional neural network (CNN) was used to automatically extract features through multi-layer convolution and pooling operations, with a classification time of 480 milliseconds. Finally, the defect detection results, including the defect type, location and size details, were output, and a test report was generated (generated in 80 milliseconds), including the detection time, detection equipment model and detection parameter setting information.

[0077] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A rail surface defect image adaptive segmentation method, characterized by: The method comprises the following steps: S1. Obtain the rail surface image, and use an industrial camera and light source equipment to photograph the rail surface; S2. Image preprocessing, including denoising, grayscale conversion and enhancement; S3. Edge feature extraction, using edge detection algorithm to extract edge features of the image; S4. Preliminary image segmentation: using a segmentation algorithm to perform preliminary segmentation on the image; S5. Extraction of suspected defect areas: extracting suspected defect areas based on the preliminary segmentation results; S6. Feature extraction, extracting the shape, texture and grayscale features of the suspected defect area; S7. Adaptive threshold accurate segmentation, further accurately segmenting the defect area; S8. Defect classification and identification, using classification algorithms to classify and identify defect areas; S9. Result output, output defect detection results and generate report.

2. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The step S1 of acquiring the rail surface image specifically includes: S1.1 uses an industrial camera installed on the rail inspection equipment to capture rail surface images, ensuring high resolution and clarity of the images; S1.2 collects images at different angles and lighting conditions through synchronously controlled light source equipment to ensure full coverage of the rail surface and highlight defect features; The resolution of the S1.3 industrial camera is 45-50 million pixels, and the acquisition time does not exceed 100-150 milliseconds.

3. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S2 image preprocessing specifically includes: S2.1 Denoising: Use a median filter or a Gaussian filter to remove noise from the image; S2.1.1 Median filter is used to remove salt and pepper noise in the image, with a window size of 3x3-5x5; S2.1.2 Gaussian filter is used to smooth the image and reduce the influence of Gaussian noise, and the standard deviation is set between 1.0 and 2.0; S2.2 Grayscale processing: converting a color image into a grayscale image; S2.2.1 The color image is converted into a grayscale image using the weighted average method, and the weights are set to 0.2989, 0.5870, and 0.1140 respectively; S2.3 Image enhancement: Use histogram equalization or contrast stretching method to enhance the contrast of the image; S2.3.1 The grayscale distribution of the image is adjusted using a histogram equalization method, with the calculation time not exceeding 50 milliseconds; S2.3.2 uses a contrast stretching method to perform a linear transformation based on the grayscale range of the image.

4. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S3 edge feature extraction specifically includes: S3.1 uses the Canny edge detection algorithm: S3.1.1 Perform Gaussian smoothing on the image to reduce noise; S3.1.2 calculate the image gradient strength and direction; S3.1.3 Remove non-edge points by non-maximum suppression; S3.1.4 Use a dual threshold detection method to connect edges, and the total processing time of the Canny edge detection algorithm does not exceed 200 milliseconds; S3.2 or use the Sobel edge detection algorithm to detect edges by calculating the gradient of the image.

5. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S4 preliminary image segmentation specifically includes: S4.1 uses the Otsu threshold segmentation algorithm to automatically determine the optimal threshold by maximizing the inter-class variance and segment the image into foreground and background. The calculation time is 80-100 milliseconds; S4.2 or adopts a segmentation algorithm based on region growing to achieve image segmentation by selecting seed points and gradually expanding the region according to the similarity criterion.

6. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S5 suspected defect area extraction specifically includes: S5.1 uses morphological operations: S5.1.1 Etching operation, used to remove noise and small non-defective areas; S5.1.2 Expansion operation is used to fill small voids and defective areas of broken connections; S5.1.3 Opening operation (erosion followed by dilation) is used to separate adjacent suspected defect areas; S5.1.4 Closing operation (dilation followed by erosion) is used to fill small holes in defective areas; S5.1.5 The processing time for morphological operations is 100-150 milliseconds.

7. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S6 feature extraction specifically includes: S6.1 Shape features: Use contour analysis method to extract the shape features of the defect area; S6.1.1 Calculate the perimeter, area, aspect ratio, etc. of the defect area; S6.2 Texture features: The texture features of the defect area are extracted using the gray level co-occurrence matrix (GLCM); S6.2.1 Calculate eigenvalues ​​such as energy, contrast, and entropy; S6.3 Grayscale features: Calculate the grayscale features such as the average grayscale value and variance of the defect area.

8. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S7 adaptive threshold precise segmentation specifically includes: S7.1 uses OtsuMethod: S7.1.1 Determine the optimal threshold by maximizing the between-class variance; S7.2 uses adaptive histogram equalization: S7.2.1 Dynamically adjust the threshold according to the grayscale distribution of the local area.

9. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S8 defect classification and identification specifically includes: S8.1 uses support vector machine (SVM) for classification: S8.1.1 Construct an appropriate feature space, including shape, texture, and grayscale features; S8.1.2 Select an appropriate kernel function and train the SVM model with a classification time of 180-200 milliseconds; S8.2 uses convolutional neural network (CNN) for classification: S8.2.1 Automatically extract features through multi-layer convolution and pooling operations; S8.2.2 uses a fully connected layer to classify features, and the classification time is 450-500 milliseconds.

10. The rail surface defect image adaptive segmentation method according to claim 1, characterized in that: The S9 result output specifically includes: S9.1 Output defect detection results, including but not limited to defect type, location and size details; S9.2 generates a test report, which includes the test time, test equipment model, and test parameter setting information. The report generation time is 70-100 milliseconds.

Citation Information

Cited By

  • Corrugated board defect detection method, medium and equipment

    CN119273677A

  • Seamless steel tube defect detection method based on image processing

    CN119338809A

  • Gearbox gear defect detection method, system and equipment

    CN119540180A

  • Defect detection method for photovoltaic screen printing plate

    CN119850523A

  • Automatic defect grinding device and method based on machine vision

    CN119871125A