High-voltage power supply element defect identification method based on computer vision

Through a computer vision-based method, combined with connectivity domain analysis and Fourier descriptor, the correlation and scratch fit of edge pixel points are calculated, which solves the problem of low defect recognition accuracy of high-voltage power supply components and achieves more efficient defect detection.

CN119863467AActive Publication Date: 2025-04-22TESLAMAN HVPS(XIAN) CO LTD

Patent Information

Application Number
CN202510353206.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
2045-03-25

Smart Images

  • Figure CN119863467A_ABST
    Figure CN119863467A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a high-voltage power supply element defect identification method based on computer vision. The method comprises the steps of collecting a surface image of a high-voltage power supply element; the method comprises the following steps: acquiring a grayscale image and a connected domain thereof, acquiring a main direction of the connected domain, constructing a width sequence based on a length perpendicular to the main direction, acquiring a width change coefficient according to the width sequence, and acquiring ambiguity of a pixel point based on a pixel point neighborhood grayscale value; constructing a window for the edge pixel points, obtaining the correlation of the edge pixel points according to the classification of the connected domains in the window, obtaining the similarity between the connected domains according to the Fourier descriptors of the connected domains, and obtaining the scratch integrating degree of the edge pixel points based on the similarity; and screening the edge points of the scratch area according to the scratch integrating degree of the edge pixel points and the ambiguity of the edge pixel points, and completing defect identification. According to the invention, the surface defect detection efficiency of the high-voltage power supply element is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method for identifying defects of high-voltage power supply components based on computer vision. Background Art

[0002] High-voltage power supply components are the various modules that make up the high-voltage power supply, including transformers, rectifiers, filters, amplifiers and other devices. They are usually integrated together as high-voltage power supply equipment. Due to its own characteristics, its use is very wide. Its applications involve everything from aerospace to deep-sea exploration, from semiconductor processing equipment to nanotechnology, from testing instruments to environmental protection equipment, from new materials to high-energy physics, and it plays an important role in the industry.

[0003] Since the manufacturing process of high-voltage power supply components is complex and delicate, it is inevitable that design and manufacturing defects such as scratches, notches, and burrs will occur. For example, the equipment on the production line may be worn out after long-term use, resulting in an uneven surface of the equipment. These uneven surfaces are prone to scratches when in contact with components. These defects may cause a variety of problems and consequences that affect the performance of the equipment and cause some safety hazards such as leakage and short circuits, leading to subsequent product quality problems, and may even have a negative impact on the entire production line. At present, visual inspection methods are usually affected by factors such as camera shake and environmental noise. Therefore, the acquired high-voltage power supply component images are usually filtered and denoised, such as Gaussian filtering, wavelet denoising, etc., to enhance the image quality. However, the additional blur caused by the loss of details caused by the Gaussian filter smoothing process is ignored. The impact on the defect recognition results, resulting in poor defect recognition accuracy. Summary of the invention

[0004] In order to solve the technical problem of poor defect recognition accuracy, this application provides a high-voltage power supply component defect recognition method based on computer vision. The technical solution adopted is as follows: This application proposes a method for identifying defects of high-voltage power supply components based on computer vision, which includes the following steps: Acquire surface images of high-voltage power components; After denoising and graying the surface image, a grayscale image is obtained, and a connected domain analysis is performed on the grayscale image to obtain several connected domains; a vector is obtained for each pixel point in the connected domain, and the longest straight line in the direction with the largest number of vectors is recorded as the main direction line segment; a width sequence is formed according to the length of the vertical main direction line segment of the pixel points in the connected domain; the width variation coefficient of the connected domain is obtained according to the slope of the width sequence fitting straight line and the ratio of the number of pixel points on the edge of the connected domain to the number of pixel points on the main direction line segment; the blurriness of each pixel point is obtained according to the grayscale value and width of each pixel point in the connected domain and the width variation coefficient of the connected domain; A window is constructed for each edge pixel of a connected domain, and the correlation of the edge pixels is calculated according to the grayscale values ​​of the pixels belonging to the connected domain and the pixels not belonging to the connected domain in the window; the Fourier descriptor of the connected domain is calculated, and the scratch significance of the connected domain is obtained according to the grayscale value of the Fourier descriptor and the similarity of the Fourier descriptors of different connected domains; the scratch fit of the edge pixels is obtained according to the scratch significance of the connected domain and the correlation of the edge pixels; The edge points of the scratch area are screened according to the scratch fit and fuzziness of the edge pixels, and defect recognition is completed.

