Potentiometer visual detection method for potentiometer production line

Through DCT conversion and frequency analysis technology, the bend information of potentiometer pins is extracted, which solves the problem of inaccurate bending detection in the existing technology, and realizes accurate positioning and identification of bending defects.

CN119600012AActive Publication Date: 2025-03-11SICHUAN BOCHEN GUOSHENG INTELLIGENT TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411777795.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-11
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

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.

Method used

Using discrete cosine transform (DCT) as the basis, pin bending information is extracted by filtering frequency, transforming and reducing. The specific steps include: obtaining pin images, using brightness characteristics to obtain pin areas, calculating pin bending probability, filtering abnormal pin areas, analyzing local suspected bending areas, and filtering out bending positioning areas based on the number of frequency and the degree of distribution discreteness.

Benefits of technology

Accurately position the bent defects of the potentiometer pins, avoid misidentification caused by rust or scratches, and improve the accuracy and reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600012A_ABST
    Figure CN119600012A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial visual intelligence, in particular to a potentiometer visual detection method for a potentiometer production line. According to the method, an abnormal pin region is screened out by using the distance difference between a restored image corresponding to the maximum frequency in a DCT coefficient matrix and a pin region boundary. And screening out a local suspected bending region through the overlapping degree of pixel point regions between the comparison image and the reference restoration image. Furthermore, the bending positioning area can be accurately screened based on the distribution discrete degree and the frequency number. According to the method, on the basis of discrete cosine transform, pin bending information is extracted through a frequency screening, transformation and reduction method, and bending defects are accurately positioned through step-by-step screening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial visual intelligence technology, and in particular to a potentiometer visual detection method for a potentiometer production line. Background Art

[0002] A potentiometer is a resistor element with three pins and whose resistance value can be adjusted according to a certain law of change. A potentiometer is usually composed of a resistor body and a movable brush. When the brush moves along the resistor body, a resistance value or voltage that is related to the displacement is obtained at the output end. When the pin of the potentiometer is bent, it will cause the potentiometer to fail to adjust the circuit or current or become unstable. It may also cause the moving piece to be in poor contact with the resistor body, resulting in obvious noise. In order to avoid the impact of a bad potentiometer, the bending of the pins should be analyzed and identified in time when the potentiometer is installed.

[0003] Because the pins have a higher brightness than the background area of ​​the circuit board, the prior art can extract the pin area through image processing methods such as threshold segmentation, and then filter out the defective area through 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 bumps and depressions caused by rust and scratches. The prior art cannot effectively identify whether the defective area is a bump 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 in the prior art that the pin bending recognition process is easily affected by other defect image features, resulting in inaccurate bending detection, the purpose of the present invention is to provide a potentiometer visual inspection method for a potentiometer production line, and the technical solution adopted is as follows:

[0005] The present invention proposes a potentiometer visual inspection method for a potentiometer production line, the method comprising:

[0006] 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;

[0007] 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;

[0008] 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;

[0009] 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.

[0010] Furthermore, the method for obtaining the pin area includes:

[0011] 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.

[0012] Furthermore, 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 area;

[0014] 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.

[0015] Furthermore, the method for screening abnormal pin areas includes:

[0016] If the pin bending probability is greater than a preset bending probability threshold, the corresponding pin area is used as the abnormal pin area.

[0017] Furthermore, the screening method of the high frequency coefficient is:

[0018] 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.

[0019] Furthermore, the method for obtaining the local suspected bending area includes:

[0020] 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;

[0021] 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.

[0022] Furthermore, the pixel point region is obtained by clustering the pixel points in the comparison image and the reference restored 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 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.

[0025] Furthermore, the method for obtaining the bending positioning area includes:

[0026] 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.

[0027] Furthermore, the step of screening out interference areas in the local suspected bending area according to the recognition degree to obtain the bending location area includes:

[0028] 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.

[0029] The present invention has the following beneficial effects:

[0030] The present invention takes into account that defects of different categories have different characteristics, resulting in different frequency compositions of information in the image. Therefore, the present invention is based on Discrete Cosine Transform (DCT) and extracts pin bending information by screening frequencies, transforming and restoring. Because the pin brightness is large, it will produce a large grayscale difference with the background area, so the frequency of the pin area boundary in the DCT algorithm will also be larger. Therefore, 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 refine the local area on the abnormal pin area. Because the defect usually contains more frequency information due to its complex characteristics, the local suspected bending area can be screened out by comparing the overlap of the pixel area between the image and the reference restored image. Further analyze the image features in the local suspected bending area. Compared with bending, defects such as rust or scratches have more complex image features, contain more complex frequency information, and the surface pixel distribution is more irregular. Therefore, the bending positioning area can be accurately screened out based on the distribution discreteness and the number of frequencies. Accurate positioning of bending defects is achieved through step-by-step screening. 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 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 A flow chart of a potentiometer visual inspection method for a potentiometer production line provided by one embodiment of the present invention;

