CN117252877B - Diode lead frame quality detection method based on image characteristics - Google Patents

Diode lead frame quality detection method based on image characteristics Download PDF

Info

Publication number
CN117252877B
CN117252877B CN202311533551.XA CN202311533551A CN117252877B CN 117252877 B CN117252877 B CN 117252877B CN 202311533551 A CN202311533551 A CN 202311533551A CN 117252877 B CN117252877 B CN 117252877B
Authority
CN
China
Prior art keywords
scratch
local
area
pixel points
deep
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
CN202311533551.XA
Other languages
Chinese (zh)
Other versions
CN117252877A (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.)
Jinan Jielong Technology Co ltd
Original Assignee
Jinan Jielong 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 Jinan Jielong Technology Co ltd filed Critical Jinan Jielong Technology Co ltd
Priority to CN202311533551.XA priority Critical patent/CN117252877B/en
Publication of CN117252877A publication Critical patent/CN117252877A/en
Application granted granted Critical
Publication of CN117252877B publication Critical patent/CN117252877B/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
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • 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)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Testing Or Measuring Of Semiconductors Or The Like (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to the technical field of image data processing, and provides a diode lead frame quality detection method based on image characteristics, which comprises the following steps: collecting a surface gray level image of the diode lead frame; obtaining a plurality of local scratch areas and other local areas on the surface gray level image; obtaining the scratch possibility of the pixel points according to the gray scale and the gradient of the pixel points in the local scratch area; obtaining shallow scratch pixel points in the local scratch area according to the scratch possibility; according to the gray scale and gradient of the deep scratch pixel points and the shallow scratch pixel points in the local scratch areas, iteratively obtaining the final optimal threshold value of each local scratch area and the final optimal threshold values of all other local areas; and obtaining the mechanical scratch according to the final optimal threshold segmentation. The invention aims to solve the problem of inaccurate detection results caused by the difference of the depths of scratches when the quality of the diode lead frame is detected by the scratches.

Description

Diode lead frame quality detection method based on image characteristics
Technical Field
The invention relates to the field of image data processing, in particular to a quality detection method of a diode lead frame based on image characteristics.
Background
In the production process of the diode lead frame, mechanical scratches are generated on the surface of the diode lead frame due to insufficient smoothness of the surface of the die or over sharp protruding parts of the die, so that the quality of the diode lead frame is seriously affected, and therefore, the diode lead frame needs to be subjected to timely quality detection. Since obvious gray level difference exists between the mechanical scratches and the surface of the diode lead frame, the quality detection is carried out by commonly using iterative threshold segmentation in the prior method, however, the mechanical scratches have the difference of depth and the deep scratches are easily obtained by iterative threshold segmentation, the shallow scratches are easily ignored due to the small gray level difference, the detection of the mechanical scratches is further caused to have errors, and the shallow scratches possibly form the deep scratches due to abrasion, so that the diode lead frame has more serious quality problem, therefore, the iterative threshold segmentation is required to be optimized, the detection of the depth and the shallow scratches is ensured, and the errors of quality detection results are avoided.
Disclosure of Invention
The invention provides a quality detection method of a diode lead frame based on image characteristics, which aims to solve the problem of inaccurate detection results caused by the difference of the depths of scratches when the quality of the diode lead frame is detected by the scratches, and adopts the following technical scheme that:
an embodiment of the present invention provides a method for detecting quality of a diode lead frame based on image features, the method comprising the steps of:
collecting a surface image of a diode lead frame, and preprocessing to obtain a surface gray level image;
dividing the surface gray level image through an iteration threshold to obtain a plurality of deep scratch pixel points, and dividing the surface gray level image and combining the deep scratch pixel points to obtain a plurality of local scratch areas and other local areas; obtaining the scratch possibility of each pixel point except the pixel point with the deep scratch in the local scratch area according to the gray scale and the gradient of the pixel point in the local scratch area;
obtaining shallow scratch pixel points in the local scratch area according to the scratch possibility; according to the gray scale and gradient of the deep scratch pixel points and the shallow scratch pixel points in the local scratch areas, iteratively obtaining the final optimal threshold value of each local scratch area and the final optimal threshold values of all other local areas;
and obtaining the mechanical scratch according to the final optimal threshold segmentation.
Further, the preprocessing is performed to obtain a surface gray level image, and the specific method comprises the following steps:
and carrying out graying treatment on the surface image of the diode lead frame, carrying out denoising treatment on the grayed image through Gaussian filtering, and recording the treated image as a surface gray image.
Further, the method for obtaining a plurality of deep scratch pixel points from the surface gray level image through iterative threshold segmentation comprises the following specific steps:
performing iterative threshold segmentation on the surface gray image, setting initial parameters and initial thresholds, wherein the initial thresholds adopt gray value average values of all pixel points in the surface gray image, and obtaining an optimal threshold through iterative threshold segmentation, and marking the optimal threshold as the initial optimal threshold; and marking the pixel points with gray values smaller than the initial optimal threshold value as deep scratch pixel points to obtain a plurality of deep scratch pixel points.
Further, the method for obtaining the plurality of local scratch areas and other local areas includes the following specific steps:
the method comprises the steps of dividing a surface gray level image into areas, marking the areas obtained by dividing as local areas, marking the local areas with deep scratch pixel points inside as local scratch areas, and marking the local areas without the deep scratch pixel points as other local areas.
Further, the method for obtaining the scratch possibility of each pixel point except the deep scratch pixel point in the local scratch area specifically includes:
obtaining the vertical direction of deep scratches of each local scratch area according to the gradient of the deep scratch pixel points in the local scratch area; for any partial scratch area, acquiring the gradient direction of each pixel point except the deep scratch pixel point in the partial scratch area, wherein the partial scratch area is the first pixel point except the deep scratch pixel pointScratch possibility of individual pixels +.>The calculation method of (1) is as follows:
wherein,indicating +.>Gradient direction of each pixel point, +.>Deep scratch vertical direction indicating the partial scratch area, < >>Indicating the third pixel point except for the deep scratch pixel point in the local scratch areaGray value of each pixel, +.>A maximum gray value representing all the deep-scratch pixels in the partial scratch area, +.>Representing absolute value>To avoid super parameters with denominator 0.
Further, the specific method for obtaining the deep scratch vertical direction of each partial scratch area comprises the following steps:
and for any one local scratch area, acquiring the gradient direction of each deep scratch pixel point in the local scratch area, and for any one gradient direction, acquiring the average value of sine values of included angles of the gradient direction and other gradient directions, and taking the gradient direction with the smallest average value obtained in all gradient directions as the vertical direction of the deep scratch of the local scratch area.
Further, the method for obtaining shallow scratch pixel points in the local scratch area according to the scratch possibility comprises the following specific steps:
and presetting a scratch threshold value, and marking the pixel points with the scratch possibility larger than or equal to the scratch threshold value in any partial scratch area as shallow scratch pixel points.
Further, the iterative obtaining of the final optimal threshold value of each partial scratch area and the final optimal threshold values of all other partial areas includes the following specific methods:
for any partial scratch area, a plurality of shallow scratch pixel points in the partial scratch area are obtained, and the vertical direction of the shallow scratch of the partial scratch area is obtained according to the gradient direction of the plurality of shallow scratch pixel points; taking the current segmentation condition of the deep scratch pixel points and the shallow scratch pixel points obtained in the local scratch area as a first iteration;
obtaining a threshold value of the local scratch area under each iteration according to the vertical direction of the deep scratch, the vertical direction of the shallow scratch and the gray values of the deep scratch pixel points and the shallow scratch pixel points;
after a new threshold value is obtained for the first iteration of the local scratch area, the pixel points which are smaller than the threshold value and serve as new deep scratch pixels are calculated, the vertical direction of the deep scratch is calculated, the scratch possibility is calculated again, a plurality of new pixel points with shallow scratches and the vertical direction of the shallow scratch are obtained, and the threshold value under the second iteration is calculated; performing iterative threshold segmentation on the local scratch area to obtain an optimal threshold of the local scratch area, and marking the optimal threshold as a final optimal threshold of the local scratch area;
and acquiring the final optimal threshold value of each local scratch area, and taking the average value of all final optimal threshold values as the final optimal threshold value of all other local areas.
Further, the method for obtaining the threshold value of the local scratch area under each iteration comprises the following specific steps:
for any one of the partial scratch areas, the partial scratch area is the firstThreshold +.>The calculation method of (1) is as follows:
wherein,indicating the local scratch area +.>Adjusting weights at multiple iterations, +.>Indicating the local scratch area +.>Gray value average value of all shallow scratch pixel points obtained under multiple iterations, < >>Indicating the local scratch area +.>The gray value average value of other pixels except the pixels with deep scratches and the pixels with shallow scratches is calculated in the next iteration; />Indicating the local scratch area +.>Vertical direction of shallow scratch under multiple iterations, +.>Indicating the local scratch area +.>Vertical direction of deep scratch under multiple iterations, +.>Indicating the local scratch area +.>Gray value average value of all deep scratch pixel points obtained under multiple iterations, < >>Representing absolute value>To avoid super parameters with denominator 0.
Further, the method for obtaining the mechanical scratches according to the final optimal threshold segmentation comprises the following specific steps:
for any local scratch area or other local areas, carrying out threshold segmentation through the final optimal threshold value of the area, and taking an area formed by pixel points with gray values smaller than the final optimal threshold value as a foreground area, and marking the foreground area as a mechanical scratch; taking a region formed by pixel points with gray values larger than or equal to a final optimal threshold value as a background region;
the foreground and background regions of the mechanical scratch are obtained for each partial scratch region or other partial regions.
The beneficial effects of the invention are as follows: according to the invention, the quality detection of the diode lead frame is realized by carrying out optimized iterative threshold segmentation on the surface gray level image of the diode lead frame and obtaining mechanical scratches according to segmentation results; after the traditional iterative threshold segmentation, the local scratch area containing the deep scratch pixel points and other local areas not containing the deep scratch pixel points are obtained by carrying out area division on the surface gray level image, the consistency of the local scratch area interior pixel points with the deep scratch pixel points in the gradient and gray level is analyzed, the scratch possibility is obtained through quantification, the probability that the pixel points are shallow scratches is reflected through the scratch possibility, then the shallow scratches are obtained, the iterative threshold value acquisition is carried out on the local scratch area according to the gradient and gray level difference of the shallow scratches and the deep scratches in the local scratch area, the shallow scratches and the deep scratches gradually tend to be consistent in gray level change in the local area, the final optimal threshold value is obtained, the mechanical scratches are obtained through the final optimal threshold value segmentation, the mechanical scratches on the surface of the diode lead frame cannot be completely detected due to the gray level difference, and the accuracy of the quality detection result of the diode lead frame is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a flowchart illustrating a method for detecting quality of a diode leadframe based on image features according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flowchart of a method for detecting quality of a diode leadframe based on image features according to an embodiment of the invention is shown, the method includes the following steps:
and S001, acquiring a surface image of the diode lead frame, and preprocessing to obtain a surface gray level image.
The objective of the present embodiment is to perform quality inspection on the diode lead frame, so that the surface image of the diode lead frame needs to be acquired first; according to the embodiment, the industrial camera is arranged above the conveyor belt to shoot the surface of the diode lead frame, and meanwhile, as the diode lead frame is made of metal, the influence of illumination is large, and therefore a light source is fixed above the conveyor belt; after capturing an image of the diode lead frame, acquiring a surface part of the diode lead frame through a semantic segmentation network as a surface image of the diode lead frame, wherein the semantic segmentation network segments the image into known techniques, and the embodiment is not repeated; and carrying out graying treatment on the surface image of the diode lead frame, carrying out denoising treatment on the grayed image through Gaussian filtering, and recording the treated image as a surface gray image.
Thus, the surface gray level image of the diode lead frame is acquired.
Step S002, dividing the surface gray level image through iteration threshold values to obtain a plurality of deep scratch pixel points, dividing the surface gray level image, and combining the deep scratch pixel points to obtain a plurality of local scratch areas and other local areas; and acquiring the scratch possibility of each pixel point except the pixel points with deep scratches in the local scratch area according to the gray scale and the gradient of the pixel points in the local scratch area.
After the surface gray level image is segmented through the iteration threshold, the deep scratches are all segmented due to the larger gray level difference between the deep scratches and the surface, and the shallow scratches are not obvious due to the gray level difference between the deep scratches and the surface, so that part of the shallow scratches exist in a foreground region, and part of the shallow scratches exist in a background region and are not segmented; therefore, a plurality of local areas are obtained by blocking the surface gray level image, whether the gray level and the gradient of each pixel point are similar to those of the pixel points on the deep scratch or not is judged by analyzing the gray level and the gradient of the pixel points in the local scratch area with the deep scratch, and the more similar the gray level and the gradient of the pixel points on the deep scratch are, the more likely the gray level and the gradient are the shallow scratches which are not segmented, namely the direction differences of the scratches in the local area are smaller and tend to be consistent, and then the scratch possibility analysis is carried out by utilizing the characteristics.
Specifically, the iterative threshold segmentation is performed on the surface gray level image, an initial parameter and an initial threshold are required to be set for the iterative threshold segmentation, the initial parameter is a preset value for stopping the iterative threshold segmentation, the initial parameter is described by 20, the initial threshold is a gray value average value of all pixel points in the surface gray level image, an optimal threshold is obtained through the iterative threshold segmentation, the optimal threshold is recorded as the initial optimal threshold, the pixel points with gray values smaller than the initial optimal threshold are recorded as the deep scratch pixel points, and the other pixel points form a background area, so that a plurality of deep scratch pixel points are obtained.
Further, in the embodiment, 5×5=25 areas are divided in total, the divided areas are denoted as local areas, the local areas in which the deep-scratch pixels exist are denoted as local scratch areas, and the local areas in which the deep-scratch pixels do not exist are denoted as other local areas; for any one local scratch area, acquiring the gradient direction of each deep scratch pixel point in the local scratch area, for any one gradient direction, acquiring the average value of sine values of included angles of the gradient direction and other gradient directions, and taking the gradient direction with the smallest average value obtained in all gradient directions as the vertical direction of the deep scratch of the local scratch area; obtaining a gradient direction for each pixel except for the deep-scratch pixel point in the local scratch area, and then obtaining the third pixel except for the deep-scratch pixel point in the local scratch areaScratch possibility of individual pixels +.>The calculation method of (1) is as follows:
wherein,indicating +.>Gradient direction of each pixel point, +.>Deep scratch vertical direction indicating the partial scratch area, < >>Indicating the third pixel point except for the deep scratch pixel point in the local scratch areaGray value of each pixel, +.>A maximum gray value representing all the deep-scratch pixels in the partial scratch area, +.>Representing absolute value>To avoid hyper-parameters with denominator 0, this embodiment uses +.>Description is made; judging through the included angle between the gradient direction of the pixel point and the vertical direction of the deep scratch, wherein the closer the included angle is 0 DEG or 180 DEG, the more consistent the gradient direction is with the vertical direction or the opposite direction of the deep scratch, the more consistent the gray scale change direction of the pixel point is with the gray scale change direction of the scratch part in the local scratch area, and the greater the scratch possibility is; meanwhile, the smaller the difference between the gray value of the pixel point and the maximum value of the gray value of the pixel point of the deep scratch is, the more likely the pixel point is the scratch pixel point which is not segmented, and the greater the scratch possibility is; the scratch probability of each pixel except the deep scratch pixel in the local scratch area is obtained according to the method.
To this end, a deep scratch and a partial scratch area are acquired, and a scratch probability is calculated for each pixel point except for the deep scratch pixel point in the partial scratch area.
Step S003, shallow scratch pixel points in the local scratch area are obtained according to the scratch possibility; and (3) iteratively obtaining the final optimal threshold value of each local scratch area and the final optimal threshold values of all other local areas according to the gray scale and the gradient of the deep scratch pixel points and the shallow scratch pixel points in the local scratch area.
After the scratch possibility is obtained, shallow scratch pixel points and shallow scratches can be obtained, threshold iteration is carried out according to the gradient direction of the shallow scratch pixel points in the local scratch area and the vertical direction of the deep scratches by combining the gray level difference, the threshold is changed continuously, the obtained deep and shallow scratches gradually tend to be consistent, and finally the final optimal threshold is obtained; and for a large number of other local areas where no deep scratch pixel points exist, wherein shallow scratches are likely to exist as well, the final optimal threshold value of the other local areas is obtained according to the final optimal threshold value of the local scratch areas.
Specifically, a scratch threshold value is preset, the scratch threshold value in this embodiment is described by using 0.65, and for any partial scratch area, a pixel point with the scratch probability greater than or equal to 0.65 in the partial scratch area is recorded as a shallow scratch pixel point; according to the gradient directions of a plurality of shallow scratch pixel points and a calculation method of the vertical direction of the deep scratch, the vertical direction of the shallow scratch of the local scratch area is obtained, and the current obtained deep scratch pixel point and the segmentation condition of the shallow scratch pixel point of the local scratch area are used as the first iteration, so that the local scratch area is the first iterationThreshold +.>The calculation method of (1) is as follows:
wherein,indicating the local scratch area +.>Adjusting weights at multiple iterations, +.>Indicating the local scratch area +.>Gray value average value of all shallow scratch pixel points obtained under multiple iterations, < >>Indicating the local scratch area +.>The gray value average value of other pixels except the pixels with deep scratches and the pixels with shallow scratches is calculated in the next iteration; />Indicating the local scratch area +.>Vertical direction of shallow scratch under multiple iterations, +.>Indicating the local scratch area +.>Vertical direction of deep scratch under multiple iterations, +.>Indicating the local scratch area +.>Gray value average value of all deep scratch pixel points obtained under multiple iterations, < >>Representing absolute value>To avoidSuper-parameters with zero denominator of 0 are adopted in the embodiment>Description is made; the more the included angle in the vertical direction of the shallow scratch approaches 0 degrees or 180 degrees, the more the gray scale change direction of the shallow scratch approaches to be consistent, and correspondingly, the larger the threshold value is not required to be adjusted at the moment, the more weight is required to be added to the gray scale value average value of the pixel point of the shallow scratch; the smaller the difference of the gray value mean values of the deep and shallow scratches is, the better the effect obtained by shallow scratch detection is, and too much adjustment of the threshold value is not needed.
Further, after a new threshold value is obtained for the first iteration of the local scratch area, the pixel point which is smaller than the threshold value and is used as a new deep scratch is used as a new pixel point, the vertical direction of the deep scratch is calculated according to the method, the scratch possibility is recalculated, a plurality of new pixel points with shallow scratches and the vertical direction of the shallow scratches are obtained, and the threshold value under the second iteration is calculated; then, according to the initial parameters set in the step S002, performing iterative threshold segmentation on the local scratch area according to the method to obtain an optimal threshold of the local scratch area, and marking the optimal threshold as a final optimal threshold of the local scratch area; and acquiring the final optimal threshold value of each local scratch area according to the method, and taking the average value of all final optimal threshold values as the final optimal threshold value of all other local areas.
So far, shallow scratches are obtained through the possibility of the scratches, the shallow scratches are compared with the deep scratches in gradient and gray scale, and the final optimal threshold value of each local area is finally obtained through iterative threshold segmentation.
And S004, dividing according to the final optimal threshold value to obtain the mechanical scratch.
For any local scratch area or other local areas, carrying out threshold segmentation through the final optimal threshold value of the area, and taking an area formed by pixel points with gray values smaller than the final optimal threshold value as a foreground area, and marking the foreground area as a mechanical scratch; taking a region formed by pixel points with gray values larger than or equal to a final optimal threshold value as a background region; according to the method, the foreground area and the background area of the mechanical scratch are obtained for each local scratch area or other local areas, so that the detection of the mechanical scratch is finished for the surface gray level image of the diode lead frame, the quality evaluation is carried out on the diode lead frame according to the detected mechanical scratch, the quality evaluation is not the key point of the invention, and the embodiment is not repeated.
The final optimal threshold value is obtained by carrying out optimal iterative threshold value segmentation on the surface gray level image of the diode lead frame, mechanical scratches are obtained by the final optimal threshold value segmentation, the quality detection result of the diode lead frame is prevented from being influenced due to the fact that the scratches are too shallow and are difficult to detect, and the quality detection of the diode lead frame is finally completed.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the invention, but any modifications, equivalent substitutions, improvements, etc. within the principles of the present invention should be included in the scope of the present invention.

Claims (6)

1. The quality detection method of the diode lead frame based on the image characteristics is characterized by comprising the following steps:
collecting a surface image of a diode lead frame, and preprocessing to obtain a surface gray level image;
dividing the surface gray level image through an iteration threshold to obtain a plurality of deep scratch pixel points, and dividing the surface gray level image and combining the deep scratch pixel points to obtain a plurality of local scratch areas and other local areas; obtaining the scratch possibility of each pixel point except the pixel point with the deep scratch in the local scratch area according to the gray scale and the gradient of the pixel point in the local scratch area;
obtaining shallow scratch pixel points in the local scratch area according to the scratch possibility; according to the gray scale and gradient of the deep scratch pixel points and the shallow scratch pixel points in the local scratch areas, iteratively obtaining the final optimal threshold value of each local scratch area and the final optimal threshold values of all other local areas;
dividing according to the final optimal threshold value to obtain mechanical scratches;
the scratch possibility of each pixel point except the deep scratch pixel point in the local scratch area is obtained by the following specific method:
obtaining the vertical direction of deep scratches of each local scratch area according to the gradient of the deep scratch pixel points in the local scratch area; for any partial scratch area, acquiring the gradient direction of each pixel point except the deep scratch pixel point in the partial scratch area, wherein the partial scratch area is the first pixel point except the deep scratch pixel pointScratch possibility of individual pixels +.>The calculation method of (1) is as follows:
wherein,indicating +.>Gradient direction of each pixel point, +.>Deep scratch vertical direction indicating the partial scratch area, < >>Indicating +.>Gray value of each pixel, +.>A maximum gray value representing all the deep-scratch pixels in the partial scratch area, +.>Representing absolute value>To avoid a super parameter with a denominator of 0;
the specific acquisition method for the vertical direction of deep scratches of each local scratch area comprises the following steps:
for any one local scratch area, acquiring the gradient direction of each deep scratch pixel point in the local scratch area, for any one gradient direction, acquiring the average value of sine values of included angles of the gradient direction and other gradient directions, and taking the gradient direction with the smallest average value obtained in all gradient directions as the vertical direction of the deep scratch of the local scratch area;
the iterative obtaining of the final optimal threshold value of each local scratch area and the final optimal threshold values of all other local areas comprises the following specific methods:
for any partial scratch area, a plurality of shallow scratch pixel points in the partial scratch area are obtained, and the vertical direction of the shallow scratch of the partial scratch area is obtained according to the gradient direction of the plurality of shallow scratch pixel points; taking the current segmentation condition of the deep scratch pixel points and the shallow scratch pixel points obtained in the local scratch area as a first iteration;
obtaining a threshold value of the local scratch area under each iteration according to the vertical direction of the deep scratch, the vertical direction of the shallow scratch and the gray values of the deep scratch pixel points and the shallow scratch pixel points;
after a new threshold value is obtained for the first iteration of the local scratch area, the pixel points which are smaller than the threshold value and serve as new deep scratch pixels are calculated, the vertical direction of the deep scratch is calculated, the scratch possibility is calculated again, a plurality of new pixel points with shallow scratches and the vertical direction of the shallow scratch are obtained, and the threshold value under the second iteration is calculated; performing iterative threshold segmentation on the local scratch area to obtain an optimal threshold of the local scratch area, and marking the optimal threshold as a final optimal threshold of the local scratch area;
acquiring a final optimal threshold value of each local scratch area, and taking the average value of all final optimal threshold values as the final optimal threshold value of all other local areas;
the method for obtaining the threshold value of the local scratch area under each iteration comprises the following specific steps:
for any one of the partial scratch areas, the partial scratch area is the firstThreshold +.>The calculation method of (1) is as follows:
wherein,indicating the local scratch area +.>Adjusting weights at multiple iterations, +.>Indicating the local scratch area +.>Gray value average value of all shallow scratch pixel points obtained under multiple iterations, < >>Indicating the local scratch area +.>In addition to the pixel points with deep scratches and the pixel points with shallow scratches under the next iterationGray value average value of other pixel points; />Indicating the local scratch area +.>Vertical direction of shallow scratch under multiple iterations, +.>Indicating the local scratch area +.>Vertical direction of deep scratch under multiple iterations, +.>Indicating the local scratch area +.>Gray value average value of all deep scratch pixel points obtained under multiple iterations, < >>The representation is to take the absolute value,to avoid super parameters with denominator 0.
2. The method for detecting the quality of the diode lead frame based on the image characteristics according to claim 1, wherein the preprocessing to obtain the surface gray scale image comprises the following specific steps:
and carrying out graying treatment on the surface image of the diode lead frame, carrying out denoising treatment on the grayed image through Gaussian filtering, and recording the treated image as a surface gray image.
3. The method for detecting the quality of the diode lead frame based on the image characteristics according to claim 1, wherein the method for obtaining the plurality of deep scratch pixel points by the iterative threshold segmentation of the surface gray level image comprises the following specific steps:
performing iterative threshold segmentation on the surface gray image, setting initial parameters and initial thresholds, wherein the initial thresholds adopt gray value average values of all pixel points in the surface gray image, and obtaining an optimal threshold through iterative threshold segmentation, and marking the optimal threshold as the initial optimal threshold; and marking the pixel points with gray values smaller than the initial optimal threshold value as deep scratch pixel points to obtain a plurality of deep scratch pixel points.
4. The method for detecting the quality of a diode lead frame based on image features according to claim 1, wherein the obtaining a plurality of partial scratch areas and other partial areas comprises the following specific steps:
the method comprises the steps of dividing a surface gray level image into areas, marking the areas obtained by dividing as local areas, marking the local areas with deep scratch pixel points inside as local scratch areas, and marking the local areas without the deep scratch pixel points as other local areas.
5. The method for detecting the quality of a diode lead frame based on image features according to claim 1, wherein the step of obtaining shallow-scratch pixels in a partial-scratch area according to the scratch probability comprises the following specific steps:
and presetting a scratch threshold value, and marking the pixel points with the scratch possibility larger than or equal to the scratch threshold value in any partial scratch area as shallow scratch pixel points.
6. The method for detecting the quality of a diode lead frame based on image features according to claim 1, wherein the step of obtaining the mechanical scratches by the final optimal threshold segmentation comprises the following specific steps:
for any local scratch area or other local areas, carrying out threshold segmentation through the final optimal threshold value of the area, and taking an area formed by pixel points with gray values smaller than the final optimal threshold value as a foreground area, and marking the foreground area as a mechanical scratch; taking a region formed by pixel points with gray values larger than or equal to a final optimal threshold value as a background region;
the foreground and background regions of the mechanical scratch are obtained for each partial scratch region or other partial regions.
CN202311533551.XA 2023-11-17 2023-11-17 Diode lead frame quality detection method based on image characteristics Active CN117252877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311533551.XA CN117252877B (en) 2023-11-17 2023-11-17 Diode lead frame quality detection method based on image characteristics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311533551.XA CN117252877B (en) 2023-11-17 2023-11-17 Diode lead frame quality detection method based on image characteristics

Publications (2)

Publication Number Publication Date
CN117252877A CN117252877A (en) 2023-12-19
CN117252877B true CN117252877B (en) 2024-02-02

Family

ID=89131734

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311533551.XA Active CN117252877B (en) 2023-11-17 2023-11-17 Diode lead frame quality detection method based on image characteristics

Country Status (1)

Country Link
CN (1) CN117252877B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107255641A (en) * 2017-06-06 2017-10-17 西安理工大学 A kind of method that Machine Vision Detection is carried out for GRIN Lens surface defect
CN111703094A (en) * 2020-06-30 2020-09-25 杭州容旗科技有限公司 Surface scratch repairing device for plastic part
WO2021003824A1 (en) * 2019-07-11 2021-01-14 平安科技(深圳)有限公司 Image recognition-based illegal building identification method and device
CN114998337A (en) * 2022-08-03 2022-09-02 联宝(合肥)电子科技有限公司 Scratch detection method, device, equipment and storage medium
CN115020267A (en) * 2022-08-05 2022-09-06 启东旺晟电子科技有限公司 Semiconductor surface defect detection method
CN115147414A (en) * 2022-09-01 2022-10-04 南通三信塑胶装备科技股份有限公司 Method for detecting surface breakdown defect of bipolar power transistor
CN115511907A (en) * 2022-11-24 2022-12-23 深圳市晶台股份有限公司 Scratch detection method for LED screen
CN115880248A (en) * 2022-12-13 2023-03-31 哈尔滨耐是智能科技有限公司 Surface scratch defect identification method and visual detection equipment
CN116309600A (en) * 2023-05-24 2023-06-23 山东金佳成工程材料有限公司 Environment-friendly textile quality detection method based on image processing
WO2023134793A2 (en) * 2022-12-13 2023-07-20 苏州迈创信息技术有限公司 Machine vision-based machine tool part online inspection method
WO2023134792A2 (en) * 2022-12-15 2023-07-20 苏州迈创信息技术有限公司 Led lamp wick defect detection method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107255641A (en) * 2017-06-06 2017-10-17 西安理工大学 A kind of method that Machine Vision Detection is carried out for GRIN Lens surface defect
WO2021003824A1 (en) * 2019-07-11 2021-01-14 平安科技(深圳)有限公司 Image recognition-based illegal building identification method and device
CN111703094A (en) * 2020-06-30 2020-09-25 杭州容旗科技有限公司 Surface scratch repairing device for plastic part
CN114998337A (en) * 2022-08-03 2022-09-02 联宝(合肥)电子科技有限公司 Scratch detection method, device, equipment and storage medium
CN115020267A (en) * 2022-08-05 2022-09-06 启东旺晟电子科技有限公司 Semiconductor surface defect detection method
CN115147414A (en) * 2022-09-01 2022-10-04 南通三信塑胶装备科技股份有限公司 Method for detecting surface breakdown defect of bipolar power transistor
CN115511907A (en) * 2022-11-24 2022-12-23 深圳市晶台股份有限公司 Scratch detection method for LED screen
CN115880248A (en) * 2022-12-13 2023-03-31 哈尔滨耐是智能科技有限公司 Surface scratch defect identification method and visual detection equipment
WO2023134793A2 (en) * 2022-12-13 2023-07-20 苏州迈创信息技术有限公司 Machine vision-based machine tool part online inspection method
WO2023134792A2 (en) * 2022-12-15 2023-07-20 苏州迈创信息技术有限公司 Led lamp wick defect detection method
CN116309600A (en) * 2023-05-24 2023-06-23 山东金佳成工程材料有限公司 Environment-friendly textile quality detection method based on image processing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
New technique for the quantification of scratch visibility on polymeric textured surfaces;C.J. Barr 等;《Wear》;84-94 *
基于机器视觉的不同属性表面中微弱缺陷的检测技术研究;李晨;《中国博士学位论文全文数据库 信息科技辑》;第2019年卷(第4期);I138-14 *
基于水平集方法的划痕形状表面视觉测量;刘明 等;《仪器仪表学报》;第41卷(第2期);184-194 *

Also Published As

Publication number Publication date
CN117252877A (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN115222741B (en) Cable surface defect detection method
CN115239704B (en) Accurate detection and repair method for wood surface defects
CN109658402A (en) Industry profile geometric dimension automatic testing method based on computer vision imaging
CN116703898B (en) Quality detection method for end face of precision mechanical bearing
CN116703251B (en) Rubber ring production quality detection method based on artificial intelligence
CN115131359B (en) Method for detecting pitting defects on surface of metal workpiece
CN117197140B (en) Irregular metal buckle forming detection method based on machine vision
CN117237368A (en) Bridge crack detection method and system
CN116309599B (en) Water quality visual monitoring method based on sewage pretreatment
CN114529538A (en) Textile surface defect detection method based on artificial intelligence and Gaussian mixture model
CN117611563B (en) Plastic mold production defect detection method based on image processing
CN115546155A (en) Rivet size detection method based on machine vision
CN116309577B (en) Intelligent detection method and system for high-strength conveyor belt materials
CN114119603A (en) Image processing-based snack box short shot defect detection method
CN115115603A (en) Automobile accessory flywheel surface detection method based on artificial intelligence
CN117495849A (en) Image feature-based power adapter quality detection method
CN115880280A (en) Detection method for quality of steel structure weld joint
CN117541582B (en) IGBT insulation quality detection method for high-frequency converter
CN117437228B (en) Photovoltaic steel structure component fracture detection method based on image characteristics
CN117252877B (en) Diode lead frame quality detection method based on image characteristics
CN111815575B (en) Bearing steel ball part detection method based on machine vision
CN116416164B (en) Ultraviolet light path imaging resolution optimization method
CN116703930B (en) Automobile rearview mirror mold forming detection method
CN116563286B (en) Mobile hard disk box production quality rapid detection system
CN117853494B (en) Visual inspection method for drug particle production process

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