A method for detecting Mura defects with blurred edges in LCD screens

By adding noise to the LCD screen image and performing differential processing, the problem of difficulty in detecting edge blur Mura defects in the prior art is solved, and accurate detection of defects of any shape and size is achieved, improving the accuracy and efficiency of detection.

CN114792310BActive Publication Date: 2025-05-09GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210467455.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2025-05-09
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect Mura defects with blurred edges in LCD screens, mainly due to blurred edges in defects, resulting in poor detection results.

Method used

By adding appropriate noise to the image and performing differential processing, the contrast of the image is enhanced, and finally the defects are screened out through binarization and expansion processing.

Benefits of technology

Accurate detection of edge blur Mura defects of any shape and size in LCD screen is achieved, improving the accuracy of detection and reducing the missed detection rate and overkill rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114792310B_ABST
    Figure CN114792310B_ABST
Patent Text Reader

Abstract

The present invention provides a method for detecting Mura defects with blurred edges in an LCD screen. The method realizes accurate detection of defects by adding noise, and is applicable to screens of different shapes and sizes. For bleeding points in the edge area of ​​the screen, filling is performed before detection and masking is performed after detection, thereby avoiding the influence of the bleeding points on the detection result. In view of the problem of large image resolution, a downsampling method is used to reduce the image size to the original size, which saves image processing time and retains valid data in the image. After the entire image processing process is completed, an upsampling method is used to restore the result image to the original size, so as to facilitate on-site operators to view, analyze and judge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision detection, and more specifically, to a method for detecting Mura defects with blurred edges in LCD screens. Background Art

[0002] LCD screens are usually composed of multiple materials and base layers glued together. Often during the bonding process, various contaminants, bubbles, migration materials or other defects may enter the LCD screen and cause Mura defects. The existence of Mura defects seriously affects the yield of LCD screens. There are currently three main mainstream detection methods for Mura defects with blurred edges. First, the traditional detection method that relies on the human eye. This method has the disadvantages of slow detection speed, low efficiency, inability to meet high-speed automated production lines, and low detection accuracy. Secondly, the edge detection solution, because the edge of this defect is very blurred, the grayscale value of the pixel in the edge area is in a "gradient" state, so the edge cannot be effectively extracted and the defect cannot be effectively detected. The detection effect of the edge detection solution is as follows Figure 1 As shown. Finally, the foreground and background separation scheme, the existing foreground and background separation scheme expects to process the input image to obtain a foreground image containing defects and a background image without defects, and then perform a comparison difference. However, due to the fuzzy characteristics of the defect edge, the foreground image and the background image obtained after the foreground and background separation operation contain the defect or do not have the defect, so the defect cannot be detected through the subsequent comparison difference operation. The detection effect of the foreground and background separation scheme is shown in Figure 2 In general, the three mainstream methods are insufficient for the edge-blurred Mura defect in LCD screens and it is difficult to achieve the expected effect. Figure 3 shown.

[0003] The prior art discloses a patent for an online automatic detection method for Mura defects of mobile phone TFT-LCD screens. The patent first collects the screen image of the mobile phone to be detected through a CCD industrial camera; then extracts the region of interest, performs geometric correction and filter preprocessing on the image to be detected to obtain the TFT-LCD screen area in the image; then divides the screen area into blocks, and uses an adaptive local enhancement algorithm to enhance the Mura defects in the image according to the grayscale distribution characteristics of each sub-image block; finally, the threshold method and morphological opening operation are used to extract the Mura defects in the image. The present invention can automatically identify Mura defects with low contrast and blurred edges, with high accuracy and strong robustness, and can effectively solve the problems of high cost, low efficiency and low accuracy of manual detection in the production process, which is of great significance to improving the production efficiency and quality of mobile phone TFT-LCD screens. However, the patent rarely reports that the problem of blurred defect edges can be effectively solved by adding appropriate noise for differential analysis. Summary of the invention

[0004] The present invention provides a method for detecting Mura defects with blurred edges in an LCD screen. The method can effectively solve the problem of blurred defect edges by adding appropriate noise for differential analysis, thereby achieving effective detection of such Mura defects with blurred edges and improving detection accuracy.

[0005] In order to achieve the above technical effects, the technical solution of the present invention is as follows:

[0006] A method for detecting Mura defects with blurred edges in an LCD screen comprises the following steps:

[0007] S1: Extract the region of interest in the image by image cropping;

[0008] S2: Perform Gaussian filtering on the image in step S1 to remove Gaussian noise;

[0009] S3: down-sampling the image after step S2 to reduce the resolution of the image;

