Protector double-gold-piece detection method based on machine vision

By acquiring the bimetallic surface image, preprocessing and threshold segmentation, calculating the lighting interference evaluation coefficient, adjusting the adaptive cropping parameters for image enhancement, the problem of lighting interference in CNN neural network detection is solved, and the accuracy of bimetallic corrosion detection is improved.

CN120259288AActive Publication Date: 2025-07-04GUANGZHOU SENBAO ELECTRICAL APPLIANCES

Patent Information

Application Number
CN202510732887.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-07-04
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

In the prior art, when using CNN neural network to detect surface corrosion of bimetallic sheets, the interference of reflected light causes the detection accuracy to decrease, making it difficult to effectively identify the corrosion area.

Method used

By acquiring the bimetallic surface image, pre-processing and threshold segmentation, the grayscale brightness and edge texture feature values of the segmented area are obtained, the lighting interference evaluation coefficient is calculated, the adaptive cropping parameters are adjusted for image enhancement, and the enhanced grayscale image is used for corrosion detection.

Benefits of technology

It improves the accuracy of surface corrosion detection of bimetallic sheets, effectively eliminates light interference, enhances the characteristics of corrosion areas, and improves the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259288A_ABST
    Figure CN120259288A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image enhancement, in particular to a protector bimetallic strip detection method based on machine vision, and the method comprises the steps: obtaining a surface image of a bimetallic strip, and carrying out the preprocessing of the surface image, and obtaining a gray image; performing threshold segmentation on the grayscale image to obtain at least one segmentation region; obtaining an evaluation coefficient of each segmented region, obtaining an adaptive cutting parameter when contrast-limited adaptive histogram equalization is carried out on each segmented region according to the evaluation coefficient of each segmented region, and carrying out image enhancement on each segmented region in the grayscale image according to the adaptive cutting parameter to obtain an enhanced grayscale image; the corrosion detection result in the bimetallic strip is obtained by using the enhanced gray level image, so that the enhanced image can reflect more effective information, and the surface corrosion detection precision of the bimetallic strip according to the enhanced image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image enhancement, and in particular to a method for detecting double metal sheets of a protector based on machine vision. Background Art

[0002] The double metal sheet of the protector is a core component working based on the principle of thermal expansion and is widely used in electrical equipment and household appliances. Its function is to achieve overload protection and temperature control through the characteristics of temperature-sensitive sensors. Therefore, its quality problems will directly affect the overheat protection function of the equipment. Since the bimetal sheet is generally composed of two metals with different coefficients of thermal expansion (such as nickel-manganese alloy + nickel-iron alloy), although this type of material has high thermal sensitivity and resistivity, its own corrosion resistance is poor. In addition, the difference in alloy composition leads to galvanic corrosion in corrosive media, and the metal layer with a lower potential (anode) will accelerate corrosion. At the same time, the material is more sensitive to high-temperature and high-humidity environments and corrosive gases, which will exacerbate the severity of metal surface corrosion. Therefore, accurately identifying and detecting surface corrosion problems is crucial for the quality inspection and evaluation of bimetal sheets.

[0003] In the prior art, the surface corrosion detection and positioning of bimetal sheets are carried out through the CNN neural network in machine learning. The specific process is as follows: training a binary classification model to automatically learn corrosion features to determine whether there is corrosion in the surface image of the currently collected bimetal sheet. However, in the actual processing process, due to the existence of free electrons on the surface of this type of metal, the incident light will be effectively concentrated and reflected back to produce a metallic luster phenomenon on its surface, resulting in uneven brightness or shadow effects in the surface image, and then causing the corrosion area features to change or weaken, making the corrosion detection results obtained by using the CNN neural network have a large deviation.

[0004] Therefore, how to eliminate the interference of reflected light and improve the accuracy of using the CNN neural network to detect the surface corrosion of bimetal sheets has become an urgent problem to be solved. Summary of the Invention

[0005] In view of this, an embodiment of the present invention provides a method for detecting double metal sheets of a protector based on machine vision to solve the problem of how to eliminate the interference of reflected light and improve the accuracy of using the CNN neural network to detect the surface corrosion of bimetal sheets.

[0006] An embodiment of the present invention provides a method for detecting double metal sheets of a protector based on machine vision, and the method includes the following steps: Obtain the surface image of the bimetal sheet, preprocess the surface image to obtain a grayscale image; perform threshold segmentation on the grayscale image to obtain at least one segmentation region; For any segmentation region, based on the gray value distribution of the pixel points in the any segmentation region, obtain the regional gray brightness feature value. Based on the gray level co-occurrence matrix of the any segmentation region and the gradient value of each edge pixel point, obtain the edge texture feature value. Based on the regional gray brightness feature value and the edge texture feature value, obtain the evaluation coefficient of the any segmentation region being affected by light interference; Obtain the evaluation coefficient of each segmentation region. Based on the evaluation coefficient of each segmentation region, obtain the adaptive cropping parameter when performing limited contrast adaptive histogram equalization on each segmentation region. Image enhancement is performed on each segmentation region in the grayscale image according to the adaptive cropping parameter to obtain the enhanced grayscale image; Use the enhanced grayscale image to obtain the corrosion detection result in the bimetal sheet.

