[go: up one dir, main page]

CN119600012A - Potentiometer visual inspection method for potentiometer production line - Google Patents

Potentiometer visual inspection method for potentiometer production line Download PDF

Info

Publication number
CN119600012A
CN119600012A CN202411777795.7A CN202411777795A CN119600012A CN 119600012 A CN119600012 A CN 119600012A CN 202411777795 A CN202411777795 A CN 202411777795A CN 119600012 A CN119600012 A CN 119600012A
Authority
CN
China
Prior art keywords
area
pin
bending
potentiometer
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411777795.7A
Other languages
Chinese (zh)
Other versions
CN119600012B (en
Inventor
周正军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Bochen Guosheng Intelligent Technology Co ltd
Original Assignee
Sichuan Bochen Guosheng Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Bochen Guosheng Intelligent Technology Co ltd filed Critical Sichuan Bochen Guosheng Intelligent Technology Co ltd
Priority to CN202411777795.7A priority Critical patent/CN119600012B/en
Publication of CN119600012A publication Critical patent/CN119600012A/en
Application granted granted Critical
Publication of CN119600012B publication Critical patent/CN119600012B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8854Grading and classifying of flaws
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of industrial visual intelligence, in particular to a visual detection method for a potentiometer, which is used for a potentiometer production line. The method utilizes the difference of the distance between the restored image corresponding to the maximum frequency in the DCT coefficient matrix and the boundary of the pin area to screen out the abnormal pin area. And screening out a local suspected bending region through the overlapping degree of the pixel point region between the comparison image and the reference reduction image. And the bending positioning area can be accurately screened out further based on the distribution discrete degree and the frequency quantity. The invention takes discrete cosine transformation as the basis, extracts pin bending information by screening frequency, transforming and restoring, and realizes accurate positioning of bending defects by screening step by step.

Description

Potentiometer visual detection method for potentiometer production line
Technical Field
The invention relates to the technical field of industrial visual intelligence, in particular to a visual detection method for a potentiometer, which is used for a potentiometer production line.
Background
The potentiometer is a resistor element with three pins and adjustable resistance according to a certain change rule. Potentiometers are generally composed of a resistor body and a movable brush. When the brush moves along the resistor, a resistance value or voltage which has a certain relation with the displacement is obtained at the output end. When the potentiometer pin is bent, the potentiometer regulating circuit or the adjustment during current is invalid or unstable, and poor contact between the moving sheet and the resistor body can be possibly caused, so that obvious noise is generated. In order to avoid the influence caused by bad potentiometers, the bending condition of the pins should be analyzed and identified in time when the potentiometers are installed.
Because the pins have higher brightness relative 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 the like, and then screen out the defect area through abnormal image features in the pin area. But in the pin installation process, the abnormal image features on the surface of the pin not only comprise bending features, but also comprise bulges and pits caused by rust and scratch. In the prior art, whether the defective area is a bulge and a recess caused by rust or scratch or a defect caused by bending cannot be effectively identified, so that the pin bending detection is inaccurate.
Disclosure of Invention
In order to solve the technical problem that in the prior art, the bending detection is inaccurate due to the fact that the pin is easily affected by other defect image characteristics in the bending identification process, the invention aims to provide a potentiometer visual detection method for a potentiometer production line, and the adopted technical scheme is as follows:
The invention provides a potentiometer visual detection method for a potentiometer production line, which comprises the following steps:
obtaining a pin area in the pin image by utilizing brightness characteristics;
For each pin area, a DCT coefficient matrix of the pin area is obtained, a restored image corresponding to the maximum frequency in the DCT coefficient matrix is used as a reference restored image, and pin bending probability is obtained according to the distance between a pixel point in the reference restored image and a boundary pixel point of the pin area;
Selecting high-frequency coefficients from the DCT coefficient matrix of the abnormal pin area and traversing according to the frequency, wherein a restored image corresponding to each high-frequency coefficient is used as a comparison image;
And counting the frequency number of each local suspected bending region in the pin image, obtaining the distribution discrete degree between the pixel points corresponding to the local suspected bending region in the comparison image, and screening out the interference region in the local suspected bending region according to the frequency number and the distribution discrete degree to obtain the bending positioning region.
Further, the method for acquiring the pin area comprises the following steps:
dividing pixel points in the pin image into two types of pixel points by using a threshold segmentation algorithm, selecting an area formed by the type of pixel points with the maximum brightness as an initial pin area, and taking an area corresponding to the minimum circumscribed rectangle of the initial pin area as the pin area.
Further, the method for obtaining the pin bending probability comprises the following steps:
referring to the shortest distance between each pixel point in the restored image and the boundary pixel point as a boundary distance, and taking the accumulated value of all the boundary distances as a boundary characteristic value of the pin area;
And for each pin area, obtaining the boundary characteristic value difference between the pin area and other pin areas, and normalizing the accumulated value of all the boundary characteristic value differences to obtain the pin bending probability.
Further, the screening method of the abnormal pin area comprises the following steps:
And if the pin bending probability is larger than a preset bending probability threshold, taking the corresponding pin area as the abnormal pin area.
Further, the screening method of the high-frequency coefficient comprises the following steps:
And performing serpentine traversal on the DCT coefficient matrix of the abnormal pin area by taking the lengths of the two coefficients as step lengths to obtain two groups of coefficients, and taking the group of coefficients with the highest frequency as the high-frequency coefficient.
Further, the method for obtaining the local suspected bending region comprises the following steps:
the pixel point area of the contrast image is used as a contrast area, and the pixel point area in the reference restored image is used as a target area;
and for each target area, obtaining the number of overlapped pixels between the target area and the comparison area, accumulating the number of overlapped pixels of the target area in each comparison image, and then carrying out normalization processing to obtain the overlapping degree, wherein if the overlapping degree of the target area is greater than a preset overlapping degree threshold value, the target area is used as the local suspected bending area.
Further, the pixel point area is obtained by clustering the pixels in the contrast image and the reference restored image through a clustering algorithm.
Further, the method for acquiring the distribution discrete degree comprises the following steps:
And for each pixel point in the local suspected bending region in the comparison image, taking the distance between each pixel point and the nearest pixel point as a local distance, obtaining the distance difference between the local distance of each pixel point and the average local distance of all the pixel points in the local suspected bending region, and accumulating the distance differences in all the comparison images to obtain the distribution discrete degree.
Further, the method for obtaining the bending and positioning area comprises the following steps:
And multiplying the distribution discrete degree by the frequency number, and then carrying out negative correlation mapping to obtain an identification degree, and screening out an interference region in the local suspected bending region according to the identification degree to obtain a bending positioning region.
Further, the screening the interference area in the local suspected bending area according to the identification degree to obtain a bending positioning area includes:
And taking the local suspected bending region with the recognition degree smaller than a preset recognition degree threshold value as an interference region, and taking the local suspected bending region with the recognition degree not smaller than the preset recognition degree threshold value as a bending positioning region.
The invention has the following beneficial effects:
The invention considers that the frequency composition of information in images is different due to different characteristics of defects in different categories, so the invention extracts the pin bending information by screening the frequency, transforming and restoring based on discrete cosine transform (Discrete Cosine Transform, DCT). Because the brightness of the pins is larger, a larger gray level difference is generated between the pins and the background area, the frequency of the boundaries of the pin areas in the DCT algorithm is also larger, so that the characteristics of the boundaries of the pin areas can be represented by utilizing the restored image corresponding to the maximum frequency in the DCT coefficient matrix, and the abnormal pin areas can be screened out through the distance difference between the restored image and the boundaries of the pin areas. Further, the local area on the abnormal pin area is subjected to refinement analysis, and because the defects generally contain more frequency information due to complex characteristics, the local suspected bending area can be screened out through the overlapping degree of the pixel point area between the comparison image and the reference reduction image. Further analyze the image feature in the regional suspected kink, defects such as corrosion or scratch have more complicated image feature than buckling, contain more complicated frequency information to the surface pixel point distribution is also more irregular, therefore further can accurately screen out the location area of buckling based on distribution discrete degree and frequency quantity. The bending defects are accurately positioned through one-step screening.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a visual inspection method for a potentiometer in a potentiometer production line according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a lead area according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a serpentine traversal according to one embodiment of the invention;
fig. 4 is a schematic diagram of pixel region segmentation comparison according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of a potentiometer visual inspection method for a potentiometer production line according to the invention, and the detailed description of the specific implementation, structure, characteristics and effects thereof is as follows. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
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.
The embodiment of the invention solves the technical problem based on the DCT transformation algorithm, wherein the DCT transformation is mainly used for compressing data or images, can convert a spatial domain signal into a frequency domain, and has good decorrelation performance. The DCT transformation itself is lossless, creating good conditions for quantization, huffman coding, etc. in the field of image coding, etc. Meanwhile, since the DCT transform is symmetrical, the original image information can be restored at the receiving end by using the DCT inverse transform after the quantization encoding. The DCT transform has very wide application in the field of current image analysis and compression, and the DCT transform is used in common JPEG still image coding, MJPEG, MPEG dynamic coding and other standards. The algorithm is a technical means well known to those skilled in the art, and the embodiment of the present invention is only an application, and specific algorithm contents are not described here.
The invention provides a specific scheme of a potentiometer visual detection method for a potentiometer production line, which is specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a potentiometer visual inspection method for a potentiometer production line according to an embodiment of the invention is shown, and the method includes:
Step S1, obtaining a pin image of a potentiometer on a potentiometer production line, and obtaining a pin area in the pin image by utilizing brightness characteristics.
In the embodiment of the invention, a camera is arranged right above a potentiometer group processing and assembling line to collect images of the positions of the pins of the potentiometer, and the acquired pin images are gray images for facilitating subsequent image processing.
The existing potentiometer assembly procedures comprise potentiometer shell feeding, carrying, adjusting, moving, gear feeding, vacuum pressing into surgery, ceramic substrate feeding and pressing into an inner gear of the shell. After the above process is executed, the potentiometer product with rough machining is sent to a production line for pin bending detection, and finally products containing defects can be screened according to detection results.
In the pin image, the pins are made of copper, iron, tin plating, silver plating and other metals, so that the pins have higher brightness relative to the background area on the potentiometer, and therefore, the pin area can be directly obtained in the pin image by using a conventional image feature extraction algorithm such as a threshold segmentation algorithm.
Preferably, in order to avoid information loss caused by directly classifying the brightness of the pixel points as the pin area, in one embodiment of the present invention, the pixel points in the pin image are divided into two types of pixel points by using a threshold segmentation algorithm, an area composed of one type of pixel points with the maximum brightness is selected as an initial pin area, and an area corresponding to the minimum circumscribed rectangle of the initial pin area is selected as the pin area. More image information is determined as a pin area by utilizing the minimum circumscribed rectangle. Referring to fig. 2, a schematic diagram of a lead area according to an embodiment of the invention is shown.
Step S2, for each pin area, a DCT coefficient matrix of the pin area is obtained, a restored image corresponding to the maximum frequency in the DCT coefficient matrix is used as a reference restored image, pin bending probability is obtained according to the distance between a pixel point in the reference restored image and a boundary pixel point of the pin area, and abnormal pin areas are screened out according to the pin bending probability.
After the processing of step S1, a plurality of pin areas of pins are obtained, and normal pin areas and defective pin areas may exist in the pin areas, so that the pin areas need to be further screened. For the defective lead area, the shape of the defective lead area is greatly different from that of the normal lead area, and the bending defect can shorten the boundary of the lead area, so that the boundary is not a complete rectangle. It is therefore necessary to determine whether the lead area is bent according to the shape of the lead boundary. The lead area extracted in step S1 is directly extracted only from the image features, and the boundary area thereof cannot be directly analyzed as a lead boundary in order to ensure accuracy. Considering that the boundary of the pin has radian problem, the reflection degree should be stronger compared with other areas of the pin. Therefore, the frequency corresponding to the DCT coefficient matrix should be the largest, so after the DCT coefficient matrix of the pin area is obtained, the coefficient of the largest frequency in the DCT coefficient matrix is extracted and subjected to image restoration to obtain the reference restored image. The pixel points in the reference restored image are pin boundary pixel points, and the pin bending probability can be obtained by further comparing the distances between the boundary pixel points of the pin area. Namely, the larger the distance is, the larger the bending probability of the pins is, and the abnormal pin area can be screened out according to the bending probability of the pins. It should be noted that, the abnormal pin area is not completely determined as the area where the pin is bent, and because the shape of the pin area is changed due to rust or scratch, the abnormal pin area only represents that the pin area is abnormal, and whether the pin is bent or not needs to be further analyzed and localized by the subsequent steps.
Preferably, in one embodiment of the present invention, the method for obtaining the pin bending probability includes:
And referring to the shortest distance between each pixel point in the restored image and the boundary pixel point as a boundary distance, and taking the accumulated value of all the boundary distances as the boundary characteristic value of the pin area. The boundary feature value characterizes a distance feature between a true pin boundary in the current pin region and the region boundary.
For all pins on a potentiometer, the defect should be a small probability event compared to the normal pin area, i.e. the distance features in the abnormal pin area have very pronounced variability with respect to the other pin areas. Therefore, for each pin area, the boundary characteristic value difference between the pin area and other pin areas is obtained, and the accumulated value of all the boundary characteristic value differences is normalized to obtain the pin bending probability. If the difference between the boundary characteristic values of a certain lead area and other lead areas is larger, the final accumulated value will be larger, which means that the more likely the lead area is an abnormal lead area containing defects, i.e. the greater the probability of bending the lead.
It should be noted that, the normalization method in the embodiment of the present invention may be a sigmoid function mapping method, and in other embodiments of the present invention, normalization methods such as polar error normalization may be also used, which are technical means well known to those skilled in the art, and are not described and limited herein.
Preferably, in one embodiment of the present invention, the screening method of the abnormal pin area includes:
And if the pin bending probability is larger than a preset bending probability threshold, taking the corresponding pin area as the abnormal pin area. Because the pin bending probability is a normalized value in one embodiment of the present invention, the bending probability threshold is set to 0.7.
And step S3, screening out high-frequency coefficients from the DCT coefficient matrix of the abnormal pin area, traversing according to the frequency, taking a restored image corresponding to each high-frequency coefficient as a comparison image, and screening out a local suspected bending area according to the overlapping degree of the pixel point area in the comparison image and the reference restored image.
Compared with other pin areas, the defect area has more complex information, and can be seen as the defect area in the DCT conversion algorithm to be composed of pixel points with a plurality of frequencies, wherein the pixel points with each frequency can embody the outline of the boundary of the defect area to a certain extent. Therefore, for the defect area, whether a certain local area is the defect area can be judged by comparing the superposition condition of the forming areas among different frequency information.
The embodiment of the invention further screens out high-frequency coefficients in the DCT coefficient matrix of the abnormal pin area, can avoid the interference of low-frequency information by screening out the high-frequency coefficients, saves the calculated amount, and because the pin area is an obvious high-brightness area, the low-frequency information is fewer and possibly is a background area, so that the unnecessary operation amount can be reduced by screening out the high-frequency coefficients. And traversing according to the frequency, namely, each high-frequency coefficient needs to be subjected to a restoration operation, and obtaining a corresponding restoration image as a comparison image. If a defect abnormality occurs at a local position in the abnormal pin area, pixel point information exists at the local position in the comparison image between different frequencies, and because the reference reduction image is information corresponding to the maximum frequency, the area formed by the pixel points in the reference reduction image is a more complete area, so that the reference reduction image can be taken as a basis, and a 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 reduction image.
Preferably, in the embodiment of the present invention, the method for screening the high frequency coefficient is:
And performing serpentine traversal on the DCT coefficient matrix of the abnormal pin area by taking the lengths of the two coefficients as step lengths to obtain two groups of coefficients, and taking the group of coefficients with the highest frequency as high-frequency coefficients. Referring to fig. 3, a serpentine traversal diagram according to one embodiment of the invention is shown. By serpentine traversal, two sets of coefficients are obtained, one set being the coefficients of the first half of the traversal process and the other set being the coefficients of the second half of the traversal process, with half of the number of coefficients in the matrix as a partition.
Preferably, in the embodiment of the present invention, the pixel point area is obtained by clustering the pixels in the contrast image and the reference restored image through a clustering algorithm. According to the embodiment of the invention, clustering is carried out by using a DBSCAN clustering algorithm according to the distance between the pixel points, and each obtained cluster forms a corresponding pixel point area. Referring to fig. 4, a schematic diagram of pixel region segmentation comparison provided by an embodiment of the present invention is shown, wherein the right image includes more pixel information, i.e. more pixel regions, than the left image, and fig. 4 shows that the pixel regions are not regions simply composed of pixels, but have regions with a certain width and a certain range, so that errors caused by too small pixel regions are avoided, and those skilled in the art can set the specific width and the range by themselves, which are not repeated herein.
Preferably, in an embodiment of the present invention, the method for obtaining a local suspected bending region includes:
The pixel point area of the comparison image is used as a comparison area, and the pixel point area in the reference restored image is used as a target area;
And for each target area, obtaining the number of overlapped pixel points between the target area and the comparison area, accumulating the number of the overlapped pixel points of the target area in each comparison image, and then carrying out normalization processing to obtain the overlapping degree. In the embodiment of the invention, the normalization method of the overlapping degree can select the number of the overlapped pixels after accumulation as a numerator, and the maximum number of the overlapped pixels after accumulation in all the target areas as a denominator, wherein the ratio is the overlapping degree after normalization.
And if the overlapping degree of the target area is greater than the preset overlapping degree threshold value, taking the target area as a local suspected bending area. In the embodiment of the present invention, the overlapping degree threshold is set to 0.7.
And S4, counting the frequency number of the local suspected bending areas in each local suspected bending area in the pin image, obtaining the distribution discrete degree between the pixel points corresponding to the local suspected bending areas in the comparison image, and screening out the interference areas in the local suspected bending areas according to the frequency number and the distribution discrete degree to obtain the bending positioning areas.
The local suspected bending area represents a local area of the pin with an abnormal defect, but the defect cannot be directly judged to be generated by bending, and scratch or rust on the surface of the pin also has the characteristic of more frequency overlapping information. Therefore, further analysis is needed, and compared with bending defects, the scratch or rust is considered to have richer texture features on the surface, uneven pixel point distribution is achieved, and the defect areas are relatively more in frequency information due to the richer texture features. Therefore, the embodiment of the invention further counts the frequency number in the local suspected bending region in the pin image, and obtains the distribution discrete degree between the pixel points corresponding to the local suspected bending region in the comparison image. It should be noted that, because the complexity of the information of the local suspected bending region needs to be represented by the frequency number, the information needs to be obtained in the original pin image, and the discrete degree of distribution needs to represent the detailed texture representation, whereas the local suspected bending region is a complete region in the pin image, and therefore, the information cannot be obtained in the pin image, so that the discrete degree of distribution of the local suspected bending region needs to be analyzed in each comparison image.
The larger the number of frequencies is, the larger the distribution dispersion degree is, which indicates that the local suspected bending region is more likely to be an interference region caused by non-bending defects such as scratch or rust, so that the interference region can be screened out, a bending positioning region is obtained, and the accurate positioning of the bending of the potentiometer pin is completed. After the positioning is finished, the corresponding positions can be selected in a frame mode in the pin image through methods such as an image mask and the like, and visual display is carried out on the terminal so as to remind workers.
Preferably, in one embodiment of the present invention, the method for acquiring the distribution discretization degree includes:
And for each pixel point in the local suspected bending region in the comparison image, taking the distance between each pixel point and the nearest pixel point as the local distance, and obtaining the distance difference between the local distance of each pixel point and the average local distance of all the pixel points in the local suspected bending region. That is, the larger the distance difference between the local distance and the average local distance, the more discrete the distribution of the pixel points, and the more the distributed and discrete pixel points in the local suspected bending region, the larger the distribution dispersion. In the embodiment of the invention, the information in all the contrast images needs to be counted, so that all the distance differences in all the contrast images are accumulated to obtain the distribution discrete degree of the local suspected bending region.
Preferably, in an embodiment of the present invention, the method for acquiring the bending location area includes:
And multiplying the distribution discrete degree by the frequency number, performing negative correlation mapping to obtain the identification degree, and screening out the interference region in the local suspected bending region according to the identification degree to obtain the bending positioning region. The greater the recognition degree, the less the local suspected bending region is an interference region, so further, the interference region in the local suspected bending region is screened out according to the recognition degree, and a bending positioning region is obtained, including:
And taking the local suspected bending region with the recognition degree smaller than the preset recognition degree threshold value as an interference region, and taking the local suspected bending region with the recognition degree not smaller than the preset recognition degree threshold value as a bending positioning region. In the embodiment of the invention, after the recognition degree normalization processing, the recognition degree threshold is set to 0.6.
It should be noted that, the negative correlation mapping method in the embodiment of the present invention may be in the form of reciprocal, and in order to avoid that the denominator is 0, the reciprocal after the product is added with the positive integer 1 is required to be used as the recognition degree.
In summary, the embodiment of the present invention screens out the abnormal pin area by using the distance difference between the restored image corresponding to the maximum frequency in the DCT coefficient matrix and the boundary of the pin area. And screening out a local suspected bending region through the overlapping degree of the pixel point region between the comparison image and the reference reduction image. And the bending positioning area can be accurately screened out further based on the distribution discrete degree and the frequency quantity. The invention takes discrete cosine transformation as the basis, extracts pin bending information by screening frequency, transforming and restoring, and realizes accurate positioning of bending defects by screening step by step.
It should be noted that the 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 accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (10)

1.一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述方法包括: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; 对于每个引脚区域,获得所述引脚区域的DCT系数矩阵,将所述DCT系数矩阵中最大频率对应的还原图像作为参考还原图像,根据所述参考还原图像中像素点与引脚区域的边界像素点之间的距离获得引脚弯折概率;根据所述引脚弯折概率筛选出异常引脚区域;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; 在所述异常引脚区域的DCT系数矩阵中筛选出高频率系数并根据频率大小进行遍历,每个高频率系数对应的还原图像作为对比图像;根据所述对比图像和所述参考还原图像中像素点区域的重叠程度筛选出局部疑似弯折区域;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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述引脚区域的获取方法包括:2. A method for visual inspection of potentiometers for a potentiometer production line according to claim 1, characterized in that the method for obtaining the pin area comprises: 利用阈值分割算法对所述引脚图像中的像素点进行分割为两类像素点,选择亮度最大的一类像素点组成的区域作为初始引脚区域,将初始引脚区域的最小外接矩形对应的区域作为所述引脚区域。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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述引脚弯折概率的获取方法包括:3. The method for visually inspecting a potentiometer for a potentiometer production line according to claim 1, wherein the method for obtaining the pin bending probability comprises: 参考还原图像中的每个像素点与所述边界像素点的最短距离作为边界距离,将所有边界距离的累加值作为引脚区域的边界特征值;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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述异常引脚区域的筛选方法包括:4. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, wherein the method for screening abnormal pin areas comprises: 若所述引脚弯折概率大于预设弯折概率阈值,则将对应的引脚区域作为所述异常引脚区域。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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述高频率系数的筛选方法为:5. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, wherein the method for screening the high-frequency coefficient is: 对所述异常引脚区域的DCT系数矩阵以两个系数长度作为步长进行蛇形遍历,获得两组系数,将频率最高的一组系数作为所述高频率系数。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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述局部疑似弯折区域的获取方法包括:6. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, wherein the method for obtaining the local suspected bending area comprises: 所述对比图像的像素点区域作为对比区域,参考还原图像中的像素点区域作为目标区域;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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述像素点区域为所述对比图像以及所述参考还原图像中的像素点通过聚类算法进行聚类获得。7. A potentiometer visual inspection method 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.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述分布离散程度的获取方法包括:8. The method for visual inspection of potentiometers for a potentiometer production line according to claim 1, wherein the method for obtaining the distribution dispersion degree comprises: 对于所述对比图像中所述局部疑似弯折区域中的每个像素点,将每个像素点与最近像素点之间的距离作为局部距离,获得每个像素点的局部距离与局部疑似弯折区域中所有像素点的平均局部距离的距离差异;将所有对比图像中的所述距离差异累加,获得所述分布离散程度。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 pixel points in the local suspected bending area is obtained; the distance differences in all comparison images are accumulated to obtain the distribution discreteness. 9.根据权利要求1所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述弯折定位区域的获取方法包括:9. The method for visually inspecting a potentiometer for a potentiometer production line according to claim 1, wherein the method for obtaining the bending positioning area comprises: 将所述分布离散程度与所述频率数量相乘后进行负相关映射,获得识别程度,根据所述识别程度筛除所述局部疑似弯折区域中的干扰区域,获得弯折定位区域。The distribution discreteness is multiplied by the frequency quantity and then negatively correlated with each other to obtain a recognition degree, and interference areas in the local suspected bending area are screened out according to the recognition degree to obtain a bending positioning area. 10.根据权利要求9所述的一种用于电位器生产线的电位器视觉检测方法,其特征在于,所述根据所述识别程度筛除所述局部疑似弯折区域中的干扰区域,获得弯折定位区域,包括:10. A potentiometer visual inspection method for a potentiometer production line according to claim 9, characterized in that the step of screening out interference areas in the local suspected bending area according to the recognition degree to obtain the bending positioning area comprises: 将所述识别程度小于预设识别程度阈值的局部疑似弯折区域作为干扰区域,将所述识别程度不小于预设识别程度阈值的局部疑似弯折区域作为弯折定位区域。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.
CN202411777795.7A 2024-12-05 2024-12-05 Potentiometer visual detection method for potentiometer production line Active CN119600012B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411777795.7A CN119600012B (en) 2024-12-05 2024-12-05 Potentiometer visual detection method for potentiometer production line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411777795.7A CN119600012B (en) 2024-12-05 2024-12-05 Potentiometer visual detection method for potentiometer production line

Publications (2)

Publication Number Publication Date
CN119600012A true CN119600012A (en) 2025-03-11
CN119600012B CN119600012B (en) 2025-06-27

Family

ID=94840491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411777795.7A Active CN119600012B (en) 2024-12-05 2024-12-05 Potentiometer visual detection method for potentiometer production line

Country Status (1)

Country Link
CN (1) CN119600012B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1048149A (en) * 1996-08-02 1998-02-20 Ricoh Co Ltd Image defect detection method and apparatus
US20080107328A1 (en) * 2006-11-03 2008-05-08 Liang-Chia Chen Non-uniform Image Defect Inspection Method
CN105144681A (en) * 2013-03-15 2015-12-09 三星电子株式会社 Creating details in an image with frequency lifting
CN109459970A (en) * 2018-10-26 2019-03-12 常州机电职业技术学院 Elliptical hole potentiometer angle reset system and reset method based on vision
CN110572652A (en) * 2019-09-04 2019-12-13 锐捷网络股份有限公司 Static image processing method and device
CN111316093A (en) * 2018-12-14 2020-06-19 合刃科技(深圳)有限公司 Structural defect detection system and structural defect detection method
CN114429649A (en) * 2022-04-07 2022-05-03 青岛美迪康数字工程有限公司 Target image identification method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1048149A (en) * 1996-08-02 1998-02-20 Ricoh Co Ltd Image defect detection method and apparatus
US20080107328A1 (en) * 2006-11-03 2008-05-08 Liang-Chia Chen Non-uniform Image Defect Inspection Method
CN105144681A (en) * 2013-03-15 2015-12-09 三星电子株式会社 Creating details in an image with frequency lifting
CN109459970A (en) * 2018-10-26 2019-03-12 常州机电职业技术学院 Elliptical hole potentiometer angle reset system and reset method based on vision
CN111316093A (en) * 2018-12-14 2020-06-19 合刃科技(深圳)有限公司 Structural defect detection system and structural defect detection method
CN110572652A (en) * 2019-09-04 2019-12-13 锐捷网络股份有限公司 Static image processing method and device
CN114429649A (en) * 2022-04-07 2022-05-03 青岛美迪康数字工程有限公司 Target image identification method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴文轩等: "基于MATLAB软件的图像处理技术在电子元器件引脚缺陷检测的应用", 《福建轻纺》, no. 01, 25 January 2018 (2018-01-25) *

Also Published As

Publication number Publication date
CN119600012B (en) 2025-06-27

Similar Documents

Publication Publication Date Title
CN111383209B (en) An Unsupervised Flaw Detection Method Based on Fully Convolutional Autoencoder Network
CN113628189B (en) Rapid strip steel scratch defect detection method based on image recognition
CN115564767B (en) Inductance winding quality monitoring method based on machine vision
CN118628500B (en) Method and system for detecting vacuum coating defects of watch case based on image processing
CN115598025B (en) Image processing method and calcium carbonate powder quality inspection system using same
CN113808138A (en) Artificial intelligence-based wire and cable surface defect detection method
CN115330767A (en) Method for identifying production abnormity of corrosion foil
CN117011292B (en) Method for rapidly detecting surface quality of composite board
CN114372983A (en) A method and system for detecting coating quality of shielding box based on image processing
CN117274262B (en) Wire welding method for acoustic horn circuit board
CN114565563B (en) Color steel plate surface abnormity detection method based on artificial intelligence
CN116402810A (en) Image processing-based lubricating oil anti-abrasive particle quality detection method
CN119600012B (en) Potentiometer visual detection method for potentiometer production line
CN119131012B (en) Busbar surface quality inspection method based on machine vision
CN118628483B (en) A method for identifying surface defects of steel structures
CN117372422B (en) Material bending degree detection method for part production
CN118392834B (en) A detection method for integrated circuit transparent flexible substrate
CN117237350B (en) Real-time detection method for quality of steel castings
CN113920118B (en) Hollow glass spacer glue-shortage detection method based on image processing
CN115511884A (en) Punching compound die surface quality detection method based on computer vision
CN120355706B (en) A method for detecting defects in optical module packaging materials
CN118658801B (en) A wafer residue detection method for cleaning etching machine
CN119648690B (en) Substrate surface cleanliness detection method and device for PVD coating
CN118864466B (en) A method for intelligently identifying surface defects of nanoimprint wafers
CN120807352B (en) Image enhancement-based automobile mold production quality control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant