A method for detecting surface defects of axial flow regulating valve

By performing grayscale image blocking and bimodal coefficient calculation on the surface of the axial flow control valve, dynamically adjusting the segmentation threshold, the problem of difficulty in detecting subtle defects in the prior art is solved, and defect recognition with high accuracy and high reliability is achieved. Suitable for surface defect detection of axial flow control valves under complex operating conditions.

CN119006830BActive Publication Date: 2025-01-14XIAN AIKEFU FLUID CONTROL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411457364.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-14
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

The existing axial flow control valve surface defect detection methods are difficult to accurately determine subtle scratches or areas with insignificant grayscale differences, resulting in subtle defects not found in time that may worsen during long-term use, causing significant damage to the equipment.

Method used

A method for detecting surface defects of axial flow control valve is proposed. By acquiring the surface grayscale image, the bimodal coefficient is calculated in blocks, and the grayscale level in the image block contains the variance and grayscale value difference of the number of pixels and the grayscale value difference are dynamically adjusted. The segmentation threshold is used to identify defects using an adaptive segmentation algorithm to ensure a stable detection effect under complex operating conditions.

Benefits of technology

It significantly improves the accuracy and reliability of detection, especially in the case of complex scratches, reduces the possibility of false detection and missed detection, enhances the ability to perceive subtle changes in the image block, is highly adaptable, and can Achieve higher detection accuracy and stability in diverse and complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006830B_ABST
    Figure CN119006830B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and specifically to a method for detecting surface defects of an axial flow regulating valve. The surface image of the regulating valve is collected by high-definition video, and semantic segmentation is performed using a U-NET model to extract the regulating valve area. Then, the grayscale histogram analysis is performed on the segmented image blocks, the bimodal coefficient is calculated, the first segmentation necessity is obtained, and after the segmentation necessity is further corrected by grayscale feature analysis of the image blocks, an adaptive threshold segmentation algorithm is applied to dynamically adjust the threshold, detect surface defects such as scratches, and ultimately improve the accuracy of scratch detection. The present invention performs semantic segmentation through a U-NET model, combines grayscale histogram analysis and an adaptive threshold segmentation algorithm, and achieves high precision and comprehensiveness in the detection of scratches on the surface of an axial flow regulating valve.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing, and in particular to a method for detecting surface defects of an axial flow regulating valve. Background Art

[0002] Axial flow control valve is a key equipment for fluid control, widely used in industries such as oil, natural gas, electricity and chemical industry. Its streamlined design gives it high flow capacity, anti-cavitation and stable flow control ability, especially suitable for high pressure difference and large flow conditions. In addition, the valve has a compact structure, fast response speed and convenient maintenance, and is an important part of industrial automation control system. However, during its manufacturing, transportation and installation, defects such as scratches, dents or wear may occur on the surface of the control valve. These defects will damage the surface protective layer of the valve body, increase the risk of corrosion and fluid leakage, affect its sealing and life, and may even cause equipment failure and cause major safety accidents. Therefore, timely and effective detection of surface defects of axial flow control valves is particularly important. Existing surface defect detection methods for axial flow control valves can usually detect more obvious scratches or damage, but it is often difficult to make accurate judgments for subtle scratches or areas with insignificant grayscale differences. These subtle defects that are not discovered in time may further deteriorate during long-term use, causing significant damage to the equipment.

[0003] At present, the adaptive threshold segmentation algorithm has been applied in surface defect detection, which has strong adaptability and fast processing speed. However, this algorithm performs poorly when the depth and shape of the scratches are inconsistent, resulting in incomplete detection results. For example, a Chinese patent application document with publication number CN115578389A discloses a defect detection method for a trench MOS device, which corrects the initial segmentation threshold according to the area ratio of the initial defect area and the change in the grayscale of the edge of the initial defect area to obtain the final segmentation threshold, so that the segmentation of the defect area is more accurate. However, this method has some technical defects: the method has a strong dependence on the setting of the threshold. If the initial parameters are set improperly or the grayscale difference on the defect surface is not obvious, it may lead to inaccurate detection or loss of details of minor defects. Summary of the invention