[0033] Figure 2 A schematic diagram of a pin area provided by an embodiment of the present invention;

[0034] Figure 3 A schematic diagram of a snake traversal provided by an embodiment of the present invention;

[0035] Figure 4 A schematic diagram of pixel area segmentation and comparison provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of a potentiometer visual inspection method for a potentiometer production line proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0037] 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 invention belongs.

[0038] The embodiment of the present invention solves the technical problem based on the DCT transform algorithm, wherein the DCT transform is mainly used to compress data or images, and can convert spatial domain signals to the frequency domain, and has good decorrelation performance. The DCT transform itself is lossless, and creates good conditions for quantization, Huffman coding, etc. in the fields of image coding. At the same time, since the DCT transform is symmetrical, the DCT inverse transform can be used after quantization coding to restore the original image information at the receiving end. The DCT transform has a very wide range of uses in the current image analysis and compression fields. The common JPEG static image coding and MJPEG, MPEG dynamic coding and other standards all use the DCT transform. The algorithm is a technical means well known to those skilled in the art. The embodiment of the present invention is only an application, and the specific algorithm content will not be repeated here.

[0039] A specific scheme of a potentiometer visual inspection method for a potentiometer production line provided by the present invention is described in detail below in conjunction with the accompanying drawings.

[0040] See also Figure 1 , which shows a flow chart of a potentiometer visual inspection method for a potentiometer production line provided by an embodiment of the present invention, the method comprising:

[0041] Step S1: Obtain a pin image of a potentiometer on a potentiometer production line; and obtain a pin area in the pin image using brightness features.

[0042] In the embodiment of the present invention, a camera is installed directly above the potentiometer group processing and assembly line to capture images of the potentiometer pin positions. It should be noted that, in order to facilitate subsequent image processing, the captured pin images are grayscale images.

[0043] It should be noted that the existing potentiometer assembly process is loading the potentiometer shell, carrying, adjusting, moving, loading the gear, pressing into the surgery under vacuum, loading the ceramic substrate, and pressing into the gear inside the shell. After completing the above process, the roughly processed potentiometer product can be sent to the production line for pin bending detection, and finally the defective products can be screened according to the detection results.

[0044] In the pin image, the pin is made of copper, iron, tin-plated, silver-plated or other metals, so it has a higher brightness than the background area on the potentiometer. Therefore, conventional image feature extraction algorithms such as threshold segmentation algorithms 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 pixel brightness classification as the pin area, in one embodiment of the present invention, the pixels in the pin image are segmented into two types of pixels using a threshold segmentation algorithm, and the area composed of the pixel type with the largest brightness is selected as the initial pin area, and the area corresponding to the minimum bounding rectangle of the initial pin area is used as the pin area. That is, the minimum bounding rectangle is used to determine more image information as the pin area. Please refer to Figure 2 , which shows a schematic diagram of a 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 based on the distance between the pixel point in the reference restored image and the boundary pixel point of the pin area; screen out abnormal pin areas based on the pin bending probability.

[0047] After the processing of step S1, the pin regions of multiple pins are obtained. There may be normal pin regions and defective pin regions in these pin regions, which need to be further screened. For the defective pin region, its shape will be greatly different from the normal pin region. The bending defect will shorten the boundary of the pin region, 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 region extracted in step S1 is only directly extracted according to the image features. In order to ensure accuracy, its boundary region cannot be directly analyzed as the pin boundary. Considering that the pin boundary has a curvature problem, its reflective degree should be stronger than other pin regions. Therefore, its corresponding frequency in the DCT coefficient matrix should also be the largest. Therefore, after the embodiment of the present invention obtains the DCT coefficient matrix of the pin region, the coefficient of the maximum frequency in the DCT coefficient matrix is ​​extracted and the image is restored to obtain a reference restored image. That is, the pixel point in the reference restored image is the pin boundary pixel point, and the pin bending probability can be obtained by further comparing the distance between the boundary pixel points of the pin region. That is, the larger the distance, the greater the probability of pin bending, and the abnormal pin region can be screened out according to the pin bending probability. It should be noted that the abnormal pin area is not necessarily the area where the pin is bent, because rust or scratches can also cause the shape of the pin area to change. Therefore, the abnormal pin area only represents that an abnormality has occurred in the pin area, and subsequent steps are required to further analyze whether bending has occurred and perform local positioning.

