An image correction method and device based on side light source brightness

By adjusting the angle and position of the side light source, grayscale information of dark and bright field images is obtained, and the gain response coefficient and bias coefficient are calculated to correct the LCD surface image. This solves the problem of inconsistent contrast caused by uneven illumination and improves the recognition effect of the detection equipment.

CN119831910BActive Publication Date: 2025-10-28TRULY OPTO ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411842384.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-10-28
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

Uneven light from the side light source on the LCD surface causes inconsistent contrast of dust and scratches near and far from the light source during imaging, making it impossible for the image algorithm to perform effective threshold segmentation.

Method used

By adjusting the angle and position of the side light source, grayscale information of dark and bright field images is obtained, the gain response coefficient and bias coefficient of each pixel are calculated, and image correction processing is performed to homogenize the illumination intensity.

Benefits of technology

After correction, the contrast consistency of dust and scratches is enhanced, making it easier for testing equipment to better identify defects on the LCD surface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831910B_ABST
    Figure CN119831910B_ABST
Patent Text Reader

Abstract

This invention provides an image correction method and apparatus based on the brightness of a side light source. A bright-field image is obtained by capturing an image with a camera; a dark-field image is obtained by capturing an image without illuminating the side light source; the dark-field and bright-field images are processed respectively to obtain grayscale information of the dark-field and bright-field images; based on the grayscale information of the dark-field and bright-field images, the gain response coefficient and bias coefficient of each pixel are determined; an image of an LCD with dust scratches under side light illumination is acquired, and the image is corrected based on the gain response coefficient and bias coefficient. Compared with existing technologies, by correcting the uniformity of image brightness, the contrast of dust scratches near and far from the side light source is enhanced and becomes uniform after correction, thus facilitating better identification and detection of dust and scratches on the LCD surface by subsequent detection equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image correction technology, and more specifically, to an image correction method and device based on the brightness of a side light source. Background Technology

[0002] Before automatic LCD inspection, side light sources are typically used to illuminate the dust and scratches on the protective film of the LCD surface. This allows for the identification of dust and scratches during LCD function testing, preventing them from being misjudged as LCD malfunctions. However, to ensure that dust and scratches are displayed on the camera image as much as possible, the side light source is usually tilted at an angle of 30 to 45 degrees relative to the LCD surface and placed on the outer edge of the LCD.

[0003] This results in uneven light distribution on the LCD surface from the side light source. Consequently, the contrast of dust and scratches farther from the light source is less noticeable than that of those closer to the light source, leading to inconsistent contrast. This makes it difficult for image algorithms to perform effective threshold segmentation of dust and scratches. Summary of the Invention

[0004] The technical problem this application aims to solve is that the light illuminating the LCD surface from a side light source is not uniform, resulting in less noticeable contrast for dust and scratches farther from the light source during imaging compared to those closer to the light source. This inconsistent contrast makes it difficult for image algorithms to perform effective threshold segmentation of dust and scratches. This embodiment addresses this issue by employing an image processing method that corrects the uniformity of image brightness, enabling the detection device to better identify and detect dust and scratches on the LCD surface.

[0005] The first aspect of this embodiment provides an image correction method based on the brightness of a side light source, the method comprising:

[0006] After adjusting the angle and position of the side light source, place a flat, crease-free piece of white paper at the test position below the camera to illuminate the side light source. Adjust the camera's exposure time and gain coefficient to ensure that the camera image is not overexposed. The camera captures the image to obtain a bright field image (White_Image). Without illuminating the side light source, the camera captures the image to obtain a dark field image (Black_Image).

[0007] The dark field image (Black_Image) and the bright field image (White_Image) are processed respectively to obtain grayscale information of the dark field image and the bright field image. The grayscale information of the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image. The grayscale information of the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image.

[0008] Based on the grayscale information of the dark field image and the grayscale information of the bright field image, determine the gain response coefficient and the bias coefficient of each pixel;

[0009] An LCD image with dust and scratches is captured under side lighting, and the captured image is corrected based on the gain response coefficient and the bias coefficient.

[0010] Furthermore, the processing of the dark field image Black_Image and the bright field image White_Image respectively includes:

[0011] The dark field image Black_Image and the bright field image White_Image are processed using the median filtering algorithm to remove noise from the images, generating the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

[0012] Furthermore, the acquisition of grayscale information of the dark field image and the bright field image includes:

[0013] The grayscale value Black_GrayValue of each pixel in the black field filtered image Black_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value Black_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image;

[0014] The sum of the gray values ​​of all pixels is obtained by adding up the gray values ​​of the dark field image to get the total gray value of the dark field image, Black_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the dark field image, Black_GrayValue_Mean.

[0015] The bright field image grayscale value White_GrayValue of each pixel in the bright field filtered image White_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value White_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image;

[0016] The sum of the gray values ​​of all pixels is obtained by adding them together to get the total gray value of the bright field image, White_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the bright field image, White_GrayValue_Mean.

[0017] Furthermore, determining the gain response coefficient and bias coefficient of each pixel based on the grayscale information of the dark field image and the grayscale information of the bright field image includes:

[0018] The gain response coefficient for each pixel is calculated as follows:

[0019] K=(White_GrayValue_Mean-Black_GrayValue_Mean)

[0020] / (White_GrayValue-Black_GrayValue);

[0021] The bias coefficient for each pixel is:

[0022] B=Black_GrayValue_Mean-Black_GrayValue*K.

[0023] Furthermore, the acquisition of an LCD image with dust scratches under side lighting, and the correction processing of the image based on the gain response coefficient and the bias coefficient, includes:

[0024] Multiply the grayscale value of each pixel in the image captured by the LCD by the gain response coefficient K, and add the bias coefficient B to obtain the side illumination uniformity correction map.

[0025] A second aspect of this embodiment provides an image correction device based on side light source brightness. The device includes an acquisition module, a processing module, a determination module, and a correction module, wherein:

[0026] The acquisition module is used to adjust the angle and position of the side light source, place a flat, crease-free white paper at the test position below the camera to illuminate the side light source, adjust the camera exposure time and gain coefficient to prevent the camera image from being overexposed, and then capture the image to obtain a bright field image (White_Image); without illuminating the side light source, the camera captures the image to obtain a dark field image (Black_Image).

[0027] The processing module is used to process the dark field image Black_Image and the bright field image White_Image respectively to obtain grayscale information of the dark field image and the bright field image; the grayscale information of the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image; the grayscale information of the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image.

[0028] The determination module is used to determine the gain response coefficient and the bias coefficient of each pixel based on the grayscale information of the dark field image and the grayscale information of the bright field image.

[0029] The correction module is used to acquire LCD images with dust scratches under side light source illumination, and to perform correction processing on the acquired images based on the gain response coefficient and the bias coefficient.

[0030] Furthermore, the processing module is also used for:

[0031] The dark field image Black_Image and the bright field image White_Image are processed using the median filtering algorithm to remove noise from the images, generating the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

[0032] Furthermore, the processing module is also used for:

[0033] The grayscale value Black_GrayValue of each pixel in the black field filtered image Black_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value Black_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image;

[0034] The sum of the gray values ​​of all pixels is obtained by adding up the gray values ​​of the dark field image to get the total gray value of the dark field image, Black_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the dark field image, Black_GrayValue_Mean.

[0035] The bright field image grayscale value White_GrayValue of each pixel in the bright field filtered image White_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value White_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image;

[0036] The sum of the gray values ​​of all pixels is obtained by adding them together to get the total gray value of the bright field image, White_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the bright field image, White_GrayValue_Mean.

[0037] Furthermore, the determining module is also used for:

[0038] The gain response coefficient for each pixel is calculated as follows:

[0039] K=(White_GrayValue_Mean-Black_GrayValue_Mean)

[0040] / (White_GrayValue-Black_GrayValue);

[0041] The bias coefficient for each pixel is:

[0042] B=Black_GrayValue_Mean-Black_GrayValue*K.

[0043] Furthermore, a third aspect of this embodiment provides a storage medium storing a computer program; the program is loaded and executed by a processor to implement the image correction method steps based on side light source brightness as described in the first aspect above.

