A method for dispensing quality detection based on image processing

By performing image processing on the dispenser, detecting the shape change of the elliptical hole, and calculating its similarity with the elliptical hole on the standard dispenser, the problem of low accuracy of dispenser quality detection in the existing technology is solved, and an efficient and accurate Dispenser quality detection and automatic marking functions.

CN118470654BActive Publication Date: 2024-09-20BAO JI HONG SHUN DA TITANIUM IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410925853.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-09-20
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

The existing technology does not have high accuracy in the quality detection of dispensers and cannot reliably and accurately detect the quality of the dispenser, especially the shape changes of the oval hole, resulting in inaccurate detection results.

Method used

By taking the original image of the dispenser, preprocessing and edge detection are performed to determine the positions of the round and elliptical holes. Combined with connected domain analysis and distance transformation, the similarity between the elliptical hole and the elliptical hole on the standard dispenser is calculated to determine the distribution. The quality of the machine is determined, and unqualified oval holes are automatically marked.

Benefits of technology

It improves the accuracy and efficiency of distributor elliptical hole identification, optimizes the ellipticity calculation process, ensures the accuracy and reliability of distributor quality detection, provides timely feedback on quality problems, and improves production efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470654B
    Figure CN118470654B
Patent Text Reader

Abstract

The present invention relates to the field of dispenser quality detection, and the present invention relates to a dispenser quality detection method based on image processing. The invention obtains an image of the dispenser, processes it to obtain an edge image of the dispenser, and determines the position of the elliptical hole in the dispenser through Hough circle detection and clustering. The connected domain of the elliptical hole is subjected to distance transformation to extract a pixel sequence, and the similarity between the elliptical hole and the elliptical hole on the standard dispenser is calculated to obtain the ellipticity of the elliptical hole, and finally whether the quality of the dispenser is qualified is determined based on the ellipticity of the elliptical hole. The present invention improves the accuracy of the dispenser elliptical hole recognition, improves the efficiency of the dispenser elliptical hole recognition, and optimizes the dispenser ellipticity calculation process by customizing the clustering algorithm distance and extracting the pixel sequence, so as to obtain accurate dispenser quality detection results in a timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of dispenser quality detection, and in particular to a dispenser quality detection method based on image processing. Background Art

[0002] Industrial device distributors, especially those containing material holes, are widely used in the distribution and control of gases or fluids. This type of distributor mainly controls the flow and distribution of fluids or gases accurately through a series of precisely designed holes. Its basic components include multiple material holes, control valves, connecting pipes and monitoring sensors. This type of distributor is widely used in chemical, pharmaceutical, food processing and electronic manufacturing, ensuring accurate distribution and efficient operation in the production process. However, if the distributor has defects such as deformation, it may lead to a series of serious consequences. First, deformation will lead to uneven distribution and flow fluctuations, affecting the accuracy of the production process and product quality. Secondly, deformation may cause blockages and leakage, reduce system efficiency and increase maintenance costs, so the quality of the distributor is closely related to its shape.

[0003] In order to monitor the quality of the dispenser, in the prior art, the dispenser can be image processed and the quality of the dispenser can be determined based on the graphic features. For example, the Chinese patent application document with publication number CN116912231A discloses a quality detection method for new energy vehicle parts, which uses the vertical distance between each data point and the reference plane to analyze and obtain the flatness value characteristics of each divided area to detect the target. However, this technical means is applied to the dispenser detection, and it is not possible to achieve a more reliable and accurate quality detection. Summary of the invention

[0004] In order to solve the problem of low precision in dispenser quality detection, the present invention proposes a dispenser quality detection method based on image processing, comprising: photographing the dispenser to be detected to obtain an original image of the dispenser; preprocessing the original image to obtain a binary edge image; performing circle detection on the edge image to determine the positions of circular holes and elliptical holes in the edge image; performing connected domain analysis on the edge image, and combining the positions of the elliptical holes, performing distance transformation on the connected domains corresponding to the elliptical holes to obtain the longest pixel sequence and the shortest pixel sequence; calculating the similarity between the elliptical holes and the elliptical holes on the standard dispenser based on the longest pixel sequence and the shortest pixel sequence; and judging whether the quality of the dispenser to be detected meets the standard based on the similarity.