[0005] In the above scheme, based on the actual morphological features of the scratch area, the main direction of the connected domain and the width change sequence are used to analyze the variation law of the area width, and the edge fuzzy discrimination is calculated based on the variation law. The beneficial effect is that the pixels in the scratch edge area and the pixels in the inherent edge of the component can be further distinguished, avoiding the problem of information loss in the traditional image sampling process. The scratch significance is calculated based on the Fourier descriptor and DTW distance in the connected domain, and finally the scratch fit is calculated based on the edge fuzzy discrimination, scratch significance, gray values ​​inside and outside the connected domain and Pearson correlation coefficient. The beneficial effect is that it comprehensively considers the local texture characteristics of the image and the spatial relationship between pixels, and captures the scratch features more comprehensively. Secondly, the pixels in the scratch area are quantified, which enhances the description ability of the scratch features, avoids the excessive reliance of traditional methods on a single feature, and can reduce the problem of sensitivity of traditional threshold segmentation or edge detection to light and noise. Then, the determined scratch area is used to realize the recognition of surface defects of high-voltage power supply components, and the accuracy of surface defect detection of high-voltage power supply components is improved.

[0006] In one embodiment, the method of obtaining a grayscale image after denoising and graying the surface image, and obtaining a plurality of connected domains by performing connected domain analysis on the grayscale image is: The surface image is denoised by using Gaussian filtering algorithm, and the denoised surface image is grayed by weighted grayscale method to obtain a grayscale image, and the seed filling method is used to obtain several connected domains from the grayscale image.

[0007] In one embodiment, the method of obtaining a vector for each pixel point in the connected domain and recording the longest straight line in the direction with the largest number of vectors as the main direction line segment is: For each connected domain, the vector from each pixel to the centroid of the connected domain is obtained, and all vectors are counted according to direction to obtain a direction histogram; the direction with the largest number is taken as the main direction of the connected domain, and the longest straight line in the main direction in the connected domain is recorded as the main direction segment.

[0008] In one embodiment, the method of forming a width sequence according to the length of the line segments perpendicular to the main direction of the pixels in the connected domain is: For each pixel point on the main direction line segment, a straight line perpendicular to the main direction line segment is drawn, and the intersection of the straight line and the edge of the connected domain is recorded as the boundary feature point. The Euclidean distance between the boundary feature points corresponding to the same pixel point is taken as the main direction width of each pixel point. Taking the center point of the connected domain as the reference, draw a vertical line perpendicular to the main direction through the center point of the connected domain. For each side of the vertical line, sort the main direction width in order of the distance from the pixel point to the center point of the connected domain from far to near, and obtain a width sequence for each side.

[0009] In one embodiment, the method for obtaining the width variation coefficient of the connected domain according to the slope of the width sequence fitting straight line and the ratio of the number of pixels at the edge of the connected domain to the number of pixels on the main direction line segment is: Record the width sequence as the left width sequence and the right width sequence, and obtain the fitting straight line of each width sequence; The expression of width variation coefficient is: ; Indicates the slope of the fitted straight line corresponding to the left width sequence of the i-th connected domain, Indicates the slope of the fitted straight line corresponding to the right width sequence of the i-th connected domain, represents the number of boundary feature points in the i-th connected domain, Represents the number of pixels on the main direction line segment in the i-th connected domain.

[0010] In one embodiment, the method for obtaining the blurriness of each pixel point according to the grayscale value and width of each pixel point in the connected domain and the width variation coefficient of the connected domain is: For each pixel, preset K neighboring boundary feature points of the pixel, and calculate the grayscale mean of the eight neighborhoods of each pixel; The blurriness of each pixel is positively correlated with the difference in the main direction width of the neighboring boundary feature points, the grayscale mean of the pixel neighborhood, and the width variation coefficient of the connected domain.

