Image enhancement method and device, equipment and storage medium

By processing the original background image in the AOI light source, the target background image is obtained, and the image of the furnace rear circuit board to be detected is enhanced based on the background image, the detection efficiency and accuracy problems caused by low image quality are solved, and high-quality target detection is achieved.

CN120219254APending Publication Date: 2025-06-27GD MIDEA AIR CONDITIONING EQUIP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311819790.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The low quality of images collected by the prior art leads to low object detection efficiency and detection accuracy, and the inability to accurately detect defects on the panel surface.

Method used

By collecting images of the original color card based on the AOI light source, the original background color map corresponding to multiple colors is obtained and processed to obtain the target background color map. Then, the original image of the furnace rear circuit board to be detected is enhanced based on the target background image to obtain the target image to improve the detection accuracy.

Benefits of technology

The image quality of the circuit board behind the furnace to be tested has been greatly improved, the target detection efficiency and detection accuracy have been improved, and the defects in the board can be accurately detected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219254A_ABST
    Figure CN120219254A_ABST
Patent Text Reader

Abstract

The invention discloses an image enhancement method and device, equipment and a storage medium, and relates to the field of visual inspection, and the method comprises the steps: carrying out the image collection of an original color card based on an AOI light source, obtaining an original ground color image corresponding to a plurality of colors in the AOI light source, processing the original ground color image, obtaining a target ground color image, and carrying out the processing of the target ground color image. Acquiring an original image of the circuit board behind the furnace based on the AOI light source, performing image enhancement on the original image based on the target ground color map to obtain a target image, and detecting the circuit board behind the furnace to be detected based on the target image; according to the method and the device, the original ground color maps corresponding to various colors are processed, and the original image of the furnace rear circuit board is enhanced based on the target ground color map obtained after processing, so that the image quality of the to-be-detected furnace rear circuit board is greatly improved, the to-be-detected furnace rear circuit board is detected based on the target image, and the detection efficiency is improved. Therefore, the target detection efficiency and the detection precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual detection, and in particular to an image enhancement method, device, equipment and storage medium. Background Art

[0002] During the production process of PCBA in the electronic production line, after reflow soldering or wave soldering, it is necessary to detect the defects on the board surface where the solder joints are located. Mainly through machine vision means, the welding quality of solder joints and patches is detected. The quality of the images captured by the camera largely determines the detection effect. Images with uniform lighting are convenient for operators to process and detect. Among them, the lighting imaging of the AOI light source is particularly important. However, for the images directly taken by the current AOI detection equipment using the AOI light source for lighting, stray light will be introduced. The light source characteristics of the OI detection equipment make the illuminated images uneven in lighting. The images collected with uneven lighting have low quality, resulting in low target detection efficiency and detection accuracy.

[0003] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of the present invention is to provide an image enhancement method, device, equipment and storage medium, aiming to solve the technical problem that the images collected by the prior art have low quality, resulting in low target detection efficiency and detection accuracy, and being unable to accurately detect the defects existing on the board surface.

[0005] To achieve the above purpose, the present invention provides an image enhancement method, and the method includes the following steps:

[0006] Collect images of the original color card based on the AOI light source to obtain original background color images corresponding to various colors in the AOI light source, where the AOI light source includes light sources of various colors;

[0007] Process the original background color images to obtain target background color images;

[0008] Collect the original image of the post-furnace circuit board to be detected based on the AOI light source;

[0009] Enhance the original image based on the target background color images to obtain target images, so as to detect the post-furnace circuit board to be detected based on the target images.

[0010] Optionally, the processing the original background color images to obtain target background color images includes:

[0011] Separate the channel colors of the original background color images corresponding to the various colors to obtain single-channel background color images corresponding to the various colors;

[0012] Analyze each of the single-channel base color images to obtain the minimum pixel value of each single-channel base color image;

[0013] Based on the minimum pixel value, perform gray value processing on each pixel position in the single-channel base color image to obtain the target base color images corresponding to the multiple colors.

[0014] Optionally, the separating the original base color image corresponding to the multiple colors into single-channel base color images includes:

[0015] Separate the original base color image corresponding to the multiple colors into channels;

[0016] Perform filtering processing on each original base color image after channel color separation to obtain candidate images;

[0017] Perform color inversion processing on the candidate images to obtain the single-channel base color images corresponding to the multiple colors.