[0044] In this invention, after adjusting the angle and position of the side light source, a smooth, unblemished white sheet of paper is placed at the test position below the camera to illuminate the side light source. The camera's exposure time and gain coefficient are adjusted to prevent overexposure, and the camera captures the image to obtain a bright field image (White_Image). Without illuminating the side light source, the camera captures an image to obtain a dark field image (Black_Image). The dark field image (Black_Image) and the bright field image (White_Image) are processed to obtain grayscale information for the dark field image and the bright field image. The grayscale information for the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image. The grayscale information for the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image. Based on the grayscale information for the dark field image and the grayscale information for the bright field image, the gain response coefficient and the bias coefficient of each pixel are determined. An image of an LCD with dust and scratches under side light illumination is acquired, and the captured image is corrected based on the gain response coefficient and the bias coefficient. Compared with the prior art, the embodiments of this application have the following advantages: through image processing that corrects the uniformity of image brightness, the contrast of dust and scratches at different distances from the side light source is enhanced and the contrast is the same after correction, which makes it easier for the detection equipment to better identify and detect dust and scratches on the LCD surface. Attached Figure Description

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 This is a schematic diagram of the overall hardware structure of the device structure disclosed in the embodiments of the present invention;

[0047] Figure 2 This is a flowchart illustrating the image correction method based on side light source brightness disclosed in an embodiment of the present invention;

[0048] Figure 3This invention discloses a method for obtaining bright field images by capturing images with a camera in an embodiment of the invention.

[0049] Figure 4 This invention discloses a method for obtaining dark-field images by capturing images with a camera according to an embodiment of the invention.

[0050] Figure 5 This is a dark field image after median filtering and smoothing, as disclosed in an embodiment of the present invention;

[0051] Figure 6 This is the bright field image after median filtering and smoothing disclosed in the embodiments of the present invention;

[0052] Figure 7 These are comparison images before and after correction as disclosed in the embodiments of the present invention. Detailed Implementation

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0054] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0055] It should be noted that "multiple" as mentioned in this article refers to two or more.

[0056] The implementation details of the technical solutions in the embodiments of this application are described in detail below:

[0057] Please see Figure 1 , Figure 1 This is a schematic diagram of the overall hardware structure of the device in this embodiment. In this embodiment, as shown... Figure 1 As shown, the side light source is tilted at an angle of 30 to 45 degrees relative to the LCD surface and is placed on the outer edge of the LCD. The camera takes pictures of the LCD surface vertically from above.

[0058] In the first aspect of this embodiment, an image correction method based on the brightness of a side light source is implemented. Please refer to... Figure 2 , Figure 2 This is a schematic flowchart of an image correction method based on side light source brightness disclosed in an embodiment of the present invention. Figure 2 As shown, the image correction method based on side light source brightness according to an embodiment of the present invention includes:

[0059] S201. After adjusting the angle and position of the side light source, place a flat, crease-free piece of white paper at the test position below the camera to illuminate the side light source. Adjust the camera exposure time and gain coefficient to ensure that the camera image is not overexposed. The camera captures the image to obtain a bright field image (White_Image). Without illuminating the side light source, the camera captures the image to obtain a dark field image (Black_Image).

[0060] Specifically, in this embodiment, according to Figure 1 After adjusting the angle and position of the side light source, a smooth, uncreased piece of white paper was placed below the camera at the test position to illuminate the side light source. The camera exposure time and gain coefficient were adjusted to ensure the image was not overexposed, with the highest brightness grayscale value in the image around 200. The camera then captured the image to obtain a bright-field image (White_Image), as shown below. Figure 3 The image shown is a bright field image obtained by the camera in this embodiment.

[0061] Without illuminating the side light source, the camera captures a dark-field image (Black_Image). For example... Figure 4 The image shown is a dark-field image obtained by capturing a photograph with the camera in this embodiment.

[0062] S202, the dark field image Black_Image and the bright field image White_Image are processed respectively to obtain the grayscale information of the dark field image and the grayscale information of the bright field image; the grayscale information of the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image; the grayscale information of the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image.

[0063] Further, in S202, the step of processing the dark field image Black_Image and the bright field image White_Image respectively includes: processing the dark field image Black_Image and the bright field image White_Image respectively using a median filtering algorithm to remove noise from the image and generate a dark field filtered image Black_Median_Image and a bright field filtered image White_Median_Image.

[0064] Further, in S202, the acquisition of grayscale information of the dark field image and the bright field image includes: obtaining the grayscale value Black_GrayValue of each pixel in the dark field filtered image Black_Median_Image through a grayscale value acquisition algorithm; the grayscale value Black_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image; the grayscale values ​​of all pixels are added together to obtain the sum of the grayscale values ​​of the dark field image Black_GrayValue_Sum; and then divided by the number of pixels to obtain the mean grayscale value of the dark field image Black_GrayValue_Mean.

[0065] The bright field image grayscale value White_GrayValue of each pixel in the bright field filtered image White_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value White_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image; the grayscale values ​​of all pixels are added together to obtain the sum of the grayscale values ​​of the bright field image White_GrayValue_Sum; then divided by the number of pixels, the mean grayscale value of the bright field image White_GrayValue_Mean is obtained.

[0066] Specifically, in this embodiment, the Black_Image and White_Image images are processed using a median filter algorithm to remove noise and smooth the images. The resulting images are Black_Median_Image and White_Median_Image after median filtering. Figure 5 This is the dark field image after medium-range filtering and smoothing in this embodiment; as shown... Figure 6 This is the bright field image after moderate filtering and smoothing in this embodiment.

[0067] Furthermore, the grayscale value Black_GrayValue of each pixel in the image Black_Median_Image is obtained using the grayscale value acquisition algorithm GetGrayval() (this value is an array, where each number in the array corresponds to the grayscale value of each pixel in the image). The grayscale values ​​of all pixels are then summed to obtain the total grayscale value Black_GrayValue_Sum, which is then divided by the number of pixels to obtain the grayscale mean Black_GrayValue_Mean. Similarly, White_GrayValue, White_GrayValue_Sum, and White_GrayValue_Mean of the bright-field image are obtained.

[0068] S203, based on the grayscale information of the dark field image and the grayscale information of the bright field image, determine the gain response coefficient and the bias coefficient of each pixel.

[0069] Specifically, in this embodiment, the gain response coefficient of each pixel can be derived further based on the data obtained above:

[0070] K=(White_GrayValue_Mean-Black_GrayValue_Mean)

[0071] / (White_GrayValue-Black_GrayValue);

[0072] Bias coefficient B = Black_GrayValue_Mean - Black_GrayValue * K;

[0073] Here, K and B are both arrays, with each data point in the array corresponding to a pixel in the image. Using these two coefficients K and B, the brightness uniformity of the dust-free and scratch-free image during testing can be corrected.

[0074] S204, acquire an LCD image with dust scratches under side light source illumination, and perform correction processing on the acquired image based on the gain response coefficient and the bias coefficient.

[0075] In S204, the step of acquiring an LCD image with dust scratches under side light source illumination and performing correction processing on the captured image based on the gain response coefficient and the bias coefficient includes: multiplying the gray value of each pixel of the LCD captured image by the gain response coefficient K, and adding the bias coefficient B to obtain a side light illumination uniformity correction map.

[0076] Specifically, in this embodiment, a normal test LCD with dust and scratches is placed at the test position, with a bright side light source, and the camera takes a picture. The image is smoothed and noise is reduced. Then, each pixel of the image is corrected by multiplying the gray value of each pixel of the image by K and adding B, so as to obtain the side lighting uniformity correction image.

[0077] In the corrected image, the brightness and contrast of dust and scratches on the LCD surface are more consistent with the background, making it easier to segment and identify them using image algorithms with uniform thresholds. For example... Figure 7 The image shown is a comparison before and after correction in this embodiment. Before correction, the dust scratches appear darker the farther away from the side light source and brighter the closer they are. After correction, the contrast of dust scratches at both near and far distances from the side light source is enhanced and the contrast is the same.

[0078] A second aspect of this embodiment provides an image correction device based on side light source brightness. The device includes an acquisition module, a processing module, a determination module, and a correction module, wherein:

[0079] The acquisition module is used to adjust the angle and position of the side light source, place a flat, crease-free white paper at the test position below the camera to illuminate the side light source, adjust the camera exposure time and gain coefficient to prevent the camera image from being overexposed, and then capture the image to obtain a bright field image (White_Image); without illuminating the side light source, the camera captures the image to obtain a dark field image (Black_Image).

[0080] The processing module is used to process the dark field image Black_Image and the bright field image White_Image respectively to obtain grayscale information of the dark field image and the bright field image; the grayscale information of the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image; the grayscale information of the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image.

[0081] The determination module is used to determine the gain response coefficient and the bias coefficient of each pixel based on the grayscale information of the dark field image and the grayscale information of the bright field image.

[0082] The correction module is used to acquire LCD images with dust scratches under side light source illumination, and to perform correction processing on the acquired images based on the gain response coefficient and the bias coefficient.

[0083] Furthermore, the processing module is also used for:

[0084] The dark field image Black_Image and the bright field image White_Image are processed using the median filtering algorithm to remove noise from the images, generating the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

[0085] Furthermore, the processing module is also used for:

[0086] The grayscale value Black_GrayValue of each pixel in the black field filtered image Black_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value Black_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image;

[0087] The sum of the gray values ​​of all pixels is obtained by adding up the gray values ​​of the dark field image to get the total gray value of the dark field image, Black_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the dark field image, Black_GrayValue_Mean.

[0088] The bright field image grayscale value White_GrayValue of each pixel in the bright field filtered image White_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value White_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image;

[0089] The sum of the gray values ​​of all pixels is obtained by adding them together to get the total gray value of the bright field image, White_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the bright field image, White_GrayValue_Mean.

[0090] Furthermore, the determining module is also used for:

[0091] The gain response coefficient for each pixel is calculated as follows:

[0092] K=(White_GrayValue_Mean-Black_GrayValue_Mean)

[0093] / (White_GrayValue-Black_GrayValue);

[0094] The bias coefficient for each pixel is:

[0095] B=Black_GrayValue_Mean-Black_GrayValue*K.

[0096] Furthermore, the acquisition of an LCD image with dust scratches under side lighting, and the correction processing of the image based on the gain response coefficient and the bias coefficient, includes:

[0097] Multiply the grayscale value of each pixel in the image captured by the LCD by the gain response coefficient K, and add the bias coefficient B to obtain the side illumination uniformity correction map.

[0098] Furthermore, embodiments of this application also disclose an electronic device comprising: one or more processors, and a memory for storing one or more computer programs; characterized in that the computer programs are configured to be executed by the one or more processors, and the programs include steps for performing the image correction method based on side light source brightness as described in the first aspect above.

[0099] Furthermore, embodiments of this application also provide a storage medium storing a computer program; the program is loaded and executed by a processor to implement the image correction steps based on side light source brightness as described in the first aspect above.

[0100] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0101] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, or may be electrical, mechanical or other forms of connection.

[0102] The units described as separate components may or may not be physically separate. As will be appreciated by those skilled in the art, the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0103] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0104] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or grid device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] 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. An image correction method based on side light source brightness, characterized in that, The method includes: After adjusting the angle and position of the side light source, place a flat, crease-free piece of white paper at the test position below the camera to illuminate the side light source. Adjust the camera's exposure time and gain coefficient to ensure that the camera image is not overexposed. The camera captures the image to obtain a bright field image (White_Image). Without illuminating the side light source, the camera captures the image to obtain a dark field image (Black_Image). The dark field image (Black_Image) and the bright field image (White_Image) are processed respectively to obtain grayscale information of the dark field image and the bright field image. The grayscale information of the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image. The grayscale information of the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image. Based on the grayscale information of the dark field image and the grayscale information of the bright field image, determine the gain response coefficient and the bias coefficient of each pixel; An LCD image with dust and scratches is captured under side lighting, and the captured image is corrected based on the gain response coefficient and the bias coefficient.

2. The image correction method based on side light source brightness according to claim 1, characterized in that, The process of processing the dark-field image Black_Image and the bright-field image White_Image respectively includes: The dark field image Black_Image and the bright field image White_Image are processed using the median filtering algorithm to remove noise from the images, generating the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

