Pin needle verticality defect detection method, device, equipment and storage medium

By using a micromirror array ultra-high-speed zoom system and multi-focal plane scanning technology, the real-time and accuracy problems of pin perpendicularity detection on high-speed production lines have been solved, achieving efficient and automated detection of pin perpendicularity defects.

CN120101645BActive Publication Date: 2025-12-12JIHUA LAB
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies are insufficient for real-time detection of PCB board pin perpendicularity defects on high-speed production lines. Traditional mechanical zoom systems suffer from slow zoom speeds and significant loss of positioning accuracy, making it difficult to meet detection requirements.

Method used

A micromirror array ultra-high-speed zoom system is used to perform multi-focal plane scanning. Based on the reference zoom height and preset step size, the focal plane image is acquired, the sharpness and center coordinate offset of the ROI region are calculated, and the pin verticality defect is determined.

Benefits of technology

It achieves efficient and automated detection of pin perpendicularity defects, avoiding the errors and subjectivity of traditional methods, and improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120101645B_ABST
    Figure CN120101645B_ABST
Patent Text Reader

Abstract

The application relates to the field of detection, and discloses a PIN needle verticality defect detection method, device, equipment and storage medium. The method is used for detecting PIN needle verticality defects. The method comprises the following steps: determining a reference zoom height for enabling a zoom system to perform multi-focal plane scanning; determining a plurality of zoom heights based on the reference zoom height, and acquiring a focal plane image corresponding to each zoom height; for each focal plane image, acquiring the center coordinates of a PIN needle to be detected, and determining the ROI area of the PIN needle to be detected; calculating the definition metric value of the ROI area corresponding to each focal plane image, if the definition metric value is greater than a preset definition threshold, it is determined that the corresponding ROI area has a clear area, and the center coordinates of the clear area are recorded; calculating the offset between the center coordinates of the PIN needle to be detected and the center coordinates of the clear area, and if the offset is greater than a preset offset threshold, it is determined that the PIN needle to be detected has a verticality defect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of detection, in particular to a PIN needle verticality defect detection method, device, equipment and storage medium. BACKGROUND

[0002] With the continuous progress of semiconductor packaging and precision electronic manufacturing technology, more and more electronic devices are integrated on a PCB board. Although this trend brings the advantages of more functions and space saving, it also greatly increases the number of pin pins on the PCB board, which leads to a dramatic increase in the workload of technicians in detecting the quality of the PCB board. Moreover, as a key connecting component, the PIN needle will directly endanger the reliability of the device once it has a bending deformation defect.

[0003] Currently, the traditional detection methods mainly rely on manual detection or use optical microscopes combined with image processing algorithms. However, these methods are not up to the task when faced with high-speed production lines and are difficult to meet the needs of real-time detection. Specifically, the mainstream optical detection equipment currently uses a mechanical zoom system with a mechanically driven zoom module, which adjusts the lens group position through a stepper motor to achieve focal length switching. However, this approach has many drawbacks: first, the zoom speed is limited by mechanical inertia, and a single zoom takes at least 50ms, which is far from keeping up with the pace of detecting more than a thousand times per minute on a super-speed production line; second, long-term high-frequency movement causes severe wear of the transmission components, and the positioning accuracy decays by more than ±5μm per thousand hours, requiring frequent calibration; third, when multiple degrees of freedom are coordinated for zooming, such as Z-axis focusing and XY-axis scanning synchronization, motion errors will accumulate, eventually causing image registration to fail.

[0004] Therefore, the prior art still needs to be improved and developed. SUMMARY

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

[0006] The first aspect of the present application provides a PIN needle verticality defect detection method, the PIN needle verticality defect detection method comprising: determining a reference zoom height for causing a zoom system to perform a multi-focal plane scanning; determining a plurality of zoom heights for scanning a PIN needle to be detected according to a preset zoom step based on the reference zoom height, and obtaining a focal plane image corresponding to each zoom height; for each focal plane image, obtaining a center coordinate of the PIN needle to be detected, and determining a ROI region of the PIN needle to be detected according to the center coordinate of the PIN needle to be detected; calculating a sharpness metric value of the ROI region of the PIN needle to be detected in each focal plane image, if the calculated sharpness metric value is greater than a preset sharpness threshold, it is determined that a clear region exists in the corresponding ROI region, and the center coordinate of the clear region is recorded; calculating the offset between the center coordinate of the PIN needle to be detected and the center coordinate of the clear region, 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 needle to be detected has a verticality defect.

[0007] Preferably, the reference zoom height of the zoom system is the height at which the zoom system clearly images the upper surface of the PIN needle to be detected.

[0008] Preferably, the method further comprises: for each focal plane image, filtering and denoising the focal plane image; extracting a PIN needle region based on the filtered and denoised focal plane image using adaptive threshold segmentation; if the PIN needle to be detected is a circular PIN needle, performing Hough circle transformation positioning in the PIN needle region to extract the contour of the target object, if the PIN needle to be detected is a rectangular PIN needle, performing minimum circumscribed rectangle fitting in the PIN needle region to extract the contour of the target object; obtaining the center coordinate of the target object according to the contour of the target object, and calculating the size of the target object; determining whether the size of the target object is within a detection size range value, if yes, determining that the target object is the PIN needle to be detected; obtaining the center coordinate of the PIN needle to be detected, and determining the ROI region of the PIN needle to be detected according to the center coordinate of the PIN needle to be detected.

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

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

[0011] Preferably, the Tenengrad gradient function is represented as:

[0012]

[0013] wherein, represents a sharpness metric value of the ROI region of the PIN to be detected calculated based on the Tenengrad gradient function, and are horizontal gradient and vertical gradient of the Sobel operator, represents the coordinates of the pixel points of the ROI region of the PIN to be detected.

[0014] Preferably, the Laplacian gradient function is represented as:

[0015]

[0016] wherein, represents a sharpness metric value of the ROI region of the PIN to be detected calculated based on the Tenengrad gradient function, represents the Laplacian value of the ROI region of the PIN to be detected at the pixel coordinates .

[0017] The second aspect of the present application provides a PIN perpendicularity defect detection device, comprising: a first determining module configured to determine a reference zoom height for causing a zoom system to perform multi-focal plane scanning; an obtaining module configured to determine a plurality of zoom heights for scanning a PIN to be detected according to a preset zoom step based on the reference zoom height, and obtain a focal plane image corresponding to each zoom height; a second determining module configured to obtain a center coordinate of the PIN to be detected for each focal plane image, and determine an ROI region of the PIN to be detected according to the center coordinate of the PIN to be detected; a first judging module configured to calculate a sharpness metric value of the ROI region of the PIN to be detected in each focal plane image, and determine that a clear region exists in the corresponding ROI region if the calculated sharpness metric value is greater than a preset sharpness threshold, and record the center coordinate of the clear region; and a second judging module configured to calculate an offset between the center coordinate of the PIN to be detected and the center coordinate of the clear region, and compare the calculated offset with a preset offset threshold, and determine that the PIN to be detected has a perpendicularity defect if the calculated offset is greater than the preset offset threshold.

[0018] ​​The third aspect of the present application provides a PIN needle verticality defect detection device, comprising: a memory and at least one processor, the memory storing computer readable instructions, and the memory and the at least one processor being interconnected by a line; the at least one processor invokes the computer readable instructions in the memory, so that the PIN needle verticality defect detection device performs each step of the PIN needle verticality defect detection method.

[0019] The fourth aspect of the present application provides a computer readable storage medium, which stores computer readable instructions, when running on a computer, so that the computer performs each step of the PIN needle verticality defect detection method.

[0020] In the technical solution provided by the present application, in the embodiment, when multiple PIN needles to be detected are detected for verticality defects, in the process of using a zoom system to perform multi-focal plane scanning on the PIN needles to be detected at multiple zoom heights to obtain multiple focal plane images, if a new PIN needle to be detected is detected at the current zoom height, the current zoom height is taken as the reference zoom height of the new PIN needle to be detected. The new PIN needle to be detected refers to a PIN needle detected in a region in the image field of view that does not overlap with the ROI region set of the existing PIN needles to be detected, and mainly aims at the case that PIN needles of different heights exist in the sample to be detected. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 A flowchart of the PIN needle verticality defect detection method provided for the embodiment of the present application;

[0022] Figure 2 A schematic diagram of the ROI region of the PIN needle to be detected provided for the embodiment of the present application;

[0023] Figure 3 A structural schematic diagram of the PIN needle verticality defect detection device provided for the embodiment of the present application;

[0024] Figure 4 A structural schematic diagram of the PIN needle verticality defect detection device provided for the embodiment of the present application. DETAILED DESCRIPTION

[0025] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed as interchangeable in order to comfort the embodiments described herein with the order described herein or illustrated in the figures. Furthermore, the terms "comprising", "having", "including", and the like, when used in the present specification, are used in their open-ended, non-limiting sense, for example, to encompass the presence of a process, method, system, product, or apparatus with its inherent components which follow the clear description in the specification, but not excluding the presence of additional steps, methods, systems, products, or apparatuses with their inherent components which are also not clearly described in the specification.

[0026] For the purpose of facilitating understanding, the specific flow of the embodiments of the present application is described below, please refer to Figure 1 In the embodiments of the present application, a PIN verticality defect detection method comprises:

[0027] S101, determining a reference zoom height for making the zoom system perform multi-focal plane scanning;

[0028] S102, determining a plurality of zoom heights for scanning the PIN to be detected according to a preset zoom step length based on the reference zoom height, and acquiring a focal plane image corresponding to each zoom height;

[0029] S103, for each focal plane image, acquiring the center coordinates of the PIN to be detected, and determining the ROI region of the PIN to be detected according to the center coordinates of the PIN to be detected;

[0030] S104, calculating the sharpness metric value of the ROI region of the PIN to be detected in each focal plane image, if the calculated sharpness metric value is greater than a preset sharpness threshold, it is determined that the corresponding ROI region has a clear region, and the center coordinates of the clear region are recorded;

[0031] S105, calculating the offset between the center coordinates of the PIN to be detected and the center coordinates of the clear region, 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.

[0032] It can be understood that the execution subject of the present application can be a PIN verticality defect detection device, and can also be a terminal or a server, which is not limited here. The embodiments of the present application take the server as the execution subject for example.

[0033] In the embodiment, in step S101, the zoom system is a micro-mirror array super-speed zoom system. The micro-mirror array super-speed zoom system is a micro-mirror array composed of hundreds to thousands of individual micro-mirrors through high-speed fine adjustment to accurately fit the required lens curvature shape, accurately realize the curvature change of a traditional zoom lens, and thus achieve a static fast zoom function. The zoom speed can reach 12KHz, and different focal plane images can be obtained in real time.

[0034] In the 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 in the zoomable range during the zooming down process.

[0035] It can be understood that the height at which the upper surface of the PIN to be detected is clearly imaged as the reference zoom height has the advantage that the zoom system has a larger downward scanning range. If the PIN to be detected is relatively short, other focusing planes of the zoom system can also be selected as the reference, as long as the super-speed zoom system can cover the entire PIN to be detected during the downward scanning process.

[0036] In the embodiment, the perpendicularity defect of multiple PINs to be detected can be detected at the same time. When adjusting the height of the zoom system, the height of the zoom system is adjusted according to the position of the PIN to be detected with the highest height, that is, when the upper surface of the PIN to be detected with the highest height can be clearly imaged, the adjustment is completed, and the adjusted height is the reference zoom height of the zoom system.

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

[0038] Specifically, a plurality of standard PIN samples with known heights are selected in advance, images are collected at different zoom heights, and parameters such as imaging clarity and size change of each standard PIN sample at different zoom heights are recorded. The relationship between these parameters and the zoom height and the actual height of the PIN 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 height of the PIN and the appropriate zoom height. That is, a mathematical model reflecting the mapping relationship between the reference zoom height and the height position of the PIN to be detected is constructed in advance.

[0039] Then, in application, the height position of the PIN to be detected is input into the mathematical model, and the data output by the mathematical model is the reference zoom height of the zoom system.

[0040] In the embodiment, the reference zoom height can also be determined according to the imaging effect.

[0041] In the embodiment, in step S102, after determining the reference zoom height, a plurality of zoom heights for multi-focal plane scanning of the PIN to be detected are determined according to a preset zoom step, and then the PIN to be detected is scanned at the plurality of zoom heights using the zoom system to obtain a plurality of focal plane images. Assuming that the reference zoom height is The corresponding focal plane image is , The reference zoom height is The corresponding zoom height is the first zoom step downward based on the reference zoom height , The corresponding zoom height is the second zoom step downward based on the reference zoom height The corresponding zoom height is the third zoom step downward based on the reference zoom height The corresponding focal plane image is , The corresponding focal plane image is The set of zoom heights is The set of focal plane images is .

[0042] In the embodiment, in step S103, for each focal plane image, the center coordinates of the PIN to be detected are obtained, and the ROI region of the PIN to be detected is determined according to the center coordinates, including: for each focal plane image, the focal plane image is subjected to filtering and noise reduction processing; the PIN region is extracted using adaptive threshold segmentation based on the focal plane image after filtering and noise reduction processing; if the PIN to be detected is a circular PIN, Hough circle transformation positioning is performed in the PIN region to extract the contour of the target object, and if the PIN to be detected is a rectangular PIN, minimum circumscribed rectangle fitting is performed in the PIN region to extract the contour of the target object; the center coordinates of the target object are obtained according to the contour of the target object, and the size of the target object is calculated; it is judged whether the size of the target object is within the detection size range value, and if so, it is determined that the target object is the PIN to be detected; the center coordinates of the PIN to be detected are obtained, and the ROI region of the PIN to be detected is determined according to the center coordinates of the PIN to be detected.

[0043] It can be understood that the detection size is predetermined according to the size of the PIN to be detected, and considering the error of the detection algorithm for circular or rectangular detection, the detection size can be appropriately scaled, that is, the detection size range value is [0.9* detection size, 1.2* detection size].

[0044] In the embodiment, the filtering and noise reduction processing of the focal plane image can use Gaussian filtering (σ=1.5) or median filtering (kernel=3x3) to suppress high-frequency noise.

[0045] like Figure 2 As shown, when there are multiple pins to be detected, the Region of Interest (ROI) refers to a circular area where the pins do not interfere with each other. It is typically set to be slightly larger than the smallest circumcircle 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 to be detected are determined, and the ROI of each pin is determined based on its center coordinates. For example, in a focal plane image... In the middle, the PIN pin to be tested The center coordinates are ROI region is Then the focal plane image In the middle, the set of ROI regions of all PIN pins to be tested .

[0046] In this embodiment, when simultaneously detecting perpendicularity defects in multiple PINs, a zoom system is used at multiple zoom heights to scan the PINs under test using multiple focal planes, obtaining multiple focal plane images. If a new PIN is detected at the current zoom height, then the current zoom height is used as the reference zoom height for the new PIN. A new PIN refers to a PIN detected in an area within the image's field of view that does not overlap with the existing set of ROIs (Region of Interest) for PINs under test. This primarily addresses situations where PINs of different heights exist in the sample being tested.

[0047] In this embodiment, in steps S104 and S105, for a normal vertical column, only the top is clearly imaged. When the focusing plane moves down, the side of the column remains outside the focusing plane (outside the depth of field) because it does not deviate from the vertical axis, and is therefore blurred. For a curved column, the middle section shifts to one side due to the curve. When the focusing plane moves down to the shifted position, the middle section enters the focusing plane range, and is thus clearly imaged.

