Optical gain correction method, device and storage medium for circuit board defect detection
By generating a magnified image of the target sub-image and calculating the actual pixel values of the RGB channels, the camera optical parameters are adjusted, solving the problem of low efficiency in optical parameter correction of multi-array cameras. This achieves efficient collaborative optical parameter adjustment of array camera modules, improving detection accuracy and efficiency.
Patent Information
- Application Number
- CN202511404117.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-05-26
- Estimated Expiration
- 2045-09-29
AI Technical Summary
In semiconductor chip manufacturing, the low efficiency of optical parameter correction in multi-array cameras leads to low efficiency in subsequent image acquisition and inspection. Furthermore, the color deviation between different camera modules affects the accuracy of defect detection and system stability.
By generating a magnified view of the target sub-image, the target sampling area is determined and the actual pixel values of the RGB channels are calculated. The optical parameters of each column of cameras are adjusted using the channel gain values, thereby achieving coordinated optical parameter adjustment of the array camera module.
It improved the efficiency of parameter calibration, ensured the consistency of imaging from each camera column, reduced the false judgment rate, and improved the detection accuracy and continuous operation capability of the production line.
Smart Images

Figure CN121258854B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and in particular to an optical gain correction method, device and storage medium for detecting defects in circuit boards. Background Technology
[0002] In semiconductor chip manufacturing processes, large-scale components such as circuit boards typically require high-resolution line scan cameras to scan the boards. Image fusion and defect detection are then performed on the scanned images. In some large inspection machines, line scan cameras usually scan in a bow-shaped or linear sequence. This single-camera scanning is relatively inefficient, so some large machines use multiple array cameras for simultaneous scanning to accommodate the width of the circuit boards. Furthermore, the camera's optical parameters are closely related to the image quality of the semiconductor circuit board. For example, copper surfaces, gold lines, substrates, and logic components on the circuit board will exhibit different textures and colors under different camera parameters, directly impacting the accuracy of subsequent image defect detection and recognition. Specific optical parameters need to be set according to the region of interest or the specific defect detection requirements. Otherwise, the accuracy of subsequent image defect detection and recognition will vary.
[0003] Regardless of whether a single camera or an array camera is used for scanning, camera parameter adjustment / calibration is required beforehand. Specifically, sample images are taken first, and then adjustments / calibrations are made based on the image quality feedback. When using an array camera for scanning, the parameters of each camera module need to be adjusted / calibrated separately in advance. For example, four-array or eight-array cameras require multiple adjustments / calibrations, which indirectly affects the efficiency of subsequent image acquisition and detection. Summary of the Invention
[0004] This application provides an optical gain correction method, device, and storage medium for circuit board defect detection, which solves the problem of low optical parameter correction efficiency of multi-array cameras and improves the efficiency of subsequent color imaging and detection.
[0005] On one hand, this application provides an optical gain correction method for circuit board defect detection, the method comprising:
[0006] In response to receiving a selection operation on a target sub-image in the array sample image, an enlarged view of the target sub-image is generated;
[0007] In response to receiving a sampling operation on the target sub-image, a target sampling area in the target sub-image is determined, and the actual pixel value of the RGB channel of the target sampling area is calculated;
[0008] The target pixel value of the RGB channel of the target sampling area is obtained, and the channel gain value is determined by comparing it with the actual pixel value. The optical parameters of each column of cameras are adjusted with the channel gain value to facilitate subsequent synchronous image acquisition and defect detection by the array camera module.
[0009] Specifically, the array sample image is acquired by an array camera module. The array sample image contains several candidate sub-images distributed in an array, and each column of sub-images corresponds to a line scan camera. At least one sub-image is selected from each column of the array sample image and a sampling area is determined. The cameras in each column are adjusted to the same or different optical parameters according to the settings.
[0010] Specifically, the array sample image acquired by the array camera module is displayed in the first display area of the optical gain correction interface; in response to receiving a selection operation on the target sub-image, the line scan data of the target sub-image is retrieved and displayed in the second display area of the optical gain correction interface.
[0011] Specifically, determining the target sampling area in the target sub-image and calculating the actual pixel values of the RGB channels of the target sampling area includes:
[0012] When a point selection command is detected in the target sub-image, the point selection coordinates of the point selection command are determined, and the target sampling area is determined using the point selection coordinates;
[0013] When a pickup box instruction is detected in the target sub-image, the pickup coordinates covered by the pickup box are determined, and the target sampling area is determined based on the pickup coordinates;
[0014] Obtain all pixels within the selected coordinate range and extract the channel values of the RGB triplet respectively;
[0015] Calculate the average channel value of each RGB triplet, and determine the average channel value as the actual pixel value of the RGB channel.
[0016] Specifically, obtaining the RGB channel target pixel value of the target sampling area and determining the channel gain value by comparing it with the actual pixel value includes:
[0017] The target sampling area is mapped onto the master image to determine the target location and the corresponding material board attribute information in the master image;
[0018] The target pixel value of the RGB channel is determined based on the attribute information of the target location; or, an attribute selection instruction / operation is received to select the target pixel value of the RGB channel corresponding to the target attribute.
[0019] The channel gain value is calculated based on the difference between the target pixel value and the actual pixel value for each channel.
[0020] Specifically, an optical parameter correction area is set in the optical gain correction interface. When the target sampling area is selected, the target pixel value of the RGB channel, the actual pixel value of the RGB channel, and the gain value of the RGB channel of the target sampling area are displayed in the optical parameter correction area. The array camera module corrects the camera optical parameters by changing the gain value of the RGB channel for subsequent image acquisition and defect detection.
[0021] Specifically, the second display area also displays adjustment controls for the target sub-image. In response to receiving a click operation on the adjustment controls, the target sub-image is scaled in the second display area.
[0022] On the other hand, this application provides an optical gain correction device for circuit board defect detection, the device comprising:
[0023] An image selection module is used to generate an enlarged image of the target sub-image in response to receiving a selection operation on the target sub-image in the array sample image;
[0024] The channel calculation module is used to, in response to receiving a sampling operation on the target sub-image, determine the target sampling area in the target sub-image and calculate the actual pixel value of the RGB channel of the target sampling area;
[0025] The gain adjustment module is used to acquire the target pixel value of the RGB channel of the target sampling area, determine the channel gain value by comparing it with the actual pixel value, and adjust the optical parameters of each column of cameras with the channel gain value to facilitate subsequent synchronous image acquisition and defect detection by the array camera module.
[0026] In another aspect, this application provides a computer device including a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, wherein the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the optical gain correction method for circuit board defect detection described above.
[0027] In another aspect, this application provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the optical gain correction method for circuit board defect detection described above.
[0028] The beneficial effects of the technical solution provided in this application include at least the following: It achieves highly efficient collaborative optical parameter adjustment of the array camera module. Through interactive selection and sampling operations, key detection areas are accurately located, effectively focusing on core optical features affecting defect detection. A dynamic comparison mechanism between the target and actual pixel values is established, transforming abstract optical parameter adjustment into quantifiable numerical relationships, providing a unified standard for multi-camera parameter synchronization. This method avoids the inefficient operation of traditional individual camera adjustment, significantly improving parameter calibration efficiency. Simultaneously, dynamic adjustment based on a unified standard ensures imaging consistency across all camera columns, effectively solving the color deviation problem between sub-images acquired by different camera modules. This provides a unified hardware foundation for subsequent image fusion and defect detection, improving the detection accuracy of minute defects on the circuit board surface and reducing the misjudgment rate caused by inconsistent image quality. Furthermore, this method improves the system's adaptability, enabling rapid response to imaging needs of different material regions, reducing the need for frequent downtime calibration, and enhancing the continuous operation capability and overall detection efficiency of the production line. Attached Figure Description
[0029] Figure 1 This is a flowchart of the optical gain correction method for circuit board defect detection provided in the embodiments of this application;
[0030] Figure 2 A schematic diagram of an array sample image captured by a camera module is shown in one possible form;
[0031] Figure 3 This diagram illustrates the selection of a target sampling region within a magnified target sub-map.
[0032] Figure 4 A schematic diagram of one possible form of the optical gain correction interface is shown;
[0033] Figure 5 A schematic diagram of the optical parameter correction zone in one possible form is shown;
[0034] Figure 6 This is a structural block diagram of the optical gain correction device for circuit board defect detection provided in the embodiments of this application;
[0035] Figure 7 A structural block diagram of a computer device provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0037] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0038] In traditional circuit board defect detection systems, the optical parameters of each array camera module need to be adjusted individually, resulting in time-consuming and inefficient parameter calibration. Due to the differences in optical characteristics of each column of cameras, the parameter adjustment process relies on manual experience and lacks a unified quantitative standard, leading to color deviations in the sub-images acquired by different camera modules. This deviation causes edge misalignment and color level breaks during the image fusion stage, directly affecting the accuracy of defect detection algorithms in identifying key features such as broken copper wires and loose solder joints on the circuit board surface. If these problems are not addressed, the imaging differences between the array camera modules will result in bright and dark stripes and color block segmentation in the fused panoramic image. This image distortion can mask micron-level circuit defect features, causing the false positive rate of the defect detection algorithm to rise to an unacceptable level. In long-term operation, the image quality degradation caused by parameter drift will force the system to frequently shut down for calibration, severely affecting the continuous operation capability of the production line. More seriously, the accumulation of parameter differences between different camera modules may cause data conflicts in the image processing pipeline, leading to decreased system stability and a surge in maintenance costs.
[0039] In response, this application proposes an optical gain correction method for circuit board defect detection. Figure 1 This is a flowchart of the optical gain correction method for circuit board defect detection provided in this application embodiment, which includes the following steps:
[0040] S1. In response to receiving a selection operation on the target sub-image in the array sample image, generate an enlarged image of the target sub-image;
[0041] The array sample image can be obtained synchronously by the array camera module. The array sample image is acquired during the camera commissioning stage and is an image collection containing multiple sub-images. Specifically, it can be implemented by parallel scanning of multiple line scan cameras. Each sub-image corresponds to the imaging area of a specific line scan camera and is used to establish a benchmark reference for multi-camera collaborative work.
[0042] For example Figure 2 A schematic diagram of a possible form of obtaining an array sample image by a camera module is shown. Due to the size and structure of the circuit board, four line scan cameras are selected to take pictures in parallel. The images of the complete circuit board structure are collected as an array sample image of 4*19, in which each column of sub-images is taken by the same camera in that column.
[0043] When the system selects a specific target sub-image based on received instructions, it indicates that camera parameter adjustments need to be performed based on that sub-image. Since array images typically display the overall structural layout and cannot be precisely selected, it's necessary to select the target sub-image for magnified display to facilitate subsequent operations. This sub-image selection operation can refer to an image region selection command triggered through the human-computer interaction interface, specifically achieved through mouse clicks or touchscreen selection, used to accurately locate the camera imaging area requiring parameter correction. Alternatively, this operation can also be performed directly through system-triggered commands when the circuit board structure layout is known. For example... Figure 2 The middle option selects the sub-image in the second row and second column as the target sub-image, enlarges its display, and performs subsequent operations.
[0044] S2. In response to receiving a sampling operation on the target sub-image, determine the target sampling area in the target sub-image and calculate the actual pixel values of the RGB channels of the target sampling area;
[0045] The target sampling area can be determined by defining the pixel analysis region within the selected sub-image based on interactive commands. This can be achieved using coordinate positioning or region selection to extract optical feature data from a specific detection area. Alternatively, the sampling operation can be automatically triggered by system commands to determine the sampling area. The sub-images in the array sampling are typically of uniform size, for example, all set to 400*200mm. Once the approximate image distribution is known, the target sampling area can be directly selected based on the master image or standard image. Figure 3 This diagram illustrates the selection of a target sampling region within a magnified target submap.
[0046] The actual pixel values of the RGB channels represent the statistical analysis of the color components of all pixels in the sampling area. Specifically, they can be achieved using the arithmetic mean or weighted average method. This is used to quantify the imaging quality under the current optical parameters. For example, the R channel of the sampled copper surface area is 220, the G channel is 170, and the B channel is 150.
[0047] It should be noted that defect detection requires focusing on defects on the gold or copper surface. Therefore, the camera should prioritize improving the optical gain by focusing on the imaging characteristics of the gold or copper surface. Thus, the sampling operation should select the ROI region (i.e., the copper or gold surface region). For other testing needs, the camera can also focus on detecting component areas; in this case, the target sampling area can be set according to actual requirements.
[0048] S3. Obtain the target pixel value of the RGB channel of the target sampling area, determine the channel gain value by comparing it with the actual pixel value, and adjust the optical parameters of each column of cameras with the channel gain value to facilitate subsequent synchronous image acquisition and defect detection by the array camera module.
[0049] The target pixel value of the RGB channel in the target sampling area is the pixel value used for optimal imaging effect in defect detection. This parameter can be an empirical value determined by historical defect detection. Images acquired at this pixel value have relatively higher accuracy in defect detection. The channel gain value is a compensation coefficient calculated based on the difference between the target pixel value and the actual pixel value. Specifically, it can be implemented using linear scaling or nonlinear mapping algorithms, and is used to establish a quantitative basis for adjusting optical parameters. The camera optical parameter adjustment / calibration that this application focuses on refers to adjusting this gain value to change the photosensitive characteristics of the image sensor, thereby achieving consistent calibration of multi-camera imaging effects. In particular, each of the three RGB channels can be set with a corresponding channel gain value. By correcting this channel gain value once or multiple times, the actual pixel value can be adjusted to or infinitely close to the target pixel value, making it easier for images obtained after normal camera scanning to be used for defect detection.
[0050] Based on this correction principle, after the array camera module samples the images, the above process can be performed separately for each column of images to correct the camera's optical parameters, thus achieving rapid adjustment. For example, at least one sub-image and sampling area can be selected from each column of the array sample image, and each column of cameras can be set to adjust the same or different optical parameters according to the actual situation to meet the corresponding industrial requirements. The selection of the sampling area can be based on image features, such as brightness, contrast, or texture. For example, a sub-image containing copper surfaces, gold lines, or substrate areas on a circuit board can be selected as the sampling object. In practical applications, different optical parameters can be set for each column of cameras according to the characteristics of different areas of the circuit board. For example, a lower gain value can be set for a camera shooting copper surfaces, while a higher gain value can be set for a camera shooting gold lines. This flexible parameter adjustment method can adapt to the imaging needs of different areas of the circuit board.
[0051] The core of this scheme lies in the construction of a dynamic gain correction mechanism based on local feature sampling. By combining interactive sampling with automatic gain calculation, it achieves collaborative parameter optimization of the array camera module. This mechanism breaks through the traditional camera-by-camera adjustment mode, directly generating gain parameters by comparing the optical features of the target area. This ensures the consistency of multi-camera imaging and significantly improves parameter correction efficiency, laying a technical foundation for synchronous image acquisition by large-scale array cameras.
[0052] Its specific working principle is as follows: It acquires an array sample image from the array camera module and receives a selection operation on the target sub-image within the array sample image. This operation triggers the generation of a magnified view of the target sub-image, facilitating precise location of key detection areas by the operator. Next, it receives a sampling operation on the target sub-image, determining the target sampling area within it. The determination of the target sampling area can be achieved through interactive methods such as point selection or bounding selection. After determining the sampling area, it calculates the actual pixel values of the RGB channels in that area, establishing an optical parameter feedback benchmark.
[0053] Next, the target pixel values of the RGB channels in the target sampling area are acquired. These target pixel values can be derived from a preset standard or determined based on specific detection requirements. Subsequently, by comparing the actual pixel values with the target pixel values, the gain value of each channel is calculated. This step transforms the abstract adjustment of optical parameters into a quantifiable numerical relationship. Finally, the calculated channel gain values are used to adjust the optical parameters of each column of cameras. This dynamic adjustment method based on a unified standard ensures the imaging consistency of the array camera module, laying the foundation for subsequent synchronous image acquisition and defect detection.
[0054] Throughout the process, core optical features affecting defect detection are accurately captured through interactive selection and sampling operations. A dynamic comparison mechanism between the target and actual pixel values is established, providing a quantitative basis for multi-camera parameter synchronization. This method avoids the inefficient operation of adjusting each camera individually and achieves coordinated optical parameter adjustment of the array camera module.
[0055] In summary, this application achieves highly efficient collaborative optical parameter adjustment of array camera modules. Through interactive selection and sampling operations, key detection areas are precisely located, effectively focusing on core optical features affecting defect detection. A dynamic comparison mechanism between the target and actual pixel values is established, transforming abstract optical parameter adjustments into quantifiable numerical relationships, providing a unified standard for multi-camera parameter synchronization. This method avoids the inefficient operation of traditional individual camera adjustments, significantly improving parameter calibration efficiency. Simultaneously, dynamic adjustment based on a unified standard ensures imaging consistency across all camera columns, effectively resolving color deviation issues between sub-images acquired by different camera modules. This provides a unified hardware foundation for subsequent image fusion and defect detection, improving the detection accuracy of minute defects on circuit board surfaces and reducing the false positive rate caused by inconsistent image quality. Furthermore, this method improves system adaptability, enabling rapid response to imaging needs of different material regions, reducing the need for frequent downtime calibration, and enhancing the continuous operation capability and overall inspection efficiency of the production line.
[0056] Considering that array image selection may require manual review or observation of the operation effect, or manual selection of sampling operation, users cannot intuitively distinguish between the original acquired data and the detailed information of the target sub-image, resulting in low efficiency of the operation interface interaction and difficulty in accurately retrieving and visually analyzing the target sub-image line scan data.
[0057] To this end, this application can set up a human-computer interaction device, with at least two display areas on the device's optical gain correction interface: a first display area and a second selection area. By default, the first display area displays the array sample image acquired by the array camera module. When a selection operation for a target sub-image is received, the line scan data of the target sub-image is retrieved, and the detailed image is displayed in the second display area of the optical gain correction interface.
[0058] Figure 4 A schematic diagram of a possible optical gain correction interface is shown. The first display area can display array images in a grid layout or tiled arrangement. The position of each candidate sub-image forms a spatial mapping relationship with the physical arrangement of the array camera modules. For example, a four-column, eight-row matrix layout corresponds to the actual installation positions of the four line scan cameras. Line scan data retrieval is achieved through a coordinate mapping mechanism. When the user clicks on a target sub-image, the system locates the corresponding raw data storage address of the line scan camera based on the row and column index of that sub-image in the array image, and then extracts the raw line scan data before image fusion processing. The second display area is configured as a high-resolution display area, supporting grayscale histogram analysis, pixel-level magnification, or channel separation display of the line scan data. For example, an independent scroll bar can be set on the side of the second display area to achieve vertical image scaling, and an RGB channel switching button can be set on the left side, etc.
[0059] Figure 4 In the first display area of the optical gain correction interface ( Figure 4 The middle area displays the array sample image acquired by the array camera module. When the system receives an external input command, i.e., when the target sub-image is selected, it retrieves the line scan data of that target sub-image and displays it in the second display area of the optical gain correction interface (i.e., Figure 4 The left-hand area is displayed.
[0060] Specifically, in the optical gain correction interface, the array sample image is presented in thumbnail form in the first display area. The operator can initially select the target sub-image to be adjusted by observing the brightness differences or texture features between sub-images (e.g., quickly locating an image with a gold-plated area with the naked eye). When the mouse hovers over the target sub-image (or clicks to select), a coordinate positioning signal is triggered. The system then parses the corresponding line scan camera number and data storage path, loading the original line scan data from the cache to the second display area for rendering. The second display area uses a different color space configuration than the first display area. For example, when converting the 16-bit depth of the original line scan data to 8-bit visualization data, linear mapping is preserved to avoid loss of detail. Through the parallel display of the two display areas, the operator can maintain a global view of the array sample image while performing channel separation comparison or local feature measurement on the line scan data of the selected sub-image.
[0061] Through the above technical solution, this application achieves the separate display of raw acquired data and detailed information of the target sub-image. Users can obtain an overall view of the array sample image in the first display area, facilitating the location of the region of interest. Simultaneously, the second display area allows for focused viewing of high-precision line scan data of the target sub-image for in-depth analysis. This dual-area display design improves the data visualization efficiency during optical parameter adjustment, enabling operators to perform optical gain correction more intuitively and accurately.
[0062] In some embodiments, due to limitations in the resolution or display size of the target sub-image, operators cannot intuitively observe local detailed features, resulting in insufficient sampling area selection accuracy, which in turn affects the accuracy of channel gain value calculation. To address this, this application further proposes displaying adjustment controls for the target sub-image in a second display area. Upon receiving a click operation on the adjustment controls, image scaling of the target sub-image is performed in the second display area.
[0063] Adjustment controls are directly integrated into the visual interface of the second display area, for example, located at the edge of the image display area or overlaid on a transparent layer of the image preview window. See also Figure 3 or Figure 4 The leftmost control in the image displays the zoom level. Clicking it triggers a preset zoom ratio switch; for example, a single click zooms in to 200%, and another click restores the original size. Alternatively, a long press activates a slider for stepless zooming. The image zooming operation is dynamically rendered based on the line scan data of the target sub-image, ensuring that the zoomed-in image area retains pixel information at the original resolution. The interactive logic of the adjustment control works in conjunction with the image display function of the second display area, allowing operators to directly trigger view adjustments while observing the line scan data without interrupting the current sampling area selection process.
[0064] Specifically, after the operator observes the line scan data of the target sub-image in the second display area, they can click the zoom-in icon in the adjustment controls to magnify the image content within the current display area by a preset factor. The magnified image displays the texture of the metal lines on the circuit board surface or the microscopic morphology of the solder joint edges in a dot matrix format. For example, magnifying an area originally displaying as 5mm × 5mm to 10mm × 10mm reduces the actual physical size of a single pixel from 0.1mm to 0.05mm. The operator then repositions the sampling area coordinates based on the magnified image details, for example, precisely aligning the pickup frame with the transition area where the metal lines meet the substrate while magnified. After selecting the sampling area, clicking the zoom-out icon in the adjustment controls restores the original view, allowing the operator to continue performing gain correction operations on other sub-images. This instant view switching mechanism avoids the operational delays required by traditional image processing software, which necessitates switching tools or calling independent zoom windows, ensuring that the sampling area coordinate calibration process is synchronized with the image observation action. This convenient interactive method improves the accuracy of sampling area selection, thereby enhancing the accuracy of channel gain value calculation. Since image zooming can be achieved without switching interfaces, operational efficiency is significantly improved. Furthermore, the magnified image can display more detailed information, which helps operators to more accurately locate and select the sampling area, providing a more reliable data basis for subsequent optical gain correction.
[0065] Based on the selection of the target sub-image through the interactive interface, the sampling operation needs to be directionally selected according to the specific image distribution of the target sub-image. This operation needs to ensure the accuracy of coordinate and pixel calculations. To this end, this application can achieve the following solution:
[0066] A. When a point selection command is detected in the target sub-image, determine the point selection coordinates of the point selection command, and use the point selection coordinates to determine the target sampling area; or when a pickup box command is detected in the target sub-image, determine the pickup coordinates covered by the pickup box, and use the pickup coordinates to determine the target sampling area.
[0067] B. Obtain all pixels within the selected coordinate range and extract the channel values of the RGB triplet respectively;
[0068] C. Calculate the average channel value of each RGB triplet, and determine the average channel value as the actual pixel value of the RGB channel.
[0069] The coordinate positioning accuracy of the point selection command can reach the sub-pixel level, for example, by mapping the coordinates to the original image resolution using a bilinear interpolation algorithm. The coverage area of the pickup box command can be set to a rectangular area, with its side length defined by the mouse or input command in pixels, and can be dynamically adjusted according to the texture features of the circuit board surface. Two interaction modes are executed through event listening: the point selection mode is triggered when a mouse click event is detected, and the pickup box mode is activated when a drag-and-draw event is detected. For pixel data within the pickup coordinate range, normalization processing is used to eliminate sensor noise, for example, by removing abnormal pixels that deviate from the mean by more than two standard deviations before calculating the average channel value. This scheme works in conjunction with the multi-column camera parameter independent adjustment mechanism in the array sample image of the preceding claim, allowing different columns of cameras to independently calculate gain values based on the standardized data of their respective sampling areas.
[0070] Specifically, during circuit board defect detection, operators can trigger a selection command by clicking on a specific location in the target sub-image. The coordinate positioning module then maps the clicked location to the original image coordinate system, extracting a micro-region centered at that coordinate with a side length of 1 pixel as the sampling area. When analyzing a larger area, the operator draws a rectangular selection box, and the geometric analysis module automatically calculates the coordinates of the diagonal vertices of the box and extracts all pixels within the coverage area. The data preprocessing module filters outliers from the collected pixel data; for example, in copper foil area detection, it automatically excludes abnormally bright pixels caused by oxide spots. The cleaned RGB channel data is then sent to the mean calculation unit, where the pixel values of the red, green, and blue channels are arithmetically averaged to generate statistically significant actual pixel values.
[0071] Traditional technical solutions cannot flexibly obtain reference values based on material plate attribute information and lack consideration for the correlation of target location attributes, resulting in insufficient accuracy and adaptability of gain correction. For example... Figure 3 Although the actual pixel values of each channel can be calculated for the target sampling area selected in the center box, the target pixel values of this selected area are unknown, making it impossible to calculate the gain value. Therefore, this application can adopt the following solution:
[0072] A. Map the target sampling area to the master image to determine the target location and corresponding material board attribute information in the master image;
[0073] B. Determine the target pixel value of the RGB channel based on the attribute information of the target location;
[0074] C. Calculate the channel gain value for each channel based on the difference between the target pixel value and the actual pixel value.
[0075] The mapping relationship between the target sampling area and the master image is achieved through a coordinate transformation algorithm. The master image stores physical property parameters of different areas of the material board, such as reflectivity parameters for the copper surface area or surface roughness parameters for the gold line area. The attribute information of the target location includes at least one of the following: material type, surface treatment process, or preset reference pixel value. Attribute selection commands are triggered via drop-down menus or touch operations, allowing operators to dynamically switch reference parameters according to inspection needs. The difference calculation uses a linear compensation algorithm, for example, using the ratio of the target pixel value to the actual pixel value as the gain coefficient, where the gain coefficient for the copper surface area is controlled within the range of 0.8-1.2, and for the gold line area within the range of 1.0-1.5. The target pixel values of different attribute areas in the master image are obtained through historical inspection data or standard sample calibration; for example, the R channel reference value for the copper surface area is 180±5, and the B channel reference value for the gold line area is 210±8.
[0076] Specifically, after determining the actual pixel value of the target sampling area, a coordinate mapping algorithm is used to map it to its physical location on the master image. This is then linked to the material attribute parameters recorded at that location to determine the target pixel value for the corresponding channel. When the detection area contains multiple materials, a reference value is automatically matched based on the attribute priority recorded in the master image; for example, the copper surface reference value is prioritized for gain calculation. When detection requirements change, an external command switches to the gold line reference value, allowing the same sampling area to adapt to different defect type detection scenarios.
[0077] In some embodiments, it can also be implemented through instructions, that is, receiving attribute selection instructions / operations and selecting the target pixel value of the RGB channel corresponding to the target attribute. This method requires the help of a visual interface or external input instructions.
[0078] In one possible implementation, the material board attribute information may include material type, surface treatment process, etc. For example, for a multilayer printed circuit board, different layers may use different materials, such as copper foil, insulating layer, solder mask, etc. Surface treatment processes may include chemical gold plating, organic solder resist coating, etc. That is, a specific type can be selected through a drop-down option.
[0079] Next, the target pixel values for the RGB channels are determined based on the attribute information of the target location. This can be achieved using a pre-established attribute-pixel value mapping table. For example, the copper foil area might correspond to RGB values (200, 150, 100), while the solder mask area might correspond to RGB values (50, 100, 50).
[0080] Another approach is to receive attribute selection instructions or operations, allowing the operator to manually select the target pixel value for the RGB channel corresponding to the target attribute. This method is suitable for areas requiring special processing or new materials.
[0081] Finally, the channel gain value is calculated based on the difference between the target pixel value and the actual pixel value for each channel. The calculation formula can be: Gain value = Target pixel value / Actual pixel value. For example, if the target pixel value for the red channel is 200 and the actual pixel value is 180, then the gain value for the red channel is 1.11.
[0082] During the difference calculation process, the gain value of each channel is calculated independently. For example, the gain value of the R channel is the ratio of the target value of 200 to the actual value of 180, which is 1.11, and the gain value of the G channel is the ratio of the target value of 185 to the actual value of 170, which is 1.09. This method eliminates imaging deviations caused by differences in lighting or camera performance while preserving the differences in reflectivity of different material regions, avoiding feature loss due to overcorrection. The final generated gain parameters are synchronized to the array camera module to ensure consistency in color and brightness between images acquired by multiple cameras, providing a reliable data foundation for subsequent image fusion and defect identification.
[0083] Figure 5 A schematic diagram of the optical parameter correction region of the optical gain correction interface in one possible form is shown, which corresponds to... Figure 4 The rightmost area is shown. The optical gain correction interface includes an optical parameter correction area. Once the target sampling area is determined in the magnified image of the first display area, the RGB channel target pixel value, RGB channel actual pixel value, and RGB channel gain value of the target sampling area can be displayed in the optical parameter correction area. These three parameter values are displayed after calculations as described above. For example... Figure 5The middle layer type indicates that the copper surface sampling area is selected, and the calculated actual pixel values for the RGB channels are 200, 170, and 155 respectively. The target pixel values for the RGB channels in this area should be 220, 175, and 150. The calculated gain values for each channel are 0.9090, 0.9714, and 0.9677 respectively (note that the gain values are calculated based on the camera system's built-in algorithm, and this application does not limit the specific algorithm type).
[0084] The array camera module corrects the camera's optical parameters by changing the gain values of the RGB channels for subsequent image acquisition and defect detection. This process can be achieved manually by adjusting the gain values of each channel, or automatically by the system. Specifically, when the difference between the target value and the actual value is too large, the system automatically adjusts the corresponding gain value to bring the actual value to match or be close to the target value. The gain values of each channel at this point are recorded and used as the target optical parameter values, which are then synchronized to other array cameras (provided that information with the same attribute is selected as the detection standard). Alternatively, this process can also be achieved by manually adjusting the gain values.
[0085] For cases where master image mapping is not used, an attribute information selection control is also displayed in the optical parameter correction area, i.e. Figure 5 In the "Layer Type" option, you can find the type you actually need by searching the drop-down menu. Figure 5 You can manually select the copper surface area, but this operation relies on human-computer interaction.
[0086] In summary, this application introduces a dedicated optical parameter correction area into the optical gain correction interface, centrally displaying the target pixel values, actual pixel values, and gain values of the RGB channels in the target sampling area. This design provides operators with an intuitive interface for parameter comparison and adjustment, avoiding the inefficiency caused by scattered information. By displaying the target pixel values and actual pixel values of each channel in real time, operators can quickly determine the direction and degree of deviation in the current optical parameters. Simultaneously, the displayed RGB channel gain values provide a quantitative basis for parameter adjustment, ensuring the accuracy of the adjustment. The array camera module can directly adjust the optical parameters based on the displayed gain values, improving the real-time performance and accuracy of parameter adjustment. This integrated parameter calculation, display, and adjustment process not only improves the continuity of operation but also significantly reduces the risk of human error. Therefore, this application effectively solves the problems of inaccurate optical parameter adjustment and low efficiency caused by the lack of an intuitive interactive interface in traditional methods, laying the foundation for subsequent synchronous image acquisition and defect detection of the array camera module, and improving the reliability and efficiency of the overall detection system.
[0087] Figure 6 This is a structural block diagram of the optical gain correction device for circuit board defect detection provided in this application embodiment. The device includes:
[0088] Image selection module 610 is used to generate an enlarged image of the target sub-image in response to receiving a selection operation on the target sub-image in the array sample image;
[0089] The channel calculation module 620 is used to, in response to receiving a sampling operation on the target sub-image, determine the target sampling area in the target sub-image and calculate the actual pixel value of the RGB channel of the target sampling area;
[0090] The gain adjustment module 630 is used to acquire the target pixel value of the RGB channel of the target sampling area, determine the channel gain value by comparing it with the actual pixel value, and adjust the optical parameters of each column of cameras with the channel gain value to facilitate subsequent synchronous image acquisition and defect detection by the array camera module.
[0091] It should be noted that the optical gain correction device for circuit board defect detection provided in this embodiment is only illustrated by the above-described division of functional modules / units. In practical applications, the above functions can be assigned to different functional modules / units as needed, that is, the internal structure of the optical gain correction device for circuit board defect detection can be divided into different functional modules / units to complete all or part of the functions described above. Furthermore, the implementation method of the optical gain correction method for circuit board defect detection provided in the above method embodiments and the implementation method of the optical gain correction device for circuit board defect detection provided in this embodiment belong to the same concept. The specific implementation process of the optical gain correction device for circuit board defect detection provided in this embodiment is detailed in the above method embodiments and will not be repeated here.
[0092] Figure 7This illustration shows a structural block diagram of a computer device provided in an exemplary embodiment of this application. The computer device can be a desktop computer, a laptop computer, a handheld computer, or a cloud server, etc. The computer device may include, but is not limited to, a processor and memory. The processor and memory can be connected via a bus or other means. The processor can be a Central Processing Unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, graphics processing units (GPUs), embedded neural network processing units (NPUs) or other dedicated deep learning coprocessors, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0093] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0094] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the above embodiments of this application. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created by the processor, etc. Furthermore, the 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, the 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, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0095] In some embodiments, the computer device may also optionally include: a peripheral device interface and at least one peripheral device. The processor, memory, and peripheral device interface can be connected via a bus or signal lines. Each peripheral device can be connected to the peripheral device interface via a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit, a display screen, and a keyboard.
[0096] Peripheral device interfaces can be used to connect at least one I / O (Input / Output) related peripheral device to the processor and memory. In some embodiments, the processor, memory, and peripheral device interface are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor, memory, and peripheral device interface can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0097] The display screen is used to display the UI (User Interface). This UI can include graphics, text, icons, videos, and any combination thereof. When the display screen is a touch screen, it also has the ability to collect touch signals on or above the surface of the display. These touch signals can be input as control signals to a processor for processing. In this case, the display screen can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen, located on the front panel of the computer device; in other embodiments, there may be at least two display screens, respectively located on different surfaces of the computer device or in a folded design; in still other embodiments, the display screen may be a flexible display screen, located on a curved or folded surface of the computer device. Furthermore, the display screen can be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0098] A power supply is used to power the various components in a computer device. The power supply can be alternating current (AC), direct current (DC), a disposable battery, or a rechargeable battery. When the power supply includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is charged via a wired connection, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0099] Those skilled in the art will understand that the structure shown in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0100] This application also discloses a computer-readable storage medium. Specifically, the computer-readable storage medium is used to store a computer program, which, when executed by a processor, implements the methods described in the above-described method embodiments. Those skilled in the art will understand that implementing all or part of the processes in the methods described in the above-described embodiments of this application can be accomplished by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0101] This specific embodiment is merely an explanation of the present invention and is not intended to limit the invention. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of the claims of the present invention.
Claims
1. An optical gain correction method for circuit board defect detection, characterized in that, The method includes: In response to receiving a selection operation on a target sub-image in the array sample image, an enlarged view of the target sub-image is generated; In response to receiving a sampling operation on the target sub-image, a target sampling area in the target sub-image is determined, and the actual pixel value of the RGB channel of the target sampling area is calculated; The target pixel value of the RGB channel in the target sampling area is obtained, and the channel gain value is determined by comparing it with the actual pixel value. The optical parameters of each column of cameras are adjusted according to the channel gain value to facilitate subsequent synchronous image acquisition and defect detection by the array camera module. Specifically, the target sampling area is mapped to the master image to determine the target position and the attribute information of the corresponding material board in the master image. The target pixel value of the RGB channel is determined based on the attribute information of the target position. Alternatively, an attribute selection instruction / operation is received to select the target pixel value of the RGB channel corresponding to the target attribute. The channel gain value of each channel is calculated according to the difference between the target pixel value and the actual pixel value of each channel.
2. The method according to claim 1, characterized in that, The array sample image is acquired by an array camera module. The array sample image contains several candidate sub-images distributed in an array, and each column of sub-images corresponds to a line scan camera. At least one sub-image is selected from each column of the array sample image and the sampling area is determined. The cameras in each column are adjusted to the same or different optical parameters according to the settings.
3. The method according to claim 2, characterized in that, The first display area of the optical gain correction interface displays the array sample image acquired by the array camera module; in response to receiving a selection operation on the target sub-image, the line scan data of the target sub-image is retrieved and displayed in the second display area of the optical gain correction interface.
4. The method according to claim 3, characterized in that, The step of determining the target sampling area in the target sub-image and calculating the actual pixel values of the RGB channels of the target sampling area includes: When a point selection command is detected in the target sub-image, the point selection coordinates of the point selection command are determined, and the target sampling area is determined using the point selection coordinates; When a pickup box instruction is detected in the target sub-image, the pickup coordinates covered by the pickup box are determined, and the target sampling area is determined based on the pickup coordinates; Obtain all pixels within the selected coordinate range and extract the channel values of the RGB triplet respectively; Calculate the average channel value of each RGB triplet, and determine the average channel value as the actual pixel value of the RGB channel.
5. The method according to claim 1, characterized in that, An optical parameter correction area is set in the optical gain correction interface. When the target sampling area is selected, the target pixel value of the RGB channel, the actual pixel value of the RGB channel, and the gain value of the RGB channel of the target sampling area are displayed in the optical parameter correction area. The array camera module corrects the camera's optical parameters by changing the gain values of the RGB channels, which is useful for subsequent image acquisition and defect detection.
6. The method according to claim 3, characterized in that, The second display area also displays adjustment controls for the target sub-image. In response to receiving a click operation on the adjustment controls, an image scaling operation is performed on the target sub-image in the second display area.
7. An optical gain correction device for circuit board defect detection, characterized in that, The device includes: An image selection module is used to generate an enlarged image of the target sub-image in response to receiving a selection operation on the target sub-image in the array sample image; The channel calculation module is used to, in response to receiving a sampling operation on the target sub-image, determine the target sampling area in the target sub-image and calculate the actual pixel value of the RGB channel of the target sampling area; The gain adjustment module is used to acquire the RGB channel target pixel value of the target sampling area, determine the channel gain value by comparing it with the actual pixel value, and adjust the optical parameters of each column of cameras with the channel gain value to facilitate subsequent synchronous image acquisition and defect detection by the array camera module; specifically, it maps the target sampling area to the master image to determine the target position and the corresponding material board attribute information in the master image; determines the RGB channel target pixel value based on the attribute information of the target position; or, receives an attribute selection instruction / operation to select the RGB channel target pixel value corresponding to the target attribute; and calculates the respective channel gain value according to the difference between the target pixel value and the actual pixel value of each channel.
8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the optical gain correction method for circuit board defect detection as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or instruction set is loaded and executed by a processor to implement optical gain correction for circuit board defect detection as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-channel CCD image non-uniformity correction method and device and storage medium
CN111669519A
Image white balance processing method and device based on standard light source
CN117896508A
