Potentiometer Visual Inspection Method for Potentiometer Production Line
Through DCT conversion and frequency screening technology, the bending information of potentiometer pins is extracted, which solves the problem of inaccurate bending detection in the existing technology, and realizes accurate positioning of bending defects.
Patent Information
- Application Number
- CN202411777795.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The prior art is difficult to accurately identify the protrusions and depressions caused by bending and rusting of potentiometer pins, resulting in inaccurate bending detection.
Using discrete cosine transform (DCT) as the basis, pin bending information is extracted by filtering frequency, transforming and reducing. The specific steps include: obtaining the DCT coefficient matrix of the pin area, filtering the abnormal pin area using the restored image corresponding to the maximum frequency, and further filtering out the bent positioning area by comparing the overlap degree and distribution discrete degree of the image and the reference restored image.
Accurately position the bent defects of the potentiometer pins, avoiding the misidentification of defects such as rust or scratches, and improving the accuracy of detection.
Smart Images

Figure CN119600012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial vision intelligent technology, and particularly relates to a potentiometer vision detection method for a potentiometer production line. Background Art
[0002] A potentiometer is a resistive element with three pins and a resistance value that can be adjusted according to a certain variation law. A potentiometer usually consists of a resistive body and a movable brush. When the brush moves along the resistive body, a resistance value or voltage related to the displacement amount is obtained at the output end. When the pins of the potentiometer are bent, it will cause the adjustment of the potentiometer adjustment circuit or current to fail or be unstable, and it may also cause poor contact between the moving piece contact and the resistive body, generating obvious noise. To avoid the influence of defective potentiometers, the bending situation of the pins should be analyzed and identified in a timely manner during the installation of the potentiometers.
[0003] Since the pins have a higher brightness compared to the background area of the circuit board, the prior art can extract the pin area through image processing means such as threshold segmentation, and then screen out the defective area through the abnormal image features in the pin area. However, during the pin installation process, the abnormal image features on the pin surface include not only bending features, but also protrusions and depressions caused by rust and scratches. In the prior art, it is impossible to effectively identify whether the defective area is a protrusion or depression caused by rust or scratches, or a defect caused by bending, resulting in inaccurate pin bending detection. Summary of the Invention
[0004] In order to solve the technical problem that in the prior art, the recognition of pin bending is easily affected by other defective image features, resulting in inaccurate bending detection, the purpose of the present invention is to provide a potentiometer vision detection method for a potentiometer production line, and the specific technical solution adopted is as follows:
[0005] The present invention proposes a potentiometer vision detection method for a potentiometer production line, and the method includes:
[0006] Obtain the pin image of the potentiometer on the potentiometer production line; obtain the pin area in the pin image by using the brightness feature;
[0007] For each pin area, obtain the DCT coefficient matrix of the pin area, take the restored image corresponding to the maximum frequency in the DCT coefficient matrix as the reference restored image, and obtain the pin bending probability according to the distance between the pixel points in the reference restored image and the boundary pixel points of the pin area; screen out the abnormal pin areas according to the pin bending probability;
[0008] Filter out the high-frequency coefficients in the DCT coefficient matrix of the abnormal pin region and traverse them according to the frequency magnitude. The restored image corresponding to each high-frequency coefficient is used as a comparison image; screen out the local suspected bending regions according to the overlapping degree of the pixel point regions in the comparison image and the reference restored image;
[0009] For each local suspected bending region in the pin image, count the frequency quantity in the local suspected bending region to obtain the distribution dispersion degree between the pixel points corresponding to the local suspected bending region in the comparison image; screen out the interference regions in the local suspected bending region according to the frequency quantity and the distribution dispersion degree to obtain the bending positioning region.
[0010] Further, the method for obtaining the pin region includes:
[0011] Use the threshold segmentation algorithm to segment the pixel points in the pin image into two types of pixel points, select the region composed of the pixel points with the maximum brightness as the initial pin region, and use the region corresponding to the minimum circumscribed rectangle of the initial pin region as the pin region.
[0012] Further, the method for obtaining the pin bending probability includes:
[0013] The shortest distance between each pixel point in the reference restored image and the boundary pixel point is used as the boundary distance, and the accumulated value of all boundary distances is used as the boundary feature value of the pin region;
[0014] For each pin region, obtain the difference in the boundary feature values between the pin region and other pin regions, and normalize the accumulated value of all boundary feature value differences to obtain the pin bending probability.
[0015] Further, the method for screening the abnormal pin region includes:
[0016] If the pin bending probability is greater than the preset bending probability threshold, the corresponding pin region is used as the abnormal pin region.
[0017] Further, the method for screening the high-frequency coefficients is:
[0018] Perform a serpentine traversal on the DCT coefficient matrix of the abnormal pin region with a step size of two coefficient lengths to obtain two groups of coefficients, and use the group of coefficients with the highest frequency as the high-frequency coefficients.
[0019] Further, the method for obtaining the local suspected bending region includes:
[0020] The pixel point region of the comparison image is used as the comparison region, and the pixel point region in the reference restored image is used as the target region;
[0021] For each target region, obtain the number of overlapping pixel points between the target region and the comparison region. After accumulating the number of overlapping pixel points of the target region in each comparison image and performing normalization processing, obtain the degree of overlap. If the degree of overlap of the target region is greater than a preset overlap degree threshold, then regard the target region as the local suspected bending region.
[0022] Furthermore, the pixel point region is obtained by clustering the pixel points in the comparison image and the reference restoration image through a clustering algorithm.
[0023] Furthermore, the method for obtaining the distribution dispersion degree includes:
[0024] For each pixel point in the local suspected bending region in the comparison image, take the distance between each pixel point and the nearest pixel point as the local distance, and obtain the distance difference between the local distance of each pixel point and the average local distance of all pixel points in the local suspected bending region. Accumulate the distance differences in all comparison images to obtain the distribution dispersion degree.
[0025] Furthermore, the method for obtaining the bending positioning region includes:
[0026] Multiply the distribution dispersion degree by the frequency number and perform a negative correlation mapping to obtain the recognition degree. According to the recognition degree, screen out the interference regions in the local suspected bending region to obtain the bending positioning region.
[0027] Furthermore, the step of screening out the interference regions in the local suspected bending region according to the recognition degree to obtain the bending positioning region includes:
[0028] Regard the local suspected bending regions with a recognition degree less than the preset recognition degree threshold as interference regions, and regard the local suspected bending regions with a recognition degree not less than the preset recognition degree threshold as the bending positioning regions.
[0029] The present invention has the following beneficial effects:
[0030] In view of the fact that different types of defects have different characteristics, resulting in different frequency compositions of information in the image, the present invention is based on the Discrete Cosine Transform (DCT). By screening frequencies, performing transformations, and restoring methods, the pin bending information is extracted. Since the pins have a relatively high brightness, there will be a large gray-scale difference from the background area. Therefore, the frequency of the pin area boundary in the DCT algorithm will also be larger. Thus, the restored image corresponding to the maximum frequency in the DCT coefficient matrix can characterize the characteristics of the pin area boundary, and the abnormal pin area can be screened out by the distance difference from the pin area boundary. Further, a refined analysis is carried out on the local area of the abnormal pin area. Since defects usually contain more frequency information due to their complex characteristics, the local suspected bending area can be screened out by comparing the overlapping degree of the pixel point areas between the image and the reference restored image. Further, the image characteristics in the local suspected bending area are analyzed. Defects such as rust or scratches have more complex image characteristics and more complex frequency information compared to bending, and the surface pixel point distribution is also more irregular. Therefore, based on the distribution dispersion degree and the number of frequencies, the bending positioning area can be accurately screened out. Through step-by-step screening, the bending defect can be accurately positioned. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0032] Figure 1 Flowchart of a potentiometer vision detection method for a potentiometer production line provided by an embodiment of the present invention;
[0033] Figure 2 Schematic diagram of a pin area provided by an embodiment of the present invention;
[0034] Figure 3 Schematic diagram of a serpentine traversal provided by an embodiment of the present invention;
[0035] Figure 4 Schematic diagram of pixel point area segmentation and comparison provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following, in combination with the accompanying drawings and preferred embodiments, details a potentiometer visual inspection method for a potentiometer production line according to the present invention, including its specific implementation manner, structure, features and effects, as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.
[0038] The embodiment of the present invention solves technical problems based on the DCT transformation algorithm. The DCT transformation is mainly used for data or image compression, which can transform the signal in the spatial domain to the frequency domain and has good decorrelation performance. The DCT transformation itself is lossless and creates good conditions for quantization, Huffman coding, etc. in the field of image coding. At the same time, since the DCT transformation is symmetric, the inverse DCT transformation can be used after quantization coding to restore the original image information at the receiving end. The DCT transformation has extremely wide applications in the current fields of image analysis and compression. The DCT transformation is used in common standards such as JPEG static image coding and MJPEG, MPEG dynamic coding. This algorithm is a well-known technical means for those skilled in the art, and the embodiment of the present invention is only an application, and the specific algorithm content will not be elaborated herein.
[0039] The following specifically describes the specific solution of a potentiometer visual inspection method for a potentiometer production line provided by the present invention in combination with the accompanying drawings.
[0040] Please refer to Figure 1 , which shows a flowchart of a potentiometer visual inspection method for a potentiometer production line provided by an embodiment of the present invention. The method includes:
[0041] Step S1: Obtain the pin image of the potentiometer on the potentiometer production line; obtain the pin area in the pin image by using the brightness feature.
[0042] In the embodiment of the present invention, a camera is installed directly above the potentiometer group processing and assembly production line to collect images of the potentiometer pin positions. It should be noted that, for the convenience of subsequent image processing, the collected pin images are grayscale images.
[0043] It should be noted that the existing potentiometer assembly process includes feeding the potentiometer housing, advancing, adjusting, moving, feeding the gear, vacuum pressing into the outer shell, feeding the ceramic substrate, and pressing the inner gear into the shell. After the above process is completed, the potentiometer products after rough machining can be sent to the assembly line for pin bending detection, and finally the products with defects can be screened according to the detection results.
[0044] In the pin image, since the pins are made of copper, iron, tin-plated, silver-plated and other metals, they have a higher brightness relative to the background area on the potentiometer. Therefore, conventional image feature extraction algorithms such as the threshold segmentation algorithm can be used to directly obtain the pin area in the pin image.
[0045] Preferably, in order to avoid the loss of information caused by directly using the result of classifying the pixel point brightness as the pin area, in an embodiment of the present invention, the pixel points in the pin image are segmented into two types of pixel points by using the threshold segmentation algorithm, and the area composed of the pixel points with the largest brightness is selected as the initial pin area, and the area corresponding to the minimum circumscribed rectangle of the initial pin area is used as the pin area. That is, the minimum circumscribed rectangle is used to determine more image information as the pin area. Please refer to Figure 2 , which shows a schematic diagram of the pin area provided by an embodiment of the present invention.
[0046] Step S2: For each pin area, obtain the DCT coefficient matrix of the pin area, use the restored image corresponding to the maximum frequency in the DCT coefficient matrix as the reference restored image, and obtain the pin bending probability according to the distance between the pixel points in the reference restored image and the boundary pixel points of the pin area; screen out the abnormal pin areas according to the pin bending probability.
[0047] After the processing in step S1, pin regions of multiple pins are obtained. There may be normal pin regions and defective pin regions among these pin regions, and further screening is required. For defective pin regions, their shapes will be quite different from those of normal pin regions. The bending defect will cause the boundary of the pin region to become shorter, resulting in the boundary not being a complete rectangle. Therefore, it is necessary to determine whether the pin region is bent according to the shape of the pin boundary. The pin regions extracted in step S1 are only directly extracted according to image features, and in order to ensure accuracy, the boundary regions thereof cannot be directly used as pin boundaries for analysis. Considering that there is a problem of arc in the boundary of the pin, its reflectivity should be stronger than that of other regions of the pin. Therefore, the corresponding frequency in the DCT coefficient matrix should also be the largest. Therefore, after obtaining the DCT coefficient matrix of the pin region in the embodiment of the present invention, the coefficient with the largest frequency in the DCT coefficient matrix is extracted and image restoration is performed to obtain a reference restored image. That is, the pixel points in the reference restored image are the pin boundary pixel points, and by further comparing the distances between the boundary pixel points of the pin region, the pin bending probability can be obtained. That is, the larger the distance, the greater the pin bending probability, and the abnormal pin regions can be screened out according to the pin bending probability. It should be noted that the abnormal pin regions are not completely determined to be the regions where the pins are bent, because rust or scraping will also cause changes in the shape of the pin region. Therefore, the abnormal pin regions only represent that abnormalities have occurred in the pin regions, and it is necessary to further analyze whether bending has occurred and perform local positioning through subsequent steps.
[0048] Preferably, in an embodiment of the present invention, the method for obtaining the pin bending probability includes:
[0049] The shortest distance between each pixel point in the reference restored image and the boundary pixel point is used as the boundary distance, and the accumulated value of all boundary distances is used as the boundary feature value of the pin region. The boundary feature value characterizes the distance feature between the real pin boundary and the region boundary in the current pin region.
[0050] For all pins on the potentiometer, defects should be a small probability event compared to normal pin regions, that is, the distance features in the abnormal pin regions have very obvious discreteness compared to other pin regions. Therefore, for each pin region, the difference in the boundary feature values between the pin region and other pin regions is obtained, and the accumulated value of all boundary feature value differences is normalized to obtain the pin bending probability. That is, if the differences in the boundary feature values between a certain pin region and other pin regions are relatively large, the final accumulated value will also be larger, indicating that the pin region is more likely to be an abnormal pin region containing defects, that is, the pin bending probability is greater.
[0051] It should be noted that the normalization method in the embodiments of the present invention may select the sigmoid function mapping method. In other embodiments of the present invention, normalization methods such as range normalization may also be selected, which are well-known technical means in the art and will not be elaborated and limited herein.
[0052] Preferably, in an embodiment of the present invention, the screening method for the abnormal pin area includes:
[0053] If the pin bending probability is greater than a preset bending probability threshold, the corresponding pin area is taken as the abnormal pin area. Since the pin bending probability in an embodiment of the present invention is a normalized value, the bending probability threshold is set to 0.7.
[0054] Step S3: Screen out high-frequency coefficients in the DCT coefficient matrix of the abnormal pin area and traverse them according to the frequency magnitude. The restored image corresponding to each high-frequency coefficient is used as a comparison image; screen out the local suspected bending area according to the overlapping degree of the pixel point areas in the comparison image and the reference restored image.
[0055] Compared with other pin areas, the defective area has more complex information. In the DCT transform algorithm, it can be regarded that the defective area is composed of pixel points at multiple frequencies, and the pixel points at each frequency can reflect the contour of the boundary of the defective area to a certain extent. Therefore, for the defective area, it is possible to judge whether a certain local area is a defective area by comparing the overlapping situation of the areas formed between different frequency information.
[0056] In the embodiments of the present invention, high-frequency coefficients are further screened out in the DCT coefficient matrix of the abnormal pin area. By screening out high-frequency coefficients, the interference of low-frequency information can be avoided and the calculation amount can be saved. Since the pin area is an obvious high-brightness area, the low-frequency information itself is less and may be the background area. Therefore, by screening high-frequency coefficients, unnecessary operation amounts can be reduced. Further traverse according to the frequency magnitude, that is, each high-frequency coefficient needs to be restored to obtain the corresponding restored image as a comparison image. If a defect anomaly occurs at a certain local position in the abnormal pin area, it will cause pixel point information to exist at this local position in the comparison images between different frequencies. Since the reference restored image is the information corresponding to the maximum frequency, the area formed by the pixel points in the reference restored image should be a more complete area. Therefore, based on the reference restored image, the local suspected bending area can be screened out according to the overlapping degree of the pixel point areas in the comparison image and the reference restored image.
[0057] Preferably, in the embodiments of the present invention, the screening method for high-frequency coefficients is:
[0058] Perform a serpentine traversal on the DCT coefficient matrix of the abnormal pin area with a step size of two coefficient lengths to obtain two sets of coefficients, and use the set of coefficients with the highest frequency as the high-frequency coefficients. Please refer to Figure 3 which shows a schematic diagram of serpentine traversal provided by an embodiment of the present invention. Through the serpentine traversal, using half of the number of coefficients in the matrix as the division, two sets of coefficients are obtained, that is, one set is the coefficients in the first half of the traversal process, and the other set is the coefficients in the second half of the traversal process.
[0059] Preferably, in the embodiment of the present invention, the pixel point area is obtained by clustering the pixel points in the comparison image and the reference restored image through a clustering algorithm. In the embodiment of the present invention, clustering is performed according to the distance between pixel points using the DBSCAN clustering algorithm, and each obtained cluster forms a corresponding pixel point area. Please refer to Figure 4 which shows a schematic diagram of pixel point area segmentation comparison provided by an embodiment of the present invention. Among them, the pixel point information included in the right figure is more than that in the left figure, that is, there are more pixel point areas, and it can be seen from Figure 4 that the pixel point area is not a region composed of only pixel points, but a region with a certain width and range, avoiding errors caused by too small pixel point areas. The specific width and range can be set by those skilled in the art themselves and will not be elaborated here.
[0060] Preferably, in the embodiment of the present invention, the method for obtaining the local suspected bending area includes:
[0061] The pixel point area of the comparison image is used as the comparison area, and the pixel point area in the reference restored image is used as the target area;
[0062] For each target area, obtain the number of overlapping pixel points between the target area and the comparison area, and after accumulating the number of overlapping pixel points in the target area of each comparison image and performing normalization processing, obtain the overlapping degree. In the embodiment of the present invention, the normalization method of the overlapping degree can select the accumulated number of overlapping pixel points as the numerator and the largest accumulated number of overlapping pixel points in all target areas as the denominator, and this ratio is the normalized overlapping degree.
[0063] If the overlapping degree of the target area is greater than the preset overlapping degree threshold, then the target area is used as the local suspected bending area. In the embodiment of the present invention, the overlapping degree threshold is set to 0.7.
[0064] Step S4: For each local suspected bending area in the pin image, count the number of frequencies in the local suspected bending area to obtain the distribution dispersion degree between the corresponding pixel points in the local suspected bending area of the comparison image; screen out the interference areas in the local suspected bending area according to the number of frequencies and the distribution dispersion degree to obtain the bending positioning area.
[0065] The locally suspected bending area represents the local area of the pin where abnormal defects exist. However, it cannot be directly determined that the defect is caused by bending. Scratches or rust on the surface of the pin will also have the characteristic of more overlapping frequency information. Therefore, further analysis is required. Considering that scratches or rust have richer texture features on their surfaces compared to bending defects, with a more uneven pixel distribution, and because of the richer texture features, such defect areas will also show relatively more frequency information. Therefore, in the embodiment of the present invention, the frequency quantity in the locally suspected bending area in the pin image is further statistically analyzed, and the distribution dispersion degree between the corresponding pixel points in the locally suspected bending area in the comparison image is obtained. It should be noted that since the frequency quantity is required to characterize the information complexity of the locally suspected bending area, it needs to be obtained from the original pin image; while the distribution dispersion degree needs to reflect the detailed texture characterization, and the locally suspected bending area in the pin image is a complete area, so it cannot be obtained in the pin image. Therefore, the distribution dispersion degree of the locally suspected bending area needs to be analyzed in each comparison image.
[0066] The larger the frequency quantity and the larger the distribution dispersion degree, it indicates that the locally suspected bending area is more likely to be an interference area caused by non-bending defects such as scratches or rust. Therefore, the interference area can be screened out to obtain the bending positioning area, and the accurate positioning of the bending of the potentiometer pin is completed. After the positioning is completed, the corresponding position can be framed in the pin image by methods such as image masking and visually displayed on the terminal to remind the staff.
[0067] Preferably, in an embodiment of the present invention, the method for obtaining the distribution dispersion degree includes:
[0068] For each pixel point in the locally suspected bending area in the comparison image, the distance between each pixel point and the nearest pixel point is used as the local distance, and the distance difference between the local distance of each pixel point and the average local distance of all pixel points in the locally suspected bending area is obtained. That is, the larger the distance difference between the local distance and the average local distance, it indicates that the distribution of this pixel point is more discrete. The more discrete pixel points in the locally suspected bending area, the greater its distribution dispersion degree. A comparison image contains multiple pixel points, that is, multiple distance differences. In the embodiment of the present invention, the information in all comparison images needs to be statistically analyzed. Therefore, all the distance differences in all comparison images are accumulated to obtain the distribution dispersion degree of the locally suspected bending area.
[0069] Preferably, in the embodiment of the present invention, the method for obtaining the bending positioning area includes:
[0070] Multiply the distribution dispersion degree by the frequency quantity and then perform a negative correlation mapping to obtain the recognition degree. According to the recognition degree, filter out the interference regions in the local suspected bending regions to obtain the bending positioning regions. The greater the recognition degree, the less the local suspected bending region is an interference region. Therefore, further, filter out the interference regions in the local suspected bending regions according to the recognition degree to obtain the bending positioning regions, including:
[0071] Regard the local suspected bending regions with a recognition degree less than the preset recognition degree threshold as interference regions, and regard the local suspected bending regions with a recognition degree not less than the preset recognition degree threshold as bending positioning regions. In the embodiments of the present invention, after the recognition degree is normalized, the recognition degree threshold is set to 0.6.
[0072] It should be noted that the negative correlation mapping method in the embodiments of the present invention can select the reciprocal form. At the same time, in order to avoid the denominator being 0, the reciprocal of the product plus the positive integer 1 is used as the recognition degree.
[0073] In summary, the embodiments of the present invention use the distance difference between the restored image corresponding to the maximum frequency in the DCT coefficient matrix and the boundary of the pin region to screen out the abnormal pin regions. The local suspected bending regions are screened out by comparing the overlapping degree of the pixel point regions between the image and the reference restored image. Further, based on the distribution dispersion degree and the frequency quantity, the bending positioning regions can be accurately screened out. The present invention is based on the discrete cosine transform, extracts the pin bending information by screening frequencies and performing transformation and restoration methods, and accurately locates the bending defects through step-by-step screening.
[0074] It should be noted that the above sequence of the embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0075] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments.
Claims
1. A potentiometer visual inspection method for a potentiometer production line, characterized in that: The method comprises: Obtain a pin image of a potentiometer on a potentiometer production line; and obtain a pin area in the pin image using a brightness feature; For each pin region, a DCT coefficient matrix of the pin region is obtained, a restored image corresponding to the maximum frequency in the DCT coefficient matrix is used as a reference restored image, and a pin bending probability is obtained according to the distance between the pixel point in the reference restored image and the boundary pixel point of the pin region; and abnormal pin regions are screened out according to the pin bending probability; High-frequency coefficients are screened out from the DCT coefficient matrix of the abnormal pin area and traversed according to the frequency magnitude, and the restored image corresponding to each high-frequency coefficient is used as a comparison image; the local suspected bending area is screened out according to the degree of overlap between the pixel point area in the comparison image and the reference restored image; For each local suspected bending area in the pin image, the frequency number in the local suspected bending area is counted to obtain the distribution discreteness between the pixel points corresponding to the local suspected bending area in the comparison image; the interference area in the local suspected bending area is screened out according to the frequency number and the distribution discreteness to obtain the bending positioning area.
2. A potentiometer visual inspection method for a potentiometer production line according to claim 1, characterized in that: The method for obtaining the pin area includes: The pixels in the pin image are segmented into two types of pixels using a threshold segmentation algorithm, the area consisting of the type of pixels with the largest brightness is selected as the initial pin area, and the area corresponding to the minimum circumscribed rectangle of the initial pin area is used as the pin area.
3. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The method for obtaining the pin bending probability includes: The shortest distance between each pixel point in the reference restored image and the boundary pixel point is used as the boundary distance, and the accumulated value of all boundary distances is used as the boundary feature value of the pin area; For each pin region, the boundary characteristic value difference between the pin region and other pin regions is obtained, and the accumulated value of all boundary characteristic value differences is normalized to obtain the pin bending probability.
4. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The method for screening the abnormal pin area includes: If the pin bending probability is greater than a preset bending probability threshold, the corresponding pin area is used as the abnormal pin area.
5. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The screening method of the high frequency coefficient is: The DCT coefficient matrix of the abnormal pin area is traversed in a serpentine manner with two coefficient lengths as a step length to obtain two groups of coefficients, and the group of coefficients with the highest frequency is used as the high-frequency coefficients.
6. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The method for obtaining the local suspected bending area includes: The pixel area of the comparison image is used as the comparison area, and the pixel area in the reference restoration image is used as the target area; For each target area, the number of overlapping pixels between the target area and the comparison area is obtained, the number of overlapping pixels of the target area in each comparison image is accumulated and normalized to obtain the degree of overlap; if the degree of overlap of the target area is greater than a preset overlap threshold, the target area is used as the local suspected bending area.
7. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The pixel point area is obtained by clustering the pixel points in the comparison image and the reference restored image through a clustering algorithm.
8. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The method for obtaining the distribution dispersion degree includes: For each pixel point in the local suspected bending area in the comparison image, the distance between each pixel point and the nearest pixel point is taken as the local distance, and the distance difference between the local distance of each pixel point and the average local distance of all pixels in the local suspected bending area is obtained; the distance differences in all comparison images are accumulated to obtain the distribution discreteness.
9. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that: The method for obtaining the bending positioning area includes: The distribution discreteness is multiplied by the frequency quantity and then negatively correlated with each other to obtain a recognition degree. The interference area in the local suspected bending area is screened out according to the recognition degree to obtain a bending positioning area.
10. A potentiometer visual inspection method for a potentiometer production line according to claim 9, characterized in that: The step of screening out the interference area in the local suspected bending area according to the recognition degree to obtain the bending positioning area includes: The local suspected bending area with the recognition degree less than the preset recognition degree threshold is taken as the interference area, and the local suspected bending area with the recognition degree not less than the preset recognition degree threshold is taken as the bending positioning area.
Citation Information
Patent Citations
Creating details in an image with frequency lifting
CN105144681A
Elliptical hole potentiometer angle restoring system and method based on vision
CN109459970A