[0007] Preferably, the obtaining of the regional gray brightness feature value based on the gray value distribution of the pixel points in the any segmentation region includes: Based on the gray value of each pixel point in the any segmentation region, obtain the overall gray distribution evaluation value; construct the gray value change curve of the any segmentation region, where the horizontal axis of the gray value change curve is the gray value and the vertical axis is the number of pixel points. Based on the fluctuation characteristics of the gray value change curve, obtain the histogram distribution evaluation value; Based on the maximum value between the overall gray distribution evaluation value and the histogram distribution evaluation value, obtain the regional gray brightness feature value.

[0008] Preferably, the obtaining of the overall gray distribution evaluation value based on the gray value of each pixel point in the any segmentation region includes: Based on the gray value of each pixel point in the any segmentation region, calculate the average gray value, and use the ratio of the average gray value to the maximum gray value as the overall gray distribution evaluation value.

[0009] Preferably, the obtaining of the histogram distribution evaluation value based on the fluctuation characteristics of the gray value change curve includes: Obtain the local maximum peak points in the gray value change curve, sort the ordinate values of each local maximum peak point in descending order to obtain an ordinate value sequence, and use the local maximum peak points corresponding to the first two elements in the ordinate value sequence as the peak points to be analyzed; Based on the gray value corresponding to each peak point to be analyzed, calculate the absolute value of the gray value difference, obtain the absolute value of the difference between the absolute value of the gray value difference and the preset reference gray difference value, and normalize the absolute value of the difference using a preset exponential function to obtain the corresponding normalized value; Obtain the proportion of the total number of pixel points corresponding to all peak points to be analyzed in the total number of pixel points in any one of the segmentation regions, and perform weighted summation on the proportion and the normalization value to obtain the histogram distribution evaluation value.

[0010] Preferably, obtaining the edge texture feature value according to the gray-level co-occurrence matrix of any one of the segmentation regions and the gradient value of each edge pixel point includes: Obtain the gray-level co-occurrence matrix of any one of the segmentation regions, and obtain the texture distribution feature evaluation value of any one of the segmentation regions according to the gray-level co-occurrence matrix; Perform edge detection on any one of the segmentation regions to obtain an initial edge, use curve fitting to repair the edge discontinuity of the initial edge to obtain a complete edge, and obtain the edge distribution feature evaluation value of any one of the segmentation regions according to the number of edge pixel points of the initial edge and the gradient value of each edge pixel point of the complete edge; Obtain the edge texture feature value according to the mean value of the texture distribution feature evaluation value and the edge distribution feature evaluation value.

[0011] Preferably, obtaining the texture distribution feature evaluation value of any one of the segmentation regions according to the gray-level co-occurrence matrix includes: Obtain the entropy value of the gray-level co-occurrence matrix, normalize the entropy value using the hyperbolic tangent function to obtain a normalized entropy value, and record the difference between the constant 1 and the normalized entropy value as the texture distribution feature evaluation value.

[0012] Preferably, obtaining the edge distribution feature evaluation value of any one of the segmentation regions according to the number of edge pixel points of the initial edge and the gradient value of each edge pixel point of the complete edge includes: Calculate the quantity ratio between the number of edge pixel points of the initial edge and the number of edge pixel points of the complete edge, calculate the mean value of the gradient values of all edge pixel points of the complete edge, normalize the mean value of the gradient values to obtain a normalized mean value, perform weighted summation on the quantity ratio and the normalized mean value to obtain a weighted summation result, and record the difference between the constant 1 and the weighted summation result as the edge distribution feature evaluation value of any one of the segmentation regions.

[0013] Preferably, obtaining the evaluation coefficient of the illumination interference of any one of the segmentation regions according to the regional gray-level brightness feature value and the edge texture feature value includes: Record the mean value of the regional gray-level brightness feature value and the edge texture feature value as the evaluation coefficient of the illumination interference of any one of the segmentation regions.

[0014] Preferably, obtaining the adaptive cropping parameter for performing contrast-limited adaptive histogram equalization on each of the segmentation regions according to the evaluation coefficient of each of the segmentation regions includes: For any one of the segmentation regions, if the evaluation coefficient of the any one of the segmentation regions is less than or equal to a preset evaluation coefficient threshold, the adaptive cropping parameter for performing contrast-limited adaptive histogram equalization on the any one of the segmentation regions is obtained by using a first piecewise function, where the calculation expression of the first piecewise function is , represents the adaptive cropping parameter, represents the evaluation coefficient, and 0.5 represents the evaluation coefficient threshold.