[0004] In view of the above-mentioned problem that minor defect details may be lost, the present invention proposes a method for detecting surface defects of an axial flow regulating valve, comprising: obtaining a surface grayscale image of the axial flow regulating valve; dividing the surface grayscale image into blocks to obtain a plurality of image blocks and obtaining an initial segmentation threshold for each image block; calculating a bimodal coefficient for each image block, wherein the bimodal coefficient is positively correlated with the variance of the number of pixels contained in each grayscale level in the corresponding image block, the difference between the grayscale value of each pixel and the median of the grayscale value; recording an image block with a bimodal coefficient less than a set threshold as a primary image block, and recording an image block greater than or equal to the set threshold as a secondary image block; and The number of other main image blocks and the contrast of other secondary image blocks in the neighborhood of the image block are used to obtain the first segmentation necessity; the final segmentation threshold of each main image block is calculated, and the final segmentation threshold is negatively correlated with the second segmentation necessity of the corresponding main image block; the second segmentation necessity is positively correlated with the proportion of the minimum grayscale level in the corresponding main image block and the first segmentation necessity of the corresponding main image block, and is negatively correlated with the bimodal coefficient of the corresponding main image block; the main image block is segmented using the final segmentation threshold, and the secondary image block is segmented using the initial segmentation threshold; the defective areas in all segmented image blocks are marked.

[0005] The present invention realizes high-precision defect recognition through image processing flow. First, the image information structure is simpler and clearer after grayscale processing and block analysis, which is helpful for subsequent processing steps. Then, by calculating the bimodal coefficient, the complexity and feature distribution of each image block can be accurately judged. In particular, the use of adaptive segmentation threshold, combined with the calculation of the necessity of the first and second segmentations, can dynamically adjust the segmentation parameters to ensure that stable detection effects can be obtained under various working conditions. Compared with the prior art, this method significantly improves the accuracy and reliability of detection, especially in the case of complex scratches, reducing the possibility of false detection and missed detection.

[0006] Furthermore, the bimodal coefficient calculation method is specifically as follows:

[0007]

[0008] in Indicates The bimodal coefficient of the image block; Indicates The variance of the number of pixels contained in each gray level of an image block; Indicates The total number of pixels in an image block; Indicates In the image block The gray value of each pixel; Indicates The median value of all gray values ​​in an image block; is the normalization function.

[0009] The calculation of the bimodal coefficient makes the feature extraction of the image block more sensitive through the comprehensive analysis of the grayscale variance and the grayscale median difference. This method can enhance the perception of subtle changes within the image block, especially when dealing with surfaces with different materials or light reflection characteristics, showing excellent adaptability. Compared with traditional edge detection or simple threshold segmentation methods, this technology can achieve higher detection accuracy and stability under complex surface conditions.

[0010] Furthermore, it also includes taking the primary image block that does not contain the secondary image block in the neighborhood as the secondary image block.

[0011] Furthermore, the first segmentation necessity calculation method is specifically as follows:

[0012]

[0013] in Indicates The necessity of the first segmentation of the main image blocks; Indicates The total number of other main image blocks within the neighborhood of the main image block; Indicated in The main image block neighborhood The maximum value of the gray value in the secondary image blocks; Indicated in The main image block neighborhood The minimum value of the gray value in the secondary image blocks; Indicates The total number of secondary image blocks within the neighborhood of the primary image block; is the tuning factor.

[0014] Furthermore, the first segmentation necessity calculation method is specifically as follows:

[0015]

[0016] in Indicates The necessity of the first segmentation of the main image blocks; Indicates The total number of other main image blocks within the neighborhood of the main image block; Indicated in The main image block neighborhood The number of pixels whose grayscale values ​​are less than the corresponding initial segmentation threshold in the secondary image blocks; Indicated in The main image block neighborhood The number of pixels whose grayscale values ​​are greater than the corresponding initial segmentation threshold in the secondary image blocks; Indicates The total number of secondary image blocks within the neighborhood of the primary image block; is the tuning factor.

[0017] This method further improves the rationality and adaptability of the segmentation criteria by carefully analyzing the grayscale value distribution of the secondary image blocks in the neighborhood. In this way, the interference caused by background noise can be effectively filtered out to ensure a higher recognition probability of defective areas. Compared with the traditional simple grayscale difference calculation method, this technology is more adaptable to diverse and complex scenes and provides more accurate segmentation results.

[0018] Furthermore, the second segmentation necessity calculation method is specifically as follows:

[0019]

