Quality detection method and device of circuit board, electronic equipment and storage medium
By performing stray light removal and weighted fusion processing on the initial illumination image of the PCB board, the problem of detection accuracy caused by the different UV adhesive spraying patterns was solved, and high-precision quality inspection of the prohibited spraying areas of the PCB board was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN GEYUAN TECH CO LTD
- Filing Date
- 2026-01-16
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the spraying patterns of UV adhesives vary, which means that UV adhesive luminescent templates cannot encompass all spraying situations. This results in poor accuracy of quality inspection results for prohibited spraying areas on PCB boards, frequent false positives and false negatives, and affects production line yield and end-equipment performance.
By acquiring the initial illumination image of the circuit board to be inspected, stray light removal processing is performed, color channels are separated, weighted feature channel images are fused, and template no-spray area images are aligned to determine the target no-spray area and compare it with a preset area threshold, thus achieving high-precision quality inspection.
It effectively removes the influence of stray light, enhances the characteristics of non-sprayed areas, improves the accuracy of quality inspection of non-sprayed areas of PCB boards, and avoids false detection and missed detection caused by insufficient template generalization ability.
Smart Images

Figure CN122016867A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quality inspection and processing technology, specifically to a method, apparatus, electronic device, and storage medium for quality inspection of circuit boards. Background Technology
[0002] With the rapid development of the electronics and information industry, the integration level of printed circuit boards (PCBs) continues to increase, and the density of components is constantly rising, making the precision requirements for assembly processes increasingly stringent. UV-curable adhesives are crucial materials for fixing and insulating electronic components, and their coating quality directly affects the electrical performance and lifespan of the product. Furthermore, applying UV adhesive to prohibited areas on the PCB (such as gold fingers, test points, and connector contacts) will hinder electrical contact, affect signal transmission, interfere with testing or assembly, and lead to functional failure or decreased reliability; therefore, such application is strictly prohibited.
[0003] In related technologies, an irradiated image is obtained by irradiating a PCB board coated with UV adhesive using an ultraviolet lamp. This irradiated image is then compared with an image from a UV adhesive luminescent template to detect the PCB board's quality. However, the spraying patterns of UV adhesive vary, and in addition to restricted and mandatory spraying areas, there are also free spraying areas. The UV adhesive luminescent template cannot encompass all spraying situations, resulting in poor accuracy of the PCB board quality inspection results from these technologies. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for quality inspection of circuit boards, which can improve the accuracy of PCB board quality inspection results.
[0005] To achieve the above objectives, one embodiment of this application provides a method for quality inspection of a circuit board, including: Acquire the initial illumination image of the circuit board to be inspected under the illumination of the target light source, and acquire the template no-spray area image corresponding to the circuit board to be inspected; The initial illumination image is processed to remove stray light to obtain an illumination-corrected image, which includes the sprayed area with UV-cured adhesive and the non-sprayed area. The illumination-corrected image is processed by color channel separation to obtain multiple feature channel maps. The first weight of the sprayed area is determined according to the light source color of the target light source, and the second weight of the non-sprayed area is determined according to the circuit board color of the circuit board to be inspected. The enhanced illumination image corresponding to the initial illumination image is obtained by fusing multiple feature channel maps based on the first weight and the second weight. Based on the template no-spray area image, the target no-spray area in the enhanced illumination image is determined, and the target color light area is determined from the target no-spray area; The target color light area is compared with the preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0006] In some embodiments, stray light removal processing is performed on the initial illumination image to obtain an illumination-corrected image, including: Gaussian blurring is applied to the initial illumination image to obtain a Gaussian blurred image. The pixel ratio corresponding to each pixel is determined based on the ratio between the pixel values of the Gaussian blurred image and the initial illumination image at corresponding positions. The ratio of each pixel is compared with the preset pixel range to obtain the comparison result, and the stray light-affected area of the initial illumination image is determined based on the comparison result. A stray light removal process is performed on the stray light-affected area of the initial illumination image to obtain an illumination-corrected image.
[0007] In some embodiments, the ratio of each pixel is compared with a preset pixel range to obtain a comparison result, and the stray light-affected area of the initial illumination image is determined based on the comparison result, including: The illumination intensity of the target light source is obtained, and the first preset pixel range and the second preset pixel range are determined based on the illumination intensity. The luminous region is determined from the Gaussian blurred image. If the area of the luminous region is equal to or greater than a preset area threshold, the ratio of each pixel is compared with a first preset pixel range to obtain a first comparison result. The stray light influence area of the initial illumination image is determined based on the first comparison result. If the area of the luminous region is less than a preset area threshold, the ratio of each pixel is compared with the second preset pixel range to obtain a second comparison result, and the stray light influence area of the initial illumination image is determined based on the second comparison result.
[0008] In some embodiments, if the area of the luminescent region is less than a preset area threshold, the ratio of each pixel is compared with a second preset pixel range to obtain a second comparison result, and the stray light-affected area of the initial illumination image is determined based on the second comparison result, including: If the area of the luminous region is less than a preset area threshold, obtain the center pixel ratio corresponding to the center pixel of the luminous region and the edge pixel ratio corresponding to the edge pixel of the luminous region. Calculate the ratio difference between the center pixel ratio and the edge pixel ratio. If the ratio difference is equal to or greater than a preset ratio threshold, compare each pixel ratio with a second preset pixel range to obtain a second comparison result, and determine the stray light influence area of the initial illumination image based on the second comparison result.
[0009] In some embodiments, determining a first weight for the sprayed area based on the color of the target light source and a second weight for the non-sprayed area based on the color of the circuit board to be inspected includes: Obtain first color information characterizing the color of the target light source and the illumination intensity of the target light source; The first weight of the spraying area is determined based on the first color information and the irradiation intensity. The second color information representing the color of the circuit board to be tested is obtained, and the preset color threshold corresponding to the second color information is compared to obtain the color depth information of the second color information. The second weight of the non-sprayed area is determined based on the second color information and the color depth information.
[0010] In some embodiments, determining a target no-spray region in an enhanced illumination image based on a template no-spray region image includes: A first feature point is determined from multiple first corner points of the template spray-off area image, and a second feature point matching the features of the first feature point is determined from multiple second corner points of the enhanced illumination image. Based on the first and second feature points, align the template spray-off region image and the enhanced illumination image; The template no-spray area is determined from the template no-spray area image, and the target no-spray area of the enhanced illumination image is determined from the aligned enhanced illumination image based on the template no-spray area.
[0011] In some embodiments, the target color light region is compared with a preset region threshold to obtain the quality inspection result of the circuit board to be inspected, including: If the target color light area is equal to or greater than the preset area threshold, a quality inspection result is obtained that indicates the circuit board to be inspected is unqualified. If the target color light area is smaller than the preset area threshold, a quality inspection result indicating that the circuit board to be inspected is qualified is obtained.
[0012] To achieve the above objectives, one embodiment of this application provides a circuit board quality inspection device, comprising: The acquisition module is used to acquire the initial illumination image of the circuit board to be inspected under the illumination of the target light source, and to acquire the template no-spray area image corresponding to the circuit board to be inspected; The illumination correction image determination module is used to perform stray light removal processing on the initial illumination image to obtain an illumination correction image. The illumination correction image includes the sprayed area with UV-curable adhesive and the non-sprayed area. The weight determination module is used to perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps. It determines the first weight of the sprayed area based on the light source color of the target light source and the second weight of the non-sprayed area based on the circuit board color of the circuit board to be detected. The enhanced illumination image determination module is used to fuse multiple feature channel maps according to the first weight and the second weight to obtain the enhanced illumination image corresponding to the initial illumination image; The image alignment module is used to determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and to determine the target color light area from the target no-spray area; The target quality detection module is used to compare the target color light area with a preset area threshold to obtain the quality detection result of the circuit board to be inspected.
[0013] To achieve the above objectives, one aspect of this application provides a computer-readable storage medium storing multiple instructions adapted for loading by a processor to execute the steps in the circuit board quality inspection method provided in this application.
[0014] To achieve the above objectives, one aspect of this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the steps in the quality inspection of the circuit board provided in this application.
[0015] To achieve the above objectives, one aspect of this application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the circuit board quality inspection method provided in this application.
[0016] The circuit board quality inspection method, apparatus, electronic device, and storage medium proposed in this application acquire an initial illumination image of the circuit board to be inspected under the illumination of a target light source, and acquire an image of the template no-spray area corresponding to the circuit board to be inspected; perform stray light removal processing on the initial illumination image to obtain an illumination correction image, which includes a sprayed area with photocurable adhesive and a non-sprayed area; perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps; determine a first weight for the sprayed area based on the light source color of the target light source, and determine a second weight for the non-sprayed area based on the circuit board color of the circuit board to be inspected; fuse the multiple feature channel maps according to the first weight and the second weight to obtain an enhanced illumination image corresponding to the initial illumination image; determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and determine the target color light area from the target no-spray area; compare the target color light area with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0017] This application embodiment removes stray light from the initial illumination image and performs multi-channel fusion processing based on weighted settings for light source color and circuit board color. This results in an image that removes stray light and significantly enhances the features of non-sprayed areas, effectively overcoming the problems of low contrast between the no-spray area and the background, and the obscuring of regional information on the circuit board. Next, the enhanced image is aligned using the template no-spray area image to identify the target no-spray area in the enhanced illumination image. Then, the presence of a target color light representing excess adhesive in the target no-spray area is checked, and the target color light area is compared with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected. This application embodiment does not rely on a fixed UV adhesive luminescent template, and therefore is unaffected by changes in the shape of the freely sprayed area. Furthermore, by removing stray light and enhancing the features of the no-spray area, it achieves high-precision identification of mis-spraying defects in the no-spray area of the PCB board, thereby improving the accuracy of the quality inspection results for the no-spray area of the PCB board.
[0018] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the system framework corresponding to the circuit board quality inspection method provided in the embodiments of this application; Figure 2 This is a schematic flowchart of the circuit board quality inspection method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the module structure of the circuit board quality inspection device provided in this application embodiment; Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] It should be noted that in all specific embodiments of this application, when it is necessary to obtain the initial illumination image of the circuit board to be tested, permission or consent from the relevant personnel managing the circuit board to be tested will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. In addition, when this application embodiment needs to obtain sensitive personal information of relevant personnel, separate permission or consent from the relevant personnel will be obtained through pop-up windows or redirection to a confirmation page. Only after obtaining the separate permission or consent of the relevant personnel will the necessary initial illumination image for the normal operation of this application embodiment be obtained. Other data obtained in this application embodiment are all authorized and legal data, and will not be described in detail here.
[0023] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, programmable consumer computer devices, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0024] The technical problems existing in the related technologies are as follows: With the rapid development of the electronics and information industry, the integration level of PCB boards continues to increase, and the density of components is constantly rising, making the precision requirements for assembly processes increasingly stringent. UV adhesive is an important material for fixing and insulating electronic components, and its coating quality is directly related to the electrical performance and lifespan of the product. Furthermore, if UV adhesive is applied to prohibited areas on the PCB board (such as gold fingers, test points, connector contacts, etc.), it will hinder electrical contact, affect signal transmission, interfere with testing or assembly, leading to functional failure or decreased reliability; therefore, its application is strictly prohibited.
[0025] In related technologies, an irradiated image is obtained by irradiating a PCB board coated with UV adhesive using an ultraviolet lamp. This irradiated image is then compared with an image from a UV adhesive luminescent template to detect the quality of the PCB board. However, the spraying patterns of UV adhesive vary, and in addition to restricted and mandatory spraying areas, there are also free spraying areas. The UV adhesive luminescent template cannot encompass all spraying situations, resulting in poor accuracy of the quality detection results for restricted spraying areas of the PCB board.
[0026] For example, users perform online quality inspections on complex PCBs such as high-density communication motherboards, automotive electronic control units, or smartphone motherboards. Specifically, they need to determine in real time, based on ultraviolet (UV) irradiation images, whether critical restricted areas such as gold fingers, test pads, or connector contacts have been misapplied with UV adhesive. However, traditional methods rely on matching a pre-constructed UV adhesive luminescent template with the overall board image. In actual production, the morphology of UV adhesive in freely sprayed areas (such as non-critical structural areas) is highly variable—it may appear as dots, lines, diffuse patterns, or irregular accumulations due to nozzle blockage. This means that fixed templates cannot cover all legitimate spraying scenarios. When the detection device compares an image containing legitimate freely sprayed areas with an idealized template, it is highly likely to misjudge normal areas as defects or overlook actual adhesive overflow in restricted areas due to template mismatch. This misdetection and missed detection caused by insufficient template generalization not only reduces the accuracy of production line yield assessment but may also lead to defective products flowing into subsequent processes, causing poor contact, signal attenuation, or even functional failure in terminal equipment.
[0027] The circuit board quality inspection method, apparatus, electronic device, and storage medium proposed in this application acquire an initial illumination image of the circuit board to be inspected under the illumination of a target light source, and acquire an image of the template no-spray area corresponding to the circuit board to be inspected; perform stray light removal processing on the initial illumination image to obtain an illumination correction image, which includes a sprayed area with photocurable adhesive and a non-sprayed area; perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps; determine a first weight for the sprayed area based on the light source color of the target light source, and determine a second weight for the non-sprayed area based on the circuit board color of the circuit board to be inspected; fuse the multiple feature channel maps according to the first weight and the second weight to obtain an enhanced illumination image corresponding to the initial illumination image; determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and determine the target color light area from the target no-spray area; compare the target color light area with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0028] This application embodiment removes stray light from the initial illumination image and performs multi-channel fusion processing based on weighted settings for light source color and circuit board color. This results in an image that removes stray light and significantly enhances the features of non-sprayed areas, effectively overcoming the problems of low contrast between the no-spray area and the background, and the obscuring of regional information on the circuit board. Next, the enhanced image is aligned using the template no-spray area image to identify the target no-spray area in the enhanced illumination image. Then, the presence of a target color light representing excess adhesive in the target no-spray area is checked, and the target color light area is compared with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected. This application embodiment does not rely on a fixed UV adhesive luminescent template, and therefore is unaffected by changes in the shape of the freely sprayed area. Furthermore, by removing stray light and enhancing the features of the no-spray area, it achieves high-precision identification of mis-spraying defects in the no-spray area of the PCB board, thereby improving the accuracy of the quality inspection results for the no-spray area of the PCB board.
[0029] The specific details regarding the circuit board quality inspection method, apparatus, electronic device, and storage medium provided in the embodiments of this application will be described in detail below.
[0030] Please see Figure 1 , Figure 1 This is a schematic diagram of the system framework corresponding to the circuit board quality inspection method provided in this application embodiment. The circuit board quality inspection method provided in this application embodiment can be applied to this system framework.
[0031] It includes terminal 140, Internet 130, gateway 120, server 110, etc.
[0032] Terminal 140 or server 110 can be a device for performing quality inspection methods on circuit boards.
[0033] Terminal 140 includes, but is not limited to, mobile phones, tablets, computers, and intelligent computing centers. Terminal 140 can be a single device or a collection of multiple devices. For example, multiple computers can be interconnected via a local area network, sharing a single monitor to work collaboratively, thus forming a terminal 140. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.
[0034] Server 110 refers to a computer system that can provide certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0035] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.
[0036] The embodiments of this application can be applied to various scenarios, such as automotive electronics-related PCB boards, aerospace-related PCB boards, and communication-related PCB boards. This is only an example and does not mean that the embodiments of this application limit the application scenarios of the circuit board quality inspection method.
[0037] Next, we will describe it from the perspective of circuit board quality inspection equipment, such as... Figure 2 As shown, Figure 2 This is a schematic flowchart of a circuit board quality inspection method provided in an embodiment of this application. The circuit board quality inspection method is applied to a circuit board quality inspection device. Figure 2 The method may include, but is not limited to, the following steps 210 to 260. When the circuit board quality inspection device executes the circuit board quality inspection method, the specific process is as follows. It should be noted that this embodiment... Figure 2 The order of steps 210 to 260 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0038] Step 210: Obtain the initial illumination image of the circuit board to be tested under the illumination of the target light source, and obtain the template no-spray area image corresponding to the circuit board to be tested; Step 220: Perform stray light removal processing on the initial illumination image to obtain an illumination-corrected image. The illumination-corrected image includes the sprayed area with UV-curable adhesive and the non-sprayed area. Step 230: Perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps. Determine the first weight of the sprayed area based on the light source color of the target light source, and determine the second weight of the non-sprayed area based on the circuit board color of the circuit board to be detected. Step 240: Fuse multiple feature channel maps according to the first weight and the second weight to obtain the enhanced illumination image corresponding to the initial illumination image; Step 250: Determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and determine the target color light area from the target no-spray area; Step 260: Compare the target color light area with the preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0039] Steps 210 to 260 are described in detail below.
[0040] In step 210, the initial illumination image of the circuit board to be tested under the illumination of the target light source is obtained, and the template no-spray area image corresponding to the circuit board to be tested is obtained.
[0041] The circuit board to be inspected refers to the printed circuit board (PCB) that requires quality inspection, whose surface has been coated with ultraviolet-cured adhesive (UV adhesive) according to process requirements. The PCB includes three types of areas: (1) UV adhesive must be sprayed on the sprayed area for fixing and insulating electronic components; (2) No-spraying areas where UV adhesive is prohibited. Key components such as gold fingers, test points, and connector contacts are usually located in these areas. (3) The blank area between the two does not affect the overall function of the PCB board if there is UV glue in this area.
[0042] It should be noted that no-spray areas are specific areas that must be deliberately avoided from being covered by protective coatings such as conformal coatings. The core purpose is to ensure that the original function of these areas is not affected. For example, some areas with sensitive and precision components may have their performance affected after being coated with UV adhesive. These areas are usually determined during the PCB design phase. For instance, in applications such as 5G communication equipment and new energy vehicle electronic control systems, there can be hundreds of no-spray areas on a single PCB, with the smallest no-spray area being only 0.2 mm × 0.2 mm.
[0043] The target light source refers to a dedicated light source used to excite the UV adhesive to produce visible fluorescence, which is typically ultraviolet light with a wavelength in the range of 365 nanometers (nm) or 395 nm. Under the illumination of this target light source, the area coated with UV adhesive will emit visible fluorescence of a specific color, usually blue, while the uncoated area will either not emit any light or will show a faint brightness due to stray light.
[0044] The initial illumination image refers to the original fluorescence image of the circuit board under inspection, captured by a camera under the illumination of the target light source. The original fluorescence image contains the effective signal light generated by the UV adhesive fluorescence and the stray light generated by the effective signal light. The stray light can interfere with the quality inspection of the PCB board.
[0045] The template no-spray area image refers to a standard no-spray area reference image or mask that matches the model of the PCB to be tested. It accurately marks all areas on the PCB of that model where UV adhesive is prohibited from being sprayed.
[0046] In step 220, stray light removal processing is performed on the initial illumination image to obtain an illumination-corrected image, which includes the sprayed area with UV-cured adhesive and the non-sprayed area.
[0047] In some embodiments, stray light in the initial illumination image is removed. Because the UV-curable adhesive itself has extremely high brightness under UV light, it easily reflects off adjacent non-coated components or substrates, forming stray light and causing the overall image to be overwhelmed by uneven illumination, thus obscuring the effective information light. This embodiment obtains an illumination-corrected image by correcting the image light. In the illumination-corrected image, the coated areas with UV-curable adhesive emit effective information light, while the non-coated areas revert to a dark background after stray light removal. Thus, the illumination-corrected image not only improves the contrast between coated and non-coated areas but also allows subsequent color channel separation, weighted fusion, and backsplash defect detection to be based on a clear and reliable base image, laying the foundation for subsequent PCB backsplash quality inspection.
[0048] In some embodiments, stray light removal processing is performed on the initial illumination image to obtain an illumination-corrected image, including: (1.1) Gaussian blurring is performed on the initial illumination image to obtain a Gaussian blurred image, and the pixel ratio corresponding to each pixel is determined according to the ratio between the pixel values of the Gaussian blurred image and the initial illumination image at the corresponding positions. (1.2) Compare the ratio of each pixel with the preset pixel range to obtain the comparison result, and determine the stray light influence area of the initial illumination image based on the comparison result; (1.3) Perform stray light removal processing on the stray light-affected area of the initial illumination image to obtain the illumination-corrected image.
[0049] In some embodiments, Gaussian blurring is an image smoothing technique that effectively filters out high-frequency details in an image by weighted averaging of the pixel values of each pixel in the initial illumination image and its neighborhood, generating a Gaussian blurred image that retains only slowly changing background illumination information. Subsequently, the device calculates the ratio between the pixel values of the initial illumination image and the Gaussian blurred image at corresponding positions pixel by pixel to obtain the pixel ratio corresponding to each pixel.
[0050] Furthermore, the calculated pixel ratios are filtered to define the area requiring illumination correction. Specifically, the pixel ratio of each pixel is compared with a preset pixel range. Pixels with pixel ratios falling within this preset range are identified and categorized as stray light affected areas; pixels with pixel ratios exceeding the preset range are categorized as effective information light areas; and pixels with pixel ratios below the preset range are categorized as background areas.
[0051] Furthermore, the stray light-affected area refers to the region that should not emit light but emits a faint glow due to the reflection of some light by the effective information light. Since some restricted areas are very small, and there may be residual UV adhesive on these small restricted areas, the stray light emitted from the stray light-affected area will affect the subsequent identification of the UV adhesive on the restricted areas. Therefore, it is necessary to remove stray light from the stray light-affected area in the initial illumination image to obtain an illumination-corrected image. The stray light-affected area is adjacent to the spraying area and is usually hollow.
[0052] Understandably, compared to the global illumination correction methods used in traditional methods, the embodiments of this application adopt a strategy of identification before processing, and only perform stray light removal processing on the determined stray light affected areas. This effectively eliminates the interference of local overexposure or underexposure and other illumination artifacts on subsequent detection, while preserving the original details and features of the unaffected areas in the image to the greatest extent, and avoiding the destruction of information in the effective light area.
[0053] In some embodiments, the ratio of each pixel is compared with a preset pixel range to obtain a comparison result, and the stray light-affected area of the initial illumination image is determined based on the comparison result, including: (1.2.1) Obtain the illumination intensity of the target light source, and determine the first preset pixel range and the second preset pixel range based on the illumination intensity; (1.2.2) Determine the luminous region from the Gaussian blurred image. If the area of the luminous region is equal to or greater than the preset area threshold, compare the ratio of each pixel with the first preset pixel range to obtain the first comparison result, and determine the stray light influence area of the initial illumination image based on the first comparison result. (1.2.3) If the area of the luminous region is less than the preset area threshold, the ratio of each pixel is compared with the second preset pixel range to obtain the second comparison result, and the stray light influence area of the initial illumination image is determined according to the second comparison result.
[0054] In some embodiments, during the process of determining the stray light-affected area, stray light emitted from a large area of UV adhesive in the main spraying area can easily be confused with the effective information light emitted from a small area of UV adhesive in other areas. For example, a spraying area has an area of S1, which is sprayed with a large amount of UV adhesive, and a restricted spraying area has an area of S2, which contains a small amount of accidentally sprayed UV adhesive. S1 is five times larger than S2. The large amount of UV adhesive in the spraying area emits bright effective information light L1, and stray light generated by this effective information light L1 exists around the spraying area. The small amount of accidentally sprayed UV adhesive in the restricted spraying area emits dimmer effective information light L2. When the intensity of L1 is very high, the dimmer effective information light L2 can easily be confused with the stray light generated by L1. It should be noted that other areas can be spraying areas, restricted spraying areas, or areas in between. This is only an example and does not mean that other areas are necessarily restricted spraying areas.
[0055] Furthermore, in order to avoid the accidental removal of valid information existing in other areas, two preset pixel ranges and a second preset pixel range are set for comparison, with the first preset pixel range being larger than the second preset pixel range.
[0056] Furthermore, the luminescent region is determined from the Gaussian blurred image. The luminescent region refers to the area on the PCB board that is actually coated with UV adhesive and illuminates when excited by an ultraviolet light source. Next, the device evaluates whether the area of this luminescent region exceeds a preset area threshold and takes different actions accordingly. (1) If the area of the light-emitting region is equal to or greater than the preset area threshold, it means that there is a large area of UV glue on the PCB board, which may lead to a wider stray light influence. In this case, the ratio of each pixel is compared with the first preset pixel range to obtain the first comparison result, and the stray light influence area of the initial illumination image is more accurately delineated based on the first comparison result. (2) If the area of the luminescent region is less than the preset area threshold, it means that the region may be a stray light affected area or a region sprayed with UV glue. In this case, the ratio of each pixel is compared with the second preset pixel range to obtain the second comparison result, and the stray light affected area of the initial illumination image is determined according to the second comparison result.
[0057] It is understood that the embodiments of this application use different preset pixel ranges for comparison for different luminous area sizes. This can avoid misjudging the effective information light emitted by UV adhesive in other small areas as stray light due to the use of a uniform preset pixel range, which would lead to errors in defining the stray light-affected area and thus improve the accuracy of determining the stray light-affected area.
[0058] In some embodiments, if the area of the luminescent region is less than a preset area threshold, the ratio of each pixel is compared with a second preset pixel range to obtain a second comparison result, and the stray light-affected area of the initial illumination image is determined based on the second comparison result, including: (1.2.3.1) If the area of the luminous region is less than the preset area threshold, obtain the center pixel ratio corresponding to the center pixel of the luminous region and the edge pixel ratio corresponding to the edge pixel of the luminous region. (1.2.3.2) Calculate the ratio difference between the center pixel ratio and the edge pixel ratio. If the ratio difference is equal to or greater than the preset ratio threshold, compare each pixel ratio with the second preset pixel range to obtain the second comparison result, and determine the stray light influence area of the initial illumination image based on the second comparison result.
[0059] In some embodiments, the difference between the ratio of the center pixel ratio and the edge pixel ratio of the luminous region will be calculated to more accurately determine whether the luminous source of the luminous region with an area smaller than a preset area threshold is UV glue or stray light, thereby reducing unnecessary stray light image region determination.
[0060] Furthermore, when the PCB board is not thoroughly cleaned, a small amount of grease may remain on the surface. This can cause this area to better reflect the effective information light generated by the UV adhesive under ultraviolet light, but the light displayed in this area is not actually effective information light. Since this area does not have self-emissive properties, the displayed light in this area should be relatively uniform; that is, the pixel ratio of the pixels at the center of the luminous area to the pixels at the edge of the area should be similar.
[0061] Furthermore, if the area of the luminous region is less than a preset area threshold, it is further determined whether the luminous source of the luminous region is UV glue: First, the center pixel ratio corresponding to the center pixel of the luminous region and the edge pixel ratio corresponding to the edge pixel of the luminous region are obtained; if the difference between the two ratios is equal to or exceeds the preset ratio threshold, it indicates that the center brightness of the luminous region is greater than the edge brightness, and it is highly likely that the region has been mistakenly sprayed with UV glue; then, each pixel ratio is compared with a second preset pixel range to obtain a second comparison result; based on the prediction that the luminous region is a region that has been mistakenly sprayed with UV glue, the stray light-affected region is further determined from the region according to the second comparison result; otherwise, if the difference between the two ratios is less than the preset ratio threshold, it indicates that the region as a whole has no effective information light, and this part of the region can be directly identified as a pure noise region, thereby determining the stray light-affected region based on this region, so as to reduce the waste of computing resources.
[0062] In step 230, the illumination correction image is processed by color channel separation to obtain multiple feature channel maps. The first weight of the sprayed area is determined according to the light source color of the target light source, and the second weight of the non-sprayed area is determined according to the circuit board color of the circuit board to be detected.
[0063] In some embodiments, to highlight the features of the no-spray zone hidden in dark areas, the illumination-corrected image is subjected to color channel separation processing to obtain multiple independent feature channel maps. For example, it is decomposed into three channel maps in the RGB color space: red (R), green (G), and blue (B). Subsequently, based on the color of the light source (e.g., blue) that appears after the photocurable adhesive is excited by the target light source (e.g., ultraviolet light), the first weight of the channel corresponding to the sprayed area (e.g., the B channel) is determined. At the same time, based on the circuit board color (e.g., green) of the circuit board itself, the second weight of the channel with the most obvious features in the non-sprayed area (e.g., the G channel) is determined, so that during subsequent image fusion, information from different channels can be selectively enhanced or suppressed according to the first and second weights.
[0064] In some embodiments, determining a first weight for the sprayed area based on the color of the target light source and a second weight for the non-sprayed area based on the color of the circuit board to be inspected includes: (2.1) Obtain the first color information characterizing the color of the target light source and the illumination intensity of the target light source; (2.2) Determine the first weight of the spraying area based on the first color information and the irradiation intensity; (2.3) Obtain the second color information that represents the color of the circuit board to be tested, and compare it with the preset color threshold corresponding to the second color information to obtain the color depth information of the second color information; (2.4) Determine the second weight of the non-sprayed area based on the second color information and the color depth information.
[0065] The first color information refers to the primary hue characteristic used to characterize the visible fluorescence produced by the target light source after exciting the UV adhesive. It is typically expressed in RGB, HSV, or CIE chromaticity coordinates. For example, under 365nm ultraviolet light irradiation, the fluorescence emitted by a typical UV adhesive is concentrated in the blue band. Its first color information can be quantified as the high B channel component of the RGB value, used to identify the typical emission color of the sprayed area. Irradiation intensity refers to the light intensity of the target light source when irradiating the circuit board under test.
[0066] Furthermore, since UV adhesive emits light with a fixed hue and whose intensity is positively correlated with the illumination intensity under a specific light source (target light source), the first color information and the illumination intensity can be jointly mapped to a weighted coefficient to obtain the first weight. The first weight includes the weight corresponding to each channel, which is essentially a weight reassembly. For example, when a high value of the B channel component in the first color information of a certain region is detected, the B channel weight corresponding to the first weight is high, and the illumination intensity is used to assist in adjusting the first weight.
[0067] For example, under 365nm ultraviolet light, UV adhesive typically emits fluorescence primarily in blue. Assuming the average color of a sprayed area in the initial illumination image is R=40, G=60, and B=210, its first color information shows that the B channel is significantly higher than the R and G channels. Simultaneously, the measured illumination intensity of this area (represented by the average B channel value) is 210, indicating a strong fluorescence response. Based on this, a dynamic first weighting of the three channels is generated: since the B channel best represents the true luminescent characteristics of the UV adhesive, it is given a higher weight (e.g., w_B=0.9); while the R and G channels, mainly containing noise or stray components, have their weights suppressed (e.g., w_R=0.2, w_G=0.3). Furthermore, if the irradiation intensity is increased (e.g., B increases from 210 to 240), it indicates a stronger fluorescence signal and a higher signal-to-noise ratio. The system can appropriately increase the weight of the B channel to 0.95 and slightly increase the weight of the G channel to preserve edge details. Conversely, if the irradiation intensity is weak (e.g., B=120), even if B remains the highest channel, the overall weight will be reduced (e.g., w_B=0.7) to avoid amplifying noise. Through this color-dominated, intensity-modulated mechanism, the first weight can adaptively highlight reliable channel information in the real UV adhesive region, providing precise guidance for subsequent multi-channel fusion.
[0068] The second color information refers to the optical characteristics used to characterize the color of the substrate or non-coated surface area of the circuit board under test. It is usually obtained by collecting the average RGB values of the area unaffected by UV adhesive. For example, a common PCB board is dark green, and its second color information may be (R:20, G:80, B:30). The second color information is used to help distinguish the base color of the non-coated area from that of the coated area.
[0069] Color depth information refers to the brightness judgment obtained by comparing the second color information with a preset color threshold (such as a brightness threshold Y=80). Color depth information is used to quantify the color depth attributes of non-sprayed areas. Dark areas absorb more light and have less background interference, while light areas are more susceptible to reflection.
[0070] Furthermore, a second weight for the non-painted area is determined based on the second color information and the color depth information. For example, the substrate of a PCB board to be tested is a common dark green solder mask. The second color value of its non-sprayed area under visible light is (R:30, G:85, B:40). This second color information indicates that the green channel feature is dominant. Further calculation of its color depth information is performed, assuming that the color depth information corresponding to the second color information is "dark". Since the dark substrate has strong absorption of ultraviolet stray light and little background interference, and the G channel can best reflect its background texture and edge features, a higher weight is assigned to the G channel (e.g., w_G=0.85). At the same time, because the overall reflectivity is low, the R and B channels are easily affected by noise, so they are given lower weights (w_R=0.3, w_B=0.25). If another PCB board uses a light green substrate (Y≈110, judged as "light color"), although G is still dominant, the G weight will be appropriately reduced (e.g., 0.65) and R / B will be slightly increased to enhance edge contrast due to the strong surface reflection. Therefore, the second weight dynamically adjusts the contribution of each channel to the enhancement of features in the non-sprayed area by combining the channel distribution of the second color information with the brightness attribute of the color depth information, so as to ensure that the outline of the no-spray area can be effectively highlighted under different panel colors.
[0071] In step 240, multiple feature channel maps are fused according to the first weight and the second weight to obtain the enhanced illumination image corresponding to the initial illumination image.
[0072] In some embodiments, a multi-channel fusion operation is performed based on a first weight and a second weight to obtain an enhanced illumination image. This weighted fusion strategy reduces the channel weights representing information about the photocurable adhesive while increasing the channel weights representing information about the circuit board substrate and components. The enhanced illumination image exhibits the following: the originally bright sprayed areas are suppressed, while the originally dark and blurry non-sprayed areas (including no-spray areas) show significantly enhanced and highlighted details such as contours and textures.
[0073] In step 250, the target no-spray area in the enhanced illumination image is determined based on the template no-spray area image, and the target color light area is determined from the target no-spray area.
[0074] In some embodiments, the acquired template no-spray area image is used as a reference to perform precise image registration and positioning on the enhanced illumination image, thereby accurately identifying and defining the target no-spray area in the enhanced illumination image. The target no-spray area is the no-spray area at the actual physical location on the circuit board to be inspected; then, a search is performed only within the located target no-spray area to determine whether a target color light area exists. The target color light area refers to a pixel area with the fluorescent color characteristics (such as blue) of the photocurable adhesive appearing within the no-spray area, so that the quality inspection result of the PCB board can be determined subsequently based on the target color light area.
[0075] In some embodiments, determining a target no-spray region in an enhanced illumination image based on a template no-spray region image includes: (3.1) Determine a first feature point from multiple first corner points of the template spray-free area image, and determine a second feature point that matches the features of the first feature point from multiple second corner points of the enhanced illumination image; (3.2) Align the template spray-off area image and the enhanced illumination image based on the first feature point and the second feature point; (3.3) Determine the template no-spray area from the template no-spray area image, and determine the target no-spray area of the enhanced illumination image from the aligned enhanced illumination image based on the template no-spray area.
[0076] In some embodiments, registration between the image under test and the standard template is performed based on feature points. First, multiple first corner points with high stability and discriminative power are extracted from a pre-stored template no-spray area image, and the most suitable first feature points for matching are selected from them. Simultaneously, multiple second corner points are extracted from the enhanced illumination image after feature enhancement processing. Among these second corner points, a feature description and matching algorithm is used to search for and determine second feature points that match the first feature points in terms of features. The first and second feature points constitute feature matching pairs, representing points at the same physical location on the standard template and the circuit board under test, respectively.
[0077] Furthermore, image alignment is performed using feature matching pairs. Specifically, based on the correspondence between the first and second feature points, a geometric transformation matrix is calculated that describes the spatial transformation (including rotation, translation, scaling, and perspective distortion) between the two images. Subsequently, this transformation matrix is applied to perform geometric correction on the template-in-place area image and the enhanced illumination image, thereby aligning the template-in-place area image and the enhanced illumination image in space.
[0078] Furthermore, after image alignment is completed, the target no-spray region is located from the enhanced illumination image. First, the precise coordinates and contour of the template no-spray region, which serves as the reference, are obtained from the template no-spray region image. Since the two images have been aligned, the region in the enhanced illumination image that is aligned with the template no-spray region can be directly identified as the target no-spray region.
[0079] In step 260, the target color light area is compared with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0080] In some embodiments, the detection results are quantitatively determined. The area or number of pixels of the target color light region found within the target no-spray area is compared with a preset area threshold. The preset area threshold represents the maximum tolerable adhesive overflow area of the PCB board, set according to process standards and product quality requirements.
[0081] It should be noted that the preset area threshold can be 0 or other values, and the specific setting depends on the actual situation. This application embodiment does not impose any restrictions on this.
[0082] It is understood that this application embodiment, by performing stray light removal on the initial illumination image and performing multi-channel feature fusion based on weighted settings of light source color and circuit board color, generates an enhanced illumination image with significantly enhanced features of the non-sprayed area. This fundamentally solves the technical problem of low contrast and difficulty in identification of the no-spray area in the original image due to factors such as uneven illumination and substrate reflection. Simultaneously, this application embodiment changes the detection logic from "comparing sprayed areas of varying shapes" to "searching for excess adhesive within a fixed-position no-spray area." That is, it precisely registers and locates the no-spray area image on the enhanced image, and then inspects the interior of the target no-spray area. This application embodiment makes detection no longer limited to the legal variations (such as stringing or blurring) of UV-cured adhesive in the mandatory or free-spraying areas. Finally, a conclusion is drawn through quantitative comparison with a preset area threshold, greatly improving the accuracy, robustness, and adaptability to complex spraying conditions. This effectively solves the problem of poor detection accuracy caused by the inability of the UV adhesive luminescent template to encompass all spraying situations in related technologies.
[0083] In some embodiments, the target color light region is compared with a preset region threshold to obtain the quality inspection result of the circuit board to be inspected, including: (4.1) If the target color light area is equal to or greater than the preset area threshold, the quality inspection result representing the non-conformity of the circuit board to be inspected is obtained; (4.2) If the target color light area is smaller than the preset area threshold, the quality test result indicating that the circuit board to be tested is qualified is obtained.
[0084] In some embodiments, when the area or number of pixels of the target color light region detected within the target no-spray area is calculated to be equal to or greater than a preset area threshold, it is determined that the amount of photocurable adhesive overflow in the no-spray area of the circuit board under test has exceeded the allowable range of the quality standard and is unqualified. If the area of the detected target color light region is less than the preset area threshold, it means two situations: first, no trace of photocurable adhesive is detected at all within the target no-spray area, i.e., no overflow has occurred; second, there is an extremely small amount of overflow in the no-spray area, but its area is within the tolerance range allowed by the process standard; therefore, it is determined that this indicator of the circuit board under test meets the quality requirements and is qualified.
[0085] It is understood that the embodiments of this application eliminate the risk of misjudgment and omission caused by individual differences, visual fatigue and different subjective judgment standards in manual visual inspection by comparing the actual measured target color light area with the preset area threshold, which greatly improves the efficiency and reliability of PCB board inspection.
[0086] like Figure 3 As shown, Figure 3 This is a schematic diagram of the module structure of the circuit board quality inspection device 300 provided in this application embodiment. The circuit board quality inspection device 300 may include the following modules 310 to 360: The acquisition module 310 is used to acquire the initial illumination image of the circuit board to be inspected under the illumination of the target light source, and to acquire the template no-spray area image corresponding to the circuit board to be inspected. The illumination correction image determination module 320 is used to perform stray light removal processing on the initial illumination image to obtain an illumination correction image. The illumination correction image includes a sprayed area with UV-curable adhesive and a non-sprayed area. The weight determination module 330 is used to perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps, determine the first weight of the sprayed area based on the light source color of the target light source, and determine the second weight of the non-sprayed area based on the circuit board color of the circuit board to be detected. The enhanced illumination image determination module 340 is used to fuse multiple feature channel maps according to the first weight and the second weight to obtain the enhanced illumination image corresponding to the initial illumination image; The image alignment module 350 is used to determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and to determine the target color light area from the target no-spray area; The target quality detection module 360 is used to compare the target color light area with the preset area threshold to obtain the quality detection result of the circuit board to be tested.
[0087] In some embodiments, the illumination correction image determination module 320 is used for: Gaussian blurring is applied to the initial illumination image to obtain a Gaussian blurred image. The pixel ratio corresponding to each pixel is determined based on the ratio between the pixel values of the Gaussian blurred image and the initial illumination image at corresponding positions. The ratio of each pixel is compared with the preset pixel range to obtain the comparison result, and the stray light-affected area of the initial illumination image is determined based on the comparison result. A stray light removal process is performed on the stray light-affected area of the initial illumination image to obtain an illumination-corrected image.
[0088] In some embodiments, the illumination correction image determination module 320 is further configured to: The illumination intensity of the target light source is obtained, and the first preset pixel range and the second preset pixel range are determined based on the illumination intensity. The luminous region is determined from the Gaussian blurred image. If the area of the luminous region is equal to or greater than a preset area threshold, the ratio of each pixel is compared with a first preset pixel range to obtain a first comparison result. The stray light influence area of the initial illumination image is determined based on the first comparison result. If the area of the luminous region is less than a preset area threshold, the ratio of each pixel is compared with the second preset pixel range to obtain a second comparison result, and the stray light influence area of the initial illumination image is determined based on the second comparison result.
[0089] In some embodiments, the illumination correction image determination module 320 is further configured to: If the area of the luminous region is less than a preset area threshold, obtain the center pixel ratio corresponding to the center pixel of the luminous region and the edge pixel ratio corresponding to the edge pixel of the luminous region. Calculate the ratio difference between the center pixel ratio and the edge pixel ratio. If the ratio difference is equal to or greater than a preset ratio threshold, compare each pixel ratio with a second preset pixel range to obtain a second comparison result, and determine the stray light influence area of the initial illumination image based on the second comparison result.
[0090] In some embodiments, the weight determination module 330 is used for: Obtain first color information characterizing the color of the target light source and the illumination intensity of the target light source; The first weight of the spraying area is determined based on the first color information and the irradiation intensity. The second color information representing the color of the circuit board to be tested is obtained, and the preset color threshold corresponding to the second color information is compared to obtain the color depth information of the second color information. The second weight of the non-sprayed area is determined based on the second color information and the color depth information.
[0091] In some embodiments, the image alignment module 350 is used for: A first feature point is determined from multiple first corner points of the template spray-off area image, and a second feature point matching the features of the first feature point is determined from multiple second corner points of the enhanced illumination image. Based on the first and second feature points, align the template spray-off region image and the enhanced illumination image; The template no-spray area is determined from the template no-spray area image, and the target no-spray area of the enhanced illumination image is determined from the aligned enhanced illumination image based on the template no-spray area.
[0092] In some embodiments, the target quality detection module 360 is used for: If the target color light area is equal to or greater than the preset area threshold, a quality inspection result is obtained that indicates the circuit board to be inspected is unqualified. If the target color light area is smaller than the preset area threshold, a quality inspection result indicating that the circuit board to be inspected is qualified is obtained.
[0093] The circuit board quality inspection method, apparatus, electronic device, and storage medium proposed in this application acquire an initial illumination image of the circuit board to be inspected under the illumination of a target light source, and acquire an image of the template no-spray area corresponding to the circuit board to be inspected; perform stray light removal processing on the initial illumination image to obtain an illumination correction image, which includes a sprayed area with photocurable adhesive and a non-sprayed area; perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps; determine a first weight for the sprayed area based on the light source color of the target light source, and determine a second weight for the non-sprayed area based on the circuit board color of the circuit board to be inspected; fuse the multiple feature channel maps according to the first weight and the second weight to obtain an enhanced illumination image corresponding to the initial illumination image; determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and determine the target color light area from the target no-spray area; compare the target color light area with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0094] This application embodiment removes stray light from the initial illumination image and performs multi-channel fusion processing based on weighted settings for light source color and circuit board color. This results in an image that removes stray light and significantly enhances the features of non-sprayed areas, effectively overcoming the problems of low contrast between the no-spray area and the background, and the obscuring of regional information on the circuit board. Next, the enhanced image is aligned using the template no-spray area image to identify the target no-spray area in the enhanced illumination image. Then, the presence of a target color light representing excess adhesive in the target no-spray area is checked, and the target color light area is compared with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected. This application embodiment does not rely on a fixed UV adhesive luminescent template, and therefore is unaffected by changes in the shape of the freely sprayed area. Furthermore, by removing stray light and enhancing the features of the no-spray area, it achieves high-precision identification of mis-spraying defects in the no-spray area of the PCB board, thereby improving the accuracy of the quality inspection results for the no-spray area of the PCB board.
[0095] like Figure 4 As shown, Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes: The processor 401 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 402 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 402 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 402 and is called by the processor 401 to execute the circuit board quality inspection method of the embodiments of this application. Input / output interface 403 is used to implement information input and output; The communication interface 404 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 405 transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404); The processor 401, memory 402, input / output interface 403 and communication interface 404 are connected to each other within the device via bus 405.
[0096] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned circuit board quality inspection method.
[0097] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0098] The circuit board quality inspection method, apparatus, electronic device, and storage medium proposed in this application acquire an initial illumination image of the circuit board to be inspected under the illumination of a target light source, and acquire an image of the template no-spray area corresponding to the circuit board to be inspected; perform stray light removal processing on the initial illumination image to obtain an illumination correction image, which includes a sprayed area with photocurable adhesive and a non-sprayed area; perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps; determine a first weight for the sprayed area based on the light source color of the target light source, and determine a second weight for the non-sprayed area based on the circuit board color of the circuit board to be inspected; fuse the multiple feature channel maps according to the first weight and the second weight to obtain an enhanced illumination image corresponding to the initial illumination image; determine the target no-spray area in the enhanced illumination image based on the template no-spray area image, and determine the target color light area from the target no-spray area; compare the target color light area with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected.
[0099] This application embodiment removes stray light from the initial illumination image and performs multi-channel fusion processing based on weighted settings for light source color and circuit board color. This results in an image that removes stray light and significantly enhances the features of non-sprayed areas, effectively overcoming the problems of low contrast between the no-spray area and the background, and the obscuring of regional information on the circuit board. Next, the enhanced image is aligned using the template no-spray area image to identify the target no-spray area in the enhanced illumination image. Then, the presence of a target color light representing excess adhesive in the target no-spray area is checked, and the target color light area is compared with a preset area threshold to obtain the quality inspection result of the circuit board to be inspected. This application embodiment does not rely on a fixed UV adhesive luminescent template, and therefore is unaffected by changes in the shape of the freely sprayed area. Furthermore, by removing stray light and enhancing the features of the no-spray area, it achieves high-precision identification of mis-spraying defects in the no-spray area of the PCB board, thereby improving the accuracy of the quality inspection results for the no-spray area of the PCB board.
[0100] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0101] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0102] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0103] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0104] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0105] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0106] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0107] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0109] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0110] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for quality inspection of a circuit board, characterized in that, include: Acquire the initial illumination image of the circuit board to be tested under the illumination of the target light source, and acquire the template no-spray area image corresponding to the circuit board to be tested; The initial illumination image is processed to remove stray light to obtain an illumination-corrected image, which includes a sprayed area with UV-curable adhesive and a non-sprayed area. The illumination correction image is processed by color channel separation to obtain multiple feature channel maps. The first weight of the sprayed area is determined according to the light source color of the target light source, and the second weight of the non-sprayed area is determined according to the circuit board color of the circuit board to be detected. Based on the first weight and the second weight, multiple feature channel maps are fused to obtain the enhanced illumination image corresponding to the initial illumination image; Based on the template no-spray area image, the target no-spray area in the enhanced illumination image is determined, and the target color light area is determined from the target no-spray area; The target color light region is compared with a preset region threshold to obtain the quality inspection result of the circuit board to be inspected.
2. The circuit board quality inspection method according to claim 1, characterized in that, The process of removing stray light from the initial illumination image to obtain an illumination-corrected image includes: The initial illumination image is subjected to Gaussian blur processing to obtain a Gaussian blurred image, and the pixel ratio corresponding to each pixel is determined according to the ratio between the pixel values of the Gaussian blurred image and the initial illumination image at corresponding positions. Each pixel ratio is compared with a preset pixel range to obtain a comparison result, and the stray light influence area of the initial illumination image is determined based on the comparison result. A stray light removal process is performed on the stray light-affected area of the initial illumination image to obtain an illumination-corrected image.
3. The circuit board quality inspection method according to claim 2, characterized in that, The step of comparing each pixel ratio with a preset pixel range to obtain a comparison result, and determining the stray light-affected area of the initial illumination image based on the comparison result, includes: The illumination intensity of the target light source is obtained, and a first preset pixel range and a second preset pixel range are determined based on the illumination intensity. The luminous region is determined from the Gaussian blurred image. If the area of the luminous region is equal to or greater than a preset area threshold, the pixel ratio of each pixel is compared with the first preset pixel range to obtain a first comparison result. The stray light influence area of the initial illumination image is determined based on the first comparison result. If the area of the luminescent region is less than a preset area threshold, the pixel ratio of each pixel is compared with the second preset pixel range to obtain a second comparison result, and the stray light influence area of the initial illumination image is determined based on the second comparison result.
4. The circuit board quality inspection method according to claim 3, characterized in that, If the area of the luminous region is less than a preset area threshold, the pixel ratio of each pixel is compared with the second preset pixel range to obtain a second comparison result, and the stray light influence area of the initial illumination image is determined based on the second comparison result, including: If the area of the light-emitting region is less than a preset area threshold, obtain the center pixel ratio corresponding to the center pixel of the light-emitting region and the edge pixel ratio corresponding to the edge pixel of the light-emitting region. Calculate the ratio difference between the center pixel ratio and the edge pixel ratio. If the ratio difference is equal to or greater than a preset ratio threshold, compare each pixel ratio with the second preset pixel range to obtain a second comparison result, and determine the stray light influence area of the initial illumination image based on the second comparison result.
5. The circuit board quality inspection method according to claim 1, characterized in that, The step of determining a first weight for the sprayed area based on the color of the target light source, and determining a second weight for the non-sprayed area based on the color of the circuit board to be tested, includes: Obtain first color information characterizing the color of the target light source and the irradiation intensity of the target light source; A first weight of the sprayed area is determined based on the first color information and the irradiation intensity; Second color information representing the circuit board color of the circuit board to be tested is obtained, and the preset color threshold corresponding to the second color information is compared to obtain the color depth information of the second color information. The second weight of the non-sprayed area is determined based on the second color information and the color depth information.
6. The circuit board quality inspection method according to claim 1, characterized in that, The step of determining the target no-spray region in the enhanced illumination image based on the template no-spray region image includes: A first feature point is determined from a plurality of first corner points of the template spray-free area image, and a second feature point matching the features of the first feature point is determined from a plurality of second corner points of the enhanced illumination image; Align the template spray-off region image and the enhanced illumination image based on the first feature point and the second feature point; The template no-spray area is determined from the template no-spray area image, and the target no-spray area of the enhanced illumination image is determined from the aligned enhanced illumination image based on the template no-spray area.
7. The circuit board quality inspection method according to claim 1, characterized in that, The step of comparing the target color light region with a preset region threshold to obtain the quality inspection result of the circuit board to be inspected includes: If the target color light region is equal to or greater than the preset region threshold, a quality inspection result is obtained that indicates the circuit board to be inspected is unqualified. If the target color light area is smaller than a preset area threshold, a quality inspection result indicating that the circuit board to be inspected is qualified is obtained.
8. A quality inspection device for circuit boards, characterized in that, include: The acquisition module is used to acquire the initial illumination image of the circuit board to be inspected under the illumination of the target light source, and to acquire the template no-spray area image corresponding to the circuit board to be inspected; The illumination correction image determination module is used to perform stray light removal processing on the initial illumination image to obtain an illumination correction image, wherein the illumination correction image includes a sprayed area with a UV-curable adhesive and a non-sprayed area. The weight determination module is used to perform color channel separation processing on the illumination correction image to obtain multiple feature channel maps, determine the first weight of the sprayed area based on the light source color of the target light source, and determine the second weight of the non-sprayed area based on the circuit board color of the circuit board to be detected. An enhanced illumination image determination module is used to fuse multiple feature channel maps according to the first weight and the second weight to obtain an enhanced illumination image corresponding to the initial illumination image; An image alignment module is used to determine the target no-spray region in the enhanced illumination image based on the template no-spray region image, and to determine the target color light region from the target no-spray region; The target quality detection module is used to compare the target color light area with a preset area threshold to obtain the quality detection result of the circuit board to be tested.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the circuit board quality inspection method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the circuit board quality inspection method according to any one of claims 1 to 7.