A PIN pin precise positioning detection method, device, equipment and readable storage medium

By preprocessing and region screening the original image and combining it with affine position transformation, the precise positioning of the PIN needle is achieved, which solves the problems of low efficiency and low accuracy in the existing technology and reduces the detection cost.

CN115578453BActive Publication Date: 2025-10-03HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211259485.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2025-10-03
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

The existing PIN needle detection method has low efficiency, low accuracy, and high cost, and it is difficult to accurately locate the PIN needle in a complex image.

Method used

By preprocessing the original image, including smoothing and local threshold segmentation, obtaining the threshold segmentation processed image, performing regional connectivity processing and screening, and using the affine position transformation relationship to determine the area where the PIN needles are located, and performing threshold segmentation processing, the effective PIN needle area is obtained and detected according to the number and center coordinates.

Benefits of technology

The accuracy and efficiency of PIN needle detection are improved, the detection cost is reduced, and the problem of confusion between PIN needles and interference points is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115578453B_ABST
    Figure CN115578453B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, apparatus, device, and readable storage medium for accurately locating and detecting PIN pins, which are applicable to the field of image detection. The method comprises: preprocessing an acquired original image to obtain a threshold segmentation-processed image; performing region connectivity processing on the threshold segmentation-processed image, selecting a region in the region connectivity processing result that meets preset characteristics as a target region; obtaining the center coordinates of the target region, and determining the region where the PIN pin is located using an affine position transformation relationship; performing threshold segmentation processing on the region where the PIN pin is located to obtain a valid PIN pin region; and detecting the PIN pin based on the number and center coordinates of the valid PIN pin regions. The present invention determines the region where the PIN pin is located using a pre-set affine position transformation relationship, and then detects the PIN pin, thereby avoiding the problem of confusion between the PIN pin and interference points in complex image effects, which makes it impossible to accurately locate the PIN pin.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection, and in particular to a method, device, equipment and readable storage medium for accurately positioning and detecting a PIN needle. Background Art

[0002] Existing methods for detecting PIN pins (a metal material used in connectors to conduct electricity) are mostly based on images. Existing methods of manually visually determining whether PIN pins are skewed or missing are not only inefficient, but also non-traceable, inaccurate, and require consideration of labor costs. Another method involves manually using testing equipment to detect product compliance by plugging and unplugging. This direct contact method carries the risk of damaging the PIN pins. Existing methods for detecting PIN pins based on 2D images include direct positioning through precise lighting, which has poor feasibility and consistency. Another method involves positioning based on a combination of 3D and 2D images, which is costly and complex.

[0003] Therefore, how to solve the high cost technical problem of accurately locating PIN needles in complex images is an issue that those skilled in the art urgently need to solve. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a PIN pin precise positioning detection method, device, equipment and readable storage medium, which solves the problem in the related art that in complex image effects, the PIN pin is confused with the interference point and the PIN pin cannot be accurately positioned.

[0005] To solve the above technical problems, the present invention provides a method for accurately positioning and detecting a PIN needle, comprising:

[0006] Preprocess the acquired original image to obtain a threshold segmentation processed image;

[0007] Performing region connectivity processing on the threshold segmentation processed image to obtain a region connectivity processing result, and selecting a region in the region connectivity processing result that meets preset characteristics as a target region; wherein the preset characteristics include at least one of the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset region;

[0008] Obtaining the center coordinates of the target area and determining the area where the PIN pin is located through an affine position transformation relationship; wherein the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target area and the area where the PIN pin is located;

[0009] Performing threshold segmentation processing on the area where the PIN pin is located to obtain a valid PIN pin area; wherein the valid PIN pin area is a valid area containing one PIN pin;

[0010] The PIN pins are detected according to the number and center coordinates of the valid PIN pin areas.

[0011] Optionally, selecting a region that meets preset characteristics in the region connectivity processing result as a target region includes:

[0012] Selecting a region from the region connectivity processing result according to a first preset feature to obtain a first target region; the first preset feature includes the area, the rectangularity, the inscribed length, and the inscribed width of the preset region;

[0013] performing closing operation and filling operation on the first target area in sequence according to preset closing operation parameters to obtain a first area;

[0014] Filtering the first area according to a second preset feature to obtain a filtered area; the second preset feature includes the circumscribed width, the circumscribed length, the inscribed length, and the inscribed width of the preset area;

[0015] The screening area is used as the target area.

[0016] Optionally, after filtering the first area according to the second preset feature to obtain a filtered area, the method further includes:

[0017] Re-judging the screening area according to a third preset feature; the third preset feature includes the area and the coordinates of the center point of the preset area;

[0018] Accordingly, taking the screening area as the target area includes:

[0019] If the screening area meets the third preset characteristic, the screening area is used as the target area;

[0020] If the screening area does not meet the third preset feature, the first preset feature is changed, and the step of selecting an area in the area connectivity processing result according to the first preset feature to obtain a first target area is performed.

[0021] Optionally, preprocessing the acquired original image to obtain a threshold segmentation processed image includes:

[0022] Performing smoothing on the original image to obtain a first smoothed image;

[0023] performing local threshold segmentation processing on the first smoothed image according to a first threshold segmentation parameter to extract a first dark region as a first segmentation region;

[0024] The first segmented area is sequentially subjected to closing operation processing and filling processing to obtain the threshold segmentation processing image.

[0025] Optionally, detecting the PIN pins according to the number and center coordinates of the valid PIN pin areas includes:

[0026] Determining whether the number of valid PIN pin areas is less than a preset number of PIN pins;

[0027] If so, it is determined that the PIN is missing;

[0028] If not, determining whether the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is a preset distance value;

[0029] If the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is the preset distance value, determining that the PIN pin detection is completed;

[0030] If the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is not the preset distance value, it is determined that the PIN pin is skewed, and the skew direction is determined.