[0020] in Indicates Necessity of second segmentation of main image blocks; Indicated in The minimum gray level in the gray level histogram of the main image blocks The proportion of the total gray level; Indicates The bimodal coefficient of the main image blocks; Indicates The necessity of the first segmentation of the main image blocks; is the maximum and minimum normalization function.

[0021] Furthermore, the method for obtaining the final segmentation threshold is specifically as follows:

[0022]

[0023] in Indicates The final segmentation threshold of the main image blocks; Indicates Necessity of second segmentation of main image blocks; and is the parameter adjustment factor; Indicates Adaptive segmentation threshold for each main image block; is the parameter adjustment factor; is the rounding function.

[0024] By nonlinearly adjusting the initial segmentation threshold, the final segmentation threshold can be more precisely adapted to the actual detection needs. This flexible segmentation threshold adjustment mechanism reduces the computational complexity and improves the detection efficiency while ensuring high accuracy. Compared with the traditional fixed threshold method, it has better flexibility and adaptability.

[0025] Furthermore, obtaining the surface grayscale image of the axial flow regulating valve also includes: using an industrial CCD camera to capture the surface image of the axial flow regulating valve with a pixel size of 1024×1024; graying the surface image of the axial flow regulating valve using an average value method; and using a U-NET model to extract a regulating valve area from the grayed surface image of the axial flow regulating valve to obtain a surface grayscale image of the regulating valve area.

[0026] Using industrial CCD cameras and U-NET models, high-quality image acquisition and accurate extraction of the control valve area can be achieved. This method ensures the availability and consistency of image data through automated grayscale processing. Compared with traditional manual or simple algorithm segmentation, this technology reduces human errors, improves the level of detection automation, and significantly improves detection efficiency and overall quality.

[0027] Furthermore, the initial segmentation threshold is obtained using the Otsu threshold method.

[0028] The technical effects of the present invention are:

[0029] The present invention collects the surface image of the regulating valve through a high-definition camera device, and uses the U-NET semantic segmentation model to accurately extract the valve body area. Then the image is divided into blocks and grayscale histogram analysis is performed, the bimodal coefficient of each image block is calculated, and the necessity of scratch segmentation in the bimodal inconspicuous area is determined in combination with the surrounding image block information. Then, an adaptive threshold segmentation algorithm is used to perform dynamic threshold adjustment to ensure that scratches can be accurately detected in the bimodal inconspicuous area. This method effectively improves the detection accuracy and coverage, especially in the detection of complex or subtle defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] 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:

[0031] Figure 1 is a flow chart schematically showing a method for detecting surface defects of an axial flow regulating valve according to an embodiment of the present invention;

[0032] Figure 2 is a grayscale schematic diagram schematically showing an axial flow regulating valve in an embodiment of the present invention;

[0033] Figure 3 The figure is a grayscale schematic diagram schematically showing a shallow scratch on the surface of the axial flow regulating valve in the embodiment of the present invention. DETAILED DESCRIPTION

[0034] 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.

[0035] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0036] Axial flow control valve surface defect detection method embodiment:

[0037] like Figure 1 As shown, a method for detecting surface defects of an axial flow regulating valve of the present invention comprises:

[0038] S1. Collect the surface image of the axial flow control valve and divide it into blocks.

[0039] Axial flow control valve is an industrial equipment used for fluid control, commonly used in oil, natural gas, electricity, chemical industry and other industries, such as Figure 2 As shown. Due to its streamlined design, the axial flow control valve has high flow capacity, good cavitation resistance and stable flow control ability, and is suitable for high pressure difference and large flow conditions. It also has the advantages of compact structure, fast response speed and easy maintenance, making it widely used in industrial automation control systems.

[0040] In order to detect its surface defects, in this embodiment, a high-definition industrial CCD camera can be used to capture the surface image of the axial flow regulating valve with a pixel size of 1024×1024; then the acquired image can be grayed using the average method; then, in order to more efficiently detect the scratch area of ​​the axial flow regulating valve, the U-NET model can be used to extract the regulating valve area in the image. The input of the model is the gray image of the axial flow regulating valve, and the output is a segmentation mask, the valve body area mask is 1, and the background area mask is 0. The gray image of the valve body area is obtained based on the segmentation mask; finally, the extracted gray image of the valve body area is divided into blocks according to the empirical value of 15×15 pixels, and the adjacent image blocks are overlapped with a 20% overlap rate, which can ensure that the details of the defective area are not missed during the block process, especially at the edge or blurred area of ​​the image, which is helpful for the complete detection of scratches. The implementer of the above image block size can also select 20×20, 25×25 or 30×30 according to the actual situation.

