PIN perpendicularity defect detection method, device and equipment and storage medium

Through the calculation of multifocal surface scanning technology and clarity measurement values, the problem that traditional detection technology is difficult to detect PIN needle verticality defects in high-speed production lines in real time is solved, and efficient and automated detection results are achieved.

CN120101645AActive Publication Date: 2025-06-06JIHUA LAB
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510592665.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-06
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

The existing technology is difficult to meet the demand for high-speed production lines to detect PIN pin verticality defects in real-time. The traditional mechanical zoom system has slow zoom speed and large motion errors, making it difficult to achieve high-precision and fast detection.

Method used

Using multifocal surface scanning technology, multiple focal plane images are obtained by determining the reference zoom height and preset zoom step length, and the clarity measurement value and offset of the ROI area of ​​the PIN pin in each focal plane image are calculated to determine whether there is a verticality defect in the PIN pin.

Benefits of technology

It realizes efficient and automated detection of PIN needle verticality defects, can quickly respond to the inspection needs of high-speed production lines, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120101645A_ABST
    Figure CN120101645A_ABST
Patent Text Reader

Abstract

The invention relates to the field of detection, and discloses a PIN perpendicularity defect detection method, device and equipment and a storage medium, the method is used for detecting a PIN perpendicularity defect, and the method comprises the following steps: determining a reference zoom height for enabling a zoom system to carry out multi-focal-plane scanning; determining a plurality of zoom heights based on the reference zoom height, and obtaining a focal plane image corresponding to each zoom height; for each focal plane image, acquiring a center coordinate of the to-be-detected PIN, and determining an ROI region of the to-be-detected PIN; calculating a definition metric value of an ROI region corresponding to each focal plane image, if the definition metric value is greater than a preset definition threshold value, determining that a clear region exists in the corresponding ROI region, and recording a center coordinate of the clear region; and calculating the offset between the center coordinate of the to-be-detected PIN and the center coordinate of the clear area, and when the offset is greater than a preset offset threshold, determining that the to-be-detected PIN has the verticality defect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of detection technology, and in particular to a PIN verticality defect detection method, device, equipment and storage medium. Background Art

[0002] As semiconductor packaging and precision electronic manufacturing technologies continue to advance, more and more electronic devices are integrated onto a PCB. This trend has brought more functions and space saving advantages, but it has also led to a significant increase in the number of pins on the PCB, which has led to a sharp increase in the workload of technicians in testing the quality of PCBs. Moreover, as a key connection component, once the PIN pins are bent and deformed, the reliability of the device will be directly endangered. At present, traditional detection methods mainly rely on manual detection, or use optical microscopes combined with image processing algorithms. However, these methods are powerless when facing high-speed production lines and are difficult to meet the needs of real-time detection. Specifically, the current mainstream optical inspection equipment uses a mechanical zoom system with a mechanically driven zoom module, which adjusts the position of the lens group through a stepper motor to achieve focal length switching. However, this method has many disadvantages: First, the zoom speed is restricted by the inertia of mechanical movement, and a single zoom takes at least 50ms, which is simply unable to keep up with the beat of more than a thousand inspections per minute on ultra-high-speed production lines; second, long-term high-frequency movement causes serious wear of transmission components, and the positioning accuracy attenuation exceeds ±5μm / thousand hours, requiring frequent calibration; third, in multi-degree-of-freedom collaborative zooming, such as when the Z-axis focusing is synchronized with the XY-axis scanning, the motion error will continue to accumulate, and eventually cause image misalignment.

[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the invention

[0004] The present invention provides a PIN verticality defect detection method, device, equipment and storage medium for detecting PIN verticality defects.

[0005] A first aspect of the present invention provides a PIN needle verticality defect detection method, the PIN needle verticality defect detection method comprising: determining a reference zoom height for enabling a zoom system to perform multi-focal plane scanning; based on the reference zoom height, determining multiple zoom heights for scanning a PIN needle to be detected according to a preset zoom step, and obtaining a focal plane image corresponding to each zoom height; for each focal plane image, obtaining the center coordinates of the PIN needle to be detected, and determining the ROI area of ​​the PIN needle to be detected according to the center coordinates of the PIN needle to be detected; calculating a clarity measurement value of the ROI area of ​​the PIN needle to be detected in each focal plane image, if the calculated clarity measurement value is greater than a preset clarity threshold, determining that a clear area exists in the corresponding ROI area, and recording the center coordinates of the clear area; calculating an offset between the center coordinates of the PIN needle to be detected and the center coordinates of the clear area, and comparing the calculated offset with a preset offset threshold, if the calculated offset is greater than the preset offset threshold, determining that a verticality defect exists in the PIN needle to be detected.

[0006] Preferably, the reference zoom height of the zoom system is the height at which the zoom system forms a clear image of the upper surface of the PIN to be inspected.

[0007] Preferably, the method of acquiring the center coordinates of the PIN pin to be detected for each focal plane image, and determining the ROI area of ​​the PIN pin to be detected according to the center coordinates includes: for each focal plane image, performing filtering and denoising processing on the focal plane image; extracting the PIN pin area by using adaptive threshold segmentation based on the focal plane image after filtering and denoising processing; if the PIN pin to be detected is a circular PIN pin, performing Hough circle transform positioning in the PIN pin area to extract the contour of the target object; if the PIN pin to be detected is a rectangular PIN pin, performing minimum circumscribed rectangle fitting in the PIN pin area to extract the contour of the target object; acquiring the center coordinates of the target object according to the contour of the target object, and calculating the size of the target object; judging whether the size of the target object is within the detection size range, and if so, determining that the target object is the PIN pin to be detected; acquiring the center coordinates of the PIN pin to be detected, and determining the ROI area of ​​the PIN pin to be detected according to the center coordinates of the PIN pin to be detected.

[0008] Preferably, for each focal plane image, filtering and denoising the focal plane image comprises using Gaussian filtering or median filtering to suppress high-frequency noise of each focal plane image.

[0009] Preferably, the clarity metric value of the ROI region of the PIN needle to be detected in each focal plane image is calculated based on the Tenengrad gradient function or the Laplacian gradient function.

[0010] Preferably, the Tenengrad gradient function is expressed as: ; In the formula, It represents the clarity measurement value of the ROI area of ​​the PIN needle to be detected calculated based on the Tenengrad gradient function. and are the horizontal and vertical gradients of the Sobel operator, The coordinates of the pixel points in the ROI area of ​​the PIN needle to be detected.

[0011] Preferably, the Laplacian gradient function is expressed as: ; In the formula, It represents the clarity measurement value of the ROI area of ​​the PIN needle to be detected calculated based on the Tenengrad gradient function. Indicates the ROI area of ​​the PIN to be detected in pixel coordinates The Laplacian value at .

[0012] According to a second aspect of the present invention, there is provided a PIN verticality defect detection device, comprising: a first determination module, for determining a reference zoom height for enabling a zoom system to perform multi-focal plane scanning; an acquisition module, for determining, based on the reference zoom height, a plurality of zoom heights for scanning a PIN to be detected according to a preset zoom step, and acquiring a focal plane image corresponding to each zoom height; a second determination module, for acquiring the center coordinates of the PIN to be detected for each focal plane image, and determining the ROI area of ​​the PIN to be detected according to the center coordinates of the PIN to be detected; a first judgment module, for calculating a clarity measurement value of the ROI area of ​​the PIN to be detected in each focal plane image, if the calculated clarity measurement value is greater than a preset clarity threshold, it is determined that a clear area exists in the corresponding ROI area, and the center coordinates of the clear area are recorded; a second judgment module, for calculating an offset between the center coordinates of the PIN to be detected and the center coordinates of the clear area, and comparing the calculated offset with a preset offset threshold, if the calculated offset is greater than the preset offset threshold, it is determined that a verticality defect exists in the PIN to be detected.

[0013] The third aspect of the present invention provides a PIN needle verticality defect detection device, comprising: a memory and at least one processor, wherein the memory stores computer-readable instructions, and the memory and the at least one processor are interconnected through lines; the at least one processor calls the computer-readable instructions in the memory so that the PIN needle verticality defect detection device performs the various steps of the PIN needle verticality defect detection method as described above.

[0014] A fourth aspect of the present invention provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the various steps of the PIN verticality defect detection method described above.

[0015] In the technical solution provided by the present invention, in this embodiment, when verticality defects are detected for multiple PIN pins to be detected at the same time, a zoom system is used to perform multi-focal plane scanning on the PIN pins to be detected at multiple zoom heights, and in the process of obtaining multiple focal plane images, if a new PIN pin to be detected appears at the current zoom height, the current zoom height is used as the reference zoom height of the new PIN pin to be detected. The new PIN pin to be detected refers to a PIN pin detected in an area that does not overlap with the ROI area set of the existing PIN pins to be detected within the image field of view, mainly for the situation where PIN pins of different heights exist in the test sample. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flow chart of a PIN verticality defect detection method provided by an embodiment of the present invention; Figure 2 A schematic diagram of a ROI region of a PIN needle to be detected provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a PIN verticality defect detection device provided in an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a PIN verticality defect detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0018] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 In an embodiment of the present invention, a method for detecting a PIN verticality defect includes: S101, determining a reference zoom height for enabling a zoom system to perform multi-focal plane scanning; S102, based on the reference zoom height, determining multiple zoom heights for scanning the PIN to be detected according to a preset zoom step, and acquiring a focal plane image corresponding to each zoom height; S103, for each focal plane image, obtaining the center coordinates of the PIN needle to be detected, and determining the ROI area of ​​the PIN needle to be detected according to the center coordinates of the PIN needle to be detected; S104, calculating the clarity measurement value of the ROI area of ​​the PIN needle to be detected in each focal plane image, if the calculated clarity measurement value is greater than a preset clarity threshold, it is determined that there is a clear area in the corresponding ROI area, and the center coordinates of the clear area are recorded; S105, calculating the offset between the center coordinates of the PIN to be detected and the center coordinates of the clear area, and comparing the calculated offset with a preset offset threshold. If the calculated offset is greater than the preset offset threshold, it is determined that the PIN to be detected has a verticality defect.

[0019] It is understandable that the execution subject of the present invention may be a PIN verticality defect detection device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.

[0020] In this embodiment, in step S101, the zoom system is a micromirror array ultra-high-speed zoom system. The micromirror array ultra-high-speed zoom system is a micromirror array composed of hundreds to thousands of individual micromirrors that is fine-tuned at high speed to achieve accurate fitting of the required lens curvature shape, accurately realize the curvature change of the traditional zoom lens, thereby achieving a static fast zoom function. The zoom speed can reach 12KHz, and different focal plane images can be acquired in real time.

[0021] In this embodiment, the reference zoom height refers to the height at which the zoom system can clearly image the upper surface of the PIN to be detected, so that the PIN to be detected is within the zoom range during the downward zooming process of the zoom system.

[0022] It can be understood that the advantage of using the height at which the upper surface of the PIN needle to be detected is clearly imaged as the reference zoom height is that the zoom system has a larger downward scanning range. If the PIN needle to be detected is shorter, other focusing surfaces of the zoom system can also be selected as the reference. It is only necessary to ensure that the ultra-high-speed zoom system can cover the entire PIN needle to be detected during the downward scanning process.

[0023] In this embodiment, verticality defect detection can be performed on multiple PIN pins to be inspected at the same time. At this time, when adjusting the height of the zoom system, the height of the zoom system is adjusted according to the position of the PIN pin to be inspected with the highest height. That is, when the upper surface of the PIN pin to be inspected with the highest height can be clearly imaged, the adjustment is completed, and the adjusted height is the base zoom height of the zoom system.

[0024] In this embodiment, the reference zoom height of the zoom system is determined according to the height position of the PIN needle to be detected.

[0025] Specifically, multiple standard PIN needle samples with known heights are selected in advance, and images are collected at different zoom heights, and parameters such as imaging clarity and size change of each standard PIN needle sample at different zoom heights are recorded. The relationship between these parameters and the zoom height and the actual height of the PIN needle is analyzed, and a mathematical model (such as a functional relationship) is established. The mathematical model is used to describe the corresponding relationship between the PIN needle height and the appropriate zoom height. That is, a mathematical model is pre-built to reflect the mapping relationship between the reference zoom height and the height position of the PIN needle to be detected.

[0026] Then, when it is applied, the height position of the PIN needle to be detected is input into the mathematical model, and the data output by the mathematical model can be the reference zoom height of the zoom system.

[0027] In this embodiment, the reference zoom height may also be determined according to the imaging effect.

[0028] In this embodiment, in step S102, after determining the reference zoom height, multiple zoom heights for performing multi-focal plane scanning on the PIN needle to be detected are determined according to the preset zoom step length, and then the zoom system is used to perform multi-focal plane scanning on the PIN needle to be detected at multiple zoom heights to obtain multiple focal plane images. Assume that the reference zoom height is , and the corresponding focal plane image is , Base zoom height Based on the zoom height corresponding to the first zoom step downward, the corresponding focal plane image is , Base zoom height Based on the downward The zoom height corresponding to the zoom step length, and the corresponding focal plane image is , is the focal plane height that can just clearly image the PIN needle substrate (usually a PCB board), and the corresponding focal plane image is , then the zoom height set , focal plane image collection .

[0029] In this embodiment, in step S103, for each focal plane image, the center coordinates of the PIN pin to be detected are obtained, and the ROI area of ​​the PIN pin to be detected is determined according to the center coordinates, including: for each focal plane image, filtering and denoising the focal plane image; extracting the PIN pin area by using adaptive threshold segmentation based on the focal plane image after filtering and denoising; if the PIN pin to be detected is a circular PIN pin, performing Hough circle transform positioning in the PIN pin area to extract the contour of the target object; if the PIN pin to be detected is a rectangular PIN pin, performing minimum circumscribed rectangle fitting in the PIN pin area to extract the contour of the target object; obtaining the center coordinates of the target object according to the contour of the target object, and calculating the size of the target object; judging whether the size of the target object is within the detection size range, and if so, determining that the target object is the PIN pin to be detected; obtaining the center coordinates of the PIN pin to be detected, and determining the ROI area of ​​the PIN pin to be detected according to the center coordinates of the PIN pin to be detected.

[0030] It can be understood that the detection size is predetermined according to the size of the PIN needle to be detected. Considering the error of the detection algorithm in detecting a circle or a rectangle, the detection size can be appropriately scaled, that is, the detection size range value is [0.9*detection size, 1.2*detection size].

[0031] In this embodiment, the filtering and noise reduction process performed on the focus plane image may use Gaussian filtering (σ=1.5) or median filtering (kernel=3×3) to suppress high-frequency noise.

[0032] like Figure 2 As shown in the figure, when there are multiple PIN pins to be detected, the ROI area refers to a circular area where the PIN pins do not interfere with each other. It is usually set to be slightly larger than the minimum circumscribed circle of the target area. The specific size can be set according to the actual situation. For each focal plane image, the center coordinates of each PIN pin to be detected are determined respectively, and the ROI area of ​​each PIN pin to be detected is determined according to the center coordinates of each PIN pin to be detected. For example, the focal plane image PIN to be detected The center coordinates of , the ROI area is , then the focal plane image The ROI area set of all PIN needles to be detected .

[0033] In this embodiment, when verticality defects are detected for multiple PIN pins to be detected at the same time, the PIN pins to be detected are scanned at multiple focal planes using a zoom system at multiple zoom heights to obtain multiple focal plane images. If a new PIN pin to be detected is detected at the current zoom height, the current zoom height is used as the reference zoom height of the new PIN pin to be detected. The new PIN pin to be detected refers to a PIN pin detected in an area that does not overlap with the ROI area set of the existing PIN pins to be detected within the image field of view, mainly for the situation where PIN pins of different heights exist in the test sample.

[0034] In this embodiment, in steps S104 and S105, for a normal vertical column, only the top is clearly imaged. When the focus plane moves downward, the side of the column is always outside the focus plane (outside the depth of field) because it does not deviate from the vertical axis, so it is blurred; for a curved column, the middle section is offset to one side due to the bending. When the focus plane moves downward to the offset position, the section enters the range of the focus plane, thereby forming a clear image.

[0035] A collection of different zoom heights set by the zoom system , get the image set , for the ROI area set of all PIN needles to be detected In the same ROI area, a set of different zoom heights k can be obtained , thereby detecting whether the clarity measurement value of each PIN to be detected in different focal plane images is greater than a preset clarity threshold, thereby determining whether a certain area is clear.

[0036] For the PIN needle to be tested , which corresponds to a set of image sequences with different focal planes. If the PIN to be detected is vertical, then Only The clarity metric value of is greater than the preset clarity threshold ( Theoretically, it is also greater than the preset clarity threshold, but because it is focused on the PIN needle substrate, its clarity measurement value is not calculated); if the PIN needle to be detected is bent, there is a reference zoom height Based on the first The ROI area in the focal plane image corresponding to the zoom height corresponding to the step length The clarity measurement value is greater than the preset clarity threshold, and a clear area appears. At this time, the center coordinates of the clear area are recorded. , and calculate the offset ,when When it is greater than the preset offset threshold, it is determined that the PIN to be detected is bent.

[0037] In this embodiment, the clarity measurement value of the ROI region of the PIN needle to be detected in each focal plane image is calculated based on the Tenengrad gradient function or the Laplacian gradient function.

[0038] The Tenengrad gradient function uses the Sobel operator to calculate the horizontal and vertical gradients of the focal plane image. The larger the gradient amplitude, the clearer the image. The Tenengrad gradient function is expressed as: .

[0039] In the formula, It represents the clarity measurement value of the ROI area of ​​the PIN needle to be detected calculated based on the Tenengrad gradient function. and are the horizontal and vertical gradients of the Sobel operator, The coordinates of the pixel points in the ROI area of ​​the PIN needle to be detected.

[0040] In this embodiment, by traversing the coordinates of each pixel point in the ROI area of ​​the PIN needle to be detected , calculate the horizontal and vertical gradients at the point respectively, and then calculate the Tenenggrad gradient function value of the ROI area of ​​the PIN needle to be detected according to the Tenengrad gradient function to measure the image clarity.

[0041] In this embodiment, the Laplacian gradient function is used to calculate the second-order derivative of the image. The core principle is that there are often rapid changes in grayscale at the edges and details in the image. The first-order derivative can detect the location of the grayscale change, while the second-order derivative is more sensitive to the rate of grayscale change. In the image, the second-order derivative will produce extreme values ​​in the transition area from low grayscale value to high grayscale value (i.e., edge), and these edge and detail information can be highlighted by calculating the second-order derivative.

[0042] The Laplacian operator is a tool for calculating second-order derivatives. In two-dimensional images, it is defined by summing the second-order partial derivatives of the image in the horizontal and vertical directions.

[0043] The Laplacian gradient function is expressed as: .

[0044] In the formula, It represents the clarity measurement value of the ROI area of ​​the PIN needle to be detected calculated based on the Tenengrad gradient function. Indicates the ROI area of ​​the PIN to be detected in pixel coordinates The Laplacian value at is the second-order derivative. For discrete digital images, template convolution is usually used to approximate the calculation.

[0045] The present embodiment provides a method for detecting verticality defects of PIN needles, which realizes efficient and automated detection of verticality defects of PIN needles through multi-focal plane collaborative scanning and precise quantitative analysis: first, a multi-focal plane scanning strategy based on a reference zoom height and a preset step length can comprehensively cover the structural features of PIN needles at different depths, avoiding misjudgment caused by the lack of information on a single focal plane; second, for each focal plane image, the center coordinates of the PIN needle to be detected are accurately obtained and the ROI area is determined, which effectively narrows the processing range, significantly improves the detection efficiency, and reduces unnecessary calculations and interference factors; finally, by calculating the clarity measurement value of the ROI area and comparing it with a preset threshold to determine the clear area, and by using the quantitative calculation of the center coordinate offset, the verticality defect is converted into a quantifiable spatial offset parameter, and an objective judgment is achieved through a preset threshold, which not only avoids the subjective error of traditional visual inspection, but also can accurately identify PIN needles with verticality defects.