[0011] In one embodiment, the method of constructing a window for each connected domain edge pixel point and calculating the correlation of the edge pixel points according to the grayscale values ​​of the pixel points belonging to the connected domain and the pixel points not belonging to the connected domain in the window is: A window is set with the edge pixel point in the connected domain as the center, and the pixel points in the window that do not belong to the connected domain are recorded as external pixel points, and the pixel points that belong to the connected domain are recorded as internal pixel points; Sort all internal pixels and external pixels according to their grayscale values ​​from small to large to obtain an internal grayscale sequence and an external grayscale sequence; The correlation between the internal grayscale sequence and the external grayscale sequence is calculated as the correlation of the edge pixels.

[0012] In one embodiment, the method of calculating the Fourier descriptor of the connected domain and obtaining the scratch significance of the connected domain according to the gray value of the Fourier descriptor and the similarity of the Fourier descriptors of different connected domains is: Extract the Fourier descriptor of each connected domain, and calculate the mean grayscale value of all pixels corresponding to its Fourier descriptors; form a sequence of grayscale values ​​of all Fourier descriptors in the connected domain, record it as a Fourier sequence, and calculate the similarity of Fourier sequences between connected domains; The expression of scratch saliency of connected domain is: , represents the mean gray value of the Fourier sequence corresponding to the i-th connected domain, represents the mean of the DTW distances between the Fourier sequences of the i-th connected domain and all other connected domains, represents the scratch significance of the i-th connected domain.

[0013] In one embodiment, the method for obtaining the scratch fit of edge pixels according to the scratch significance of the connected domain and the correlation of edge pixels is: The expression of scratch conformity of edge pixels is: ,in represents the correlation of the pth edge pixel in the ith connected domain, represents the scratch fit of the pth edge pixel in the i-th connected domain, The value is the preset value, norm() represents the linear normalization function.

[0014] In one embodiment, the method for selecting edge points of the scratch area according to the scratch conformity of edge pixels and the fuzziness of edge pixels is: Obtaining the screening coefficient of edge pixels according to the scratch conformity of edge pixels and the fuzziness of edge pixels; The screening coefficient of edge pixels is: ,in, is the weight parameter, is the screening coefficient of edge pixels, represents the scratch fit of the pth edge pixel in the i-th connected domain, Represents the fuzziness of the pth edge pixel in the i-th connected domain; The edge pixel points whose screening coefficients are greater than the preset segmentation threshold are regarded as the edge pixel points of the scratch area on the surface of the high-voltage power supply element.

[0015] The beneficial effects of the present application are: based on the actual morphological features of the scratch area, the main direction of the connected domain and the width change sequence are used to analyze the variation law of the area width, and the edge fuzzy discrimination is calculated based on the variation law. The beneficial effect is that the pixel points in the scratch edge area and the pixel points of the inherent edge of the component can be further distinguished, avoiding the problem of information loss in the traditional image sampling process. The scratch significance is calculated based on the Fourier descriptor and the DTW distance in the connected domain, and finally the scratch fit is calculated based on the edge fuzzy discrimination, the scratch significance, the gray value inside and outside the connected domain and the Pearson correlation coefficient. The beneficial effect is that the local texture characteristics of the image and the spatial relationship between pixels are comprehensively considered, and the scratch features are captured more comprehensively. Secondly, the pixel points in the scratch area are quantified, which enhances the description ability of the scratch features, avoids the excessive reliance of traditional methods on a single feature, and can reduce the problem of sensitivity of traditional threshold segmentation or edge detection to light and noise. Then, the determined scratch area is used to realize the recognition of surface defects of high-voltage power supply components, and the accuracy of surface defect detection of high-voltage power supply components is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A flow chart of a method for identifying defects of high-voltage power supply components based on computer vision provided in one embodiment of the present application; Figure 2 Flowchart of the method for obtaining the blurriness of pixel points. DETAILED DESCRIPTION

[0018] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of the high-voltage power supply component defect recognition method based on computer vision proposed in the present application in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0019] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0020] Embodiment of a method for identifying defects of high-voltage power supply components based on computer vision: The specific scheme of the high-voltage power supply component defect recognition method based on computer vision provided by the present application is described in detail below with reference to the accompanying drawings.

[0021] See also Figure 1 , which shows a flow chart of a method for identifying defects of high-voltage power supply components based on computer vision provided by an embodiment of the present application, the method comprising the following steps: Step S001, collecting a surface image of a high-voltage power supply component.

