[go: up one dir, main page]

CN118396984B - Quality detection method for hardware terminal - Google Patents

Quality detection method for hardware terminal Download PDF

Info

Publication number
CN118396984B
CN118396984B CN202410822901.2A CN202410822901A CN118396984B CN 118396984 B CN118396984 B CN 118396984B CN 202410822901 A CN202410822901 A CN 202410822901A CN 118396984 B CN118396984 B CN 118396984B
Authority
CN
China
Prior art keywords
sequence
determining
interval
stitch
pixel points
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.)
Active
Application number
CN202410822901.2A
Other languages
Chinese (zh)
Other versions
CN118396984A (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.)
Dongguan Shangtong Hardware Electronics Co ltd
Original Assignee
Dongguan Shangtong Hardware Electronics 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 Dongguan Shangtong Hardware Electronics Co ltd filed Critical Dongguan Shangtong Hardware Electronics Co ltd
Priority to CN202410822901.2A priority Critical patent/CN118396984B/en
Publication of CN118396984A publication Critical patent/CN118396984A/en
Application granted granted Critical
Publication of CN118396984B publication Critical patent/CN118396984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • 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)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Biochemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Geometry (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image data processing, in particular to a quality detection method of a hardware terminal, which comprises the following steps: collecting images of the continuous hardware terminals to be detected, and carrying out graying treatment on the collected images to obtain gray images; acquiring an arrangement rule of pins of the hardware terminal based on the gray level image, wherein the arrangement rule comprises a pin arrangement direction and a pin period interval; based on the arrangement rule, acquiring gray scale differences of pixel points at the same positions on different pins, and determining the possibility that the pixel points belong to normal points according to the gray scale differences; and determining a defect area of the continuous hardware terminal to be detected based on the probability. According to the quality detection method provided by the invention, through determining the arrangement rule of the pins of the hardware terminal, the gray level difference of the pixel points at the positions on different pins is obtained, the possibility that each pixel point belongs to a normal point can be calculated, and further, the defect area of the continuous hardware terminal to be detected is determined, so that the quality detection of the hardware terminal is completed.

Description

Quality detection method for hardware terminal
Technical Field
The invention relates to the technical field of image data processing, in particular to a quality detection method of a hardware terminal.
Background
A hardware terminal generally refers to a metallic connector that connects wires or leads for establishing a reliable electrical connection in electrical and electronic devices. But due to reactions of metals with moisture, oxygen and other chemicals in the environment, these reactions can lead to oxide layer or rust formation on the terminal surface, degrading its conductive properties and connection quality. Therefore, the method is particularly important for rust detection of the surface of the hardware terminal.
Although the arrangement of the continuous hardware terminals is regular, the pictures shot by the camera are deformed due to external factors, so that effective quality detection cannot be performed on the hardware terminals.
Disclosure of Invention
In order to solve the technical problem that effective quality detection cannot be performed on a hardware terminal, the invention aims to provide a quality detection method of the hardware terminal, and the adopted technical scheme is as follows:
A quality detection method of a hardware terminal, the quality detection method comprising: collecting images of the continuous hardware terminals to be detected, and carrying out graying treatment on the collected images to obtain gray images; acquiring an arrangement rule of pins of the hardware terminal based on the gray level image, wherein the arrangement direction of the pins of the arrangement rule and the periodic intervals of the pins are equal to each other; based on the arrangement rule, acquiring gray scale differences of pixel points at the same positions on different pins, and determining the possibility that the pixel points belong to normal points according to the gray scale differences; and determining a defect area of the continuous hardware terminal to be detected based on the probability.
Preferably, the step of obtaining the arrangement rule of the hardware terminal pins based on the gray level image includes: and acquiring gradient directions of all pixel points in the gray level image, and determining the stitch arrangement direction based on the gradient directions.
Preferably, the step of obtaining the arrangement rule of the hardware terminal pins based on the gray level image further includes: dividing all pixel points into a plurality of sequences based on the stitch arrangement direction; and determining the stitch period interval based on the gradient distribution of the pixel points on the same sequence.
Preferably, the step of determining the stitch cycle interval based on the gradient distribution of the pixels on the same sequence includes: acquiring gradient distribution of pixel points on each sequence, and determining an optimal sequence based on the gradient distribution; taking the periodic interval of the optimal sequence as the stitch periodic interval.
Preferably, the optimal sequence is determined by analyzing the correlation between the position of the edge point and the interval distance of the adjacent edge points on each sequence and the gray scale difference between the edge points.
Preferably, the sequence evaluation value is calculated, and the sequence corresponding to the maximum value in the sequence evaluation value is taken as the optimal sequence;
the sequence evaluation value The calculation formula of (2) is as follows:
In the method, in the process of the invention, Representing pearson correlation coefficients reflected by the positions and spacing distances of edge points in each sequence,Representing the number of edge points in each sequence,Represents the gray value corresponding to the nth edge point in the mth sequence,Representing the gray-scale average of all edge points on the mth sequence.
Preferably, the step of determining the stitch cycle interval based on the gradient distribution of the pixels on the same sequence comprises: acquiring gradient distribution of pixel points on each sequence, and determining an optimal sequence based on the gradient distribution; and correcting the period interval of the optimal sequence to obtain the stitch period interval.
Preferably, the step of correcting the period interval of the optimal sequence to obtain the stitch period interval includes:
calculating the change rate of the period interval by taking the period interval of the optimal sequence as a reference period interval;
And correcting the reference period interval based on the change rate to obtain the stitch period interval.
Preferably, the step of obtaining the gray scale difference of the pixel points at the same position on different pins based on the arrangement rule and determining the possibility that the pixel points belong to the normal points specifically includes:
And aiming at each pixel point, acquiring a plurality of pixel points at the same position on other pins corresponding to the current pixel point according to the arrangement rule, calculating a plurality of gray value difference values, and summing absolute values to obtain the possibility.
Preferably, the determining the defect area of the continuous hardware terminal to be detected based on the likelihood is that the defect area is determined by performing adaptive value linear gray scale stretching based on the calculated likelihood.
The invention has the following beneficial effects: according to the quality detection method of the hardware terminal, provided by the invention, the gray level difference of the pixel points at the positions on different pins is obtained by determining the arrangement rule of the pins of the hardware terminal, so that the possibility that each pixel point belongs to a normal point can be calculated, the defect area of the continuous hardware terminal to be detected is further determined, and the quality detection of the hardware terminal is completed.
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 quality detection method of a hardware terminal according to an embodiment of the invention;
FIG. 2 is a schematic illustration of an image acquired in one embodiment of the invention;
Fig. 3 is a schematic sub-flowchart of step S20 in a quality detection method of a hardware terminal according to an embodiment of the present invention;
fig. 4 is a schematic sub-flowchart of step S23 in a quality detection method of a hardware terminal according to an embodiment of the present invention;
Fig. 5 is a schematic sub-flowchart of step S232 in a quality detection method of a hardware terminal according to an embodiment of the invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following detailed description is given below of a quality detection method of a hardware terminal according to the invention, which is specific to the implementation, structure, characteristics and effects thereof, with reference to the accompanying drawings and preferred embodiments. 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 following specifically describes a specific scheme of a quality detection method for hardware terminals provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a method flowchart of a quality detection method of a hardware terminal according to an embodiment of the present invention is shown, where the quality detection method includes:
Step S10, collecting images of a continuous hardware terminal to be detected, and carrying out graying treatment on the collected images to obtain gray images;
Step S20, acquiring an arrangement rule of pins of the hardware terminal based on the gray level image, wherein the arrangement rule comprises a pin arrangement direction and a pin period interval;
step S30, based on the arrangement rule, acquiring gray scale differences of pixel points at the same positions on different pins, and determining the possibility that the pixel points belong to normal points according to the gray scale differences;
And step S40, determining a defect area of the continuous hardware terminal to be detected based on the possibility.
The invention relates to a quality detection method for a continuous hardware terminal, which is characterized in that the gray level difference of pixel points at the same position on different pins of the hardware terminal is obtained by determining the arrangement rule of the pins of the hardware terminal to be detected, the possibility that each pixel point belongs to a normal point is calculated by utilizing the gray level difference, and then the defect area of the continuous hardware terminal to be detected is determined, so that the quality detection of the hardware terminal is completed.
The following details the steps:
In step S10, referring to fig. 2, it can be seen that the acquired images of the continuous hardware terminals, while the pins of the continuous hardware terminals are periodically arranged, the images shot by the camera are deformed due to external factors, so that it is difficult to perform effective quality detection. It can be understood that the gray scales of the same position points on different pins of the hardware terminal with qualified quality are consistent; if the surface of the hardware terminal pin has a defective area, that is, when an oxide layer or rust is formed, the gray scale of the position point of the defective area is different from the gray scale of the same position point on other pins.
It should be noted that, each pixel point on the pin will have a corresponding pixel point at the same position on the other pins, which may also be referred to as a period point of the pixel point. The detection method provided by the invention achieves the aim of finishing quality detection of the hardware terminal under the condition of picture deformation.
In step S20, it can be understood that the gray scale of the pixel points located in the same area (the background area or the stitch area) will maintain uniformity; and a larger gray scale difference exists at the edge points, namely the pixel points at the junction of the stitch and the background. Therefore, the gray scale difference of all pixel points can be analyzed according to the gray scale image, so that the stitch arrangement direction and stitch period interval of the hardware terminal can be obtained, wherein the stitch period interval is the period length, namely the distance between stitches. The pin arrangement direction is the direction indicated by arrow a in fig. 2.
Preferably, the stitch arrangement direction is determined by using the overall gradient direction of all pixel points in the image. Referring to fig. 3, the step S20 includes a step S21 of obtaining gradient directions of all pixels in the gray scale image, and determining the stitch arrangement direction based on the gradient directions.
As shown in fig. 2, for the continuous hardware terminal, each stitch is mainly in a strip shape, and the strip-shaped stitch can make the stitch vertical direction have higher gradient expression, and the stitch arrangement direction required to be obtained is vertical to the stitch, so that the stitch arrangement direction can be determined by using the overall gradient direction of all the pixels in the image. In some preferred embodiments, a sum vector of gradient vectors of all pixels of the whole image can be obtained, and the direction of the sum vector is the stitch arrangement direction. Specifically, the gradient of any pixel point is determined as a vector, wherein the gradient amplitude is the vector modulo length, the gradient direction is the vector direction, then the vectors corresponding to the gradients of all pixel points are summed to obtain the sum vector of the gradient vectors of all pixel points of the whole image, and the direction of the obtained sum vector is the stitch arrangement direction.
More preferably, the step of obtaining the arrangement rule of the hardware terminal pins based on the gray level image further includes: dividing all pixel points into a plurality of sequences based on the stitch arrangement direction; and determining the stitch period interval based on the gradient distribution of the pixel points on the same sequence. That is, as shown in fig. 3, the step S20 further includes: step S22, dividing all pixel points into a plurality of sequences based on the stitch arrangement direction; and step S23, determining the stitch period interval based on gradient distribution of pixel points on the same sequence.
By acquiring each sequence in the determined stitch arrangement direction, each pixel point and the periodic point thereof are in the same sequence, so that the periodic point corresponding to the pixel point can be conveniently searched later, the stitch periodic interval is determined based on the gradient distribution of the pixel points on the same sequence, and accurate stitch periodic interval data can be obtained.
In step S23, it can be understood that, since the stitch has continuity in the arrangement direction and there is a large gray scale difference between the stitch and the background, there is a large gradient change at the stitch edge, so that all the period intervals can be obtained by gradient distribution of the pixel points on each sequence. In some embodiments, a gradient distribution of pixels on each sequence is obtained, and an optimal sequence is determined based on the gradient distribution; taking the periodic interval of the optimal sequence as the stitch periodic interval. By screening out the optimal sequence without the defect point and taking the period interval of the optimal sequence as the period interval, the accuracy of the detection result can be ensured.
More preferably, the optimal sequence is determined by analyzing the correlation between the position of the edge point and the distance between adjacent edge points on each sequence and the gray scale difference between the edge points.
This is because the surface defects of the stitch also result in a sequence with a large gradient that is not a basis for reflecting the periodic variations of the image. And because the image is deformed by photographing, the stitch period interval has a certain change rule on a sequence, the regularity is broken by the defect edge point, and the gray value of the defect edge point is different from the gray values of other edge points. Therefore, by analyzing the correlation between the position of the edge point on each sequence and the interval distance between the adjacent edge points and the gray level difference between the edge points, the interval distance obtained by comprehensively evaluating the optimal sequence can be confirmed to have the sequence with the optimal periodic expression.
In some embodiments, the optimal sequence is determined by taking the interval of all edge points n in the same gradient direction and having a gradient greater than 150, for each obtained gradient distribution, asRepresenting the distance between the nth edge point and the next edge point in the mth sequence
More preferably, the sequence corresponding to the maximum value in the sequence evaluation values is taken as the optimal sequence by calculating the sequence evaluation values; the sequence evaluation valueThe calculation formula of (2) is as follows:
In the method, in the process of the invention, Representing the pearson correlation coefficient reflected by the position and the interval distance of the edge point in each sequence, wherein the pearson correlation coefficient reflects the correlation of two variables through the quotient of the product of covariance and standard deviation between the two variables; the range of values of the correlation coefficient is [ -1, +1], a negative value indicates that one variable value increases and the other decreases, a positive value indicates that one variable value increases and the other increases, and 0 indicates that the increase and decrease of one variable has no effect on the value of the other variable;
representing the number of edge points in each sequence, Represents the gray value corresponding to the nth edge point in the mth sequence,Representing the gray-scale average of all edge points on the mth sequence.
Evaluating values at the sequenceIs calculated by multiplying two scores. In the first score, the degree of periodicity of the acquired edge points over the sequence is evaluated; specifically, the molecules areIt can be understood that, since the gray scale of the defect point is relatively close to that of the normal point in the stitch, by using the pixel point with the gradient larger than 150 as the edge point, for a certain hardware terminal to be detected,Is a fixed value; and denominator isIt will be appreciated that the better the degree of periodicity of the sequence, the smaller and even no difference in gray scale between the acquired edge points, the greater the value of the score; and under certain ideal conditions, when the gray levels between the edge points are completely consistent, the gray levels appearSince 0 is not calculated, it is +1. In the second score, the degree of correlation between the position of the acquired edge point on the sequence and the spacing distance of the adjacent edge points is evaluated; specifically, the numerator is a fixed value of 1, and the denominator isIt will be appreciated that if the degree of correlation between the position of an acquired edge point on a sequence and the separation distance of adjacent edge points is betterThe closer to 1 the value of (c), the greater the value of the score; and under certain ideal conditions, it will occurThe value of (2) is equal to 1 such thatSince 0 cannot be used, it is +0.1. The calculation formula can comprehensively evaluate the periodic performance of the sequence, thereby determining the optimal sequence.
This allows calculation of each sequenceValue, finally calculateThe sequence corresponding to the maximum value is the optimal sequence.
Referring to fig. 4, in other embodiments, the step S23 includes:
Step S231, obtaining gradient distribution of pixel points on each sequence, and determining an optimal sequence based on the gradient distribution;
And step S232, correcting the period interval of the optimal sequence to obtain the stitch period interval.
After the optimal sequence is determined, the period interval of the optimal sequence is corrected, so that more accurate stitch period interval can be obtained, the accuracy of searching the periodic point corresponding to the pixel point is improved, and the accuracy of a detection result can be further ensured.
The specific manner of step S231 may refer to the content of determining the optimal sequence described above, and will not be described herein.
For step S232, referring to fig. 5, in some preferred embodiments, the step S232 includes:
step S2321, calculating the change rate of the period interval by taking the period interval of the optimal sequence as a reference period interval;
Step S2322, correcting the reference period interval based on the change rate to obtain the stitch period interval.
It will be appreciated that since the stitch cycle interval is not a fixed value due to image distortion, the stitch cycle interval may gradually increase or gradually decrease, so that the cycle length of the pixel points in the cycle interval may be inconsistent, but still follow the rule that the cycle length gradually increases or gradually decreases. For all the pixels of one period interval, the period length of the pixels is gradually increased or decreased, and the corresponding period interval cannot directly reflect the period performance of all the pixels contained in the period interval, but can show the period difference from the period of the pixels in different intervals, so that the period interval can be determined as the reference period of all the pixels contained in the period interval, and the period performance of the whole is reflected. Generally, the variation of the periodic performance of the pixel points in the sequence has uniformity, so the periodic interval variation can directly reflect the periodic variation relation of the sequence, and further, the period of all the pixel points in the periodic interval is corrected according to the periodic variation relation, so as to obtain the period size of all the pixel points. Therefore, the reference cycle length can be corrected by analyzing the variation relationship of the cycle interval. The method is characterized in that the period interval of the optimal sequence is used as a reference, the change rule of the period interval is obtained through analysis, and the change rule is utilized to correct the reference period interval, so that the more accurate stitch period interval is obtained.
The step 2321 specifically includes:
The pin arrangement direction of the hardware terminals is taken as the X direction, and the direction with gradually increased period intervals is taken as the X-axis positive direction. At this time, the rate of change of the period interval is k, and the calculation formula is as follows:
In the method, in the process of the invention, Indicating the amount of change in the interval between adjacent cycles,Representing the distance between two center pixel points corresponding to adjacent period intervals,Indicating the number of adjacent periodic intervals.Representing the rate of change of the period interval;
The step 2322 specifically includes:
The period length of the center point in one period interval represents the average period length of all the pixel points in the period interval, and the period length of the center point is the period interval length, so the center point in one period interval is taken as the reference point on the period interval, and the reference period length is . (In particular, when the number of pixels in the periodic interval is an odd number, the pixel at one position in the center of the periodic interval is taken as the reference point, whereas the pixel at two positions in the center of the periodic interval is taken as the reference point).
The period length of the rear pixel point with the reference point as the center gradually increases, the period length of the front pixel point gradually decreases, and the calculation formula of the period length of the pixel point in one period interval is as follows:
Wherein: The period length of the i-th pixel point behind the reference point in the nth period interval is shown, =The period length of the i-th pixel point in front of the reference point in the nth period interval is shown,=
Specifically, the reference period length of the reference point isPeriod length of 1 st pixel behind reference point=Period length of the 2 nd pixel behind the reference point=Period length of 3 rd pixel point behind reference point=Similarly, the period length of the subsequent pixel point is calculated according to the change rate based on the previous one; period length of 1 st pixel point in front of reference point=Period length of 2 nd pixel point in front of reference point=Period length of 3 rd pixel point behind reference point=Similarly, the period length of the subsequent pixel point is calculated based on the previous one according to the change rate.
Through the calculation of the formula, the period length L of all pixel points in all period intervals can be finally obtained.
In step S30, since the gray values of the pixel points at the corresponding positions in each stitch have consistency in the stitch images arranged in succession, and if a stitch has a defect, the gray value of the pixel point at the defective position is inconsistent with the gray values of the pixel points at the corresponding positions on other stitches, the possibility that the current pixel point belongs to a normal point can be determined by the gray difference between the current pixel point and the pixel points at other corresponding positions. That is, based on the stitch period interval, a plurality of period points in the same sequence with the current pixel point can be found, if the gray scale between the current pixel point and the plurality of period points is not different or is very small, the probability that the current pixel point belongs to the normal point is high, and if the gray scale between the current pixel point and the plurality of period points is different, the probability that the current pixel point belongs to the normal point is low.
Preferably, in step S30, for each pixel, a plurality of pixel points at the same position on the current pixel corresponding to other pins are obtained according to the arrangement rule, and after a plurality of gray value differences are calculated, absolute values are taken and summed to obtain the possibility.
The possibility is thatThe calculation formula of (2) is as follows:
Wherein: represents the gray value of the current pixel point, And representing the gray values of the pixel points at the current pixel point corresponding to a plurality of positions on other pins.
The gray level difference between the current pixel point and a plurality of periodic points can be calculated and obtained, and the gray level difference is embodied in specific numerical values. Wherein N may be selected according to the number of pins of the hardware terminal to be detected, in some preferred embodiments N is 3-7, in some specific embodiments N is 5.
In step S40, the likelihood may be calculatedFor making the determination, a threshold value may be set, for example, if the likelihood of a pixel pointIf the threshold value is exceeded, determining that the pixel is normal, and if the pixel is likely to beAnd if the threshold value is not exceeded, judging the hardware terminal to be detected as a defect point, and determining a defect area of the hardware terminal to be detected.
In some preferred embodiments, the continuous hardware terminal defect area to be detected is determined by adaptively performing value-taking linear gray scale stretching based on the calculated likelihood. That is, the likelihood that the calculated pixel point belongs to the normal point is utilizedAnd (3) carrying out self-adaptive value taking on k by adopting a linear gray stretching method to obtain an image for enhancing the defects. And (3) carrying out threshold segmentation on the image through the enhanced gray image by using an Ojin algorithm to obtain a binary image, wherein a connected region with a median value of 1 in the binary image is a defect region of the hardware terminal.
It will be appreciated that the possibility will be due to the closer gray level of the defective point to the normal point in the stitchAs the coefficient k value in the linear transformation function, the gray value of the defect area can be enhanced, and the gray value of the normal area is weakened, which is equivalent to amplifying the difference between the two; therefore, gray stretching is performed first, then the defect area is determined, and the accuracy of the detection result can be further improved.
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 (6)

1. The quality detection method of the hardware terminal is characterized by comprising the following steps of:
collecting images of the continuous hardware terminals to be detected, and carrying out graying treatment on the collected images to obtain gray images;
acquiring an arrangement rule of pins of the hardware terminal based on the gray level image, wherein the arrangement rule comprises a pin arrangement direction and a pin period interval;
Based on the arrangement rule, acquiring gray scale differences of pixel points at the same positions on different pins, and determining the possibility that the pixel points belong to normal points according to the gray scale differences;
determining a defect area of the continuous hardware terminal to be detected based on the possibility;
the step of obtaining the arrangement rule of the hardware terminal pins based on the gray level image further comprises the following steps:
Dividing all pixel points into a plurality of sequences based on the stitch arrangement direction;
determining the stitch cycle interval based on the gradient distribution of the pixel points on the same sequence;
the step of determining the stitch cycle interval based on the gradient distribution of the pixel points on the same sequence comprises the following steps:
acquiring gradient distribution of pixel points on each sequence, and determining an optimal sequence based on the gradient distribution; taking the periodic interval of the optimal sequence as the stitch periodic interval;
the optimal sequence is determined by analyzing the correlation between the position of the edge point on each sequence and the interval distance between the adjacent edge points and the gray level difference between the edge points;
calculating a sequence evaluation value, wherein a sequence corresponding to the maximum value in the sequence evaluation value is the optimal sequence;
the sequence evaluation value The calculation formula of (2) is as follows:
In the method, in the process of the invention, Representing pearson correlation coefficients reflected by the positions and spacing distances of edge points in each sequence,Representing the number of edge points in each sequence,Represents the gray value corresponding to the nth edge point in the mth sequence,Representing the gray-scale average of all edge points on the mth sequence.
2. The method for detecting quality of a hardware terminal according to claim 1, wherein the step of acquiring an arrangement rule of pins of the hardware terminal based on the gray level image comprises:
and acquiring gradient directions of all pixel points in the gray level image, and determining the stitch arrangement direction based on the gradient directions.
3. The method for detecting quality of a hardware terminal according to claim 1, wherein the step of determining the stitch cycle interval based on gradient distribution of pixels on the same sequence includes: acquiring gradient distribution of pixel points on each sequence, and determining an optimal sequence based on the gradient distribution; and correcting the period interval of the optimal sequence to obtain the stitch period interval.
4. The method for detecting the quality of a metal terminal according to claim 3, wherein the step of correcting the cycle interval of the optimal sequence to obtain the stitch cycle interval comprises:
calculating the change rate of the period interval by taking the period interval of the optimal sequence as a reference period interval;
And correcting the reference period interval based on the change rate to obtain the stitch period interval.
5. The method for detecting quality of hardware terminals according to any one of claims 1 to 4, wherein the step of obtaining gray scale differences of pixel points at positions on different pins based on the arrangement rule and determining the probability that the pixel points belong to normal points specifically comprises:
And aiming at each pixel point, acquiring a plurality of pixel points at the same position on other pins corresponding to the current pixel point according to the arrangement rule, calculating a plurality of gray value difference values, and summing absolute values to obtain the possibility.
6. The method for detecting quality of a metal terminal according to claim 5, wherein the determining of the defective area of the continuous metal terminal to be detected based on the likelihood is determining the defective area by performing adaptive value linear gray scale stretching based on the computed likelihood.
CN202410822901.2A 2024-06-25 2024-06-25 Quality detection method for hardware terminal Active CN118396984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410822901.2A CN118396984B (en) 2024-06-25 2024-06-25 Quality detection method for hardware terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410822901.2A CN118396984B (en) 2024-06-25 2024-06-25 Quality detection method for hardware terminal

Publications (2)

Publication Number Publication Date
CN118396984A CN118396984A (en) 2024-07-26
CN118396984B true CN118396984B (en) 2024-08-30

Family

ID=91999766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410822901.2A Active CN118396984B (en) 2024-06-25 2024-06-25 Quality detection method for hardware terminal

Country Status (1)

Country Link
CN (1) CN118396984B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117372435A (en) * 2023-12-08 2024-01-09 智联信通科技股份有限公司 Connector pin detection method based on image characteristics
CN117723548A (en) * 2023-12-14 2024-03-19 东莞市毅廷音响科技有限公司 Automobile horn production quality detection method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109712084B (en) * 2018-12-10 2021-01-19 上海奕瑞光电子科技股份有限公司 Image restoration method, image restoration system and flat panel detector
CN115272322A (en) * 2022-09-28 2022-11-01 南通先端精密机械有限公司 Alloy defect quantitative detection method based on data processing
CN116703912B (en) * 2023-08-07 2023-11-24 深圳市鑫赛科科技发展有限公司 Mini-host network port integrity visual detection method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117372435A (en) * 2023-12-08 2024-01-09 智联信通科技股份有限公司 Connector pin detection method based on image characteristics
CN117723548A (en) * 2023-12-14 2024-03-19 东莞市毅廷音响科技有限公司 Automobile horn production quality detection method

Also Published As

Publication number Publication date
CN118396984A (en) 2024-07-26

Similar Documents

Publication Publication Date Title
CN113689428B (en) Mechanical part stress corrosion detection method and system based on image processing
CN109242853B (en) An intelligent detection method for PCB defects based on image processing
CN112153371B (en) Image quality detection method, device, storage medium and product detection method
CN116993718B (en) TFT array substrate defect detection method based on machine vision
CN116137036B (en) Gene detection data intelligent processing system based on machine learning
CN115272336A (en) Metal part defect accurate detection method based on gradient vector
CN112037287A (en) Camera calibration method, electronic device and storage medium
CN117274291B (en) Method for detecting mold demolding residues based on computer vision
CN118657759A (en) Composite pipe quality inspection method and system based on machine vision
CN116862812A (en) Infrared image processing method, device, computer equipment, storage medium and product
CN109255799B (en) A target tracking method and system based on spatial adaptive correlation filter
CN118396984B (en) Quality detection method for hardware terminal
CN114445318B (en) Defect detection method, device, electronic device and storage medium
CN117237350B (en) Real-time detection method for quality of steel castings
CN117848972B (en) Titanium alloy anodic oxidation pretreatment method
CN114638833B (en) Non-ferrous metal calendering quality detection method and system based on machine vision
CN116523904A (en) Artificial intelligence-based metal stamping part surface scratch detection method
CN107993196B (en) Image Interpolation Method and System Based on Predictive Verification
CN117197009A (en) In-situ test scanning drift image correction method, system and storage medium
CN116883401A (en) Industrial product production quality detection system
CN115641611A (en) Human body posture estimation method, device, equipment and storage medium
CN119672026B (en) Watch bottom cover defect inspection method and system based on machine vision
CN116758082B (en) Profile steel production quality detection method based on artificial intelligence
CN119131012B (en) Busbar surface quality inspection method based on machine vision
CN118657740B (en) Hardware processing quality inspection method, electronic equipment and system

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