[0005] The inventors found that the dispenser mainly includes circular holes and elliptical holes, and in the actual production process, if there is a problem with the quality of the dispenser, it is often the elliptical hole that first shows a change in shape. Therefore, the inventors creatively proposed to determine the quality of the dispenser by detecting the shape change of the elliptical hole, that is, the ellipticity. Based on this, the distance transformation is performed on the elliptical hole of the dispenser, the pixel sequence is extracted, and the similarity between the elliptical hole and the elliptical hole on the standard dispenser is calculated to obtain the ellipticity of the elliptical hole, ensuring the accurate acquisition of the features to improve the calculation accuracy of the elliptical hole corresponding to the elliptical hole, and then reliably judge the quality of the dispenser, and mark the unqualified elliptical holes of the dispenser in the image to facilitate subsequent processing and quality control. The present invention optimizes the dispenser ellipticity calculation process by extracting the pixel sequence, so as to obtain accurate dispenser quality detection results in a timely manner, which is reliable, stable and highly accurate.

[0006] Further, calculating the similarity between the elliptical hole and the elliptical hole on the standard distributor also includes:

[0007] The similarity between the elliptical hole and the elliptical hole on the standard dispenser is calculated based on the pixel sequence, and the calculation formula is as follows:

[0008]

[0009] in, Indicates the similarity between the elliptical hole and the elliptical hole on the standard dispenser; The longest pixel sequence between the elliptical hole and the longest pixel sequence of the template is distance, The shortest pixel sequence between the elliptical hole and the shortest pixel sequence of the template is distance; represents the length of the longest pixel sequence of the elliptical hole, Indicates the length of the longest pixel sequence of the template; represents the length of the shortest pixel sequence of the elliptical hole, Indicates the length of the shortest pixel sequence of the template.

[0010] Furthermore, judging whether the quality of the dispenser to be tested meets the standard also includes:

[0011] The elliptical hole is mapped based on the similarity between the elliptical hole and the elliptical hole on the standard dispenser to obtain the elliptical degree of the elliptical hole, and an elliptical degree threshold is set. When the elliptical degree of the elliptical hole is less than the set threshold, it is considered that the elliptical degree does not meet the requirement, and the elliptical hole is marked in the image. The specific mapping relationship is as follows:

[0012]

[0013] in represents the ellipticity of the elliptical hole; represents a similarity index, reflecting the similarity between the elliptical hole and the standard elliptical hole; represents the similarity sensitivity parameter; Represents the similarity criterion parameter.

[0014] When judging the quality of the dispenser, when the ellipticity of the elliptical hole is lower than the preset threshold, the system can automatically mark the position of the unqualified elliptical hole in the image. This automatic marking function not only saves the time of manual inspection, but also can provide timely feedback on quality problems, which is conducive to timely adjustment and improvement in the manufacturing process. The present invention ensures the consistency and reliability of the dispenser quality by accurately marking unqualified elliptical holes, and improves production efficiency and product quality.

[0015] Furthermore, performing circle detection on the edge image to determine the positions of circular holes and elliptical holes in the edge image further includes:

[0016] Performing Hough circle detection on the edge image;

[0017] Count the number of times the radius of each Hough circle passes through the center of the circle, and cluster the accumulated number of times the center of the circle passes through the center of the circle;

[0018] The elliptical hole cluster is determined according to the size of the mode in each cluster, thereby determining the positions of the circular hole and the elliptical hole.