[0010] S4: performing edge filling on the image after step S3, filling the non-screen area of ​​the edge area;

[0011] S5: adding noise to a certain position of the image after step S4;

[0012] S6: performing a difference between the image with added noise after step S5 and the image obtained in step S4, and enhancing the result image after the difference;

[0013] S7: binarizing and dilating the image obtained in step S6 to screen out defects;

[0014] S8: Up-sampling and masking are performed on the image obtained in step S7 to restore the resolution of the image and shield false detections in non-screen areas.

[0015] Furthermore, in step S1, since LCD screens have various shapes and sizes, in order to ensure that all areas of the product to be tested can be photographed during the actual industrial site inspection process, the camera's field of view must be larger than the area to be tested, so a certain bleed will be left at the edge of the screen. The area to be tested on the LCD screen needs to be cropped out for subsequent processing, and image cropping is performed by manually inputting the screen edge coordinates and automatically obtaining the edge coordinates for cropping.

[0016] Furthermore, in step S2, the specific operation of Gaussian filtering is: use a template to scan each pixel in the image, replace the grayscale value of the central pixel of the template with the weighted average grayscale value of the pixels in the neighborhood determined by the template, and select a template with a kernel of 45×45 and a standard deviation of 0 for filtering.

[0017] Furthermore, in step S3, the height and width of the image are reduced to the original values ​​by using a bilinear interpolation downsampling mode. The grayscale values ​​of the four real pixels around the virtual point in the original image are used to jointly determine the grayscale value of the corresponding pixel in the target image, and the grayscale value corresponding to the virtual point is calculated. Specifically:

[0018] f(dx,0)=f(0,0)*(1-dx)+f(1,0)*dx (1)

[0019] f(dx,1)=f(0,1)*(1-dx)+f(1,1)*dx (2)

[0020] f(dx,dy)=f(dx,0)*(1-dy)+f(dx,1)*dy (3)

[0021] Among them, f(0,0) represents the grayscale value of the coordinates (0,0), f(0,1) represents the grayscale value of the coordinates (0,1), f(1,0) represents the grayscale value of the coordinates (1,0), f(1,1) represents the grayscale value of the coordinates (1,1), f(dx,0) represents the grayscale value of the coordinates (dx,0), f(dx,1) represents the grayscale value of the coordinates (dx,1), and f(dx,dy) represents the grayscale value of the coordinates (dx,dy).

[0022] Furthermore, in step S4, the filling process is column by column. First, the grayscale mean of the 100th pixel to the 300th pixel in a column is calculated, and then all the pixels in the column whose grayscale values ​​are lower than a certain threshold are found by traversing all the pixels in the column, and the grayscale values ​​of these pixels are set to be equal to the calculated grayscale mean.

[0023] Furthermore, in step S5, when adding noise, it is necessary to proceed column by column from left to right, calculate the pixel mean of each column of pixels in turn, use the obtained pixel mean as the added noise value, and add the obtained pixel mean to every two pixels in the column.

[0024] Furthermore, in step S6, the noise value obtained is smaller than the grayscale value of the white mass defect and larger than the grayscale value of the black mass defect, and the noise value is not much different from the normal grayscale value; the white mass defect can be detected by taking a difference between the image without noise filling and the image with noise filling:

[0025] The noise-filled image and the image without noise filling are differentially detected for black defects. In the obtained image, the area with a larger grayscale value is where the defect is located, and the area with a smaller grayscale value is without defect. In order to increase the grayscale value difference between the defective area and the non-defective area, histogram equalization or normalization is used for enhancement. After enhancement by histogram equalization or normalization, the grayscale value difference between the defective area and the non-defective area is widened, which is convenient for the next step of processing;

[0026] When the grayscale of the image pixels changes randomly and the image histogram appears uneven, histogram equalization makes the image histogram roughly flat;

[0027] The principle of normalization is to calculate the grayscale value of each pixel in the image and map it to the range of 0-255. The minimum grayscale value before mapping is the lower limit of the range after mapping, and the maximum grayscale value before mapping is the upper limit of the range after mapping:

[0028]

[0029] In equation (4), img(n,m) refers to the grayscale value of the pixel with coordinates (n,m) in the image, min_img is the minimum grayscale value of all pixels in the image, and max_img is the maximum grayscale value of all pixels in the image. Normalization is a linear transformation. After normalization, the grayscale value will be mapped to the range of 0-255, which can increase the contrast.

[0030] Furthermore, in step S7, after the image without noise is differentiated from the image with noise or the difference image is enhanced, the place with the largest grayscale value in the image is the place where the defect is located, and the grayscale value of other places differs from the maximum value by at least 10. The grayscale value of the pixel point with a grayscale value greater than a certain threshold is set to 255 by a binarization method, and the grayscale value of other areas is set to 0. In the binarization result image, each defect is composed of multiple white short lines, and the white short lines are condensed into a white mass by a dilation operation;

[0031] The specific operation method of expansion is to use a rectangle with a width of m and a height of n as a template, and perform the following processing on each pixel x in the image: pixel x is placed at the center of the template, and according to the size of the template, all other pixels covered by the template are traversed, and the value of pixel x is modified to the maximum value of all pixels, and the protruding points on the periphery of the image are connected and extended outward.

[0032] Furthermore, in step S8, due to the downsampling operation, the width and height of the image are reduced to the original Therefore, it is necessary to restore the image to its original size through upsampling; the upsampling selects the bicubic interpolation method, in which the grayscale value of (x, y) can be obtained by the weighted average of the nearest 16 sampling points in the rectangular grid.

[0033] Preferably, a Gaussian filter kernel with a size of 45×45 and a standard deviation of 0 is selected for Gaussian filtering. The resolution of the Gaussian filtering result image is 8797×3965. The image resolution has a large impact on the speed of subsequent image processing. The length and width of the image are reduced to the original After downsampling, the image resolution is reduced to 1759×793.

[0034] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0035] The present invention can effectively detect Mura defects with blurred edges at any position or size in LCD screens of any shape and size by adding appropriate noise at appropriate positions, thereby improving the accuracy of detection and reducing the missed detection rate and over-kill rate of detection; the invention realizes accurate detection of defects by adding noise, and is applicable to screens of different shapes and sizes; for bleeding points in the edge area of ​​the screen, filling is performed before detection and masking is performed after detection, thereby avoiding the influence of bleeding points on the detection results; in view of the problem of large image resolution, downsampling is adopted to reduce the image size to the original size. It not only saves image processing time but also retains valid data in the image. After the entire image processing process is completed, the result image is restored to its original size by upsampling, which is convenient for on-site operators to view, analyze and judge. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a detection effect diagram of the edge detection solution in the prior art;

[0037] Figure 2 This is a diagram showing the effect of foreground-background separation detection in the prior art;

[0038] Figure 3 It is a detection effect diagram expected in the prior art;

[0039] Figure 4 is a flow chart of the method of the present invention;

[0040] Figure 5 Capture images for the camera;

[0041] Figure 6 It is a schematic diagram of the bilinear interpolation process;

[0042] Figure 7 It is a schematic diagram of the expansion operation;

[0043] Figure 8 Cropping effect for the image

[0044] Fig. 9 is a schematic diagram of a mask template;

[0045] Fig.10 This is a schematic diagram of the downsampling effect;

[0046] Fig.11 It is the overall filling effect diagram;

[0047] Fig.12 To add noise effect map;

[0048] Fig.13 It is a binary image of white mass defect with blurred edges;

[0049] Fig.14 It is a binary image of a black mass with blurred edges;

[0050] Fig.15 This is the expansion image of the white mass defect with blurred edges;

[0051] Fig.16 This is a dilation image of a black mass defect with blurred edges;

[0052] Fig.17 This is the test result diagram. DETAILED DESCRIPTION

[0053] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0054] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0055] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0056] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0057] Example 1

[0058] like Figure 4 As shown, a method for detecting Mura defects with blurred edges in an LCD screen includes the following steps:

[0059] S1: Extract the region of interest in the image by image cropping;

[0060] S2: Perform Gaussian filtering on the image in step S1 to remove Gaussian noise;

[0061] S3: down-sampling the image after step S2 to reduce the resolution of the image;

[0062] S4: performing edge filling on the image after step S3, filling the non-screen area of ​​the edge area;

[0063] S5: adding noise to a certain position of the image after step S4;

[0064] S6: performing a difference between the image with added noise after step S5 and the image obtained in step S4, and enhancing the result image after the difference;

[0065] S7: binarizing and dilating the image obtained in step S6 to screen out defects;

[0066] S8: Up-sampling and masking are performed on the image obtained in step S7 to restore the resolution of the image and shield false detections in non-screen areas.

[0067] In step S1, since LCD screens have various shapes and sizes, in order to ensure that all areas of the product to be tested can be photographed during the actual industrial site inspection process, the camera's field of view must be larger than the area to be tested, so a certain bleed will be left at the edge of the screen. The area to be tested on the LCD screen needs to be cropped out for subsequent processing. Image cropping is performed by manually inputting the screen edge coordinates for cropping or automatically obtaining the edge coordinates for cropping.

[0068] For each pixel in step S2, the weighted average grayscale value of the pixel in the neighborhood determined by the template is used to replace the grayscale value of the central pixel of the template, and a template with a kernel of 45×45 and a standard deviation of 0 is selected for filtering.

[0069] In step S3, the bilinear interpolation downsampling mode is used to reduce the height and width of the image to the original The grayscale values ​​of the four real pixels around the virtual point in the original image are used to jointly determine the grayscale value of the corresponding pixel in the target image, and the grayscale value corresponding to the virtual point is calculated. Specifically:

[0070] f(dx,0)=f(0,0)*(1-dx)+f(1,0)*dx (1)

[0071] f(dx,1)=f(0,1)*(1-dx)+f(1,1)*dx (2)

[0072] f(dx,dy)=f(dx,0)*(1-dy)+f(dx,1)*dy (3)

[0073] Among them, f(0,0) represents the grayscale value of the coordinates (0,0), f(0,1) represents the grayscale value of the coordinates (0,1), f(1,0) represents the grayscale value of the coordinates (1,0), f(1,1) represents the grayscale value of the coordinates (1,1), f(dx,0) represents the grayscale value of the coordinates (dx,0), f(dx,1) represents the grayscale value of the coordinates (dx,1), and f(dx,dy) represents the grayscale value of the coordinates (dx,dy).

[0074] In step S4, the filling process is column-by-column filling. First, the grayscale mean of the 100th pixel to the 300th pixel in a column is calculated, and then all the pixels in the column whose grayscale values ​​are lower than a certain threshold are found by traversing all the pixels in the column, so that the grayscale values ​​of these pixels are equal to the calculated grayscale mean.

[0075] In step S5, when adding noise, it is necessary to proceed column by column from left to right, calculate the pixel mean of each column of pixels in turn, use the obtained pixel mean as the added noise value, and add the obtained pixel mean to every two pixels in the column.

[0076] In step S6, the noise value obtained is smaller than the grayscale value of the white mass defect and larger than the grayscale value of the black mass defect, and the noise value is not much different from the normal grayscale value; the white mass defect can be detected by taking a difference between the image without noise filling and the image with noise filling:

[0077] The noise-filled image and the image without noise filling are differentially detected for black defects. In the obtained image, the area with a larger grayscale value is where the defect is located, and the area with a smaller grayscale value is without defect. In order to increase the grayscale value difference between the defective area and the non-defective area, histogram equalization or normalization is used for enhancement. After enhancement by histogram equalization or normalization, the grayscale value difference between the defective area and the non-defective area is widened, which is convenient for the next step of processing;

[0078] When the grayscale of the image pixels changes randomly and the image histogram appears uneven, histogram equalization makes the image histogram roughly flat;

[0079] The principle of normalization is to calculate the gray value of each pixel in the image and map it to a certain range (such as 0-255). The place with the lowest gray value before mapping becomes the lower limit of the range after mapping, and the place with the highest gray value before mapping becomes the upper limit of the range after mapping:

[0080]

[0081] In equation (4), img(n,m) refers to the grayscale value of the pixel with coordinates (n,m) in the image, min_img is the minimum grayscale value of all pixels in the image, and max_img is the maximum grayscale value of all pixels in the image. Normalization is a linear transformation. After normalization, the grayscale value will be mapped to the range of 0-255, which can increase the contrast.

[0082] In step S7, after the image without noise is differentiated from the image with noise or the difference image is enhanced, the place with the largest grayscale value in the image is where the defect is located, and the grayscale value of other places differs from the maximum value by at least 10. The grayscale value of the pixel points with grayscale values ​​greater than a certain threshold is set to 255 by using a binarization method, and the grayscale value of other areas is set to 0. In the binarization result image, each defect is composed of multiple white short lines, and the white short lines are condensed into white clusters by using a dilation operation;

[0083] The specific operation method of expansion is to use a rectangle with a width of m and a height of n as a template, and perform the following processing on each pixel x in the image: pixel x is placed at the center of the template, and according to the size of the template, all other pixels covered by the template are traversed, and the value of pixel x is modified to the maximum value of all pixels, and the protruding points on the periphery of the image are connected and extended outward.

[0084] In step S8, due to the downsampling operation, the width and height of the image are reduced to the original Therefore, it is necessary to restore the image to its original size through upsampling; the upsampling selects the bicubic interpolation method, in which the grayscale value of (x, y) can be obtained by the weighted average of the nearest 16 sampling points in the rectangular grid.

[0085] Example 2

