Image correction method and device based on side light source brightness

By adjusting the angle and position of the side light source, calculating the gain response coefficient and bias coefficient, and performing image correction processing, the problem of uneven illumination of the side light source is solved, and uniform enhancement of the contrast of dust and scratches is achieved, which is easy to identify and detect.

CN119831910AActive Publication Date: 2025-04-15TRULY OPTO ELECTRONICS
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The light irradiated by the side light source on the LCD surface is uneven, resulting in inconsistent contrast between dust and scratches, making it difficult for the image algorithm to perform effective threshold segmentation processing.

Method used

By adjusting the angle and position of the side light source, obtaining dark and bright field images, calculating the gain response coefficient and bias coefficient of each pixel, and performing image correction processing to uniformize the brightness of the side light source.

Benefits of technology

After correction, the contrast between dust and scratches is evenly enhanced, making it easier for the detection equipment to identify and detect dust and scratches on the LCD surface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831910A_ABST
    Figure CN119831910A_ABST
Patent Text Reader

Abstract

The invention provides an image correction method and device based on side light source brightness. A bright field image is obtained through image taking and photographing of a camera; under the condition that the side light source is not lightened, the camera collects an image to obtain a dark field image; respectively processing the dark field image and the bright field image to obtain dark field image gray information and bright field image gray information; determining a gain response coefficient and a bias coefficient of each pixel according to the dark field image gray information and the bright field image gray information; and acquiring an LCD shot image with dust scratches under the irradiation of the side light source, and correcting the shot image based on the gain response coefficient and the bias coefficient. Compared with the prior art, through image processing for correcting the image brightness uniformity, after correction, the contrast ratios of dust scratches far and near to a side light source are enhanced and are the same, so that a detection device can better identify and detect the dust and scratches on the surface of the LCD subsequently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image correction, and in particular to an image correction method and device based on side light source brightness. Background Art

[0002] Before the LCD automatic inspection equipment is used for inspection, the dust on the LCD surface and the scratches on the protective film are usually illuminated with a side light source, so that the dust and scratches can be identified first when the LCD function screen is inspected, avoiding misjudgment of them as LCD malfunctions. However, in order to make the dust and scratches appear as much as possible on the camera image, the side light source is generally 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 from the side light source shining on the LCD surface, causing the contrast of dust and scratches farther away from the light source to be less obvious than those closer to the light source during imaging. The contrast is inconsistent, making it impossible for the image algorithm to perform threshold segmentation processing on dust and scratches well. Summary of the invention

[0004] The technical problem to be solved by the embodiments of the present application is to solve the problem that the light irradiated by the side light source on the LCD surface is not uniform, resulting in the contrast of dust and scratches farther away from the light source being less obvious than those closer to the light source during imaging. The contrast is inconsistent, causing the image algorithm to be unable to perform threshold segmentation processing on dust and scratches well. This embodiment uses an image processing method for correcting the uniformity of image brightness, so that the detection equipment can better identify and detect dust and scratches on the LCD surface.

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

[0006] After adjusting the angle and position of the side light source, place a piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera imaging is not overexposed, and the camera takes a picture to obtain a bright field image White_Image; without lighting the side light source, the camera collects images 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 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 mean of the grayscale values ​​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 mean of the grayscale values ​​of the bright field image;

[0008] Determining a gain response coefficient and a bias coefficient of each pixel according to the dark field image grayscale information and the bright field image grayscale information;

[0009] A captured image of an LCD with dust and scratches illuminated by a side light source is acquired, and correction processing is performed on the captured image based on the gain response coefficient and the bias coefficient.

[0010] Further, 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 by the median filtering algorithm respectively to remove the noise in the image and generate the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

[0012] Further, the obtaining of the grayscale information of the dark field image and the grayscale information of the bright field image includes:

[0013] The dark field image grayscale value Black_GrayValue of each pixel of the dark field filter image Black_Median_Image is obtained by 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 on the image;

[0014] Add the gray values ​​of all pixels to get the total gray value of the dark field image Black_GrayValue_Sum; then divide it by the number of pixels to get the gray mean dark field image gray mean Black_GrayValue_Mean;

[0015] The bright field image grayscale value White_GrayValue of each pixel of the bright field filter image White_Median_Image is obtained by 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 on the image;

[0016] Add up the gray values ​​of all pixels to get the sum of the gray values ​​of the bright field image White_GrayValue_Sum; then divide it by the number of pixels to get the gray mean bright field image gray mean White_GrayValue_Mean.

[0017] Further, determining the gain response coefficient and the bias coefficient of each pixel according to 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:

[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] Further, the acquiring of a captured image of an LCD with dust and scratches under illumination of a side light source, and performing correction processing on the captured image based on the gain response coefficient and the bias coefficient, comprises:

[0024] The grayscale value of each pixel of the LCD captured image is multiplied by the gain response coefficient K, and then added with the bias coefficient B to obtain a side light illumination uniformity correction map.

[0025] A second aspect of this embodiment provides an image correction device based on side light source brightness, the device comprising 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 piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera imaging is not overexposed, and the camera takes a picture to obtain a bright field image White_Image; without lighting the side light source, the camera collects images to obtain a dark field image Black_Image;

[0027] A 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 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 mean of the grayscale values ​​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 mean of the grayscale values ​​of the bright field image;

[0028] A determination module, used to determine the gain response coefficient and the bias coefficient of each pixel according to the grayscale information of the dark field image and the grayscale information of the bright field image;

[0029] The correction module is used to obtain a captured image of an LCD with dust and scratches under the illumination of a side light source, and to perform correction processing on the captured image 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 by the median filtering algorithm respectively to remove the noise in the image and generate 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 dark field image grayscale value Black_GrayValue of each pixel of the dark field filter image Black_Median_Image is obtained by 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 on the image;

[0034] Add the gray values ​​of all pixels to get the total gray value of the dark field image Black_GrayValue_Sum; then divide it by the number of pixels to get the gray mean dark field image gray mean Black_GrayValue_Mean;

[0035] The bright field image grayscale value White_GrayValue of each pixel of the bright field filter image White_Median_Image is obtained by 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 on the image;

[0036] Add up the gray values ​​of all pixels to get the sum of the gray values ​​of the bright field image White_GrayValue_Sum; then divide it by the number of pixels to get the gray mean bright field image gray mean White_GrayValue_Mean.

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

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

[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] In addition, 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 steps of the image correction method based on the side light source brightness as described in the first aspect above.

[0044] In the scheme of the present invention, after adjusting the angle and position of the side light source, a piece of white paper with a flat surface and no creases is placed at a test position below the camera to light up the side light source, and the camera exposure time and gain coefficient are adjusted so that the camera imaging is not overexposed, and the camera takes an image to obtain a bright field image White_Image; without lighting the side light source, the camera collects 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 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 mean 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 mean grayscale value of the bright field image; according to the grayscale information of the dark field image and the grayscale information of the bright field image, the gain response coefficient and the bias coefficient of each pixel are determined; an LCD captured image with dust and scratches under the illumination of the side light source is obtained, and the captured image is corrected based on the gain response coefficient and the bias coefficient. Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects: through image processing to correct the uniformity of image brightness, after correction, the contrast of dust and scratches at different distances from the side light source is enhanced and the contrast is the same, thereby facilitating the subsequent detection equipment to better identify and detect dust and scratches on the LCD surface. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] 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.

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

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

[0048] Figure 3The camera disclosed in the embodiment of the present invention takes pictures to obtain a bright field image;

[0049] Figure 4 The camera disclosed in the embodiment of the present invention takes pictures to obtain a dark field image;

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

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

[0052] Figure 7 It is a comparison diagram before and after correction disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] 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.

[0054] 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.

[0055] It should be noted that the “plurality” mentioned in this article refers to two or more.

[0056] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0057] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of the overall hardware structure of the device structure of this embodiment. 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 shoots the LCD surface vertically from above the LCD.

[0058] In the first aspect of this embodiment, an image correction method based on the brightness of a side light source is implemented. Figure 2 , Figure 2 FIG. 1 is a flow chart 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 the brightness of the side light source according to the embodiment of the present invention includes:

[0059] S201, after adjusting the angle and position of the side light source, place a piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera imaging is not overexposed, and the camera takes an image to obtain a bright field image White_Image; without lighting the side light source, the camera collects an 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, place a piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera image is not overexposed, and the highest brightness grayscale value in the image is around 200. The camera takes a picture to obtain the bright field image White_Image, as shown in Figure 3 The figure shows a bright field image obtained by taking a picture by the camera of this embodiment.

[0061] When the side light source is not turned on, the camera collects images to obtain a dark field image Black_Image. Figure 4 The figure shows a dark field image obtained by taking a picture by the camera of this embodiment.

[0062] S202, processing the dark field image Black_Image and the bright field image White_Image respectively to obtain grayscale information of the dark field image and 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 mean 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 mean grayscale value of the bright field image.

[0063] Further, in S202, the processing of 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 in the images and generate a dark field filtered image Black_Median_Image and a bright field filtered image White_Median_Image.

