Bitmap-based detection area batch generation method
By exporting bitmaps from Gerber files and using image registration technology to generate the detection area of the PCB board, the problem of low efficiency and poor adaptability of detection area generation in the existing technology is solved, realizing efficient and accurate detection area generation and a highly adaptable detection strategy.
Patent Information
- Application Number
- CN202511106365.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-25
AI Technical Summary
Existing technologies struggle to efficiently and efficiently generate accurate inspection areas in batches for PCB board inspection, especially for pads and surface mount locations. Furthermore, they require neural network training and have high hardware requirements, making them unsuitable for adapting to variations in different PCB models.
The system selects the TS layer from the Gerber file to export the bitmap, uses the threshold extraction method to obtain the component mounting area, and uses image registration technology to align the bitmap with the actual captured image, calculates the mapping relationship, and forms an accurate detection area. It supports setting detection requirements by model group.
It enables efficient and accurate generation of inspection areas, adapts to different PCB models, improves inspection efficiency, eliminates tedious manual calibration steps, and is suitable for production line changes.
Smart Images

Figure CN121010641A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of circuit board inspection technology, specifically a method for batch generation of inspection areas based on bitmaps. Background Technology
[0002] Surface Mount Technology (SMT) has become the most common assembly method in the electronics manufacturing industry. High-quality SMT inspection is crucial for ensuring the performance and reliability of electronic products. SMT inspection primarily aims to ensure the soldering quality of components and avoid soldering defects.
[0003] Existing technology discloses a patent: a method, apparatus, electronic device, and storage medium for inspecting surface mount soldering quality (patent number: CN202311007734). This method first divides the PCB image into multiple inspection areas according to rules. Then, deep learning is used to identify these areas, identifying the surface mount components and solder. Finally, the positions of the solder pads and solder are used to determine if any abnormalities exist. This technical solution requires neural network technology to identify the areas of the image to determine the positions of the surface mount components and solder pads. Neural networks require training, placing high demands on hardware. Furthermore, the model needs to be trained every time a different PCB model is used.
[0004] The prior art discloses a patent: a method, device, system and medium for detecting micro-defects on a PCB board (patent number: CN202411984355). First, the PCB board is divided into detection areas according to graphic features. Detection blocks are obtained from the detection areas. Sub-images to be tested are obtained from the detection blocks. Then, the sub-images are converted into high-dimensional matrices and the high-dimensional matrices are input into the detection model to obtain the defect classification results. This technical solution emphasizes micro-defects and describes it as "dividing the PCB board into several test areas according to the image features of the PCB". The image features include gate array structure areas and component pin patch areas. However, it does not explain how these test areas are obtained.
[0005] The prior art also discloses a patent: a PCB board inspection method and device based on artificial intelligence (patent number: CN202510701099). First, an adaptive network is used to process the PCB image to obtain a candidate region set. Then, enhancement is performed, and feature extraction is performed on the enhanced candidate region set to obtain defect features. The defect features and position features are fused across modes to obtain fused features. Finally, the PCB board is inspected based on the fused features. This technology divides the image according to set rules. These division rules include the outer frame of the PCB board edge and multiple cutting lines within the frame. It appears to be a blind cut, rather than detection based on existing components or solder joints. The shapes of the solder pads and solder joints obtained in this way are varied and cannot utilize their own features.
[0006] To efficiently and in batches generate detection areas for components on PCBs, a bitmap-based batch generation method for detection areas has been developed. Summary of the Invention
[0007] The purpose of this invention is to provide a method for batch generation of detection regions based on bitmaps, which solves the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a method for batch generation of detection regions based on bitmaps, comprising:
[0009] Select the TS layer using the Gerber file, and then export it as a bitmap;
[0010] The component mounting area is obtained by threshold extraction in the TS layer on the bitmap. This component mounting area is the chip or pad position on the PCB board.
[0011] The bitmap is aligned with the actual captured image. The bitmap is aligned with the actual captured image, and the component mounting area is mapped to the actual captured image to form the detection area.
[0012] In this invention, the TS layer is a single-color image, and the component mounting area extraction image of the same color image is directly obtained by threshold extraction method.
[0013] In this invention, four vertices A1, A2, A3 and A4 on the bitmap are extracted and denoted as group A.
[0014] In this invention, four vertices B1, B2, B3 and B4 of the actual photograph are extracted and denoted as group B.
[0015] In this invention, the mapping relationship between points in group A and group B is calculated, and A1, A2, A3 and A4 on the bitmap are aligned one by one with B1, B2, B3 and B4 of the actual captured image.
[0016] In this invention, group A of the bitmap is aligned with group B of the actual captured image, and the position of the component mounting area mapped onto the actual captured image is the detection area.
[0017] In this invention, the actual captured image is obtained by real-time scanning or real-time capturing of the PCB board to be inspected.
[0018] In this invention, the detection area can be divided into multiple groups according to set rules or different types of components, and detection requirements can be set according to the groups.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0020] This invention, by combining bitmaps, can very accurately extract the component mounting area and determine the location area of the pads or solder pads. The area extracted from the bitmap is aligned with the real-time captured PCB diagram, and the positions of pads and components can be obtained in batches directly on the captured image to obtain the detection area. After obtaining the positions of pads and components, different types of components can be grouped according to the set rules, and different detection requirements can be set according to the group. Attached Figure Description
[0021] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "horizontal," "vertical," "top," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0024] Please see Figure 1 The present invention provides an embodiment of a method for batch generation of detection regions based on bitmaps, comprising:
[0025] Select the TS layer through the Gerber file. The Gerber file is the PCB design source file, and the TS layer is the top solder mask. Export the selected TS layer as a bitmap image.
[0026] Since the TS layer is usually presented as a single color in the bitmap (representing the open area, i.e. the area where soldering / placing components is allowed), the component mounting area can be extracted efficiently and accurately by using image thresholding technology. This area image clearly identifies all surface mount pads and component mounting positions on the PCB, forming the component mounting area.
[0027] By directly utilizing the TS layer information in the Gerber file to extract the installation area, interference from factors such as background texture, reflection, and component occlusion in the actual image is fundamentally avoided, ensuring that the boundaries of the extracted area accurately correspond to the design intent.
[0028] Image thresholding is one type of threshold extraction method; other threshold extraction methods are also possible, and the method of threshold extraction is not limited.
[0029] The actual image of the PCB is obtained through real-time scanning or image capture.
[0030] In this embodiment, an optical imaging system (the camera of the AOI device) is used to scan or photograph the PCB board to be inspected in real time, obtaining a high-resolution actual image.
[0031] The bitmap is aligned with the actual captured image. The bitmap is aligned with the actual captured image, and the component mounting area is mapped to the actual captured image to form the detection area.
[0032] Feature point extraction: Extract easily identifiable groups of feature points with spatial correspondence from the bitmap and the actual captured image.
[0033] The four corner vertices on the bitmap are denoted as group A: A1, A2, A3, A4.
[0034] The points corresponding to the four corner vertices in the actual photograph are denoted as Group B: B1, B2, B3, B4.
[0035] Then, using point pairs from groups A and B, a spatial transformation model between the two images is calculated (usually using perspective transformation or affine transformation). This model precisely describes how to map the coordinates of any point on the bitmap to the corresponding coordinates on the actual captured image.
[0036] By applying the calculated transformation model, the component mounting area image extracted from the bitmap through thresholding is mapped to the coordinate system of the actual captured image. The mapped area is the detection area, which accurately covers all the pads and component mounting positions that need to be detected on the actual PCB.
[0037] The mapped detection area can be divided into multiple logical groups according to preset rules (such as component type, package size, functional area) or the requirements of different component models. For each group, its detection requirements and parameters can be set independently to achieve a refined and differentiated detection strategy.
[0038] Based on the accurate detection area obtained by mapping, grouping by component type or region can be easily achieved, and differentiated detection standards can be set for different groups to improve the adaptability and accuracy of detection.
[0039] By automatically aligning bitmaps with actual photographs using image registration technology, the tedious steps of manually calibrating pad or component positions are eliminated, significantly improving the efficiency of generating inspection procedures, and is especially suitable for line changeover production.
[0040] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A bitmap-based detection area batch generation method, characterized in that, The method comprises the following steps: Selecting a TS layer through a Gerber file and then exporting a bitmap; Extracting a component mounting area through a threshold extraction method, the component mounting area being a patch or a pad position of the PCB board; Aligning the bitmap to an actual shooting image, wherein the bitmap is aligned to the actual shooting image, the component mounting area is calculated to have a mapping relationship with the actual shooting image, and a detection area is formed.
2. The method of claim 1, wherein, The TS layer is a single color image, and the component mounting area extraction image of the same color image is directly obtained through the threshold extraction method.
3. The bitmap-based detection area batch generation method according to any one of claims 1 or 2, characterized in that, Four vertices A1, A2, A3 and A4 on the bitmap are extracted and recorded as group A.
4. The method of claim 3, wherein, Four vertices B1, B2, B3 and B4 on the actual shooting image are extracted and recorded as group B.
5. The method of claim 4, wherein, The mapping relationship is calculated through the group A and the group B, and the A1, A2, A3 and A4 on the bitmap are aligned to the B1, B2, B3 and B4 on the actual shooting image one by one.
6. The bitmap-based detection area batch generation method according to claim 5, wherein, The group A of the bitmap is aligned to the group B of the actual shooting image, and the position of the component mounting area mapped on the actual shooting image is the detection area.
7. The bitmap-based detection area batch generation method according to claim 1, wherein, The actual shooting image is obtained through real-time scanning or real-time shooting of the PCB board to be detected.
8. The method of claim 1, wherein, The detection area can be divided into multiple groups according to the set rules or different types of components, and detection requirements are set according to the groups.
Citation Information
Patent Citations
Patch welding quality detection method and device, electronic equipment and storage medium
CN116912230A
Method, device and system for detecting microdefects of PCB (Printed Circuit Board) and medium
CN119919372A
PCB board detection method and device based on artificial intelligence
CN120213978B