Light source irradiation brightness uniformity test method and device and electronic equipment
By collecting and correcting images in the AOI detection device, determining the brightness uniformity area and coefficient of the light source, the problem of insufficient uniformity of the light source is solved, and the recognition rate and imaging effect of the detection target are improved.
Patent Information
- Application Number
- CN202411893004.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-04
AI Technical Summary
The irradiation uniformity of the light source in the AOI detection device results in uneven imaging of the target, a decrease in recognition rate, and an increase in missed detection error rate.
The camera collects images and performs flat field correction, determines the brightness uniformity area range of the light source, and calculates the brightness uniformity coefficient to determine whether the light source meets the uniformity standards.
By accurately quantizing the brightness uniformity of the light source, it is determined whether it can be used for imaging of the AOI detection device, thereby improving the contrast recognition rate of the detection target.
Smart Images

Figure CN119756572A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of light source detection technology, and in particular to a method, device and electronic equipment for testing the uniformity of light source illumination brightness. Background Art
[0002] AOI (Automated Optical Inspection) is based on optical principles to detect common defects encountered in welding production.
[0003] When AOI inspection equipment is performing target detection, it generally uses external light sources to enhance the contrast recognition rate of the detection target when the camera is imaging. The uniformity of the light source will directly affect the imaging effect of the target. A light source with poor uniformity will cause uneven imaging of the target, resulting in a lower recognition rate during detection and an increase in the rate of missed or false detection of products. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present application is to detect whether the light source meets the uniformity standard, so that it can be used as an external light source to enhance the detection target when the camera is imaging. The purpose of the embodiments of the present invention is to test the uniformity of the light source illumination brightness to determine whether the uniformity of the light source can be used as an external light source to assist the camera in imaging, thereby enhancing the contrast recognition rate of the detection target.
[0005] A first aspect of the present invention provides a method for testing the uniformity of illumination brightness of a light source, which is used to test the light source of an AOI inspection device, wherein the AOI inspection device includes a camera, and is characterized in that the method includes: Capturing a first image using a camera, and performing flat field correction on the first image based on a flat field correction coefficient to obtain a first flat field correction image; Performing image processing on the first flat field correction image, and determining a brightness uniformity region range that needs to be tested when the light source in the first flat field correction image is actually used; The brightness uniformity coefficient within the brightness uniformity area is determined according to the grayscale values of the pixels within the brightness uniformity area.
[0006] Furthermore, before the camera captures the first image, the method further includes: Perform flat field correction on the camera and calculate the grayscale correction coefficient K of each pixel; The camera exposure and gain coefficient are adjusted so that the highest grayscale value in the image of the light source imaged by the camera is within a predetermined range.
[0007] Further, the collecting the first image according to the camera includes: According to the camera after adjusting the camera exposure and gain coefficient, the first image is acquired; the image processing of the first flat field correction image includes: performing denoising processing on the first flat field correction image.
[0008] Further, determining the brightness uniformity coefficient within the brightness uniformity region according to the pixel grayscale values within the brightness uniformity region includes: Determine the maximum gray value Max_Gray and the minimum gray value Min_Gray of the pixels within the brightness uniformity area to be tested; The brightness uniformity coefficient A of the brightness of the area is determined according to the maximum gray value Max_Gray and the minimum gray value Min_Gray: A= .
[0009] Furthermore, the step of determining the brightness uniformity coefficient within the brightness uniformity region according to the pixel grayscale values within the brightness uniformity region further includes: If the brightness uniformity coefficient is greater than the first threshold, it is determined that the uniformity of the light source is qualified and can be used for imaging by the AOI detection device.
[0010] In addition, a second aspect of the present invention provides a light source illumination brightness uniformity testing device, the system is used to test the light source of an AOI detection device, the AOI detection device includes a camera, and the device includes an acquisition and correction module, an area determination module, and a uniformity determination module; wherein: An acquisition and correction module, configured to acquire a first image using a camera, and perform flat field correction on the first image based on a flat field correction coefficient to obtain a first flat field correction image; An area determination module, configured to perform image processing on the first flat field correction image, and determine a brightness uniformity area range that needs to be tested when the light source in the first flat field correction image is actually used; The uniformity determination module is used to determine the brightness uniformity coefficient within the brightness uniformity area according to the pixel grayscale values within the brightness uniformity area.
[0011] Furthermore, the device also includes a pre-adjustment module, which is used to: perform flat field correction on the camera to calculate the grayscale correction coefficient K of each pixel; adjust the camera exposure and gain coefficient so that the highest grayscale value in the image of the light source imaged by the camera is within a predetermined range.
[0012] Furthermore, the acquisition and correction module is further used to acquire the first image according to the camera after adjusting the camera exposure and gain coefficient; The uniformity determination module is also used to determine the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray of the pixels within the brightness uniformity area to be tested; and determine the brightness uniformity coefficient A of the brightness of the area according to the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray: A= .
[0013] In addition, the third aspect of the present invention provides an electronic device, which includes: one or more processors, and a memory, wherein the memory is used to store one or more computer programs; the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the light source illumination brightness uniformity test method as described in the first aspect.
[0014] In addition, a fourth aspect of the present invention provides a storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the light source illumination brightness uniformity testing method as described in the first aspect above.
[0015] In the solution of the present invention, a first flat field correction map is obtained by collecting a first image according to a camera and performing flat field correction on the first image based on a flat field correction coefficient; image processing is performed on the first flat field correction map, and the brightness uniformity area range that needs to be tested when the light source is actually used in the first flat field correction map is determined; and the brightness uniformity coefficient within the area range is determined according to the pixel grayscale value within the brightness uniformity area range. Compared with the prior art, the embodiment of the present application has the following main beneficial effects: after adjusting the camera and the light source and correcting the image, the brightness uniformity area that needs to be tested is selected to perform accurate quantitative calculation of the brightness uniformity, thereby determining whether the uniformity of the light source can be used as an external light source to assist the camera imaging, thereby enhancing the contrast recognition rate of the detection target. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 It is a schematic diagram of the overall hardware structure of the device structure disclosed in the embodiment of the present invention; Figure 2 It is a flow chart of an AOI detection method for shielding a Mark on a display screen disclosed in an embodiment of the present invention; Figure 3This is a captured image disclosed in an embodiment of the present invention when the maximum grayscale value of the image is around 200.
[0018] The reference numerals in the figure are: 1, camera, 2, light-transmitting plate, 3, light-controlling film, 4, light source, 5, dark box. DETAILED DESCRIPTION
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of this application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0020] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0021] It should be noted that the “plurality” mentioned in this article refers to two or more.
[0022] The implementation details of the technical solution of the embodiment of the present application are described in detail below: See also Figure 1 , Figure 1 The overall hardware structure diagram of the device structure of this embodiment is shown in FIG. In this embodiment, the hardware structure of the device includes: a light source bracket, a light-transmitting plate, a light-controlling film, a camera, a dark box, and an industrial computer.
[0023] Among them, the light source bracket is used to fix the light source to be tested. The light-transmitting plate is a transparent plate substrate with a smooth surface, which can be glass. The light-control film is used to control the transmittance of the light source. The stronger the light source, the lower the transmittance of the light-control film is used to compensate for the fact that the camera's own exposure and gain parameter setting functions cannot meet the adjustment of the brightness of the light source that is too strong. The camera is used to collect images. The entire test process is operated in a dark box to prevent external lighting from affecting the imaging. The computer performs image algorithm processing and uniformity calculation.
[0024] In a first aspect of this embodiment, a method for testing the uniformity of light source illumination brightness is implemented, which is used to test the light source of an AOI inspection device, wherein the AOI inspection device includes a camera. Figure 2 , Figure 2 FIG. 1 is a flow chart of a method for testing the uniformity of light source illumination brightness disclosed in an embodiment of the present invention. Figure 2 As shown, the method for testing the uniformity of illumination brightness of a light source according to an embodiment of the present invention includes: S201, collecting a first image with a camera, and performing flat field correction on the first image based on a flat field correction coefficient to obtain a first flat field correction image.
[0025] Specifically, in this embodiment, before the camera captures the first image, the method also includes: performing flat field correction on the camera to calculate the grayscale correction coefficient K of each pixel; adjusting the camera exposure and gain coefficient so that the highest grayscale value in the image of the light source imaged by the camera is within a predetermined range.
[0026] In this embodiment, before the formal test of the captured image, the camera is first subjected to flat-field correction (Flat-field correction) to calculate the grayscale correction coefficient K of each pixel. Flat-field correction (FFC) is a technology to improve the quality of digital imaging. The flat-field correction coefficient K refers to a parameter used to correct the non-uniformity of the image or camera response, mainly including gain and offset. By adjusting these parameters, the image can look more uniform and smooth.
[0027] Flat field correction usually includes the following steps: (1) Dark field correction: Use fixed pattern noise (FPN) correction, i.e. dark field correction, to eliminate the fixed background noise of the image. (2) Bright field correction: Use photo response non-uniformity (PRNU) correction, i.e. bright field correction, to eliminate the non-uniform response of the image. (3) Pixel response rate correction: Calculate the gain and bias parameters by counting the response rate of each pixel. (4) Image correction function: Correct each pixel according to the gain and bias parameters to make the entire image look more uniform.
[0028] Further, the capturing of the first image according to the camera includes: capturing the first image according to the camera after adjusting the exposure and gain coefficient of the camera.
[0029] Specifically, in this embodiment, before acquiring the first image, the camera is fixed on a bracket and the imaging focus of the camera on the light-transmitting flat plate is adjusted to be clear; the light source to be tested is fixed on the bracket, and the height and brightness of the light source are adjusted to the required test conditions, and the light from the light source passes through the light-controlling film and the light-transmitting flat plate into the camera.
[0030] In some embodiments, the camera exposure and gain coefficient are adjusted so that the highest grayscale value in the image of the light source imaged by the camera is between 150 and 200. If the camera exposure time and gain coefficient are adjusted to the minimum, the camera image of the light source is still in an overexposed state. Figure 1 In the device hardware structure diagram shown, the light-control film with lower transmittance can be replaced to reduce the intensity of the light source.
[0031] Then, the first image is captured according to the camera after adjusting the camera exposure and gain coefficient.
[0032] S202: Perform image processing on the first flat field correction image, and determine a brightness uniformity region range that needs to be tested when the light source in the first flat field correction image is actually used.
[0033] The performing image processing on the first flat field correction image includes: performing denoising processing on the first flat field correction image.
[0034] Specifically, in this embodiment, the camera captures an image and uses a flat field correction coefficient to perform flat field correction on the image to compensate for the image grayscale difference caused by uneven light from the camera lens shadow, thereby obtaining a flat field correction image.
[0035] S203: Determine a brightness uniformity coefficient within the brightness uniformity region according to the grayscale values of the pixels within the brightness uniformity region.
[0036] Further, determining the brightness uniformity coefficient within the brightness uniformity region according to the grayscale values of the pixels within the brightness uniformity region includes: determining the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray of the pixels within the brightness uniformity region to be tested; and determining the brightness uniformity coefficient A of the brightness within the region according to the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray: A= .
[0037] Furthermore, determining the brightness uniformity coefficient within the brightness uniformity area according to the pixel grayscale values within the area also includes: if the brightness uniformity coefficient is greater than a first threshold, determining that the uniformity of the light source is qualified and can be used for imaging by the AOI detection device.
[0038] Specifically, in this embodiment, the flat field image is subjected to noise reduction, and the brightness uniformity region range required for testing when the light source in the image is actually used is selected. Figure 3The figure shows the range of the brightness uniformity area to be tested in this embodiment, wherein the area within the yellow circle is the brightness uniformity area to be tested for the image. The highest grayscale value Max_Gray and the lowest grayscale value Min_Gray in the area are calculated, and the brightness uniformity in the test area is obtained by dividing Min_Gray by Max_Gray, ranging from 0 to 100%. The higher the calculated value, the better the illumination uniformity of the light source under the conditions of the illumination height and illumination brightness.
[0039] In some embodiments, the brightness uniformity area of the image to be tested may also be a rectangular area or an area in other forms, and the location may be any area in the image.
[0040] In this embodiment, a first threshold value may be set, such as 90%. If "the maximum gray value Max_Gray and the minimum gray value Min_Gray in the area" are greater than 90%, it is determined that the uniformity of the light source is qualified and can be used for imaging of the AOI detection device.
[0041] In summary, in this embodiment, a first flat field correction image is obtained by acquiring a first image according to a camera and performing flat field correction on the first image based on a flat field correction coefficient; image processing is performed on the first flat field correction image, and the brightness uniformity region range that needs to be tested when the light source is actually used in the first flat field correction image is determined; and the brightness uniformity coefficient within the region range is determined according to the pixel grayscale value within the brightness uniformity region range. Compared with the prior art, the embodiment of the present application has the following main beneficial effects: after adjusting the camera and the light source and correcting the image, the brightness uniformity region that needs to be tested is selected to perform accurate quantitative calculation of the brightness uniformity, thereby determining whether the uniformity of the light source can be used as an external light source to assist the camera imaging, thereby enhancing the contrast recognition rate of the detection target.
[0042] In addition, a second aspect of this embodiment provides a light source illumination brightness uniformity testing device, the system is used to test the light source of an AOI detection device, the AOI detection device includes a camera, and the device includes an acquisition and correction module, an area determination module, and a uniformity determination module; wherein: An acquisition and correction module, configured to acquire a first image using a camera, and perform flat field correction on the first image based on a flat field correction coefficient to obtain a first flat field correction image; An area determination module, configured to perform image processing on the first flat field correction image, and determine a brightness uniformity area range that needs to be tested when the light source in the first flat field correction image is actually used; The uniformity determination module is used to determine the brightness uniformity coefficient within the brightness uniformity area according to the pixel grayscale values within the brightness uniformity area.
[0043] Furthermore, the device also includes a pre-adjustment module, which is used to: perform flat field correction on the camera to calculate the grayscale correction coefficient K of each pixel; adjust the camera exposure and gain coefficient so that the highest grayscale value in the image of the light source imaged by the camera is within a predetermined range.
[0044] Furthermore, the acquisition and correction module is further used to acquire the first image according to the camera after adjusting the camera exposure and gain coefficient; The uniformity determination module is also used to determine the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray of the pixels within the brightness uniformity area to be tested; and determine the brightness uniformity coefficient according to the ratio of the maximum grayscale value Max_Gray to the minimum grayscale value Min_Gray.
[0045] The performing image processing on the first flat field correction image includes: performing denoising processing on the first flat field correction image.
[0046] The uniformity determination module is also used to: if the brightness uniformity coefficient is greater than a first threshold, determine that the uniformity of the light source is qualified and can be used for imaging of the AOI detection equipment.
[0047] In addition, an embodiment of the present application also discloses an electronic device, which includes: one or more processors, and a memory, wherein the memory is used to store one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the light source illumination brightness uniformity test method described in the first aspect above.
[0048] In addition, an embodiment of the present application further provides a storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the light source illumination brightness uniformity testing method as described in the first aspect above.
[0049] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0050] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0051] The units described as separate components may or may not be physically separated. As a unit, it can be appreciated by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0052] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0053] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a grid device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0054] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for testing the uniformity of light source illumination brightness, used to test the light source of an AOI inspection device, wherein the AOI inspection device includes a camera, characterized in that: The method comprises: Capturing a first image using a camera, and performing flat field correction on the first image based on a flat field correction coefficient to obtain a first flat field correction image; Performing image processing on the first flat field correction image, and determining a brightness uniformity region range that needs to be tested when the light source in the first flat field correction image is actually used; The brightness uniformity coefficient within the brightness uniformity area is determined according to the grayscale values of the pixels within the brightness uniformity area.
2. The method for testing the uniformity of light source illumination brightness according to claim 1, characterized in that: Before collecting the first image by the camera, the method further includes: Perform flat field correction on the camera and calculate the grayscale correction coefficient K of each pixel; The camera exposure and gain coefficient are adjusted so that the highest grayscale value in the image of the light source imaged by the camera is within a predetermined range.
3. The method for testing the uniformity of light source illumination brightness according to claim 2, characterized in that: The acquiring the first image according to the camera includes: acquiring the first image according to the camera after adjusting the exposure and gain coefficient of the camera; and the performing image processing on the first flat field correction image includes: performing denoising processing on the first flat field correction image.
4. The method for testing the uniformity of light source illumination brightness according to claim 3, characterized in that: The step of determining the brightness uniformity coefficient within the brightness uniformity region according to the pixel grayscale values within the brightness uniformity region includes: Determine the maximum gray value Max_Gray and the minimum gray value Min_Gray of the pixels within the brightness uniformity area to be tested; The brightness uniformity coefficient A of the brightness of the area is determined according to the maximum gray value Max_Gray and the minimum gray value Min_Gray: A= 。 5. The method for testing the uniformity of light source illumination brightness according to claim 4, characterized in that: The step of determining the brightness uniformity coefficient within the brightness uniformity region according to the pixel grayscale values within the brightness uniformity region further includes: If the brightness uniformity coefficient is greater than the first threshold, it is determined that the uniformity of the light source is qualified and can be used for imaging by the AOI detection device.
6. A light source illumination brightness uniformity testing device, characterized in that: The system is used to test the light source of an AOI inspection device, wherein the AOI inspection device includes a camera, and the device includes an acquisition and correction module, an area determination module, and a uniformity determination module; wherein: An acquisition and correction module, configured to acquire a first image using a camera, and perform flat field correction on the first image based on a flat field correction coefficient to obtain a first flat field correction image; An area determination module, configured to perform image processing on the first flat field correction image, and determine a brightness uniformity area range that needs to be tested when the light source in the first flat field correction image is actually used; The uniformity determination module is used to determine the brightness uniformity coefficient within the brightness uniformity area according to the pixel grayscale values within the brightness uniformity area.
7. The light source illumination brightness uniformity testing device according to claim 6, characterized in that: The device also includes a pre-adjustment module, which is used to: perform flat field correction on the camera to calculate the grayscale correction coefficient K of each pixel; adjust the camera exposure and gain coefficient so that the highest grayscale value in the image of the light source imaged by the camera is within a predetermined range.
8. The light source illumination brightness uniformity testing device according to claim 7, characterized in that: The acquisition and correction module is further used to acquire the first image according to the camera after adjusting the camera exposure and gain coefficient; The uniformity determination module is also used to determine the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray of the pixels within the brightness uniformity area to be tested; and determine the brightness uniformity coefficient A of the brightness of the area according to the maximum grayscale value Max_Gray and the minimum grayscale value Min_Gray: A= .
9. An electronic device, comprising: One or more processors, a memory, wherein the memory is used to store one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the light source illumination brightness uniformity testing method as described in any one of claims 1-5.
10. A storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the light source illumination brightness uniformity testing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Light source brightness detection method and system
CN104581135A
Monochrome area array CCD camera flat-field correction method and monochrome area array CCD camera flat-field correction system
CN107835337A
Control method, electronic device and storage medium
CN110581958A
Control method, electronic device and storage medium
CN110913149A
Illumination uniformity detection method and device and readable storage medium
CN111609998A