[0019] The accumulated times of the centers of each circle are obtained by Hough circle detection, and the accumulated times of the centers are clustered by custom distance calculation. The position of the dispenser elliptical hole is determined according to the clustering result, the accuracy of the dispenser elliptical hole recognition is improved, and the fixed circular holes and elliptical holes in the dispenser are distinguished, thereby reducing the complexity of subsequent calculations and improving the detection efficiency. The present invention improves the dispenser elliptical hole recognition accuracy through custom clustering algorithm distance, thereby improving the dispenser elliptical hole recognition efficiency, which is efficient and accurate.

[0020] Furthermore, clustering the accumulated times of the circle centers also includes:

[0021] K-Means clustering is performed on the cumulative number of circle centers. The distance calculation formula between each sample point and the center point is as follows:

[0022]

[0023] Among them, L represents the distance calculation formula, Indicates the number of sample points that are the same as the center point data. Indicates and The number of samples with the same sample value, Represents the value of the center point, Indicates The value of the samples; in k-means clustering, when the center point is a virtual point, the number of samples with the same value as the center point is replaced by the mode in the sample.

[0024] Furthermore, preprocessing the original image further includes:

[0025] performing noise reduction on the original image of the distributor;

[0026] Gray-scaling the de-noised image to obtain a grayscale image of the distributor;

[0027] The grayscale image of the distributor is processed using an edge detection algorithm to obtain an edge image of the distributor.

[0028] Furthermore, the original image of the distributor is subjected to noise reduction, further comprising:

[0029] The original image is subjected to median filtering for denoising to obtain a distributor denoised image.

[0030] Furthermore, grayscale processing is performed on the denoised image, further comprising:

[0031] The distributor denoising image is grayed out using a minimum value method to obtain a distributor grayscale image.

[0032] By performing noise reduction and grayscale processing on the original image of the distributor, the noise in the image can be effectively removed and important edge details can be retained. Specifically, the median filter denoising and the minimum value method grayscale are used to make the preprocessed image clearer, laying the foundation for subsequent edge detection and circle detection. The present invention significantly improves the image quality and reduces noise interference through the preprocessing process, thereby improving the accuracy and stability of the entire detection process.

[0033] Furthermore, the binary edge image acquisition method further includes:

[0034] Using a Laplacian edge detection algorithm on the dispenser grayscale image to obtain a dispenser edge image;

[0035] The minimum grayscale value of the edge in the distributor edge image is used as a segmentation threshold, and the distributor edge image is subjected to threshold segmentation to obtain a binary edge image.

[0036] By processing the grayscale image of the dispenser using the Laplacian edge detection algorithm, a high-quality edge image can be obtained. The Laplacian edge detection algorithm can effectively capture the fine edge features in the image by calculating the second-order derivative of the grayscale change in the image. The processed edge image can clearly show the outline of the hole on the dispenser, which is helpful for subsequent circle detection and morphological analysis. This method improves the accuracy of edge detection, makes the identification of elliptical holes and circular holes more accurate, and further improves the efficiency and effectiveness of the entire quality inspection process.

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

[0038] The present invention improves the accuracy and efficiency of distributor elliptical hole recognition and optimizes the distributor ellipticity calculation process by customizing clustering algorithm distance and extracting pixel sequence, thereby obtaining accurate distributor quality detection results in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0040] Figure 1 is a flowchart schematically showing a method for detecting gear defects based on image processing according to an embodiment of the present invention;

[0041] Figure 2 is a schematic top view of a distributor device after pretreatment in the present invention;

[0042] Figure 3 is a diagram schematically showing the logical structure of obtaining the position of the elliptical hole clustering cluster through the binarized edge image in the present invention;

[0043] Figure 4 It is a schematic diagram schematically showing a single elliptical hole connected domain and a longest pixel sequence and a shortest pixel sequence in the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

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

[0046] Dispenser quality detection method embodiment based on image processing:

[0047] like Figure 1 As shown, the dispenser quality detection method based on image processing of the present invention includes:

[0048] S1. Obtain an original image of the distributor and preprocess it; obtain a binary edge image of the distributor.

