A gear box body crack edge detection method for CRH5 motor train unit

By combining video surveillance equipment and digital image processing technology with median filtering, Otsu adaptive thresholding algorithm, multi-scale morphological operations and Canny operator, automated detection of gearbox housing cracks in CRH5 EMU trains has been achieved. This solves the problems of low efficiency in manual monitoring and difficulty in computer detection, and improves detection efficiency and accuracy.

CN117351036BActive Publication Date: 2026-11-24SOUTHWEST JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311349855.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2026-11-24
Estimated Expiration
2043-10-18

AI Technical Summary

Technical Problem

The monitoring of gearbox housing cracks in CRH5 EMUs mainly relies on manual visual inspection, which is inefficient, prone to missed detections and false detections, and difficult to achieve automatic computer detection.

Method used

Video surveillance equipment is used to acquire images of the gearbox housing. Combining machine vision and digital image processing technologies, crack edge detection is performed by a method that combines median filtering, Otsu adaptive thresholding algorithm, multi-scale morphological operations, and Canny operator to achieve automated detection.

Benefits of technology

It improves the efficiency and accuracy of gearbox crack detection, solves the problem of low efficiency in manual monitoring, realizes automatic computer detection, and enhances the detection effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117351036B_ABST
    Figure CN117351036B_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting the edge of a gearbox housing crack in a CRH5 high-speed train, comprising the following steps: S1: acquiring an image of a crack in the gearbox housing of a CRH5 high-speed train; S2: preprocessing the image of the gearbox housing crack to obtain a grayscale image of the crack; S3: filtering the grayscale image of the crack using a median filtering algorithm to obtain a filtered image of the crack; S4: segmenting the filtered image of the crack using an Otsu adaptive thresholding algorithm to separate the background from the image to obtain a target image; S5: performing edge detection of the target image using a combination of multi-scale morphological operations and the Canny operator to obtain image edges with clear contours and prominent details. This application can realize automatic detection of the edge of a gearbox crack image, solving the problems of low manual efficiency and difficulty in achieving automatic computer crack detection in traditional methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of health inspection technology for rail vehicles, specifically relating to a method for detecting the edge of cracks in the gearbox housing of a CRH5 high-speed train. Background Technology

[0002] The CRH5 EMU gearbox has a complex structure and multiple vibration sources. The bending and torsional vibrations induced by mechanical and electrical factors are coupled together. Under long-haul service conditions, the gearbox is highly susceptible to vibration wear and fatigue wear, leading to gearbox cracks and seriously endangering railway transportation safety. Due to the unique structure of the CRH5 EMU gearbox, the shape of gearbox cracks has a certain degree of uncertainty. Currently, the monitoring of gearbox cracks in the CRH5 EMU mainly relies on manual visual inspection. This is affected by various factors such as the sense of responsibility and professional competence of the train inspection personnel, resulting in potential for missed or incorrect inspections. Furthermore, manual monitoring is inefficient and cannot achieve computer-based extraction of gearbox cracks. Summary of the Invention

[0003] To address the problems mentioned in the background art, the present invention provides a method for detecting the edge of cracks in the gearbox housing of CRH5 high-speed trains, thereby solving the problems of low efficiency of manual monitoring and inability to achieve computer extraction of gearbox cracks in the prior art.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] A method for detecting crack edges in the gearbox housing of a CRH5 high-speed train includes the following steps:

[0006] S1: Collect images of cracks in the gearbox housing of the CRH5 high-speed train;

[0007] S2: Preprocess the image of the gearbox housing crack to obtain a grayscale image of the crack;

[0008] S3: Filter the grayscale image of the crack. The median filtering algorithm is used to filter the grayscale image of the crack to obtain the filtered crack image.

[0009] S4: The Otsu adaptive thresholding algorithm is used to segment the filtered crack image, dividing the filtered crack image into two parts: background and target. The background is separated from the image to obtain the target image.

[0010] S5: Use multi-scale morphological operations combined with the Canny operator to perform edge detection on the target image, resulting in image edges with clear contours and prominent details.

[0011] Preferably, in S1, video monitoring equipment is used to collect images of cracks in the gearbox housing of the CRH5 high-speed train. The monitoring equipment includes:

[0012] Gearbox mounting bracket; The gearbox mounting bracket is fixedly installed on the power bogie of the CRH5 EMU;

[0013] At least two cameras; at least one camera is fixedly mounted on the bottom bracket of the gearbox, and at least one camera is fixedly mounted on the gearbox mounting bracket, with all cameras pointing towards the gearbox body;

[0014] Main unit NVR; The main unit NVR is connected to all cameras and is used to store images of gearbox housing cracks captured by the cameras;

[0015] Monitoring terminal; The monitoring terminal is connected to the host NVR and is used to acquire images of gearbox housing cracks and perform real-time monitoring.

[0016] Preferably, the preprocessing in S2 mainly includes the following steps:

[0017] S2.1: Convert the image of the gearbox housing crack into a grayscale histogram. The horizontal axis of the grayscale histogram represents the gray level of the image, and the vertical axis represents the probability of each gray level pixel appearing.

[0018] S2.2: Perform a nonlinear gamma transform on the grayscale histogram to obtain the crack grayscale image;

[0019] The expression for the gamma transform is:

[0020] y = (x + esp) γ ;

[0021] In the formula, x and y are the horizontal and vertical coordinates of the grayscale histogram, respectively, with values ​​ranging from [0,1]. esp is the compensation coefficient, and γ is the gamma coefficient.

[0022] Preferably, in S3, the specific steps of the median filtering algorithm for filtering the crack grayscale image include:

[0023] S3.1: Slide the template of the two-dimensional 3×3 rectangular filter point by point along the crack grayscale image so that the origin of the template coincides with a certain pixel (x,y) in the crack grayscale image;

[0024] S3.2: Obtain the grayscale value of each corresponding pixel under the template and sort them in ascending order;

[0025] S3.3: Assign the gray value of the middle element of the gray value sequence to the pixel at the center of the template corresponding to the crack gray value image to obtain the image processed by the median filtering algorithm. The calculation formula of the median filtering algorithm is as follows:

[0026] g(x,y)=med{f(xM,yN),M,N∈W};

[0027] In the formula, f(x,y) is the original image of the input crack grayscale image, and W represents the two-dimensional template.

[0028] Preferably, when the exposure is insufficient or excessive, the grayscale histogram under unsatisfactory lighting conditions is enhanced by using a limited contrast adaptive histogram equalization method after the preprocessing step.

[0029] First, crop the grayscale histogram, then redistribute each grayscale histogram, and finally calculate the transformation function.

[0030] The formulas for the shear limit β and contrast calculation C of each grayscale histogram are as follows:

[0031]

[0032]

[0033] Where L is the number of gray levels in each gray-level histogram, u is the mean gray level of the gray-level histogram, q is the standard deviation of the gray-level histogram, and I... max I min This indicates the maximum and minimum pixel values ​​of an image.

[0034] Preferably, the specific method for image segmentation in S4 is as follows:

[0035] Let threshold T0 divide the crack image into two regions with gray levels equal to W0 and W1, respectively, and their corresponding probabilities equal to W0 and W1. The formula for calculating the average gray level of the crack image after filtering is:

[0036] μ = P0W0 + P1W1;

[0037] The formula for calculating the total variance is:

[0038] δ 2 =P0(μ-W0) 2 +P1(μ-W1) 2 ;

[0039] The optimal segmentation threshold is T0, which has the largest total variance. Therefore, T0 is selected as the higher threshold (T0) in the dual thresholding method. max Alternatively, choose 0.3T. max As a low threshold, after filtering, the crack image is segmented into W0 and W1, which are the foreground region and background region, respectively, where W0 is the target image.

[0040] Preferably, in S5, the main steps of using the Canny operator for image edge detection in the crack image edge detection combining multi-scale morphological operations and the Canny operator are as follows:

[0041] The target image f(x,y) is convolved with a two-dimensional Gaussian filter G(x,y), and the smoothed image E(x,y) is calculated using the following formula:

[0042]

[0043] E(X,Y)=f(x,y)*G(x,y);

[0044] In the formula, δ is the distributed parameter of the Gaussian filter;