[0018] Optionally, the analyzing each of the single-channel base color images to obtain the minimum pixel value of each single-channel base color image includes:

[0019] Obtain the color space information of the single-channel base color image;

[0020] Generate a color histogram corresponding to the single-channel base color image based on the color space information;

[0021] Perform pixel analysis based on the color histogram to obtain the minimum pixel value of each single-channel base color image.

[0022] Optionally, the generating a color histogram corresponding to the single-channel base color image based on the color space information includes:

[0023] Convert each pixel in the single-channel base color image into a discrete color in the color space based on the color space information;

[0024] Obtain the number of pixels where each discrete color appears in the single-channel base color image;

[0025] Determine a color vector based on the number of pixels;

[0026] Generate a color histogram corresponding to the single-channel base color image based on the color vector.

[0027] Optionally, the enhancing the original image based on the target base color image to obtain a target image includes:

[0028] Separate the original image into channel images corresponding to each color based on the multiple colors;

[0029] Subtract the channel images corresponding to each color from the target background color image to obtain the target channel images corresponding to each color;

[0030] Perform image synthesis based on the target channel images corresponding to each color to complete image enhancement of the original image and obtain the target image.

[0031] Optionally, the image acquisition of the original color card based on the AOI light source to obtain the original background color images corresponding to multiple colors in the AOI light source includes:

[0032] Obtain image acquisition parameters;

[0033] Set the original color card in the preset acquisition area;

[0034] Illuminate the original color card based on the AOI light source;

[0035] Perform image acquisition on the illuminated original color card based on the image acquisition parameters to obtain the original background color images corresponding to multiple colors in the AOI light source.

[0036] In addition, to achieve the above object, the present invention also provides an image enhancement device, which includes:

[0037] A color card acquisition module, configured to perform image acquisition on the original color card based on the AOI light source to obtain the original background color images corresponding to multiple colors in the AOI light source;

[0038] A background color image processing module, configured to process the original background color image to obtain the target background color image;

[0039] A target acquisition module, configured to acquire the original image of the post-furnace circuit board to be detected based on the AOI light source;

[0040] An image enhancement module, configured to perform image enhancement on the original image based on the target background color image to obtain the target image, so as to detect the post-furnace circuit board to be detected based on the target image.

[0041] In addition, to achieve the above object, the present invention also provides an image enhancement device, which includes: a memory, a processor, and an image enhancement program stored on the memory and executable on the processor, and the image enhancement program is configured to implement the steps of the image enhancement method as described above.

[0042] In addition, to achieve the above object, the present invention also provides a storage medium, on which an image enhancement program is stored, and when the image enhancement program is executed by a processor, it implements the steps of the image enhancement method as described above.

[0043] The present invention acquires an original background image corresponding to multiple colors in the AOI light source by collecting an image of an original color card based on the AOI light source, processes the original background image to obtain a target background image, collects an original image of a post-furnace circuit board to be detected based on the AOI light source, enhances the original image based on the target background image to obtain a target image, and detects the post-furnace circuit board to be detected based on the target image; since the present invention processes the original background images corresponding to multiple colors and enhances the original image of the post-furnace circuit board to be detected based on the obtained target background image after processing, it realizes a significant improvement in the image quality of the post-furnace circuit board to be detected, and detects the post-furnace circuit board to be detected based on the enhanced target image, thereby improving the target detection efficiency and detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a schematic structural diagram of an image enhancement device in the hardware operating environment related to the embodiment solution of the present invention;

[0045] Figure 2 is a schematic flowchart of the first embodiment of the image enhancement method of the present invention;

[0046] Figure 3 is a schematic flowchart of the second embodiment of the image enhancement method of the present invention;

[0047] Figure 4 is a schematic flowchart of the third embodiment of the image enhancement method of the present invention;

[0048] Figure 5 is a structural block diagram of the first embodiment of the image enhancement device of the present invention.

[0049] The realization, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0051] Refer to Figure 1 , Figure 1 is a schematic structural diagram of an image enhancement device in the hardware operating environment related to the embodiment solution of the present invention.

[0052] As Figure 1As shown in the figure, the image enhancement device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed Random Access Memory (RAM) or a stable Non-Volatile Memory (NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0053] Those skilled in the art can understand that Figure 1 the structure shown in does not constitute a limitation on the image enhancement device, and it may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0054] As Figure 1 shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and an image enhancement program.

[0055] In Figure 1 the image enhancement device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the image enhancement device of the present invention may be provided in the image enhancement device. The image enhancement device calls the image enhancement program stored in the memory 1005 through the processor 1001 and executes the image enhancement method provided by the embodiments of the present invention.

[0056] The embodiments of the present invention provide an image enhancement method. Referring to Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of an image enhancement method of the present invention.

[0057] In this embodiment, the image enhancement method includes the following steps:

[0058] Step S10: Based on the AOI light source, image acquisition is performed on the original color card to obtain the original background color maps corresponding to various colors in the AOI light source, where the AOI light source includes light sources of various colors.

[0059] It should be noted that this embodiment is applied to the production process of PCBA in the electronic production line. Here, PCBA represents Printed Circuit Board Assembly, that is, printed circuit board assembly. In this process, various electronic components on the printed circuit board (PCB) are installed and connected to form the core part of the final electronic product. In this embodiment, after the PCB after the furnace has undergone reflow soldering or wave soldering, it is necessary to detect the defects on the board surface where the solder joints are located. By performing AOI lighting and acquisition on the post-furnace circuit board to be detected, the lighting imaging of the AOI light source is particularly important. The AOI light source is a circular tower-shaped light source composed of three circles of light sources at different angles. From the outside to the inside, it can be blue light, green light, and red light.

[0060] It should be understood that the execution subject of the method in this embodiment can be an image enhancement device with data processing, network communication, and program running functions, such as a vision detection device, a computer, or other devices or equipment that can achieve the same or similar functions. Here, the above image enhancement device is taken as an example for description.

[0061] It should be noted that the AOI light source can be composed of an RGB three-color high-brightness LED array, which is a light source that irradiates an object at different angles and with different colors. In this embodiment, light sources of three colors, namely red light, green light, and blue light, are taken as examples for description. The above original color card can be a color card for calibrating colors and acquiring background color maps. For example, the original color card can be a white color card. The original background color maps corresponding to the above-mentioned colors can be the background color maps corresponding to each color collected after using the light sources corresponding to each color to illuminate the original color card.

[0062] It can be understood that this embodiment is described by taking a white color card as an example. The white color card usually has a uniform white background, which enables it to provide a consistent reference background under light and color conditions. When placing the product on the white color card and performing image acquisition in AOI image detection, the influence of the product's own color or surface material can be eliminated, making the image easier to analyze and process.

[0063] In a specific implementation, after the image enhancement device determines the acquisition parameters, the white color card is placed at the acquisition position, and the white color card at the acquisition position is illuminated and photographed respectively using red light, green light, and blue light in the AOI light source, so as to acquire three background color maps corresponding to red light, green light, and blue light.

[0064] Furthermore, in order to effectively collect the background color map, the above step S10 includes:

[0065] Get image acquisition parameters;

[0066] Set the original color card in the preset acquisition area;

[0067] Lighting the original color card based on the AOI light source;

[0068] Based on the image acquisition parameters, image acquisition is performed on the original color card after lighting to obtain the original background color image corresponding to the multiple colors in the AOI light source.

[0069] It should be noted that the above-mentioned image acquisition parameters may be acquisition parameters of an acquisition device (e.g., a camera), for example, the image acquisition parameters may include camera white balance, exposure time, gain, and other parameters. The above-mentioned AOI light source may be an AOI light source of multiple colors, for example, the AOI light source may include red light, green light, and blue light sources in the AOI light source. The above-mentioned preset acquisition area may be an image acquisition area or a photographing surface, etc.

[0070] It can be understood that the image enhancement device can perform image acquisition on the original background color card after determining the parameters, specifically including: determining the image acquisition parameters and light source parameters of the acquisition device, the above light source parameters may include parameters such as the brightness value of each channel of the AOI light source; after determining the parameters, the original background color card (such as a white background color card) is placed in a preset acquisition area, and the red light, green light and blue light of the AOI light source are used to illuminate and take pictures separately, to produce I RB ,I GB and I BB Three original background images.

[0071] Step S20: Process the original background color image to obtain a target background color image.

[0072] It should be noted that the target background color map may be a new background color map obtained by processing the original background color maps corresponding to the light sources of each color.

