A liquid crystal display screen dirt detection method based on multiple exposures
Through double exposure technology and adaptive threshold segmentation algorithm, the problem of accuracy in dirt detection on LCD screens under low contrast conditions is solved, and accurate extraction and efficient detection of fine dirt are achieved.
Patent Information
- Application Number
- CN202511079043.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-02
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-02
AI Technical Summary
Existing methods for detecting dirt on LCD screens have difficulty showing the details of dirty areas under low contrast or insufficient lighting conditions, resulting in misjudgments or missed detections. In addition, traditional methods lack accuracy when dealing with small areas of dirt.
Using double exposure technology and adaptive threshold segmentation algorithm, the exposure time is adjusted through the first and second exposures, and the background grayscale value is calculated by combining the Gaussian weighted average method. The optimal threshold is dynamically determined to accurately extract the dirty area.
It improves the visibility and detection accuracy of dirty areas, reduces the interference of the background environment, ensures the accuracy and stability of the test results, and adapts to the detection needs under different lighting conditions.
Smart Images

Figure CN120563525B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of image processing and machine vision, and is particularly suitable for application in industrial automation detection and quality control to dirt detection of liquid crystal display screens. Background Art
[0002] Currently, LCD screen dirt detection primarily relies on traditional image processing techniques. A single exposure is used to capture the image. Image preprocessing, noise reduction, and threshold segmentation are then used to extract the dirty area. The product's conformity is then determined based on the size of the dirt. This method can detect most visible dirty areas under standard conditions, offering a certain degree of automation and efficiency. However, existing technologies still suffer from the following shortcomings: Single-exposure limitations: Existing detection methods typically rely on capturing images with fixed exposure parameters, making them difficult to adapt to the varying lighting conditions of LCD screens. In particular, in low-contrast or low-light conditions, the details of the dirty area are difficult to fully visualize, resulting in incomplete capture of dirt information and the risk of misjudgment or missed detection. Detection errors occur when the dirt area is small. When the dirt area on an LCD screen is small, traditional methods are susceptible to image noise during image noise reduction and threshold segmentation, resulting in an undersized or inaccurately extracted dirty area. Consequently, the detection system may be unable to accurately distinguish between subtle dirt and normal product conditions, impacting overall detection accuracy. Summary of the Invention
[0003] In response to the shortcomings of the existing technology, the present invention realizes accurate detection of fine dirt on the LCD screen through double exposure and adaptive threshold segmentation algorithm, which has the advantage of realizing efficient and stable detection in a mass production environment.
[0004] The present invention proposes a method for detecting dirt on a liquid crystal display screen based on multiple exposures, comprising the following steps:
[0005] Step S1: Image acquisition: Use an industrial camera to take a first shot of the LCD screen and set the first exposure time; perform a preliminary inspection on the exposed image. If the initially detected dirt area is smaller than a threshold, adjust the camera exposure time and re-expose the captured image until the threshold requirement is met;
[0006] Step S2: Image processing, performing denoising preprocessing on the collected image to reduce the interference of random noise on the detection results;
[0007] Step S3: Product qualification determination, by comparing the extracted dirty area area with the preset area threshold, if the dirty area is less than or equal to the set threshold, the product is determined to be qualified; otherwise, the product is determined to be unqualified.
[0008] As a further solution of the present invention, step S2 includes: background grayscale calculation, specifically using a Gaussian weighted average method to assign weights to each pixel in the background area around the target defect in the defect image using a Gaussian kernel to accurately calculate the background grayscale value of the defect area;
[0009] The two-dimensional Gaussian function is defined as follows:
[0010] ;
[0011] Where: (x, y): the center position of the defect, (u, v): the position of a pixel in the neighborhood, σ: the standard deviation of the Gaussian function, used to control the range of the Gaussian kernel
[0012] The Gaussian weighted average grayscale calculation formula is as follows:
[0013] ;
[0014] Among them: G 背景 (x, y): background grayscale value at the defect center; W(x, y): window within a certain range around the defect center; D: pixel set in the defect area; G(u, v): grayscale value of pixel point (u, v) in the background area; the size of σ is adaptively adjusted according to the window size.
[0015] As a further solution of the present invention, the accurate extraction of the dirty area is achieved by selecting the gray value of the image in (G 背景 The number of pixels in the interval (x, y), μ+2σ) is realized, and the calculation formulas for the grayscale mean (μ) and grayscale standard deviation (σ) of the defect area are as follows:
[0016] Assume that the pixel grayscale set in the defect area is {x1,x2,x3,...,x n}, where the total number of pixels is n;
[0017] The grayscale mean μ is calculated as follows:
[0018] ;
[0019] Grayscale standard deviation σ is calculated as follows:
[0020] .
[0021] As a further solution of the present invention, in step S1: the first exposure time is set to 20000ms-60000ms, and when the initially detected dirt area is less than 0.08 square millimeters, the camera exposure time needs to be adjusted to 130000ms-170000ms, the image is retaken, the defect extraction operation is performed again, and the defect area is analyzed; when the defect area is less than 0.12 square millimeters, it is judged as qualified; if the defect area is greater than or equal to 0.12 square millimeters, it is judged as unqualified; if the initially extracted defect area is greater than or equal to 0.08 square millimeters, the defect area is directly judged, and when the defect area is less than 0.018 square millimeters, it is judged as qualified; if the defect area is greater than or equal to 0.018 square millimeters, it is judged as unqualified. Preferably, in step S1: the first exposure time is set to 40000ms, and when the initially detected dirt area is less than 0.08 square millimeters, the camera exposure time needs to be adjusted to 150000ms, and the image is retaken. In the present invention, each area threshold can be adjusted accordingly according to the specific application scenario and detection accuracy requirements to meet different actual needs.
[0022] This invention utilizes a dual-exposure strategy and an optimized adaptive threshold segmentation algorithm to improve the accuracy and reliability of fine stain detection, making it particularly suitable for low-contrast environments or where the stains are relatively small. This invention specifically addresses the challenges of identifying fine stains in low-contrast environments, as well as the lack of accuracy of traditional detection methods for small stains. This ensures high reliability in the detection process, overcomes traditional technical bottlenecks, and provides an efficient and reliable solution for low-contrast scenes or where stains are minimal.
[0023] The present invention solves the problem of poor accuracy of traditional methods in detecting low-contrast conditions and subtle dirt. It uses double exposure technology to greatly improve the visualization of dirty areas, and uses an adaptive threshold algorithm to achieve accurate extraction of dirty areas. At the same time, by increasing the calculation of background grayscale, it reduces the interference of the background environment on dirt, ensuring the accuracy and stability of the detection results. Specifically, through double exposure technology, images can be acquired under different exposure parameters, greatly improving the recognition of dirty areas in the image. At the same time, in combination with an adaptive threshold algorithm, the optimal threshold can be dynamically determined based on the grayscale distribution characteristics of the image, achieving accurate extraction of dirty areas and avoiding false detection and missed detection. In addition, the present invention also innovatively introduces a background grayscale calculation link, using the Gaussian weighted average method to calculate the background grayscale value of the defective area, effectively reducing the interference of the background environment on dirt detection. Multi-dimensional technical improvements ensure that the detection results are both accurate and stable in all aspects, providing a more reliable and efficient technical solution for the field of LCD screen dirt detection.
[0024] In order to more clearly illustrate the structural features and effects of the present invention, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is the overall flow chart of the present invention;
[0026] Figure 2 Defect extraction process for image algorithms;
[0027] Figure 3a This is the result diagram of the defect detection under the exposure time of 40000ms mentioned in the present invention;
[0028] Figure 3b This is the result image of the 40000ms exposure mentioned in the present invention. Since the defect is dim and cannot be extracted, a large exposure is used, that is, the exposure time is set to 150000ms.
[0029] Figure 3c This is a diagram of defect shooting and detection effects under the large exposure conditions mentioned in the present invention. DETAILED DESCRIPTION
[0030] The present invention will be further described below with reference to the accompanying drawings and related knowledge, and described clearly and completely. Obviously, the described applications are only part of the embodiments of the present invention, rather than all of the embodiments.
[0031] Example 1: Reference Figure 1-Figure 3c As shown, the present invention provides a method for detecting dirt on a liquid crystal display screen based on multiple exposures, comprising the following steps:
[0032] Step S1: Image acquisition: an industrial camera is used to take a first shot of the LCD screen, with the first exposure time set to 40,000 ms; a preliminary inspection is performed on the first exposure image;
[0033] Specifically, an industrial camera is used to take the first photo of the LCD screen, and the first exposure time is set to 40,000ms. The first exposure image is then preliminarily inspected. When the detected dirty area is less than 0.08, the system automatically triggers a second exposure, and the second exposure time is increased to 150,000ms to enhance the visibility of dirty areas under low-contrast conditions.
[0034] Step S2: Image processing, performing denoising preprocessing on the collected image to reduce the interference of random noise on the detection results; specifically, performing denoising preprocessing on the collected image to reduce the interference of random noise on the detection results; using an adaptive threshold segmentation algorithm (such as the Otsu method or the local adaptive threshold method) to automatically determine the optimal threshold according to the grayscale distribution of the image.
[0035] Further optimization, background grayscale calculation,
[0036] The Gaussian weighted averaging method is used to assign weights to each pixel in the background area around the target defect in the defect image using a Gaussian kernel. The weight of close pixels is higher, and the weight of distant pixels is lower, so as to accurately calculate the background grayscale value of the defect area.
[0037] The two-dimensional Gaussian function is defined as follows:
[0038] ;
[0039] in:
[0040] (x,y): defect center position
[0041] (u,v): a pixel position in the neighborhood
[0042] σ: standard deviation of the Gaussian function, used to control the range of the Gaussian kernel
[0043] The Gaussian weighted average grayscale calculation formula is as follows:
[0044] ;
[0045] in:
[0046] G 背景 (x, y): background grayscale value at the center of the defect;
[0047] W(x,y): A window within a certain range around the defect center;
[0048] D: the set of pixels in the defect area (excluded from calculation);
[0049] G(u,v): grayscale value of pixel (u,v) in the background area;
[0050] The window size depends on the defect size and is adaptively adjusted according to the defect area. Generally, 2 to 3 times the defect diameter is selected as the window diameter or side length. The size of σ is adaptively adjusted according to the window size. Usually, 1 / 4 to 1 / 2 of the window size is selected as the initial value of σ.
[0051] For each pixel (u, v) in the window W (x, y), calculate its distance to the defect center (x, y), and use the Gaussian function to calculate the corresponding weight.
[0052] Exclude pixels within the defect area and only use background pixels in the calculation.
[0053] The Gaussian weighted gray value G of the defect background is calculated using the above formula 背景 (x,y).
[0054] The accurate extraction of dirty areas is achieved by selecting the gray value of the image in (G 背景 The number of pixels in the interval (x, y), μ+2σ) is realized to effectively avoid misjudging the normal background as dirt and improve the accuracy of dirty area extraction.
[0055] In the present invention, the calculation formulas for the grayscale mean (μ) and grayscale standard deviation (σ) of the defect area are as follows:
[0056] Assume that the pixel grayscale set in the defect area is {x1,x2,x3,...,x n}, where the total number of pixels is n.
[0057] The grayscale mean μ is calculated as follows:
[0058] ;
[0059] Grayscale standard deviation σ is calculated as follows:
[0060] ;
[0061] Step S3: By comparing the extracted dirty area with the preset area threshold, if the dirty area is less than or equal to the set threshold, the product is judged to be qualified; otherwise, the product is judged to be unqualified.
[0062] The present invention also includes a system linkage and feedback mechanism. When the dirt area in the initial exposure image analysis is less than 0.08, the secondary exposure linkage mechanism is automatically triggered to ensure detection accuracy.
[0063] The present invention effectively solves the problem of poor accuracy of traditional methods in detecting low-contrast conditions and fine dirt. It uses double exposure technology to greatly improve the visualization of dirty areas, and uses an adaptive threshold algorithm to achieve accurate extraction of dirty areas. At the same time, by increasing the calculation of background grayscale, it reduces the interference of the background environment on dirt, ensuring the accuracy and stability of the detection results.
[0064] Example 2: A method for detecting dirt on a liquid crystal display screen based on multiple exposures, referring to Figure 1 The figure shows the overall flow chart of the present invention. First, the ring light is turned on, the camera exposure time is set to 40,000 ms, and an image is captured. Then, the image defects are extracted using a defect extraction algorithm. If the defect area is less than 0.08 square millimeters, the camera exposure is set to 150,000 ms, an image is captured, and the defect is re-extracted to determine the area size. An area less than 0.12 square millimeters is considered OK, and an area greater than or equal to 0.12 square millimeters is considered NG. Otherwise, the area size is directly determined. An area less than 0.018 square millimeters is considered OK, and an area greater than or equal to 0.018 square millimeters is considered NG.
[0065] Reference Figure 2 As shown in the figure, the detection process is as follows: First, use Gaussian filtering to denoise the image to reduce the impact of noise on subsequent analysis. Then, use the adaptive threshold segmentation method to distinguish the target area from the background in the image. To avoid false detection, the process will remove defective areas with less than 30 pixels, thereby excluding smaller noise points or irrelevant areas. After the initial defect screening, the background grayscale G is calculated. 背景 (x, y), and the grayscale mean μ and standard deviation σ of the defect area are used to further analyze the characteristics of the defect. Then, the grayscale value in the interval (G 背景 The number of pixels within (x, y), μ+2σ) is used to obtain the possible defect range. Finally, the area of the defect is calculated based on the number of pixels and the square of the pixel ratio to quantify the severity of the defect.
[0066] Further references Figure 3a-3c As shown in the figure, the result of defect detection under 40000ms exposure, the result of using large exposure to shoot with the exposure time set to 150000ms because the defect is dim and cannot be extracted under 40000ms exposure, and the defect shooting and detection effect under large exposure conditions.
[0067] Example 3: A method for detecting dirt on a liquid crystal display screen based on multiple exposures, comprising the following steps:
[0068] At the beginning of the test, the control system first turns on the ring LED light source and sets the first exposure time of the industrial camera to 40,000 ms to capture the image and obtain the first exposure image.
[0069] Furthermore, after obtaining the first exposure image, the image is transmitted to the algorithm processing unit for image denoising preprocessing, preferably using Gaussian filtering for noise reduction processing, and the filter kernel size is usually set to 5×5 to effectively suppress random noise and retain image details.
[0070] After the image is denoised, it enters the adaptive threshold segmentation stage, using the Otsu method or the local adaptive threshold method to automatically determine the optimal threshold based on the image grayscale characteristics, thereby achieving accurate distinction between the target area (dirty area) and the background.
[0071] In the image after threshold segmentation, the area with less than 30 pixels is first removed to exclude irrelevant noise or false detection areas and reduce the probability of false positives. Then, the algorithm processing unit calculates the background grayscale G for each candidate area. 背景 (x, y), and the defect grayscale mean μ and grayscale standard deviation σ. Select the grayscale value in G 背景 The number of pixels in the range from (x, y) to (μ+2σ) is used to determine the possible defect range and avoid background interference.
[0072] The system determines the defect area based on the extracted defect area from the first exposure image. If the calculated defect area is greater than or equal to 0.08 square millimeters, the product is immediately deemed acceptable. If the defect area is less than 0.018 square millimeters, the product is deemed acceptable (OK); otherwise, it is deemed unacceptable (NG). If the defect area detected under the first exposure is less than 0.08 square millimeters, the system automatically triggers a second exposure process. The control unit adjusts the industrial camera's exposure time to 150,000 milliseconds for another image capture to enhance the visibility of low-contrast or subtle defects. The second exposure image is also processed using Gaussian filtering for noise reduction and adaptive threshold segmentation, and the pixel count and defect area are calculated again. After calculation, if the defect area is less than 0.12 square millimeters, the product is deemed acceptable (OK); otherwise, it is deemed unacceptable (NG). Finally, the control system provides real-time feedback to the production line control unit, enabling automated product sorting and rejection of defective products.
[0073] It should be noted that the double-exposure shooting detection method of the present invention includes an image acquisition method of the initial exposure (40,000ms) and a large exposure (150,000ms), as well as a linkage mechanism for dirt detection based on the comparison of the two image data. The area calculation method uses denoising and adaptive threshold segmentation to extract the dirty area in the image, and calculates the image grayscale value in G 背景 The number of pixels in the range (x, y) to (μ+2σ) is used to accurately quantify the dirty area. This calculation method is the key innovation of the present invention, which can avoid interference from the background environment and significantly improve the accuracy and robustness of detection.
[0074] Specifically, the detection method of the present invention leverages system linkage and precise algorithms to achieve efficient and accurate detection of LCD screen dirt, significantly improving detection accuracy and efficiency and making it applicable to a variety of complex detection scenarios. The specific implementation steps are as follows: Image acquisition preparation and initial capture: When the detection process starts, the control system automatically activates the ring-shaped LED light source to provide a stable and uniform lighting environment for capture. Simultaneously, the industrial camera's initial exposure time is set to 40,000ms, and the LCD screen is captured to obtain the initial exposure image.
[0075] First-exposure image preprocessing and analysis, image denoising: After acquiring the first-exposure image, it is transmitted to the algorithm processing unit. Here, a Gaussian filter is used to denoise the image, with the filter kernel size set to 5×5. This setting effectively suppresses random noise in the image while preserving image detail to the greatest extent possible, laying the foundation for subsequent analysis.
[0076] Adaptive Threshold Segmentation: After denoising, the image enters the adaptive threshold segmentation stage. Using the Otsu method or local adaptive thresholding, the optimal threshold is automatically determined based on the image's grayscale characteristics, accurately distinguishing between dirty and background areas.
[0077] Preliminary screening and feature calculation: In the image after threshold segmentation, the system will remove the area with less than 30 pixels, exclude irrelevant noise and false detection areas, and reduce the probability of false positives. Then, the algorithm processing unit calculates the background grayscale, the defect grayscale mean μ and the grayscale standard deviation σ for the dirty candidate area. By statistically analyzing the grayscale value in G 背景 The number of pixels in the range from (x, y) to (μ+2σ) determines the possible defect range and effectively avoids background interference.
[0078] Based on the initial judgment of the first exposure image and the triggering of the second exposure, the system performs a preliminary judgment based on the defect area extracted from the first exposure image. If the defect area is greater than or equal to 0.08 square millimeters, the product is directly judged as qualified. If the defect area is less than 0.018 square millimeters, the product is judged as qualified (OK); otherwise, the product is judged as unqualified (NG).
[0079] Secondary Exposure Trigger: If the defect area detected during the initial exposure is less than 0.08 mm², the system automatically triggers a secondary exposure. The control unit adjusts the industrial camera's exposure time to 150,000 ms and captures the LCD screen again, enhancing the visibility of low-contrast or subtle defects.
[0080] The secondary exposure image undergoes Gaussian filtering for noise reduction and adaptive threshold segmentation. The system then counts pixels and calculates the defect area. If the calculated defect area is less than 0.12 square millimeters, the product is deemed acceptable (OK); otherwise, it is deemed unacceptable (NG).
[0081] Finally, the control system will provide real-time feedback on the test results to the production line control unit. Based on the feedback, the production line control unit will automatically sort the products, remove unqualified products, and complete the entire testing process.
[0082] The core technical innovations of this invention are:
[0083] Double-exposure shooting and detection method: This invention adopts an image acquisition method that combines an initial exposure (40,000ms) with a long exposure (150,000ms), and cooperates with a dirt detection linkage mechanism based on the comparison of the two image data to significantly improve the detection ability of different degrees of dirt.
[0084] Area calculation method: extract the dirty area in the image through denoising and adaptive threshold segmentation, calculate the image gray value in G 背景 The number of pixels in the interval (x, y) to (μ + 2σ) accurately quantifies the dirty area. This method effectively avoids background interference and significantly improves detection accuracy and robustness.
[0085] The technical principles of the present invention have been described above in conjunction with specific embodiments, which are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention fall within the scope of protection of the present invention. Those skilled in the art will be able to conceive of other specific embodiments of the present invention without inventive effort, and such methods will fall within the scope of protection of the present invention.
Claims
1. A method for detecting dirt on a liquid crystal display screen based on multiple exposures, characterized in that: The following steps are involved: Step S1: Image acquisition: use an industrial camera to take the first photo of the LCD screen and set the first exposure time; Perform a preliminary inspection on the exposed image. If the initially detected dirt area is smaller than the threshold, adjust the camera exposure time and re-expose the captured image until the threshold is met. Step S2: Image processing, performing denoising preprocessing on the collected image to reduce the interference of random noise on the detection results; Step S3: Product qualification determination: by comparing the extracted dirty area with a preset area threshold, if the dirty area is less than or equal to the set threshold, the product is determined to be qualified; Otherwise, the product is judged to be unqualified.
2. The method for detecting dirt on a liquid crystal display screen based on multiple exposures according to claim 1, wherein: Step S2 includes: background grayscale calculation, specifically using Gaussian weighted averaging method, for the background area around the target defect in the defect image, using Gaussian kernel to assign weights to each pixel to accurately calculate the background grayscale value of the defect area; The two-dimensional Gaussian function is defined as follows: ; Where: (x, y): defect center position, (u, v): pixel position in the neighborhood, σ: standard deviation of the Gaussian function, used to control the range of the Gaussian kernel; The Gaussian weighted average grayscale calculation formula is as follows: ; Among them: G 背景 (x, y): background grayscale value at the defect center; W(x, y): window within a certain range around the defect center; D: pixel set in the defect area; G(u, v): grayscale value of pixel point (u, v) in the background area; the size of σ is adaptively adjusted according to the window size.
3. The method for detecting dirt on a liquid crystal display screen based on multiple exposures according to claim 2, wherein: The accurate extraction of dirty areas is achieved by selecting the gray value of the image in (G 背景 The number of pixels in the interval (x, y), μ+2σ) is realized, and the calculation formulas for the grayscale mean (μ) and grayscale standard deviation (σ) of the defect area are as follows: Assume that the pixel grayscale set in the defect area is {x1,x2,x3,...,x n }, where the total number of pixels is n; The grayscale mean μ is calculated as follows: ; Grayscale standard deviation σ is calculated as follows: 。 4. The method for detecting dirt on a liquid crystal display screen based on multiple exposures according to claim 2, wherein: In step S1, the initial exposure time is set to 20,000 ms to 60,000 ms. If the initially detected dirt area is less than 0.08 square millimeters, the camera exposure time is adjusted to 130,000 ms to 170,000 ms, the image is retaken, the defect extraction operation is performed again, and the defect area is analyzed. If the defect area is less than 0.12 square millimeters, the image is determined to be qualified. If the defect area is greater than or equal to 0.12 square millimeters, it is judged as unqualified; if the defect area of the initial extraction is greater than or equal to 0.08 square millimeters, the defect area is directly judged. When the defect area is less than 0.018 square millimeters, it is judged as qualified; If the defect area is greater than or equal to 0.018 square millimeters, it is judged as unqualified.
5. The method for detecting dirt on a liquid crystal display screen based on multiple exposures according to claim 4, wherein: In step S1 , the initial exposure time is set to 40,000 ms. When the initially detected dirt area is less than 0.08 square millimeters, the camera exposure time needs to be adjusted to 150,000 ms and the image needs to be retaken.
Citation Information
Patent Citations
Liquid crystal display screen defect detection method
CN119827522A
Image exposure adjustment method and apparatus, device, and storage medium
US20230056296A1