[0041] Using industrial CCD cameras and U-NET models, high-quality image acquisition and accurate extraction of the control valve area can be achieved. This method ensures the availability and consistency of image data through automated grayscale processing. Compared with traditional manual or simple algorithm segmentation, this technology reduces human errors, improves the level of detection automation, and significantly improves detection efficiency and overall quality.

[0042] S2. Necessity of first segmentation to obtain image blocks where the bimodality is not obvious.

[0043] In this embodiment, the defect area is obtained by performing adaptive threshold segmentation on the surface image of the axial flow regulating valve. However, adaptive threshold segmentation usually has a better effect on image cutting with obvious double peaks in the grayscale histogram, and the shapes and depths of scratches on the surface of the axial flow regulating valve are different. Using conventional adaptive threshold segmentation may cause incomplete detection of the surface defect area, affecting subsequent identification and maintenance operations.

[0044] In order to better detect the defects on the surface of the axial flow regulating valve, more accurate detection results can also be obtained for the image area where the double peaks are not obvious. In this embodiment, the grayscale histogram of the multiple image blocks obtained in step S1 is analyzed, and the double peak coefficient of the grayscale histogram of each image block is calculated, which is specifically:

[0045]

[0046] in Indicates The bimodal coefficient of the image block; Indicates The variance of the number of pixels corresponding to each gray level of an image block; Indicates The number of pixels in an image block; Indicates In the image block The gray value of each pixel; Indicates The median value of the grayscale value in the image block; is the normalization function.

[0047] when When the value is larger, it means that the difference in the number of pixels corresponding to each gray level in the image block is larger, and the grayscale difference of the image pixel value in the area where the image block is located is larger, and the bimodal coefficient of the image block is larger. The bigger it is; when When the value is larger, it means that the gray value of the pixel in the image block deviates from the median gray value, and the distribution of pixels corresponding to all gray levels in the grayscale histogram of the image block tends to be more polarized, and the bimodal coefficient of the image block is The bigger it is.

[0048] The calculation of the bimodal coefficient makes the feature extraction of the image block more sensitive through the comprehensive analysis of the grayscale variance and the grayscale median difference. This method can enhance the perception of subtle changes within the image block, especially when dealing with surfaces with different materials or light reflection characteristics, showing excellent adaptability. Compared with traditional edge detection or simple threshold segmentation methods, this technology can achieve higher detection accuracy and stability under complex surface conditions.

[0049] After obtaining the bimodal coefficient of each image block, set the coefficient threshold And take the empirical value as 0.6, for example: if there is a bimodal coefficient of an image block , which is less than This means that the image block is an image block with inconspicuous double peaks. At the same time, since the image block with inconspicuous double peaks is the main analysis object of this embodiment, it can also be called the main image block; and the image block greater than or equal to the threshold The image blocks with obvious double peaks are recorded as image blocks with obvious double peaks, which can also be called secondary image blocks. Therefore, the image blocks with unclear double peaks mentioned later in this embodiment refer to primary image blocks, and the image blocks with obvious double peaks refer to secondary image blocks.

[0050] Here, the image blocks with unclear double peaks are further analyzed, specifically: for an image block with unclear double peaks, 8 adjacent image blocks are obtained. If there are more image blocks with obvious double peaks around it, it means that the possibility of defects in the area around this image block is greater, and the probability of the image block with unclear double peaks containing surface defects such as shallow scratches is also greater. Therefore, the necessity of the first segmentation of each image block with unclear double peaks is calculated. In one embodiment, the calculation method of the necessity of the first segmentation is as follows:

[0051]

[0052] in Indicates The necessity of the first segmentation of image blocks with unclear bimodal features; Indicates The total number of other image blocks with inconspicuous bimodality within the neighborhood of the image block with inconspicuous bimodality; Indicated in The first In an image block with obvious bimodal peaks, the number of pixels whose grayscale value is less than the adaptive segmentation threshold of this image block; Indicated in The first In an image block with obvious bimodal peaks, the number of pixels whose grayscale value is greater than the adaptive segmentation threshold of this image block; Indicates The total number of image blocks with obvious bimodal peaks within the neighborhood of image blocks with inconspicuous bimodal peaks; To adjust the parameter factor and avoid the situation where the denominator is 0, an empirical value of 0.001 can be taken in this embodiment.

