Visible light image surface defect deep learning classification method
By processing the red, green, and blue channel information of wind turbine blade images, fusing brightness, and adjusting color direction, the problem of unstable image surface defect classification in existing technologies is solved, achieving more accurate defect identification and classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINYI HEGOU ZHONGXIN WIND POWER CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-12
AI Technical Summary
Existing deep learning classification methods for surface defects in visible light images cannot effectively identify regions of subtle structural abrupt changes, resulting in fracture locations being judged as background, feature loss, coarse handling of boundary brightness changes, inaccurate classification of blurred boundary regions, lack of color information alignment mechanisms, susceptibility to local color differences, and unstable classification.
By acquiring red, green, and blue channel information from wind turbine blade images, fusing brightness and processing the directional relationship between pixels, extracting regions of abrupt directional changes, connecting directional trajectories, adjusting color direction to ensure consistent color relationships in regions, extracting edge brightness changes, and outputting surface defect classification results for visible light images.
It enhances the identification of structurally changing regions in images, maintains the coherence of image content, reduces color difference interference between channels, provides a stable basis for classification and discrimination, and improves the accuracy and continuity of defect identification.
Smart Images

Figure CN122023905A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and more particularly to a deep learning classification method for surface defects in visible light images. Background Technology
[0002] Image recognition technology involves the automatic detection and classification of targets or features in images using methods such as computer vision and deep learning. Core aspects include image acquisition, preprocessing, feature extraction, and classification. It is widely used in industrial inspection, medical analysis, and security monitoring. The focus is on improving the accuracy and automation of recognition, often achieved by constructing deep neural network models to effectively process complex image information.
[0003] Traditional deep learning classification methods for surface defects in visible light images involve acquiring images of workpiece surfaces under visible light conditions and classifying surface defects in the images using models such as convolutional neural networks. These methods typically use labeled defect images as training samples, extract features through multi-layer convolution and pooling operations, output defect categories using fully connected layers, and optimize model parameters using supervised learning. They are widely used for identifying defects such as scratches and cracks on the surfaces of materials like metals and ceramics.
[0004] Existing methods lack modeling of inter-pixel directional relationships, failing to identify regions of subtle structural abrupt changes, leading to the easy omission of structural defects. Fracture locations in images are often mistaken for background, resulting in feature loss. Boundary brightness variations are handled coarsely, easily causing inaccurate classification of areas with blurred boundaries. Color information lacks alignment mechanisms between channels, making it susceptible to local color differences and leading to recognition errors. In images with diverse defect types and complex structures, classification performance is unstable, making it difficult to identify defects with clear boundaries and continuous structures. Summary of the Invention
[0005] To address the technical problems existing in the prior art, embodiments of the present invention provide a deep learning classification method for surface defects in visible light images. The technical solution is as follows: A deep learning-based method for classifying surface defects in visible light images includes the following steps: S1: Collect red, green and blue channel information from wind turbine blade images, perform brightness fusion on the channel content, process the brightness direction between each pixel and its adjacent pixels in the image, extract the location points in the direction change region, retain the distribution of these pixels in the image, and obtain the direction change breakpoint location map. S2: Using the image region extracted from the direction change breakpoint location map, connect the direction trajectory within it, extend the direction information of adjacent pixels, make the direction interval region tend to be continuous, and use the processed image as subsequent input to obtain the direction path reconstructed image content; S3: Reconstruct the image region in the image content by referring to the direction path, extract the edge brightness performance, observe the brightness changes between different regions, separate the image part with obvious brightness change trend, process the region with concentrated change trend as continuous image edge, output the processing layer, and obtain the brightness jump boundary region map. S4: Read the image portion extracted from the brightness jump boundary region map, process the red, green and blue channel color directions respectively, adjust the color direction to keep the color relationship of the region consistent, replace the corresponding region of the original image with the processed image portion, and output the color value corrected image frame. S5: Extract the image content in the color value correction image frame, sort out the continuous pixel areas, extract the boundary at the position where the color expression and direction are consistent, indicate the pixel area within the boundary range, assign names in combination with image feature information, and output the visible light image surface defect classification result.
[0006] As a further aspect of the present invention, the direction change breakpoint location map includes breakpoint location coordinates, breakpoint pixel set, and breakpoint distribution density; the direction path reconstructed image content includes reconstructed direction channels, direction continuity constraint domain, and break completion region; the brightness jump boundary region map includes jump boundary contour, brightness difference on both sides of the boundary, and jump intensity grading; the color value correction image frame includes channel color consistency relationship, color correction parameter set, and corrected color distribution; and the visible light image surface defect classification result includes defect type set, defect region number, and defect level label.
[0007] As a further aspect of the present invention, the step of obtaining the direction change breakpoint location map is as follows: S101: Collect red, green and blue channel information from the visible light image of the wind turbine blade, extract the brightness data of each channel at the pixel position, call the brightness information of the corresponding position of the three channels, fuse them to generate the comprehensive brightness value of each pixel in the image, and obtain the fused brightness matrix. S102: Based on the pixel brightness values in the fused brightness matrix, extract the brightness difference between each pixel and its neighboring pixels, identify pixels whose brightness changes in each direction exceed the threshold, filter out the location points with directional change characteristics, and obtain the set of directional change locations. S103: Based on the image coordinates in the set of direction change locations, extract the corresponding pixel information in the original image, construct a pixel distribution map that retains only the positions of the direction change abrupt changes, generate the image spatial distribution of the marked abrupt change region, and obtain the direction change breakpoint location map.
[0008] As a further aspect of the present invention, the step of obtaining the directional path reconstructed image content is as follows: S201: Based on the pixel region extracted from the direction change breakpoint location map, extract the start and end positions of the direction trajectory, call the spatial distribution of each pixel in the image, connect each direction path in sequence according to the adjacent position relationship, extend the continuous range of the direction trend, and obtain the direction trajectory connection path set. S202: Based on the extension direction of the connection path set of the directional trajectory, extract the directional information of adjacent pixels, determine whether the surrounding directional trend continues the original trajectory, select the image part with the same direction, extend the directional channel range, and obtain the directional channel extension area. S203: Call the image area in the direction channel extension area, extract the corresponding image content in the original image, fill the extension part into the corresponding position of the image, and complete the connection processing of the overall direction trajectory to obtain the direction path reconstructed image content.
[0009] As a further aspect of the present invention, the step of obtaining the brightness transition boundary region map is as follows: S301: Reconstruct the image region in the image content by referring to the direction path, extract the brightness information at each edge, detect the distribution difference of pixels in the edge direction, distinguish the brightness trend between different regions according to the brightness change range inside and outside the edge, and obtain a set of brightness change trends. S302: Based on the distribution direction of brightness differences in the set of brightness change trends, retrieve the boundary of the region where brightness differences are concentrated, filter the image range where brightness changes are continuously distributed, and merge the pixel range according to edge continuity to obtain edge continuous region segments. S303: For the image range located in the continuous edge region segment, extract the pixel data corresponding to the edge, allocate it to a new processing layer in the image space, form an image presentation structure based on the brightness jump position, and obtain a brightness jump boundary region map.
[0010] As a further aspect of the present invention, the step of obtaining the color value-corrected image frame is as follows: S401: Read the image portion extracted from the brightness jump boundary region map, extract the color distribution in the red channel, green channel and blue channel in sequence, detect the directional features of each channel at adjacent positions, and perform alignment operation according to the extension direction between the color distributions to obtain a channel orientation aligned image block; S402: Call the color content in the image block with the channel direction alignment, extract the color extension direction of the red, green and blue channels in the image area, perform order adjustment on the color channels with directional offset, and perform unified processing according to the spatial direction of color extension to obtain a color direction unified graphic segment. S403: Based on the adjusted area in the color direction unified graphic segment, replace the image part at the same position in the original image, merge the corrected color area into the original image frame structure, output the complete image frame content, and obtain the color value corrected image frame.
[0011] As a further aspect of the present invention, the step of obtaining the surface defect classification result of the visible light image is as follows: S501: Extract the image content in the color value correction image frame, filter continuous regions according to the positional relationship between adjacent pixels, sort out the regions with the same color change direction, extract the edge boundary according to color features and spatial direction, and obtain the color edge definition range. S502: Based on the image portion defined within the color edge boundary range, detect the morphological changes and color trends of pixels in each region. Combining edge continuity and structural direction within the region, select image portions with a unified orientation as the basis for division to obtain the image structure region distribution. S503: Based on the position and morphological features of each region in the image structure region distribution, call the texture arrangement and boundary features in the image content, assign names and name regions to the corresponding defect types of each region, obtain the corresponding classification content of the image, and obtain the surface defect classification result of the visible light image.
[0012] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, by extracting local differences in pixel brightness direction in an image, the basis for identifying abrupt changes in space is enhanced, highlighting areas of structural change in the image. Combined with the linear extension of directional trajectories, the path information of broken regions is connected in space, promoting visual continuity of the structure. Brightness variation trends are integrated into continuous boundary regions, strengthening the contrast of region division. Unified processing of color direction reduces color difference interference between channels, maintaining consistency in regional color relationships. Image content is enhanced in a coordinated manner in terms of structure, edges, and color, providing a stable basis for subsequent classification stages. Attached Figure Description
[0013] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart of the process for obtaining the location map of the breakpoints in the direction change of the present invention; Figure 3 This is a flowchart illustrating the process of obtaining image content through directional path reconstruction according to the present invention. Figure 4 This is a flowchart illustrating the process of obtaining the brightness jump boundary region map in this invention. Figure 5 This is a flowchart illustrating the process of obtaining the color value correction image frame according to the present invention. Figure 6This is a flowchart illustrating the process of obtaining the visible light image surface defect classification results according to the present invention. Detailed Implementation
[0014] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0015] refer to Figures 1 to 6 A deep learning-based classification method for surface defects in visible light images includes the following steps: S1: Collect red, green and blue channel information from visible light images of wind turbine blades, process the brightness of all pixels in the image through channel fusion, process the brightness direction between each pixel and its neighboring pixels, extract all position points in the direction change region, retain the pixel distribution of these position points in the image space, and obtain the direction change breakpoint location map. S2: Using the pixel regions extracted from the direction change breakpoint location map, perform linear connection operations on the direction trajectories within these regions. Extend the surrounding pixel information through continuous direction trajectories to form a continuous channel between the break region and the surrounding image direction. Use the image after the direction path extension as the subsequent image to obtain the direction path reconstructed image content. S3: Reconstruct the image region in the image content by referencing the direction path, extract the brightness information of the edge part of the region, separate the image part with obvious change trend by observing the brightness change between different regions, process the edge of the region with concentrated change trend into a group of continuous regions, output the processed layer, and obtain the brightness jump boundary region map. S4: Read the image portion mentioned in the brightness jump boundary region map, perform channel direction alignment on the color representation in the red, green and blue channels respectively, and make the color relationship in the region consistent by readjusting the color direction. Replace the corresponding content in the original image with the processed image portion to form new image data content, and output the color value corrected image frame. S5: Extract color values to correct the image content in the image frame, sort out continuous pixel regions, extract the boundaries of parts with consistent color expression and direction, indicate the regions of pixel regions within these boundaries, assign names and define regions by combining their image feature information, and output the surface defect classification results of the visible light image.
[0016] The directional change breakpoint location map includes breakpoint location coordinates, breakpoint pixel set, and breakpoint distribution density. The directional path reconstruction image content includes the reconstruction directional channel, directional continuity constraint domain, and break completion region. The brightness jump boundary region map includes the jump boundary contour, brightness difference on both sides of the boundary, and jump intensity grading. The color value correction image frame includes the channel color consistency relationship, color correction parameter set, and corrected color distribution. The visible light image surface defect classification results include the defect type set, defect region number, and defect level label.
[0017] Please see Figure 2 The steps to obtain the breakpoint location diagram of the direction change are as follows: S101: Collect red, green and blue channel information from the visible light image of the wind turbine blade, extract the brightness data of each channel at the pixel position, call the brightness information of the corresponding position of the three channels, fuse them to generate the comprehensive brightness value of each pixel in the image, and obtain the fused brightness matrix. The system acquires red, green, and blue channel information from visible light images of wind turbine blades, extracts brightness data for each channel at its pixel location, and then fuses the corresponding brightness information from the three channels to generate a combined brightness value for each pixel in the image, resulting in a fused brightness matrix. During implementation, an industrial-grade image acquisition device mounted on a highly stable UAV gimbal is activated. This device is equipped with a 50-megapixel high-sensitivity CMOS sensor and is positioned 5 meters vertically above the wind turbine blade surface for hovering and shooting, thereby acquiring a high-resolution visible light image with a resolution of 8192×4096 pixels. The system maps the acquired raw image data stream to a two-dimensional Cartesian coordinate system. For each discrete pixel coordinate point in the image, the intensity values of the corresponding red, green, and blue channels are analyzed, and these values are quantized to integers between 0 and 255. To simulate the human eye's perception of different wavelengths of light and obtain the most realistic grayscale information, the system pre-sets specific channel blending weight coefficients according to the International Commission on Illumination (CIE) standard color space conversion protocol. The weights are set as follows: red channel 0.299, green channel 0.587, and blue channel 0.114. Based on these weight coefficients, the system performs a weighted summation of the three channel values for each pixel location. For example, in pixel data acquired at a specific coordinate location, the values for the red, green, and blue channels are 158, 162, and 155, respectively. The system integrates these components into a single scalar value of 160 through weighted calculation, which represents the overall brightness at that location. The system iterates through all pixels of the entire image using a double loop, calculating and converting the brightness value one by one. These calculation results are then stored in a two-dimensional floating-point array of the same dimension, following the original spatial coordinate order, thus constructing a blended brightness matrix that accurately reflects the details of light and dark variations on the leaf surface.
[0018] S102: Based on the pixel brightness values in the fused brightness matrix, extract the brightness difference between each pixel and its neighboring pixels, identify pixels whose brightness changes exceed the threshold in each direction, filter out the location points with directional change characteristics, and obtain the set of directional change locations. Based on the pixel brightness values in the fused brightness matrix, the brightness difference between each pixel and its neighboring pixels is extracted. Pixels with brightness changes exceeding a threshold in each direction are identified, and locations exhibiting abrupt directional changes are selected to obtain a set of directional change locations. In the specific execution steps, the system employs an eight-neighbor difference analysis method in the spatial domain. Taking any non-edge pixel in the matrix as the center, the brightness values of its eight neighboring positions (top left, top right, top right, left, right, bottom left, bottom right, and bottom right) are read. The system sequentially calculates the absolute value of the brightness difference between the center pixel and each of its surrounding neighboring pixels to quantify the gradient change degree of that point in different spatial directions. To distinguish between normal surface texture fluctuations and potential defect abrupt changes, the system sets a strict judgment threshold based on statistical principles. The system selects known defect-free smooth regions in the image as background samples, statistically analyzes the mean and standard deviation of the brightness differences between neighboring pixels within these regions, and sets the brightness change threshold to 10 based on a 6-times standard deviation principle. The system calculates eight directional difference values for each pixel and compares them to a threshold. If the difference value in any direction exceeds 10, the system determines that the pixel has a directional abrupt change characteristic. Simultaneously, the system records the direction vector that produces the maximum difference value as the feature direction of the abrupt change point. For example, when a pixel's brightness difference value with its right-hand neighbor reaches 25, because this value is significantly higher than the set threshold of 10, the system not only marks it as an abrupt change point but also locks the abrupt change direction to horizontal to the right. The system performs a full-coverage scan and filtering of the entire brightness matrix, structurally summarizing the coordinates of all pixels that meet the abrupt change conditions and their corresponding directional information to generate a set of directional change locations containing all potential defect edge information.
[0019] S103: Based on the image coordinates in the set of orientation change locations, extract the corresponding pixel information in the original image, construct a pixel distribution map that retains only the orientation change locations, generate the image spatial distribution of the marked change regions, and obtain the orientation change breakpoint location map.
[0020] Based on the image coordinates in the set of orientation change locations, corresponding pixel information is extracted from the original image. A pixel distribution map retaining only the orientation change locations is constructed, generating an image spatial distribution map marking the change regions, thus obtaining an orientation change breakpoint location map. In the specific operation, a blank binarized matrix with the exact same size as the original acquired image is initialized, and the initial value of all elements is set to the background color 0. Each coordinate data in the orientation change location set is read, and the pixel value at the corresponding position in the binarized matrix is marked with a highlight value of 255, thereby separating the change points of interest from background noise at the data level. Since single-pixel-width change points visually appear as discrete noise, which is detrimental to subsequent path tracing, the system introduces morphological image processing techniques to optimize the matrix. The system uses a 3×3 cross-shaped structural element to perform a dilation operation on the binarized matrix. This operation marks the four adjacent positions (top, bottom, left, and right) of each highlighted pixel as highlighted, thus expanding the discrete breakpoints into pixel clusters with a certain degree of connectivity. After this processing, the originally sparse edge points are integrated into visually continuous lines or regions, and the image presents a distribution pattern of black background and white dots. Among them, the dense clusters of white pixels accurately depict the geometric locations where the brightness of the blade surface changes drastically, and intuitively show the edge contours of defects such as cracks, scratches or coating peeling, thus generating a map of the directional change breakpoints that can clearly define the spatial distribution of abrupt change areas.
[0021] Please see Figure 3 The steps for obtaining image content reconstructed by directional path are as follows: S201: Based on the pixel region extracted from the direction change breakpoint location map, extract the start and end positions of the direction trajectory, call the spatial distribution of each pixel in the image, connect each direction path in sequence according to the adjacent position relationship, extend the continuous range of the direction trend, and obtain the direction trajectory connection path set. Based on the pixel regions extracted from the directional change breakpoint location map, the system extracts the start and end positions of the directional trajectories. It then utilizes the spatial distribution of pixels in the image, connecting each directional path sequentially according to their adjacent positions, extending the continuous range of the directional trend to obtain a set of directional trajectory connection paths. In specific implementation, the system uses a connected component labeling algorithm to scan the white pixel regions in the image, merging adjacent pixels into independent connected subsets. Furthermore, a skeletonization algorithm extracts the central skeleton line of each connected subset, thereby determining the spatial start and end points of each trajectory. To address trajectory breakage caused by uneven lighting or occlusion in actual shooting, the system sets a connection search logic: a search radius centered on the endpoint is set to 5 pixels, and the angular tolerance of the trajectory tangent direction is 15 degrees. Starting from each trajectory endpoint, the system extends forward along its tangent direction to search for the endpoints of other isolated trajectories. When the system detects that the Euclidean distance between two broken trajectory endpoints is less than the preset 4.24 pixels, and the tangent angle deviation is less than 3 degrees, the system determines that these two trajectory segments belong to the broken fragments of the same physical crack based on spatial geometric continuity. A linear interpolation algorithm is used to generate a connection path between the two endpoints, and the missing pixel coordinates are calculated and filled in, thus stitching the broken lines together. By executing this intelligent connection logic on all breakpoints in the entire image, the system effectively repairs visual discontinuities and forms a set of directional trajectory connection paths with complete geometric continuity that reflects the true physical defect morphology.
[0022] S202: Based on the extension direction of the connection path set of the directional trajectory, extract the directional information of adjacent pixels, determine whether the surrounding directional trend continues the original trajectory, select the image part with the same direction, extend the directional channel range, and obtain the directional channel extension area. Based on the extension direction of the path set connected by the directional trajectory, the system extracts the directional information of adjacent pixels, sequentially determines whether the surrounding directional trend continues the original trajectory, selects the image portion with the same direction, and extends the directional channel range to obtain the directional channel extension area. In the specific execution steps, for each pixel on the repaired path, the system calculates its normal direction perpendicular to the path direction, and searches for adjacent pixels one by one along this normal direction to determine the actual physical width and smear range of the defect. The system introduces a gradient direction consistency index as a criterion, setting a similarity threshold of 0.85. During the search process, the system calculates the cosine similarity between the gradient vector of adjacent pixels and the gradient vector of the path center point in real time. When the calculated similarity value is higher than 0.85, it indicates that the texture flow direction of the adjacent pixel is consistent with the main path and belongs to the same defect structure. The system includes it in the extension range and continues to search outward; conversely, if the similarity is lower than the threshold, or the single-sided extension distance exceeds the preset upper limit of 20 pixels, the system stops the search in that direction. Through this iterative extension process from line to surface, the system expands the original single-pixel-width linear skeleton into a band-shaped region covering the entire defect halo area, thereby accurately defining the directional channel extension area that includes the crack body and its surrounding deformation texture caused by stress concentration.
[0023] S203: Call the image area in the directional channel extension area, extract the corresponding image content in the original image, and fill the extension part into the corresponding position of the image to complete the connection processing of the directional trajectory and obtain the directional path reconstructed image content.
[0024] The system retrieves the image region from the extended area of the directional channel, extracts the corresponding image content from the original image, and inserts the extended portion into the corresponding position in the image, thus completing the connection processing of the directional trajectory and obtaining the reconstructed directional path image content. In specific operations, the system generates a binary mask matrix based on the set of coordinates of the extended area determined in the previous steps, where the corresponding position of the extended area is set as the valid value, and the rest is the background. The system performs a bitwise AND operation between this mask and the original high-resolution visible light image, thereby completely filtering out irrelevant background interference while preserving the original color and texture details. For the connection path positions generated by mathematical interpolation in the previous steps, due to the lack of real pixel information, the system uses a sample-based texture synthesis technique for repair. The system searches for the image block with the best matching texture features in the real image region around the connection point (e.g., within a radius of 10 pixels), selects the best matching block by minimizing the squared difference criterion, fills it into the interpolation position, and performs edge smoothing. All extracted real defect areas are superimposed and integrated with the repaired connection areas to form a directional path reconstructed image content with a transparent background, retaining only the complete defect shape and its fine texture details.
[0025] Please see Figure 4The steps to obtain the brightness transition boundary region map are as follows: S301: Reconstruct the image region in the image content by referencing the direction path, extract the brightness information at each edge, detect the distribution difference of pixels in the edge direction, distinguish the brightness trend between different regions according to the brightness change range inside and outside the edge, and obtain a set of brightness change trends. The system reconstructs image regions from image content using directional paths, extracts brightness information at each edge, detects pixel distribution differences along the edge direction, and distinguishes brightness trends between different regions based on the range of brightness changes inside and outside the edge, resulting in a set of brightness change trends. In specific implementation, the system performs a refined scan of the edge along the normal direction of a defined strip region, extracting a 5-pixel-width range both inside and outside the edge line, and calculating the average pixel brightness within these two ranges. To quantify the degree of brightness jumps on both sides of the edge, the system introduces the Weber contrast algorithm, calculating the ratio of the absolute value of the difference between the average brightness on the inside and outside sides to the maximum of the two. The system sets an effective edge detection threshold of 0.15 to filter out subtle light and shadow changes. For example, at a certain edge detection point, the measured average brightness on the inside is 80, and the average brightness of the background on the outside is 140; the system calculates a contrast value of 0.428. Since this value is significantly greater than the set threshold of 0.15, the system determines that there is a physically significant brightness jump at this location, rather than a simple texture transition. The system then associates and records the coordinates of the location, the magnitude of the brightness gradient, and the direction of the gradient (such as from dark to bright or from bright to dark), thereby constructing a set of brightness change trends containing detailed edge attribute features.
[0026] S302: Based on the distribution direction of brightness differences in the brightness change trend set, retrieve the boundary of the region where brightness differences are concentrated, filter the image range where brightness changes are continuously distributed, and merge the pixel range according to edge continuity to obtain edge continuous region segments. Based on the distribution direction of brightness differences in the brightness change trend set, the system retrieves the boundaries of regions with concentrated brightness differences, filters the image ranges with continuous brightness changes, and merges pixel ranges according to edge continuity to obtain edge-continuous region segments. In practice, the system performs topological analysis on discrete edge transition points and concatenates them based on spatial proximity and directional consistency principles. The system defines two nodes as components of the same edge line segment if the spatial Euclidean distance between them does not exceed 2 pixels and the gradient direction angle does not exceed 10 degrees. To further eliminate sensor noise or transient interference, the system counts the pixel length of each concatenated edge line and sets a minimum continuous length threshold of 15 pixels. Short line segments with a length of less than 15 pixels are considered invalid noise and discarded, while line segments with a length exceeding the threshold are retained as valid edge segments. The system further checks the geometric positional relationship between these valid segments. If the distance between the endpoints of two segments is less than 3 pixels, the system automatically merges them to construct a closed or semi-closed complete region outline. The pixel coordinate ranges enclosed by all verified and merged continuous edges are uniformly archived to obtain edge-continuous region segments that accurately describe the geometry of defects.
[0027] S303: For the image range located in the continuous edge region segment, extract the pixel data corresponding to the edge, allocate it to a new processing layer in the image space, form an image presentation structure based on the brightness jump position, and obtain the brightness jump boundary region map.
[0028] For image ranges located within continuous edge regions, pixel data corresponding to the edges is extracted and allocated to a new processing layer in the image space. This forms an image rendering structure based on brightness transition locations, resulting in a brightness transition boundary region map. Specifically, the system allocates a new independent layer space in the image processing memory, possessing a complete alpha transparency channel. The system precisely maps the grayscale data of all pixels within the continuous edge region segment from their original image to their corresponding positions in this new layer, while uniformly setting the background pixel values of non-edge regions to 0 (fully transparent). To make the internal texture features of defects more clearly discernible, the system performs local histogram equalization enhancement processing on the non-zero pixel regions within this layer. For example, if the original pixel grayscale values of a certain region are concentrated in a narrow range of 70 to 90, resulting in low contrast, after equalization processing, the grayscale values of these pixels are non-linearly stretched and mapped to a wide dynamic range of 20 to 230. This processing significantly enhances the contrast of detailed textures within the defects, making the originally blurry structural features clear and sharp. The generated layer structure, which contains enhanced edge texture information, is a brightness transition boundary region map that clearly defines the physical boundary between defects and the background.
[0029] Please see Figure 5The steps for obtaining the color value corrected image frame are as follows: S401: Read the image portion extracted from the brightness jump boundary region map, extract the color distribution in the red, green and blue channels in sequence, detect the directional features of each channel at adjacent positions, and perform alignment operation according to the extension direction between the color distributions to obtain the channel orientation aligned image block; The system reads the image portion extracted from the brightness transition boundary region map, sequentially extracting the color distribution within the red, green, and blue channels. It then detects the directional features of each channel at adjacent positions and aligns them according to the extension direction of the color distribution, resulting in channel-oriented aligned image patches. In practice, the system uses local window analysis to calculate the brightness centroid coordinates of each color channel for the corresponding edge regions in the original RGB data. Due to slight differences in the refractive index of optical lenses for different wavelengths of light, the red, green, and blue channels often exhibit sub-pixel-level physical misalignment at the edges. Using the green channel, located at the spectral center, as a reference, the system calculates the centroid displacement vectors of the red and blue channels relative to the green channel. For example, at a specific edge position, the system detects a horizontal offset of 1.2 pixels and a vertical offset of -0.5 pixels relative to the green channel, with a corresponding specific offset in the blue channel. The system partitions and stores these local displacement vectors detected in different regions, establishing a color difference correction parameter mapping table across the entire image. The dataset generated in this process, containing precise alignment parameters, is the channel-oriented aligned image patch.
[0030] S402: Call the color content in the image block with channel direction alignment, extract the color extension direction of the red, green and blue channels in the image area, perform order adjustment on the color channels with direction offset, and perform unified processing according to the spatial direction of color extension to obtain a color direction unified graphic fragment. The system aligns the color content of the image patch with the channel orientation, extracts the color extension directions of the red, green, and blue channels in the image region, adjusts the order of color channels with directional offsets, and unifies the processing according to the spatial direction of the color extension to obtain a color-oriented graphic fragment. In the specific execution steps, the system reads the displacement vector parameters obtained in the previous step and uses a high-precision bilinear interpolation algorithm to perform inverse translation correction on the pixel matrices of the red and blue channels. For the 1.2-pixel horizontal offset and 0.5-pixel vertical offset detected in the red channel, the system calculates the color value of the virtual sampling point corresponding to the target coordinates in the original red channel image and reassigns it to the corrected pixel matrix. The same operation is performed on the blue channel. After correction, the system calculates the structural similarity index (SSIM) between the three channels in real time. If the similarity of a certain region after correction still does not reach the standard of 0.98, the system will automatically start the optical flow algorithm to fine-tune the pixel position until the edge textures of the three channels completely overlap in space. This meticulous correction process completely eliminates purple or red edge artifacts caused by color difference, restoring the true color edges of the object and thus obtaining graphic fragments with unified color direction.
[0031] S403: Based on the color direction, unify the adjusted areas in the graphic segment, replace the corresponding image parts in the original image, merge the corrected color areas into the original image frame structure, output the complete image frame content, and obtain the color value corrected image frame.
[0032] Based on the adjusted areas in the color-direction unified graphic segment, the corresponding image portions in the original image are replaced, and the corrected color areas are merged into the original image frame structure to output a complete image frame, resulting in a color-corrected image frame. In practice, to avoid leaving harsh stitching marks in the image, the system employs advanced feathering fusion technology to write the corrected pixel data back into the original image. The system sets a smooth transition band with a width of 3 pixels at the boundary between the corrected area and the background. Within this transition band, the system linearly blends the corrected high-quality pixels with the original background pixels according to distance weights. The weighting coefficient is set to decrease linearly from 1.0 at the inner edge of the corrected area to 0.0 at the outer boundary, thus achieving a seamless transition between old and new pixels. Through this fusion process, the system not only corrects color difference deviations at image edges but also perfectly maintains the continuity of background texture and the naturalness of the visual appearance. The output image eliminates optical artifact interference and retains all true physical details, resulting in a high-quality color-corrected image frame.
[0033] Please see Figure 6 The steps for obtaining the surface defect classification results of visible light images are as follows: S501: Extract color values to correct the image content in the image frame, filter continuous regions according to the positional relationship between adjacent pixels, sort out the regions with the same color change direction, extract the edge boundaries according to color features and spatial direction, and obtain the color edge definition range. The system extracts color values to correct image content within image frames, filters continuous regions based on the positional relationship between adjacent pixels, and further organizes regions with consistent color change directions. Edge boundaries are extracted based on color features and spatial orientation to obtain the color edge definition range. In practice, the system performs feature mining on the corrected image, calculates the color gradient distribution of pixels within the region, and uses the Canny edge detection operator to extract precise closed contours of the region. Within the defined range, the system calculates a series of key geometric and physical feature parameters, including the length of the major axis along the principal axis, the width of the minor axis perpendicular to the principal axis, the total area of pixels covered by the region, and the ratio of the major axis to the minor axis (aspect ratio). Simultaneously, the system extracts the average color vector within the region and the average color vector of the background region, and calculates their Euclidean distance in color space to quantify the contrast between the defect and the background. Furthermore, the system uses the gray-level co-occurrence matrix to calculate the texture entropy of the region to characterize the complexity of the internal texture. These multi-dimensional feature data are fully recorded and structured by the system, forming detailed color edge definition range data.
[0034] S502: Based on the image portion defined within the color edge boundary range, detect the morphological changes and color trends of pixels within each region. Combining edge continuity and structural direction within the region, select image portions with a unified orientation as the basis for division to obtain the image structure region distribution. Based on the image portion defined within the color edge boundary, the system detects the morphological changes and color trends of pixels within each region. Combining edge continuity and structural orientation within the region, image portions with a unified orientation are selected as the classification criteria to obtain the image structure region distribution. In specific execution, the system performs preliminary topological morphological classification of each potential defect region based on the geometric feature parameters extracted by S501. The closure index of the region is calculated, which is the ratio of the region area to the convex hull area. When the closure index of a region is greater than 0.9 and the aspect ratio is less than 2.0, the system determines that the region has regular blocky features and classifies it as a blocky structure region; while when the aspect ratio of a region is greater than 5.0, the system determines that it exhibits significant elongated features and classifies it as a linear structure region. The system traverses all extracted independent regions in the image and establishes a detailed index list containing a unique ID, geometric center coordinates, and morphological classification label for each region. This process generates the image structure region distribution.
[0035] S503: Based on the position and morphological characteristics of each region in the image structure region distribution, call the texture arrangement and boundary features in the image content, assign names and name regions to the corresponding defect types of each region, obtain the corresponding classification content of the image, and obtain the surface defect classification results of the visible light image.
[0036] Based on the location and morphological features of each region in the image structure distribution, the system calls upon the texture arrangement and boundary features in the image content to assign names and name regions corresponding to the defect types in each region, thereby obtaining the corresponding classification content of the image and obtaining the surface defect classification results of the visible light image. In the specific execution steps, the system inputs the detailed quantitative features of each region into a preset defect classification logic model for matching and judgment. This model sets clear criteria based on the physical properties of common defects in wind turbine blades: cracks are usually characterized by being long and thin with complex textures, and their criteria are an aspect ratio greater than 5.0, an area greater than 50 pixels, a color distance greater than 40, and a texture entropy greater than 4.5; pinholes are characterized by small holes, and their criteria are an aspect ratio less than 1.5 and an area less than 20 pixels; peeling is somewhere in between, with an aspect ratio between 1.5 and 5.0. For example, the system analyzes data from a certain region and finds that its aspect ratio is 8.0, area is 1650, color distance is 55, and texture entropy is 4.8. Because all indicators fall within the threshold range for cracks, the system automatically classifies it as a "crack." Another region, with an aspect ratio of 1.6 and an area of 300, is classified as "peeling." After completing the logical matching of all regions in the entire image, the system generates visible light image surface defect classification results containing specific defect type names, precise location coordinates, and confidence level information.
[0037] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A deep learning classification method for surface defects in visible light images, characterized in that, Includes the following steps: S1: Collect red, green and blue channel information from wind turbine blade images, perform brightness fusion on the channel content, process the brightness direction between each pixel and its adjacent pixels in the image, extract the location points in the direction change region, retain the distribution of these pixels in the image, and obtain the direction change breakpoint location map. S2: Using the image region extracted from the direction change breakpoint location map, connect the direction trajectory within it, extend the direction information of adjacent pixels, make the direction interval region tend to be continuous, and use the processed image as subsequent input to obtain the direction path reconstructed image content; S3: Reconstruct the image region in the image content by referring to the direction path, extract the edge brightness performance, observe the brightness changes between different regions, separate the image part with obvious brightness change trend, process the region with concentrated change trend as continuous image edge, output the processing layer, and obtain the brightness jump boundary region map. S4: Read the image portion extracted from the brightness jump boundary region map, process the red, green, and blue channel color directions respectively, adjust the color direction to keep the color relationship of the region consistent, replace the corresponding region of the original image with the processed image portion, and output the color value corrected image frame.
2. The deep learning classification method for visible light image surface defects according to claim 1, characterized in that: The direction change breakpoint location map includes breakpoint location coordinates, breakpoint pixel set, and breakpoint distribution density. The direction path reconstructed image content includes reconstructed direction channels, direction continuity constraint domain, and break completion region. The brightness jump boundary region map includes jump boundary contour, brightness difference on both sides of the boundary, and jump intensity grading. The color value corrected image frame includes channel color consistency relationship, color correction parameter set, and corrected color distribution.
3. The deep learning classification method for visible light image surface defects according to claim 1, characterized in that: The steps for obtaining the direction change breakpoint location map are as follows: S101: Collect red, green and blue channel information from the visible light image of the wind turbine blade, extract the brightness data of each channel at the pixel position, call the brightness information of the corresponding position of the three channels, fuse them to generate the comprehensive brightness value of each pixel in the image, and obtain the fused brightness matrix. S102: Based on the pixel brightness values in the fused brightness matrix, extract the brightness difference between each pixel and its neighboring pixels, identify pixels whose brightness changes in each direction exceed the threshold, filter out the location points with directional change characteristics, and obtain the set of directional change locations. S103: Based on the image coordinates in the set of direction change locations, extract the corresponding pixel information in the original image, construct a pixel distribution map that retains only the positions of the direction change abrupt changes, generate the image spatial distribution of the marked abrupt change region, and obtain the direction change breakpoint location map.
4. The deep learning classification method for surface defects in visible light images according to claim 1, characterized in that: The steps for obtaining the image content reconstructed by the directional path are as follows: S201: Based on the pixel region extracted from the direction change breakpoint location map, extract the start and end positions of the direction trajectory, call the spatial distribution of each pixel in the image, connect each direction path in sequence according to the adjacent position relationship, extend the continuous range of the direction trend, and obtain the direction trajectory connection path set. S202: Based on the extension direction of the connection path set of the directional trajectory, extract the directional information of adjacent pixels, determine whether the surrounding directional trend continues the original trajectory, select the image part with the same direction, extend the directional channel range, and obtain the directional channel extension area. S203: Call the image area in the direction channel extension area, extract the corresponding image content in the original image, fill the extension part into the corresponding position of the image, and complete the connection processing of the overall direction trajectory to obtain the direction path reconstructed image content.
5. The deep learning classification method for surface defects in visible light images according to claim 1, characterized in that: The steps for obtaining the brightness jump boundary region map are as follows: S301: Reconstruct the image region in the image content by referring to the direction path, extract the brightness information at each edge, detect the distribution difference of pixels in the edge direction, distinguish the brightness trend between different regions according to the brightness change range inside and outside the edge, and obtain a set of brightness change trends. S302: Based on the distribution direction of brightness differences in the set of brightness change trends, retrieve the boundary of the region where brightness differences are concentrated, filter the image range where brightness changes are continuously distributed, and merge the pixel range according to edge continuity to obtain edge continuous region segments. S303: For the image range located in the continuous edge region segment, extract the pixel data corresponding to the edge, allocate it to a new processing layer in the image space, form an image presentation structure based on the brightness jump position, and obtain a brightness jump boundary region map.
6. The deep learning classification method for surface defects in visible light images according to claim 1, characterized in that: The steps for obtaining the color value corrected image frame are as follows: S401: Read the image portion extracted from the brightness jump boundary region map, extract the color distribution in the red channel, green channel and blue channel in sequence, detect the directional features of each channel at adjacent positions, and perform alignment operation according to the extension direction between the color distributions to obtain a channel orientation aligned image block; S402: Call the color content in the image block with the channel direction alignment, extract the color extension direction of the red, green and blue channels in the image area, perform order adjustment on the color channels with directional offset, and perform unified processing according to the spatial direction of color extension to obtain a color direction unified graphic segment. S403: Based on the adjusted area in the color direction unified graphic segment, replace the image part at the same position in the original image, merge the corrected color area into the original image frame structure, output the complete image frame content, and obtain the color value corrected image frame.
7. The deep learning classification method for surface defects in visible light images according to claim 1, characterized in that, The method further includes step S5: S5: Extract the image content in the color value correction image frame, sort out the continuous pixel areas, extract the boundary at the position where the color expression and direction are consistent, indicate the pixel area within the boundary range, assign names in combination with image feature information, and output the visible light image surface defect classification result. The visible light image surface defect classification results include a set of defect types, defect region numbers, and defect level labels.
8. The deep learning classification method for surface defects in visible light images according to claim 7, characterized in that: The steps for obtaining the surface defect classification results of the visible light image are as follows: S501: Extract the image content in the color value correction image frame, filter continuous regions according to the positional relationship between adjacent pixels, sort out the regions with the same color change direction, extract the edge boundary according to color features and spatial direction, and obtain the color edge definition range. S502: Based on the image portion defined within the color edge boundary range, detect the morphological changes and color trends of pixels in each region. Combining edge continuity and structural direction within the region, select image portions with a unified orientation as the basis for division to obtain the image structure region distribution. S503: Based on the position and morphological features of each region in the image structure region distribution, call the texture arrangement and boundary features in the image content, assign names and name regions to the corresponding defect types of each region, obtain the corresponding classification content of the image, and obtain the surface defect classification result of the visible light image.