[0049] The original image can be obtained by photographing the produced distributor using a CCD camera, and the obtained distributor image is an RGB image. The preprocessing includes denoising and grayscale. Since the image needs to be subjected to Hough circle detection later, and Hough circle detection is sensitive to noise in the image, the image can be subjected to median filtering to remove the noise in the image. The denoised distributor image is converted into a grayscale image using the minimum value method to obtain the preprocessed distributor image, such as Figure 2 As shown, it includes elliptical holes for regulating the flow of fluid, gas or material, such as the regularly arranged elliptical holes in the middle area of ​​the figure; it also includes circular holes for fixing the distributor body, such as the irregularly distributed circular holes in the edge area of ​​the figure.

[0050] The preprocessed dispenser image may be subjected to a Laplacian edge detection algorithm to obtain a dispenser edge image, and the minimum grayscale value of the edge in the dispenser edge image may be used as a segmentation threshold. The dispenser edge image may be subjected to threshold segmentation to obtain a binary edge image.

[0051] By performing denoising and grayscale processing on the original image of the distributor, the noise in the image can be effectively removed and important edge details can be retained. Specifically, the median filter denoising and the minimum value method grayscale are used to make the pre-processed image clearer, laying the foundation for subsequent edge detection and circle detection.

[0052] S2. Get the position of the elliptical hole of the distributor.

[0053] In the distributor, the elliptical hole controls the distribution or regulates the flow of fluid, gas or material. The elliptical hole determines the quality of the distributor, and the round hole has almost no effect on the quality inspection of the distributor. Therefore, in order to improve the inspection efficiency, the elliptical hole of the produced distributor needs to be separated from the round hole and the elliptical hole. The specific method is as follows:

[0054] The binary edge image can be subjected to an opening operation in morphology to remove noise, and then the denoised edge image is subjected to Hough circle detection to detect circles (including circular holes and elliptical holes) in the distributor image that meet preset detection parameters, as well as the radius and center accumulation times of each circle, where the center accumulation times is the number of times the gradient direction of the circle edge passes through the center of the circle.

[0055] The preset parameters (including circular holes and elliptical holes) of the Hough circle detection in the present invention can be empirical values: dp=1, minDist=20, param1=100, param2=30, minRadius=10, maxRadius=50. The implementer can select appropriate parameter values ​​according to the actual situation. Among them, dp is the inverse ratio of the resolution of the Hough circle detection accumulator to the image resolution. Setting it to 1 means that the accumulator has the same resolution as the original image; minDist represents the minimum interval between the detected circles, which is set to 20 here to avoid detecting adjacent circles; param1 represents the high threshold for Canny edge detection, which is set to 100 to indicate that the edge detection has a high sensitivity and is suitable for clearer images; param2 represents the accumulator threshold of the Hough circle detection, which is set to 30 to indicate that only circles with an accumulator greater than 30 are detected; minRadius represents the minimum radius of the detected circle or ellipse, which is adjusted according to the actual size of the smallest hole in the distributor; maxRadius represents the maximum radius of the detected circle or ellipse, which is adjusted according to the actual size of the largest hole in the distributor.

[0056] The K-means clustering algorithm is used to obtain a clustering result by accumulating the number of times the circle center is located. The cluster formed by the elliptical hole is determined according to the size of the majority of each cluster in the clustering result, so as to obtain the position of the elliptical hole in the dispenser.

[0057] Specifically, the K-means clustering algorithm can be used to accumulate the number of times of the circle center, wherein the distance calculation formula between each sample point and the center point is as follows:

[0058]

[0059] in Represents the distance calculation formula; Indicates the number of sample points that are the same as the center point data; Indicates and The number of samples with the same sample value, Represents the value of the center point, Indicates The distance calculated by the above formula can avoid the influence of noise points on the clustering results, because there are fewer sample points with the same value as the noise point. When the center point is the same, the distance between the noise point and the center point is farther. The larger the number of sample points with the same value as the center point, the greater the calculated value of the isolated point. The larger the value of , the greater the distance between the center point and the isolated point. In k-means clustering, the center point may be a virtual point. When the center point is a virtual point, the number of samples with the same value as the center point is replaced by the mode in the sample.

