A visually assisted identification method and system for defects on the sealing surface of a fluorine-lined ball valve
By extracting and screening feature points in the sealing surface image of the fluorine-lined ball valve, and combining grayscale distribution and grayscale gradient changes, multiple types of defects are identified, which solves the problem of low identification accuracy in the existing technology and achieves more efficient defect detection.
Patent Information
- Application Number
- CN202411106431.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-13
AI Technical Summary
When the existing technology detects multiple types of defects on the sealing surface of fluorine-lined ball valves, it cannot take into account the characteristics of various defect types, resulting in low identification accuracy.
By collecting sealing surface images, extracting feature points and their feature vectors, screening scratches, wear and bulge feature points, combining local grayscale distribution and grayscale gradient changes, identify defect locations and categories, and use neural network models for training and detection .
It improves the accuracy of sealing surface defect detection, effectively screens out scratches, wear and raised feature points, and improves the model's ability to identify multiple types of defects.
Smart Images

Figure CN118644478B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sealing surface defect recognition, and in particular to a method and system for visually assisting in identifying sealing surface defects of a fluorine-lined ball valve. Background Art
[0002] The internal ball and sealing surface of the fluorine-lined ball valve are lined with fluorine plastic materials, which have excellent corrosion resistance and can operate stably for a long time in corrosive media such as strong acids and alkalis. During the production and processing of fluorine-lined ball valves, due to limited equipment accuracy or improper manual operation, scratches, dents, wear and other defects may appear on the sealing surface. These defects will cause the fluorine-lined ball valve to be poorly sealed during use, which is easy to cause fluid leakage, and in severe cases may cause safety accidents such as fire and explosion. Therefore, during the production process of fluorine-lined ball valves, it is necessary to detect defects on the sealing surface, remove or repair unqualified sealing surfaces in a timely manner, and ensure that every sealing surface leaving the factory has qualified quality.
[0003] The most common defects on the sealing surface are scratches, dents, wear and tear, etc. Machine learning or deep learning technology is usually used to detect these defects. The existing technology is effective in detecting one defect feature, but when there are multiple types of defects in the image, it is impossible to accurately identify the characteristics of various defect types, resulting in low accuracy in identifying defect types on the sealing surface of the fluorine-lined ball valve. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide a method and system for visually assisting the identification of defects on the sealing surface of a fluorine-lined ball valve. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for visually assisting the identification of defects on a sealing surface of a fluorine-lined ball valve, the method comprising the following steps:
[0006] S1, collecting the image of the sealing surface of the fluorine-lined ball valve;
[0007] S2, obtaining each feature point and its feature vector in the image of the sealing surface of the fluorine-lined ball valve; obtaining the scratch feature point according to the feature vectors and local grayscale distribution characteristics of the feature points on all edges in the image of the sealing surface of the fluorine-lined ball valve;
[0008] S3, for each feature point other than the scratch feature point, filter the wear feature point according to the grayscale difference of all pixels in the neighborhood of different sizes of the feature point;
[0009] S4, for all feature points except the scratch feature points and the wear feature points, select the protruding feature points according to the local grayscale gradient changes of the feature points in different areas;
[0010] S5, identifying the defect position and defect category of the sealing surface image of the fluorine-lined ball valve to be inspected according to the local grayscale distribution of all scratch feature points, wear feature points and protrusion feature points.
[0011] Furthermore, the method for obtaining each feature point and its feature vector in the fluorine-lined ball valve sealing surface image includes: using a feature point extraction algorithm to obtain each feature point and its feature vector on the fluorine-lined ball valve sealing surface image; the feature vector includes direction and length.
[0012] Furthermore, the method for obtaining scratch feature points includes:
[0013] Taking each feature point as the initial point, the target contour extraction algorithm is used on the sealing surface image of the fluorine-lined ball valve to obtain the edge line with each feature point as the initial point;
[0014] For each edge line, the scratch feature value of each edge line is obtained according to the grayscale difference between each feature point on the edge line and the pixel point in its local window;
[0015] Perform threshold segmentation on the scratch feature values of all edge lines to obtain a scratch segmentation threshold; record the edge lines whose scratch feature values are greater than or equal to the scratch segmentation threshold as scratch lines; and record the feature points on the scratch lines as scratch feature points.
[0016] Furthermore, the method for obtaining the scratch feature value of each edge line includes:
[0017] Obtain the minimum grayscale value of all pixels in a preset window centered on each feature point on the edge line, and record it as the local minimum grayscale of each feature point; calculate the mean grayscale value of all feature points on all edge lines; obtain the difference between the mean of the local minimum grayscale of all feature points and the mean grayscale value, and record it as the first difference; obtain the sum of the variance of the feature vector direction of all feature points on the edge line and the number of feature points; and record the ratio of the first difference to the sum as the scratch feature value of each edge line.
[0018] Furthermore, the method for screening wear characteristic points includes:
[0019] According to the gray value differences of all pixels in the neighborhoods of different sizes of the feature point and the feature vector of the feature point, the wear feature value of the feature point is obtained;
[0020] Perform threshold segmentation on the wear feature values of all feature points except the scratch feature point to obtain the wear segmentation threshold; and take the feature point whose wear feature value is greater than the wear segmentation threshold as the wear feature point.
[0021] Furthermore, the method for obtaining the wear characteristic value of the feature point includes: recording the wear characteristic value of the i-th feature point as , ;in, Represents the average grayscale value of all pixels in the n×n neighborhood centered on the i-th feature point; Represents the average grayscale value of all pixels in the h×h neighborhood centered on the i-th feature point; is a natural constant; Represents the length of the feature vector of the i-th feature point; A preset constant greater than 0.
[0022] Furthermore, the method for screening convex feature points includes:
[0023] Connected domains are extracted from the sealing surface image of the fluorine-lined ball valve to obtain each connected domain; for all feature points except scratch feature points and wear feature points, the feature points located inside the connected domain are recorded as convex discriminant feature points; the triplets consisting of the horizontal coordinate, vertical coordinate and grayscale value of all convex discriminant feature points are clustered to obtain the local density of each cluster and each convex discriminant feature point in it;
[0024] For each convex discriminant feature point, obtain the pixel point with the minimum grayscale gradient in the connected domain to which the convex discriminant feature point belongs, and record it as the local grayscale gradient minimum point; obtain the distance between the convex discriminant feature point and the local grayscale gradient minimum point; calculate the grayscale gradient difference between the convex discriminant feature point and the local grayscale gradient minimum point; and use the product of the distance and the grayscale gradient difference as the grayscale gradient density coefficient of the convex discriminant feature point;
[0025] The convex defect probability of each convex discriminant feature point is obtained by integrating the feature vector, gray gradient density coefficient and local density of the convex discriminant feature point in the local neighborhood of each convex discriminant feature point;
[0026] The convex defect probabilities of all convex discriminant feature points are subjected to threshold segmentation to obtain a convex segmentation threshold; the convex discriminant feature points whose convex defect probabilities are greater than the convex segmentation threshold are taken as convex feature points.
[0027] Furthermore, the method for obtaining the convex defect probability of each convex discriminant feature point specifically includes: recording the convex defect probability of the bth convex discriminant feature point as , ;in, represents the local density of the b-th convex discriminant feature point; Represents the gray gradient density coefficient of the b-th convex discriminant feature point; It represents the variance of the feature vector directions of all convex discriminant feature points contained in the n×n neighborhood of the bth convex discriminant feature point.
[0028] Furthermore, the method for identifying the defect position and defect category of the sealing surface image of the fluorine-lined ball valve to be inspected includes:
[0029] All scratch feature points, wear feature points and protrusion feature points are recorded as defect feature points; the eight neighborhood areas of each defect feature point are evenly divided into a first preset number of sub-areas, and the substituting into SIFT descriptors to obtain each feature vector;
[0030] A second preset number of fluorine-lined ball valve sealing surface images are obtained, and the defect positions and defect categories in the fluorine-lined ball valve sealing surface images are manually marked, and the defect positions and defect categories are used as training sets to train the neural network model. During the training process, all the feature vectors are spliced with the feature vectors output by the convolutional layer in the neural network model to obtain a trained neural network model; the trained neural network model is used to detect the fluorine-lined ball valve sealing surface images to be detected, and the defect positions and defect categories are obtained.
[0031] In the second aspect, an embodiment of the present application also provides a visually assisted identification system for defects on the sealing surface of a fluorine-lined ball valve, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned methods for visually assisted identification of defects on the sealing surface of a fluorine-lined ball valve are implemented.
[0032] This application has at least the following beneficial effects:
[0033] This application analyzes the shape and texture features of several common defects on the sealing surface of a fluorine-lined ball valve, constructs a scratch feature value based on the shape, length and neighborhood grayscale distribution of the scratch, and effectively screens out the scratch from all feature points; further analyzes the unclear edge features of the wear area, constructs a wear feature value through the grayscale distribution and edge features of the wear area, and effectively screens the wear feature points based on the difference between the wear area and the uneven area and the noise point area to improve the screening accuracy; further analyzes the flaky features of the uneven area, constructs the probability of raised defects based on the density and texture features of the raised feature points in the uneven area, and effectively screens the raised feature points of the uneven area to improve the screening accuracy; the feature vectors of the screened defect feature points are spliced with the feature vectors of the neural network model, so that the model obtains richer features, thereby improving the model's detection accuracy for defects on the sealing surface of fluorine-lined ball valves. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] 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.
[0035] Figure 1 A flowchart of a method for visually assisting the identification of sealing surface defects of a fluorine-lined ball valve provided in one embodiment of the present application;
[0036] Figure 2 A block diagram for obtaining scratch feature points provided in one embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] 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.
[0039] The specific scheme of a method and system for visually assisting in identifying sealing surface defects of a fluorine-lined ball valve provided by the present application is described in detail below in conjunction with the accompanying drawings.
[0040] See also Figure 1 , which shows a flowchart of a method for visually assisting the identification of sealing surface defects of a fluorine-lined ball valve provided by an embodiment of the present application, the method comprising the following steps:
[0041] S1, collect the image of the sealing surface of the fluorine-lined ball valve.
[0042] First, a high-resolution camera is used to collect images of the sealing surface of a fluorine-lined ball valve to obtain a fluorine-lined ball valve sealing surface image dataset. In this embodiment, a total of 5,000 images of the sealing surface of a fluorine-lined ball valve are obtained, which contain three types of sealing surface defects, namely scratches, wear, and unevenness. Then, the median filtering technology is used to process the image to remove noise while retaining the boundary information. The median filtering is a well-known technology, and the specific process will not be repeated.
[0043] S2, obtaining each feature point and its feature vector in the fluorine-lined ball valve sealing surface image; obtaining scratch feature points according to the feature vectors and local grayscale distribution characteristics of the feature points on all edges in the fluorine-lined ball valve sealing surface image.
[0044] In view of the problem that different defect features are easily misdetected when using a neural network to detect defect features of the sealing surface of a fluorine-lined ball valve, this embodiment designs a method for distinguishing feature points of different defects.
[0045] Firstly, the feature point extraction algorithm is used to obtain the feature points and their feature vectors on the sealing surface image of the fluorine-lined ball valve; the feature vector includes direction and length; specifically, the collected fluorine-lined ball valve sealing surface image is used as input, and the SURF algorithm is used to extract the feature points on the defect image and the feature vector of each feature point, the feature vector includes length m and direction ,SURF algorithm is a well-known technology, and the specific process will not be repeated here.
[0046] The obtained feature points include not only the defect feature points of scratches, wear and unevenness, but also the feature points of the sealing surface edge and some noise feature points. Therefore, it is necessary to further distinguish these feature points to obtain the defect feature points.
[0047] For scratch-shaped defects, the scratches are mostly short straight lines, and the color at the scratches is darker than the colors on both sides; while the edge of the sealing surface is a long arc, and the colors on both sides of the edge of the sealing surface are usually darker and lighter. Then the directions of the feature points at the scratches are relatively similar, while the directions of the feature points at the edges of the sealing surface vary greatly. The grayscale distribution histograms on both sides of the scratches are relatively similar, while the grayscale distribution histograms on both sides of the edges of the sealing surface are quite different.
[0048] Among these feature points, the scratch feature points and the sealing surface edge feature points are continuous points, while the wear feature points and the protrusion feature points are discrete points. Furthermore, each feature point is used as the initial point, and the target contour extraction algorithm is used on the fluorine-lined ball valve sealing surface image to obtain the edge line with each feature point as the initial point. Specifically, the position information of the feature point is used as the input of the boundary tracking algorithm, and the search is performed in turn in the eight neighborhood directions of the initial point to obtain a continuous edge line. The edge tracking algorithm is a well-known technology, and the specific process will not be repeated. In the obtained edge line, there are both scratches and sealing surface edges.
[0049] Based on the above features, a scratch feature value is constructed to characterize the probability that an edge is a scratch. For each edge line, the minimum grayscale value of all pixels in a preset window centered on each feature point on the edge line is obtained, and recorded as the local minimum grayscale of each feature point; the mean grayscale value of all feature points on all edge lines is calculated; the difference between the mean of the local minimum grayscale of all feature points and the mean grayscale value is obtained, and recorded as the first difference; the sum of the variance of the feature vector direction of all feature points on the edge line and the number of feature points is obtained; the ratio of the first difference to the sum is recorded as the scratch feature value of each edge line.
[0050] When the edge is a scratch, the grayscale value at the scratch is smaller, and the grayscale value of the area on both sides of the scratch is larger, that is, the greater the first difference, the greater the probability that the edge is a scratch; the smaller the variance of the directions of all feature points on the edge line, the more similar the direction angles of each edge point on the edge, and thus the more likely the edge is to be a straighter scratch; the fewer the number of feature points on the edge line, the shorter the edge, and thus the more likely the edge is to be a shorter scratch.
[0051] Furthermore, the scratch feature values of all edge lines are threshold segmented to obtain the scratch segmentation threshold; the edge lines whose scratch feature values are greater than or equal to the scratch segmentation threshold are recorded as scratch lines; the feature points on the scratch lines are recorded as scratch feature points. Specifically, the scratch feature values of all edge lines are used as the input of the Otsu threshold algorithm to obtain the scratch segmentation threshold x, and according to the size of the scratch segmentation threshold x, it is determined whether the edge is a scratch or a sealing surface edge. When the scratch feature value of the i-th edge line is When , the edge is judged to be a scratch line; when When , it is determined that the edge belongs to the sealing surface edge. At this point, the scratch edge is obtained, and the feature points contained in the scratch edge are the scratch feature points.
[0052] The block diagram for obtaining scratch feature points is as follows: Figure 2 shown.
[0053] S3, for each feature point other than the scratch feature point, the wear feature point is selected according to the grayscale difference of all pixels in the neighborhood of different sizes of the feature point.
[0054] Next, the feature points belonging to the wear-like defects are identified. First, the scratch feature points are removed from all the feature points. The feature points obtained include the feature points of the wear area, the feature points of the uneven area, and the noise feature points. For wear-like defects, the grayscale value at the defect is larger, and the grayscale value of the non-wear area adjacent to the wear area is smaller. The wear area has less obvious edge features than the uneven area and the noise point area, so the directional length of the wear area is smaller.
[0055] Based on the above features, a wear discrimination index is constructed to characterize the probability that a feature point belongs to a wear feature point. For each feature point other than the scratch feature point, the wear feature value of the i-th feature point is recorded as , ;in, Represents the average grayscale value of all pixels in the n×n neighborhood centered on the i-th feature point; represents the average grayscale value of all pixels in the h×h neighborhood centered on the i-th feature point; n and h are both odd numbers, in this embodiment, n is 7 and h is 11; is a natural constant; Represents the length of the feature vector of the i-th feature point; To preset a constant greater than 0 to prevent the denominator from being 0, 0.01 is taken here.
[0056] The larger the value of is, the higher the average grayscale value in the n×n neighborhood close to the center of the i-th feature point is, and the higher the probability that the feature point belongs to the wear feature point is; The smaller the value of is, the smaller the length of the direction vector of the i-th feature point is, which means that the grayscale change at the feature point is not obvious, and the probability that the feature point belongs to a wear feature point is higher.
[0057] Perform threshold segmentation on the wear feature values of all feature points except the scratch feature point to obtain the wear segmentation threshold; take the feature point whose wear feature value is greater than the wear segmentation threshold as the wear feature point. Specifically, determine whether the feature point belongs to the wear feature point according to the size of the wear segmentation threshold g. If , then the feature point is a wear feature point; if , then the feature point is not a wear feature point. So far, the wear feature point is obtained.
[0058] S4, for all feature points except the scratch feature points and the wear feature points, the protruding feature points are selected according to the local grayscale gradient changes of the feature points in different regions.
[0059] Next, the convex and concave feature points are identified. After removing the edge feature points and the wear feature points from all the feature points, the feature points obtained include the convex and concave feature points and the noise feature points. For the convex and concave defects, the features are denser, so the density of the convex feature points is larger; while the noise feature points are more dispersed, so the density of the noise feature points is smaller.
[0060] The area where the raised feature points are located is a sheet area, and connected domain extraction can be performed to obtain feature points in the connected domain. Specifically, the connected domain extraction is performed on the sealing surface image of the fluorine-lined ball valve to obtain each connected domain; for all feature points except the scratch feature points and the wear feature points, the feature points located inside the connected domain are recorded as raised discriminant feature points; the triples consisting of the horizontal coordinates, vertical coordinates and grayscale values of all raised discriminant feature points are clustered to obtain the local density of each cluster and each raised discriminant feature point therein.
[0061] In this embodiment, the local density of each convex discriminant feature point is calculated using the DPC density peak clustering algorithm. , all convex discriminant feature points are divided into different clusters. The cutoff distance in the algorithm is 1% of the total number of convex discriminant feature points. The DPC density peak clustering algorithm is a well-known technology, and the specific process will not be repeated here.
[0062] The highest point of the convexity and the lowest point of the concaveity are both feature points with the smallest grayscale gradient. Therefore, the farther the convex feature point is from the pixel point with the smallest grayscale gradient, the larger the grayscale gradient. Based on the above features, the grayscale gradient density coefficient of the convexity discriminant feature point is constructed: for each convexity discriminant feature point, the pixel point with the smallest grayscale gradient in the connected domain to which the convexity discriminant feature point belongs is obtained, and recorded as the local grayscale gradient minimum point; the distance between the convexity discriminant feature point and the local grayscale gradient minimum point is obtained; the grayscale gradient difference between the convexity discriminant feature point and the local grayscale gradient minimum point is calculated; the product of the distance and the grayscale gradient difference is used as the grayscale gradient density coefficient of the convexity discriminant feature point.
[0063] Specifically, the gray gradient density coefficient of the a-th convex discriminant feature point is recorded as , ; In the formula, It is the Euclidean distance between the convex discriminant feature point a and the minimum gray gradient point o in its connected domain. It is the difference between the grayscale gradient value of the convex discriminant feature point a and the grayscale gradient value of the point with the minimum grayscale gradient in its connected domain.
[0064] Gray gradient density coefficient The larger the value is, the farther the convex feature point a is from the lowest point of the grayscale gradient, the larger the grayscale gradient is, and the greater the probability that it is a convex feature point is.
[0065] In addition, the texture of the uneven area is relatively rough, so the direction angle difference of the neighboring pixels around the convex feature point is relatively large. Based on the local density, gray gradient density coefficient and direction angle difference of each feature point, an unevenness discrimination index is constructed to characterize the probability that a convexity discrimination feature point belongs to an uneven feature point.
[0066] Specifically, the convex defect probability of the bth convex discriminant feature point is recorded as , ;in, represents the local density of the b-th convex discriminant feature point; Represents the gray gradient density coefficient of the b-th convex discriminant feature point; represents the variance of the feature vector directions of all convex discriminant feature points contained in the n×n neighborhood of the b-th convex discriminant feature point; in this embodiment, n=9.
[0067] The larger it is, the denser the distribution of feature points around feature point b is, which means that the probability that the feature point belongs to a high-density uneven feature point is greater; The larger the value of , the greater the difference in the direction angles of all pixels in the n×n neighborhood around the bth feature point, which means that the probability that the feature point is a rough and uneven feature point is greater.
[0068] The convex defect probabilities of all convex discriminant feature points are subjected to threshold segmentation to obtain a convex segmentation threshold; the convex discriminant feature points whose convex defect probabilities are greater than the convex segmentation threshold are taken as convex feature points.
[0069] Specifically, the convex defect probability of all convex feature points is used as the input of the Otsu threshold algorithm to obtain the threshold t, and the feature point is judged whether it is a concave and convex feature point according to the size of the threshold t. , then the convex feature point is an uneven convex feature point; if , then the convex discrimination feature point is not an uneven convex feature point.
[0070] S5, identifying the defect position and defect category of the sealing surface image of the fluorine-lined ball valve to be inspected according to the local grayscale distribution of all scratch feature points, wear feature points and protrusion feature points.
[0071] All scratch feature points, wear feature points and protrusion feature points are recorded as defect feature points; the eight-neighborhood area of each defect feature point is evenly divided into a first preset number of sub-areas, and the SIFT descriptors are substituted to obtain each feature vector.
[0072] Specifically, when using the SURF algorithm to generate the feature point descriptors of the three types of feature points obtained above, the 8 neighborhood areas of the feature points are evenly divided into smaller 8×8 sub-areas, and 4 vector values are sampled in each sub-area, which can generate a total of 8×8×4=256-dimensional feature vectors. Assuming that the sum of the number of defect feature points is E, then E 256-dimensional feature vectors will be generated in the end.
[0073] A second preset number of fluorine-lined ball valve sealing surface images are obtained, and the defect positions and defect categories in the fluorine-lined ball valve sealing surface images are manually marked, and the defect positions and defect categories are used as training sets to train the neural network model. During the training process, all the feature vectors are spliced with the feature vectors output by the convolutional layer in the neural network model to obtain a trained neural network model; the trained neural network model is used to detect the fluorine-lined ball valve sealing surface images to be detected, and the defect positions and defect categories are obtained.
[0074] Specifically, the defect positions and defect categories in 5,000 images of the sealing surface of fluorine-lined ball valves are annotated and used as training sets to train the YOLOv8 network. During the training process, the E 256-dimensional feature vectors obtained are concatenated with the 256-dimensional output vector of the C2F module of the 15th layer of the YOLOv8 network to obtain a richer feature representation; wherein the Adam optimizer is used as the optimization algorithm of the model, the cross entropy loss function is used as the classification loss function of the model, and the DFL loss function and the CIOU loss function are used as the border regression loss of the model. After 300 rounds of iterative training, the trained neural network model is obtained. Neural network training is a well-known technology, and the specific process will not be repeated. The trained neural network model is used to detect the sealing surface images of the fluorine-lined ball valve to be inspected, and the defect positions and defect categories are obtained.
[0075] Based on the same inventive concept as the above-mentioned method, an embodiment of the present application also provides a system for visually assisting identification of defects on the sealing surface of a fluorine-lined ball valve, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned methods for visually assisting identification of defects on the sealing surface of a fluorine-lined ball valve are implemented.
[0076] Through the above description of the implementation method in combination with the accompanying drawings, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0077] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve, characterized in that: The method comprises the following steps: S1, collecting the image of the sealing surface of the fluorine-lined ball valve; S2, obtaining each feature point and its feature vector in the image of the sealing surface of the fluorine-lined ball valve; obtaining the scratch feature point according to the feature vectors and local grayscale distribution characteristics of the feature points on all edges in the image of the sealing surface of the fluorine-lined ball valve; S3, for each feature point other than the scratch feature point, filter the wear feature point according to the grayscale difference of all pixels in the neighborhood of different sizes of the feature point; S4, for all feature points except the scratch feature points and the wear feature points, select the protruding feature points according to the local grayscale gradient changes of the feature points in different areas; S5, identifying the defect position and defect category of the sealing surface image of the fluorine-lined ball valve to be inspected according to the local grayscale distribution of all scratch feature points, wear feature points and protrusion feature points; The method for obtaining each feature point and its feature vector in the fluorine-lined ball valve sealing surface image comprises: using a feature point extraction algorithm to obtain each feature point and its feature vector on the fluorine-lined ball valve sealing surface image; the feature vector comprises a direction and a length; The method for screening convex feature points comprises: Connected domains are extracted from the sealing surface image of the fluorine-lined ball valve to obtain each connected domain; for all feature points except scratch feature points and wear feature points, the feature points located inside the connected domain are recorded as convex discriminant feature points; the triplets consisting of the horizontal coordinate, vertical coordinate and grayscale value of all convex discriminant feature points are clustered to obtain the local density of each cluster and each convex discriminant feature point in it; For each convex discriminant feature point, obtain the pixel point with the minimum grayscale gradient in the connected domain to which the convex discriminant feature point belongs, and record it as the local grayscale gradient minimum point; obtain the distance between the convex discriminant feature point and the local grayscale gradient minimum point; calculate the grayscale gradient difference between the convex discriminant feature point and the local grayscale gradient minimum point; and use the product of the distance and the grayscale gradient difference as the grayscale gradient density coefficient of the convex discriminant feature point; The convex defect probability of each convex discriminant feature point is obtained by integrating the feature vector, gray gradient density coefficient and local density of the convex discriminant feature point in the local neighborhood of each convex discriminant feature point; The convex defect probabilities of all convex discriminant feature points are subjected to threshold segmentation to obtain a convex segmentation threshold; the convex discriminant feature points whose convex defect probabilities are greater than the convex segmentation threshold are taken as convex feature points.
2. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve according to claim 1, characterized in that: The method for obtaining scratch feature points comprises: Taking each feature point as the initial point, the target contour extraction algorithm is used on the sealing surface image of the fluorine-lined ball valve to obtain the edge line with each feature point as the initial point; For each edge line, the scratch feature value of each edge line is obtained according to the grayscale difference between each feature point on the edge line and the pixel point in its local window; Perform threshold segmentation on the scratch feature values of all edge lines to obtain a scratch segmentation threshold; record the edge lines whose scratch feature values are greater than or equal to the scratch segmentation threshold as scratch lines; and record the feature points on the scratch lines as scratch feature points.
3. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve as claimed in claim 2, characterized in that: The method for obtaining the scratch feature value of each edge line includes: Obtain the minimum grayscale value of all pixels in a preset window centered on each feature point on the edge line, and record it as the local minimum grayscale of each feature point; calculate the mean grayscale value of all feature points on all edge lines; obtain the difference between the mean of the local minimum grayscale of all feature points and the mean grayscale value, and record it as the first difference; obtain the sum of the variance of the feature vector direction of all feature points on the edge line and the number of feature points; and record the ratio of the first difference to the sum as the scratch feature value of each edge line.
4. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve as claimed in claim 1, characterized in that: The method for screening wear characteristic points comprises: According to the gray value differences of all pixels in the neighborhoods of different sizes of the feature point and the feature vector of the feature point, the wear feature value of the feature point is obtained; Perform threshold segmentation on the wear feature values of all feature points except the scratch feature point to obtain the wear segmentation threshold; and take the feature point whose wear feature value is greater than the wear segmentation threshold as the wear feature point.
5. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve as claimed in claim 4, characterized in that: The method for obtaining the wear characteristic value of the feature point includes: recording the wear characteristic value of the i-th feature point as , ;in, Represents the average grayscale value of all pixels in the n×n neighborhood centered on the i-th feature point; Represents the average grayscale value of all pixels in the h×h neighborhood centered on the i-th feature point; is a natural constant; Represents the length of the feature vector of the i-th feature point; A preset constant greater than 0.
6. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve as claimed in claim 1, characterized in that: The method for obtaining the convex defect probability of each convex distinguishing feature point specifically includes: recording the convex defect probability of the bth convex distinguishing feature point as , ;in, represents the local density of the b-th convex discriminant feature point; Represents the gray gradient density coefficient of the b-th convex discriminant feature point; It represents the variance of the feature vector directions of all convex discriminant feature points contained in the n×n neighborhood of the bth convex discriminant feature point.
7. A visually assisted identification method for sealing surface defects of a fluorine-lined ball valve as claimed in claim 1, characterized in that: The method for identifying defect positions and defect categories of a sealing surface image of a fluorine-lined ball valve to be inspected comprises: All scratch feature points, wear feature points and protrusion feature points are recorded as defect feature points; and a feature vector of each defect feature point is obtained; A second preset number of fluorine-lined ball valve sealing surface images are obtained, and the defect positions and defect categories in the fluorine-lined ball valve sealing surface images are manually marked, and the defect positions and defect categories are used as training sets to train the neural network model. During the training process, all the feature vectors are spliced with the feature vectors output by the convolutional layer in the neural network model to obtain a trained neural network model; the trained neural network model is used to detect the fluorine-lined ball valve sealing surface images to be detected, and the defect positions and defect categories are obtained.
8. A visually assisted identification system for sealing surface defects of fluorine-lined ball valves, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for visually assisting in identifying sealing surface defects of a fluorine-lined ball valve as described in any one of claims 1 to 7 are implemented.