[0031] Optionally, performing threshold segmentation processing on the PIN pin area to obtain a valid PIN pin area includes:

[0032] Smoothing the image of the area where the PIN needle is located to obtain a second smoothed image, performing local threshold segmentation on the second smoothed image according to a second threshold segmentation parameter, and extracting a second dark area as a second segmented area;

[0033] Performing a filling process on the second segmented area to obtain a filled area, and performing an opening operation on the filled area to obtain an opening operation-processed image;

[0034] Performing a region connectivity process on the image processed by the opening operation to obtain a first valid PIN needle region;

[0035] Determining whether the number of the first valid PIN pin area is less than the preset number of PIN pins;

[0036] If so, reducing the second threshold segmentation parameter, performing the step of performing local threshold segmentation on the smoothed image according to the second threshold segmentation parameter, and extracting a second dark area as a second segmentation area;

[0037] If not, the first valid PIN needle area is used as the valid PIN needle area.

[0038] Optionally, the taking the first valid PIN pin area as the valid PIN pin area includes:

[0039] Performing a circular structure expansion operation on the first effective PIN needle area to obtain an expanded area image;

[0040] Performing dynamic threshold segmentation processing on the expanded area image to obtain a third segmented area, and performing region connectivity processing on the third segmented area to obtain a to-be-screened area;

[0041] The area to be screened with 1 hole is used as the effective PIN needle area.

[0042] The present invention also provides a PIN pin precise positioning detection device, comprising:

[0043] An image preprocessing module is used to preprocess the acquired original image to obtain a threshold segmentation processed image;

[0044] a target region selection module, configured to perform region connectivity processing on the threshold segmentation processed image to obtain a region connectivity processing result, and select a region in the region connectivity processing result that meets preset characteristics as a target region; wherein the preset characteristics include the width, length, inscribed width, inscribed height, rectangularity, and area of ​​the preset region;

[0045] a first determination module configured to obtain the center coordinates of the target area and determine the area of ​​the PIN pin through an affine position transformation relationship; wherein the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target area and the area of ​​the PIN pin;

[0046] An effective PIN pin acquisition module, configured to perform threshold segmentation processing on the PIN pin area to obtain an effective PIN pin area; wherein the effective PIN pin area is an effective area containing one PIN pin;

[0047] The positioning result determination module is used to determine the positioning result of the PIN pin according to the number and center coordinates of the effective PIN pin area.

[0048] The present invention also provides a PIN pin precise positioning detection device, comprising:

[0049] Memory for storing computer programs;

[0050] The processor is used to execute the computer program to implement the steps of the above-mentioned PIN needle precise positioning detection method.

[0051] The present invention also provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned PIN needle precise positioning detection method.

[0052] As can be seen, the present invention preprocesses the acquired original image to obtain a threshold segmentation-processed image, performs region connectivity processing on the threshold segmentation-processed image, obtains the region connectivity processing result, and selects the region in the region connectivity processing result that meets preset characteristics as the target region, where the preset characteristics include the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset region. The center coordinates of the target region are obtained, and the region where the PIN pin is located is determined using an affine position transformation relationship, where the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target region and the region where the PIN pin is located. Threshold segmentation is performed on the region where the PIN pin is located to obtain a valid PIN pin region, where a valid PIN pin region is a valid region containing one PIN pin. PIN pins are detected based on the number and center coordinates of the valid PIN pin regions. The present invention preprocesses the acquired original image, performs regional connectivity processing on the obtained threshold segmentation processed image, selects the area that meets the preset characteristics as the target area, determines the area where the PIN pin is located through the affine relationship between the target area and the PIN pin area, and performs threshold segmentation processing on the area where the PIN pin is located to determine the area number and area coordinate center of the effective PIN pin area, and then detects the PIN pin. The method solves the problem that the PIN pin is confused with the interference point in complex image effects and the PIN pin cannot be accurately located, improves the accuracy and efficiency of the PIN pin precise positioning detection, and reduces the detection cost.

[0053] In addition, the present invention also provides a PIN needle precise positioning detection device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0055] Figure 1 A flowchart of a PIN pin precise positioning detection method provided by an embodiment of the present invention;

[0056] Figure 2A flowchart of a method for selecting a region threshold for segmentation processing in an image that meets preset feature requirements provided by an embodiment of the present invention;

[0057] Figure 3 A flowchart of a method for obtaining a valid PIN needle area provided by an embodiment of the present invention;

[0058] Figure 4 A flowchart of a method for detecting a PIN needle provided in an embodiment of the present invention;

[0059] Figure 5 A schematic structural diagram of a PIN pin precise positioning detection device provided by an embodiment of the present invention;

[0060] Figure 6 A schematic structural diagram of a PIN needle precise positioning detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0062] Please refer to Figure 1 , Figure 1 This is a flow chart of a method for accurately locating and detecting a PIN needle provided by an embodiment of the present invention. The method may include:

[0063] S101: Preprocess the acquired original image to obtain a threshold segmentation processed image.

[0064] The execution entity of this embodiment is a terminal. This embodiment does not limit the type of terminal; as long as it can perform precise PIN positioning detection, it can be a general-purpose terminal or a dedicated terminal. It should be noted that the pre-processing of the original image in this embodiment includes at least performing threshold segmentation on the original image to extract the target area.

[0065] This embodiment does not limit the method for acquiring the original image, as long as the operation of acquiring the original image can be completed. For example, the terminal can passively receive the original image, or the terminal can actively acquire it. This embodiment does not limit the frequency of acquiring the original image, as long as the original image can be acquired in a timely manner. For example, acquisition can be performed in real time, that is, after completing one acquisition operation, the next acquisition is performed immediately; or the acquisition operation can be performed once every preset acquisition time period. This embodiment does not limit the set value of the preset acquisition time period. For example, it can be 1 second, 2 seconds, or 5 seconds. This embodiment does not limit the basis for setting the set value of the preset acquisition time period. For example, it can be customized by the operator, or it can be set according to the processing speed of the PIN pin precise positioning detection. The faster the processing speed of the PIN pin precise positioning detection, the smaller the set value of the preset acquisition time period. In order to ensure that the original image is acquired in a timely manner for preprocessing and to ensure the efficiency of the PIN pin precise positioning detection method, this embodiment can adopt a real-time acquisition method for acquisition.