[0048] Preferably, in one embodiment of the present invention, the method for obtaining the pin bending probability includes:

[0049] The shortest distance between each pixel in the reference restored image and the boundary pixel is taken as the boundary distance, and the accumulated value of all boundary distances is taken as the boundary feature value of the pin region. The boundary feature value represents 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 low-probability events compared to normal pin areas, that is, the distance features in abnormal pin areas have very obvious discreteness compared to other pin areas. Therefore, for each pin area, the boundary feature value difference between the pin area and other pin areas is obtained, and the cumulative value of all boundary feature value differences is normalized to obtain the probability of pin bending. That is, if the boundary feature value difference between a pin area and other pin areas is relatively large, the final cumulative value will also be larger, indicating that the pin area is more likely to be an abnormal pin area containing defects, that is, the probability of pin bending is greater.

[0051] It should be noted that the normalization method in the embodiment of the present invention can be the sigmoid function mapping method, and in other embodiments of the present invention, normalization methods such as range normalization can also be used. These are technical means well known to those skilled in the art and will not be elaborated or limited here.

[0052] Preferably, in one embodiment of the present invention, the method for screening abnormal pin areas includes:

[0053] If the pin bending probability is greater than a preset bending probability threshold, the corresponding pin area is used as the abnormal pin area. Because 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: Filter out high-frequency coefficients in the DCT coefficient matrix of the abnormal pin area and traverse them according to the frequency size. The restored image corresponding to each high-frequency coefficient is used as a comparison image; and the local suspected bending area is filtered out according to the degree of overlap between the pixel area 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, the defective area can be regarded as composed of pixels at multiple frequencies. The pixels at each frequency can reflect the boundary of the defective area to a certain extent. Therefore, for the defective area, it is possible to determine whether a local area is a defective area by comparing the overlap of the areas formed by different frequency information.

[0056] The embodiment of the present invention further screens out high-frequency coefficients in the DCT coefficient matrix of the abnormal pin area. By screening out the high-frequency coefficients, the interference of low-frequency information can be avoided and the amount of calculation can be saved. Because the pin area is an obvious high-brightness area, the low-frequency information itself is relatively small and may be a background area. Therefore, by screening the high-frequency coefficients, the amount of unnecessary operations can be reduced. Further traversal is performed according to the frequency size, that is, each high-frequency coefficient needs to be restored to obtain a corresponding restored image as a comparison image. If a defect abnormality occurs at a local position in the abnormal pin area, it will cause pixel point information to exist at the local position in the comparison images between different frequencies. Because the reference restored image is the information corresponding to the maximum frequency, the area composed of pixels in the reference restored image should be a more complete area. Therefore, the reference restored image can be used as a basis, and the local suspected bending area can be screened out according to the degree of overlap of the pixel point area in the comparison image and the reference restored image.

[0057] Preferably, in the embodiment of the present invention, the method for screening high frequency coefficients is:

[0058] The DCT coefficient matrix of the abnormal pin area is traversed in a snake-like manner with two coefficient lengths as the step length to obtain two groups of coefficients, and the group of coefficients with the highest frequency is taken as the high-frequency coefficients. Figure 3 , which shows a schematic diagram of a snake traversal provided by an embodiment of the present invention. Through the snake traversal, half of the number of coefficients in the matrix is ​​used as a partition to obtain two groups of coefficients, namely one group is the coefficients of the first half of the traversal process, and the other group is the coefficients of the second half of the traversal process.

[0059] Preferably, in the embodiment of the present invention, the pixel point region is obtained by clustering the pixels in the comparison image and the reference restored image through a clustering algorithm. The embodiment of the present invention uses the DBSCAN clustering algorithm to perform clustering according to the distance between the pixels, and each cluster obtained forms a corresponding pixel point region. Figure 4 , which shows a schematic diagram of pixel point area segmentation comparison provided by an embodiment of the present invention, wherein the right image contains more pixel point information than the left image, that is, more pixel point areas, and Figure 4 It can be seen that the pixel area is not a region composed simply of pixels, but an area with a certain width and range, which avoids errors caused by a pixel area that is too small. The specific width and range can be set by technicians in this field and will not be elaborated here.

[0060] Preferably, in an embodiment of the present invention, a method for obtaining a local suspected bending area includes:

[0061] 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;

[0062] For each target area, the number of overlapping pixels between the target area and the comparison area is obtained, and the number of overlapping pixels of the target area in each comparison image is accumulated and normalized to obtain the degree of overlap. In an embodiment of the present invention, the normalization method of the degree of overlap can select the accumulated number of overlapping pixels as the numerator and the largest accumulated number of overlapping pixels in all target areas as the denominator, and the ratio is the normalized degree of overlap.

[0063] If the overlap degree of the target area is greater than a preset overlap degree threshold, the target area is regarded as a local suspected bending area. In the embodiment of the present invention, the overlap degree threshold is set to 0.7.

[0064] Step S4: For each local suspected bending area in the pin image, count the frequency number in the local suspected bending area to obtain the distribution discreteness between the pixel points corresponding to the local suspected bending area in the comparison image; screen out the interference area in the local suspected bending area according to the frequency number and the distribution discreteness to obtain the bending positioning area.

[0065] The local suspected bending area indicates the local area of ​​the pin with abnormal defects, but it cannot be directly judged that the defect is caused by bending. The scratches or rust on the surface of the pin will also have the characteristics of more frequency overlapping information. Therefore, it is necessary to further analyze it, considering that the scratches or rust have richer surface texture features and more uneven pixel distribution compared to the bending defects, and because the texture features are richer, it will also reflect that this type of defect area has relatively more frequency information. Therefore, the embodiment of the present invention further counts the number of frequencies in the local suspected bending area in the pin image, and obtains the distribution discreteness between the pixels corresponding to the local suspected bending area in the comparison image. It should be noted that because the frequency number needs to be used to characterize the information complexity of the local suspected bending area, it needs to be obtained in the original pin image; and the distribution discreteness needs to reflect the texture representation of the details, and the local suspected bending area in the pin image is a complete area, so it cannot be obtained in the pin image, so it is necessary to analyze the distribution discreteness of the local suspected bending area in each comparison image.

[0066] The larger the number of frequencies, the greater the degree of distribution dispersion, indicating that the local 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 bending of the potentiometer pin can be accurately positioned. After positioning is completed, the corresponding position can be framed in the pin image by methods such as image masking, and visualized on the terminal to remind the staff.

[0067] Preferably, in one embodiment of the present invention, the method for obtaining the distribution dispersion degree includes:

[0068] For each pixel point in the local suspected bending area in the contrast 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. That is, the greater the difference between the local distance and the average local distance, the more discrete the distribution of the pixel point is, and the more discrete pixels are distributed in the local suspected bending area, the greater the distribution discreteness is. A contrast image contains multiple pixel points, that is, it contains multiple distance differences. The embodiment of the present invention needs to count the information in all contrast images, so all distance differences in all contrast images are accumulated to obtain the distribution discreteness of the local suspected bending area.

[0069] Preferably, in an embodiment of the present invention, the method for obtaining the bending positioning area includes:

[0070] The degree of distribution dispersion is multiplied by the frequency number and then negatively correlated to obtain the degree of recognition. The interference area in the local suspected bending area is screened out according to the degree of recognition to obtain the bending location area. The greater the degree of recognition, the less likely the local suspected bending area is to be an interference area. Therefore, further, the interference area in the local suspected bending area is screened out according to the degree of recognition to obtain the bending location area, including:

[0071] The local suspected bend area with a recognition degree less than the preset recognition degree threshold is used as the interference area, and the local suspected bend area with a recognition degree not less than the preset recognition degree threshold is used as the bend positioning area. In the embodiment 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 of the embodiment of the present invention may be in the form of a reciprocal. In order to avoid the denominator being 0, the reciprocal of the product plus the positive integer 1 needs to be used as the recognition degree.

[0073] In summary, the embodiment of the present invention utilizes the distance difference between the restored image corresponding to the maximum frequency in the DCT coefficient matrix and the pin area boundary to screen out abnormal pin areas. The local suspected bending area is screened out by comparing the degree of overlap of the pixel area between the image and the reference restored image. Further, based on the distribution discreteness and the number of frequencies, the bending location area can be accurately screened out. The present invention is based on discrete cosine transform, and extracts pin bending information by screening frequencies, transforming and restoring them, and accurately locates bending defects through step-by-step screening.

[0074] It should be noted that the sequence of the above 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 accompanying 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] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A 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

  • Static image processing method and device

    CN110572652A

  • Structural defect detection system and structural defect detection method

    CN111316093A

  • Target image recognition method and device

    CN114429649A