[0022] For high-voltage power supplies, their defects are mainly scratches on the surface. Therefore, the image of the surface of the high-voltage power supply component is collected by a CCD camera. In order to reduce the impact of uneven lighting, an LED light source is installed under the camera, and the image collected by the CCD camera is recorded as a surface image.

[0023] At this point, the surface image of the high voltage power supply element is acquired.

[0024] Step S002, denoising and graying the surface image to obtain a grayscale image, performing connected domain analysis on the grayscale image to obtain a number of connected domains; obtaining a vector for each pixel point in the connected domain, recording the longest straight line in the direction with the largest number of vectors as the main direction segment; constructing a width sequence according to the length of the main direction segment perpendicular to the pixels in the connected domain; obtaining the width variation coefficient of the connected domain according to the slope of the width sequence fitting straight line and the ratio of the connected domain edge pixel point to the main direction segment; obtaining the blurriness of each pixel point in the connected domain according to the domain grayscale value and width corresponding to each pixel point in the connected domain and the width variation coefficient of the connected domain.

[0025] During the processing of high-voltage power supply components, particles are easily generated on the surface due to the long-term operation of the machine tool. These particles come into contact with the components, causing scratches and other wear on the components. After grayscale transformation of the image with surface defects, it is analyzed that there are two types of pixels that can produce defect effects.

[0026] The first type is the pixel points of the real defects on the surface of the high-voltage power supply component; the second type is the "false" defect pixel points caused by the blurred edge of the image. The areas where the above two types of pixel points are located have different regional characteristics in the image. For example, when the intensity of the scratch or crack is much higher or lower than the natural texture of the part, the gray value of the scratch part is brighter than the surrounding normal part, that is, the gray value of the scratch part is larger. At this time, a lower threshold can be used to display only the pixels of the scratch or crack, and the number of these pixels is the defect signal. However, the pixel values ​​exceeding the threshold may be caused by uneven lighting or component structural properties rather than cracks or scratches. The gray values ​​of the pixels in these "false" defect areas are basically close to the gray values ​​of the real defects, and the threshold segmentation method cannot be used for processing. Moreover, most of the defects are on the surface of smooth components, and some fine scratches are difficult to distinguish, so the grayscale changes of the whole picture are generally very uniform and lack texture characteristics.

[0027] Since environmental noise has a great impact on image quality during image acquisition, it is necessary to denoise the surface image through a filtering algorithm. When the surface image is smoothed and denoised through a filtering algorithm, the surface image will lose details and become blurred. This will cause the pixel points at the edge of the scratch area and the edge of the connected domain in the surface image to be located in the blurred area. Therefore, in order to accurately identify the scratch defects of high-voltage power supply components, it is necessary to distinguish the pixel points.

[0028] Preferably, the filtering algorithm used in this embodiment is a Gaussian filtering algorithm; it should be noted that the filtering algorithm here serves to denoise the surface image, so other filtering algorithms may also be selected for denoising, such as bilateral filtering.

[0029] The denoised surface image is grayed to obtain a gray image. In this embodiment, the graying method uses a weighted gray method. Graying is only one method of graying a surface image. The implementer may use other graying methods, such as the average method, for processing.

[0030] For the grayscale image, a connected domain algorithm is used to segment the grayscale image into multiple different connected domains. In this embodiment, the connected domain algorithm used is a seed filling method, which is only used to segment the grayscale image into connected domains. The implementer can use other connected domain algorithms, such as the eight-connected domain algorithm.

[0031] For the scratch area, since the scratch area is caused by the contact between particles and components, resulting in scratches and abrasions on the components, the main direction of the scratch area is the wear force direction, and with the change of contact area, the width of the area at different positions in the scratch area is obviously different, showing the characteristics of being narrow at both ends and wider in the middle, and usually the scratch area is not a regular area.

[0032] For each connected domain in the grayscale image, obtain the coordinates of all pixels in the connected domain, based on which obtain the centroid of each connected domain, obtain the vector from each pixel in the connected domain to the centroid, count the direction distribution of all vectors, and calculate the number of vectors in each direction. This forms a direction histogram, in which the highest peak will represent the main direction of the connected domain.

[0033] In the connected domain, obtain all the straight lines with the same direction as the main direction, and record the longest straight line with the same direction as the main direction in the connected domain as the main direction line segment.