[0053] when , explain If there is an image block with obvious bimodal peaks in the neighborhood of an image block with inconspicuous bimodal peaks, then there may be a defective area in the area where the image block is located; The smaller the time, the The less the total number of other image blocks with inconspicuous bimodal peaks in the neighborhood of an image block with inconspicuous bimodal peaks, the more the number of image blocks with obvious bimodal peaks in its neighborhood. This means that the image block with inconspicuous bimodal peaks is more likely to have surface defects such as shallow scratches. The bigger; when The larger the value, the The first In the image blocks with obvious bimodal peaks, the difference between the number of pixels greater than the adaptive segmentation threshold and the number of pixels less than the adaptive segmentation threshold is large, which usually means that the brightness distribution or texture of the object surface is abnormal. The more likely it is that there will be defective areas, the higher the probability of defective areas. The above-mentioned adaptive segmentation threshold is obtained by Otsu threshold method, which belongs to the well-known technology and will not be described in detail here.

[0054] when , explain If there is no image block with obvious bimodal peaks in the neighborhood of an image block with inconspicuous bimodal peaks, the possibility that there is a defective area in the area where the image block is located is extremely small, and no subsequent analysis is performed in this embodiment, that is, when threshold segmentation is performed on such image blocks in subsequent steps, the same segmentation operation steps can be used as for image blocks with obvious bimodal peaks.

[0055] In another embodiment, the method for calculating the necessity of the first segmentation of the image block with unclear bimodalities may also be:

[0056]

[0057] in Indicates The necessity of the first segmentation of image blocks with unclear bimodal features; Indicates The total number of other image blocks with inconspicuous bimodality within the neighborhood of the image block with inconspicuous bimodality; Indicated in The first The maximum gray value in the image block with obvious bimodal peaks; Indicated in The first The minimum gray value in the image block with obvious bimodal peaks; Indicates The total number of image blocks with obvious bimodal peaks within the neighborhood of image blocks with inconspicuous bimodal peaks; To adjust the parameter factor and avoid the situation where the denominator is 0, an empirical value of 0.001 can be taken in this embodiment.

[0058] This method further improves the rationality and adaptability of the segmentation criteria by carefully analyzing the grayscale value distribution of image blocks with obvious bimodalities in the neighborhood. In this way, the interference caused by background noise can be effectively filtered out to ensure a higher recognition probability of defective areas. Compared with the traditional simple grayscale difference calculation method, this technology is more adaptable to diverse and complex scenes and provides more accurate segmentation results.

[0059] S3. Modify the first segmentation necessity to obtain the second segmentation necessity.

[0060] In step S2, the first segmentation necessity of each image block with inconspicuous bimodality is obtained. However, since this index is obtained based on the features of the surrounding image blocks of each image block with inconspicuous bimodality, in this embodiment, the grayscale change features in the image block with inconspicuous bimodality are further analyzed, and the first segmentation necessity of each image block with inconspicuous bimodality is corrected to obtain the second segmentation necessity.

[0061] Because scratches will damage the waterproof and anti-corrosion coating on the surface of the regulating valve, resulting in reduced surface smoothness of the axial flow regulating valve, thereby weakening the surface reflection ability, making the grayscale value of the surface defect area relatively low. Therefore, in the image block with unclear double peaks, if there are defects such as slight scratches, even if the double peaks of the grayscale value in the image block are not obvious, there will be areas with smaller grayscale values ​​compared to normal areas, such as Figure 3 As shown in the figure, although the scratches are shallow, the grayscale value is still smaller than that of the normal area. In summary, the necessity of obtaining the second segmentation of the image block with unclear double peaks is as follows:

[0062]

[0063] in Indicates The necessity of the second segmentation of image blocks with unclear bimodalities; Indicated in In the grayscale histogram of an image block with inconspicuous bimodal peaks, the minimum grayscale level The proportion of the total gray level; Indicates The bimodal coefficient of the image block with inconspicuous bimodality; Indicates The necessity of the first segmentation of image blocks with unclear bimodal features; is the maximum and minimum normalization function.