[0066] Furthermore, in order to eliminate noise in the original image, eliminate blank areas in the closed image, and reduce the requirements for image stability, the above-mentioned preprocessing of the acquired original image to obtain the threshold segmentation processed image may include the following steps:

[0067] Step S11: performing smoothing on the original image to obtain a first smoothed image;

[0068] Step S12: performing local threshold segmentation processing on the first smoothed image according to the first threshold segmentation parameter, and extracting a first dark area as a first segmentation area;

[0069] Step S13: performing closing operation and filling operation on the first segmented area in sequence to obtain a threshold segmentation processed image.

[0070] It should be noted that in this embodiment, smoothing the original image to obtain a first smoothed image can eliminate interference from noise in the original image that interferes with detection. Local threshold segmentation of the first smoothed image based on the first threshold segmentation parameter can better extract edge information and reduce image stability requirements. This embodiment does not limit the basis for setting the first threshold segmentation parameter. For example, it can be set based on the grayscale characteristics of the positioning feature or based on a grayscale deviation formula. This embodiment does not limit the number of first dark regions extracted. For example, it can be one, two, or even four, and the number of first dark regions is determined based on the actual extraction situation. This embodiment does not limit the basis for setting the closing operation parameter for the first segmented region; as long as the closing operation can be completed for the first segmented region to obtain a threshold segmented image, it will suffice. For example, it can be set by the operator or based on the image of the first segmented region. The lower the image stability of the first segmented region, the larger the setting value of the closing operation parameter.

[0071] S102: performing region connectivity processing on the pre-processed image to obtain a region connectivity processing result, and selecting a region in the region connectivity processing result that meets preset characteristics as a target region.

[0072] It should be noted that in this embodiment, the preset features include at least one of the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset region. This embodiment does not limit the number of preset features that can be selected. For example, it can be one of the above preset features, or a combination of multiple of the above preset features.

[0073] In this embodiment, the set values ​​for the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset features are determined based on the preset region. This embodiment does not limit the criteria for selecting the preset region; any region that is stable and has distinguishing features within the image can be used. For example, it can be a "T-shaped" region at the top of the image, or a rectangular region at the top.

[0074] Furthermore, in order to improve the accuracy of obtaining the target area, the above-mentioned selection of the area that meets the preset characteristics in the area connectivity processing result as the target area can include the following steps. For details, please refer to Figure 2 , Figure 2 A flowchart of a method for selecting a region threshold for segmentation processing in an image that meets preset feature requirements is provided in an embodiment of the present invention, which may specifically include:

[0075] S201: Selecting a region from the region connectivity processing result according to a first preset feature to obtain a first target region.

[0076] In this embodiment, the first preset feature includes the area, rectangularity, inscribed length, and inscribed width of the preset region.

[0077] S202: performing closing operation and filling operation on the first target area in sequence according to preset closing operation parameters to obtain a first area.

[0078] In this embodiment, the first target area is sequentially closed and filled according to the preset closing operation parameters, so that the target area can be completely acquired, and the interference caused by the gaps in the target area is avoided. In this embodiment, the filling operation can fill the holes that are not filled after the closing operation. This embodiment does not limit the way in which the first target area is closed according to the preset closing operation parameters. For example, the first target area can be closed with a circular structure according to the preset closing operation parameters, or the first target area can be closed with a rectangular structure according to the preset closing operation parameters. This embodiment does not limit the set value of the preset closing operation parameter, as long as it can bridge the gaps in the target area, for example, it can be a 50 pixel value or a 60 pixel value.

[0079] S203: Filter the first area according to the second preset feature to obtain a filtered area.

[0080] In this embodiment, the second preset feature includes the circumscribed width, circumscribed length, inscribed length, and inscribed width of the preset area.

[0081] Furthermore, in order to avoid the problem of regional morphology changing during opening and closing operations due to interference from noise points near the screening area, after the first area is screened according to the second preset feature to obtain the screening area, the following steps may be further included:

[0082] Step S21: re-judging the screening area according to the third preset feature;

[0083] Step S22: If the screening area meets the third preset characteristic, the screening area is used as the target area;

[0084] Step S23: If the screened area does not meet the third preset feature, the first preset feature is changed, and a step of selecting an area in the area connectivity processing result according to the first preset feature is performed to obtain a first target area.

[0085] It should be noted that in this embodiment, the third preset characteristic includes the area and center coordinates of the preset area. If the center coordinates of the screening area are consistent with the center coordinates of the preset area, and the area of ​​the screening area is consistent with the area of ​​the preset area, then the screening area is determined to meet the third preset characteristic. This embodiment does not limit the method of changing the first preset characteristic. For example, the center coordinates of the preset area can be moved, the area of ​​the preset area can be changed, or the center coordinates of the preset area can be moved and the area of ​​the preset area can be changed at the same time.

[0086] S204: The filtered area is used as the target area.

[0087] S103: Obtain the center coordinates of the target area, and determine the area where the PIN needle is located through the affine position transformation relationship.

[0088] In this embodiment, the affine position transformation relationship is a pre-set transformation relationship, and the affine position transformation relationship will change accordingly depending on the preset area. The affine position transformation relationship is established by the relative position relationship between the selected preset area and the area where the PIN pin is located.

[0089] S104: Perform threshold segmentation processing on the area where the PIN pins are located to obtain a valid PIN pin area.

[0090] This embodiment does not limit the grayscale offset parameter used for threshold segmentation of the PIN region. Any parameter that can perform threshold segmentation of the PIN region will suffice. For example, the grayscale offset parameter for threshold segmentation can be 2, 4, or any parameter between 2 and 5.

[0091] Furthermore, in order to avoid the interference of noise in the image on the detection, reduce the interference of image quality on the precise positioning detection of the PIN needle, and avoid the situation where the PIN needle offset causes the inability to accurately obtain the PIN needle edge, the above-mentioned threshold segmentation processing of the PIN needle area to obtain the effective PIN needle area can include the following steps. For details, please refer to Figure 3 , Figure 3 A flowchart of a method for obtaining a valid PIN pin area provided in an embodiment of the present invention may specifically include:

[0092] S301: Smoothing the image of the area where the PIN needle is located to obtain a second smoothed image.

[0093] S302: Performing local threshold segmentation processing on the second smoothed image according to the second threshold segmentation parameter, and extracting a second dark area as a second segmentation area.

[0094] It should be noted that after the second smoothed image is subjected to local threshold segmentation, the second dark region is extracted in order to more accurately obtain the edge of the white bright spot region of the PIN needle.

[0095] S303: Perform filling processing on the second segmented area to obtain a filled area.

[0096] S304: performing an opening operation on the filled area to obtain an opening operation processed image.

[0097] It should be noted that in this embodiment, the opening operation is performed on the filled area to eliminate the interference of burrs in the dark area. This embodiment does not limit the basis for setting the opening operation parameter; as long as it is smaller than the PIN pin characteristic area, it can be used. For example, it can be customized by the operator, or it can be set based on the size of the PIN pin characteristic area. Or, the larger the PIN pin characteristic area, the larger the opening operation parameter setting value.

[0098] S305: Performing region connection processing on the image processed by the opening operation to obtain a first valid PIN needle region.

[0099] S306: Determine whether the number of the first valid PIN pin area is less than the preset PIN pin number. If so, execute S307; if not, execute S308.

[0100] In this embodiment, the preset number of PIN pins is the actual number of existing PIN pins.

[0101] S307: reducing the second threshold segmentation parameter, performing local threshold segmentation processing on the smoothed image according to the second threshold segmentation parameter, and extracting a second dark area as a second segmentation area.

[0102] In this embodiment, if the number of the first valid PIN pin area is less than the preset number of PIN pins, the second threshold segmentation parameter is reduced.

[0103] S308: Use the first valid PIN needle area as the valid PIN needle area.

[0104] In this embodiment, if the number of the first valid PIN pin area is not less than the preset number of PIN pins, the first valid PIN pin area is used as the valid PIN pin area.

[0105] Furthermore, in order to avoid the problem of debris on the edge of the PIN pin, which may prevent the first effective PIN area from being annularly closed, and to reduce interference of the debris on detection, the above-mentioned first effective PIN pin area as the effective PIN pin area may include the following steps:

[0106] Performing a circular structure expansion operation on the first effective PIN needle area to obtain an expanded area image;

[0107] Performing dynamic threshold segmentation processing on the expanded area image to obtain a third segmented area, and performing regional connectivity processing on the third segmented area to obtain an area to be screened;

[0108] The area to be screened with a hole number of 1 is regarded as the effective PIN needle area.

[0109] This embodiment does not limit the setting value of the circular structure expansion calculation parameter for the first valid PIN pin area. For example, it can be 3.5 pixels or 4 pixels. This embodiment does not limit the basis for setting the circular structure expansion calculation parameter. For example, it can be customized by the operator or set based on the size of the PIN pin feature area. For example, the larger the PIN pin feature area, the larger the circular structure expansion calculation parameter.

[0110] It should be noted that, in this embodiment, the number of screening areas can be multiple, and this embodiment does not limit this. Generally, the number should be the same as the number of preset PIN pins.

[0111] Furthermore, in order to facilitate distinguishing the positional relationship between PIN pins, after performing the threshold segmentation process on the area where the PIN pins are located to obtain valid PIN pin areas, the method may further include: sorting the valid PIN pin areas.

[0112] This embodiment does not limit the method of sorting the valid PIN pin areas, as long as the positional relationship between different valid PIN pin areas can be distinguished. For example, the sorting can be started from left to right or from top to bottom.

[0113] S105: Detecting the PIN pins according to the number and center coordinates of the valid PIN pin areas.

[0114] It should be noted that, in this embodiment, the number of valid PIN pin areas is the number of detected PIN pins.

[0115] Furthermore, in order to improve the accuracy of locating the PIN needle and intuitively reflect the results of the PIN needle detection, the above-mentioned detection of the PIN needle according to the number and center coordinates of the effective PIN needle area can include the following steps. For details, please refer to Figure 4 , Figure 4 A flowchart of a method for detecting a PIN pin provided in an embodiment of the present invention may specifically include:

[0116] S401: Determine whether the number of valid PIN pin areas is less than the preset number of PIN pins. If so, execute S402; if not, execute S403.

[0117] S402: Determine whether the PIN is missing.

[0118] In this embodiment, if the number of valid PIN pin areas is less than the preset number of PIN pins, it is determined that the PIN pin is missing.

[0119] S403: Determine whether the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is a preset distance value. If so, execute S404; if not, execute S405.

[0120] In this embodiment, the preset distance value is the distance between the center coordinates of a valid PIN pin area and the center coordinates of an adjacent valid PIN pin area under normal circumstances.

[0121] S404: Determine whether the PIN detection is completed.

[0122] In this embodiment, if the distance between the center coordinates of a valid PIN pin area and the center coordinates of an adjacent valid PIN pin area is a preset distance value, it is determined that the PIN pin detection is completed.

[0123] S405: Determine whether the PIN pin is skewed and determine the direction of the skew.

