A method for detecting defects on inner surface of gas cylinder
By identifying and quantifying the geometric and grayscale features of the fuzzy area of the inner surface defect of the gas cylinder, constructing the fuzzy evaluation factor and the reciprocal fuzzy update factor, and dynamically adjusting the Pal-King fuzzy enhancement algorithm, the problem of defect feature degradation caused by motion blur in gas cylinder endoscopic inspection is solved and the detection effect is improved.
Patent Information
- Application Number
- CN202510990252.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-18
AI Technical Summary
When existing automated endoscopy devices detect defects on the inner surface of high-pressure gas cylinders, the image is blurred due to motion blur, resulting in poor defect detection results. In particular, the traditional Pal-King blur enhancement algorithm has inconsistent enhancement effects on different areas, affecting the detection effect.
By acquiring the inner surface image of the gas cylinder to be inspected, identifying the fuzzy area of suspected defects, calculating the geometric feature parameters and grayscale gradient feature parameters, constructing the fuzzy evaluation factor, generating the inverse fuzzy update factor, and dynamically adjusting the enhancement strength of the Pal-King fuzzy enhancement algorithm, adaptive enhancement is performed for different areas.
The defect detection effect on the inner surface of the gas cylinder is improved, the problem of over-enhancement in clear areas generating noise and under-enhancement in fuzzy areas is avoided, and the accuracy and clarity of defect detection are improved.
Smart Images