[0034] For each pixel point on the main direction line segment, a straight line perpendicular to the main direction line segment is drawn, and the intersection of the straight line and the edge of the connected domain is recorded as the boundary feature point. The Euclidean distance between the boundary feature points corresponding to the same pixel point is taken as the main direction width of each pixel point.

[0035] Furthermore, the main direction width of the pixel point on the main direction line segment closest to the center point of the connected domain is used as the standard width of the connected domain. In this embodiment, the Euclidean distance between the pixel point and the center point is used as the distance between the two.

[0036] In the main direction, take the center point of the connected domain as the reference, draw a vertical line perpendicular to the main direction through the center point of the connected domain, and record the two sides of the vertical line as the left side and the right side respectively. For each side, sort the main direction width in order from far to near according to the distance of the pixel points from the center point of the connected domain, and obtain a width sequence for each side, which are recorded as the left width sequence and the right width sequence respectively. The left width sequence and the right width sequence are respectively used as the input of the straight line fitting algorithm to obtain the fitting straight line. Any straight line fitting algorithm can be used here.

[0037] Furthermore, the corresponding slope of each fitting line is obtained, and the slope can characterize the change law of the width in the connected domain. Therefore, the width change coefficient of each connected domain is obtained based on the slopes of the two fitting lines and the number of pixels.

[0038] Preferably, in this embodiment, the width variation coefficient of the connected domain is ,in, Indicates the slope of the fitted straight line corresponding to the left width sequence of the i-th connected domain, Indicates the slope of the fitted straight line corresponding to the right width sequence of the i-th connected domain, represents the number of boundary feature points in the i-th connected domain, Represents the number of pixels on the main direction line segment in the i-th connected domain.

[0039] For each pixel, K neighboring boundary feature points of the pixel are preset, and the blurriness of each pixel is obtained according to the main direction width difference of the neighboring boundary feature points of each pixel, the grayscale mean of the pixel neighborhood and the width variation coefficient of the connected domain.

[0040] The blurriness of each pixel is positively correlated with the difference in the main direction width of the neighboring boundary feature points, the grayscale mean of the pixel neighborhood, and the width variation coefficient of the connected domain.

[0041] It should be noted that positive correlation means that when one variable increases, the other variable also increases, and the two variables change in the same direction. When one variable changes from large to small or from small to large, the other variable also changes from large to small or from small to large. This application does not impose any special restrictions.

[0042] Preferably, in this embodiment, the variance of the main direction width of all neighboring feature points of each pixel is calculated, and the product of the variance, the grayscale mean of the pixel neighborhood, and the width variation coefficient is normalized as the blur of the pixel in the connected domain. The selection of neighboring feature points is 5 in this embodiment, and the selected value is related to the value accuracy, and 6, 7, etc. can also be selected; the neighborhood of the pixel is the eight neighborhood of the pixel. The normalization method of this embodiment is a linear normalization method.

[0043] Preferably, in another embodiment of the present application, the standard deviation of the main direction width of all neighboring feature points of each pixel is calculated, and the sum of the standard deviation, the grayscale mean of the pixel neighborhood, and the width variation coefficient is normalized as the blurriness of the pixel in the connected domain. The number of neighboring feature points selected in this embodiment is 8; the neighborhood of the pixel is the eight neighborhoods of the pixel. The normalization method of this embodiment is the maximum and minimum value normalization method.

[0044] The greater the possibility that the i-th connected domain corresponds to the scratch area, the more significant the change characteristics of the connected domain width from the two ends to the middle of the i-th connected domain. , The larger the value of , the greater the curvature of the ith connected domain, the higher the irregularity, and the smaller the number of overlapping pixels between its main direction and the ith connected domain. The larger the value of The larger the value of ; if the width of the main direction corresponding to the neighboring edge pixel of the pixel point changes greatly, it means that the probability that the neighboring boundary feature point is located at the irregular edge is greater, that is, the greater the difference in the width of the main direction; and the larger the grayscale mean of the pixel point in the pixel point neighborhood, the more likely it is to be blurred, that is, the greater the blurriness of the pixel point, the greater the probability that the pixel point is located in the boundary blur area caused by the scratch. The flowchart of the method for obtaining the blurriness of the pixel point is as follows Figure 2 shown.

[0045] At this point, the blurriness of each pixel is obtained.