[0073] It can be understood that this embodiment can perform channel color separation on the original background color image corresponding to each color, extract the image corresponding to each channel color, and then obtain a new target background color image after processing through noise reduction, filtering, inversion and other processing methods. The new target background color image can be a single-channel background color image corresponding to each color.

[0074] For example, the image enhancement device uses the red light, green light and blue light in the AOI light source to illuminate the original color card and take a photo to obtain I RB ,I GB and I BBThree original background color images are processed respectively to obtain new single-channel images corresponding to each color: I RB ', I GB ', and I BB '.

[0075] Step S30: Based on the AOI light source, collect the original image of the post-furnace circuit board to be detected.

[0076] It should be noted that the post-furnace circuit board to be detected can be a PCBA after the furnace, that is, a PCB board after the assembly and soldering of electronic components. For example, the post-furnace circuit board to be detected can be a PCB board after reflow soldering or wave soldering.

[0077] It can be understood that the process of detecting the solder joints and patches of the post-furnace circuit board to be detected is as follows: The XY translation module drives the camera lens and the AOI light source to move and take pictures. Each time, a partial image of the bottom of the PCBA board is taken, and the detection result is output by analyzing the patch and solder joint information in the image.

[0078] It should be understood that in this embodiment, by using the three-color light of the AOI light source to illuminate simultaneously, the post-furnace circuit board to be detected (such as the PCB board after the furnace) is placed on the photographing surface to collect the original image to be processed.

[0079] Step S40: Based on the target background color image, perform image enhancement on the original image to obtain a target image, and detect the post-furnace circuit board to be detected based on the target image.

[0080] It should be noted that in this embodiment, the original image to be processed can be subjected to channel color separation to obtain single-channel images corresponding to each color. Based on the target background color images corresponding to each color, image subtraction is performed on the single-channel images corresponding to their respective colors to obtain new target single-channel images corresponding to each color. The target single-channel images corresponding to each color are synthesized to obtain an enhanced target image, thereby completing the enhancement effect of the image of the post-furnace circuit board to be detected, and then defect detection is performed based on the enhanced target image, thereby effectively improving the visual detection efficiency and detection accuracy.

[0081] In this embodiment, background color images are taken based on light sources of multiple colors, and then the collected original background color images are processed to eliminate stray light by using the background color images. Image enhancement is performed on the original image of the post-furnace circuit board to be detected based on the target background color image obtained after processing, which greatly improves the image quality of the post-furnace circuit board to be detected. Detection is performed on the post-furnace circuit board to be detected based on the enhanced target image, which compensates for the accuracy of visual detection, effectively avoids the problem of low visual detection accuracy caused by poor quality of the collected image, thereby improving the target detection efficiency and detection accuracy, and accurately detecting the defects existing on the board surface.

[0082] Reference Figure 3 , Figure 3 is a schematic flowchart of the second embodiment of an image enhancement method according to the present invention.

[0083] Based on the above first embodiment, in this embodiment, the step S20 includes:

[0084] Step S21: Perform channel color separation on the original background color maps corresponding to the multiple colors to obtain single-channel background color maps corresponding to the multiple colors.

[0085] It should be noted that the single-channel background color map can be the background color map of the single-channel color corresponding to each color. For example, the red light background color map corresponding to the red light source is subjected to channel color separation to obtain a red single-channel background color map.

[0086] Further, in order to effectively process the background color map and improve the auxiliary efficiency of the background color map, the above step S21 may include:

[0087] Step S211: Perform channel color separation on the original background color maps corresponding to the multiple colors;

[0088] Step S212: Perform filtering processing on each original background color map after channel color separation to obtain a candidate image;

[0089] Step S213: Perform color inversion processing on the candidate image to obtain single-channel background color maps corresponding to the multiple colors.

[0090] It can be understood that the image enhancement device separates the three background color maps of I RB 、I GB and I BB into a red channel image R, a green channel image G, and a blue channel image B respectively, and uses the mean filter algorithm to perform smoothing filtering on the images of each channel to remove noise and detail information. Using the mean filter can better eliminate pixel spikes, making the distribution curve relatively smooth, which is beneficial to histogram analysis; the mean filter can be described by the following formula:

[0091]

[0092] Among them, I in (x,y) represents the image table value of the input image at the coordinate (x,y), and I out (x,y) represents the pixel value of the output image at the coordinate (x,y), and K represents the size of the filter. In the mean filter, we take the average of the pixel values of K×K pixels around each pixel in the input image and use the average value as the pixel value of the corresponding pixel in the output image.