[0086] like Figure 4 As shown, a method for detecting Mura defects with blurred edges in LCD screens is divided into eight steps to implement the detection process. The first step is image cropping, which is used to extract the area of ​​interest in the image. The second step is Gaussian filtering, which filters out Gaussian noise. The third step is downsampling, which reduces the resolution of the image. The fourth step is edge filling, which fills the non-screen area of ​​the edge area. The fifth step is to add appropriate noise at the appropriate position. The sixth step is to differentiate the image without noise and the image with noise, and enhance the result image after differentiation. The seventh step is to perform binarization and expansion processing to screen out defects. The eighth step is to perform upsampling and masking, restore the resolution of the image, and shield the false detection of the non-screen area. Through the processing of the above eight steps, Mura defects with blurred edges at any position and any size in LCD screens of any shape and size can be accurately detected. The important key technical points in each step will be introduced in detail below.

[0087] 1. Image Cropping

[0088] LCD screens come in a variety of shapes and sizes. In the actual industrial field inspection process, in order to ensure that all areas of the product to be tested can be photographed, the camera's field of view must be larger than the area to be tested, so a certain amount of bleed will be left at the edge of the screen. The camera captures the image as follows: Figure 5 As shown. Due to the existence of bleeding, not only the detection speed but also the detection effect will be affected. Therefore, before the formal detection begins, the LCD screen area to be tested needs to be cropped for subsequent processing. Image cropping can be done by manually inputting the screen edge coordinates for cropping or automatically obtaining the edge coordinates for cropping. Both methods can extract the area of ​​interest and meet the requirements of subsequent processing.

[0089] 2. Gaussian filtering

[0090] Due to the influence of the illumination environment during imaging, the images taken by the camera always contain Gaussian noise. Gaussian noise refers to a type of noise whose probability density function obeys Gaussian distribution. The present invention uses Gaussian filtering to eliminate the influence of Gaussian noise. Gaussian filtering is a linear smoothing filter, which is widely used in the noise reduction process of image processing. Gaussian filtering is the process of weighted averaging the entire image. The grayscale value of each pixel is obtained by weighted averaging the grayscale values ​​of itself and other pixels in the neighborhood. The specific operation of Gaussian filtering is: use a template (or convolution, mask) to scan each pixel in the image, and replace the grayscale value of the center pixel of the template with the weighted average grayscale value of the pixels in the neighborhood determined by the template. The present invention selects a template with a kernel of 45×45 and a standard deviation of 0 for filtering.

[0091] 3. Downsampling

[0092] Because the defect edge blur contrast is low, the grayscale value of the edge pixel is in a "gradient" and "transition" state, and the area to be detected is large. Therefore, the bilinear interpolation downsampling mode is used to reduce the height and width of the image to the original Reducing the height and width of the image can also help improve the speed of subsequent algorithms. Bilinear interpolation is a relatively good image scaling algorithm. It makes full use of the grayscale values ​​of the four real pixels around the virtual point in the original image to jointly determine the grayscale value of the corresponding pixel in the target image. The grayscale value corresponding to the virtual point can be calculated. The calculation principle is as follows: Figure 6 shown.

[0093] According to the calculation principle of bilinear interpolation, Figure 6 The coordinate relationship in can be obtained as follows:

[0094] f(dx,0)=f(0,0)*(1-dx)+f(1,0)*dx (1)

[0095] f(dx,1)=f(0,1)*(1-dx)+f(1,1)*dx (2)

[0096] f(dx,dy)=f(dx,0)*(1-dy)+f(dx,1)*dy (3)

[0097] Among them, f(0,0) represents the grayscale value of the coordinates (0,0), f(0,1) represents the grayscale value of the coordinates (0,1), f(1,0) represents the grayscale value of the coordinates (1,0), f(1,1) represents the grayscale value of the coordinates (1,1), f(dx,0) represents the grayscale value of the coordinates (dx,0), f(dx,1) represents the grayscale value of the coordinates (dx,1), and f(dx,dy) represents the grayscale value of the coordinates (dx,dy).

[0098] 4. Edge filling

[0099] LCD screens come in a variety of shapes and sizes, including rectangular screens, bangs screens, and water drop screens. However, since the image shape after downsampling can only be a rectangle, there are still some bleeding points in the edge area of ​​the LCD screen. In order to prevent these bleeding points from affecting the subsequent image processing process, a filling operation is required to fill the edge area with an appropriate grayscale value. The filling process is column-by-column filling. First, the grayscale mean of the 100th pixel to the 300th pixel in a column is calculated, and then all the pixels in the column whose grayscale values ​​are lower than a certain threshold are found by traversing all the pixels in the column, so that the grayscale values ​​of these pixels are equal to the calculated grayscale mean.

[0100] 5. Add Noise

[0101] Adding noise is the most important part of the present invention and is also a key step in the entire image processing process. Because the grayscale value of the defect is somewhat different from the grayscale values ​​of other pixels in the column, appropriate noise can be added to the result image in step 4 for detection. When adding noise, it is necessary to proceed from left to right column by column, calculate the pixel mean of each column of pixels in turn, and use the obtained pixel mean as the added noise value, and add the obtained pixel mean to every two pixels in the column.

[0102] 6. Image subtraction and enhancement

[0103] Through experiments, it is found that, in general, the obtained noise value is smaller than the grayscale value of the white mass defect, larger than the grayscale value of the black mass defect, and the noise value is not much different from the normal grayscale value. The white mass defect can be detected by differentiating the image without noise filling with the image with noise filling. The black mass defect can be detected by differentiating the noise filling image with the image without noise filling. The area with a larger grayscale value in the obtained image is where the defect is located, and the area with a smaller grayscale value is without defect. In order to increase the grayscale value difference between the defective area and the non-defective area, histogram equalization or normalization can be used for enhancement. After enhancement by histogram equalization or normalization, the grayscale value difference between the defective area and the non-defective area can be widened, which is convenient for the next step of processing.

[0104] Histogram equalization is an important application of grayscale transformation. It is efficient and easy to implement, and is widely used in image enhancement. When the grayscale of an image pixel changes randomly and the image histogram is uneven, histogram equalization can use a certain algorithm to make the image histogram roughly flat. In short, histogram equalization is a method to enhance image contrast by stretching the pixel intensity distribution range.

[0105] The principle of normalization is to calculate the grayscale value of each pixel in the image and map it to a certain range (such as 0-255). The minimum grayscale value before mapping is the lower limit of the range after mapping, and the maximum grayscale value before mapping is the upper limit of the range after mapping.

[0106]

[0107] In equation (4), img(n,m) refers to the grayscale value of the pixel with coordinates (n,m) in the image, min_img is the minimum grayscale value of all pixels in the image, and max_img is the maximum grayscale value of all pixels in the image. Normalization is a linear transformation. After normalization, the grayscale value is mapped to the range of 0-255, which can increase the contrast.

[0108] 7. Binarization and dilation processing

[0109] After the difference between the image without noise and the image with noise or the enhancement of the difference image, the place with the largest grayscale value in the image is where the defect is located, and the grayscale value of other places differs from the maximum value by at least 10. Therefore, the binarization method can be used to set the grayscale value of pixels with grayscale values ​​greater than a certain threshold to 255, and the grayscale value of other areas to 0. In the binarization result image, each defect is composed of multiple white short lines, and the dilation operation can be used to condense the white short lines into a white mass.

[0110] The specific operation method of expansion is to use a rectangle with a width of m and a height of n as a template, and perform the following processing on each pixel x in the image: pixel x is placed at the center of the template, and according to the size of the template, all other pixels covered by the template are traversed, and the value of pixel x is modified to the maximum value of all pixels. The result of this operation will connect the protruding points on the periphery of the image and extend them outward. Figure 7 Shown is a schematic diagram of the dilation operation of a 3×3 template.

[0111] 8. Upsampling and Masking

[0112] Due to the downsampling operation, the width and height of the image are reduced to the original Therefore, it is necessary to restore the image to its original size through upsampling. Bicubic interpolation can be selected for upsampling. Bicubic interpolation is the most commonly used interpolation method in two-dimensional space. In this method, the gray value of (x, y) can be obtained by weighted average of the nearest 16 sampling points in a rectangular grid.

[0113] Because the screen is not a very regular rectangle, the bleeding points in the image are not the places that need to be detected. Therefore, in order to avoid the detection of bleeding points in the final detection results, the mask method can be used for processing. The mask uses a selected image, graphic or object to block part or all of the processed image to control the image processing area or processing process. The specific image or object used for covering is called a mask or template.

[0114] Example 3

[0115] After starting the inspection, you need to place the product to be inspected in the center of the camera's field of view, then turn on the power to light up the screen, adjust the grayscale value of the pixels on the screen to a certain threshold (for example, 128), and then use the camera to capture images and transfer the captured images to the computer. The captured images are as follows: Figure 5 shown. Figure 5 The black area on the periphery of the screen is the bleeding point and is not within the range that needs to be detected. You can crop the screen area by manually entering the screen edge coordinates or automatically calculating the screen edge coordinates. The cropped effect is shown in the figure below. Figure 8 According to the cropped screen effect image, the edge information of the screen can be obtained, so that Fig. 9 The mask template image shown is for use in subsequent masking steps.

