Fan metal fitting surface defect recognition method based on image processing
By adaptively adjusting the fusion weights of wind turbine metal component images and combining detail enhancement and noise suppression factors, the problems of image detail preservation and noise suppression in traditional methods are solved, achieving a more efficient defect recognition effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI ALI SCENERY TECHNOLOGY CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-26
AI Technical Summary
Traditional methods for identifying surface defects in wind turbine metal parts cannot dynamically adjust based on the local characteristics of the image. This makes it difficult to retain details in highly reflective areas and to extract effective information from shadow areas. Furthermore, they are prone to introducing noise, resulting in a low detection rate for minor defects and a tendency to misdetect noise as defects.
By acquiring initial images at different exposure times, the fusion weights are adaptively adjusted based on the local characteristics of each pixel. The fusion weights are then optimized by combining detail enhancement factors and noise suppression factors, and finally the fused irradiance of each pixel is obtained for surface defect identification.
It improves the accuracy of defect identification and image quality, ensuring that noise is effectively suppressed while enhancing defect details, and improves the detection capability of minute defects.
Smart Images

Figure CN122289178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method for identifying surface defects in wind turbine metal parts based on image processing. Background Technology
[0002] As core equipment for energy conversion and power output, fans are widely used in power, industrial manufacturing, and building ventilation. The mechanical properties and surface quality of their metal components (such as blades, bearing housings, and casings) directly determine the overall operational stability and service life of the fan. During casting, machining, heat treatment, and assembly, fan metal components are prone to surface defects such as scratches, cracks, porosity, and corrosion due to fluctuations in process parameters, equipment wear, or improper operation. These defects not only weaken the fatigue resistance and corrosion resistance of the components but may also cause stress concentration leading to fracture failure, resulting in serious consequences such as equipment downtime, production interruption, and even personal injury. Therefore, identifying surface defects in fan metal components is a crucial quality control step to ensure the safe operation of fans.
[0003] Before defect identification, original images need to be acquired through a high-precision image acquisition system. The imaging quality of the original images (such as resolution, contrast, and illumination uniformity) directly affects the accuracy and robustness of subsequent image processing algorithms and is a fundamental prerequisite for defect feature extraction and classification decisions. Since highly reflective areas and dark cracks and shadow areas often coexist on the surface of wind turbine metal parts, a single exposure cannot capture the details of both. This leads to overexposure in highly reflective areas, resulting in the loss of crack edge information, while shadow areas suffer from severe noise due to underexposure, making defect features difficult to identify. Therefore, traditional methods typically use multi-exposure fusion to generate high dynamic range (HDR) images. This involves acquiring grayscale images with different exposures, converting the grayscale values of pixels in each image into irradiance values, and then obtaining the final irradiance of each pixel based on the irradiance values of each image to form an HDR irradiance map, providing a reliable basis for subsequent defect identification.
[0004] However, when traditional methods obtain the final irradiance of each pixel, the weight of the irradiance value of each pixel in each image is usually evenly distributed or simply set based on brightness and contrast. This makes it impossible for traditional methods to dynamically adjust according to the local characteristics of the image. That is, it is difficult to retain details at highly reflective edges, difficult to extract effective information in shadow areas, and also introduces noise. As a result, when performing complex surface defect detection of wind turbine metal parts, the detection rate of small defects is low, and noise is easily misdetected as defects.
[0005] Therefore, how to adaptively obtain the fusion weights of pixels in each image based on the local characteristics of images with different exposure levels, thereby improving the quality of images used for defect identification and thus improving the accuracy of defect identification, has become an urgent problem to be solved. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a method for identifying surface defects of wind turbine metal parts based on image processing, in order to solve the problem of how to adaptively obtain the fusion weight of pixels in each image according to the local characteristics of images with different exposures, thereby improving the quality of the images used for defect identification and thus improving the accuracy of defect identification.
[0007] This invention provides a method for identifying surface defects in wind turbine metal components based on image processing. The method includes the following steps: The initial image of the wind turbine metal parts is obtained at each exposure time. Each initial image is then converted to grayscale to obtain a grayscale image. The pixels in each grayscale image correspond one-to-one. Any grayscale image is designated as the target image. For any pixel in the target image, a target window of a preset size is established with the pixel as the center. Based on the difference in grayscale distribution between the target window and the pixels in the target image, the initial fusion weight of the pixel is obtained. Based on the local detail features and local noise interference level of any pixel, the detail enhancement factor and noise suppression factor of any pixel are obtained. Using the detail enhancement factor and noise suppression factor of any pixel, the initial fusion weight of any pixel is adjusted to obtain the final fusion weight of any pixel. Obtain the final fusion weight of each pixel in each grayscale image, obtain the irradiance of each pixel in each grayscale image, and obtain the fused irradiance of each pixel in the target image based on the irradiance of each pixel in each grayscale image and the final fusion weight. By utilizing the fused irradiance of each pixel in the target image, the final image of the wind turbine metal parts is obtained, which is used to identify surface defects in the wind turbine metal parts.
[0008] Preferably, obtaining the initial fusion weight of any pixel based on the difference in grayscale distribution between the target window and the target image includes: The maximum and minimum gray values of pixels in the target image are obtained. The difference between the maximum gray value and the gray value of any pixel is calculated and recorded as the first difference. The difference between the gray value of any pixel and the minimum gray value is calculated and recorded as the second difference. The ratio of the minimum value between the first difference and the second difference to the maximum gray value is obtained to obtain the exposure suitability. Obtain the standard deviation of the gray values of the pixels in the target window, and denot it as the local gray standard deviation of any pixel. Obtain the local gray standard deviation of each pixel in the target image. Calculate the ratio of the local gray standard deviation of any pixel to the maximum value of the local gray standard deviation of each pixel in the target image to obtain the local contrast. The product between the exposure suitability and the local contrast is normalized to obtain the initial fusion weight of any pixel.
[0009] Preferably, obtaining the detail enhancement factor and noise suppression factor of any pixel based on its local detail features and local noise interference level includes: Obtain the gradient direction of each pixel in the target window, and construct the directional gradient histogram of the target window. The horizontal axis of the directional gradient histogram is the direction interval, and the vertical axis is the weighted sum of the gradient magnitudes of all pixels corresponding to the direction interval. Based on the grayscale distribution characteristics of the pixels in the target window and the gradient distribution characteristics in the directional gradient histogram, the detail enhancement factor of any pixel is obtained. The noise suppression factor of any pixel is obtained based on the degree of local noise interference.
[0010] Preferably, obtaining the detail enhancement factor of any pixel based on the grayscale distribution features of the pixels in the target window and the gradient distribution features in the histogram of oriented gradients includes: The grayscale entropy of the pixels in the target window is obtained and denoted as the first local detail feature value; The distance between any pixel and the pixel corresponding to the maximum gray value is obtained and denoted as the first distance. The distance between any pixel and the pixel corresponding to the minimum gray value is obtained and denoted as the second distance. The minimum value between the first distance and the second distance is obtained and denoted as the second local detail feature value. The number of pixels corresponding to the main peak of the directional gradient histogram is obtained and denoted as the first number. The ratio of the first number to the number of pixels in the target window is normalized to obtain the gradient direction consistency. The Laplacian response value of each pixel within the target window is obtained. The absolute values of the Laplacian response values of each pixel within the target window are accumulated to obtain the sum of absolute values of the Laplacian responses. The sum of absolute values of the Laplacian responses is normalized to obtain the normalized sum of absolute values of the Laplacian responses. The gradient direction consistency is added to the sum of the normalized sum of absolute values of the Laplacian responses to obtain the third local detail feature value. The product of the first local detail feature value, the second local detail feature value, and the third local detail feature value is normalized to obtain the detail enhancement factor of any pixel.
[0011] Preferably, obtaining the noise suppression factor of any pixel based on the local noise interference level of any pixel includes: Obtain the average grayscale value of the pixels in the target window, calculate the product of the reciprocal of the exposure time of the target image and the reciprocal of the average grayscale value, and obtain the first noise impact level; The grayscale images other than the target image are denoted as the comparison images of the target image. In each comparison image, the pixel corresponding to any pixel is obtained and denoted as the comparison pixel. A target window for each comparison pixel is constructed and denoted as the comparison window. The gradient covariance between the target window and each comparison window is obtained, and the mean gradient covariance is obtained. The reciprocal of the mean gradient covariance is normalized to obtain the second noise influence level. Edge detection is performed on the target image to obtain edge pixels in the target image. The ratio of the number of edge pixels to the number of pixels in the target window is obtained to obtain the proportion of edge pixels. The difference between constant 1 and the proportion of edge pixels is obtained to obtain the proportion of non-edge pixels. The minimum value between the proportion of edge pixels and the proportion of non-edge pixels is obtained and recorded as the minimum proportion. The difference between constant 1 and the minimum proportion is normalized to obtain the third noise influence level. The sum of the second noise impact level and the third noise impact level is obtained, and the product of the first noise impact level and the sum is normalized to obtain the noise suppression factor of any pixel.
[0012] Preferably, the step of adjusting the initial fusion weight of any pixel using the detail enhancement factor and noise suppression factor of any pixel to obtain the final fusion weight of any pixel includes: The sum of constant 1 and the detail enhancement factor of any pixel is obtained to obtain the first adjustment factor. The product of the initial fusion weight of any pixel and the first adjustment factor is obtained to obtain the first fusion weight. The difference between constant 1 and the noise suppression factor of any pixel is obtained to obtain the second adjustment factor. The product between the initial fusion weight of any pixel and the second adjustment factor is obtained to obtain the second fusion weight. The sum of the first fusion weight and the second fusion weight is obtained to obtain the final fusion weight of any pixel.
[0013] Preferably, obtaining the fused irradiance corresponding to each pixel in the target image based on the irradiance of each pixel in each grayscale image and the final fusion weight includes: For any pixel in the target image, the cumulative value of the final fusion weight of the pixel and each of its comparison pixels is obtained to obtain the final fusion weight cumulative value. The ratio of the final fusion weight of the pixel to the final fusion weight cumulative value is obtained as the weight coefficient of the irradiance of the pixel. Obtain the weight coefficient of the irradiance of each comparison pixel for any given pixel, and perform a weighted summation of the irradiance of the given pixel and each comparison pixel to obtain the fused irradiance corresponding to the given pixel.
[0014] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: In this invention, an initial fusion weight is obtained for each pixel to initially measure the contribution of the image to the information of that pixel. The larger the weight, the more reliable the image's record of the information of that pixel, providing a reasonable basis for subsequent fusion. A detail enhancement factor for each pixel is obtained to highlight defect details, making the defect information more clearly presented in the subsequent fusion result and improving defect detectability. A noise suppression factor for each pixel is obtained to identify noise regions and prevent noise regions from being misjudged as defect regions. The detail enhancement factor and the noise suppression factor are complementary, thereby obtaining the final fusion weight for each pixel. The fusion weight is initially optimized from different aspects to ensure that noise is effectively suppressed while enhancing defect details, improving the quality of the subsequent fused image. Finally, the fusion irradiance corresponding to each pixel in the target image is obtained to obtain the final image of the wind turbine metal parts, providing a reliable basis for surface defect identification of the wind turbine metal parts. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of a method for identifying surface defects in wind turbine metal parts based on image processing, provided in Embodiment 1 of the present invention. Detailed Implementation
[0017] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0018] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0019] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0020] See Figure 1 This is a flowchart of a method for identifying surface defects in wind turbine metal parts based on image processing, as provided in Embodiment 1 of the present invention. Figure 1 As shown, the method may include: Step S101: Obtain the initial image of the wind turbine metal parts at each exposure time, and perform grayscale processing on each initial image to obtain a grayscale image, with each pixel in the grayscale image corresponding to the others.
[0021] In the process of identifying surface defects in wind turbine metal parts, traditional methods typically employ multi-exposure fusion to generate high dynamic range (HDR) images. This involves acquiring grayscale images with different exposures, converting the grayscale values of each pixel in the image into irradiance values, and then obtaining the final irradiance of each pixel based on the irradiance values of each image to form an HDR irradiance map, providing a reliable basis for subsequent defect identification.
[0022] However, when traditional methods obtain the final irradiance of each pixel, the weight of the irradiance value of each pixel in each image is usually evenly distributed or simply set based on brightness and contrast. This makes it impossible for traditional methods to dynamically adjust according to the local characteristics of the image. That is, it is difficult to retain details at highly reflective edges, difficult to extract effective information in shadow areas, and also introduces noise. As a result, when performing complex surface defect detection of wind turbine metal parts, the detection rate of small defects is low, and noise is easily misdetected as defects.
[0023] Therefore, after obtaining images at different exposure times, this embodiment of the invention obtains the initial fusion weights of the pixels in the image, initially measures the contribution of the image to the information of the pixel, and then obtains the detail enhancement factor and noise suppression factor of the pixel. The fusion weights are initially optimized from different aspects to ensure that noise is effectively suppressed while enhancing the details of defects. Finally, the fusion irradiance corresponding to each pixel in the image is obtained to obtain the final image of the wind turbine metal parts, providing a reliable basis for the surface defect identification of wind turbine metal parts.
[0024] First, using a professional industrial camera with adjustable exposure parameters, multiple images are captured sequentially at different exposure times (such as short, medium, and long exposure combinations) on the surface of the fan metal parts from the same shooting position and angle. This ensures coverage of the complete dynamic range from dark to bright areas, obtaining the initial image of the fan metal parts at each exposure time. In this embodiment, a production line scenario is used as an example: short exposure times are typically 1 / 1000 to 1 / 4000 second, medium exposure times are typically 1 / 250 to 1 / 500 second, and long exposure times are typically 1 / 60 to 1 / 125 second. These are not strictly limited and can be set according to the specific implementation scenario. Short exposures are used to capture details in highlight areas and avoid overexposure; long exposures are used to obtain information in shadow areas and prevent underexposure; medium exposures serve as an intermediate transition to balance overall brightness. During shooting, the camera must be kept stable to avoid motion blur, and consistent lighting conditions must be ensured to reduce external interference. After acquisition, each initial image is converted to grayscale to obtain a grayscale image. Each grayscale image has a one-to-one correspondence of pixels. A rectangular coordinate system is established with the lower left corner of each grayscale image as the origin, the horizontal axis as the horizontal axis, and the vertical axis as the vertical axis. Pixels with the same coordinates (same position) in each grayscale image correspond one-to-one. Grayscale conversion is an existing technology and will not be described in detail here.
[0025] At this point, grayscale images of the wind turbine metal components at each exposure time are obtained.
[0026] Step S102: Denote any grayscale image as the target image. For any pixel in the target image, establish a target window of a preset size centered on the target image. Based on the difference in grayscale distribution between the target window and the pixels in the target image, obtain the initial fusion weight of the target pixel.
[0027] In multi-exposure image fusion, images with different exposure times present the same scene differently. Short-exposure images can capture details in highlight areas, but lose significant information in shadow areas; long-exposure images can clearly present shadow areas, but highlight areas are prone to overexposure. That is, the appropriate exposure of the same pixel in images with different exposure times varies, and there are differences in whether each image can accurately reflect the information of the real scene.
[0028] Therefore, any grayscale image is designated as the target image. For any pixel in the target image, a target window of a preset size is established centered on that pixel. If the preset size is insufficient to establish a target window centered on that pixel, the target image boundary is expanded using methods such as mirror filling or repeated boundary value filling to establish the target window. Mirror filling and repeated boundary value filling are existing technologies and will not be elaborated here. In this embodiment, the preset size is set to 5×5, meaning the target window contains 25 pixels. This is not a limitation and can be set according to the specific implementation scenario. Based on the difference in grayscale distribution between the target window and the pixels in the target image, the initial fusion weight of that pixel is obtained to initially measure the contribution of the target image to the information of that pixel, providing a reasonable basis for subsequent fusion.
[0029] The method for obtaining the initial fusion weight of any pixel based on the difference in grayscale distribution between the target window and the target image is as follows: The maximum and minimum gray values of pixels in the target image are obtained. The difference between the maximum gray value and the gray value of any pixel is calculated and recorded as the first difference. The difference between the gray value of any pixel and the minimum gray value is calculated and recorded as the second difference. The ratio of the minimum value between the first difference and the second difference to the maximum gray value is obtained to obtain the exposure suitability. Obtain the standard deviation of the gray values of the pixels in the target window, and denot it as the local gray standard deviation of any pixel. Similarly, obtain the local gray standard deviation of each pixel in the target image, and calculate the ratio of the local gray standard deviation of any pixel to the maximum value of the local gray standard deviation of each pixel in the target image to obtain the local contrast. The product between the exposure suitability and the local contrast is normalized to obtain the initial fusion weight of any pixel.
[0030] In one embodiment, the a-th grayscale image is denoted as the target image. Taking the i-th pixel in the target image as an example, the initial fusion weight of the i-th pixel is calculated using the following formula: in, Let be the initial fusion weight for the i-th pixel in the target image; The maximum grayscale value of a pixel in the target image; Let be the gray value of the i-th pixel in the target image; The minimum grayscale value of a pixel in the target image; It represents the local grayscale standard deviation of the i-th pixel in the target image, which is also the standard deviation of the grayscale values of the pixels in the target window (the target window of the i-th pixel in the target image). This represents the maximum value of the local grayscale standard deviation for each pixel in the target image. It is a minimum value function; This is the normalization function.
[0031] It should be noted that, For appropriate exposure, This indicates that normalization is performed using the maximum grayscale value in the target image. This represents the distance of the i-th pixel from the maximum or minimum grayscale value in the target image. The greater the distance, the more likely the i-th pixel is in the middle range, neither overexposed (close to white saturation) nor underexposed (close to black distortion), thus retaining more detail and tonal range. The more suitable the exposure time of the target image is for the i-th pixel, the more reliable the target image's recording of information about the i-th pixel, meaning the greater the contribution of the target image to the information of the i-th pixel. The larger the size, the more weight is needed to preserve its local details, and thus... The larger it is; For local contrast, This indicates that normalization is performed using the maximum standard deviation in the target image. The larger the value, the more structural information the i-th pixel contains locally, and the higher the weight needed to preserve its local details. The larger it is.
[0032] Thus, the initial fusion weight of any pixel in the target image is obtained.
[0033] Step S103: Based on the local detail features and local noise interference level of any pixel, obtain the detail enhancement factor and noise suppression factor of any pixel, and adjust the initial fusion weight of any pixel using the detail enhancement factor and noise suppression factor of any pixel to obtain the final fusion weight of any pixel.
[0034] In the scenario of surface defect recognition of wind turbine metal parts, relying solely on the initial weight fusion of pixels is insufficient to meet the requirements of high-quality defect detection. The specific reasons are as follows: On the one hand, real defects such as cracks on the surface of wind turbine metal parts have specific structural characteristics, such as continuity and directionality; on the other hand, there may be noise interference in grayscale images, especially in the dark areas of shadow prefetching or short exposure images, where noise interference is more obvious.
[0035] Therefore, in this embodiment, based on the local detail features and local noise interference level of any pixel, the detail enhancement factor and noise suppression factor of any pixel are obtained. Then, the initial fusion weight of any pixel is adjusted using the detail enhancement factor and noise suppression factor of any pixel to obtain the final fusion weight of any pixel. This effectively suppresses noise while enhancing defect details, thereby improving the quality of the subsequent fused image.
[0036] The method for obtaining the detail enhancement factor and noise suppression factor of any pixel based on its local detail features and local noise interference level is as follows: (1) Obtain the detail enhancement factor of any pixel.
[0037] Specifically, the grayscale entropy of the pixels in the target window is obtained and recorded as the first local detail feature value; Obtain the Euclidean distance between any pixel and the pixel corresponding to the maximum gray value, denoted as the first distance; obtain the Euclidean distance between any pixel and the pixel corresponding to the minimum gray value, denoted as the second distance; obtain the minimum value between the first distance and the second distance, denoted as the second local detail feature value. The gradient direction of each pixel in the target window is obtained, the gradient direction is quantized into 36 direction intervals, and the orientation gradient histogram of the target window is constructed. The horizontal axis of the orientation gradient histogram is the direction interval, and the vertical axis is the weighted sum of the gradient magnitudes of all pixels corresponding to the direction interval. The number of pixels corresponding to the main peak of the directional gradient histogram is obtained and denoted as the first number. The ratio of the first number to the number of pixels in the target window is normalized using the norm() function to obtain the gradient direction consistency. Taking the i-th pixel in the target image as an example, the gradient direction consistency is denoted as D. ,in, This is the first quantity, which is the number of pixels corresponding to the main peak of the directional gradient histogram. This represents the number of pixels in the target window. This is the normalization function; The Laplacian response value of each pixel within the target window is obtained. The Laplacian response value is a prior art technique and will not be elaborated upon here. The absolute values of the Laplacian response values of each pixel within the target window are summed to obtain the sum of absolute Laplacian responses. The normalized sum of absolute Laplacian responses is then obtained using the `norm()` function. Taking the i-th pixel in the target image as an example, let the normalized sum of absolute Laplacian responses be denoted as L. ,in, Let be the Laplacian response value of the j-th pixel within the target window, and n be the number of pixels within the target window. The normalization function is used to obtain the sum of the gradient direction consistency and the absolute value of the normalized Laplacian response, thus obtaining the third local detail feature value. The product of the first local detail feature value, the second local detail feature value, and the third local detail feature value is normalized to obtain the detail enhancement factor of any pixel.
[0038] In one embodiment, the a-th grayscale image is denoted as the target image. Taking the i-th pixel in the target image as an example, the formula for calculating the detail enhancement factor of the i-th pixel is: in, Let be the detail enhancement factor for the i-th pixel in the target image; This is the first local detail feature value, which is also the grayscale entropy of the pixels in the target window; and Let x and y be the x and y coordinates of the i-th pixel in the target image, respectively; and , where are the x and y coordinates of the pixel corresponding to the maximum or minimum gray value in the target image, respectively; D is the gradient direction consistency; L is the sum of the absolute values of the normalized Laplacian response; This is the normalization function.
[0039] It should be noted that, This represents the first local detail feature value, which is also the grayscale entropy of the pixels in the target window. The larger the value, the more complex the grayscale distribution of the pixels in the target window, and the more it matches the drastic grayscale changes characteristic of the crack region. The i-th pixel in the target image may contain more local details. The larger it is; This is the second local detail feature value, which is the Euclidean distance between the i-th pixel in the target image and the pixel corresponding to the minimum or maximum gray value. The larger the value, the more reliable the local details of the i-th pixel in the target image. The larger it is; Here, D represents the third local detail feature value, and D is the gradient direction consistency. The larger D is, the more pixels with the main peak are represented within the target window, and the more consistent the gradient directions of the pixels within the target window are, which better matches the linear extension characteristics of a real crack. The larger it is, the more... The larger L is, the stronger the edge response within the target window; L is the sum of the absolute values of the normalized Laplacian response. The Laplacian operator can capture edge details. The larger L is, the stronger the edge response within the target window, meaning there is a greater probability of edge or detail textures existing within the target window. The larger it is, the more... The larger it is.
[0040] (2) Obtain the noise suppression factor of any pixel.
[0041] Specifically, the average grayscale value of the pixels in the target window is obtained, and the product of the reciprocal of the exposure time of the target image and the reciprocal of the average grayscale value is calculated to obtain the first noise impact level; Grayscale images other than the target image are designated as comparison images of the target image. In each comparison image, the pixel corresponding to any given pixel (i.e., the pixel with the same coordinates as the given pixel) is obtained and designated as the comparison pixel. A target window is constructed for each comparison pixel and designated as the comparison window. The gradient covariance between the target window and each comparison window is obtained, and the mean gradient covariance is calculated. The reciprocal of the mean gradient covariance is normalized using the `norm()` function to obtain the second noise influence level. Taking the i-th pixel in the target image as an example, the second noise influence level is denoted as E. ,in, Let be the gradient covariance between the i-th pixel of the target image and its k-th contrasting pixel in the target window, or the gradient covariance between the target window and its k-th contrasting window. Let m be the number of contrasting pixels, or the number of contrasting windows. As a normalization function, since the true texture structure should maintain consistent shape under different exposures, while noise or artifacts lack cross-exposure consistency, that is, the lower the local similarity of pixels at the same location in multi-exposure images, the greater the possibility of local noise. The smaller the value, the lower the similarity between the i-th pixel and other exposed images in the same local area, the greater the possibility of noise in the target window, and the larger E is. Edge detection of the target image is performed using the Canny algorithm. The Canny algorithm is existing technology and will not be elaborated upon here. Edge pixels in the target image are obtained. The ratio of the number of edge pixels to the total number of pixels in the target window is calculated to obtain the edge pixel percentage. The difference between a constant 1 and the edge pixel percentage is calculated to obtain the non-edge pixel percentage. The minimum value between the edge pixel percentage and the non-edge pixel percentage is obtained and denoted as the minimum percentage. The difference between the constant 1 and the minimum percentage is normalized using the normal() function to obtain the third noise influence level. Taking the i-th pixel in the target image as an example, the third noise influence level is denoted as G. , This represents the number of edge pixels in the target window. The number of pixels in the target window. It is a minimum value function. As a normalization function, since real cracks are generally continuous edges with moderate edge density, while noise pixels are generally isolated and do not form edges or form pseudo-edges, resulting in excessively dense edges, therefore... The smaller the value, the denser or sparser the local edge density of the i-th pixel, and the greater the possibility of isolated noise points or dense pseudo edges in its local area, and the larger G is. The sum of the second noise impact level and the third noise impact level is obtained, and the product of the first noise impact level and the sum is normalized to obtain the noise suppression factor of any pixel.
[0042] In one embodiment, the a-th grayscale image is denoted as the target image. Taking the i-th pixel in the target image as an example, the formula for calculating the noise suppression factor of the i-th pixel is: in, Let be the noise suppression factor for the i-th pixel in the target image; The exposure time of the target image; E represents the average grayscale value of the pixels in the target window; G represents the second level of noise influence; and G represents the third level of noise influence. This is the normalization function.
[0043] It should be noted that, The first level of noise impact, The smaller the value, the more severe the noise in the dark areas of the target image. The smaller the value, the darker the local area of the i-th pixel, and the greater the possibility of noise. The larger the value, the greater the noise suppression factor is required. The larger the value of E, the greater the likelihood of noise in the target window, and the more noise suppression factor is needed. E represents the second level of noise influence; the larger E is, the greater the possibility of noise in the target window, and the more noise suppression factor is required. The larger the value of G, the greater the noise suppression factor required. G represents the third level of noise influence; the larger G is, the denser or sparser the local edge density of the i-th pixel, indicating a higher probability of isolated noise points or dense pseudo-edges, thus requiring a larger noise suppression factor. The larger it is.
[0044] Furthermore, the initial fusion weight of any pixel is adjusted using the detail enhancement factor and noise suppression factor of that pixel to obtain the final fusion weight of that pixel, as follows: The sum of constant 1 and the detail enhancement factor of any pixel is obtained to obtain the first adjustment factor. The product of the initial fusion weight of any pixel and the first adjustment factor is obtained to obtain the first fusion weight. The difference between constant 1 and the noise suppression factor of any pixel is obtained to obtain the second adjustment factor. The product between the initial fusion weight of any pixel and the second adjustment factor is obtained to obtain the second fusion weight. The sum of the first fusion weight and the second fusion weight is obtained to obtain the final fusion weight of any pixel.
[0045] In one embodiment, the a-th grayscale image is denoted as the target image. Taking the i-th pixel in the target image as an example, the formula for calculating the final fusion weight of the i-th pixel is: in, The final fusion weight for the i-th pixel in the target image; Let be the initial fusion weight for the i-th pixel in the target image; Let be the detail enhancement factor for the i-th pixel in the target image; is the noise suppression factor for the i-th pixel in the target image.
[0046] It should be noted that, The larger the value, the more accurately the i-th pixel in the target image reflects the image's detailed features. Therefore, it's necessary to increase the final fusion weight of the i-th pixel to make the fusion result more clearly present defect information and improve defect detectability. The larger it is; The larger the value, the greater the likelihood that the i-th pixel in the target image is affected by noise. To reduce the possibility of noise interference being misidentified as a defect in the subsequent defect identification process, it is necessary to reduce the final fusion weight of the i-th pixel. The smaller it is.
[0047] The detail enhancement adjustment factor and the noise suppression adjustment factor adjust the initial fusion weight from the perspectives of enhancing defect details and suppressing noise, respectively. The initial fusion weight is fused with these two adjustment factors to obtain the final fusion weight. Taking into account factors such as exposure suitability, detail information and noise level, the final fusion weight more accurately reflects the contribution of each exposed image to the target pixel.
[0048] Thus, the final fusion weight of any pixel in the target image is obtained.
[0049] Step S104: Obtain the final fusion weight of each pixel in each grayscale image, obtain the irradiance of each pixel in each grayscale image, and obtain the fused irradiance corresponding to each pixel in the target image based on the irradiance of each pixel in each grayscale image and the final fusion weight.
[0050] According to the method for obtaining the final fusion weight of any pixel in the target image, the final fusion weight of each pixel in each grayscale image is obtained, and then the irradiance of each pixel in each grayscale image is obtained. The method for obtaining the irradiance is existing technology and will not be described in detail here. Based on the irradiance of each pixel in each grayscale image and the final fusion weight, the fused irradiance corresponding to each pixel in the target image is obtained, which is used to obtain the final image of the wind turbine metal parts and provide a reliable basis for surface defect identification of the wind turbine metal parts.
[0051] The method for obtaining the fused irradiance corresponding to each pixel in the target image based on the irradiance of each pixel in each grayscale image and the final fusion weight is as follows: For any pixel in the target image, the cumulative value of the final fusion weight of the pixel and each of its comparison pixels is obtained to obtain the final fusion weight cumulative value (i.e., the cumulative value of the final fusion weight of pixels in the same position in all grayscale images, including the final fusion weight of the pixel). The ratio of the final fusion weight of the pixel to the final fusion weight cumulative value is obtained as the weight coefficient of the irradiance of the pixel. Obtain the weight coefficient of the irradiance of each comparison pixel for any given pixel, and perform a weighted summation of the irradiance of the given pixel and each comparison pixel (i.e., perform a weighted summation of the irradiance of pixels in the same position in all grayscale images, including the irradiance of the given pixel) to obtain the fused irradiance corresponding to the given pixel.
[0052] In one embodiment, the a-th grayscale image is denoted as the target image. Taking the i-th pixel in the target image as an example, the formula for calculating the fused irradiance corresponding to the i-th pixel is: in, Let be the fused irradiance corresponding to the i-th pixel in the target image; Let be the irradiance of the i-th pixel in the target image; The final fusion weight for the i-th pixel in the target image; This represents the final accumulated weight value for fusion; m is the number of comparison pixels, and m+1 is the number of grayscale images.
[0053] It should be noted that, The larger the value, the more information the i-th pixel in the target image can reflect, the greater the proportion of the irradiance of the i-th pixel in the fused irradiance, and the higher the quality of the final fused image. The final weights used to make the sum of the irradiance of each pixel in the grayscale image equal to 1.
[0054] Thus, the fused irradiance corresponding to any pixel in the target image is obtained.
[0055] Step S105: Using the fused irradiance of each pixel in the target image, the final image of the wind turbine metal parts is obtained, which is used to identify surface defects in the wind turbine metal parts.
[0056] According to the method for obtaining the fused irradiance corresponding to any pixel in the target image, the fused irradiance of each pixel in the target image is obtained to form an HDR irradiance map. The HDR irradiance map is compressed to an 8-bit range using adaptive tone mapping (such as logarithmic mapping based on the local brightness mean) to obtain the final image of the wind turbine metal parts. The final image of the wind turbine metal parts is used as the input of a machine learning model for the automatic identification of surface defects of the wind turbine metal parts. The use of machine learning to identify surface defects of wind turbine metal parts is an existing technology and will not be elaborated here.
[0057] In summary, in this embodiment of the invention, the initial fusion weight of each pixel is obtained to initially measure the contribution of the image to the information of that pixel. The larger the weight, the more reliable the image's record of the information of that pixel, providing a reasonable basis for subsequent fusion. The detail enhancement factor of each pixel is obtained to highlight defect details, making the subsequent fusion result present defect information more clearly and improving defect detectability. The noise suppression factor of each pixel is obtained to identify noise regions and prevent noise regions from being misjudged as defect regions. The detail enhancement factor and the noise suppression factor are complementary, thus obtaining the final fusion weight of the pixel. The fusion weight is initially optimized from different aspects to ensure that noise is effectively suppressed while enhancing defect details, improving the quality of the subsequent fused image. Finally, the fusion irradiance corresponding to each pixel in the target image is obtained to obtain the final image of the wind turbine metal parts, providing a reliable basis for surface defect identification of the wind turbine metal parts.
[0058] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for identifying surface defects in wind turbine metal components based on image processing, characterized in that, The image processing-based method for identifying surface defects in wind turbine metal components includes: The initial image of the wind turbine metal parts is obtained at each exposure time. Each initial image is then converted to grayscale to obtain a grayscale image. The pixels in each grayscale image correspond one-to-one. Any grayscale image is designated as the target image. For any pixel in the target image, a target window of a preset size is established with the pixel as the center. Based on the difference in grayscale distribution between the target window and the pixels in the target image, the initial fusion weight of the pixel is obtained. Based on the local detail features and local noise interference level of any pixel, the detail enhancement factor and noise suppression factor of any pixel are obtained. Using the detail enhancement factor and noise suppression factor of any pixel, the initial fusion weight of any pixel is adjusted to obtain the final fusion weight of any pixel. Obtain the final fusion weight of each pixel in each grayscale image, obtain the irradiance of each pixel in each grayscale image, and obtain the fused irradiance of each pixel in the target image based on the irradiance of each pixel in each grayscale image and the final fusion weight. By utilizing the fused irradiance of each pixel in the target image, the final image of the wind turbine metal parts is obtained, which is used to identify surface defects in the wind turbine metal parts.
2. The method for identifying surface defects in wind turbine metal components based on image processing according to claim 1, characterized in that, The step of obtaining the initial fusion weight of any pixel based on the difference in grayscale distribution between the target window and the target image includes: The maximum and minimum gray values of pixels in the target image are obtained. The difference between the maximum gray value and the gray value of any pixel is calculated and recorded as the first difference. The difference between the gray value of any pixel and the minimum gray value is calculated and recorded as the second difference. The ratio of the minimum value between the first difference and the second difference to the maximum gray value is obtained to obtain the exposure suitability. Obtain the standard deviation of the gray values of the pixels in the target window, and denot it as the local gray standard deviation of any pixel. Obtain the local gray standard deviation of each pixel in the target image. Calculate the ratio of the local gray standard deviation of any pixel to the maximum value of the local gray standard deviation of each pixel in the target image to obtain the local contrast. The product between the exposure suitability and the local contrast is normalized to obtain the initial fusion weight of any pixel.
3. The method for identifying surface defects in wind turbine metal components based on image processing according to claim 2, characterized in that, The step of obtaining the detail enhancement factor and noise suppression factor of any pixel based on the local detail features and local noise interference level of any pixel includes: Obtain the gradient direction of each pixel in the target window, and construct the directional gradient histogram of the target window. The horizontal axis of the directional gradient histogram is the direction interval, and the vertical axis is the weighted sum of the gradient magnitudes of all pixels corresponding to the direction interval. Based on the grayscale distribution characteristics of the pixels in the target window and the gradient distribution characteristics in the directional gradient histogram, the detail enhancement factor of any pixel is obtained. The noise suppression factor of any pixel is obtained based on the degree of local noise interference.
4. The method for identifying surface defects in wind turbine metal components based on image processing according to claim 3, characterized in that, The step of obtaining the detail enhancement factor for any pixel based on the grayscale distribution features of the pixels in the target window and the gradient distribution features in the directional gradient histogram includes: The grayscale entropy of the pixels in the target window is obtained and denoted as the first local detail feature value; The distance between any pixel and the pixel corresponding to the maximum gray value is obtained and denoted as the first distance. The distance between any pixel and the pixel corresponding to the minimum gray value is obtained and denoted as the second distance. The minimum value between the first distance and the second distance is obtained and denoted as the second local detail feature value. The number of pixels corresponding to the main peak of the directional gradient histogram is obtained and denoted as the first number. The ratio of the first number to the number of pixels in the target window is normalized to obtain the gradient direction consistency. The Laplacian response value of each pixel within the target window is obtained. The absolute values of the Laplacian response values of each pixel within the target window are accumulated to obtain the sum of absolute values of the Laplacian responses. The sum of absolute values of the Laplacian responses is normalized to obtain the normalized sum of absolute values of the Laplacian responses. The gradient direction consistency is added to the sum of the normalized sum of absolute values of the Laplacian responses to obtain the third local detail feature value. The product of the first local detail feature value, the second local detail feature value, and the third local detail feature value is normalized to obtain the detail enhancement factor of any pixel.
5. The method for identifying surface defects in wind turbine metal components based on image processing according to claim 3, characterized in that, The step of obtaining the noise suppression factor of any pixel based on the local noise interference level of any pixel includes: Obtain the average grayscale value of the pixels in the target window, calculate the product of the reciprocal of the exposure time of the target image and the reciprocal of the average grayscale value, and obtain the first noise impact level; The grayscale images other than the target image are denoted as the comparison images of the target image. In each comparison image, the pixel corresponding to any pixel is obtained and denoted as the comparison pixel. A target window for each comparison pixel is constructed and denoted as the comparison window. The gradient covariance between the target window and each comparison window is obtained, and the mean gradient covariance is obtained. The reciprocal of the mean gradient covariance is normalized to obtain the second noise influence level. Edge detection is performed on the target image to obtain edge pixels in the target image. The ratio of the number of edge pixels to the number of pixels in the target window is obtained to obtain the proportion of edge pixels. The difference between constant 1 and the proportion of edge pixels is obtained to obtain the proportion of non-edge pixels. The minimum value between the proportion of edge pixels and the proportion of non-edge pixels is obtained and recorded as the minimum proportion. The difference between constant 1 and the minimum proportion is normalized to obtain the third noise influence level. The sum of the second noise impact level and the third noise impact level is obtained, and the product of the first noise impact level and the sum is normalized to obtain the noise suppression factor of any pixel.
6. The method for identifying surface defects in wind turbine metal components based on image processing according to claim 1, characterized in that, The step of adjusting the initial fusion weight of any pixel using the detail enhancement factor and noise suppression factor to obtain the final fusion weight of any pixel includes: The sum of constant 1 and the detail enhancement factor of any pixel is obtained to obtain the first adjustment factor. The product of the initial fusion weight of any pixel and the first adjustment factor is obtained to obtain the first fusion weight. The difference between constant 1 and the noise suppression factor of any pixel is obtained to obtain the second adjustment factor. The product between the initial fusion weight of any pixel and the second adjustment factor is obtained to obtain the second fusion weight. The sum of the first fusion weight and the second fusion weight is obtained to obtain the final fusion weight of any pixel.
7. The method for identifying surface defects in wind turbine metal components based on image processing according to claim 5, characterized in that, The step of obtaining the fused irradiance corresponding to each pixel in the target image based on the irradiance of each pixel in each grayscale image and the final fusion weight includes: For any pixel in the target image, the cumulative value of the final fusion weight of the pixel and each of its comparison pixels is obtained to obtain the final fusion weight cumulative value. The ratio of the final fusion weight of the pixel to the final fusion weight cumulative value is obtained as the weight coefficient of the irradiance of the pixel. Obtain the weight coefficient of the irradiance of each comparison pixel for any given pixel, and perform a weighted summation of the irradiance of the given pixel and each comparison pixel to obtain the fused irradiance corresponding to the given pixel.