[0060] Specifically, the method for determining the elliptical hole clustering cluster is as follows: the cumulative number of cluster A can be set to , the cumulative number of cluster B is , elliptical holes usually have a larger cumulative frequency mode of the center, because the changes of its edges in different directions are more complex; while the cumulative frequency mode of circular holes is smaller and concentrated. When , cluster A corresponds to elliptical holes, and cluster B corresponds to circular holes; on the contrary, when Then cluster A corresponds to circular holes, and cluster B corresponds to elliptical holes.

[0061] like Figure 3 As shown, the present invention uses the accumulated times of the centers of each circle in the Hough circle detection principle, and clusters the accumulated times of the centers of the circles by custom distance calculation, and determines the position of the dispenser elliptical hole by the mode of the accumulated times of the centers of the circles in the cluster cluster, thereby simply and effectively improving the accuracy of the dispenser elliptical hole recognition, and distinguishing between the fixed circular holes and the elliptical holes in the dispenser, thereby reducing the complexity of subsequent calculations and improving the detection efficiency. The present invention improves the dispenser elliptical hole recognition accuracy through the custom clustering algorithm distance, thereby improving the dispenser elliptical hole recognition efficiency, which is efficient and accurate.

[0062] S3. Obtain the pixel sequence of the connected domain corresponding to the elliptical hole.

[0063] A connected domain analysis is performed on the binary edge image obtained by S1, the connected domain is extracted, and the connected domain corresponding to the elliptical hole is obtained based on the position of the elliptical hole in the distributor in S2, that is, the connected domain corresponding to the elliptical hole is retained, and the remaining connected domains are deleted, and the connected domain corresponding to the elliptical hole is distance transformed. After the distance transformation, the pixel values ​​on the longest line in each connected domain are extracted to obtain the longest pixel sequence of the connected domain, and the pixel values ​​on the shortest line are extracted to obtain the shortest pixel sequence of the connected domain.

[0064] like Figure 4 As shown in the figure on the left, the connected domain corresponding to a single elliptical hole is obtained, and the coordinates of the two points with the longest distance in the connected domain of the elliptical hole are obtained, as shown in the figure on the right. With point , connect these two points with a straight line to get the line , then the straight line The sequence of pixel values ​​after all distance transformations is arranged in order, which is the longest pixel sequence of the elliptical hole. Similarly, the coordinates of the two closest points in the connected domain of the elliptical hole are obtained, such as the point With point , connect these two points with a straight line to get the straight line , then the straight line The sequence of pixel values ​​after all distance transformations is the shortest pixel sequence of the elliptical hole. That is, in a standard elliptical hole, the longest pixel sequence is the pixel values ​​of the pixels through which the major axis of the ellipse passes, arranged in order, and the shortest pixel sequence is the pixel values ​​of the pixels through which the minor axis of the ellipse passes, arranged in order.

[0065] S4. Calculate the similarity between the elliptical hole to be analyzed and the elliptical hole on the standard distributor.

[0066] Specifically, the similarity between the elliptical hole and the elliptical hole on the standard dispenser is calculated based on the pixel sequence, and the calculation formula is as follows:

[0067]

[0068] in, Indicates the similarity between the elliptical hole and the elliptical hole on the standard dispenser; Indicates the difference between the longest pixel sequence of the elliptical hole and the longest pixel sequence of the template distance, The shortest pixel sequence between the elliptical hole and the shortest pixel sequence of the template is distance; represents the length of the longest pixel sequence of the elliptical hole, Indicates the length of the longest pixel sequence of the template; represents the length of the shortest pixel sequence of the elliptical hole, Indicates the length of the shortest pixel sequence of the template.