[0116] Since Gaussian noise in the image will interfere with the subsequent image processing process, a Gaussian filter kernel with a size of 45×45 and a standard deviation of 0 is selected for Gaussian filtering. The resolution of the Gaussian filtering result image is 8797×3965. The image resolution has a large impact on the speed of subsequent image processing. Therefore, downsampling is used to reduce the length and width of the image to the original After downsampling, the image resolution is reduced to 1759×793. The resolution comparison is as follows Fig.10 shown.

[0117] Because the screen is not a standard rectangular screen, there are still some bleeding points in the edge area of ​​the screen. These bleeding points are prone to misdetection, so they need to be filled. The present invention adopts a column-by-column filling method to fill. First, the grayscale mean or grayscale mode of the 100th to 300th elements in the first column is calculated, and the area to be filled is assigned with the calculated result. And so on, from left to right, column by column. The overall filling effect is shown in the figure. Fig.11 shown.

[0118] Adding noise is a key step of the present invention. The specific implementation idea is to first find the grayscale mean of each column of pixels from left to right, and the grayscale mean is the added noise value. In each column of pixels, the noise value is added every 2 pixels. The effect after adding is as follows Fig.12 shown.

[0119] The difference between the image with added noise and the image without added noise can be used to detect white defects, and the difference between the image without added noise and the image with added noise can be used to detect black defects. By setting an appropriate binarization threshold, the Mura defects with blurred edges can be screened out, such as Fig.13 , 14 shown.

[0120] The defects in the binary image are composed of multiple short lines. In order to better meet the actual detection requirements, the expansion kernel with a kernel of 3 is used for expansion processing. The effect after processing is as follows Fig.15 , 16 To avoid false detection caused by non-screen areas, use Fig.15 , 16 The dilated result shown is similar to Fig. 9 The mask template image shown in the figure is differentiated, and the contours with contour areas greater than 200 pixels are selected in the result image after differentiation to obtain Fig.17 The result graph is shown.

[0121] The same or similar reference numerals correspond to the same or similar components;

[0122] The positional relationships described in the drawings are only for illustrative purposes and should not be construed as limiting the present patent.

[0123] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for detecting Mura defects with blurred edges in LCD screens, characterized in that: The following steps are involved: S1: Extract the region of interest in the image by image cropping; S2: Perform Gaussian filtering on the image in step S1 to remove Gaussian noise; S3: down-sampling the image after step S2 to reduce the resolution of the image; S4: performing edge filling on the image after step S3, filling the non-screen area of ​​the edge area; S5: adding noise to a certain position of the image after step S4; S6: performing a difference between the image with added noise after step S5 and the image obtained in step S4, and enhancing the result image after the difference; S7: binarizing and dilating the image obtained in step S6 to screen out defects; S8: upsampling and masking the image obtained in step S7 to restore the resolution of the image and shield false detection in non-screen areas; Among them, in the step S6, the noise value obtained is smaller than the gray value of the white mass defect and larger than the gray value of the black mass defect, and the noise value is not much different from the normal gray value; the white mass defect can be detected by taking a difference between the image without noise filling and the image with noise filling: The noise-filled image and the image without noise filling are differentially detected to detect black defects. In the obtained image, the area with a larger grayscale value is where the defect is located, and the area with a smaller grayscale value is without defect. In order to increase the grayscale value difference between the defective area and the non-defective area, histogram equalization or normalization is used for enhancement. After enhancement by histogram equalization or normalization, the grayscale value difference between the defective area and the non-defective area is widened, which is convenient for the next step of processing; When the grayscale of the image pixels changes randomly and the image histogram appears uneven, histogram equalization makes the image histogram roughly flat; The principle of normalization is to calculate the grayscale value of each pixel in the image and map it to the range of 0-255. The minimum grayscale value before mapping is the lower limit of the range after mapping, and the maximum grayscale value before mapping is the upper limit of the range after mapping: In equation (4), img(n,m) refers to the grayscale value of the pixel with coordinates (n,m) in the image, min_img is the minimum grayscale value of all pixels in the image, and max_img is the maximum grayscale value of all pixels in the image. Normalization is a linear transformation. After normalization, the grayscale value will be mapped to the range of 0-255, which can increase the contrast.