[0064] Further, in S202, the grayscale information of the dark field image and the grayscale information of the bright field image are obtained, including: obtaining the dark field image grayscale value Black_GrayValue of each pixel of the dark field filter 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 on the image; adding the grayscale values ​​of all pixels to obtain the dark field image grayscale value sum Black_GrayValue_Sum; and then dividing by the number of pixels to obtain the grayscale mean dark field image grayscale value mean Black_GrayValue_Mean;

[0065] The bright field image grayscale value White_GrayValue of each pixel of the bright field filtered image White_Median_Image is obtained by 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 on the image; the grayscale values ​​of all pixels are added to obtain the bright field image grayscale value sum White_GrayValue_Sum; and then divided by the number of pixels to obtain the grayscale mean bright field image grayscale value mean White_GrayValue_Mean.

[0066] Specifically, in this embodiment, the median filter algorithm is used to process the two images Black_Image and White_Image respectively, with the purpose of removing the noise in the image and making the image smoother; Black_Image and White_Image are processed by the median filter to obtain the images Black_Median_Image and White_Median_Image. Figure 5 is the dark field image after median filtering and smoothing in this embodiment; Figure 6 This is the bright field image after median filtering and smoothing in this embodiment.

[0067] Furthermore, the gray value Black_GrayValue of each pixel in the image Black_Median_Image is obtained through the gray value acquisition algorithm GetGrayval() (this value is an array, and each number in the array corresponds to the gray value of each pixel in the image), and the gray values ​​of all pixels are added to obtain the gray value sum Black_GrayValue_Sum, and then divided by the number of pixels to obtain the gray mean Black_GrayValue_Mean. Similarly, White_GrayValue, White_GrayValue_Sum, and White_GrayValue_Mean of the bright field image are obtained.

[0068] S203, determining a gain response coefficient and a bias coefficient of each pixel according to the grayscale information of the dark field image and the grayscale information of the bright field image.

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