[0015] Preferably, obtaining the adaptive cropping parameter for performing contrast-limited adaptive histogram equalization on each of the segmentation regions according to the evaluation coefficient of each of the segmentation regions further includes: If the evaluation coefficient of the any one of the segmentation regions is greater than the preset evaluation coefficient threshold, the adaptive cropping parameter for performing contrast-limited adaptive histogram equalization on the any one of the segmentation regions is obtained by using a second piecewise function, where the calculation expression of the second piecewise function is .

[0016] The beneficial effects of the embodiments of the present invention compared with the prior art are: The present invention obtains the surface image of a bimetallic strip, preprocesses the surface image to obtain a grayscale image, performs threshold segmentation on the grayscale image to obtain at least one segmentation region, for any one of the segmentation regions, according to the gray value distribution of the pixel points in the any one of the segmentation regions, obtains the regional gray brightness feature value, according to the gray-level co-occurrence matrix of the any one of the segmentation regions and the gradient value of each edge pixel point, obtains the edge texture feature value, and according to the regional gray brightness feature value and the edge texture feature value, obtains the evaluation coefficient of the any one of the segmentation regions being affected by light interference; obtains the evaluation coefficient of each of the segmentation regions, according to the evaluation coefficient of each of the segmentation regions, obtains the adaptive cropping parameter when performing limited contrast adaptive histogram equalization on each of the segmentation regions, and performs image enhancement on each segmentation region in the grayscale image according to the adaptive cropping parameter to obtain an enhanced grayscale image; uses the enhanced grayscale image to obtain the corrosion detection result in the bimetallic strip. Among them, the surface image of the bimetallic strip is adaptively divided into multiple segmentation regions by the Otsu method, and according to the evaluation coefficient of the degree of light interference received by each segmentation region, the adaptive cropping parameter of each segmentation region when performing limited contrast adaptive histogram equalization on the surface image is obtained, so that when the light interference is severe, the cropping parameter is increased to enhance the detail contrast, and when the light interference is relatively light, the cropping parameter is decreased to avoid excessive enhancement of a small amount of noise, so that the enhanced image can reflect more effective information, thereby improving the accuracy of surface corrosion detection of the bimetallic strip based on the enhanced image. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0018] Figure 1 is a flowchart of a method for detecting a double-metal sheet of a protector based on machine vision provided in Embodiment 1 of the present invention; Figure 2 is a schematic diagram of a bimetallic strip provided in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] The following will describe in detail the embodiments of the present disclosure, and the examples of the embodiments are shown in the drawings. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present disclosure and should not be construed as limiting the present disclosure.

[0020] It should be noted that the terms "first", "second", etc. in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure.

[0021] In order to illustrate the technical solution of the present invention, the following will be described through specific embodiments.

[0022] See Figure 1 , which is a method flowchart of a method for detecting double metal sheets of a protector based on machine vision provided in the first embodiment of the present invention. As Figure 1 shown, the method may include: Step S101, obtain a surface image of the bimetal sheet, preprocess the surface image to obtain a grayscale image; perform threshold segmentation on the grayscale image to obtain at least one segmentation region.

[0023] In the embodiment of the present invention, the position and angle of the light source on the detection platform are set to capture the surface image of the bimetal sheet as shown in Figure 2 . The specific setting process is as follows: Select an LED light source or a halogen light source to ensure good light source stability and adjustable brightness, and set the light source on the side or above the detection platform. The light source angle is generally 35 degrees to 45 degrees higher than the main body (this is the default industry conventional parameter setting and can be adjusted according to specific circumstances). At this time, a small amount of shadow can be generated on the captured main body, relatively enhancing the three-dimensional sense. The height of the light source should be higher than the horizon of the captured main body, but it should be noted that it cannot be too high to avoid generating too many shadows.

[0024] After setting the position and angle of the light source, use a high-resolution industrial camera to capture the surface image of the bimetal sheet to ensure that more detailed features on the surface of the bimetal sheet can be captured. During the shooting process, parameters such as the camera focal length and exposure time need to be adjusted to ensure that the surface image with the best image quality is obtained. It should be noted that when capturing the surface image of the bimetal sheet, ensure that the upper surface of the detection platform is flat and unobstructed.

[0025] After obtaining the surface image of the bimetal sheet, preprocess the surface image to obtain a grayscale image. The specific preprocessing process is as follows: First, use denoising algorithms such as Gaussian filtering and median filtering to eliminate the noise in the image, and then perform grayscale processing on the image to obtain the corresponding grayscale image. This preprocessing method can reduce the subsequent calculation amount and ensure the quality of the grayscale image to the greatest extent.