[0046] The above describes the PIN verticality defect detection method in the embodiment of the present invention. The following describes the device in the embodiment of the present invention. Figure 3 , the implementation of the PIN verticality defect detection device in the embodiment of the present invention includes: A first determination module 201 determines a reference zoom height for enabling the zoom system to perform multi-focal plane scanning; An acquisition module 202 is used to determine multiple zoom heights for scanning the PIN needle to be detected according to a preset zoom step based on a reference zoom height, and acquire a focal plane image corresponding to each zoom height; The second determination module 203 is used to obtain the center coordinates of the PIN needle to be detected for each focal plane image, and determine the ROI area of ​​the PIN needle to be detected according to the center coordinates of the PIN needle to be detected; The first judgment module 204 is used to calculate the clarity measurement value of the ROI area of ​​the PIN needle to be detected in each focal plane image. If the calculated clarity measurement value is greater than a preset clarity threshold, it is determined that there is a clear area in the corresponding ROI area, and the center coordinates of the clear area are recorded; The second judgment module 205 is used to calculate the offset between the center coordinates of the PIN to be detected and the center coordinates of the clear area, and compare the calculated offset with a preset offset threshold. If the calculated offset is greater than the preset offset threshold, it is determined that the PIN to be detected has a verticality defect.

[0047] In this embodiment, when verticality defects are detected for multiple PIN pins to be detected at the same time, the PIN pins to be detected are scanned with multiple focal planes using a zoom system at multiple zoom heights to obtain multiple focal plane images. If a new PIN pin to be detected appears at the current zoom height, the current zoom height is used as the reference zoom height of the new PIN pin to be detected. The new PIN pin to be detected refers to a PIN pin detected in an area that does not overlap with the ROI area set of the existing PIN pins to be detected within the image field of view, mainly for the situation where PIN pins of different heights exist in the test sample.

[0048] Figure 3 The structure of the PIN verticality defect detection device shown does not constitute a limitation on the PIN verticality defect detection device, and can implement the steps of the PIN verticality defect detection method provided by the above-mentioned method embodiments.

[0049] above Figure 3 The PIN verticality defect detection device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the PIN verticality defect detection device in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0050] Figure 4 It is a structural schematic diagram of a PIN verticality defect detection device provided by an embodiment of the present invention. The device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the device 300. Furthermore, the processor 310 can be configured to communicate with the storage medium 330 and execute a series of instruction operations in the storage medium on the device 300.

[0051] The device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc.

[0052] An embodiment of the present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the PIN verticality defect detection method.

[0053] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0054] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0055] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting PIN verticality defects, characterized in that: The PIN verticality defect detection method comprises: Determining a reference zoom height for enabling the zoom system to perform multi-focal plane scanning; Based on the reference zoom height, determine multiple zoom heights for scanning the PIN to be detected according to a preset zoom step, and obtain a focal plane image corresponding to each zoom height; For each focal plane image, the center coordinates of the PIN needle to be detected are obtained, and the ROI area of ​​the PIN needle to be detected is determined according to the center coordinates of the PIN needle to be detected; Calculate the clarity measurement value of the ROI area of ​​the PIN needle to be detected in each focal plane image. If the calculated clarity measurement value is greater than the preset clarity threshold, it is determined that there is a clear area in the corresponding ROI area, and the center coordinates of the clear area are recorded; The offset between the center coordinates of the PIN to be detected and the center coordinates of the clear area is calculated, and the calculated offset is compared with a preset offset threshold. If the calculated offset is greater than the preset offset threshold, it is determined that the PIN to be detected has a verticality defect.

2. The PIN verticality defect detection method according to claim 1, characterized in that: When there is one PIN pin to be detected, the reference zoom height is the height at which the zoom system clearly images the upper surface of the PIN pin to be detected. When there are at least two PIN pins to be detected, the reference zoom height is the height at which the zoom system clearly images the upper surface of the tallest PIN pin to be detected.