[0048] A set of different zoom heights set by the zoom system Obtain the image set For the set of ROI regions of all PIN pins to be detected Within the same ROI region, a set of different zoom heights k can be obtained. This allows for the detection of whether the sharpness metric value of each PIN pin in different focal plane images is greater than a preset sharpness threshold, thereby determining whether a certain area is sharp.

[0049] For the PIN pin to be tested This 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 the ROI region of the PIN needle is greater than the preset clarity threshold value Theoretically, it is also greater than the preset clarity threshold value, but since it is focused on the PIN needle substrate, its clarity metric value is not calculated; if the PIN needle to be detected is bent, the reference zoom height exists The first Step size corresponding to the zoom height corresponding to the focal plane image of the ROI region The clarity metric value of the ROI region of the PIN needle is greater than the preset clarity threshold value, and a clear area appears. At this time, the center coordinates of the clear area are recorded And the offset is calculated When is greater than the preset offset threshold value, it is determined that the PIN needle to be detected is bent.

[0050] In this embodiment, 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.

[0051] The Tenengrad gradient function calculates the horizontal gradient and the vertical gradient of the focal plane image using the Sobel operator. The greater the gradient amplitude, the clearer the image. The Tenengrad gradient function is represented as:

[0052] .

[0053] In the formula, represents the clarity metric value of the ROI region of the PIN needle to be detected calculated based on the Tenengrad gradient function, and are the horizontal gradient and the vertical gradient of the Sobel operator, represents the coordinates of the pixel point of the ROI region of the PIN needle to be detected.

[0054] In this embodiment, by traversing the coordinates of each pixel point of the ROI region of the PIN needle to be detected , the horizontal and vertical gradients at the point are calculated respectively, and then the Tenengrad gradient function value of the ROI region of the PIN needle to be detected is calculated according to the Tenengrad gradient function, so as to measure the image clarity.

[0055] In this embodiment, the Laplacian gradient function is used to calculate the second derivative of the image. Its core principle lies in that edges and details in the image often have rapid changes in gray scale. The first derivative can detect the position of the gray scale change, and the second derivative is more sensitive to the rate of change of the gray scale change. In the image, the transition area from low gray value to high gray value (i.e. edge), the second derivative will produce extreme value, by calculating the second derivative, these edges and detail information can be highlighted.

[0056] The Laplacian operator is a tool for implementing the calculation of the second derivative. In a two-dimensional image, it is defined by summing the second partial derivatives of the image in the horizontal and vertical directions.

[0057] The Laplacian gradient function is expressed as:

[0058] .

[0059] In the formula, represents the sharpness metric value of the ROI region of the PIN to be detected calculated based on the Tenengrad gradient function, represents the Laplacian value of the ROI region of the PIN to be detected at the pixel coordinates , that is, the second derivative. For a discrete digital image, the calculation is usually approximated by template convolution.

[0060] The embodiment provides a PIN verticality defect detection method, which realizes efficient and automatic detection of PIN verticality defects through multi-focal plane cooperative scanning and accurate quantitative analysis. First, based on the multi-focal plane scanning strategy of the reference zoom height and the preset step length, the structural features of the PIN at different depths can be comprehensively covered, and the misjudgment caused by the loss of information of a single focal plane can be avoided. Second, for each focal plane image, the center coordinates of the PIN to be detected are accurately obtained and the ROI region is determined, so that the processing range is effectively reduced, the detection efficiency is significantly improved, and unnecessary calculation amount and interference factors are reduced. Finally, the sharpness metric value of the ROI region is calculated, compared with a preset threshold to determine the clear region, and the quantitative calculation of the center coordinate offset is used to convert the verticality defect into a quantifiable spatial offset parameter, and the objective judgment is realized through the preset threshold, which not only avoids the subjective error of traditional visual inspection, but also accurately identifies the PIN with verticality defects.

[0061] The PIN verticality defect detection method in the embodiment of the application is described above, and the device in the embodiment of the application is described below. Please refer to Figure 3 The implementation of the PIN verticality defect detection device in the embodiment of the application includes:

[0062] The first determination module 201 determines the reference zoom height for making the zoom system perform multi-focal plane scanning.

[0063] The acquisition module 202 is configured to determine a plurality of zoom heights for scanning the PIN to be detected according to a preset zoom step length based on the reference zoom height, and acquire a focal plane image corresponding to each zoom height.

[0064] The second determination module 203 is configured to acquire the center coordinate of the PIN to be detected for each focal plane image, and determine the ROI region of the PIN to be detected according to the center coordinate of the PIN to be detected.

[0065] The first judgment module 204 is configured to calculate the definition metric value of the ROI region of the PIN to be detected in each focal plane image, and determine that the corresponding ROI region has a clear region if the calculated definition metric value is greater than a preset definition threshold, and record the center coordinate of the clear region.

[0066] The second judgment module 205 is configured to calculate the offset between the center coordinate of the PIN to be detected and the center coordinate of the clear region, and compare the calculated offset with a preset offset threshold, and determine that the PIN to be detected has a perpendicularity defect if the calculated offset is greater than the preset offset threshold.

[0067] In the embodiment, when the perpendicularity defect of multiple PINs to be detected is detected simultaneously, the focal plane scanning of the PIN to be detected is performed using the zoom system at multiple zoom heights, and multiple focal plane images are obtained. If a new PIN to be detected is detected at the current zoom height, the current zoom height is taken as the reference zoom height of the new PIN to be detected. The new PIN to be detected refers to the PIN detected in the non-overlapping region of the ROI region set of the existing PIN to be detected in the image field of view, and is mainly used for the case that the PINs to be detected at different heights exist in the sample.

[0068] Figure 3 The structure of the PIN perpendicularity defect detection device shown in the figure does not constitute a limitation on the PIN perpendicularity defect detection device, and the steps of the PIN perpendicularity defect detection method provided by each method embodiment can be implemented.

[0069] The above Figure 3 The PIN perpendicularity defect detection device in the embodiment of the application is described in detail from the perspective of modular functional entities, and the PIN perpendicularity defect detection device in the embodiment of the application is described in detail from the perspective of hardware processing.

[0070] Figure 4is a structural schematic diagram of a PIN needle verticality defect detection device provided by the embodiment of the present application. The device 300 can have great differences due to different configurations or performances, and can include one or more central processing units (CPUs) 310 (for example, one or more processors) and a memory 320, one or more storage media 330 (for example, one or more mass storage devices) storing application programs 333 or data 332. The memory 320 and the storage media 330 can be temporary storage or persistent storage. The programs stored in the storage media 330 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the device 300. Furthermore, the processor 310 can be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media on the device 300.

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

[0072] The embodiment of the present application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium or a volatile computer readable storage medium. The computer readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the steps of the PIN needle verticality defect detection method.

[0073] 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 or device, unit can refer to the corresponding process in the foregoing method embodiment, which will not be described here.

[0074] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0075] The above-described embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the same; even though the present application has been described in detail with reference to the foregoing embodiments, those ordinarily skilled in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some of the technical features; and these modifications or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for detecting the perpendicularity defect of a PIN needle, characterized in that, The PIN needle verticality defect detection method comprises: determining a reference zoom height for enabling the zoom system to perform a multi-focal plane scanning; based on the reference zoom height, determining a plurality of zoom heights for scanning the 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 region of the PIN needle to be detected according to the center coordinates of the PIN needle to be detected; calculating the sharpness metric value of the ROI region of the PIN needle to be detected in each focal plane image, and if the calculated sharpness metric value is greater than a preset sharpness threshold, determining that the corresponding ROI region has a clear area, and recording the center coordinates of the clear area; calculating the 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, and if the calculated offset is greater than the preset offset threshold, determining that the PIN needle to be detected has a verticality defect; when the PIN needle to be detected is one, the reference zoom height is the height at which the zoom system clearly images the upper surface of the PIN needle to be detected, and when the PIN needle to be detected is at least two, the reference zoom height is the height at which the zoom system clearly images the upper surface of the highest PIN needle to be detected.