[0026] The Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm is an image enhancement technique aimed at improving the local contrast of an image while avoiding the over-amplification of noise. The CLAHE algorithm is a variant of the Adaptive Histogram Equalization (AHE), which avoids the problem of over-amplification of noise that may be caused by AHE by limiting the increase in contrast. The basic idea of the CLAHE algorithm is to divide the image into multiple non-overlapping small blocks, perform histogram equalization on each small block separately, and then combine the equalization results of these small blocks through an interpolation method to form the final enhanced image.

[0027] In the embodiments of the present invention, considering that there are free electrons on the surface of the bimetallic strip, when the image is collected, the incident light will be effectively concentrated and reflected back to produce a metallic luster phenomenon on the surface, resulting in uneven brightness or shadow effects in the grayscale image, which causes the characteristics of the corrosion area to change or weaken. Therefore, the CLAHE algorithm is used to enhance the grayscale image, and the enhanced grayscale image is used to detect the corrosion of the bimetallic strip.

[0028] Under normal circumstances, in the CLAHE algorithm, the image is evenly divided into multiple non-overlapping small blocks. However, in the embodiments of the present invention, in order to detect the corrosion area and enhance the corrosion characteristics in the grayscale image, the Otsu Adaptive Thresholding (OTSU) algorithm is used to perform threshold segmentation on the grayscale image to obtain at least one segmentation area to distinguish the foreground and background in the grayscale image. Among them, the OTSU algorithm is a method for automatically calculating the threshold, which finds the optimal segmentation threshold by maximizing the between-class variance, divides the image into the foreground and background parts, so that the between-class variance between these two parts is the largest and the within-class variance is the smallest. The OTSU algorithm belongs to the prior art and will not be elaborated here.

[0029] After obtaining all the segmentation areas, preprocessing can also be performed on each segmentation area. The specific process is to use morphological opening operation to eliminate isolated noise points, and then use morphological closing operation to fill holes and optimize the region boundary to optimize each segmentation area. The preprocessing process belongs to the prior art and will not be elaborated in detail here.

[0030] Step S102, for any one of the segmentation areas, according to the gray value distribution of the pixel points in any one of the segmentation areas, obtain the regional gray brightness feature value, and according to the gray-level co-occurrence matrix of any one of the segmentation areas and the gradient value of each edge pixel point, obtain the edge texture feature value. According to the regional gray brightness feature value and the edge texture feature value, obtain the evaluation coefficient of any one of the segmentation areas being affected by light interference.

[0031] In the CLAHE algorithm, there is an important parameter called "clipLimit", which is referred to as the clipping parameter in the embodiments of the present invention. It is used to set the threshold for the gray-level distribution in the histogram. When the number of pixel points at a certain gray level exceeds this threshold, the excess pixels will be clipped and evenly distributed to other gray levels, which can limit the increase in contrast and thus avoid the over-amplification of noise. When using the CLAHE algorithm for image enhancement, its enhancement effect largely depends on the selection of the clipping parameter. A smaller value will limit the enhancement of contrast and thus reduce the amplification of noise, while a larger value will enhance the contrast but may introduce more noise. However, the selection of the clipping parameter usually depends on experience, and different clipping parameter settings may be required for different images and application scenarios. Therefore, in the embodiments of the present invention, in order to exclude the light interference on the surface of the bimetallic strip and improve the enhancement effect of the grayscale image using the CLAHE algorithm, an adaptive clipping parameter is set for each segmentation region according to the pixel information contained in each segmentation region to meet the requirements of the current application scenario.

[0032] When the light reflection is too strong, the contrast between the corrosion region and the normal metal region in the grayscale image decreases, which will mask the corrosion details or cause the distortion of the corrosion region morphology. Therefore, in the embodiments of the present invention, first, an evaluation is performed by judging the change in the internal gray-level distribution of each segmentation region. For example, assume that any segmentation region is an overexposed region, and the local or overall gray-level value of this segmentation region is close to saturation (such as 255) and loses details. The light interference does not completely cover this segmentation region, and its local is close to saturation. If it is completely covered, its overall is close to saturation. Secondly, the degree of light interference on each segmentation region can be comprehensively analyzed through features such as the blurring degree of the internal texture of each segmentation region (the rough texture of the corrosion region caused by uneven light, such as pitting and intergranular corrosion, is smoothed) and edge breakage (the corrosion boundary is discontinuous due to reflection or shadow, and there are breakpoints in the Canny edge detection). The larger the evaluation coefficient, the greater the degree of light interference.

[0033] Taking any segmentation region as an example, the method for obtaining the evaluation coefficient of the light interference on the any segmentation region is as follows: (1)According to the gray-level value distribution of the pixel points in any segmentation region, obtain the regional gray-level brightness feature value.