[0093] Color Inversion: Perform color inversion on the image of each channel. Let the original image be I(x, y), where (x, y) represents the pixel position in the image, and I(x, y) represents the pixel value at that position. The process of image color inversion can be expressed by the following formula:

[0094] I'(x, y) = 255 - I(x, y)

[0095] where I'(x, y) represents the pixel value after color inversion. This formula subtracts the value of each pixel in the original image from 255 to obtain the pixel value after color inversion. Since the pixel value range of the image is usually from 0 to 255, the pixel value after color inversion is also between 0 and 255, obtaining a single-channel background color image I RB ', I GB ', and I BB '.

[0096] Step S22: Analyze each of the single-channel background color images to obtain the minimum pixel value of each single-channel background color image.

[0097] It should be noted that the minimum pixel value can be the lowest pixel value in the single-channel background color image.

[0098] It can be understood that in this embodiment, the color distribution of each single-channel background color image can be analyzed to determine the number of pixels of each color in the color space of the single-channel background color image, so as to determine the minimum pixel value of the single-channel background color image.

[0099] Furthermore, in order to accurately obtain the minimum pixel value, the above step S22 may include:

[0100] Step S221: Obtain the color space information of the single-channel background color image;

[0101] Step S222: Generate a color histogram corresponding to the single-channel background color image based on the color space information;

[0102] Step S223: Perform pixel analysis based on the color histogram to obtain the minimum pixel value of each single-channel background color image.

[0103] It should be noted that the color histogram can be a statistical image used to describe the color distribution of an image.

[0104] It can be understood that in this embodiment, the total number of pixels of the image is set to N, the dimension of the color space is d (for example, d = 3 in the RGB color space), and the color vector of the i-th pixel is Ci = (Ci1, Ci2,..., Cid), where Ci1, Ci2,..., Cid respectively represent the values of this pixel on d color channels. Assuming that there are k discrete colors in the color space (for example, k = 256 for a 256-color grayscale image), the color histogram can be represented as a k-dimensional vector H = (H1, H2,..., Hk), where Hi represents the number of pixels in which the i-th color in the color space appears in the image.

[0105] Take the minimum value Hi of the number of pixels in the color histogram, and perform pixel subtraction on the new image I' after color flipping. Its formula is expressed as: I”(x, y) = I'(x, y) - Hi, where I” is the new image after calculation, and the new image I is obtained. RB ”, I GB ” and I BB ”.

[0106] Further, in order to effectively analyze the color space distribution, the above step S222 may include:

[0107] Convert each pixel in the single-channel background color map into a discrete color in the color space based on the color space information;

[0108] Obtain the number of pixels in which each of the discrete colors appears in the single-channel background color map;

[0109] Determine the color vector based on the number of pixels;

[0110] Generate a color histogram corresponding to the single-channel background color map based on the color vector.

[0111] It should be understood that the calculation of the color histogram can be completed through the following steps: First, convert all pixels of the image into discrete colors in the color space. For example, each channel in the RGB color space is quantized into 256 discrete values; count the number of pixels in which each discrete color appears in the image to obtain the color histogram vector H.

[0112] Step S23: Perform grayscale value processing on each pixel position in the single-channel background color map based on the pixel minimum value to obtain the target background color map corresponding to the multiple colors.

[0113] It can be understood that in this embodiment, by obtaining the grayscale values of each pixel position in the single-channel background color map, subtracting each grayscale value by the pixel minimum value, a new image is obtained, that is, the target background color map corresponding to the multiple colors is obtained.

[0114] In a specific implementation, the image enhancement device analyzes the color distribution of a single-channel background image, obtains the minimum pixel value of each image, then traverses the pixels of each single-channel background image, obtains the gray value at each pixel position, and subtracts the minimum value from the gray value at each pixel position to obtain a new image, that is, the target background image, which vividly describes the light source intensity distribution of the light source on the imaging surface;

[0115] In this embodiment, the original background image is subjected to channel color separation, then the color distribution of each single-channel background image is analyzed to obtain the minimum pixel value of each image, and then the gray value at each pixel position is subtracted from the minimum value to obtain the target background image corresponding to the multiple colors, thereby realizing the processing of the background image, improving the quality of the background image, and realizing the elimination of stray light using the background image and improving the image quality.