[0045] For each pixel in the target image, the magnitude and direction of the gradient are calculated using the finite difference of the first-order partial derivative. The first-order difference convolution template used is shown below:

[0046]

[0047] The partial derivatives of any pixel (i,j) in the target image f(x,y) in the two perpendicular directions of x and y are calculated as follows:

[0048] G x (i,j)=(E[i,j+1]-E[i,j]+E[i+1,j+1]-E[i+1,j]) / 2;

[0049] G y (i,j)=(E[i,j]-E[i+1,j]+E[i,j+1]-E[i+1,j+1]) / 2;

[0050] The formulas for calculating the magnitude and direction of its gradient operator are as follows:

[0051]

[0052] θ(i,j)=arctan[G y (i,j) / G x [i,j];

[0053] F(i,j) reflects the edge intensity at point (i,j) in the target image. θ(i,j) is the normal vector of image point (i,j) and is orthogonal to the edge direction. Based on the gradient direction of each point, it is determined whether the intensity of this point is the maximum value of its neighborhood, and thus whether the point is an image edge point.

[0054] Based on the gradient direction, local gradient maxima are preserved, and non-maximum gradient magnitudes are suppressed. Double thresholding is used to detect and connect image edges to obtain the crack edge image E. F1.

[0055] Preferably, in S5, the crack image edge detection combining multi-scale morphological operations and the Canny operator specifically involves:

[0056] Choose the following two structural elements:

[0057]

[0058]

[0059] Perform n expansions on structuring elements A and B, where n is the scale parameter, and denote them as follows: For the target image F, a dilation structure A is used. n A continuous nth multiscale expansion is denoted as: The improved large-scale morphological operator relation yields the image edge E. F2 As shown below:

[0060]

[0061] Preferably, in S5, the crack image edge detection step combining multi-scale morphology and the Canny operator is as follows:

[0062] S2.1: The scale parameter is set to 2, and the structuring element A is obtained through dilation operation. n and B n ;

[0063] S2.2: Based on image edge E F1 E F2 Calculate the difference value E of the edge image. e E e =F F1 -F F2 ;

[0064] S2.3: Based on the difference map, the pixels E with non-zero grayscale values... e (x,y), find connected edge points, including weak edge points, in the neighborhood to determine the detailed edge point image e(x,y), or simply e;

[0065] S2.4: Transfer the edge image E F1 E F2 By fusing it with the detailed edge image e, a crack image edge E with clear outline and prominent details can be obtained.

[0066] Preferably, the camera is a fiber optic network dome camera with an effective pixel count of 720p and an IP66 protection rating, and the host NVR is a vehicle-mounted network video recording host NVR.

[0067] Compared with the prior art, the beneficial effects of the present invention are:

[0068] This invention discloses a method for edge detection of gearbox housing cracks using the onboard video monitoring system of the CRH5 high-speed train gearbox: Video images of the gearbox housing are acquired through video monitoring equipment; the acquired gearbox housing crack images are subjected to sample set expansion, image preprocessing, and image enhancement processing by combining machine vision and digital image analysis and processing theories; simultaneously, a crack image edge detection method combining multi-scale morphological operations and the Canny operator is employed to achieve automatic detection of gearbox crack image edges, thereby solving the problems of low efficiency of manual visual monitoring and difficulty in achieving automatic computer detection of cracks in traditional gearbox crack monitoring methods. Attached Figure Description

[0069] Figure 1 Flowchart for edge detection of crack images in gearbox housing;

[0070] Figure 2 This is a diagram showing the camera's location.

[0071] Figure 3 Image of a crack in the gearbox housing;

[0072] Figure 4 The grayscale histogram obtained by converting the crack image;

[0073] Figure 5 The image shows the crack after nonlinear gamma transformation;

[0074] Figure 6 The image shows the crack image after median filtering;

[0075] Figure 7 Image enhancement effect of contrast-limited adaptive histogram equalization;

[0076] Figure 8 Image showing the result of crack image segmentation using the Otsu algorithm;

[0077] Figure 9 Image showing the result of crack edge detection performed on morphological operations;

[0078] Figure 10 This is an image edge detection result combining morphology and the Canny operator. Detailed Implementation

[0079] To facilitate understanding of the technical content of this invention by those skilled in the art, the invention will be further described in detail below with reference to the accompanying drawings and specific examples. It should be understood that the specific examples described herein are merely illustrative and not intended to limit the scope of the invention.

[0080] Example 1

[0081] like Figure 1 As shown, a method for detecting crack edges in the gearbox housing of a CRH5 high-speed train includes the following steps:

[0082] S1: Video monitoring and crack image acquisition of gearbox housing of CRH5 EMU;

[0083] like Figure 2 As shown, the CRH5 EMU gearbox onboard video monitoring system uses equipment such as gearbox mounting brackets installed on the power bogies, fiber optic network dome cameras (720p effective pixels, IP66 protection level) on the bottom bracket of the gearbox, onboard network video recording host (NVR), and emergency alarm buttons to collect and store video information of the gearbox in service. The data is then transmitted to the CRH5 EMU platform management system via the built-in 3G / 4G wireless network of the NVR host, realizing full video monitoring of the CRH5 EMU gearbox during its service life.

[0084] S2: Gearbox housing crack image sample dataset expansion;

[0085] S2.1: Crack image sample (data) set expansion;

[0086] To ensure sufficient image samples (data) for later deep learning using Convolutional Neural Networks (CNN), the PIL library in Python was called. Through spatial geometric transformation, color transformation, noise transformation, and other methods, normal sample seed values ​​(expansion factor) and fault sample seed values ​​were selected to complete the batch expansion of the gearbox housing crack dataset.

[0087] S2.2: Crack image samples are divided into training set and validation set.

[0088] The labelimg data annotation tool was installed using Python. Sample image files were stored in JPEGImages of the YOLOv5 deep learning algorithm, and category information was stored in predefined_classes.txt. Since labelimg generates labels in XML format for crack image labeling, while YOLOv5 requires TXT labels, the XML labels need to be converted to TXT.

[0089] Set the training set ratio to 80% (80% of the dataset is used for training), and the remainder for validation. In the YOLOv5 model file, set the pre-trained weight file to lightweightYoLOv5s.pt, the number of classes to 1, the crack label to 0, the number of images input to the network per pass to 2, and the number of training epochs to the expanded maximum crack dataset. This allows for various learning and training methods.

[0090] S3: Image preprocessing of gearbox housing cracks;

[0091] S3.1: As Figure 3 As shown, to visually reflect the brightness of a digital image, the crack image is converted into a grayscale histogram, and the distribution probability characteristics at different grayscale levels are statistically analyzed to obtain the total number of occurrences of each grayscale level in the image. Figure 4 As shown, the horizontal axis of the grayscale image represents the gray levels of the image, and the vertical axis represents the probability of each gray level pixel appearing.

[0092] S3.2: To distinguish between cracked and non-cracked regions, point operations are performed on the crack image. Simultaneously, a grayscale mapping is established to adjust the grayscale of the original crack image. A linear grayscale transformation improves image quality, highlights crack image details, and increases image contrast. After the linear grayscale transformation, the pixel grayscale values ​​change, and the image contrast changes accordingly. The expression for the linear grayscale transformation function is as follows:

[0093] D B =f(D A ) = KD A +B;

[0094] In the formula, K is the slope of the linear transformation function f, B is the intercept of the linear transformation function f on the vertical axis, and D... A D represents the grayscale value before the transformation. A This is represented as the grayscale value after transformation.

[0095] S3.3: Nonlinear gamma transform of image grayscale;

[0096] The gamma coefficient γ is an important parameter for image grayscale correction. Its value reflects the grayscale mapping pattern between the original image and the processed image, determining whether to enhance low grayscale (dark) areas or high grayscale (bright) areas. The gamma transform expression is as follows:

[0097] y = (x + esp) γ ;

[0098] In the formula, x and y are the horizontal and vertical coordinates, respectively, both ranging from [0,1]. esp is the compensation coefficient, and γ is the gamma coefficient. When γ = 1, it degenerates into a linear transformation, with no impact on the overall image contrast. When γ > 1, the high grayscale (bright) areas of the transformed image are enhanced, resulting in a brighter overall image. When γ < 1, the low grayscale (dark) areas of the transformed image are enhanced, resulting in a darker overall image. Figure 5 The image shown is the result of nonlinear gamma transformation of the crack image grayscale.

[0099] S4: Image enhancement processing of gearbox housing cracks;

[0100] S4.1: The median filtering algorithm is used to filter the image of the gearbox housing crack;

[0101] The value of a point in a crack image is replaced by the median value of pixels within a certain neighborhood of that point, making the surrounding pixel values ​​closer to the true value, thereby eliminating isolated noise points and achieving denoising in the crack image. The specific steps of two-dimensional median filtering include: ① Sliding the two-dimensional filter template point by point along the crack image until the origin of the template coincides with a pixel (x, y) in the image; ② Obtaining the grayscale value of each corresponding pixel under the template and sorting them in ascending order; ③ Assigning the grayscale value of the middle element of the grayscale value sequence to the pixel at the center of the corresponding template position in the grayscale image, that is, replacing the data to be processed with the sorted median value. The calculation formula for two-dimensional median filtering is shown below:

[0102] g(x,y)=med{f(xM,yN),M,N∈W};

[0103] Where g(x,y) is the filtered image, med represents median filtering, f(x,y) is the input two-dimensional image of the gearbox housing crack, m represents the horizontal scale of the filtering window, n represents the vertical scale of the window, and W is the two-dimensional template. Here, a 3×3 two-dimensional rectangular filter is used to filter the image f(x,y), as follows: Figure 6 As shown, Figure 6 This is the effect of median filtering on the crack image.

[0104] S4.2: The contrast-limited adaptive histogram equalization method is used to enhance the crack image;

[0105] When the acquired crack images are underexposed or overexposed, a contrast-limited adaptive histogram equalization method is used to enhance the crack images under unsatisfactory lighting conditions. To limit contrast amplification, the histograms are first cropped, each histogram is redistributed, and then the transformation function is calculated. The cropping upper limit β for each histogram and the formula for contrast calculation C are as follows:

[0106]

[0107]

[0108] Where L is the number of gray levels in each histogram, u is the mean gray level of the histogram, q is the root mean square error of the histogram, and I... max I min Represents the maximum and minimum values ​​of image pixels, such as Figure 7 As shown, Figure 7 Image enhancement effect of contrast-limited adaptive histogram equalization;

[0109] S5: Otsu adaptive thresholding algorithm is used to segment images of gearbox housing cracks;

[0110] Based on the grayscale characteristics of the image, the crack image is divided into two parts: background and target. An optimal segmentation threshold is determined to perform binary segmentation on the image, separating the background (region of interest) from the image. Let n be the number of pixels with grayscale value i in the image. i If the total number of gray levels is L, then the total number of pixels is:

[0111]

[0112] The probability of a pixel with grayscale value i is denoted as P. i The calculation formula is as follows:

[0113]

[0114] Suppose that threshold T0 divides the crack image into two regions with gray levels equal to W0 and W1, and these regions are gray level sets within the gray level intervals [0, T0-1] and [T0, L]. The corresponding probabilities are respectively:

[0115]

[0116] The average grayscale formulas for the two regions are respectively equal to:

[0117]

[0118] The formula for calculating the average gray level of the entire image is:

[0119] μ = P0W0 + P1W1;

[0120] The formulas for calculating the total variance of regions W0 and W1 are as follows:

[0121] δ 2 =P0(μ-W0) 2 +P1(μ-W1) 2 ;

[0122] The T0 value with the largest total variance is the optimal segmentation threshold, and it is used as the higher threshold T in the dual thresholding method. max Then select 0.3T max As a low threshold; after crack image segmentation, W0 and W1 represent the foreground and background regions, respectively, such as Figure 8 As shown, Figure 8 Image showing the result of crack segmentation using the Otsu algorithm.

[0123] S6: Crack image edge detection combining multi-scale morphological operations and the Canny operator;

[0124] S6.1: Gearbox housing crack edge detection based on morphological operations;

[0125] Morphological operations use structuring elements to extract features from regions of interest. After binary segmentation of a crack image F = f(x,y), holes or fractures may appear in the crack region. Let B(x,y) be the structuring element; mathematical morphological operations are introduced for image processing, including dilation, erosion, and opening / closing operations.

[0126] ① After thresholding the image of the gearbox housing crack, the crack in the region of interest may become two parts. Dilation is used to connect the two crack fracture sub-regions. The dilation operation is performed on the thresholded crack image by selecting the structuring element size, denoted as . The domain is D f D B The following formula exists:

[0127]

[0128] ② Select a suitable structuring element to erode the expanded crack image, thus "slimming down" the crack boundaries and reducing the number of image pixels; the erosion operation is denoted as... The following formula is given:

[0129]

[0130] ③ The opening operation first erodes and then dilates the crack image to eliminate small details, denoted as F°B; the closing operation first dilates the image and then performs an erosion operation to fill small holes or cracks in the image, denoted as F*B; both the opening and closing operations can smooth the crack boundary and obtain the crack image edge. Their calculation relationship is simplified as follows:

[0131]

[0132]

[0133] like Figure 9 As shown, Figure 9 The result of crack edge detection performed on morphological operations.

[0134] S6.2: Crack image edge detection based on Canny operator;

[0135] The main steps for image edge detection using the Canny operator are as follows:

[0136] ① The crack image is converted to grayscale, filtered using median filtering, and then smoothed using a two-dimensional Gaussian filter.

[0137] The cracked image f(x,y) is convolved with a two-dimensional Gaussian filter G(x,y), and the smoothed image E(x,y) is calculated using the following formula:

[0138]

[0139] E(X,Y)=f(x,y)*G(x,y);

[0140] In the formula, δ is the distributed parameter of the Gaussian filter.

[0141] For each pixel in the filtered image, the magnitude and direction of the gradient are calculated using the finite difference of the first-order partial derivative. The first-order difference convolution template used is shown below:

[0142]

[0143] The partial derivatives of any pixel (i,j) in the x and y perpendicular directions of the image f(x,y) of the gearbox housing crack are calculated as follows:

[0144] G x (i,j)=(E[i,j+1]-E[i,j]+E[i+1,j+1]-E[i+1,j]) / 2;

[0145] G y (i,j)=(E[i,j]-E[i+1,j]+E[i,j+1]-E[i+1,j+1]) / 2;

[0146] The formulas for calculating the magnitude and direction of its gradient operator are as follows:

[0147]

[0148] θ(i,j)=arctan[G y (i,j) / G x [i,j];

[0149] F(i,j) reflects the edge intensity at point (i,j) on the crack image, and θ(i,j) is the normal vector of image point (i,j) and is orthogonal to the edge direction. Usually, the gradient direction of each point is used to determine whether the intensity of this point is the maximum value of its neighborhood, and thus determine whether the point is an image edge point.

[0150] ② Based on the gradient direction, retain the local gradient maximum points and suppress non-maximum values ​​of the gradient magnitude;

[0151] The crack edge image E is obtained by using dual threshold detection and concatenation of crack image edges. F1 ;

[0152] The edge image is obtained by using two thresholds of the non-maximum suppression image: points greater than the high threshold are identified as edges, while points less than the low threshold are not edges. Points below the high threshold and above the low threshold are identified as weak edge points through eight connected regions. The high threshold image edges are connected into a contour using the double threshold method. Points that meet the low threshold are found in the eight neighborhood points of the breakpoint and connected to the contour. This achieves the connection of the edges of the high threshold crack image, thereby determining the edge position and the edge image EF1.

[0153] S6.3: Crack image edge detection combining multi-scale morphological operations and Canny operator;

[0154] Choose the following two structural elements:

[0155]

[0156] Perform n expansions on structuring elements A and B (where n is the scale parameter), denoted as follows: For the crack image F, an expansion structure A is used. n A continuous nth multiscale expansion is denoted as: The image edges obtained from the improved large-scale morphological operator relation are shown below:

[0157]

[0158] like Figure 10 As shown, Figure 10 The image shows the result of combining morphology with the Canny operator for edge detection. The steps for crack image edge detection combining multi-scale morphology with the Canny operator are as follows:

[0159] ① The scale parameter is set to 2, and the structuring element A is obtained through dilation operation. n and B n ;

[0160] ②Based on image edge E F1 E F2 Calculate the difference value E of the edge image. e E e =F F1 -F F2 ;

[0161] ③Based on the difference map, the pixels E with non-zero grayscale values e (x,y), find connected edge points, including weak edge points, in the neighborhood to determine the detailed edge point image e(x,y), or simply e;

[0162] ④ Transfer the edge image E F1 E F2By fusing the aforementioned detailed edge image e, a crack image edge E with clear contours and prominent details can be obtained:

[0163] E = E F1 modE F1 +1.5e;

[0164] In the formula, the symbol mod represents the modulo operation.

[0165] In this embodiment, the present invention conducted experiments on gearbox housing crack images using two edge image detection methods: a "binary morphological operation" method and a "multi-scale morphological operation combined with the Canny operator" method. This achieved automatic detection of gearbox crack image edges, thus solving the problems of low efficiency in manual visual monitoring and difficulty in achieving automatic computer detection of cracks in traditional gearbox crack monitoring methods. The average peak signal-to-noise ratio (PSNR) (dB) obtained were 30.85 and 35.77, respectively. The latter method improved the PSNR by approximately 16% compared to the former. Therefore, the gearbox crack edge image detection method combining multi-scale morphological operations and the Canny operator has better detection performance and is suitable for edge detection of crack images.

Claims

1. A method for detecting crack edges in the gearbox housing of a CRH5 high-speed train, characterized in that, Includes the following steps: S1: Collect images of cracks in the gearbox housing of the CRH5 high-speed train; S2: Preprocess the image of the gearbox housing crack to obtain a grayscale image of the crack; When there is underexposure or overexposure, the grayscale histogram under unsatisfactory lighting conditions is enhanced by using a limited contrast adaptive histogram equalization method after the preprocessing step. First, crop the grayscale histogram, then redistribute each grayscale histogram, and finally calculate the transformation function. The formulas for the shear limit β and contrast calculation C of each grayscale histogram are as follows: ; ; Where L is the number of gray levels in each gray-level histogram, u is the mean gray level of the gray-level histogram, q is the standard deviation of the gray-level histogram, and I... max I min Represents the maximum and minimum values ​​of image pixels; S3: Filter the grayscale image of the crack. The median filtering algorithm is used to filter the grayscale image of the crack to obtain the filtered crack image. S4: The Otsu adaptive thresholding algorithm is used to segment the filtered crack image, dividing the filtered crack image into two parts: background and target. The background is separated from the image to obtain the target image. S5: Use multi-scale morphological operations combined with the Canny operator to perform edge detection on the target image, and obtain image edges with clear contours and prominent details; In S5, the crack image edge detection combining multi-scale morphological operations and the Canny operator specifically involves: Choose the following two structural elements: A = ; B = ; Perform n expansions on structuring elements A and B, where n is the scale parameter, denoted as A and B respectively. n =A……㊉A、B n =B㊉B……㊉B; For the target image F, a dilation structure A is used. n A continuous n-fold multiscale expansion is denoted as: F ⊉ A n =(((F㊉A)㊉A……)㊉A, then the improved large-scale morphological operator relation yields the image edge E. F2 As shown below: HAVE BEEN F2 = (F∘A n )㊉B n -(F A n )㊀B n .

2. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 1, characterized in that, S1 uses video surveillance equipment to collect images of cracks in the gearbox housing of the CRH5 high-speed train. The surveillance equipment includes: Gearbox mounting bracket; The gearbox mounting bracket is fixedly installed on the power bogie of the CRH5 EMU; At least two cameras; at least one camera is fixedly mounted on the bottom bracket of the gearbox, and at least one camera is fixedly mounted on the gearbox mounting bracket, with all cameras pointing towards the gearbox body; Main unit NVR; The main unit NVR is connected to all cameras and is used to store images of gearbox housing cracks captured by the cameras; Monitoring terminal; The monitoring terminal is connected to the host NVR and is used to acquire images of gearbox housing cracks and perform real-time monitoring.

3. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 1, characterized in that, The preprocessing in S2 mainly includes the following steps: S2.1: Convert the image of the gearbox housing crack into a grayscale histogram. The horizontal axis of the grayscale histogram represents the gray level of the image, and the vertical axis represents the probability of each gray level pixel appearing. S2.2: Perform a nonlinear gamma transform on the grayscale histogram to obtain the crack grayscale image; The expression for the gamma transform is: ; In the formula, x and y are the horizontal and vertical coordinates of the grayscale histogram, respectively, and their values ​​are both in the range of [0, 1]. esp is the compensation coefficient, and γ is the gamma coefficient.

4. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 1, characterized in that, In S3, the specific steps of the median filtering algorithm for filtering crack grayscale images include: S3.1: Slide the template of the two-dimensional 3×3 rectangular filter point by point along the crack grayscale image so that the origin of the template coincides with a certain pixel (x,y) in the crack grayscale image; S3.2: Obtain the grayscale value of each corresponding pixel under the template and sort them in ascending order; S3.3: Assign the gray value of the middle element of the gray value sequence to the pixel at the center of the template corresponding to the crack gray value image to obtain the image processed by the median filtering algorithm. The calculation formula of the median filtering algorithm is as follows: ; In the formula, f(x,y) is the original image of the input crack grayscale image, and W represents the two-dimensional template.

5. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 1, characterized in that, The specific image segmentation method in S4 is as follows: Let threshold T0 divide the crack image into two regions with gray levels equal to W0 and W1, respectively, and the corresponding probabilities equal to W0 and W1. The formula for calculating the average gray level of the crack image after filtering is: ; The formula for calculating the total variance is: ; The optimal segmentation threshold is T0, which has the largest total variance. Therefore, T0 is selected as the higher threshold (T0) in the dual thresholding method. max Alternatively, choose 0.3T. max As a low threshold, after filtering, the crack image is segmented into W0 and W1, which are the foreground region and background region, respectively, where W0 is the target image.

6. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 1, characterized in that, In S5, the main steps of image edge detection using the Canny operator in combining multi-scale morphological operations with the Canny operator are as follows: The target image f(x, y) is convolved with a two-dimensional Gaussian filter G(x, y), and the smoothed image E(x, y) is calculated using the following formula: ; ; In the formula, δ is the distributed parameter of the Gaussian filter; For each pixel in the target image, the magnitude and direction of the gradient are calculated using the finite difference of the first-order partial derivative. The first-order difference convolution template used is shown below: , ; The partial derivatives of any pixel (i,j) in the target image f(x, y) in the two perpendicular directions of x and y are calculated using the following formulas: ; ; The formulas for calculating the magnitude and direction of its gradient operator are as follows: ; ; F(i, j) reflects the edge intensity at point (i, j) in the target image. θ(i, j) is the normal vector of image point (i, j) and is orthogonal to the edge direction. Based on the gradient direction of each point, it is determined whether the intensity of this point is the maximum value of its neighborhood, and thus whether the point is an image edge point. Based on the gradient direction, local gradient maxima are preserved, and non-maximum gradient magnitudes are suppressed. Double thresholding is used to detect and connect image edges to obtain the crack edge image E. F1 .

7. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 6, characterized in that, In S5, the crack image edge detection steps combining multi-scale morphology and the Canny operator are as follows: S2.1: The scale parameter is set to 2, and the structuring element A is obtained through dilation operation. n and B n ; S2.2: Based on image edge E F1 E F2 Calculate the difference value E of the edge image. e E e = F F1 -F F2 ; S2.3: Based on the difference map, the pixels E with non-zero grayscale values... e (x, y), find connected edge points, including weak edge points, in the neighborhood to determine the detailed edge point image e (x, y), or simply e; S2.4: Transfer the edge image E F1 E F2 By fusing it with the detail edge image e, a crack image edge E with clear outline and prominent details can be obtained.

8. The method for detecting crack edges in the gearbox housing of a CRH5 high-speed train according to claim 2, characterized in that, The camera is a fiber optic network dome camera with an effective pixel count of 720p and an IP66 protection rating. The main NVR is a vehicle-mounted network video recording main NVR.

Citation Information

Patent Citations

  • Visual detection method for slots on the surface of a bridge pier

    CN109523479A

  • Insulator crack detection method based on Canny operator two-dimensional threshold segmentation optimization

    CN111260616A