[0034] Specifically, first, according to the gray-level value of each pixel point in the any segmentation region, calculate the gray-level value mean, and take the ratio of the gray-level value mean to the maximum gray-level value as the overall gray-level distribution evaluation value. The calculation formula for the overall gray-level distribution evaluation value is:

[0035] Among them, Represents the overall grayscale distribution evaluation value, Represents the number of pixel points in any segmentation region I, Represents the grayscale value of the i-th pixel point in any segmentation region I, and 255 represents the maximum grayscale value.

[0036] It should be noted that the larger the average grayscale value of any segmentation region I, the stronger the possible illumination interference degree of any segmentation region I, and the corresponding overall grayscale distribution evaluation value is larger.

[0037] Then, construct the grayscale value change curve of any segmentation region. Among them, the horizontal axis of the grayscale value change curve is the grayscale value, and the vertical axis is the number of pixel points. Use the binary search method to obtain the local maximum peak point in the grayscale value change curve, which belongs to the prior art and will not be elaborated here. Sort the ordinate values of each local maximum peak point in descending order to obtain the ordinate value sequence, and use the local maximum peak points corresponding to the first two elements in the ordinate value sequence as the peak points to be analyzed; According to the grayscale value corresponding to each peak point to be analyzed, calculate the absolute value of the grayscale value difference, obtain the absolute value of the difference between the absolute value of the grayscale value difference and the preset reference grayscale difference value, and use the preset exponential function to normalize the absolute value of the difference to obtain the corresponding normalized value; Obtain the proportion of the sum of the number of pixel points corresponding to all peak points to be analyzed in the total number of pixel points in any segmentation region, and perform weighted summation on the proportion and the normalized value to obtain the histogram distribution evaluation value.

[0038] Among them, the calculation formula of the histogram distribution evaluation value is:

[0039] Among them, Represents the histogram distribution evaluation value, Represents the first weight, Represents the number of pixel points corresponding to the first peak point to be analyzed, Represents the number of pixel points corresponding to the second peak point to be analyzed, Represents the total number of pixel points in any segmentation region I, Represents the second weight, Represents the exponential function with the natural constant as the base, Represents the grayscale value corresponding to the first peak point to be analyzed, Represents the grayscale value corresponding to the second peak point to be analyzed, Represents the reference grayscale difference value, Represents the difference value symbol.

[0040] It should be noted that, The larger the value, the stronger the dominance of these two peak points to be analyzed in the gray value change curve, the higher the proportion of the number of pixel points, and the more serious the polarization of the gray values in any segmentation region I, and the light interference does not completely cover, which belongs to local near saturation, and the corresponding histogram distribution evaluation value is larger; The larger the value, the greater the interval between the two peak points to be analyzed, the larger the peak distance, and the easier the two peak points are to distinguish. Based on experimental statistics is set to the default value of 50, which is used to measure the gray difference degree between the two peak points to be analyzed. The smaller the value, the smaller the difference between the gray value difference between the two peak points to be analyzed and the constant The smaller the difference, the less incomplete the light interference, the closer to local saturation, and the larger the corresponding histogram distribution evaluation value. Considering that the histogram distribution evaluation value is expanded from two dimensions, the weights of the two dimensions are set to be the same. Therefore, is not displayed here and can be adjusted according to the actual situation.

[0041] Finally, according to the maximum value between the overall gray distribution evaluation value and the histogram distribution evaluation value, the regional gray brightness characteristic value is obtained. Among them, the calculation formula of the regional gray brightness characteristic value is: , represents the regional gray brightness characteristic value of any segmentation region I. represents the maximum value function.

[0042] It should be noted that if the light interference completely covers, then the overall gray value of any segmentation region I is close to saturation. At this time tends to 1 more; if the light interference does not completely cover, then any segmentation region I is locally close to saturation. At this time tends to 1 more, that is, there is a serious polarization of pixel gray values in any segmentation region I, which is manifested as obvious bimodal characteristics in the gray value change curve. Finally, the maximum value of the calculation results of the two is selected, which means that in either case, it can be considered that there is an overexposure phenomenon caused by light interference and the degree of light interference is large.

[0043] (2) According to the gray-level co-occurrence matrix of any segmentation region and the gradient value of each edge pixel point, the edge texture characteristic value is obtained.

[0044] Specifically, obtain the gray-level co-occurrence matrix of the any segmentation region, obtain the entropy value of the gray-level co-occurrence matrix, normalize the entropy value using the hyperbolic tangent function to obtain the normalized entropy value, and record the difference between the constant 1 and the normalized entropy value as the texture distribution characteristic evaluation value.

[0045] Among them, the calculation expression of the texture distribution characteristic evaluation value is:

