A method for detecting surface defects of metal insulation layer
By obtaining the defect connectivity and smoothness of the surface communication domain of the metal insulation layer and calculating the defect score, the problem of difficult to identify complex mixed defects in the prior art is solved, and the accuracy of detection is improved.
Patent Information
- Application Number
- CN202411648557.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-19
AI Technical Summary
When detecting surface defects of metal insulation layer, it is difficult to accurately identify complex mixing defects, and mixing defects are often identified as single defects, resulting in misjudgment of the healthy state of metal insulation layer.
By collecting the grayscale image of the insulation layer surface and the grayscale image of the insulation layer distance, the defect connectivity and defect smoothness of each communication domain are obtained, and the defect score of each communication domain is calculated based on these features, and then defect detection is performed.
The accuracy of the surface defect detection results of metal insulation layer is improved, and defects of different shapes and complex properties can be more accurately identified.
Smart Images

Figure CN119151937B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and more specifically, to a method for detecting surface defects of a metal insulation layer. Background Art
[0002] Metal insulation layers are usually used to reduce heat loss, improve energy efficiency and protect equipment from temperature changes and external environment. Since scratches, dents, cracks and other defects may appear on the metal insulation layer during manufacturing, transportation and use, which may reduce the insulation performance and increase safety hazards. Therefore, surface defect detection is a crucial part. Since the existing technology detects surface defects of metal insulation layers, due to the differences in reflectivity changes and shape changes of different single or mixed defect areas, the existing technology manually identifies or traditionally uses image segmentation to identify defect types. Mixed defects are identified as single defects, which leads to misjudgment of the health status of the metal insulation layer.
[0003] The patent application document with the publication number CN110097566A currently discloses an image threshold segmentation algorithm, which obtains the prior probability of the target area in the image to be segmented and the prior probability of the background area in the image to be segmented; calculates the optimal threshold using the NBAS algorithm based on the prior probability of the target area, the prior probability of the background area and a preset threshold selection function; and defines the segmented image with the optimal threshold as the boundary.
[0004] In the process of detecting surface defects of metal insulation layer, the image threshold segmentation algorithm changes the reflectivity and shape of different single or mixed defect areas, which leads to the different changes in the defect area. When the traditional image segmentation method is used to identify the defect type, mixed defects are identified as single defects, which leads to misjudgment of the health status of the metal insulation layer. Summary of the invention
[0005] In order to solve the problem that mixed defects are identified as single defects when manually identifying or traditionally identifying defect types by image segmentation in the prior art due to the differences in reflectivity changes and shape changes of different single or mixed defect areas, the present invention proposes a method for detecting surface defects of a metal insulation layer, which comprises the following steps:
[0006] Collect the grayscale image of the surface of the insulation layer and the grayscale image of the distance of the insulation layer; obtain each connected domain of the grayscale image of the surface of the insulation layer; take the mean value of the defect connectivity factor of each pixel point in each connected domain of the grayscale image of the surface of the insulation layer as the defect connectivity of each connected domain of the grayscale image of the surface of the insulation layer; correspond each connected domain in the grayscale image of the surface of the insulation layer to the grayscale image of the distance of the insulation layer, and obtain each connected domain of the grayscale image of the distance of the insulation layer; obtain the defect smoothness of each connected domain of the grayscale image of the distance of the insulation layer:
[0007] ; The number of directions representing the directions of the four neighborhoods; Indicates The defect smoothness factor of a connected domain in the direction of the jth four neighbors; Indicates The mean value of the defect smoothness factor of a connected domain in all four neighborhood directions; Indicates taking the absolute value;
[0008] Get the defect score of each connected domain ; Represents the defective connectivity of the connected domain; Indicates the defect smoothness of the connected domain; Represents the number of all pixels in the connected domain; Represents the number of all pixels in the grayscale image of the insulation layer surface; defects are detected on the insulation layer surface according to the defect score of the connected domain.
[0009] The innovation of the present invention lies in firstly obtaining the gray value distribution of the pixels in each connected domain and obtaining the defect connectivity of each connected domain, so as to accurately analyze the overall shape of the connected domain according to the defect connectivity and distinguish defects of different shapes. Furthermore, according to the gray value difference and distance between the pixels and adjacent pixels in the gray image of the connected domain in the insulation layer, the depth change rate of the pixels in the connected domain in each four-neighborhood direction is obtained, and then according to the difference in the depth change rate between the pixels in each four-neighborhood direction, the defect smoothness of each connected domain is obtained, thereby solving the problem that single feature detection cannot accurately identify complex mixed defects; finally, according to the defect connectivity and defect smoothness of each connected domain, the defect score of each connected domain is obtained; according to the defect score of the connected domain, the surface of the insulation layer is inspected for defects, thereby improving the accuracy of the defect detection results on the surface of the insulation layer.
[0010] Preferably, the defect connectivity factor of each pixel point in each connected domain of the grayscale image of the surface of the thermal insulation layer is obtained, including:
[0011] ;
[0012] In the formula, Indicates The first Pixel defect connectivity factor; The number of directions representing the directions of the four neighbors; Indicated in In the direction of the jth four neighbors of the connected domain, through the The run length of pixels; as well as Indicated in The number of all run lengths in the directions of the jth four neighbors of the connected domain and the number of The jth four-neighborhood direction of the connected domain The number of times a run length occurs; Indicated in The jth four-neighborhood direction of the connected domain Stroke length.
[0013] It is convenient to obtain the defect connectivity of the connected domain according to the defect connectivity factor, and can accurately analyze the overall shape of the connected domain and distinguish defects of different shapes.
[0014] Preferably, the acquisition of the stroke length includes:
[0015] The Otsu threshold segmentation algorithm is used to perform threshold segmentation on the grayscale image of the insulation layer surface to obtain a binary image of the insulation layer surface. connected domain, The area formed by the minimum circumscribed rectangle of the connected domain is recorded as The target area of the connected domain is obtained by using the binary image of the insulation layer surface. The binary grayscale matrix of the target area of the connected domain;
[0016] In the grayscale image of the insulation layer surface In the direction of the jth four neighbors of the connected domain, and In the binary grayscale matrix of the target area of the connected domain, the number of pixels with the same grayscale value appearing consecutively each time is recorded as The length of a run in the direction of the jth four neighbors of a connected domain.
[0017] Preferably, the acquisition of the defect smoothness factor includes:
[0018] ;
[0019] In the formula, Indicates The defect smoothness factor of a connected domain in the direction of the jth four neighbors; Indicates The number of all depth change sets of a connected domain in the jth four-neighborhood direction; Indicates The connected domain is in the direction of the jth four neighbors. The local defect smoothness of a set of depth variations; Indicates The connected domain is in the direction of the jth four neighbors. The number of all pixels in a depth change set; Indicates The connected domain is in the direction of the jth four neighbors. The depth change rate of the pixels in the depth change set; Indicates The mean of all depth change rates of a connected domain in the jth four neighborhood directions; Indicates The number of all pixels in a connected region.
[0020] It is convenient to obtain the defect smoothness of each connected domain according to the defect smoothing factor, so as to solve the problem that single feature detection cannot accurately identify complex mixed defects.
[0021] Preferably, the acquisition of the depth change set includes:
[0022] For the insulation layer distance grayscale image In the jth four-neighborhood direction, a connected domain consists of several sets of pixels with the same absolute value of the depth change rate, all of which are recorded as The depth change set of a connected domain in the direction of the jth four neighbors.
[0023] Preferably, obtaining the local defect smoothness of the depth variation set includes:
[0024] Obtain the neighborhood travel of each connected domain of the insulation layer distance grayscale image in each of the four neighborhood directions;
[0025] ;
[0026] In the formula, Indicates The connected domain is in the direction of the jth four neighbors. The local defect smoothness of a set of depth variations; Indicates The defect connectivity of a connected domain; Indicates The connected domain is in the direction of the jth four neighbors. Neighborhood itinerary of a set of depth changes; Indicates The connected domain is in the direction of the jth four neighbors. The number of all pixels in a depth change set.
[0027] It is convenient to obtain the defect smoothness of each connected domain according to the local defect smoothness of the depth variation set, so as to solve the problem that single feature detection cannot accurately identify complex mixed defects.
[0028] Preferably, the acquisition of the depth change rate of the pixel point includes:
[0029] For any pixel point in any connected domain of the insulation layer distance grayscale image, in any four neighborhood directions, the adjacent pixel points of the pixel point in the four neighborhood directions are recorded as the target pixel points of the pixel point in the four neighborhood directions; the difference in grayscale values between the pixel point and its target pixel points in the four neighborhood directions is recorded as the first difference; the Euclidean distance between the pixel point and its target pixel points in the four neighborhood directions is recorded as the first distance; and the ratio of the first difference to the first distance is used as the depth change rate of the pixel point in the four neighborhood directions.
[0030] This facilitates the subsequent acquisition of the defect smoothness of each connected domain, and then obtains the defect score of each connected domain.
[0031] Preferably, the specific method of obtaining the neighborhood travel of each connected domain of the insulation layer distance grayscale image in each of the four neighborhood directions includes:
[0032] For The connected domain is in the direction of the jth four neighbors. A set of depth changes, The first pixel in the depth change set is taken as the starting point. Within the eight neighborhoods of the pixel, the pixels with the same absolute value of the depth change rate as the pixel are recorded as neighborhood pixels. In the jth four neighborhood directions, the maximum number of consecutive neighborhood pixels is taken as the jth neighborhood pixel. The neighborhood itinerary of a connected domain in the jth four-neighborhood direction.
[0033] The present invention has the following beneficial effects: the present invention obtains the defect connectivity of each connected domain according to the gray value distribution of the pixels in each connected domain; thereby, the overall shape of the connected domain can be accurately analyzed; the depth change rate of the pixels in the connected domain in each four-neighborhood direction is obtained according to the gray value difference and distance between the pixels and adjacent pixels in the gray image of the insulation layer; the defect smoothness of each connected domain is obtained according to the difference in the depth change rate between the pixels in each four-neighborhood direction; thereby, the problem that single feature detection cannot accurately identify complex mixed defects is solved; the defect score of each connected domain is obtained according to the defect connectivity and defect smoothness of each connected domain; the surface of the insulation layer is defect-detected according to the defect score of the connected domain; thereby, the accuracy of the defect detection result of the surface of the insulation layer is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0035] Figure 1 The present invention is a flowchart of a method for detecting surface defects of a metal insulation layer according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0037] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0038] See also Figure 1 , which shows a flow chart of the steps of a method for detecting surface defects of a metal insulation layer provided by an embodiment of the present invention, the method comprising the following steps:
[0039] S001. Collect a grayscale image of the surface of the insulation layer and a grayscale image of the distance of the insulation layer.
[0040] Specifically, it is necessary to first collect the grayscale image of the surface of the insulation layer and the grayscale image of the distance of the insulation layer. The specific process is as follows:
[0041] The distance from the surface of the metal insulation layer to the camera is measured by a depth camera, and the distance is converted into a grayscale value to obtain a grayscale image of the insulation layer distance. A high-resolution camera is used to capture the surface image of the metal insulation layer to obtain a surface image of the insulation layer. The surface image of the insulation layer is filtered and denoised using wavelet transform to obtain a grayscale image of the insulation layer surface.
[0042] Among them, wavelet transformation is a prior art, and this embodiment will not be described in detail here.
[0043] S002. Obtain a plurality of connected domains of the grayscale image of the surface of the thermal insulation layer; and obtain the defect connectivity of each connected domain according to the grayscale value distribution of the pixels in each connected domain.
[0044] It should be noted that, due to the differences in reflectivity changes and shape changes of different single or mixed defect areas in the existing technology during the process of detecting surface defects of the metal insulation layer, the existing technology may identify mixed defects as single defects when manually identifying or traditional image segmentation identifies defect types, thereby misjudging the health status of the metal insulation layer. Therefore, it is necessary to construct directional travel matrices in four directions based on the binary grayscale matrix of the target area of the connected domain, analyze the grayscale value change trends of the target area in the four directions, obtain the defect connectivity of the connected domain, and then obtain the overall shape characteristics of the connected domain; thereby, the accuracy of identifying surface defects of the metal insulation layer can be improved.
[0045] Preferably, in some implementations of the embodiments of the present invention, the Otsu threshold segmentation algorithm is used to perform threshold segmentation on the grayscale image of the surface of the insulation layer to obtain a binary image of the surface of the insulation layer; a gradient image of the grayscale image of the surface of the insulation layer is obtained, and a watershed segmentation algorithm is performed on the gradient image of the grayscale image of the surface of the insulation layer to obtain multiple regions of the grayscale image of the surface of the insulation layer, and each region is used as a connected domain, thereby obtaining several connected domains of the grayscale image of the surface of the insulation layer.
[0046] Among them, the Otsu threshold segmentation algorithm and the watershed segmentation algorithm are existing technologies, and will not be described in detail in this embodiment.
[0047] It should be noted that due to the sensitivity of image edge details and noise, some edge details are blurred, and it is therefore impossible to determine the authenticity of the edge of each connected domain of the grayscale image of the insulation layer surface. Therefore, in an embodiment of the present invention, for any connected domain of the grayscale image of the insulation layer surface, the area formed by the minimum circumscribed rectangle of the connected domain is recorded as the target area of the connected domain, and the binary grayscale matrix of the target area of the connected domain is obtained using the binary image of the insulation layer surface.
[0048] It should be noted that by analyzing the grayscale value change trend of the target area of the connected domain in the four neighborhood directions based on the binary grayscale matrix of the target area of the connected domain, the defect connectivity of the connected domain is obtained, and then the overall shape characteristics of the connected domain are obtained; thereby, the accuracy of identifying surface defects of the metal insulation layer can be improved; since the overall shape of the connected domain can be accurately analyzed through the defect connectivity, it is necessary to obtain the defect connectivity of the connected domain.
[0049] In the embodiment of the present invention, in the grayscale image of the surface of the thermal insulation layer In the direction of the jth four neighbors of the connected domain, and In the binary grayscale matrix of the target area of the connected domain, the number of pixels with the same grayscale value appearing consecutively each time is recorded as The length of a run in the direction of the jth four neighbors of a connected domain;
[0050] Get the The first The calculation formula of the defect connectivity factor of a pixel is:
[0051] ;
[0052] In the formula, Indicates The first Pixel defect connectivity factor; The number of directions representing the directions of the four neighbors; Indicated in In the direction of the jth four neighbors of the connected domain, through the The run length of pixels; Indicated in The number of all the path lengths in the directions of the jth four neighbors of a connected domain; Indicated in The jth four-neighborhood direction of the connected domain The number of times a run length occurs; Indicated in The jth four-neighborhood direction of the connected domain Stroke length.
[0053] The first The mean of the defect connectivity factors of all pixels in the connected domain is taken as the The defect connectivity of a connected domain.
[0054] It should be noted that the defect connectivity of a connected domain indicates the difference in ductility of the connected domain in the four neighboring directions. The larger the difference, the more slender the shape of the connected domain, and the smaller the difference, the more rounded it is. Therefore, the smaller the defect connectivity, the greater the possibility that the defect is a scratch or a crack; the larger the defect connectivity, the greater the possibility that the defect is a protrusion, a depression, peeling, or a spot.
[0055] S003. According to the grayscale difference and distance between the pixel point and the adjacent pixel point in the grayscale image of the insulation layer distance of the connected domain, the depth change rate of the pixel point in each four-neighborhood direction is obtained; according to the difference in the depth change rate between the pixel points in each four-neighborhood direction, the defect smoothness of each connected domain is obtained; according to the defect connectivity and defect smoothness of each connected domain, the defect score of each connected domain is obtained.
[0056] It should be noted that due to the different depth changes between the mixed defect area and the single defect area, when the existing technology detects surface defects based on the trend of image pixel value changes, the mixed defect area will be identified as only a single defect with a larger area. Based on the depth change of the pixel points in the grayscale image of the insulation layer, the depth change rate feature is obtained, and then the depth change trend of the connected domain in the four neighborhood directions is analyzed; according to the differences in the depth change trends of different defects in different directions, the depth defect smoothness is comprehensively obtained, and then the mixing situation of surface defects detected based on the image pixel value change trend can be analyzed, so as to achieve more accurate defect recognition; and the defect recognition performed under this comprehensive depth feature can more accurately identify the defect mixing situation of the connected domain, so it is necessary to construct the defect smoothness based on the depth feature of the connected domain.
[0057] In the embodiment of the present invention, according to the position of the connected domain in the insulation layer surface grayscale image, the area corresponding to the position of the connected domain in the insulation layer distance grayscale image is used as the connected domain of the insulation layer distance grayscale image.
[0058] For any pixel point in any connected domain of the insulation layer distance grayscale image, in any four neighborhood directions, the neighboring pixel points of the pixel point in the four neighborhood directions are recorded as the target pixel points of the pixel point in the four neighborhood directions; the difference in grayscale value between the pixel point and its target pixel points in the four neighborhood directions is recorded as the first difference; the Euclidean distance between the pixel point and its target pixel points in the four neighborhood directions is recorded as the first distance; the ratio of the first difference to the first distance is taken as the depth change rate of the pixel point in the four neighborhood directions;
[0059] The specific formula is:
[0060] ;
[0061] In the formula, The grayscale image of the insulation layer distance The first The depth change rate of a pixel in the jth four-neighborhood direction; The grayscale image of the insulation layer distance The first The gray value of each pixel; The grayscale image of the insulation layer distance The first The gray value of the target pixel in the jth four-neighborhood direction; The grayscale image of the insulation layer distance The first The Euclidean distance between a pixel and its target pixel in the jth four-neighborhood direction.
[0062] It should be noted that if the depth change rates of the adjacent pixels before and after the pixel point have opposite signs, then the pixel point is the center of gravity of the defect. According to the difference in the depth change rates of the pixels around the center of gravity of the defect, the accuracy of defect recognition can be improved; and when the depth change rate changes from positive to negative in the four neighborhood directions, the probability that the connected domain is a convex defect is higher, and the depth change rate changes from negative to positive, the probability that the connected domain is a concave or peeling defect is higher.
[0063] It should be noted that due to the complexity of the depth variation of compound defects, multiple defect centroids will be identified when identifying the defect centroid, and the differences in the depth change rates around different centroids will lead to errors in defect identification; therefore, it is necessary to calculate the defect smoothness factor of the connected domain in each of the four neighborhood directions.
[0064] In the embodiment of the present invention, for the insulation layer distance grayscale image In the jth four-neighborhood direction, a connected domain consists of several sets of pixels with the same absolute value of the depth change rate, all of which are recorded as The depth change set of a connected domain in the direction of the jth four neighborhoods;
[0065] For The connected domain is in the direction of the jth four neighbors. A set of depth changes, The first pixel in the depth change set is taken as the starting point. Within the eight neighborhoods of the pixel, the pixels with the same absolute value of the depth change rate as the pixel are recorded as neighborhood pixels. In the jth four neighborhood directions, the maximum number of consecutive neighborhood pixels is taken as the jth neighborhood pixel. The neighborhood itinerary of a connected domain in the jth four-neighborhood direction.
[0066] Get the The connected domain is in the direction of the jth four neighbors. The calculation formula for the local defect smoothness of a depth variation set is:
[0067] ;
[0068] In the formula, Indicates The connected domain is in the direction of the jth four neighbors. The local defect smoothness of a set of depth variations; Indicates The defect connectivity of a connected domain; Indicates The connected domain is in the direction of the jth four neighbors. Neighborhood itinerary of a set of depth changes; Indicates The connected domain is in the direction of the jth four neighbors. The number of all pixels in a depth change set.
[0069] Get the The calculation formula of the defect smoothness factor of a connected domain in the direction of the jth four neighborhoods is:
[0070] ;
[0071] In the formula, Indicates The defect smoothness factor of a connected domain in the direction of the jth four neighbors; Indicates The number of all depth change sets of a connected domain in the jth four-neighborhood direction; Indicates The connected domain is in the direction of the jth four neighbors. The local defect smoothness of a set of depth variations; Indicates The connected domain is in the direction of the jth four neighbors. The number of all pixels in a depth change set; Indicates The connected domain is in the direction of the jth four neighbors. The depth change rate of the pixels in the depth change set; Indicates The mean of all depth change rates of a connected domain in the jth four neighborhood directions; Indicates The number of all foreground pixels in a connected region.
[0072] Get the The calculation formula of the defect smoothness of a connected domain is:
[0073] ;
[0074] In the formula, Indicates Defect smoothness of connected domains; The number of directions representing the directions of the four neighborhoods; Indicates The defect smoothness factor of a connected domain in the direction of the jth four neighbors; Indicates The mean value of the defect smoothness factor of a connected domain in all four neighborhood directions; Indicates taking the absolute value.
[0075] It should be noted that the greater the difference in depth change rate, the less smooth it is, the smaller the defect smoothness is, and the greater the probability of a complex defect; the smaller the difference in change rate, the smoother the defect, the greater the smoothness is, and the smaller the probability of a complex defect; that is, the greater the difference in defect smoothness of the connected domain in the four neighborhood directions, the greater the difference in depth change rate.
[0076] In the embodiment of the present invention, according to the defect smoothness and defect connectivity of the connected domain, the calculation formula for obtaining the defect score of the connected domain is:
[0077] ;
[0078] In the formula, represents the defect score of the connected domain; Indicates the defect connectivity of the connected domain; Indicates the defect smoothness of the connected domain; Represents the number of all pixels in the connected domain; Represents the number of all pixels in the grayscale image of the insulation layer surface.
[0079] It should be noted that a larger defect score indicates a greater degree of damage to the insulation layer, and a smaller defect score indicates a smaller degree of damage to the insulation layer.
[0080] S004. Perform defect detection on the surface of the insulation layer according to the defect score of the connected domain.
[0081] Preferably, in some implementations of the embodiments of the present invention, after the defect score corresponding to each connected domain in the grayscale image of the surface of the insulation layer is marked, it is input into a trained neural network to obtain the defect type corresponding to each connected domain in the grayscale image of the surface of the insulation layer; wherein the neural network used in this embodiment is YOLOv3, and the method for obtaining the data set for training the neural network is:
[0082] A large number of grayscale images of the surface of the insulation layer are collected, and the defect score and the corresponding defect type of each connected domain in each grayscale image of the surface of the insulation layer are manually marked, and the marking result is recorded as the label of each grayscale image of the surface of the insulation layer; a large number of grayscale images of the surface of the insulation layer and their corresponding labels are collected to form a data set; the neural network is trained using the data set, and the loss function used in the training process is a cross loss function; the specific training process is a well-known content of the neural network, and the specific training process will not be repeated in this embodiment.
[0083] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting surface defects of a metal insulation layer, characterized in that: include: Collecting grayscale images of the surface of the insulation layer and grayscale images of the distance of the insulation layer; Obtain each connected domain of the grayscale image of the surface of the insulation layer; The mean value of the defect connectivity factor of each pixel in each connected domain of the grayscale image of the surface of the insulation layer is taken as the defect connectivity of each connected domain of the grayscale image of the surface of the insulation layer; each connected domain in the grayscale image of the surface of the insulation layer is corresponded to the grayscale image of the distance of the insulation layer to obtain each connected domain of the grayscale image of the distance of the insulation layer; the defect smoothness of each connected domain of the grayscale image of the distance of the insulation layer is obtained: ; The number of directions representing the directions of the four neighbors; Indicates The defect smoothness factor of a connected domain in the direction of the jth four neighbors; Indicates The mean value of the defect smoothness factor of a connected domain in all four neighborhood directions; Indicates taking the absolute value; Get the defect score of each connected domain ; Indicates the defect connectivity of the connected domain; Indicates the defect smoothness of the connected domain; Represents the number of all pixels in the connected domain; Represents the number of all pixels in the grayscale image of the insulation layer surface; Defect detection on the surface of the insulation layer is performed according to the defect score of the connected domain; The acquisition of the defect smoothness factor includes: ; In the formula, Indicates The number of all depth change sets of a connected domain in the jth four-neighborhood direction; Indicates The connected domain is in the direction of the jth four neighbors. The local defect smoothness of a set of depth variations; Indicates The connected domain is in the direction of the jth four neighbors. The number of all pixels in a depth change set; Indicates The connected domain is in the direction of the jth four neighbors. The depth change rate of the pixels in the depth change set; Indicates The mean of all depth change rates of a connected domain in the jth four neighborhood directions; Indicates The number of all pixels in a connected region.
2. A method for detecting surface defects of a metal insulation layer according to claim 1, characterized in that: The defect connectivity factor of each pixel point in each connected domain of the grayscale image of the surface of the thermal insulation layer is obtained, including: ; In the formula, Indicates The first Pixel defect connectivity factor; The number of directions representing the directions of the four neighbors; Indicated in In the direction of the jth four neighbors of the connected domain, through the The run length of pixels; as well as Indicated in The number of all run lengths in the directions of the jth four neighbors of the connected domain and the number of The jth four-neighborhood direction of the connected domain The number of times a run length occurs; Indicated in The jth four-neighborhood direction of the connected domain Stroke length.
3. A method for detecting surface defects of a metal insulation layer according to claim 2, characterized in that: The acquisition of the stroke length includes: The Otsu threshold segmentation algorithm is used to perform threshold segmentation on the grayscale image of the insulation layer surface to obtain a binary image of the insulation layer surface. connected domain, The area formed by the minimum circumscribed rectangle of the connected domain is recorded as The target area of the connected domain is obtained by using the binary image of the insulation layer surface. The binary grayscale matrix of the target area of the connected domain; In the grayscale image of the insulation layer surface In the direction of the jth four neighbors of the connected domain, and In the binary grayscale matrix of the target area of the connected domain, the number of pixels with the same grayscale value appearing consecutively each time is recorded as The length of a run in the direction of the jth four neighbors of a connected domain.
4. A method for detecting surface defects of a metal insulation layer according to claim 1, characterized in that: The acquisition of the depth change set includes: For the insulation layer distance grayscale image In the jth four-neighborhood direction, a connected domain consists of several sets of pixels with the same absolute value of the depth change rate, all of which are recorded as The depth change set of a connected domain in the direction of the jth four neighbors.
5. A method for detecting surface defects of a metal insulation layer according to claim 1 or 4, characterized in that: The acquisition of the local defect smoothness of the depth variation set includes: Obtain the neighborhood travel of each connected domain of the insulation layer distance grayscale image in each of the four neighborhood directions; ; In the formula, Indicates The connected domain is in the direction of the jth four neighbors. The local defect smoothness of a set of depth variations; Indicates The defect connectivity of a connected domain; Indicates The connected domain is in the direction of the jth four neighbors. Neighborhood itinerary of a set of depth changes; Indicates The connected domain is in the direction of the jth four neighbors. The number of all pixels in a depth change set.
6. A method for detecting surface defects of a metal insulation layer according to claim 1, characterized in that: The acquisition of the depth change rate of the pixel point includes: For any pixel point in any connected domain of the insulation layer distance grayscale image, in any four neighborhood directions, the adjacent pixel points of the pixel point in the four neighborhood directions are recorded as the target pixel points of the pixel point in the four neighborhood directions; the difference in grayscale values between the pixel point and its target pixel points in the four neighborhood directions is recorded as the first difference; the Euclidean distance between the pixel point and its target pixel points in the four neighborhood directions is recorded as the first distance; and the ratio of the first difference to the first distance is used as the depth change rate of the pixel point in the four neighborhood directions.
7. A method for detecting surface defects of a metal insulation layer according to claim 5, characterized in that: The specific method of obtaining the neighborhood travel of each connected domain of the insulation layer distance grayscale image in each of the four neighborhood directions includes: For The connected domain is in the direction of the jth four neighbors. A set of depth changes, The first pixel in the depth change set is taken as the starting point. Within the eight neighborhoods of the pixel, the pixels with the same absolute value of the depth change rate as the pixel are recorded as neighborhood pixels. In the jth four neighborhood directions, the maximum number of consecutive neighborhood pixels is taken as the jth neighborhood pixel. The neighborhood itinerary of a connected domain in the jth four-neighborhood direction.
Citation Information
Patent Citations
Image threshold segmentation algorithm
CN110097566A
Vacuum cup surface defect detection method based on image features
CN117237355A
Cylinder cover quality detection method and system
CN117252882A