Figure CN120510138B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of defect detection, and in particular to a method for detecting defects on the inner surface of a gas cylinder. Background Art
[0002] High-pressure gas cylinders are a type of pressure-bearing equipment. They are specially designed, manufactured and inspected movable pressure vessels used to store and transport compressed gas or liquefied gas under high pressure. They are used in all walks of life. Their main function is to compress gas to a very high pressure, thereby accommodating a large amount of gas in a relatively small volume, making the storage, transportation and use of gas efficient, convenient and economical. Defect detection on the inner surface of high-pressure gas cylinders is an important part of gas cylinder quality control. With the development of science and technology, the inner surface inspection device has evolved from the initial rod-type endoscope, which was pushed inward manually, to the current automated endoscope device for the inner surface of high-pressure gas cylinders. However, when using an automated endoscope device to perform defect detection on the inner surface of a high-pressure gas cylinder, the image obtained will be blurred due to the problem of obtaining the image by the movement of the endoscope device, which further leads to poor defect detection on the inner surface of the high-pressure gas cylinder.
[0003] The Pal-King fuzzy enhancement algorithm is an algorithm for enhancing fuzzy images. It introduces fuzzy set theory into the edge detection algorithm of the image. The processing effect is better than the traditional algorithm. However, in actual application, the Pal-King fuzzy enhancement algorithm has the same enhancement effect on all areas of the image, and the enhancement degree is the same at different positions in the image. For images with different blur levels at different positions, the image enhancement effect is poor, which in turn affects the effect of defect detection on the inner surface of the gas cylinder. Summary of the Invention
[0004] In order to solve the problem of defect feature degradation caused by motion blur in gas cylinder endoscopic inspection, the present application provides a method for detecting defects on the inner surface of a gas cylinder.
[0005] This application provides a method for detecting defects on the inner surface of a gas cylinder, which adopts the following technical solutions:
[0006] A method for detecting defects on the inner surface of a gas cylinder comprises the following steps:
[0007] Acquire an image of the inner surface of the gas cylinder to be inspected and identify fuzzy areas suspected of defects; for each fuzzy area suspected of defects, determine its geometric characteristic parameters and grayscale gradient characteristic parameters, wherein the geometric characteristic parameters include the average width of the cross section and the length in the shape direction, and the grayscale gradient characteristic parameters include a pixel balancing factor and a pixel discrete factor;
[0008] Based on the geometric characteristic parameters and the grayscale gradient characteristic parameters, a fuzzy evaluation factor for evaluating the degree of fuzziness is calculated by dividing the product of the normalized average cross-sectional width and the normalized shape direction length by the product of the normalized pixel equalization factor and the normalized pixel discrete factor;
[0009] Screening out fuzzy regions according to the fuzzy evaluation factors; analyzing the information uncertainty and frequency domain energy of each fuzzy region, calculating a fuzzy defect extraction factor, and generating a reciprocal fuzzy update factor for the Pal-King fuzzy enhancement algorithm based on the fuzzy defect extraction factor;
[0010] The fuzzy area is adaptively enhanced using the reciprocal fuzzy update factor to obtain an enhanced inner surface image of the gas cylinder, and surface defect detection is performed on the enhanced inner surface image.
[0011] The traditional Pal-King fuzzy enhancement algorithm uses a fixed enhancement intensity for all areas, resulting in noise amplification when the clear area is over-enhanced, and the loss of defect features when the fuzzy area is under-enhanced. This application constructs a fuzzy evaluation factor by fusing geometric features and grayscale gradient features to accurately quantify the degree of regional blur; generates a reciprocal fuzzy update factor based on the fuzzy defect extraction factor, and dynamically adjusts the enhancement intensity of the Pal-King algorithm. In high-fuzzy areas, the enhancement intensity is increased, thereby improving the defect contrast; in low-fuzzy areas, the enhancement intensity is reduced to suppress noise.
[0012] Furthermore, the method for obtaining the suspected defect fuzzy area is: using an edge detection algorithm to obtain an edge composed of all edge pixels in the image of the inner surface of the gas cylinder to be inspected;
[0013] For each edge, the minimum circumscribed circle of the edge is obtained as its suspected defect fuzzy area.
[0014] Furthermore, the method for obtaining the average width of the cross section is as follows: for an area composed of continuous edge pixels in the suspected defect fuzzy area, a skeleton is obtained using a skeleton extraction algorithm;
[0015] For each edge pixel point on the skeleton, a straight line perpendicular to the skeleton is obtained at the edge pixel point, and the number of continuous edge pixel points including this edge pixel point passed by the straight line is taken as the cross-sectional width of this edge pixel point. The average cross-sectional width of all edge pixel points in the suspected defect blurred area is calculated as the average cross-sectional width of the suspected defect blurred area.
[0016] This application performs vertical profile sampling through skeleton extraction, and finally calculates the width mean to quantify the degree of edge blur diffusion.
[0017] Furthermore, the method for obtaining the length of the shape direction is: for each suspected defect blurred area, obtain the area composed of all continuous edge pixel points in the suspected defect blurred area as the edge continuous area, calculate the second-order moment in the edge continuous area, obtain the shape direction of the edge continuous area based on the second-order moment as the shape direction of the suspected defect blurred area, and obtain the length of the shape direction of each suspected defect blurred area.
[0018] This application calculates the shape direction of the edge continuous area based on the second-order moment, quantifies the spatial extension length in this direction, and quantifies the stretching deformation of the defect edge along the moving direction caused by motion blur.
[0019] Furthermore, the method for obtaining the pixel balancing factor is: for each suspected defect blurred area, an edge detection operator is used to obtain the gradient value of the grayscale value of all edge pixels in the suspected defect blurred area, and the average of the gradient values of all grayscale values is calculated as the pixel balancing factor.
[0020] Furthermore, the pixel discrete factor is the variance of the gradient values of all grayscale values in the suspected defect blurred area.
[0021] Furthermore, the method for obtaining the fuzzy region is: for all fuzzy evaluation factors of the suspected defect fuzzy regions, the suspected defect fuzzy region with a fuzzy evaluation factor greater than a first preset threshold is taken as the fuzzy region.
[0022] Furthermore, the information uncertainty is the information entropy of the grayscale values of all pixels in the fuzzy area.
[0023] Furthermore, the method for obtaining the fuzzy defect extraction factor is as follows: normalizing the information entropy of all fuzzy regions; processing each fuzzy region using wavelet decomposition to obtain a low-frequency image, a horizontal detail image, a vertical detail image, and a diagonal detail image of each fuzzy region; and calculating the energy in the low-frequency image, the horizontal detail image, the vertical detail image, and the diagonal detail image respectively;
[0024] The ratio between the energy of the low-frequency image and the average of the energies in the horizontal detail image, the vertical detail image, and the diagonal detail image is calculated, and the result of dividing the ratio by the normalized information entropy is calculated as the blur defect extraction factor of the blur area.
[0025] Information entropy reflects the complexity of the texture of the defect area. The more complex the defect texture, the greater the information entropy value. The energy ratio in the frequency domain can identify the loss of frequency domain features caused by blur. The fusion of the two constructs a fuzzy defect extraction factor, which can comprehensively represent the defect in the time domain and frequency domain.
[0026] Furthermore, the reciprocal fuzzy update factor is obtained by calculating, for each fuzzy region, the sum of the fuzzy defect factor and the value 1 and the multiplication result of the sum and the reciprocal fuzzy factor to obtain the reciprocal fuzzy update factor.
[0027] The present application implements dynamic parameter adjustment based on the fuzzy defect extraction factor, thereby avoiding the problem of poor image enhancement effect caused by the same value for all regions in the image.
[0028] This application has the following technical effects:
[0029] In traditional image enhancement algorithms, the enhancement effect of the entire image is the same, which will lead to over-enhancement of clearer areas and thus noise, and poor enhancement effect of blurry areas. However, there will be blurry and clearer areas in the image, and different enhancement effects need to be given to different areas. First, the present application constructs a fuzzy evaluation factor based on the degree of blur in the suspected defect blur area obtained by edge line division, obtains the blur area, and constructs a fuzzy defect extraction factor based on the time domain and frequency domain. Based on the fuzzy defect extraction factor, the reciprocal fuzzy factor in the Pal and King fuzzy enhancement algorithm is improved to obtain better enhancement effect for each blurry area. The present application gives different reciprocal fuzzy update factors to different areas according to the degree of blur and defect characteristics of different areas, so that different areas have different enhanced effects, which solves the problem of defect feature degradation caused by motion blur in gas cylinder endoscopic detection and improves the detection effect of defects on the inner surface of gas cylinders. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flow chart of a method for detecting defects on the inner surface of a gas cylinder in an embodiment of the present application.
[0031] Figure 2 This is a flowchart for obtaining fuzzy defect extraction factors in an embodiment of the present application. DETAILED DESCRIPTION
[0032] An embodiment of the present application discloses a method for detecting defects on the inner surface of a gas cylinder. The method comprises the following steps: obtaining a fuzzy area of suspected defects in an image of the inner surface of each gas cylinder to be detected, obtaining an average width of a cross section and a length in a shape direction, obtaining a pixel equalization factor and a pixel discrete factor based on the average gradient of the grayscale values of the fuzzy area of suspected defects and an average degree of dispersion, calculating a fuzzy evaluation factor of the fuzzy area of suspected defects, and obtaining each fuzzy area; analyzing the information uncertainty and frequency domain energy of the fuzzy area to obtain a fuzzy defect extraction factor, calculating a reciprocal fuzzy update factor as the reciprocal fuzzy factor of a Pal-King fuzzy enhancement algorithm, obtaining an enhanced image of the inner surface of the gas cylinder, and using a target detection algorithm to detect defects in the enhanced image of the inner surface of the gas cylinder, thereby solving the problem of unclear defect determination caused by image blur.
[0033] Reference Figure 1 A method for detecting defects on the inner surface of a gas cylinder includes steps S1 to S4.
[0034] S1: Acquire the inner surface image of the gas cylinder to be inspected.
[0035] The present application uses an automatic surface endoscopy device to obtain images of the inner surface of a high-pressure gas cylinder. In the process of obtaining images of the inner surface of a high-pressure gas cylinder, the automatic surface endoscopy device will slide and automatically obtain images of the inner surface of the high-pressure gas cylinder, and perform denoising on all the obtained images of the inner surface of the high-pressure gas cylinder. The denoising algorithm selected in one embodiment of the present application is a Gaussian filtering algorithm. The implementer can select other denoising algorithms based on actual conditions, and grayscale all the denoised images of the inner surface of the high-pressure gas cylinder to obtain images of the inner surface of each gas cylinder to be inspected.
[0036] S2: Identify suspected defect blurred areas; for each of the suspected defect blurred areas, determine its geometric characteristic parameters and grayscale gradient characteristic parameters, the geometric characteristic parameters include the average width of the cross section and the length in the shape direction, and the grayscale gradient characteristic parameters include a pixel equalization factor and a pixel discrete factor; based on the geometric characteristic parameters and grayscale gradient characteristic parameters, calculate a blur evaluation factor for evaluating the degree of blur.
[0037] On the inner surface of the high-pressure gas cylinder, common defect types include pit defects, scratch defects and stretch defects; and the surface of the gas cylinder is curved. When the automatic surface endoscope device obtains the image of the inner surface of the high-pressure gas cylinder, it needs to move to obtain images of various places on the inner surface of the high-pressure gas cylinder. The image is easily blurred due to movement, and the edge of the defect area in the image of the inner surface of the gas cylinder to be inspected cannot be accurately obtained. The contrast between the defects on the inner surface of the high-pressure gas cylinder obtained and the normal area is not high, resulting in the display effect of the defects in the obtained image of the inner surface of the high-pressure gas cylinder not being obvious, and it is difficult to detect the type of defects and determine the size, resulting in poor defect detection effect on the surface of the high-pressure gas cylinder.
[0038] The idea of the traditional Pal-King fuzzy enhancement algorithm for image enhancement is to first use a membership function to map the image into a membership matrix, and then perform fuzzy enhancement processing. However, in the practical application of traditional Pal-King fuzzy enhancement algorithm for image enhancement, the enhancement intensity of all areas in the image is consistent, which will cause the clearer areas to be over-enhanced and thus generate noise, and the enhancement effect of the fuzzier areas will be poor. This application assigns different inverse fuzzy update factors to different areas according to the degree of fuzziness and defect characteristics of different areas, so that different areas have different enhancement effects, solves the problem of defect feature degradation caused by motion blur in gas cylinder endoscopic detection, and improves the detection effect of defects on the inner surface of gas cylinders.
[0039] Specifically, for defects on the inner surface of high-pressure gas cylinders, pit defects usually appear in grayscale images as an arc-shaped or elliptical area with a lighter color in the middle of the pit and a darker color at the edge of the pit. Scratch defects usually appear as an elongated and lighter area. Stretch defects appear as a light and dark alternating area in the image.
[0040] Based on the above analysis, the imaging features of various defects on the inner surface of the gas cylinder are different, and the degree of blur is different. Therefore, when using the Pal-King fuzzy enhancement algorithm to enhance the image of the inner surface of the gas cylinder to be inspected, different defects have different degrees of blur in the image, and the degree of enhancement required is also different. When some areas in the image are relatively clear, if the degree of image enhancement is large at this time, the noise in the image will increase; conversely, when some areas in the image are relatively blurred and contain more defects, if the image enhancement effect is small at this time, the image enhancement effect will be poor, thereby affecting the effect of defect detection on the inner surface of the gas cylinder.
[0041] Based on the above analysis, for each inner surface image of the gas cylinder to be inspected, an edge detection algorithm is used to obtain all edges in the inner surface image of the gas cylinder to be inspected. In one embodiment of the present application, the edge detection algorithm selected is the Canny edge detection algorithm, and the implementer can select other values based on actual conditions.
[0042] Furthermore, for each edge, the minimum circumscribed circle of the edge is obtained as its suspected defect fuzzy area. The fuzziness of each suspected defect fuzzy area is evaluated, specifically:
[0043] For each suspected defect blurred area in the inner surface image of each gas cylinder to be inspected, when the defect in the area is relatively blurred, the width of the edge of the defect will increase, and the change between the pixel value of the edge pixel point and the pixel value of the pixel points in other areas will be relatively gentle.
[0044] Therefore, for the area composed of continuous edge pixels in the suspected defect blurred area, a skeleton is obtained using a skeleton extraction algorithm. For each edge pixel, a straight line perpendicular to the skeleton is obtained at the edge pixel point. The number of continuous edge pixels, including this edge pixel, that the straight line passes through is used as the cross-sectional width of this edge pixel point. The mean of the cross-sectional widths of all edge pixels in the suspected defect blurred area is calculated as the average cross-sectional width of the suspected defect blurred area. The skeleton extraction algorithm is a well-known technology and will not be described in detail in this application. The skeleton extraction algorithm selected in one embodiment of this application is the K3M skeleton extraction algorithm. The implementer may select other skeleton extraction algorithms based on actual conditions.
[0045] At the same time, when the defects in the area are relatively blurred, resulting in an increase in edge width, the sharp edges will also be caused to diffuse. In order to reflect the diffusion of edge pixels and the degree of edge diffusion in the image, for each suspected defect blurred area, the area composed of all continuous edge pixels in the suspected defect blurred area is obtained as the edge continuous area, the second-order moment in the edge continuous area is calculated, and the shape direction of the edge continuous area is obtained based on the second-order moment as the shape direction of the suspected defect blurred area, wherein the second-order moment of the image can be used to obtain the shape direction of the object, and calculating the second-order moment and obtaining the shape direction of the edge continuous area based on the second-order moment are well-known technologies, which will not be elaborated in this application; the length of the shape direction of each edge continuous area is obtained, specifically, the average cross-sectional width of the suspected defect blurred area and the length of the shape direction of the edge continuous area in the suspected defect blurred area can reflect the degree of edge diffusion in the suspected defect blurred area. When the image is not blurred, the edge is a sharp edge in the image. When the image is blurred, the edge of the image will diffuse, the average cross-sectional width will increase, and the length of the shape direction will increase.
[0046] Based on the above analysis, since the increase in the edge width of the defect will cause the change between the pixel value on the edge pixel point and the pixel value of other pixel points to be relatively gentle, and the sharp edge becomes soft, therefore, in order to obtain the degree of smooth change of the grayscale value of the edge pixel point and the degree of softening of the sharp edge, for each suspected defect blurred area, the Sobel operator is used to obtain the gradient value of the grayscale value of all edge pixel points in the suspected defect blurred area, the mean of the gradient value of the grayscale value of all pixel points is calculated as the pixel equalization factor, and the variance value of the grayscale gradient value of all pixel points is calculated as the pixel discrete factor. The Sobel operator is a well-known technology and will not be described in detail in this application.
[0047] Furthermore, the average cross-sectional width of all suspected defect blur regions, the length of the shape direction in the edge continuous region, the pixel equalization factor, and the pixel discrete factor are normalized respectively.
[0048] Based on the average profile width, pixel balance factor, and pixel discrete factor, the fuzzy evaluation factor of each suspected defect fuzzy area is constructed. The calculation formula is: Where, is the fuzzy evaluation factor of each suspected defect fuzzy area; is the normalized average cross-sectional width of each suspected defect fuzzy area, is the normalized shape length of each suspected defect fuzzy area, is the normalized pixel equalization factor of each suspected defect blur area, is the normalized pixel discretization factor of each suspected defect blur area.
[0049] It should be noted that for each suspected defect blurred area, when the degree of blur in the suspected defect blurred area is large, the edge width in the suspected defect blurred area will increase, and the length of the edge continuous area in the suspected defect blurred area in the direction of its shape will increase. At this time, the value of the obtained average width of the profile is larger, and the obtained blur evaluation factor is larger; at the same time, the larger the gradient value of the grayscale value in the suspected defect blurred area, the greater the difference between the boundary line and the background area, and the clearer the image. At this time, the value of the pixel equalization factor obtained is larger, and when it is clearer, due to the different pixel values at different positions in the area, the difference in the obtained grayscale gradient value is also larger. At this time, the value of the obtained pixel discrete factor is larger, and the obtained blur evaluation factor is smaller.
[0050] S3: screening out fuzzy regions according to the fuzzy evaluation factors; analyzing the information uncertainty and frequency domain energy of each fuzzy region, and calculating a fuzzy defect extraction factor.
[0051] Based on the above analysis, the fuzzy evaluation factor reflects the degree of fuzziness of each suspected defect fuzzy area. The greater the degree of fuzziness in the suspected defect fuzzy area, the less obvious the characteristics of the defect. Therefore, when judging defects in relatively vague suspected defect fuzzy areas, it is necessary to relax the criteria for judging defects; conversely, it is necessary to narrow the criteria for judging defects.
[0052] If a defect area appears in a relatively blurred suspected defect area, the texture in the defect area will be lost and the contrast in the defect area will be reduced.
[0053] Based on the above analysis, for the fuzzy evaluation factors of all suspected defect fuzzy areas, the suspected defect fuzzy areas with fuzzy evaluation factors greater than the first preset threshold are regarded as fuzzy areas. In one embodiment of the present application, the value of the first preset threshold is 0.8, and the implementer can select other values based on actual conditions.
[0054] Furthermore, for each blurred area, the information entropy of the grayscale values of all pixels in each blurred area is calculated, and the information entropy of all blurred areas is normalized. At the same time, wavelet decomposition is used to process each blurred area to obtain the low-frequency image, horizontal detail image, vertical detail image and diagonal detail image of each blurred area, and the energy in the low-frequency image, horizontal detail image, vertical detail image and diagonal detail image is calculated respectively. Among them, wavelet decomposition and energy calculation are well-known technologies and will not be elaborated in this application.
[0055] Based on the above analysis, the fuzzy defect extraction factor of each fuzzy area is constructed, and the calculation formula is: Where, Extract fuzzy defect factors for each fuzzy region; is the average value of the energy in the horizontal detail image, vertical detail image and diagonal detail image in each blurred area, is the energy of the low-frequency image in each fuzzy area, is the normalized information entropy in each fuzzy region.
[0056] It should be noted that the fuzzy defect extraction factor determines the defects in the fuzzy area from the time domain and frequency domain. The more blurred defects in the area will lose the texture features in the time domain and the high-frequency features in the frequency domain. At this time, the energy value of the acquired detail image is small, the energy value in the low-frequency image is large, and the information entropy value is small. At this time, the value of the acquired fuzzy defect extraction factor is large; otherwise, the value of the acquired fuzzy defect extraction factor is small. The fuzzy defect extraction factor acquisition flow chart is as follows: Figure 2 shown.
[0057] S4: generating a reciprocal fuzzy update factor for the Pal-King fuzzy enhancement algorithm based on the fuzzy defect extraction factor; using the reciprocal fuzzy update factor to adaptively enhance the fuzzy area to obtain an enhanced inner surface image of the gas cylinder, and performing surface defect detection on the enhanced inner surface image.
[0058] Based on the above analysis, when the Pal-King fuzzy enhancement algorithm is used to enhance the inner surface image of the gas cylinder to be inspected, the reciprocal fuzzy factor in the membership function defined by the Pal-King fuzzy enhancement algorithm is improved. The reciprocal fuzzy factor will affect the shape of the membership function. When the value of the reciprocal fuzzy factor is larger, the membership function grows faster, and the membership value finally obtained for the image with the same grayscale level is larger. The larger the membership value, the more obvious the enhancement effect; conversely, the smaller the membership value, the worse the enhancement effect.
[0059] Based on the above analysis, for each fuzzy area, the inverse fuzzy update factor is obtained by multiplying the sum of the fuzzy defect factor and the value 1 with the inverse fuzzy factor. It should be noted that when the value of the fuzzy defect extraction factor of the fuzzy area is larger, the possibility of fuzzy defects in the fuzzy area is greater. At this time, when using the Pal-King fuzzy enhancement algorithm to perform image enhancement on the fuzzy area, it is necessary to give a larger value to the inverse fuzzy factor in the membership function to give a greater enhancement effect to the fuzzy area, thereby reducing the blur in the fuzzy area and better obtaining the defect edge on the inner surface of the gas cylinder.
[0060] Based on the above analysis, for each fuzzy area, the reciprocal fuzzy update factor is used as the reciprocal fuzzy factor in the membership function of the Pal-King fuzzy enhancement algorithm in the fuzzy area. Then, the membership function is used to complete the mapping of the inner surface image of the gas cylinder to be inspected to the fuzzy membership matrix. The inner surface image of the gas cylinder to be inspected is further fuzzy enhanced to obtain the enhanced inner surface image of the gas cylinder.
[0061] Furthermore, based on the enhanced image of the inner surface of the gas cylinder, defect detection is performed on the inner surface of the gas cylinder to obtain the defect area of the inner surface of the gas cylinder. This application performs defect detection on the enhanced image of the inner surface of the gas cylinder based on the YOLOv7 model, and the loss function uses the SIOU loss function. The process of training the YOLOv7 model is a well-known technology and will not be elaborated in this application. At this point, the defect detection on the inner surface of the gas cylinder is completed.
[0062] It should be noted that the order of the embodiments of the present application is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the above description is of specific embodiments of this specification. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0063] The above-described embodiments are only used to illustrate the technical solutions of the present application, and not to limit them. Modifications to the technical solutions described in the aforementioned embodiments, or equivalent replacements of some of the technical features therein, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A method for detecting defects on the inner surface of a gas cylinder, characterized in that: The method comprises the following steps: obtaining an image of the inner surface of a gas cylinder to be inspected and identifying a fuzzy area suspected of being defective; determining geometric characteristic parameters and grayscale gradient characteristic parameters of each fuzzy area suspected of being defective, wherein the geometric characteristic parameters include an average width of a cross section and a length in a shape direction, and the grayscale gradient characteristic parameters include a pixel balancing factor and a pixel discrete factor; The pixel balancing factor is obtained by using an edge detection operator to obtain the gradient values of the grayscale values of all edge pixels in each suspected defect blurred area, and calculating the mean of the gradient values of all grayscale values as the pixel balancing factor. The pixel discrete factor is the variance of the gradient values of all gray values in the suspected defect fuzzy area; Based on the geometric feature parameters and the grayscale gradient feature parameters, a fuzzy evaluation factor for evaluating the degree of fuzziness is calculated. The calculation method is: the product of the normalized average width of the cross section and the normalized length of the shape direction is divided by the product of the normalized pixel equalization factor and the normalized pixel discrete factor. Filter out the fuzzy area according to the fuzzy evaluation factor; The information uncertainty and frequency domain energy of each fuzzy area are analyzed to calculate the fuzzy defect extraction factor. The method is as follows: the information uncertainty is the information entropy of the grayscale values of all pixels in the fuzzy area, and the information entropy of all fuzzy areas is normalized; each fuzzy area is processed using wavelet decomposition to obtain the low-frequency image, horizontal detail image, vertical detail image and diagonal detail image of each fuzzy area, and the energy in the low-frequency image, horizontal detail image, vertical detail image and diagonal detail image is calculated respectively; the ratio between the energy of the low-frequency image and the average value of the energy in the horizontal detail image, vertical detail image and diagonal detail image is calculated, and the result of dividing the ratio by the normalized information entropy is calculated as the fuzzy defect extraction factor of the fuzzy area; A reciprocal fuzzy update factor for the Pal-King fuzzy enhancement algorithm is generated based on the fuzzy defect extraction factor. The method is as follows: for each fuzzy region, the reciprocal fuzzy update factor is obtained by multiplying the sum of the fuzzy defect factor and the value 1 with the reciprocal fuzzy factor. The fuzzy area is adaptively enhanced using a reciprocal fuzzy update factor to obtain the enhanced inner surface image of the gas cylinder, and surface defect detection is performed on the enhanced inner surface image.
2. A method for detecting defects on the inner surface of a gas cylinder according to claim 1, characterized in that: The method for obtaining the suspected defect fuzzy area is: using an edge detection algorithm to obtain the edge composed of all edge pixels in the image of the inner surface of the gas cylinder to be inspected; For each edge, the minimum circumscribed circle of the edge is obtained as its suspected defect fuzzy area.
3. A method for detecting defects on the inner surface of a gas cylinder according to claim 2, characterized in that: The method for obtaining the average width of the cross section is as follows: for an area composed of continuous edge pixels in the suspected defect fuzzy area, a skeleton extraction algorithm is used to obtain the skeleton thereof; For each edge pixel point on the skeleton, a straight line perpendicular to the skeleton is obtained at the edge pixel point, and the number of continuous edge pixel points including this edge pixel point passed by the straight line is taken as the cross-sectional width of this edge pixel point. The average cross-sectional width of all edge pixel points in the suspected defect blurred area is calculated as the average cross-sectional width of the suspected defect blurred area.
4. A method for detecting defects on the inner surface of a gas cylinder according to claim 2, characterized in that: The method for obtaining the length of the shape direction is: for each suspected defect blurred area, obtain the area composed of all continuous edge pixel points in the suspected defect blurred area as the edge continuous area, calculate the second-order moment in the edge continuous area, obtain the shape direction of the edge continuous area based on the second-order moment as the shape direction of the suspected defect blurred area, and obtain the length of the shape direction of each suspected defect blurred area.
5. A method for detecting defects on the inner surface of a gas cylinder according to claim 1, characterized in that: The method for acquiring the fuzzy region is as follows: for all fuzzy evaluation factors of the suspected defect fuzzy regions, the suspected defect fuzzy region with a fuzzy evaluation factor greater than a first preset threshold is taken as the fuzzy region.
Citation Information
Patent Citations
Infrared image enhancement method for electrical equipment based on non-downsampling shear wave transform
CN109035166A
Industrial part defect detection method, device and equipment and storage medium
CN118014959A