[0046] Step S003, construct a window for each edge pixel of a connected domain, and calculate the correlation of the edge pixels according to the grayscale values ​​of the pixels in the window that belong to the connected domain and the pixels that do not belong to the connected domain; calculate the Fourier descriptor of the connected domain, and obtain the scratch significance of the connected domain according to the grayscale value of the Fourier descriptor and the similarity of the Fourier descriptors of different connected domains; obtain the scratch fit of the edge pixels according to the scratch significance of the connected domain and the correlation of the edge pixels.

[0047] In surface images, there is a specific spatial relationship between pixels and their neighboring pixels, which constitutes the texture features of the image. Scratches, as an unnatural image element, disrupt this spatial relationship, making the texture features of the scratched area irregular or blurred. Secondly, the presence of scratches weakens the edge contrast, making the edge unclear, thus affecting the edge detection and analysis of the image.

[0048] Since the scratch defect area is generally distributed continuously and unevenly on the surface of the high-voltage power supply component, the original texture structure in the image, such as the text, patterns and other components on the surface of the original, has a strong distribution regularity.

[0049] The Fourier descriptor of each connected domain is extracted to characterize the image information of different edge points on the edge of each connected domain. If the connected domain belongs to the scratch defect area, the elements in the corresponding Fourier descriptor should show the enhancement of high-frequency components, the non-uniformity of the amplitude spectrum, the disorder of the phase spectrum, etc. On the contrary, if the connected domain belongs to the inherent connected domain of the surface of the high-voltage power supply element, the elements in the corresponding Fourier descriptor should show the dominance of low-frequency components, the regularity of the amplitude spectrum and phase spectrum, and the uniformity of energy distribution. Therefore, their characteristic differences are used to distinguish the scratch defect area and the inherent connected domain of the surface of the high-voltage power supply element.

[0050] Take the edge pixels on each connected domain as the center pixels, and set a A window of size is created, and the pixels in the window that belong to this connected domain are recorded as internal pixels, and the pixels in the window that do not belong to this connected domain are recorded as external pixels. The internal pixels and external pixels in each window are sorted in ascending order according to the grayscale value, and the internal grayscale sequence and external grayscale sequence of the window are obtained.

[0051] For each connected domain, the mean grayscale value of the pixel points corresponding to all its Fourier descriptors is calculated; the grayscale values ​​of all Fourier descriptors in the connected domain are combined into a sequence recorded as a Fourier sequence, and the DTW distance of the Fourier sequences between connected domains is calculated.

[0052] The scratch saliency of the connected domain is obtained according to the mean gray value of the Fourier sequence corresponding to each connected domain and the DTW distance between the Fourier sequence of the connected domain and all other connected domains. ,in represents the mean gray value of the Fourier sequence corresponding to the i-th connected domain, represents the mean of the DTW distances between the Fourier sequences of the i-th connected domain and all other connected domains, Indicates the scratch significance of the i-th connected domain. If the mean of the DTW distance is larger, it means that the difference between the current connected domain and the other connected domains is larger, which means that the current connected domain is more likely to be a scratch area, and the larger the mean of the Fourier descriptor of the connected domain itself, the more significant it is.

[0053] For each connected edge pixel point, the correlation between its internal grayscale sequence and external grayscale sequence is calculated. In this embodiment, the correlation is obtained by the Pearson correlation coefficient. In addition, the implementer can use other algorithms for calculating the correlation to obtain it.

[0054] The scratch fit of edge pixels is obtained according to the scratch significance of the connected domain and the correlation of edge pixels.

[0055] The scratch fit of edge pixels is positively correlated with the scratch significance of the connected domain and negatively correlated with the correlation of edge pixels.

[0056] Preferably, in this embodiment, ,in represents the correlation of the pth edge pixel in the ith connected domain, represents the scratch fit of the pth edge pixel in the i-th connected domain, The function here is to place the denominator at 0, and its value is 1. norm() represents a linear normalization function. The normalization function can be other normalization functions, such as the maximum and minimum value functions.

[0057] Preferably, in another embodiment of the present application, , the scratch fit of edge pixels is calculated by logarithmic function.

[0058] At this point, the scratch fit of the edge pixels is obtained.

[0059] Step S004, filtering edge points of the scratch area according to the scratch conformity and fuzziness of the edge pixels, and completing defect recognition.