[0069] when The closer it is to 1, the greater the difference between the elliptical hole and the longest pixel sequence of the template. The distance between the elliptical hole and the shortest pixel sequence of the template The closer the distance is, the more similar the law of pixel changes in the elliptical hole and the template elliptical hole is, and the similarity between the elliptical hole and the elliptical hole on the standard dispenser is. The closer it is to 1; when The closer it is to 1, the closer the length ratio of the elliptical hole to the longest pixel sequence of the template is to the length ratio of the elliptical hole to the shortest pixel sequence of the template, the closer the shape of the elliptical hole is to the shape of the elliptical hole in the template, and the similarity between the elliptical hole and the elliptical hole on the standard dispenser is. The closer it is to 1.

[0070] The distance transformation is performed on the elliptical hole of the dispenser, the pixel sequence is extracted, and the similarity between the elliptical hole and the elliptical hole on the standard dispenser is calculated to obtain the ellipticity of the elliptical hole, so as to ensure the accurate acquisition of features and improve the calculation accuracy of the corresponding ellipticity of the elliptical hole, and then reliably judge the quality of the dispenser, and mark the unqualified elliptical holes of the dispenser in the image for subsequent processing and quality control.

[0071] S5. Determine whether the dispenser to be tested meets the quality requirements based on the similarity.

[0072] The elliptical hole can be mapped based on the similarity between the elliptical hole and the elliptical hole on the standard dispenser to obtain the elliptical degree of the elliptical hole, and an elliptical degree threshold is set. When the elliptical degree of the elliptical hole is less than the set threshold, it is considered that the elliptical degree does not meet the requirement, and the elliptical hole is marked in the image. The specific mapping relationship is as follows:

[0073]

[0074] in represents the ellipticity of the elliptical hole; Indicates the similarity between the elliptical hole and the elliptical hole on the standard dispenser; Represents the similarity sensitivity parameter, which controls the similarity Near the threshold When , the rate of change of ellipticity; Represents the similarity criterion parameter, which determines the threshold from when the elliptical hole shape is considered to meet the qualification.

[0075] when When the value is larger, the ellipticity of the elliptical hole is larger, and when it is closer to 1, the elliptical hole meets the requirements more and the quality of the distributor is better. The larger the value, the more similar the elliptical hole is to the elliptical hole on the standard distributor. The bigger; when The larger the value, the greater the ellipticity is for similarity The more sensitive the change of is, the more accurately the quality difference of the elliptical hole shape can be reflected. The empirical value is given in the present invention. , the implementer can give a suitable value according to the actual situation; when When the size is larger, it means that the similarity standard between the elliptical hole and the elliptical hole on the standard distributor is higher, and the shape of the elliptical hole is more difficult to approach the standard. The empirical value is given in the present invention. , implementers can give appropriate values ​​according to actual conditions.

[0076] when When it is close to 1, the ellipticity of the elliptical hole is closer to the ellipticity of the elliptical hole on the standard distributor. Greater than or equal to threshold When , it is considered that the ellipticity of the elliptical hole meets the requirements, that is, the quality of the distributor is qualified; otherwise, when Less than threshold When the elliptical hole is considered to have an elliptical degree that does not meet the requirements, that is, the quality of the detected dispenser is unqualified, the present invention provides a preset threshold , implementers can give other appropriate thresholds based on actual conditions.

[0077] Specifically, the automatic marking function not only saves time for manual inspection, but also can provide timely feedback on quality issues, which helps to make timely adjustments and improvements in the manufacturing process. The present invention ensures the consistency and reliability of the quality of the dispenser by accurately marking unqualified elliptical holes, thereby improving production efficiency and product quality. Finally, the inventor creatively proposed to determine the quality of the dispenser by detecting the shape change of the elliptical hole in the dispenser, which is the most likely to reflect the quality of the dispenser, that is, the ellipticity.

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

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

Claims