[0124] In this embodiment, if the distance between the center coordinates of a valid PIN pin area and the center coordinates of an adjacent valid PIN pin area is not a preset distance value, it is determined that the PIN pin is skewed, and the skew direction is determined.

[0125] The PIN pin precise positioning detection method provided in an embodiment of the present invention preprocesses the acquired original image to obtain a threshold segmentation processed image. This threshold segmentation processed image is then subjected to region connectivity processing to obtain a region connectivity processing result. Regions within the region connectivity processing result that meet preset characteristics are selected as target regions, where the preset characteristics include the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset region. The center coordinates of the target region are obtained, and the PIN pin region is determined using an affine position transformation relationship, where the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target region and the PIN pin region. The PIN pin region is subjected to threshold segmentation processing to obtain a valid PIN pin region, where a valid PIN pin region is a valid region containing one PIN pin. PIN pins are detected based on the number and center coordinates of the valid PIN pin regions. The present invention preprocesses the original image, performs regional connectivity processing on the resulting threshold-segmented image, selects regions meeting preset characteristics as target regions, and uses the affine relationship between the target region and the PIN region to determine the PIN region. The PIN region is then threshold-segmented to determine the number of valid PIN regions and their coordinate centers, thereby detecting the PIN. By sequentially performing smoothing, local threshold segmentation, closing, and filling operations on the original image, noise is eliminated from the original image and blank areas in the closed image are eliminated, while also reducing the image stability requirements for precise PIN pin location detection. Re-evaluation of the selected regions improves the accuracy of target region detection. By comparing the number of valid PIN regions with the preset number of PIN pins, interference from image noise is avoided, image quality interference with precise PIN pin location detection is reduced, and the inability to accurately locate PIN pin edges due to PIN offset is avoided. This method solves the problem of confusion between PIN pins and interfering points in complex image effects, resulting in the inability to accurately locate PIN pins. This improves the accuracy and efficiency of precise PIN pin location detection and reduces detection costs.

[0126] To make the present invention easier to understand, the PIN pin precise positioning detection method in this embodiment may specifically include the following steps:

[0127] Step S1: pre-process the acquired original image:

[0128] (1) Using different smoothing parameters, the image is smoothed to obtain a first smoothed image.

[0129] (2) Using a local threshold to perform image segmentation on the first smoothed image, extracting a first dark area as a first segmentation area, wherein the use of the local threshold is to better extract edge information and reduce the requirement for image stability.

[0130] (3) The first segmented area is closed and then filled to obtain a threshold segmentation image.

[0131] (4) Performing regional connectivity processing on the threshold segmentation processed image to obtain the regional connectivity processing result.

[0132] Step S2: Preliminary positioning of the target area:

[0133] The results of regional connectivity processing are subjected to feature screening to determine the rough positioning area of ​​the target area in the PIN needle image. The preset features include the preset target area "area", "rectangularity", "inscribed length", "inscribed width", "circumscribed length", and "circumscribed width", and the rough positioning area of ​​the target area is screened out.

[0134] Step S3: relocate the target area:

[0135] The roughly located area of ​​the target region is closed, and the closed area is then filled. The closed rectangle feature parameters are determined based on the positional relationship of the preset target region. A circular structure is used for closing, and the circular structure parameter uses a value of 50 pixels. The closed area is then filled, and the filled result is connected to the region to obtain the first region. The first region is filtered, mainly based on the "circumscribed width", "circumscribed length", "inscribed width", and "inscribed length" features of the preset target region to obtain the filtered area.

[0136] The screened area is re-evaluated based on the area of ​​the preset area and the remaining center coordinates. A determination is made as to whether the preset area characteristics are met. If not, the first preset characteristics are modified, and the steps of selecting an area from the area connectivity processing result based on the first preset characteristics to obtain a first target area are performed until the screened area meets the re-evaluated characteristics. At this point, the screened area is used as the target area.

[0137] Step S4, determine the area where the PIN is located:

[0138] Obtain the center coordinates of the target area, and determine the area where the PIN is located through the affine transformation relationship established in advance between the area where the PIN is located and the target center coordinates.

[0139] Step S5, determine the valid PIN area:

[0140] (1) Smoothing the area where the PIN needle is located to obtain a second smoothed image.

[0141] (2) Perform local threshold segmentation on the second smoothed image to extract the second dark area as the second segmentation area. The grayscale value offset parameter of this threshold segmentation process should be adjusted between 2 and 5.

[0142] (3) The second segmented area is filled, and the white area and edge of the PIN needle are covered to obtain a filled area.

[0143] (4) Perform rectangular opening operation on the filled area to obtain the opening operation processed image. The opening operation parameters should refer to the size of the PIN needle white point, and the parameter setting should be smaller than the PIN needle feature spot.

[0144] (5) Performing a region connection process on the image processed by the opening operation to obtain a first valid PIN pin region. Determining whether the number of the first valid PIN pin region is less than the preset number of PIN pins. If the number of the first valid PIN pin region is less than the preset number of PIN pins, reducing the grayscale value offset in step (2) and performing a closing operation on the segmented image.

[0145] This step is to cope with the situation where the edge of the PIN point cannot be accurately obtained due to image changes and PIN needle offset, and to achieve dynamic real-time feedback adjustment.

[0146] (6) Perform a circular dilation operation on the first valid PIN pin area with a dilation parameter of 3.5. This step is to prevent debris from forming on the edge of the PIN pin, which would prevent the selected area from being circularly closed. Using a small dilation value can reduce the impact of debris, minimize the inclusion of PIN feature points in the area, and obtain an image of the dilated area after dilation.

[0147] (7) Dynamic threshold segmentation is performed on the dilated area image through local mean and standard deviation analysis. The deviation value is set to 1-2 pixels, and the segmented area is processed as a connected domain. The area with 1 hole is selected as the valid PIN needle area.