[0060] The screening coefficient of the edge pixel point is obtained according to the scratch fit degree of the edge pixel point and the fuzziness of the edge pixel point, and the edge points of the scratch area are screened according to the screening coefficient.

[0061] Preferably, in this embodiment, ,in, is the weight parameter, is the screening coefficient of edge pixels, represents the fuzziness of the pth edge pixel in the ith connected domain. The value of is 0.4, and other embodiments may also take the value as 0.5 and 0.6.

[0062] The screening coefficients of all edge pixels on all connected domains are used as input, and the segmentation threshold is obtained using the Otsu threshold algorithm. The edge pixels whose screening coefficients are greater than the segmentation threshold are used as edge pixels of the scratch area on the surface of the high-voltage power supply component. Then, the pixels at the edge of the scratch area are marked with specific colors in the feature map, and then the marked pixels are expanded to enhance the features of the scratches and connect the adjacent edge points. Then, the regional growing algorithm is applied through the connected domain analysis to merge them into a complete scratch area, thereby realizing the recognition of surface defects of the high-voltage power supply component. The expansion operation and the regional growing algorithm are both well-known technologies and will not be described in detail here.

[0063] At this point, the identification of component surface defects is completed.

[0064] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

[0065] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A method for identifying defects in high-voltage power supply components based on computer vision, characterized in that: The method comprises the following steps: Acquire surface images of high-voltage power components; After denoising and graying the surface image, a grayscale image is obtained, and a connected domain analysis is performed on the grayscale image to obtain several connected domains; a vector is obtained for each pixel point in the connected domain, and the longest straight line in the direction with the largest number of vectors is recorded as the main direction line segment; a width sequence is formed according to the length of the vertical main direction line segment of the pixel points in the connected domain; the width variation coefficient of the connected domain is obtained according to the slope of the width sequence fitting straight line and the ratio of the number of pixel points on the edge of the connected domain to the number of pixel points on the main direction line segment; the blurriness of each pixel point is obtained according to the grayscale value and width of each pixel point in the connected domain and the width variation coefficient of the connected domain; A window is constructed for each edge pixel of a connected domain, and the correlation of the edge pixels is calculated according to the grayscale values ​​of the pixels belonging to the connected domain and the pixels not belonging to the connected domain in the window; the Fourier descriptor of the connected domain is calculated, and the scratch significance of the connected domain is obtained according to the grayscale value of the Fourier descriptor and the similarity of the Fourier descriptors of different connected domains; the scratch fit of the edge pixels is obtained according to the scratch significance of the connected domain and the correlation of the edge pixels; The edge points of the scratch area are screened according to the scratch fit and fuzziness of the edge pixels, and defect recognition is completed.

2. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method of obtaining a grayscale image after denoising and graying the surface image, and obtaining a plurality of connected domains by performing connected domain analysis on the grayscale image is as follows: The surface image is denoised by using Gaussian filtering algorithm, and the denoised surface image is grayed by weighted grayscale method to obtain a grayscale image, and the seed filling method is used to obtain several connected domains from the grayscale image.

3. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method of obtaining a vector for each pixel point in the connected domain and recording the longest straight line in the direction with the largest number of vectors as the main direction line segment is: For each connected domain, the vector from each pixel to the centroid of the connected domain is obtained, and all vectors are counted according to direction to obtain a direction histogram; the direction with the largest number is taken as the main direction of the connected domain, and the longest straight line in the main direction in the connected domain is recorded as the main direction segment.

4. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method for forming a width sequence according to the length of the line segment perpendicular to the main direction of the pixel points in the connected domain is: For each pixel point on the main direction line segment, a straight line perpendicular to the main direction line segment is drawn, and the intersection of the straight line and the edge of the connected domain is recorded as the boundary feature point. The Euclidean distance between the boundary feature points corresponding to the same pixel point is taken as the main direction width of each pixel point. Taking the center point of the connected domain as the reference, draw a vertical line perpendicular to the main direction through the center point of the connected domain. For each side of the vertical line, sort the main direction width in order of the distance from the pixel point to the center point of the connected domain from far to near, and obtain a width sequence for each side.

5. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method for obtaining the width variation coefficient of the connected domain according to the slope of the width sequence fitting straight line and the ratio of the number of pixels at the edge of the connected domain to the number of pixels on the main direction line segment is: Record the width sequence as the left width sequence and the right width sequence, and obtain the fitting straight line of each width sequence; The expression of width variation coefficient is: ; Indicates the slope of the fitted straight line corresponding to the left width sequence of the i-th connected domain, Indicates the slope of the fitted straight line corresponding to the right width sequence of the i-th connected domain, represents the number of boundary feature points in the i-th connected domain, Represents the number of pixels on the main direction line segment in the i-th connected domain.

6. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 4, characterized in that: The method for obtaining the blurriness of each pixel point according to the domain grayscale value and width corresponding to each pixel point in the connected domain and the width variation coefficient of the connected domain is: For each pixel, preset K neighboring boundary feature points of the pixel, and calculate the grayscale mean of the eight neighborhoods of each pixel; The blurriness of each pixel is positively correlated with the difference in the main direction width of the neighboring boundary feature points, the grayscale mean of the pixel neighborhood, and the width variation coefficient of the connected domain.

7. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method of constructing a window for each connected domain edge pixel point and calculating the correlation of the edge pixel points according to the grayscale values ​​of the pixel points belonging to the connected domain and the pixel points not belonging to the connected domain in the window is: A window is set with the edge pixel point in the connected domain as the center, and the pixel points in the window that do not belong to the connected domain are recorded as external pixel points, and the pixel points that belong to the connected domain are recorded as internal pixel points; Sort all internal pixels and external pixels according to their grayscale values ​​from small to large to obtain an internal grayscale sequence and an external grayscale sequence; The correlation between the internal grayscale sequence and the external grayscale sequence is calculated as the correlation of the edge pixels.

8. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method of calculating the Fourier descriptor of the connected domain and obtaining the scratch significance of the connected domain according to the gray value of the Fourier descriptor and the similarity of the Fourier descriptors of different connected domains is: Extract the Fourier descriptor of each connected domain, and calculate the mean grayscale value of all pixels corresponding to its Fourier descriptors; form a sequence of grayscale values ​​of all Fourier descriptors in the connected domain, record it as a Fourier sequence, and calculate the similarity of Fourier sequences between connected domains; The expression of scratch saliency of connected domain is: , represents the mean gray value of the Fourier sequence corresponding to the i-th connected domain, represents the mean of the DTW distances between the Fourier sequences of the i-th connected domain and all other connected domains, represents the scratch significance of the i-th connected domain.

9. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method for obtaining the scratch fit of edge pixels according to the scratch significance of the connected domain and the correlation of edge pixels is: The expression of scratch conformity of edge pixels is: ,in represents the correlation of the pth edge pixel in the ith connected domain, represents the scratch fit of the pth edge pixel in the i-th connected domain, The value is the preset value, norm() represents the linear normalization function.

10. The method for identifying defects of high-voltage power supply components based on computer vision according to claim 1, characterized in that: The method for selecting edge points of the scratch area according to the scratch conformity of edge pixels and the fuzziness of edge pixels is: Obtaining the screening coefficient of edge pixels according to the scratch conformity of edge pixels and the fuzziness of edge pixels; The screening coefficient of edge pixels is: ,in, is the weight parameter, is the screening coefficient of edge pixels, represents the scratch fit of the pth edge pixel in the i-th connected domain, Represents the fuzziness of the pth edge pixel in the i-th connected domain; The edge pixel points whose screening coefficients are greater than the preset segmentation threshold are regarded as the edge pixel points of the scratch area on the surface of the high-voltage power supply element.

Citation Information

Patent Citations

  • Intelligent latex viscosity control method based on image processing

    CN116523883A

  • Intelligent detection method for surface defects of power adapter

    CN118014989A

  • Printing pattern defect detection method and system for plastic package

    CN118411367A

  • Food packaging bottle defect visual detection method and system

    CN118864468A

  • Method for eddy current thermography defect reconstruction baseed on electrical impedance tomography

    US20220412919A1

Cited By

  • Binding belt defect detection method and system for banding machine

    CN120107257A

  • A method and system for detecting cable tie defects in a cable tie machine

    CN120107257B

  • Aluminum alloy casting machining forming quality evaluation method

    CN120451164A

  • Circuit board microsection image defect detection method

    CN120635071A

  • Low-power-consumption acquisition and transmission system for industrial visual inspection

    CN121010604A