[0064] when The larger the value, the In the grayscale histogram of an image block with inconspicuous bimodal peaks, the minimum grayscale level The larger the proportion of the total gray level, that is, the larger the area of ​​the defective area with a lower gray level, the more likely the image block contains a lighter defective area. The bigger; when The smaller the time, the more The smaller the bimodal coefficient of an image block with inconspicuous bimodalities, the more evenly distributed the grayscale is in the image block. The larger the value is, the more likely it is that there is a shallow defect area in the image block. The bigger; when The larger the value, the The greater the necessity of the first segmentation of an image block with unclear bimodalities, that is, the more likely it is that the image block has a defective area based on the grayscale features of the surrounding image blocks, the The bigger.

[0065] S4. Determine a final segmentation threshold based on the second segmentation necessity; and perform adaptive threshold segmentation on each image block to obtain surface defects.

[0066] In step S3, the necessity of the second segmentation of the image block with unclear double peaks is obtained. That is, for an image block with unclear double peaks in the histogram, if its necessity of the second segmentation is large, it means that the probability of defects such as slight scratches in this image block is greater, and the segmentation effect of this image block should be improved when performing threshold segmentation. At this time, the threshold in this image block can be dynamically adjusted based on the necessity of the second segmentation. For example, for the first The image blocks with inconspicuous bimodal peaks and the necessity of the second segmentation is , then the final segmentation threshold of the image block is The specific calculation process is:

[0067]

[0068] in Indicates The final segmentation threshold of the image block with inconspicuous bimodality; Indicates The necessity of the second segmentation of image blocks with unclear bimodalities; is a parameter adjustment factor used to control the final segmentation threshold to be biased towards the initial threshold In this embodiment, the empirical value 4 can be taken; represents the initial adaptive segmentation threshold of the image block obtained by Otsu threshold method; To adjust the parameter factor and avoid the situation where the final segmentation threshold is 0, an empirical value of 0.001 can be taken in this embodiment; is the rounding function.

[0069] when The larger the The greater the necessity of the second segmentation of an image block with unclear double peaks, the more likely it is that there are defects such as slight scratches in the image block area, and because the grayscale value of the defective area is low, the segmentation threshold should be lowered to divide the area where there may be defects such as slight scratches. The smaller.

[0070] By nonlinearly adjusting the initial segmentation threshold, the final segmentation threshold can be more precisely adapted to the actual detection needs. This flexible segmentation threshold adjustment mechanism reduces the computational complexity and improves the detection efficiency while ensuring high accuracy. Compared with the traditional fixed threshold method, it has better flexibility and adaptability.

[0071] For all image blocks, the Otsu threshold method is first used to obtain the adaptive segmentation threshold, and for image blocks with unclear double peaks, the final segmentation threshold is obtained in the manner shown above based on the necessity of the second segmentation; then, after obtaining the segmentation threshold of all image blocks, image segmentation is performed to obtain the foreground and background areas of the image blocks; then the contour detection algorithm is used to obtain the contours of each area; finally, defects are marked for the image within each contour to obtain the defective area of ​​each image block, and the defective area is marked accordingly in the original image of the axial flow control valve surface.

[0072] The present invention realizes high-precision defect recognition through image processing flow. First, the image information structure is simpler and clearer after grayscale processing and block analysis, which is helpful for subsequent processing steps. Then, by calculating the bimodal coefficient, the complexity and feature distribution of each image block can be accurately judged. In particular, the use of adaptive segmentation threshold, combined with the calculation of the necessity of the first and second segmentations, can dynamically adjust the segmentation parameters to ensure that stable detection effects can be obtained under various working conditions. Compared with the prior art, this method significantly improves the accuracy and reliability of detection, especially in the case of complex scratches, reducing the possibility of false detection and missed detection.