[0046] Among them, represents the evaluation value of the texture distribution feature, 1 represents a constant, represents the hyperbolic tangent function, represents the entropy value of the gray-level co-occurrence matrix, which belongs to the prior art and will not be elaborated here.

[0047] It should be noted that the entropy value can describe the randomness and complexity of the gray-level distribution within any segmentation region I. The larger the entropy value, the more complex the texture within any segmentation region I. If any segmentation region I is affected by light interference, uneven illumination will smooth the rough textures such as pitting and intergranular corrosion in the region, and the texture features will be simpler. Therefore, the larger the entropy value, the smaller the degree of light interference within any segmentation region I, and the smaller the corresponding texture distribution feature evaluation value.

[0048] Use the Canny operator to perform edge detection on the any segmentation region to obtain an initial edge, use curve fitting to repair the edge discontinuity of the initial edge to obtain a complete edge, calculate the quantity ratio between the number of edge pixel points of the initial edge and the number of edge pixel points of the complete edge, calculate the average value of the gradient values of all edge pixel points of the complete edge, normalize the average value of the gradient values to obtain a normalized average value, perform weighted summation on the quantity ratio and the normalized average value to obtain a weighted summation result, and record the difference between the constant 1 and the weighted summation result as the edge distribution feature evaluation value of the any segmentation region.

[0049] Among them, the calculation formula for the edge distribution feature evaluation value is:

[0050] Among them, represents the edge distribution feature evaluation value, 1 represents a constant, represents the first weight coefficient, represents the number of edge pixel points of the initial edge, represents the number of edge pixel points of the complete edge, represents the second weight coefficient, represents the normalization function, represents the average value of the gradient values of all edge pixel points of the complete edge.

[0051] It should be noted that reflection or shadow will cause the region boundary to be discontinuous. Therefore, there will be breakpoints during Canny edge detection. The larger the ratio of the two, the stronger the continuity of the initial edge, the less obvious the fracture feature, the less affected by illumination interference, and the smaller the corresponding edge distribution feature evaluation value; The larger the value, the clearer the edge, the less affected by illumination interference, and the smaller the corresponding edge distribution feature evaluation value. Since the edge distribution feature evaluation value analyzes the edge features from two dimensions, no restrictions are set here, and it can be set according to the actual situation.

[0052] Furthermore, according to the mean value of the texture distribution feature evaluation value and the edge distribution feature evaluation value, an edge texture feature value is obtained, where the edge texture feature value The calculation formula is:

[0053] (3) According to the regional gray-scale brightness feature value and the edge texture feature value, an evaluation coefficient of the illumination interference on any segmentation region is obtained. Preferably, the mean value of the regional gray-scale brightness feature value and the edge texture feature value is denoted as the evaluation coefficient of the illumination interference on any segmentation region. The larger the mean value, the greater the degree of illumination interference on any segmentation region, and the larger the corresponding evaluation coefficient.

[0054] Similarly, the evaluation coefficient of the illumination interference on each segmentation region is obtained.

[0055] Step S103: Obtain the evaluation coefficient of each segmentation region. According to the evaluation coefficient of each segmentation region, obtain the adaptive cropping parameter for performing limited contrast adaptive histogram equalization on each segmentation region. According to the adaptive cropping parameter, perform image enhancement on each segmentation region in the grayscale image to obtain the enhanced grayscale image.

[0056] When the illumination interference is severe, the cropping parameter should be increased to enhance the detail contrast; when the illumination interference is light, the cropping parameter should be decreased to avoid over-enhancing a small amount of noise. Therefore, in the embodiment of the present invention, according to the evaluation coefficient of each segmentation region, the adaptive cropping parameter of each segmentation region is obtained for limited contrast adaptive histogram equalization. The specific obtaining method is: For any segmentation region, if the evaluation coefficient of the any segmentation region is less than or equal to a preset evaluation coefficient threshold, the adaptive cropping parameter for performing limited contrast adaptive histogram equalization on the any segmentation region is obtained by using a first piecewise function, where the calculation expression of the first piecewise function is , represents the adaptive cropping parameter, represents the evaluation coefficient, and 0.5 represents the evaluation coefficient threshold.

[0057] If the evaluation coefficient of any of the segmentation regions is greater than a preset evaluation coefficient threshold, an adaptive cropping parameter for performing limited contrast adaptive histogram equalization on any of the segmentation regions is obtained by using a second piecewise function, where the calculation expression of the second piecewise function is .