2. The method of claim 1, wherein, The method comprises: for each focal plane image, filtering and denoising the focal plane image; based on the focal plane image after filtering and denoising, using adaptive threshold segmentation to extract the PIN needle region; if the PIN needle to be detected is a circular PIN needle, performing Hough circle transformation positioning in the PIN needle region to extract the contour of the target object, and if the PIN needle to be detected is a rectangular PIN needle, performing minimum circumscribed rectangle fitting in the PIN needle region 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; determining whether the size of the target object is within a detection size range value, and if so, determining that the target object is the PIN needle to be detected; obtaining the center coordinates of the PIN needle to be detected, and determining the ROI region of the PIN needle to be detected according to the center coordinates of the PIN needle to be detected.

3. The method of claim 2, wherein the step of detecting the verticality defect of the PIN needle is performed by using a camera. The filtering and denoising of each focal plane image comprises using Gaussian filtering or median filtering to suppress the high-frequency noise of each focal plane image.

4. The method of claim 1, wherein The sharpness metric value of the ROI region of the PIN needle to be detected in each focal plane image is calculated based on a Tenengrad gradient function or a Laplacian gradient function.

5. The method of claim 4, wherein the step of detecting the verticality defect of the PIN needle is performed by using a camera. The Tenengrad gradient function is represented as: F Tenengrad = ∑(G x (x,y) 2 + G y (x,y) 2 ); In the formula, F Tenebgrd G represents a sharpness measurement value of the ROI region of the PIN to be detected calculated based on a Tenengrad gradient function x and G y are horizontal gradient and vertical gradient of a Sobel operator, and (x, y) represents coordinates of a pixel point of the ROI region of the PIN to be detected.

6. The method of claim 4, wherein the step of detecting the verticality defect of the PIN needle is performed by using a camera. The Laplacian gradient function is represented as: In the formula, F Laplacian represents the sharpness metric value of the ROI region of the PIN to be detected calculated based on the Tenengrad gradient function, and 2 I(x, y) represents the Laplacian value of the ROI region of the PIN to be detected at the pixel coordinates (x, y).

7. A PIN needle perpendicularity defect detection apparatus characterized by comprising: The method comprises: a first determination module for determining a reference zoom height for enabling the zoom system to perform a multi-focal plane scanning; The acquisition module is configured to determine a plurality of zoom heights for scanning the PIN 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 is configured to acquire the center coordinates of the PIN to be detected for each focal plane image, and determine the ROI region of the PIN to be detected according to the center coordinates of the PIN to be detected; The first judgment module is configured to calculate the sharpness metric value of the ROI region of the PIN to be detected in each focal plane image, and determine that a clear region exists in the corresponding ROI region if the calculated sharpness metric value is greater than a preset sharpness threshold, and record the center coordinates of the clear region; The second judgment module is configured to calculate the offset between the center coordinates of the PIN to be detected and the center coordinates of the clear region, and compare the calculated offset with a preset offset threshold, and determine that the PIN to be detected has a perpendicularity defect if the calculated offset is greater than the preset offset threshold. When the PIN to be detected is one, the reference zoom height is the height at which the zoom system clearly images the upper surface of the PIN to be detected; when the PIN to be detected is at least two, the reference zoom height is the height at which the zoom system clearly images the upper surface of the highest PIN to be detected.

8. A PIN needle perpendicularity defect detection apparatus characterized by comprising: The computer readable instructions are executed by the processor to implement the steps of the PIN perpendicularity defect detection method according to any one of claims 1-6. The computer readable instructions are executed by the processor to implement the steps of the PIN perpendicularity defect detection method according to any one of claims 1-6.

9. A computer-readable storage medium having stored thereon computer-readable instructions, wherein, The computer readable instructions are executed by the processor to implement the steps of the PIN perpendicularity defect detection method according to any one of claims 1-6.

Citation Information

Patent Citations

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

    CN116782029A

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

    CN117557531A