[0148] (8) Sort the valid PIN areas.

[0149] Locate the valid PIN area, obtain the number of areas and the center coordinates of the valid PIN area.

[0150] (1) PIN number detection: Get the number of valid PIN areas. If the number is less than the preset number of PINs, it is determined that the PIN is missing.

[0151] (2) Obtain the center coordinates of the effective PIN pin area, calculate the position distance between adjacent PIN pins, and determine whether the PIN pin is skewed based on the position distance between adjacent PIN pins and determine the skew direction.

[0152] The following is an introduction to a PIN pin precise positioning detection device provided by an embodiment of the present invention. The PIN pin precise positioning detection device described below and the PIN pin precise positioning detection method described above can be referenced to each other.

[0153] Please refer to Figure 5 , Figure 5 The schematic structural diagram of the PIN pin precise positioning detection device provided in an embodiment of the present invention may include:

[0154] The image preprocessing module 100 is used to preprocess the acquired original image to obtain a threshold segmentation processed image;

[0155] The target region selection module 200 is configured to perform region connectivity processing on the threshold segmentation processed image to obtain a region connectivity processing result, and select a region in the region connectivity processing result that meets preset characteristics as the target region; wherein the preset characteristics include the width, length, inscribed width, inscribed height, rectangularity, and area of ​​the preset region;

[0156] A first determination module 300 is configured to obtain the center coordinates of the target area and determine the area of ​​the PIN pin using an affine position transformation relationship; wherein the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target area and the area of ​​the PIN pin;

[0157] The valid PIN pin acquisition module 400 is configured to perform threshold segmentation processing on the PIN pin area to obtain a valid PIN pin area; wherein the valid PIN pin area is a valid area containing one PIN pin;

[0158] The positioning result determination module 500 is configured to determine the positioning result of the PIN pin according to the number and center coordinates of the valid PIN pin area.

[0159] Based on the above embodiment, the target area selection module 200 may include:

[0160] a first target region acquisition unit, configured to select a region from the region connectivity processing result according to a first preset feature to obtain a first target region; the first preset feature includes the area, the rectangularity, the inscribed length, and the inscribed width of the preset region;

[0161] A first region acquisition unit is configured to sequentially perform a closing operation and a filling operation on the first target region according to preset closing operation parameters to obtain a first region;

[0162] a screening area acquisition unit, configured to screen the first area according to a second preset feature to obtain a screening area; the second preset feature includes the circumscribed width, the circumscribed length, the inscribed length, and the inscribed width of the preset area;

[0163] The target area determination unit is configured to use the screening area as the target area.

[0164] Based on any of the above embodiments, the target area selection module 200 may further include:

[0165] a re-judgment unit, configured to re-judgment the screening area according to a third preset feature; the third preset feature including the area and the coordinates of the center point of the preset area;

[0166] Accordingly, the target area determination unit may include:

[0167] a first execution subunit, configured to use the screening area as the target area if the screening area meets the third preset characteristic;

[0168] The second execution subunit is configured to change the first preset feature if the screening area does not meet the third preset feature, and execute the step of selecting an area from the area connectivity processing result according to the first preset feature to obtain a first target area.

[0169] Based on any of the above embodiments, the image preprocessing module 100 may include:

[0170] A first smoothing processing unit, configured to perform smoothing on the original image to obtain a first smoothed image;

[0171] a first segmentation region acquisition unit, configured to perform local threshold segmentation processing on the first smoothed image according to a first threshold segmentation parameter, and extract a first dark region as a first segmentation region;

[0172] The threshold segmentation processed image acquisition unit is used to perform closing operation processing and filling processing on the first segmented area in sequence to obtain the threshold segmentation processed image.

[0173] Based on any of the above embodiments, the positioning result determination module 500 may include:

[0174] a first determining unit, configured to determine whether the number of the valid PIN pin areas is less than a preset number of PIN pins;

[0175] a first execution unit, configured to determine that the PIN is missing if yes;

[0176] a second determining unit, configured to determine, if not, whether a distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is a preset distance value;

[0177] a second execution unit, configured to determine that the PIN pin detection is completed if a distance between the center coordinates of the valid PIN pin area and the center coordinates of an adjacent valid PIN pin area is the preset distance value;

[0178] The third execution unit is configured to determine that the PIN pin is skewed and determine the skew direction if the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is not the preset distance value.

[0179] Based on any of the above embodiments, the valid PIN acquisition module 400 may include:

[0180] a second smoothing processing unit, configured to smooth the image of the area where the PIN needle is located to obtain a second smoothed image, perform local threshold segmentation on the second smoothed image according to a second threshold segmentation parameter, and extract a second dark area as a second segmented area;

[0181] an opening operation processed image acquisition unit, configured to perform a filling process on the second segmented area to obtain a filled area, and perform an opening operation on the filled area to obtain an opening operation processed image;

[0182] A first valid PIN needle area acquisition unit is configured to perform a region connectivity process on the image processed by the opening operation to obtain a first valid PIN needle area;

[0183] a third determining unit, configured to determine whether the number of the first valid PIN pin area is less than the preset number of PIN pins;

[0184] a fourth execution unit, configured to, if yes, modify the second threshold segmentation parameter, and execute the step of performing local threshold segmentation on the smoothed image according to the second threshold segmentation parameter, and extracting a second dark area as a second segmented area;

[0185] The fourth execution unit is configured to, if not, use the first valid PIN needle area as the valid PIN needle area.

[0186] Based on any of the foregoing embodiments, the fourth execution unit may include:

[0187] a circular structure expansion operation subunit, configured to perform a circular structure expansion operation on the first valid PIN needle area to obtain an expanded area image;

