Improved MSR subway wheel tread image enhancement method, device and storage medium
By adaptively calculating the Gaussian convolution kernel size and illumination compensation combined with image segmentation and gamma correction technology, the convolution kernel fixation and information loss problems of the MSR algorithm in subway wheel tread image enhancement are solved, and the grayscale uniformity and visibility of the image are improved.
Patent Information
- Application Number
- CN202210915199.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-01
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-08-01
AI Technical Summary
The existing MSR algorithm has problems in subway wheel tread image enhancement, such as the fixed convolution kernel size is not applicable, the consistent global pixel processing method leads to information loss, and the effective grayscale area is compressed, which affects image processing and human eye recognition.
Adaptive calculation of Gaussian convolution kernel size is adopted, and illumination compensation is performed based on texture compensation parameters of gray-level co-occurrence matrix and the distribution law of point light sources. Image segmentation and gamma correction technology are combined to optimize the image enhancement process.
It improves the grayscale uniformity and clarity of the image, enhances the visibility and recognition of the wheelset tread image, adapts to different grayscale conditions of subway wheelset tread images, and improves the image processing effect.
Smart Images

Figure CN115330611B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of subway vehicle detection, and more particularly to an improved MSR subway wheel tread image enhancement method, device and storage medium. Background Art
[0002] Wheelsets are critical components of the running gear of railway locomotives. Because they bear the direct impact of the tracks, uneven wear easily develops on the wheelset treads. Continuously increasing wear on the tread surface can lead to vehicle safety accidents, resulting in significant losses to railway transportation and posing a significant threat to people's property and lives. Therefore, dynamic detection and fault diagnosis of locomotive wheelsets are crucial. Whether performed manually or through machine recognition, the accuracy of fault diagnosis directly depends on the quality of the tread images, necessitating image enhancement prior to troubleshooting. Commonly used image enhancement methods include grayscale-based gamma transformation, histogram equalization, and various retinal cortex theories (retinex) based on local features.
[0003] Retinex theory, a theory of color constancy proposed by Land et al. in 1971, states that the color of an object depends solely on the object itself and is independent of the intensity of the incident light. Land subsequently proposed a path model that takes the average of the pixels along a random path to a pixel as the new value of the current pixel. Horn et al. proposed the PDE (Partial Differential Equations) model, which first proposed decomposing an image into an illumination image and a reflectance image. Variational models transform the problem into an optimization problem by constructing constraints. Currently, the best performing center-surround model uses the ratio of the brightness of surrounding pixels to the brightness of the current pixel to represent the retinex result. Representative center-surround models include multi-scale retinex (MSR) and multi-scale retinex with color restoration (MSRCR).
[0004] The above-mentioned algorithms have achieved some success in color correction and image enhancement for images in foggy, underwater, or low-light conditions. However, because the Gaussian filter used by the Retinex algorithm to estimate illumination images uses a uniform convolution kernel, it lacks sensitivity to the position of the center pixel and the directional features within the convolution kernel. Furthermore, the supplemental lighting used by subway trackside equipment uses point sources, resulting in uneven illumination. Therefore, the above-mentioned algorithms are not suitable for subway wheel set detection scenarios. Furthermore, the Retinex algorithm uses a fixed-size convolution kernel, making RGB images less sensitive to the Gaussian filter kernel size, thus minimizing the impact. Wheel set equipment, on the other hand, collects single-channel grayscale images, requiring more flexible selection of the convolution kernel size to achieve better image enhancement results.
[0005] In addition, for the scenario of wheelset tread equipment images, the traditional MSR algorithm has limitations, mainly manifested in the following three points:
[0006] 1. The size of the Gaussian convolution kernel is usually selected based on empirical experience and is applicable to a single scenario. However, images collected by wheelset tread inspection equipment can experience changes in grayscale distribution due to brightness changes, changes in texture depth due to shooting distance, and changes in texture coarseness due to changes in focal length. Fixed-size convolution kernels cannot adapt to these scenarios.
[0007] 2. The value of the Gaussian convolution kernel is calculated based on the two-dimensional normal distribution. Therefore, the parameter value of each position of the convolution kernel is only related to the distance from the position to the center pixel. It lacks sensitivity to the position information of the center pixel and the directional characteristics within the convolution kernel. That is, the same processing method is used for all pixels globally, which may lead to some information loss.
[0008] 3. The grayscale value distribution of the illumination image obtained by convolution filtering of the original image is uneven. The pixels in the range close to 0 and 255 are sparsely distributed, resulting in the compression of the effective grayscale area, affecting subsequent image processing and human eye recognition. Summary of the Invention
[0009] In order to overcome the defects existing in the above-mentioned prior art, the present invention discloses a subway wheel set tread image enhancement method, device and storage medium with improved MSR, so as to solve the problems such as the above-mentioned fixed-size convolution kernel is not suitable for subway wheel set tread images, the same processing method is used for global pixels, resulting in partial information loss, and the effective grayscale area is compressed, affecting subsequent image processing and human eye recognition.
[0010] In order to achieve the above objectives, the present invention adopts the following technical solutions:
[0011] In a first aspect, the present invention provides a method for enhancing a subway wheel tread image by improving MSR, comprising the following steps:
[0012] S1. Obtain the original image of the subway wheel tread, calculate the gray level co-occurrence matrix of the original image, and construct texture compensation parameters based on the energy and contrast of the gray level co-occurrence matrix;
[0013] Existing research methods for selecting MSR thresholds include manual experience-based methods and adaptive extraction. Manual experience-based methods often fail to adapt to image variations and are unsuitable for wheelset inspection image data. This invention uses adaptive extraction to select the MSR threshold.
[0014] The MSR algorithm generally selects three scales of convolution kernels for weighted calculation, which are divided into small, medium and large. The artificial experience values of the three convolution kernel sizes are 15, 80, and 200. In order to adapt to the subway wheel tread image, the present invention multiplies the artificial experience value with a texture compensation coefficient to obtain the coefficient actually used. The texture compensation parameter calculation is based on the statistics of the gray-level co-occurrence matrix (GLCM) of the image. The gray-level co-occurrence matrix is defined as the probability that the gray-level value of a point is j when it leaves a fixed position (with a distance of d and an orientation of θ) from a pixel point with gray-level i. It reflects the texture characteristics of the gray-level distribution in the image. The energy index of the gray-level co-occurrence matrix reflects the uniformity of the gray-level distribution and the coarseness of the texture. The contrast index of the gray-level co-occurrence matrix reflects the clarity of the image and the depth of the texture. The present invention can adaptively calculate the size of the Gaussian convolution kernel according to the texture thickness and depth of the wheelset tread image, thereby realizing a filtering method compatible with various grayscale conditions of subway wheelset tread images.
[0015] Preferably, the energy of the gray-level co-occurrence matrix is: ;
[0016] The contrast of the gray-level co-occurrence matrix is: ;
[0017] Where, is the energy of the gray-level co-occurrence matrix, is the contrast of the gray-level co-occurrence matrix, is the gray-level co-occurrence matrix, are the row and column coordinates of the gray-level co-occurrence matrix, respectively.
[0018] Preferably, the texture compensation parameters are:
[0019]
[0020] in, Indicates the scaling sizes corresponding to the three artificial experience values, , is the energy value obtained by the gray-level co-occurrence matrix of the image, is the experience energy value, is the contrast of the original image, is the empirical value of contrast, Indicates three different texture compensation parameter numbers, .
[0021] S2. Calculating the variance of Gaussian convolution kernels of three scales according to the texture compensation parameters;
[0022] For images with obvious texture features, coarse and deep textures, the scale of the Gaussian convolution kernel can be appropriately enlarged to weaken the effect of grayscale contraction while not losing too much texture characteristics. Based on the above inference, the variance of the Gaussian convolution kernel is designed.
[0023] Preferably, the variance of the Gaussian convolution kernel is:
[0024]
[0025] Where, is the variance of different Gaussian convolution kernels, The convolution kernel size representing the artificial experience value, , represents the texture compensation parameter, These are the convolution kernel identifiers of three different sizes for the MSR algorithm.
[0026] From the above formula, we can see that the size of the Gaussian convolution kernel variance is It increases with the increase of energy and contrast.
[0027] S3. Based on the pixel distribution law under the point light source and the variance of the Gaussian convolution kernel, brightness compensation is performed on the Gaussian convolution kernels of three scales to obtain illumination compensation convolution kernels of three scales;
[0028] The parameter values of the convolution kernel of a traditional Gaussian filter follow a two-dimensional normal distribution in all directions. Furthermore, this distribution remains unchanged when the center pixel changes. This means that when extracting illumination characteristics within a neighborhood, the Gaussian convolution kernel assumes that the contribution of each pixel to the center pixel follows a normal distribution. This does not meet the requirements of actual scenes and requires compensation. This compensation is based on the distribution of pixels under point light sources.
[0029] Preferably, the illumination compensation convolution kernel is:
[0030]
[0031] Where, is the convolution kernel before rotation, is the Gaussian convolution kernel before compensation, is the convolution kernel after final illumination compensation, 、 is the coordinate of the current convolution center in the image, 、 is the image coordinate of the illumination center point of the point light source in the illumination plane, is the Gaussian filter variance, , is the direct distance of the light source, 、 are the coordinate information of the current convolution kernel respectively.
[0032] In the present invention, since the obtained convolution kernel is not symmetrical, according to the principle of convolution operation, the convolution kernel needs to be rotated 180 degrees, and the algebraic sum in the convolution kernel must be guaranteed to be 0, so it needs to be normalized.
[0033] The illumination intensity of a point light source at a certain point on the illumination plane is inversely proportional to the distance from the point to the illumination center. The grayscale value of each pixel of the illumination image corresponds to the illumination intensity of the actual position of the object corresponding to the pixel. Therefore, for any convolution kernel, with the center of the convolution kernel as the reference, the value of each position parameter of the convolution kernel is equal to the ratio of the grayscale value of the position to the grayscale of the center of the convolution kernel, which is equal to the distance from the point (i, j) to the illumination center (x L ,y L ) and the convolution center point (x C ,y C )’s distance ratio.
[0034] S4, constructing a reflection image based on the illumination compensation convolution kernel;
[0035] Preferably, the reflected image is:
[0036]
[0037] Where, is the reflected image, are the coefficients corresponding to three different Gaussian kernels, is the original image, is the Gaussian convolution kernel, is the Gaussian convolution kernel variance, are the coordinate position information of the image pixel points, is a label used to distinguish three different sizes of convolution kernels. .
[0038] S5. Perform global image enhancement on the reflected image to obtain an enhanced image of the subway wheel tread.
[0039] The reflected image, obtained by subtracting the Gaussian filtered image from the original image in the logarithmic domain, exhibits a certain degree of grayscale compression. The grayscale values of the reflected image are often concentrated between high and low frequencies, while the pixel values at both ends are relatively sparse, resulting in lower overall image quality and reduced recognition.
[0040] Furthermore, objects in wheelset tread images exhibit certain distribution characteristics. For example, in wheelset tread images, the rails act as interference objects for the detection task, while the circular wheelset area represents our region of interest. The rails extend from a distance, have a large grayscale span, and occupy a large area within the image, easily interfering with wheelset tread analysis.
[0041] In view of the above problems, the present invention solves this defect through the following method.
[0042] Preferably, the step S5 comprises the following steps:
[0043] S51, removing interference parts in the reflected image by image segmentation;
[0044] S52, retaining the grayscale interval of the remaining ROI area after segmentation;
[0045] S53, stretching the grayscale range and performing gamma correction;
[0046] S54: Perform histogram equalization on the corrected image to obtain an enhanced image.
[0047] Preferably, the image segmentation adopts an image segmentation method based on edge extraction, uses the edge extraction method of the Canny operator to extract the edges of the wheelset detection image, and uses the image Hough transform to extract the straight lines in the marginalized image, and extracts the rail edge through the three points of the straight line slope, the straight line distribution, and the grayscale gradient on both sides of the straight line, and segments the image into an adaptive area of interest according to the rail edge.
[0048] The grayscale values of the segmented region of interest (ROI) are often compressed within a certain range. To enhance image quality, the present invention performs interval gamma correction on the ROI. Traditional gamma correction applies to global grayscale, mapping [0, 255] to [0, 255]. However, the present invention changes the scope of gamma correction from global to interval, adding a linear coefficient to the transformation function and truncating grayscale values outside the ROI.
[0049] Preferably, the gamma correction is:
[0050]
[0051] Where, is the grayscale value after transformation, is the gray value of the reflected image, is the grayscale value of the region of interest obtained by segmentation.
[0052] The above-mentioned subway wheelset tread image enhancement method provided by the present invention first adaptively calculates the Gaussian convolution kernel size based on the overall grayscale mean and grayscale distribution of the image according to grayscale statistics. Secondly, the convolution calculation method is optimized. Based on the light intensity distribution characteristics of the point light source on the plane, the light compensation amount at the current position is added to the single convolution calculation. At the same time, the light compensation amount introduces directional information based on the current position, and directional compensation values are added in the upper, lower, left, and right directions to form an asymmetric Gaussian convolution kernel. Finally, when the final reflected image is obtained, the image is linearly stretched within the interval, and the highlight and low-brightness areas are suppressed. The grayscale range of some target components is gamma-corrected to highlight the area of interest, thereby solving the grayscale interval compression problem.
[0053] In a second aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor executes the steps in the method for enhancing the image of a subway wheel set tread.
[0054] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method for enhancing the tread image of a subway wheel set.
[0055] Beneficial effects of the present invention:
[0056] 1. In the subway wheelset tread image enhancement method provided by the present invention, the energy index of the grayscale co-occurrence matrix reflects the uniformity of the image grayscale distribution and the coarseness of the texture, and the contrast index of the grayscale co-occurrence matrix reflects the clarity of the image and the depth of the texture. The size of the Gaussian convolution kernel is adaptively calculated according to the texture coarseness and depth of the wheelset tread image, thereby realizing a filtering method compatible with various subway wheelset tread image grayscale conditions.
[0057] 2. The subway wheel tread image enhancement method provided by the present invention performs illumination compensation on the parameters of the Gaussian kernel based on the distance from the illumination center according to the point light source illumination model, thereby further improving the accuracy of MSR illumination image extraction.
[0058] 3. The subway wheelset tread image enhancement method provided by the present invention uses image segmentation based on image edges and Hough transform to enhance the global image, performs grayscale truncation on non-interest areas, and then performs gamma correction on the image interest areas, thereby improving the image quality and visibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a flow chart of the method of the present invention;
[0060] Figure 2 The image is the result of MSR using the convolution kernel size of 15, 80, and 200, which are artificially experienced values;
[0061] Figure 3 The results of MSR using adaptive convolution kernel size;
[0062] Figure 4 is an image without illumination compensation;
[0063] Figure 5 is the processing result of Gaussian kernel brightness compensation of the present invention;
[0064] Figure 6 To compensate for the difference between the front and back images;
[0065] Figure 7 This is an image without gamma correction;
[0066] Figure 8 An image that is gamma-corrected according to the present invention;
[0067] Figure 9 HE enhancement for the original image;
[0068] Figure 10 This is the HE enhancement after gamma correction in the present invention. DETAILED DESCRIPTION
[0069] The following will provide a clear and complete description of the concept, specific structure and technical effects of the present invention in conjunction with the embodiments and drawings, so as to fully understand the purpose, features and effects of the present invention.
[0070] Example 1
[0071] A subway wheel tread image enhancement method based on improved MSR, such as Figure 1 As shown, the following steps are included:
[0072] S1. Obtain the original image of the subway wheel tread, calculate the gray level co-occurrence matrix of the original image, and construct texture compensation parameters based on the energy and contrast of the gray level co-occurrence matrix;
[0073] S2. Calculating the variance of Gaussian convolution kernels of three scales according to the texture compensation parameters;
[0074] S3. Based on the pixel distribution law under the point light source and the variance of the Gaussian convolution kernel, brightness compensation is performed on the Gaussian convolution kernels of three scales to obtain illumination compensation convolution kernels of three scales;
[0075] S4, constructing a reflection image based on the illumination compensation convolution kernel;
[0076] S5. Perform global image enhancement on the reflected image to obtain an enhanced image of the subway wheel tread.
[0077] In this embodiment, the energy index of the grayscale co-occurrence matrix reflects the uniformity of the grayscale distribution and the texture coarseness of the image, and the contrast index of the grayscale co-occurrence matrix reflects the clarity of the image and the depth of the texture. According to the texture coarseness and depth of the wheelset tread image, the size of the Gaussian convolution kernel is adaptively calculated to achieve a filtering method that is compatible with various grayscale conditions of subway wheelset tread images.
[0078] Example 2
[0079] This embodiment further elaborates on step S1 based on Example 1. Existing research methods for selecting MSR thresholds include manual experience-based and adaptive extraction. Manual experience-based selection often cannot adapt to image changes and cannot be applied to wheelset inspection image data.
[0080] The MSR algorithm generally selects three convolution kernels of different sizes for weighted calculation, which are divided into small, medium and large. The manual experience values of the three convolution kernel sizes are 15, 80, and 200. In order to adapt to the subway wheel tread image, this embodiment multiplies the manual experience value with a texture compensation coefficient to obtain the coefficient actually used. The texture compensation parameter calculation is based on the statistics of the gray-level co-occurrence matrix (GLCM) of the image. The gray-level co-occurrence matrix is defined as the probability that the gray-level value of a point with a gray-level i is j when it leaves a fixed position (with a distance of d and an orientation of θ). It reflects the texture characteristics of the gray-level distribution in the image. The energy index of the gray-level co-occurrence matrix reflects the uniformity of the gray-level distribution and the coarseness of the texture of the image, and the contrast index of the gray-level co-occurrence matrix reflects the clarity of the image and the depth of the texture. This embodiment can adaptively calculate the size of the Gaussian convolution kernel according to the texture thickness and depth of the wheelset tread image, thereby realizing a filtering method compatible with various grayscale conditions of subway wheelset tread images.
[0081] Specifically, in this embodiment, the energy of the gray-level co-occurrence matrix is: ;
[0082] The contrast of the gray-level co-occurrence matrix is: ;
[0083] Where, is the energy of the gray-level co-occurrence matrix, is the contrast of the gray-level co-occurrence matrix, is the gray-level co-occurrence matrix, are the row and column coordinates of the gray-level co-occurrence matrix, respectively.
[0084] In this embodiment, the texture compensation parameters are:
[0085]
[0086] in, Indicates the scaling sizes corresponding to the three artificial experience values, , is the energy value obtained by the gray-level co-occurrence matrix of the image, is the experience energy value, is the contrast of the original image, is the empirical value of contrast, Indicates three different texture compensation parameter numbers, .
[0087] Example 3
[0088] This example further elaborates on step S2 based on Example 2. For images with distinct texture features, such as coarse and deep textures, the scale of the Gaussian convolution kernel can be appropriately enlarged to reduce the grayscale shrinkage effect without losing too much texture. Based on the above inference, the variance of the Gaussian convolution kernel is designed.
[0089] Specifically, in this embodiment, the variance of the Gaussian convolution kernel is:
[0090]
[0091] Where, is the variance of different Gaussian convolution kernels, The convolution kernel size representing the artificial experience value, , represents the texture compensation parameter, These are the convolution kernel identifiers of three different sizes for the MSR algorithm.
[0092] From the above formula, we can see that the size of the Gaussian convolution kernel variance is It increases with the increase of energy and contrast.
[0093] Figure 2 The image is the result of MSR using the convolution kernel size of 15, 80, and 200, which are artificial experience values. Figure 3 This is the result of MSR using adaptive convolution kernel size. It can be seen that Figure 3 The grayscale range of the image is wider and the visibility is stronger.
[0094] Example 4
[0095] This embodiment further elaborates on step S3 based on embodiment 3. The parameter values of the convolution kernel of the traditional Gaussian filter in all directions follow a two-dimensional normal distribution. At the same time, when the center pixel changes, the distribution pattern remains unchanged. In other words, when the Gaussian convolution kernel extracts the illumination feature information in the neighborhood, it assumes that the contribution of each pixel to the center pixel follows a normal distribution. This does not meet the requirements of the actual scene and needs to be compensated. The compensation method is based on the distribution pattern of pixels under point light sources.
[0096] Specifically, in this embodiment, the illumination compensation convolution kernel is:
[0097]
[0098] Where, is the convolution kernel before rotation, is the Gaussian convolution kernel before compensation, is the convolution kernel after final illumination compensation, 、 is the coordinate of the current convolution center in the image, 、 is the image coordinate of the illumination center point of the point light source in the illumination plane, is the Gaussian filter variance, , is the direct distance of the light source, 、 are the coordinate information of the current convolution kernel. Since the obtained convolution kernel is not symmetrical, according to the principle of convolution operation, the convolution kernel needs to be rotated 180 degrees, and the algebraic sum of the convolution kernel must be 0, so it needs to be normalized.
[0099] The illumination intensity of a point light source at a certain point on the illumination plane is inversely proportional to the distance from the point to the illumination center. The grayscale value of each pixel of the illumination image corresponds to the illumination intensity of the actual position of the object corresponding to the pixel. Therefore, for any convolution kernel, with the center of the convolution kernel as the reference, the value of each position parameter of the convolution kernel is equal to the ratio of the grayscale value of the position to the grayscale of the center of the convolution kernel, which is equal to the distance from the point (i, j) to the illumination center (x L ,y L ) and the convolution center point (x C ,y C )’s distance ratio.
[0100] The image result after calculation of the illumination compensation convolution kernel is as follows Figure 4 、 5 and 6: Figure 4 For images without illumination compensation, Figure 5The processing result of the algorithm of this embodiment may be difficult to distinguish the difference with the naked eye, but by subtracting the two images, it can be clearly seen that the algorithm of this embodiment has a significant enhancement of the grayscale value around the image, as shown in FIG. Figure 6 .
[0101] Example 5
[0102] This embodiment further elaborates on step S4 based on embodiment 4. In step S4, the reflected image is:
[0103]
[0104] Where, is the reflected image, are the coefficients corresponding to three different Gaussian kernels, is the original image, is the Gaussian convolution kernel, is the Gaussian convolution kernel variance, are the coordinate position information of the image pixel points, is a label used to distinguish three different sizes of convolution kernels. .
[0105] Example 6
[0106] This embodiment further elaborates on step S5 based on Example 5. The reflected image, obtained by subtracting the Gaussian-filtered image from the original image in the logarithmic domain, exhibits a certain degree of grayscale range compression. The grayscale values of the reflected image are often concentrated between high and low frequencies, while the pixel values at both ends are relatively sparse, resulting in lower overall image quality and reduced recognition.
[0107] At the same time, the objects in the wheelset tread image have certain distribution characteristics. Figure 2 For example, consider Figure 3. The rails on the right are interference objects for the detection task, and the circular wheelset area on the left is our region of interest. The rails extend from a distance, have a large grayscale span in the image, and occupy a large area within the image, easily interfering with the analysis of the wheelset tread.
[0108] To address the above problem, this embodiment uses image segmentation to remove interference parts in the image, then extracts the grayscale interval of the remaining region of interest, stretches the interval and performs gamma correction, and then performs histogram equalization to finally obtain an enhanced image.
[0109] This embodiment employs an edge-extraction-based image segmentation method, using the Canny operator to extract edges from wheelset inspection images. Taking advantage of the compositional characteristics of wheelset tread images, the interfering rails are located on one side of the image and clearly separated from the tread area. This embodiment uses the Hough transform to extract straight lines from the marginalized image. The rail edges are extracted using three factors: line slope, line distribution, and the grayscale gradient on either side of the line. This enables adaptive region-of-interest segmentation of the image based on the rail edges.
[0110] The grayscale values of the segmented region of interest are often compressed within a certain range. To enhance image quality, interval gamma correction is performed on the region of interest. Traditional gamma correction is applied to global grayscale, mapping [0, 255] to [0, 255]. This embodiment, however, changes the scope of gamma correction from global to interval, adds a linear coefficient to the transformation function, and truncates grayscale values outside the region of interest.
[0111] The optimized gamma correction formula is as follows:
[0112]
[0113] Where, is the grayscale value after transformation, is the gray value of the reflected image, is the grayscale value of the region of interest obtained by segmentation. The gamma-corrected image is as follows Figure 7 and 8 shown.
[0114] Depend on Figure 7 and Figure 8 It can be seen that after gamma correction, the image quality is significantly improved. At this time, the histogram equalization (HE) enhancement algorithm is performed, which can achieve better results than directly enhancing the original image. Figure 9 and 10 shown.
[0115] Example 7
[0116] A computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the processor executes the steps of the subway wheel tread image enhancement method described in any one of the above-mentioned embodiments 1-6.
[0117] In this embodiment, the processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0118] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs, and units. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and process work data, thereby implementing the methods described in the above embodiments.
[0119] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0120] One or more units are stored in the memory, and when executed by the processor, perform the method of any one of the above embodiments 1-6.
[0121] Example 8
[0122] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the subway wheel set tread image enhancement method described in any one of the above embodiments 1-6 are implemented.
[0123] The above is a detailed description of the embodiments of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without departing from the spirit of the present invention. These equivalents or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A subway wheel tread image enhancement method based on improved MSR, characterized in that: The following steps are involved: Obtain the original image of the subway wheel tread, calculate the gray level co-occurrence matrix of the original image, and construct texture compensation parameters based on the energy and contrast of the gray level co-occurrence matrix; Calculating the variance of Gaussian convolution kernels of three scales according to the texture compensation parameters; Based on the pixel distribution law under point light source and the variance of Gaussian convolution kernel, brightness compensation is performed on Gaussian convolution kernels of three scales respectively to obtain illumination compensation convolution kernels of three scales. Construct a reflection image based on the illumination compensation convolution kernel; Perform global image enhancement on the reflected image to obtain an enhanced image of the subway wheel tread; The energy of the gray-level co-occurrence matrix is: ; The contrast of the gray-level co-occurrence matrix is: ; Where, is the energy of the gray-level co-occurrence matrix, is the contrast of the gray-level co-occurrence matrix, is the gray-level co-occurrence matrix, are the row and column coordinates of the gray-level co-occurrence matrix respectively; The texture compensation parameters are: in, Indicates the scaling sizes corresponding to the three artificial experience values, is the energy value obtained by the gray-level co-occurrence matrix of the image, is the experience energy value, is the contrast of the original image, is the empirical value of contrast, Indicates three different texture compensation parameter numbers; The variance of the Gaussian convolution kernel is: Where, is the variance of different Gaussian convolution kernels, The convolution kernel size representing the artificial experience value, , represents the texture compensation parameter, Identifies the three convolution kernels of different sizes for the MSR algorithm; The illumination compensation convolution kernel is: Where, is the convolution kernel before rotation, is the Gaussian convolution kernel before compensation, is the convolution kernel after final illumination compensation, 、 is the coordinate of the current convolution center in the image, 、 is the image coordinate of the illumination center point of the point light source in the illumination plane, is the Gaussian filter variance, is the direct distance of the light source, 、 They are the coordinate information of the current convolution kernel respectively; The reflected image is: Where, is the reflected image, are the coefficients corresponding to three different Gaussian kernels, is the original image, is the Gaussian convolution kernel, is the Gaussian convolution kernel variance, are the coordinate position information of the image pixel points, For the label.
2. The subway wheel tread image enhancement method according to claim 1, characterized in that: The step of performing global image enhancement on the reflected image to obtain an enhanced image of the subway wheel set tread comprises the following steps: Image segmentation is used to remove interference from the reflected image; After segmentation, the grayscale interval of the remaining ROI area of interest is retained; Stretch the grayscale range and perform gamma correction; Perform histogram equalization on the corrected image to obtain the enhanced image.
3. The method for enhancing the subway wheel tread image according to claim 2, characterized in that: The image segmentation adopts an image segmentation method based on edge extraction, uses the Canny operator's edge extraction method to extract the edges of the wheelset detection image, and uses the image Hough transform to extract the straight lines in the marginalized image. The rail edge is extracted through three points: the straight line slope, the straight line distribution, and the grayscale gradient on both sides of the straight line, and the adaptive region of interest of the image is segmented according to the rail edge.
4. The method for enhancing the subway wheel tread image according to claim 2, wherein: The gamma correction is: Where, is the grayscale value after transformation, is the gray value of the reflected image, is the grayscale value of the region of interest obtained by segmentation.
5. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method executes the steps of the subway wheel tread image enhancement method according to any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the subway wheel set tread image enhancement method described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method of extracting port warehouses via hierarchically screened remote sensing images
CN108108670A
Self-adaptive highlight face image texture recovery method based on deformation Gaussian kernel function
CN109934190A