[0116] Reference Figure 4 , Figure 4 is a schematic flowchart of the third embodiment of an image enhancement method of the present invention.

[0117] Based on the above first embodiment, in this embodiment, the step S40 includes:

[0118] Step S41: Based on the multiple colors, perform channel color separation on the original image to obtain channel images corresponding to the respective colors.

[0119] It should be noted that in this embodiment, single-channel color separation is performed on the original image based on multiple colors. For example, the original image is separated into a red channel image I R , a green channel image I G and a blue channel image I B .

[0120] Step S42: Subtract the channel images corresponding to the respective colors from the target background image to obtain target channel images corresponding to the respective colors.

[0121] It can be understood that the image enhancement device collects a color checker, performs channel color separation on three background images respectively, and then performs smoothing filtering and color inversion on the corresponding channels to obtain single-channel new images I RB ', I GB ' and I BB ', performs color histogram analysis on the three new images to obtain the minimum pixel value of each image, and then subtracts the minimum value from the gray value at each pixel position to obtain new images I RB ”, I GB ” and I BB ”, and the red channel image I R , the green channel image I G and the blue channel image I BRespectively with I RB ”, I GB ” and I BB ” perform image subtraction, and the formula is I R ' = I R - I RB ”, I G ' = I G - I GB ”, I B ' = I B - I BB ”.

[0122] Step S43: Based on the target channel images corresponding to each color, perform image synthesis to complete image enhancement of the original image and obtain the target image.

[0123] It can be understood that the image enhancement device synthesizes three new single-channel images into the enhanced result image I1 to complete image enhancement, and its expression is:

[0124] I1 = [R(x, y), G(x, y), B(x, y)]

[0125] In this embodiment, by performing single-channel color separation on the original image of the post-furnace circuit board to be detected, single-channel images of each color are obtained. The single-channel images are subtracted from the processed target background color image to obtain the subtraction results corresponding to each color. The subtraction results corresponding to each color are fused to obtain the enhanced effect image, thereby realizing the enhancement of the acquired image of the post-furnace circuit board to be detected and improving the target detection efficiency and detection accuracy.

[0126] In addition, an embodiment of the present invention also provides a storage medium, on which an image enhancement program is stored. When the image enhancement program is executed by a processor, the steps of the image enhancement method described above are implemented.

[0127] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be elaborated here one by one.

[0128] Referring to Figure 5 , Figure 5 is the structural block diagram of the first embodiment of the image enhancement device of the present invention.

[0129] As Figure 5 shown, the image enhancement device proposed by the embodiment of the present invention includes:

[0130] The color card acquisition module 10 is used to acquire an image of the original color card based on the AOI light source to obtain the original background color images corresponding to multiple colors in the AOI light source, and the AOI light source includes light sources of multiple colors;

[0131] The background color image processing module 20 is configured to process the original background color image to obtain a target background color image;

[0132] The target acquisition module 30 is configured to acquire an original image of the post-furnace circuit board to be detected based on the AOI light source;

[0133] The image enhancement module 40 is configured to perform image enhancement on the original image based on the target background color image to obtain a target image, so as to detect the post-furnace circuit board to be detected based on the target image.

[0134] It should be noted that the AOI light source may be an AOI light source. In this embodiment, light sources of three colors, red, green, and blue, are taken as examples for illustration. The above-mentioned original color card may be a color card for calibrating colors and acquiring background color images. For example, the original color card may be a white color card. The original background color images corresponding to the above-mentioned colors may be the background color images corresponding to each color collected after illuminating the original color card with the light sources corresponding to each color.

[0135] It can be understood that in this embodiment, a white color card is taken as an example for illustration. The white color card usually has a uniform white background, which enables it to provide a consistent reference background under different light and color conditions. When the product is placed on the white color card and the image is acquired during AOI image detection, the influence of the color or surface material of the product itself can be eliminated, making the image easier to analyze and process.

[0136] In a specific implementation, after the image enhancement device determines the acquisition parameters, the white color card is placed at the acquisition position, and the white color card at the acquisition position is illuminated and photographed respectively with red, green, and blue lights in the AOI light source, so as to acquire three background color images corresponding to red, green, and blue lights.

[0137] Further, in order to effectively acquire the background color image, the above step S10 includes:

[0138] Obtain image acquisition parameters;

[0139] Set the original color card in a preset acquisition area;

[0140] Illuminate the original color card based on the AOI light source;

[0141] Acquire an image of the illuminated original color card based on the image acquisition parameters to obtain the original background color images corresponding to multiple colors in the AOI light source.

[0142] It should be noted that the above-mentioned image acquisition parameters may be acquisition parameters of an acquisition device (e.g., a camera), for example, the image acquisition parameters may include camera white balance, exposure time, gain, and other parameters. The above-mentioned AOI light source may be an AOI light source of multiple colors, for example, the AOI light source may include red light, green light, and blue light sources in the AOI light source. The above-mentioned preset acquisition area may be an image acquisition area or a photographing surface, etc.

[0143] It can be understood that the image enhancement device can perform image acquisition on the original background color card after determining the parameters, specifically including: determining the image acquisition parameters and light source parameters of the acquisition device, the above light source parameters may include parameters such as the brightness value of each channel of the AOI light source; after determining the parameters, the original background color card (such as a white background color card) is placed in a preset acquisition area, and the red light, green light and blue light of the AOI light source are used to illuminate and take pictures separately, to produce I RB ,I GB and I BB Three original background images.

[0144] It should be noted that the target background color map may be a new background color map obtained by processing the original background color maps corresponding to the light sources of each color.

[0145] It can be understood that this embodiment can perform channel color separation on the original background color image corresponding to each color, extract the image corresponding to each channel color, and then obtain a new target background color image after processing through noise reduction, filtering, inversion and other processing methods. The new target background color image can be a single-channel background color image corresponding to each color.

[0146] For example, the image enhancement device uses the red light, green light and blue light in the AOI light source to illuminate the original color card and take a photo to obtain I RB ,I GB and I BB Three original background images, the original background images are processed separately to obtain the single-channel new images corresponding to each color: I RB '、I GB 'and I BB '.

[0147] It should be noted that the post-furnace circuit board to be inspected may be a post-furnace target, for example, the post-furnace circuit board to be inspected may be a PCB board that has been subjected to reflow soldering or wave soldering.

[0148] It can be understood that the process of detecting the solder joints and patches of the circuit board after the furnace is as follows: through the XY translation module, the camera lens and the AOI light source are driven to move and take pictures, each time a local image of the bottom of the PCBA board is taken, and the patch and solder joint information in the image is analyzed to output the detection results.

[0149] It should be understood that in this embodiment, by using the three-color light of the AOI light source to illuminate simultaneously, the post-furnace circuit board to be detected (such as the PCB board after the furnace) is placed on the photographing surface to collect the original image to be processed.

[0150] It should be noted that in this embodiment, the original image to be processed can be subjected to channel color separation to obtain single-channel images corresponding to each color. Based on the target background color maps corresponding to each color, the single-channel images corresponding to their respective colors are subtracted from each other to obtain new target single-channel images corresponding to each color. The target single-channel images corresponding to each color are synthesized to obtain the enhanced target image, thereby completing the enhancement effect of the image of the post-furnace circuit board to be detected. Then, based on the enhanced target image, defect detection is performed, thereby effectively improving the visual detection efficiency and detection accuracy.

[0151] In this embodiment, background color maps are captured based on light sources of multiple colors, and then the collected original background color maps are processed to eliminate stray light by using the background color maps. Based on the obtained target background color maps after processing, the original images of the post-furnace circuit boards to be detected are enhanced, significantly improving the image quality of the post-furnace circuit boards to be detected. Based on the enhanced target images, the post-furnace circuit boards to be detected are detected, compensating for the accuracy of visual detection, effectively avoiding the problem of low visual detection accuracy caused by poor quality of the collected images, thereby improving the target detection efficiency and detection accuracy, and accurately detecting the defects existing on the board surface.

[0152] It should be understood that the above is only for illustrative purposes and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can set according to needs, and the present invention does not make any restrictions in this regard.

[0153] It should be noted that the above-described work process is only illustrative and does not constitute a limitation to the protection scope of the present invention. In actual applications, those skilled in the art can select some or all of them according to actual needs to achieve the purpose of the solution of this embodiment, and no restrictions are made here.

[0154] In addition, for the technical details not described in detail in this embodiment, reference can be made to the image enhancement method provided in any embodiment of the present invention, which will not be elaborated here.