2. The method for detecting Mura defects with blurred edges in LCD screens according to claim 1, characterized in that: In step S1, since LCD screens have various shapes and sizes, in order to ensure that all areas of the product to be tested can be photographed during the actual industrial site inspection process, the camera's field of view must be larger than the area to be tested, so a certain bleed will be left at the edge of the screen. The area to be tested on the LCD screen needs to be cropped out for subsequent processing. Image cropping is performed by manually inputting the screen edge coordinates for cropping or automatically obtaining the edge coordinates for cropping.

3. The method for detecting Mura defects with blurred edges in LCD screens according to claim 2, characterized in that: In step S2, the specific operation of Gaussian filtering is: use a template to scan each pixel in the image, replace the grayscale value of the central pixel of the template with the weighted average grayscale value of the pixels in the neighborhood determined by the template, and select a template with a kernel of 45×45 and a standard deviation of 0 for filtering.

4. The method for detecting Mura defects with blurred edges in LCD screens according to claim 3, characterized in that: In step S3, the bilinear interpolation downsampling mode is adopted to reduce the height and width of the image to the original The grayscale values ​​of the four real pixels around the virtual point in the original image are used to jointly determine the grayscale value of the corresponding pixel in the target image, and the grayscale value corresponding to the virtual point is calculated. Specifically: f(dx,0)=f(0,0)*(1-dx)+f(1,0)*dx(1) f(dx,1)=f(0,1)*(1-dx)+f(1,1)*dx(2) f(dx,dy)=f(dx,0)*(1-dy)+f(dx,1)*dy(3) Among them, f(0,0) represents the grayscale value of the coordinates (0,0), f(0,1) represents the grayscale value of the coordinates (0,1), f(1,0) represents the grayscale value of the coordinates (1,0), f(1,1) represents the grayscale value of the coordinates (1,1), f(dx,0) represents the grayscale value of the coordinates (dx,0), f(dx,1) represents the grayscale value of the coordinates (dx,1), and f(dx,dy) represents the grayscale value of the coordinates (dx,dy).

5. The method for detecting Mura defects with blurred edges in LCD screens according to claim 4, characterized in that: In step S4, the filling process is column by column. First, the grayscale mean of the 100th pixel to the 300th pixel in a column is calculated, and then all the pixels in the column whose grayscale values ​​are lower than a certain threshold are found by traversing all the pixels in the column, so that the grayscale values ​​of these pixels are equal to the calculated grayscale mean.

6. The method for detecting Mura defects with blurred edges in LCD screens according to claim 5, characterized in that: In step S5, when adding noise, it is necessary to proceed column by column from left to right, calculate the pixel mean of each column of pixels in turn, and use the obtained pixel mean as the added noise value, and add the obtained pixel mean to every two pixels in the column.

7. The method for detecting Mura defects with blurred edges in LCD screens according to claim 6, characterized in that: In step S7, after the image without noise is differentiated from the image with noise or the difference image is enhanced, the place with the largest grayscale value in the image is the place where the defect is located, and the grayscale value of other places differs from the maximum value by at least 10. The grayscale value of the pixel points with a grayscale value greater than a certain threshold is set to 255 by a binarization method, and the grayscale value of other areas is set to 0. In the binarization result image, each defect is composed of multiple white short lines, and the white short lines are condensed into a white mass by a dilation operation; The specific operation method of expansion is to use a rectangle with a width of m and a height of n as a template, and perform the following processing on each pixel x in the image: pixel x is placed at the center of the template, and according to the size of the template, all other pixels covered by the template are traversed, and the value of pixel x is modified to the maximum value of all pixels, and the protruding points on the periphery of the image are connected and extended outward.

8. The method for detecting Mura defects with blurred edges in LCD screens according to claim 7, characterized in that: In step S8, due to the downsampling operation, the width and height of the image are reduced to the original Therefore, it is necessary to restore the image to its original size through upsampling; the upsampling selects the bicubic interpolation method, in which the grayscale value of (x, y) can be obtained by the weighted average of the nearest 16 sampling points in the rectangular grid.

9. The method for detecting Mura defects with blurred edges in LCD screens according to any one of claims 1 to 8, characterized in that: A Gaussian filter kernel with a size of 45×45 and a standard deviation of 0 is selected for Gaussian filtering. The resolution of the Gaussian filtering result image is 8797×3965. The large image resolution affects the speed of subsequent image processing. The length and width of the image are reduced to the original After downsampling, the image resolution is reduced to 1759×793.

Citation Information

Patent Citations

  • Mobile phone TFT-LCD screen Mura defect online automatic detection method

    CN108460757A

  • Liquid crystal screen Mura defect detection method based on computer vision

    CN111563889A