[0058] It should be noted that the common cropping parameter setting standard is: the lower cropping parameter range is [1%, 10%], and the higher cropping parameter range is [20%, 40%]. In the embodiments of the present invention, by constructing piecewise functions (the first piecewise function and the second piecewise function), smooth control can be achieved. At the same time, it is ensured that when the evaluation coefficient increases, the cropping parameter increases monotonically. When the evaluation coefficient is 0, the minimum value of the corresponding cropping parameter is 1%, and when the evaluation coefficient is 1, the maximum value of the corresponding cropping parameter is 40%. When the calculation results of the first piecewise function and the second piecewise function are decimals, one decimal place is retained or rounded down to obtain the final adaptive cropping parameter.

[0059] Thus, the adaptive cropping parameter of each segmentation region in the grayscale image can be obtained. Then, limited contrast adaptive histogram equalization is performed on each segmentation region in the grayscale image according to the adaptive cropping parameter of each segmentation region to obtain an enhanced grayscale image. It is worth noting that in the embodiments of the present invention, after obtaining the segmentation region, the cropping parameter in the limited contrast adaptive histogram equalization algorithm is optimized, and other steps remain unchanged. The limited contrast adaptive histogram equalization algorithm belongs to the prior art and will not be elaborated here in detail.

[0060] Step S104, obtaining a corrosion detection result in the bimetal sheet by using the enhanced grayscale image.

[0061] After obtaining the enhanced grayscale image, the enhanced grayscale image is used as the input of a trained CNN neural network model, and the corrosion detection result on the surface of the bimetal sheet is correspondingly output, which is used to evaluate the quality of the bimetal sheet. For example, the more corrosion regions and the larger the area detected on the surface of the bimetal sheet, the worse the quality of the corresponding bimetal sheet. Among them, the general training process of the CNN neural network model is: collecting image samples containing corrosion regions and non-corrosion regions as the training set, constructing a CNN model with a network structure including a convolutional layer, a pooling layer, and a fully connected layer, training the CNN model by using the training set until the loss function converges completely, and obtaining a trained CNN model. It should be noted that the training of the CNN model belongs to the prior art and will not be elaborated here in detail.

[0062] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for detecting double metal sheets of a protector based on machine vision, characterized in that, The method includes: Obtain the surface image of the bimetallic strip, preprocess the surface image to obtain a grayscale image; perform threshold segmentation on the grayscale image to obtain at least one segmentation region; For any one of the segmentation regions, according to the gray value distribution of the pixel points in the any one of the segmentation regions, obtain the regional gray brightness characteristic value, according to the gray level co-occurrence matrix of the any one of the segmentation regions and the gradient value of each edge pixel point, obtain the edge texture characteristic value, and according to the regional gray brightness characteristic value and the edge texture characteristic value, obtain the evaluation coefficient of the any one of the segmentation regions being affected by light interference; Obtain the evaluation coefficient of each of the segmentation regions, according to the evaluation coefficient of each of the segmentation regions, obtain the adaptive cropping parameter when performing limited contrast adaptive histogram equalization on each of the segmentation regions, and perform image enhancement on each segmentation region in the grayscale image according to the adaptive cropping parameter to obtain an enhanced grayscale image; Use the enhanced grayscale image to obtain the corrosion detection result in the bimetallic strip.

2. The method for detecting the double metal sheets of a protector based on machine vision according to claim 1, characterized in that, The obtaining the regional gray brightness characteristic value according to the gray value distribution of the pixel points in the any one of the segmentation regions includes: According to the gray value of each pixel point in the any one of the segmentation regions, obtain the overall gray distribution evaluation value; construct the gray value change curve of the any one of the segmentation regions, where the horizontal axis of the gray value change curve is the gray value and the vertical axis is the number of pixel points, and according to the fluctuation characteristics of the gray value change curve, obtain the histogram distribution evaluation value; According to the maximum value between the overall gray distribution evaluation value and the histogram distribution evaluation value, obtain the regional gray brightness characteristic value.

3. A method for detecting double metal sheets of a protector based on machine vision according to claim 2, characterized in that, The obtaining the overall gray distribution evaluation value according to the gray value of each pixel point in the any one of the segmentation regions includes: According to the gray value of each pixel point in the any one of the segmentation regions, calculate the gray value mean, and use the ratio of the gray value mean to the maximum gray value as the overall gray distribution evaluation value.

4. A method for detecting the double metal pieces of a protector based on machine vision according to claim 2, characterized in that, The obtaining the histogram distribution evaluation value according to the fluctuation characteristics of the gray value change curve includes: Obtain the local maximum peak points in the gray value change curve, sort the ordinate values of each of the local maximum peak points in descending order to obtain an ordinate value sequence, and use the local maximum peak points corresponding to the first two elements in the ordinate value sequence as the peak points to be analyzed; According to the gray value corresponding to each of the peak points to be analyzed, calculate the absolute value of the gray value difference, obtain the absolute value of the difference between the absolute value of the gray value difference and the preset reference gray difference value, and normalize the absolute value of the difference using a preset exponential function to obtain the corresponding normalized value; Obtain the proportion of the sum of the pixel point numbers corresponding to all the peak points to be analyzed in the total number of pixel points in the any one of the segmentation regions, and perform weighted summation on the proportion and the normalized value to obtain the histogram distribution evaluation value.