[0188] a subunit for obtaining an area to be screened, configured to perform dynamic threshold segmentation processing on the dilated area image to obtain a third segmented area, and perform regional connectivity processing on the third segmented area to obtain an area to be screened;

[0189] The effective PIN needle area acquisition subunit is used to take the to-be-screened area with 1 hole as the effective PIN needle area.

[0190] In the PIN pin precise positioning detection device provided by the embodiments of the present invention, the image preprocessing module 100 is configured to preprocess the acquired original image to obtain a threshold segmentation-processed image. The target region selection module 200 is configured to perform region connectivity processing on the threshold segmentation-processed image to obtain a region connectivity processing result. The region in the region connectivity processing result that meets preset characteristics is selected as the target region, where the preset characteristics include the width, length, inscribed width, inscribed height, rectangularity, and area of ​​the preset region. The first determination module 300 is configured to obtain the center coordinates of the target region and determine the PIN pin region using an affine position transformation relationship, where the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target region and the PIN pin region. The valid PIN pin acquisition module 400 is configured to perform threshold segmentation processing on the PIN pin region to obtain a valid PIN pin region, where a valid PIN pin region is a valid region containing one PIN pin. The positioning result determination module 500 is configured to determine the PIN pin positioning result based on the number and center coordinates of the valid PIN pin regions. The present invention preprocesses the original image, performs regional connectivity processing on the resulting threshold segmentation image, selects regions meeting preset characteristics as target regions, and uses the affine relationship between the target region and the PIN region to determine the PIN region. The PIN region is then threshold segmented to determine the number of valid PIN regions and their coordinate centers, thereby detecting the PIN. By sequentially performing smoothing, local threshold segmentation, closing, and filling operations on the original image, noise is eliminated from the original image, blank areas in the closed image are eliminated, and image stability requirements are reduced. Re-evaluation of the selected regions improves the accuracy of target region detection. By comparing the number of valid PIN regions with the preset number of PIN pins, interference from image noise on detection is avoided, image quality interference with precise PIN pin positioning detection is reduced, and the inability to accurately detect PIN pin edges due to PIN offset is avoided. The PIN pin positioning detection device provided by the present invention solves the problem of confusion between PIN pins and interference points in complex image effects, resulting in the inability to accurately locate PIN pins. This improves the accuracy and efficiency of PIN pin positioning detection and reduces detection costs.

[0191] The following is an introduction to a PIN pin precise positioning detection device provided by an embodiment of the present invention. The PIN pin precise positioning detection device described below and the PIN pin precise positioning detection method described above can be referenced to each other.

[0192] Please refer to Figure 6 , Figure 6 The schematic diagram of the structure of the PIN pin precise positioning detection device provided in the embodiment of the present invention may include:

[0193] Memory 10, for storing computer programs;

[0194] The processor 20 is configured to execute a computer program to implement the above-mentioned PIN needle precise positioning detection method.

[0195] The memory 10 , the processor 20 , and the communication interface 31 all communicate with each other via the communication bus 32 .

[0196] In an embodiment of the present invention, the memory 10 is used to store one or more programs. The program may include program code, and the program code includes computer operating instructions. In an embodiment of the present application, the memory 10 may store programs for implementing the following functions:

[0197] Preprocess the acquired original image to obtain a threshold segmentation processed image;

[0198] Performing region connectivity processing on the threshold segmentation processed image to obtain a region connectivity processing result, and selecting a region in the region connectivity processing result that meets preset characteristics as a target region; wherein the preset characteristics include at least one of the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset region;

[0199] Obtaining the center coordinates of the target area and determining the area where the PIN pin is located through an affine position transformation relationship; wherein the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target area and the area where the PIN pin is located;

[0200] Performing threshold segmentation processing on the area where the PIN pin is located to obtain a valid PIN pin area; wherein the valid PIN pin area is a valid area containing one PIN pin;

[0201] The PIN pins are detected according to the number and center coordinates of the valid PIN pin areas.

[0202] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function, etc.; the data storage area may store data created during use.

[0203] In addition, the memory 10 may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset or an extended set thereof. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0204] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device. The processor 20 may be a microprocessor or any conventional processor. The processor 20 may call a program stored in the memory 10.

[0205] The communication interface 31 may be an interface of a communication module, used for connecting to other devices or systems.

[0206] Of course, it needs to be explained that Figure 6 The structure shown does not constitute a limitation on the PIN needle precise positioning detection device in the embodiment of the present application. In actual applications, the PIN needle precise positioning detection device may include Figure 6 More or fewer components than shown, or combinations of certain components.

[0207] The following is an introduction to a readable storage medium provided in an embodiment of the present invention. The readable storage medium described below and the PIN needle precise positioning detection method described above can be referenced to each other.

[0208] The present invention also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned PIN needle precise positioning detection method are implemented.

[0209] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes.

[0210] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0211] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0212] Finally, it should be noted that, in this document, relationships such as first and second, etc., are used solely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0213] The above is a detailed introduction to the PIN needle precise positioning detection method, device, equipment and computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A PIN pin precise positioning detection method, characterized in that: include: Preprocess the acquired original image to obtain a threshold segmentation processed image; Performing a region connectivity process on the threshold segmentation processed image to obtain a region connectivity process result, and selecting a region in the region connectivity process result that meets preset characteristics as a target region; wherein the preset characteristics include the circumscribed width, circumscribed length, inscribed width, inscribed length, rectangularity, and area of ​​the preset region; Obtaining the center coordinates of the target area and determining the area where the PIN pin is located through an affine position transformation relationship; wherein the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target area and the area where the PIN pin is located; Performing threshold segmentation processing on the area where the PIN pin is located to obtain a valid PIN pin area; wherein the valid PIN pin area is a valid area containing one PIN pin; Detecting the PIN pins according to the number and center coordinates of the valid PIN pin areas; The performing threshold segmentation processing on the PIN pin area to obtain a valid PIN pin area includes: Smoothing the image of the area where the PIN needle is located to obtain a second smoothed image, performing local threshold segmentation on the second smoothed image according to a second threshold segmentation parameter, and extracting a second dark area as a second segmented area; Performing a filling process on the second segmented area to obtain a filled area, and performing an opening operation on the filled area to obtain an opening operation-processed image; Performing a region connectivity process on the image processed by the opening operation to obtain a first valid PIN needle region; Determining whether the number of the first valid PIN pin area is less than a preset number of PIN pins; If so, reducing the second threshold segmentation parameter, performing the step of performing local threshold segmentation on the smoothed image according to the second threshold segmentation parameter, and extracting a second dark area as a second segmentation area; If not, the first valid PIN needle area is used as the valid PIN needle area.