[0073] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0074] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A method for detecting surface defects of an axial flow regulating valve, characterized in that: The method comprises: Acquire a surface grayscale image of the axial flow regulating valve; The surface grayscale image is divided into multiple image blocks and an initial adaptive segmentation threshold of each image block is obtained; a bimodal coefficient of each image block is calculated, and the bimodal coefficient calculation method is specifically as follows: ; in Indicates The bimodal coefficient of the image block; Indicates The variance of the number of pixels contained in each gray level of an image block; Indicates The total number of pixels in an image block; Indicates In the image block The gray value of each pixel; Indicates The median value of all gray values ​​in an image block; is the normalization function; The image block with a bimodal coefficient less than a set threshold is recorded as a primary image block, and the image block greater than or equal to the set threshold is recorded as a secondary image block; the first segmentation necessity of the primary image block is obtained, and the first segmentation necessity is positively correlated with the total number of other primary image blocks in the neighborhood range of the corresponding primary image block, and negatively correlated with the sum of the grayscale extremes of each secondary image block in the neighborhood range of the corresponding primary image block; or the first segmentation necessity is positively correlated with the total number of other primary image blocks in the neighborhood range of the corresponding primary image block, and negatively correlated with the ratio of the number of pixels greater than the initial adaptive segmentation threshold and less than the initial adaptive segmentation threshold in each secondary image block in the neighborhood range of the corresponding primary image block; the final segmentation threshold of each primary image block is calculated, and the calculation method of the final segmentation threshold is specifically: ; in Indicates The final segmentation threshold of the main image blocks; Indicates Necessity of second segmentation of main image blocks; and is the parameter adjustment factor; Indicates Initial adaptive segmentation threshold for each main image patch; is the rounding function; The second segmentation necessity is positively correlated with the proportion of the minimum gray level in the corresponding main image block and the first segmentation necessity of the corresponding main image block, and is negatively correlated with the bimodal coefficient of the corresponding main image block; The final segmentation threshold is used to segment the main image block, and the initial adaptive segmentation threshold is used to segment the secondary image block; and the defect areas in all the segmented image blocks are marked.

2. The method for detecting surface defects of an axial flow regulating valve according to claim 1, characterized in that: It also includes taking a primary image block that does not contain a secondary image block within a neighborhood range as a secondary image block.

3. The method for detecting surface defects of an axial flow regulating valve according to claim 2, characterized in that: The first segmentation necessity calculation method is specifically as follows: ; in Indicates The necessity of the first segmentation of the main image blocks; Indicates The total number of other main image blocks within the neighborhood of the main image block; Indicated in The main image block neighborhood The maximum value of the gray value in the secondary image blocks; Indicated in The main image block neighborhood The minimum value of the gray value in the secondary image blocks; Indicates The total number of secondary image blocks within the neighborhood of the primary image block; is the tuning factor.

4. The method for detecting surface defects of an axial flow regulating valve according to claim 2, characterized in that: The first segmentation necessity calculation method is specifically as follows: ; in Indicates The necessity of the first segmentation of the main image blocks; Indicates The total number of other main image blocks within the neighborhood of the main image block; Indicated in The main image block neighborhood The number of pixels whose grayscale values ​​are less than the corresponding initial adaptive segmentation threshold in the secondary image blocks; Indicated in The main image block neighborhood The number of pixels in the secondary image blocks whose grayscale values ​​are greater than the corresponding initial adaptive segmentation threshold; Indicates The total number of secondary image blocks within the neighborhood of the primary image block; is the tuning factor.

5. The method for detecting surface defects of an axial flow regulating valve according to claim 2, characterized in that: The second segmentation necessity calculation method is specifically as follows: ; in Indicates Necessity of second segmentation of main image blocks; Indicated in The minimum gray level in the gray level histogram of the main image blocks The proportion of the total gray level; Indicates The bimodal coefficient of the main image blocks; Indicates The necessity of the first segmentation of the main image blocks; is the maximum and minimum normalization function.

6. The method for detecting surface defects of an axial flow regulating valve according to claim 1, characterized in that: Get the grayscale image of the axial flow control valve surface, including: An industrial CCD camera is used to capture the surface image of the axial flow control valve with a pixel size of 1024×1024; graying the surface image of the axial flow regulating valve using an average value method; The U-NET model is used to extract the regulating valve area from the grayscale surface image of the axial flow regulating valve to obtain the surface grayscale image of the regulating valve area.

7. The method for detecting surface defects of an axial flow regulating valve according to claim 1, characterized in that: The initial adaptive segmentation threshold is obtained using the Otsu threshold method.

Citation Information

Patent Citations

  • Nilback image segmentation method based on improved Otsu method

    CN111161300A

  • Defect detection method for groove MOS (Metal Oxide Semiconductor) device

    CN115578389A