5. A method for detecting the double metal sheets of a protector based on machine vision according to claim 1, characterized in that, The obtaining the edge texture characteristic value according to the gray level co-occurrence matrix of the any one of the segmentation regions and the gradient value of each edge pixel point includes: Obtain the gray level co-occurrence matrix of the any one of the segmentation regions, and obtain the texture distribution characteristic evaluation value of the any one of the segmentation regions according to the gray level co-occurrence matrix; Perform edge detection on any of the divided regions to obtain an initial edge, use curve fitting to repair edge discontinuities of the initial edge to obtain a complete edge, and obtain an edge distribution feature evaluation value of any of the divided regions according to the number of edge pixel points of the initial edge and the gradient value of each edge pixel point of the complete edge; Obtain an edge texture feature value according to the mean value of the texture distribution feature evaluation value and the edge distribution feature evaluation value.

6. The method for detecting the double metal pieces of the protector based on machine vision according to claim 5, characterized in that, The obtaining of the texture distribution feature evaluation value of any of the divided regions according to the gray-level co-occurrence matrix includes: Obtain the entropy value of the gray-level co-occurrence matrix, normalize the entropy value using the hyperbolic tangent function to obtain a normalized entropy value, and denote the difference between the constant 1 and the normalized entropy value as the texture distribution feature evaluation value.

7. A method for detecting the double metal sheets of a protector based on machine vision according to claim 5, characterized in that, The obtaining of the edge distribution feature evaluation value of any of the divided regions according to the number of edge pixel points of the initial edge and the gradient value of each edge pixel point of the complete edge includes: Calculate the quantity ratio between the number of edge pixel points of the initial edge and the number of edge pixel points of the complete edge, calculate the mean value of the gradient values of all edge pixel points of the complete edge, normalize the mean value of the gradient values to obtain a normalized mean value, perform weighted summation on the quantity ratio and the normalized mean value to obtain a weighted summation result, and denote the difference between the constant 1 and the weighted summation result as the edge distribution feature evaluation value of any of the divided regions.

8. A method for detecting the double metal sheets of a protector based on machine vision according to claim 1, characterized in that, The obtaining of the evaluation coefficient of any of the divided regions being affected by light interference according to the regional gray-level brightness feature value and the edge texture feature value includes: Denote the mean value of the regional gray-level brightness feature value and the edge texture feature value as the evaluation coefficient of any of the divided regions being affected by light interference.

9. A method for detecting the double metal sheets of a protector based on machine vision according to claim 1, characterized in that, The obtaining of the adaptive cropping parameter for performing contrast-limited adaptive histogram equalization on each of the divided regions according to the evaluation coefficient of each of the divided regions includes: For any segmentation region, if the evaluation coefficient of the any segmentation region is less than or equal to a preset evaluation coefficient threshold, the adaptive cropping parameter when the any segmentation region performs limited contrast adaptive histogram equalization is obtained by using a first piecewise function, where the calculation expression of the first piecewise function is , represents the adaptive cropping parameter, represents the evaluation coefficient, and 0.5 represents the evaluation coefficient threshold.

10. A method for detecting the double metal pieces of a protector based on machine vision according to claim 9, characterized in that, The obtaining of the adaptive cropping parameter for performing contrast-limited adaptive histogram equalization on each of the divided regions according to the evaluation coefficient of each of the divided regions further includes: If the evaluation coefficient of any of the divided regions is greater than a preset evaluation coefficient threshold, an adaptive cropping parameter for performing limited contrast adaptive histogram equalization on any of the divided regions is obtained by using a second piecewise function, where the calculation expression of the second piecewise function is .

Citation Information

Patent Citations

  • Image processing method and mobile terminal

    CN107610059A

  • Welded pipe corrosion state detection method based on image processing

    CN117152137A

  • Insulating plate surface defect intelligent detection method based on visual detection

    CN117934460A

  • Method for detecting surface defects of autoclave mold

    CN118196081A

  • Automatic analyzer sample state evaluation method based on AI visual inspection

    CN118898600A

Cited By

  • Petroleum pipeline defect identification method, device and equipment

    CN120563527A

  • A method, device and equipment for identifying defects of a petroleum pipeline

    CN120563527B

  • Monitoring video enhancement method for tar residue processing equipment

    CN120580145A

  • A monitoring video enhancement method for tar residue treatment equipment

    CN120580145B

  • Method for monitoring glue melting state of nozzle of injection molding machine based on machine vision

    CN120747083A