1. A dispenser quality detection method based on image processing, characterized in that: The method comprises: Photographing the dispenser to be inspected to obtain an original image of the dispenser; Preprocessing the original image to obtain a binary edge image; Performing circle detection on the edge image to determine the position of the elliptical hole in the edge image includes: Performing Hough circle detection on the edge image; Count the number of times the radius of each Hough circle passes through the center of the circle, and cluster the accumulated number of times the center of the circle passes through the center of the circle; Determine the elliptical hole cluster according to the size of the mode in each cluster, so as to determine the position of the elliptical hole; The clustering of the accumulated times of the circle centers includes: K-means clustering is performed on the accumulated number of circle centers. The distance between each sample point and the center point during clustering is , specifically: ; in, Indicates the number of sample points that are the same as the center point data. Indicates and The number of samples with the same sample value, Represents the value of the center point, Indicates The value of each sample; in K-means clustering, when the center point is a virtual point, the number of samples with the same value as the center point is replaced by the mode of the sample; Performing a connected domain analysis on the edge image, and combining the position of the elliptical hole, performing a distance transformation on the connected domain corresponding to the elliptical hole to obtain a longest pixel sequence and a shortest pixel sequence; calculating the similarity between the elliptical hole and the elliptical hole on the standard distributor according to the longest pixel sequence and the shortest pixel sequence; wherein, after the distance transformation, the pixel values ​​on the longest line in each connected domain are extracted to obtain the longest pixel sequence of the connected domain, and the pixel values ​​on the shortest line are extracted to obtain the shortest pixel sequence of the connected domain; The similarity between the elliptical hole and the elliptical hole on the standard distributor is , specifically: ; in, The longest pixel sequence between the elliptical hole and the longest pixel sequence of the template is distance, The shortest pixel sequence between the elliptical hole and the shortest pixel sequence of the template is distance; represents the length of the longest pixel sequence of the elliptical hole, Indicates the length of the longest pixel sequence of the template; represents the length of the shortest pixel sequence of the elliptical hole, Indicates the length of the shortest pixel sequence of the template; Judging whether the quality of the dispenser to be tested meets the standard according to the similarity includes: The elliptical hole is mapped according to the similarity between the elliptical hole and the elliptical hole on the standard dispenser to obtain the elliptical degree of the elliptical hole, and an elliptical degree threshold is set. When the elliptical degree of the elliptical hole is less than the elliptical degree threshold, it is considered that the elliptical degree does not meet the requirement, and the elliptical hole is marked in the image. The specific mapping relationship is as follows: ; in represents the ellipticity of the elliptical hole; represents a similarity index, reflecting the similarity between the elliptical hole and the elliptical hole on the standard distributor; represents the similarity sensitivity parameter, if The larger the value, the more ellipticity is for similarity. The more sensitive the change; represents the similarity criterion parameter, if The larger the value is, the higher the similarity standard between the elliptical hole and the elliptical hole on the standard dispenser is.

2. The method for detecting the quality of a dispenser based on image processing according to claim 1, characterized in that: Preprocessing the original image includes: performing noise reduction on the original image of the distributor; Grayscale the denoised image to obtain a grayscale image of the distributor; The grayscale image of the dispenser is processed using an edge detection algorithm to obtain an edge image of the dispenser.

3. The method for detecting the quality of a dispenser based on image processing according to claim 2, characterized in that: The original image of the distributor is subjected to noise reduction, comprising: The original image is subjected to median filtering for denoising to obtain a distributor denoised image.

4. The method for detecting the quality of a dispenser based on image processing according to claim 3, characterized in that: Grayscale the denoised image, including: The distributor denoising image is grayed out using a minimum value method to obtain a distributor grayscale image.

5. The method for detecting the quality of a dispenser based on image processing according to claim 2, characterized in that: The binary edge image acquisition method comprises: Using a Laplacian edge detection algorithm on the dispenser grayscale image to obtain a dispenser edge image; The minimum grayscale value of the edge in the distributor edge image is used as a segmentation threshold, and the distributor edge image is subjected to threshold segmentation to obtain a binary edge image.