3. The PIN verticality defect detection method according to claim 1, characterized in that: The method of acquiring the center coordinates of the PIN needle to be detected for each focal plane image and determining the ROI area of ​​the PIN needle to be detected according to the center coordinates includes: For each focal plane image, filtering and noise reduction processing is performed on the focal plane image; Based on the focal plane image after filtering and noise reduction, the PIN needle area is extracted by using adaptive threshold segmentation; If the PIN to be detected is a circular PIN, Hough circle transform positioning is performed in the PIN area to extract the contour of the target object. If the PIN to be detected is a rectangular PIN, minimum circumscribed rectangle fitting is performed in the PIN area to extract the contour of the target object. Obtain the center coordinates of the target object according to the outline of the target object, and calculate the size of the target object; Determine whether the size of the target object is within the detection size range, and if so, determine that the target object is a PIN to be detected; The center coordinates of the PIN needle to be detected are obtained, and the ROI area of ​​the PIN needle to be detected is determined according to the center coordinates of the PIN needle to be detected.

4. The PIN verticality defect detection method according to claim 3, characterized in that: The filtering and noise reduction process is performed on each focal plane image, including using Gaussian filtering or median filtering to suppress high-frequency noise of each focal plane image.

5. The PIN verticality defect detection method according to claim 1, characterized in that: The clarity measurement value of the ROI area of ​​the PIN needle to be detected in each focal plane image is calculated based on the Tenengrad gradient function or the Laplacian gradient function.

6. The PIN verticality defect detection method according to claim 5, characterized in that: The Tenengrad gradient function is expressed as: ; In the formula, It represents the clarity measurement value of the ROI area of ​​the PIN needle to be detected calculated based on the Tenengrad gradient function. and are the horizontal and vertical gradients of the Sobel operator, The coordinates of the pixel points in the ROI area of ​​the PIN needle to be detected.

7. The PIN verticality defect detection method according to claim 5, characterized in that: The Laplacian gradient function is expressed as: ; In the formula, It represents the clarity measurement value of the ROI area of ​​the PIN needle to be detected calculated based on the Tenengrad gradient function. Indicates the ROI area of ​​the PIN to be detected in pixel coordinates The Laplacian value at .

8. A PIN verticality defect detection device, characterized in that: include: A first determination module determines a reference zoom height for enabling the zoom system to perform multi-focal plane scanning; An acquisition module, used to determine multiple zoom heights for scanning the PIN needle to be detected according to a preset zoom step based on a reference zoom height, and acquire a focal plane image corresponding to each zoom height; A second determination module is used to obtain the center coordinates of the PIN needle to be detected for each focal plane image, and determine the ROI area of ​​the PIN needle to be detected according to the center coordinates of the PIN needle to be detected; The first judgment module is used to calculate the clarity measurement value of the ROI area of ​​the PIN needle to be detected in each focal plane image. If the calculated clarity measurement value is greater than a preset clarity threshold, it is determined that there is a clear area in the corresponding ROI area, and the center coordinates of the clear area are recorded; The second judgment module is used to calculate the offset between the center coordinates of the PIN to be detected and the center coordinates of the clear area, and compare the calculated offset with a preset offset threshold. If the calculated offset is greater than the preset offset threshold, it is determined that the PIN to be detected has a verticality defect.

9. A PIN verticality defect detection device, characterized in that: comprising a memory and at least one processor, wherein the memory has computer-readable instructions stored therein; The at least one processor calls the computer-readable instructions in the memory to execute the various steps of the PIN verticality defect detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the PIN verticality defect detection method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image automatic focusing method and device, computer equipment and storage medium

    CN116782029A

  • PIN defect detection method, device and equipment and computer readable storage medium

    CN116823791A

  • Sub-pixel precision robust PIN true position detection method and device and storage medium

    CN117557531A

  • Multi-focal-plane image fusion method and system for three-dimensional workpiece detection

    CN119693252A

  • Detector for determining a position of at least one object

    US20210180939A1