[0155] In addition, it should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or system comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements inherent to such process, method, article or system. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or system comprising that element.

[0156] The serial numbers of the above-described embodiments of the present invention are for description only and do not represent the superiority or inferiority of the embodiments.

[0157] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as Read Only Memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0158] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the description of the present invention and the content of the drawings, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. An image enhancement method, characterized in that, The described image enhancement method includes: Performing image acquisition on the original color card based on the AOI light source to obtain the original background color maps corresponding to multiple colors in the AOI light source, where the AOI light source includes light sources of multiple colors; Processing the original background color maps to obtain the target background color maps; Collecting the original image of the post-furnace circuit board to be detected based on the AOI light source; Performing image enhancement on the original image based on the target background color maps to obtain the target image, so as to detect the post-furnace circuit board to be detected based on the target image.

2. The image enhancement method according to claim 1, wherein The processing the original background color maps to obtain the target background color maps includes: Performing channel color separation on the original background color maps corresponding to the multiple colors to obtain the single-channel background color maps corresponding to the multiple colors; Analyzing each of the single-channel background color maps to obtain the pixel minimum value of each of the single-channel background color maps; Performing gray value processing on each pixel position in the single-channel background color maps based on the pixel minimum value to obtain the target background color maps corresponding to the multiple colors.

3. The image enhancement method according to claim 2, wherein The performing channel color separation on the original background color maps corresponding to the multiple colors to obtain the single-channel background color maps corresponding to the multiple colors includes: Performing channel color separation on the original background color maps corresponding to the multiple colors; Performing filtering processing on each of the original background color maps after channel color separation to obtain candidate images; Performing color inversion processing on the candidate images to obtain the single-channel background color maps corresponding to the multiple colors.

4. The image enhancement method according to claim 2, wherein The analyzing each of the single-channel background color maps to obtain the pixel minimum value of each of the single-channel background color maps includes: Obtaining the color space information of the single-channel background color maps; Generating a color histogram corresponding to the single-channel background color maps based on the color space information; Performing pixel analysis based on the color histogram to obtain the pixel minimum value of each of the single-channel background color maps.

5. The image enhancement method according to claim 4, wherein The generating a color histogram corresponding to the single-channel background color maps based on the color space information includes: Converting each pixel in the single-channel background color maps into discrete colors in the color space based on the color space information; Obtaining the number of pixels where each of the discrete colors appears in the single-channel background color maps; Determining a color vector based on the number of pixels; Generating a color histogram corresponding to the single-channel background color maps based on the color vector.

6. The image enhancement method according to claim 1, wherein The performing image enhancement on the original image based on the target background color maps to obtain the target image includes: Performing channel color separation on the original image based on the multiple colors to obtain channel images corresponding to each color; Subtracting the channel images corresponding to each color from the target background color maps to obtain target channel images corresponding to each color; Performing image synthesis based on the target channel images corresponding to each color to complete image enhancement of the original image and obtain the target image.

7. The image enhancement method according to claim 1, wherein The performing image acquisition on the original color card based on the AOI light source to obtain the original background color maps corresponding to multiple colors in the AOI light source includes: Obtaining image acquisition parameters; Setting the original color card in a preset acquisition area; Illuminating the original color card based on the AOI light source; Performing image acquisition on the original color card after lighting based on the image acquisition parameters to obtain the original background color maps corresponding to various colors in the AOI light source.

8. An image enhancement device, characterized in that, The image enhancement device includes: A color card acquisition module, configured to perform image acquisition on the original color card based on the AOI light source to obtain the original background color maps corresponding to various colors in the AOI light source, where the AOI light source includes light sources of various colors; A background color map processing module, configured to process the original background color maps to obtain target background color maps; A target acquisition module, configured to acquire the original image of the post-furnace circuit board to be detected based on the AOI light source; An image enhancement module, configured to perform image enhancement on the original image based on the target background color maps to obtain a target image, so as to detect the post-furnace circuit board to be detected based on the target image.

9. An image enhancement device, characterized in that, The image enhancement device includes: a memory, a processor, and an image enhancement program stored on the memory and executable on the processor, where the image enhancement program is configured to implement the image enhancement method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, An image enhancement program is stored on the storage medium, and when the image enhancement program is executed by the processor, it implements the image enhancement method according to any one of claims 1 to 7.