2. The PIN pin precise positioning detection method according to claim 1, characterized in that: The step of selecting a region that meets preset characteristics in the region connectivity processing result as a target region includes: Selecting a region from the region connectivity processing result according to a first preset feature to obtain a first target region; the first preset feature includes the area, the rectangularity, the inscribed length, and the inscribed width of the preset region; performing closing operation and filling operation on the first target area in sequence according to preset closing operation parameters to obtain a first area; Filtering the first area according to a second preset feature to obtain a filtered area; the second preset feature includes the circumscribed width, the circumscribed length, the inscribed length, and the inscribed width of the preset area; The screening area is used as the target area.

3. The PIN pin precise positioning detection method according to claim 2, characterized in that: After the first area is screened according to the second preset feature to obtain a screened area, the method further includes: Re-judging the screening area according to a third preset feature; the third preset feature includes the area and the coordinates of the center point of the preset area; Accordingly, taking the screening area as the target area includes: If the screening area meets the third preset characteristic, the screening area is used as the target area; If the screening area does not meet the third preset feature, the first preset feature is changed, and the step of selecting an area in the area connectivity processing result according to the first preset feature to obtain a first target area is performed.

4. The PIN pin precise positioning detection method according to claim 1, characterized in that: The preprocessing of the acquired original image to obtain a threshold segmentation processed image includes: Performing smoothing on the original image to obtain a first smoothed image; performing local threshold segmentation processing on the first smoothed image according to a first threshold segmentation parameter to extract a first dark region as a first segmentation region; The first segmented area is sequentially subjected to closing operation processing and filling processing to obtain the threshold segmentation processing image.

5. The PIN pin precise positioning detection method according to claim 1, characterized in that: The detecting of the PIN pins according to the number and center coordinates of the valid PIN pin areas includes: Determining whether the number of valid PIN pin areas is less than a preset number of PIN pins; If so, it is determined that the PIN is missing; If not, determining whether the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is a preset distance value; If the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is the preset distance value, determining that the PIN pin detection is completed; If the distance between the center coordinates of the valid PIN pin area and the center coordinates of the adjacent valid PIN pin area is not the preset distance value, it is determined that the PIN pin is skewed, and the skew direction is determined.

6. The PIN pin precise positioning detection method according to claim 1, characterized in that: The using the first valid PIN pin area as the valid PIN pin area includes: Performing a circular structure expansion operation on the first effective PIN needle area to obtain an expanded area image; Performing dynamic threshold segmentation processing on the expanded area image to obtain a third segmented area, and performing region connectivity processing on the third segmented area to obtain a to-be-screened area; The area to be screened with 1 hole is used as the effective PIN needle area.

7. A PIN pin precise positioning detection device, characterized in that: include: An image preprocessing module is used to preprocess the acquired original image to obtain a threshold segmentation processed image; a target region selection module, configured to perform region connectivity processing on the threshold segmentation processed image to obtain a region connectivity processing result, and select a region in the region connectivity processing result that meets preset characteristics as a target region; wherein the preset characteristics include the width, length, inscribed width, inscribed height, rectangularity, and area of ​​the preset region; a first determination module configured to obtain the center coordinates of the target area and determine the area of ​​the PIN pin through an affine position transformation relationship; wherein the affine position transformation relationship is a pre-established affine relationship between the center coordinates of the target area and the area of ​​the PIN pin; An effective PIN pin acquisition module, configured to perform threshold segmentation processing on the PIN pin area to obtain an effective PIN pin area; wherein the effective PIN pin area is an effective area containing one PIN pin; a positioning result determination module, configured to determine a positioning result of the PIN pin according to the number and center coordinates of the valid PIN pin area; The valid PIN needle acquisition module includes: a second smoothing processing unit, configured to smooth the image of the area where the PIN needle is located to obtain a second smoothed image, perform local threshold segmentation on the second smoothed image according to a second threshold segmentation parameter, and extract a second dark area as a second segmented area; an opening operation processed image acquisition unit, configured to perform a filling process on the second segmented area to obtain a filled area, and perform an opening operation on the filled area to obtain an opening operation processed image; A first valid PIN needle area acquisition unit is configured to perform a region connectivity process on the image processed by the opening operation to obtain a first valid PIN needle area; a third determining unit, configured to determine whether the number of the first valid PIN pin area is less than a preset number of PIN pins; a fourth execution unit, configured to, if yes, modify the second threshold segmentation parameter, and execute the step of performing local threshold segmentation on the smoothed image according to the second threshold segmentation parameter, and extracting a second dark area as a second segmented area; The fourth execution unit is configured to, if not, use the first valid PIN needle area as the valid PIN needle area.

8. A PIN needle precise positioning detection device, characterized in that: include: Memory for storing computer programs; A processor is configured to execute the computer program to implement the steps of the PIN needle precise positioning detection method according to any one of claims 1 to 6.

9. A readable storage medium, characterized in that The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the PIN needle precise positioning detection method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Circuit board pin detection method based on machine vision

    CN111709937A

  • Chip defect visual detection method and device

    CN114387223A