3. The image correction method based on side light source brightness according to claim 2, characterized in that, The acquisition of grayscale information of dark field image and grayscale information of bright field image includes: The grayscale value Black_GrayValue of each pixel in the black field filtered image Black_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value Black_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image; The sum of the gray values ​​of all pixels is obtained by adding up the gray values ​​of the dark field image to get the total gray value of the dark field image, Black_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the dark field image, Black_GrayValue_Mean. The bright field image grayscale value White_GrayValue of each pixel in the bright field filtered image White_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value White_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image; The sum of the gray values ​​of all pixels is obtained by adding them together to get the total gray value of the bright field image, White_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the bright field image, White_GrayValue_Mean.

4. The image correction method based on side light source brightness according to claim 3, characterized in that, The step of determining the gain response coefficient and bias coefficient of each pixel based on the grayscale information of the dark field image and the grayscale information of the bright field image includes: The gain response coefficient for each pixel is calculated as follows: K=(White_GrayValue_Mean-Black_ GrayValue_Mean) / (White_GrayValue-Black_GrayValue); The bias coefficient for each pixel is: B=Black_GrayValue_Mean-Black_GrayValue*K.

5. The image correction method based on side light source brightness according to claim 4, characterized in that, The process of acquiring an LCD image with dust scratches under side light illumination, and then correcting the image based on the gain response coefficient and the bias coefficient, includes: Multiply the grayscale value of each pixel in the image captured by the LCD by the gain response coefficient K, and add the bias coefficient B to obtain the side illumination uniformity correction map.

6. An image correction device based on side light source brightness, characterized in that, The device includes a data acquisition module, a processing module, a determination module, and a correction module, wherein: The acquisition module is used to adjust the angle and position of the side light source, place a flat, crease-free white paper at the test position below the camera to illuminate the side light source, adjust the camera exposure time and gain coefficient to prevent the camera image from being overexposed, and then capture the image to obtain a bright field image (White_Image); without illuminating the side light source, the camera captures the image to obtain a dark field image (Black_Image). The processing module is used to process the dark field image Black_Image and the bright field image White_Image respectively to obtain grayscale information of the dark field image and the bright field image; the grayscale information of the dark field image includes the grayscale value of the dark field image, the sum of the grayscale values ​​of the dark field image, and the average grayscale value of the dark field image; the grayscale information of the bright field image includes the grayscale value of the bright field image, the sum of the grayscale values ​​of the bright field image, and the average grayscale value of the bright field image. The determination module is used to determine the gain response coefficient and the bias coefficient of each pixel based on the grayscale information of the dark field image and the grayscale information of the bright field image. The correction module is used to acquire LCD images with dust scratches under side light source illumination, and to perform correction processing on the acquired images based on the gain response coefficient and the bias coefficient.

7. The image correction device based on side light source brightness according to claim 6, characterized in that, The processing module is further configured to: The dark field image Black_Image and the bright field image White_Image are processed using the median filtering algorithm to remove noise from the images, generating the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

8. The image correction device based on side light source brightness according to claim 7, characterized in that, The processing module is further configured to: The grayscale value Black_GrayValue of each pixel in the black field filtered image Black_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value Black_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image; The sum of the gray values ​​of all pixels is obtained by adding up the gray values ​​of the dark field image to get the total gray value of the dark field image, Black_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the dark field image, Black_GrayValue_Mean. The bright field image grayscale value White_GrayValue of each pixel in the bright field filtered image White_Median_Image is obtained through a grayscale value acquisition algorithm; the grayscale value White_GrayValue is an array, and each number in the array corresponds to the grayscale value of each pixel in the image; The sum of the gray values ​​of all pixels is obtained by adding them together to get the total gray value of the bright field image, White_GrayValue_Sum; then, it is divided by the number of pixels to get the mean gray value of the bright field image, White_GrayValue_Mean.

9. The image correction device based on side light source brightness according to claim 8, characterized in that, The determining module is also used for The gain response coefficient for each pixel is calculated as follows: K=(White_GrayValue_Mean-Black_ GrayValue_Mean) / (White_GrayValue-Black_GrayValue); The bias coefficient for each pixel is: B=Black_GrayValue_Mean-Black_GrayValue*K.

10. A storage medium storing a computer program; the program being loaded and executed by a processor to implement the steps of the image correction method based on side light source brightness as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Mobile phone screen backlight foreign matter defect diagnosis method and device based on machine vision

    CN110445921A

  • Flat panel detector image correction method and device

    CN115170423A