[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, and each data in the array corresponds to each pixel on the image. Using these two coefficients K and B, the brightness uniformity correction can be performed on the dust and scratch removal image during the test.

[0074] S204, acquiring a captured image of an LCD with dust and scratches illuminated by a side light source, and performing correction processing on the captured image based on the gain response coefficient and the bias coefficient.

[0075] In S204, the captured image of the LCD with dust and scratches under the illumination of a side light source is obtained, and the captured image is corrected based on the gain response coefficient and the bias coefficient, including: multiplying the grayscale 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, a bright side light source is used, a camera is used to take pictures, the image is smoothed and denoised, and each pixel of the image is corrected, that is, the grayscale value of each pixel of the image is multiplied by K, and then added with B, to obtain a side light uniformity correction diagram.

[0077] The brightness contrast of dust and scratches on the LCD surface in the corrected image is more consistent with the background, making it easier to segment and identify them using a unified threshold using an image algorithm. Figure 7 The comparison diagram before and after the correction of this embodiment is shown. Before the correction, the farther the dust scratches are from the side light source, the darker they are, and the closer they are, the brighter they are. After the correction, the contrast of the dust scratches is enhanced and the contrast is the same regardless of the distance from the side light source.

[0078] A second aspect of this embodiment provides an image correction device based on side light source brightness, the device comprising 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 piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera imaging is not overexposed, and the camera takes a picture to obtain a bright field image White_Image; without lighting the side light source, the camera collects images to obtain a dark field image Black_Image;

[0080] A 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 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 mean of the grayscale values ​​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 mean of the grayscale values ​​of the bright field image;

[0081] A determination module, used to determine the gain response coefficient and the bias coefficient of each pixel according to the grayscale information of the dark field image and the grayscale information of the bright field image;

[0082] The correction module is used to obtain a captured image of an LCD with dust and scratches under the illumination of a side light source, and to perform correction processing on the captured image 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 by the median filtering algorithm respectively to remove the noise in the image and generate 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 dark field image grayscale value Black_GrayValue of each pixel of the dark field filter image Black_Median_Image is obtained by 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 on the image;

[0087] Add the gray values ​​of all pixels to get the total gray value of the dark field image Black_GrayValue_Sum; then divide it by the number of pixels to get the gray mean dark field image gray mean Black_GrayValue_Mean;

[0088] The bright field image grayscale value White_GrayValue of each pixel of the bright field filter image White_Median_Image is obtained by 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 on the image;

[0089] Add up the gray values ​​of all pixels to get the sum of the gray values ​​of the bright field image White_GrayValue_Sum; then divide it by the number of pixels to get the gray mean bright field image gray mean White_GrayValue_Mean.

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

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

[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] Further, the acquiring of a captured image of an LCD with dust and scratches under illumination of a side light source, and performing correction processing on the captured image based on the gain response coefficient and the bias coefficient, comprises:

[0097] The grayscale value of each pixel of the LCD captured image is multiplied by the gain response coefficient K, and then added with the bias coefficient B to obtain a side light illumination uniformity correction map.

[0098] 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 image correction method based on side light source brightness as described in the first aspect above.

[0099] 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 image correction step based on the side light source brightness as described in the first aspect above.

[0100] 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.

[0101] 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.

[0102] 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.

[0103] 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.

[0104] 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.

[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 comprises: After adjusting the angle and position of the side light source, place a piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera imaging is not overexposed, and the camera takes a picture to obtain a bright field image White_Image; without lighting the side light source, the camera collects images 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 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 mean of the grayscale values ​​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 mean of the grayscale values ​​of the bright field image; Determining a gain response coefficient and a bias coefficient of each pixel according to the dark field image grayscale information and the bright field image grayscale information; A captured image of an LCD with dust and scratches illuminated by a side light source is acquired, and correction processing is performed on the captured image 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 processing of the dark field image Black_Image and the bright field image White_Image respectively comprises: The dark field image Black_Image and the bright field image White_Image are processed by the median filtering algorithm respectively to remove the noise in the image and generate 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 step of obtaining the grayscale information of the dark field image and the grayscale information of the bright field image includes: The dark field image grayscale value Black_GrayValue of each pixel of the dark field filter image Black_Median_Image is obtained by 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 on the image; Add the gray values ​​of all pixels to get the total gray value of the dark field image Black_GrayValue_Sum; then divide it by the number of pixels to get the gray mean dark field image gray mean Black_GrayValue_Mean; The bright field image grayscale value White_GrayValue of each pixel of the bright field filter image White_Median_Image is obtained by 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 on the image; Add up the gray values ​​of all pixels to get the sum of the gray values ​​of the bright field image White_GrayValue_Sum; then divide it by the number of pixels to get the gray mean bright field image gray mean White_GrayValue_Mean.

4. The image correction method based on side light source brightness according to claim 3, characterized in that: Determining the gain response coefficient and the bias coefficient of each pixel according to 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: 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 acquiring of a captured image of an LCD with dust and scratches under illumination of a side light source, and performing correction processing on the captured image based on the gain response coefficient and the bias coefficient, comprises: The grayscale value of each pixel of the LCD captured image is multiplied by the gain response coefficient K, and then added with the bias coefficient B to obtain a side light illumination uniformity correction map.

6. An image correction device based on side light source brightness, characterized in that: The device includes a collection 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 piece of white paper with a flat surface and no creases at the test position below the camera to light up the side light source, adjust the camera exposure time and gain coefficient so that the camera imaging is not overexposed, and the camera takes a picture to obtain a bright field image White_Image; without lighting the side light source, the camera collects images to obtain a dark field image Black_Image; A 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 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 mean of the grayscale values ​​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 mean of the grayscale values ​​of the bright field image; A determination module, used to determine the gain response coefficient and the bias coefficient of each pixel according to the grayscale information of the dark field image and the grayscale information of the bright field image; The correction module is used to obtain a captured image of an LCD with dust and scratches under the illumination of a side light source, and to perform correction processing on the captured image based on the gain response coefficient and the bias coefficient.

7. The image correction device for detecting the brightness of the light source on the side of the device according to claim 6, characterized in that: The processing module is further used for: The dark field image Black_Image and the bright field image White_Image are processed by the median filtering algorithm respectively to remove the noise in the image and generate the dark field filtered image Black_Median_Image and the bright field filtered image White_Median_Image.

8. The image correction device for detecting the brightness of the light source on the side of the device according to claim 7, characterized in that: The processing module is further used for: The dark field image grayscale value Black_GrayValue of each pixel of the dark field filter image Black_Median_Image is obtained by 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 on the image; Add the gray values ​​of all pixels to get the total gray value of the dark field image Black_GrayValue_Sum; then divide it by the number of pixels to get the gray mean dark field image gray mean Black_GrayValue_Mean; The bright field image grayscale value White_GrayValue of each pixel of the bright field filter image White_Median_Image is obtained by 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 on the image; Add up the gray values ​​of all pixels to get the sum of the gray values ​​of the bright field image White_GrayValue_Sum; then divide it by the number of pixels to get the gray mean bright field image gray mean White_GrayValue_Mean.

9. The image correction device for detecting the brightness of the light source on the side of the device according to claim 8, characterized in that: The determination module is also used The gain response coefficient for each pixel is calculated as: 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 is 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 to 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

  • LCD defect detection method based on uniformity correction

    CN118603505A

  • Intensity correction for backlight modules under different inspection angles

    TW200951878A