A Visual Inspection Method for Black Spot Defects of PAD Light Guide Plates
Through Gaussian filtering, segmented linear transformation and Harris corner point detection algorithms, combined with Chebishev distance grayscale mean judgment, automated, high-speed and accurate detection of black point defects of PAD light guide plates is achieved, and the problem of time-consuming and labor-consuming manual detection is solved.
Patent Information
- Application Number
- CN202210690089.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-06-17
AI Technical Summary
In the prior art, the detection of black spot defects of PAD light guide plates relies on manual detection, consumes a lot of human resources, and the detection speed is slow and the accuracy is low, so continuous and stable work cannot be achieved.
Gaussian filtering and segmented linear transformation are used to preprocess the light guide plate image, combined with the Harris corner point detection algorithm, the black point defect is judged by calculating the difference in the grayscale mean difference of the Chebischev distance of the corner point, and displayed on the winning bid circle of the upper computer.
It improves the accuracy of black spot defect detection of light guide plates, reduces false detection and missed detection, and realizes automated and high-speed online detection.
Smart Images

Figure CN115035071B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of light guide plate production and image recognition, and specifically to a visual detection method for black dot defects of a PAD light guide plate. Background Art
[0002] A light guide plate (LGP) is obtained by making light guide points on an acrylic board using techniques such as screen printing and laser engraving. As a high-tech optical material with a high reflectivity, the light guide plate has excellent characteristics such as being thin, light, high-brightness, environmentally friendly, durable, and having uniform light emission. Therefore, it is widely used in liquid crystal panels, advertising lights, mobile phones, PAD modules, and other scenarios.
[0003] During the plasticization process of the melt of a portable Android device (PAD) light guide plate, sometimes carbonization occurs due to the too high temperature of the cavity for loading the melt, thus generating black dot defects. Currently, domestic light guide plate manufacturers mainly employ a large number of young employees to conduct multi-angle inspections of light guide plate defects under special lighting to pick out the defective light guide plates. This not only consumes a large amount of human resources but also causes varying degrees of damage to the eyesight and cervical vertebrae of the inspectors. In terms of the detection effect, manual detection has too many subjective factors, large detection differences among individuals, slow detection speed, and cannot achieve continuous and stable operation for 7×24 hours. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a visual detection method for black dot defects of a PAD light guide plate for on-line detection of black dots on the produced light guide plate.
[0005] To solve the above technical problem, the present invention provides a visual detection method for black dot defects of a PAD light guide plate, including: collecting an image of the light guide plate and sending it to a host computer for further preprocessing, including performing Gaussian filtering and piecewise linear transformation in sequence, then using the Harris corner detection algorithm to perform corner detection on the preprocessed image, performing black dot detection on the detected corners to determine whether there are black dot defects, and marking and displaying the black dots in the host computer.
[0006] As an improvement to the visual detection method for black dot defects of a PAD light guide plate of the present invention:
[0007] When performing Gaussian filtering to smooth the pixels in the image neighborhood, different weights are assigned to the pixels at different positions in the neighborhood. The pixels closer to the center of the template have larger weights, and the pixels farther from the center of the template have smaller weights:
[0008]
[0009]
[0010] Among them, f(x, y) is the pixel value before transformation, g(x, y) is the pixel value after transformation, and w(s, t) is the weight value.
[0011] As a further improvement to the visual inspection method for black dot defects of the PAD light guide plate in the present invention:
[0012] The piecewise linear transformation is to highlight the gray level intervals of interest and relatively suppress those gray level intervals that are not of interest:
[0013]
[0014] Among them, f(x, y) is the pixel value before transformation, g(x, y) is the pixel value after transformation, and L-1 is the maximum pixel value.
[0015] As a further improvement to the visual inspection method for black dot defects of the PAD light guide plate in the present invention:
[0016] The Harris corner detection algorithm is to use a local window to move in all directions of the image, and judge whether the window is located at a corner point by calculating the gray level change value. When R>0, the center point of the window is the corner point position, and the corner point coordinates Q are the coordinates (x, y) of the center point of the window:
[0017]
[0018] In the formula, R is the corner response function value, λ1 and λ2 are the eigenvalues of the matrix M, detM represents the value of the determinant M, traceM represents the trace of the matrix M, and a is an empirical constant, generally with a value range between 0.04 and 0.06;
[0019] detM = λ1λ2 = AB - C 2 1-(12)
[0020] traceM = λ1 + λ2 = A + B 1-(13)
[0021]
[0022]
[0023]
[0024]
[0025] W is the window centered on (x, y), w(x, y) is the window function within the window, I x and I y are the partial derivatives of I(x, y) in the x direction and y direction respectively:
[0026]
[0027]
[0028] As a further improvement of the visual inspection method for black dot defects of the PAD light guide plate of the present invention:
[0029] The process of the black dot detection is as follows:
[0030] Calculate the average gray value mean1 of the area within the Chebyshev distance of 5 from the corner point coordinate Q, then calculate the average gray value mean2 of the area with the Chebyshev distance of 9 to 11 from the corner point coordinate Q, and then determine whether the difference between the average gray values of the two areas is greater than a pre-set threshold (Threshold). The corner point when mean2 - mean1 > Threshold is a black dot;
[0031] The formula for the Chebyshev distance is:
[0032] d 1,2 = max(|x1 - x2|, |y1 - y2|) 1-(15)
[0033] Where x1, x2, y1, and y2 are the coordinates of the points.
[0034] As a further improvement of the visual inspection method for black dot defects of the PAD light guide plate of the present invention:
[0035] Circle the black dot with a circle centered at the black dot coordinate and a radius of 10 pixels.
[0036] The beneficial effects of the present invention are mainly reflected in:
[0037] The present invention improves the defect that the existing threshold segmentation algorithm uses only a single threshold for division and is prone to missed detection due to the influence of imaging stability. Through the Harris corner detection algorithm and the secondary confirmation of black dot detection, the accuracy of detecting black dots is improved. The present invention improves the defect that the traditional Harris corner detection algorithm simply uses the corner detection algorithm and has a high probability of false detection; by adding the comparison of the average gray values of different distance regions of the corner points on the Harris corner detection algorithm, it is thus determined whether the corner point is a black dot, greatly improving the accuracy of detecting black dots. Description of the Drawings
[0038] The following further describes in detail the specific embodiments of the present invention with reference to the drawings.
[0039] Figure 1 It is a process schematic diagram of a visual inspection method for black dot defects of the PAD light guide plate of the present invention;
[0040] Figure 2 It is an image of a light guide plate with black dot defects;
[0041] Figure 3 It is a comparison diagram before and after preprocessing of a partial image of the light guide plate with black dot defects (the left image is the original image, the middle image is the image after Gaussian filtering, and the right image is the image after piecewise linear transformation);
[0042] Figure 4 It is a schematic diagram of the Harris corner detection algorithm;
[0043] Figure 5 It is a schematic diagram of the relationship between the corner response function R value and the eigenvalues λ1 and λ2;
[0044] Figure 6 It is a schematic diagram of the black dot detection algorithm of the present invention;
[0045] Figure 7 It is a schematic diagram of the effect of black dot defect detection;
[0046] Figure 8 It is a schematic diagram of the process of black dot detection of the present invention;
[0047] Figure 9 It is a schematic diagram of the effect of piecewise linear transformation. Specific embodiments
[0048] The present invention will be further described below in conjunction with specific embodiments, but the protection scope of the present invention is not limited thereto:
[0049] Embodiment 1. A visual detection method for black dot defects of a PAD light guide plate, as Figure 1 shown, the specific process includes:
[0050] 1. Image acquisition and preprocessing
[0051] At the end of the light guide plate production line in the industrial field, a planar array camera is used to collect pictures of the produced light guide plates and send them to the host computer for further preprocessing. As Figure 2 shown, it shows a single imaging picture of the planar array camera, which contains the black dot defects to be detected.
[0052] There are mainly two ways of image preprocessing: first, Gaussian filtering is performed on the obtained original image of the PAD light guide plate to blur the miscellaneous points in the image background; then, piecewise linear transformation is used to significantly improve the contrast of the image. These two steps simplify the design of the subsequent detection algorithm. The preprocessed image is as shown in the appendix Figure 3 shown, Figure 3It is a partial view of the light guide plate image with black dot defects. Among them, the left figure is the original image, the middle image is the image after Gaussian filtering, and the right figure is the image after piecewise linear transformation.
[0053] When Gaussian filtering smooths the pixels in the image neighborhood, different weights are assigned to the pixels at different positions in the neighborhood. The pixels closer to the center of the template have larger weights, and the pixels farther from the center of the template have smaller weights. The advantages of Gaussian filtering are as follows: It can not only smooth the image, but also retain more of the overall gray distribution characteristics of the image. The formula of Gaussian filtering is as follows:
[0054]
[0055]
[0056] Among them, f(x, y) is the pixel value before transformation, g(x, y) is the pixel value after transformation, and w(s, t) is the weight.
[0057] The advantage of piecewise linear transformation is to highlight the gray interval of interest and relatively suppress those gray intervals that are not of interest. The effect is as shown in the appendix Figure 9 and the formula of piecewise linear transformation is as follows:
[0058]
[0059] Among them, f(x, y) is the pixel value before transformation, g(x, y) is the pixel value after transformation, L - 1 is the maximum pixel value, and a and b are the interval critical values of piecewise linear transformation.
[0060] 2. Corner Detection
[0061] Corners can be considered as points with drastic changes in image brightness or points with maximum curvature on the image edge curve. Corner detection is currently widely used in motion detection, image matching, visual tracking and other fields. Corner detection algorithms can be classified into three categories: based on gray scale, based on binary images, and based on contour curves. Among them, corner detection based on gray scale images can be further divided into three methods: based on gradient, based on gradient templates, and based on template gradient combinations. Commonly used template corner detection algorithms include: Harris corner detection, KLT corner detection, SUSAN corner detection, and so on. Among them, the Harris corner detection operator is insensitive to brightness and contrast changes and has rotational invariance, which is more suitable for detecting black dot defects on the light guide plate.
[0062] The core idea of the Harris corner detection algorithm is to use a local window to move in all directions of the image and judge whether the window is located at a corner by calculating the gray scale change value. The schematic of the Harris corner detection algorithm is as shown in the appendix Figure 4 as follows, Figure 4The window in the left figure is in a flat area, and there will be no gray-scale change when it moves in any direction. Figure 4 The window in the middle figure is in an edge area, and there will be no gray-scale change when it moves along the edge direction. Figure 4 The window in the right figure is at a corner point, and obvious gray-scale changes will occur when it moves in any direction.
[0063] The derivation of the Harris corner detection algorithm is as follows:
[0064] According to the algorithm idea, when the center position (x, y) of a window moves to (x + u, y + v), calculate the change amount E(u, v) of the pixel gray-scale value in the window after movement. The formula is as follows:
[0065]
[0066] In the formula, W is the window centered at (x, y), w(x, y) is the window function within the window, generally a two-dimensional Gaussian distribution, which can make the positioning of corner points more accurate, and I(x, y) is the gray-scale value at (x, y).
[0067] The calculation of formula 1-(1) will be very slow. The first-order Taylor expansion of the two-dimensional function can be used to simplify it. The derivation is as follows:
[0068]
[0069] I x and I y are the partial derivatives of I(x, y) in the x direction and y direction respectively, and are defined as follows:
[0070]
[0071]
[0072] Substitute formula 1-(2) into 1-(1) and continue to simplify:
[0073]
[0074] It is represented by a matrix as:
[0075]
[0076] Among them, M is:
[0077]
[0078] In the formula, R is an invertible matrix.
[0079] λ1 and λ2 are the eigenvalues of matrix M. Theoretically, although the corners can be judged by calculating the magnitudes of the eigenvalues, the operation of calculating eigenvalues is very complex and computationally intensive. In practical applications, the empirical formula of corner response is usually used for judgment, which is defined as follows:
[0080] R = detM - a(traceM) 2 1-(8)
[0081] In the formula, the value of the corner response function R is used to judge whether it is a corner. The sign and magnitude of R both determine whether the point is a corner. The specific relationship is as Figure 5 shown. detM represents the value of the determinant M, traceM represents the trace of matrix M, and a is an empirical constant, generally with a value range between 0.04 and 0.06.
[0082] If we let
[0083]
[0084]
[0085]
[0086] then
[0087] detM = λ1λ2 = AB - C 2 1-(12)
[0088] traceM = λ1 + λ2 = A + B 1-(13)
[0089] Then, Equation 1-(8) becomes:
[0090]
[0091] Generally, a threshold can be set to judge whether it is a corner. The relationship between the magnitude of the corner response function R value and the eigenvalues λ1, λ2 is as Figure 5 shown. In the lower left corner area (plane) of the figure, both λ1 and λ2 are relatively small, and |R| is relatively small, indicating that the gray level difference is very small when the window moves in all directions, and the center point (x, y) of the window is in a relatively flat area; in the upper left and lower right corner areas (edges) of the figure, λ1 and λ2 differ relatively greatly, and R is less than 0, indicating that the gray level difference is relatively large in the horizontal or vertical direction of the window, and the center point (x, y) of the window is located at the edge of the object; in the upper right corner and the middle area (corners) of the figure, both λ1 and λ2 are relatively large, and R is greater than 0, indicating that the gray level difference is relatively large no matter which direction the window moves, and the center point (x, y) of the window is exactly located at the corner position, thereby obtaining the corner coordinates Q.
[0092] After the above calculations, the image is divided into planes, edges, and corner points. At this time, many spatially continuous corner points may be detected. Through non-maximum suppression, the positions of the corner points can be more accurately located.
[0093] 3. Black dot detection
[0094] After the corner point detection step, multiple corner point coordinates can be obtained. In fact, these corner point coordinates are not necessarily all black dots. This is because there may be certain noise interference in the image, or the pixel values of the detected corner points do not differ much from the background and may not be considered as black dot defects themselves. Due to the existence of the above situations, it is necessary to perform a secondary confirmation (black dot detection) on the detected corner points to determine whether they are black dot defects.
[0095] The algorithm idea of black dot detection in the present invention can be summarized as follows: First, calculate the mean value of all pixels within a certain range around the corner point to be measured, and then calculate the mean value of the outer pixels. If the difference between the two mean values is greater than a certain threshold, it is determined that the corner point to be measured is a black dot. The schematic diagram of the black dot detection algorithm is as Figure 6 shown. The distance shown in the figure is the Chebyshev distance, which is defined as shown in Equation 1-(15).
[0096] d 1,2 =max(|x1 - x2|,|y1 - y2|) 1-(15)
[0097] where x1, x2, y1, and y2 are the coordinates of the points.
[0098] By statistically analyzing dozens of black dot defect images, it is obtained that the maximum pixel radius of black dot defects does not exceed 7 pixels.
[0099] Calculate the corner points through the corner point detection algorithm of Equation 1-(14) in Step 2. The center point (x, y) of the window in the area where R is greater than 0 obtained is the corner point coordinate Q. Then calculate the average gray value mean1 of the area within a distance of 5 from the corner point coordinate Q, and calculate the average gray value mean2 of the area with a distance of 9 to 11 from the corner point coordinate Q. Determine whether the corner point is a black dot by judging whether the difference between the average gray values of the two areas is greater than a pre-set threshold (Threshold). The corner point when mean2 - mean1 > Threshold is a black dot. The specific flowchart is as Figure 8 shown. Finally, for easy observation and confirmation, draw a circle with a radius of 10 pixels centered on the black dot coordinates, and mark and display the detected black dots on the upper computer.
[0100] After the mean value calculation, the interference of background noise can be eliminated, and the artificially set threshold can exclude points with too small gray value differences, realizing the filtering of non-black dot defects. Through the above algorithm, the effect of black dot defect detection is as Figure 7 shown.
[0101] Experiment:
[0102] A comparative detection experiment was conducted on the visual detection method for black dot defects of the PAD light guide plate of the present invention, the traditional threshold segmentation algorithm, and the traditional Harris corner detection method. The traditional threshold segmentation algorithm uses a single unique gray value to filter the pixels in the image. In this experiment, the gray threshold was set to 160, and the pixels with gray values greater than 160 were all filtered out, while the pixels with gray values less than or equal to 160 were retained. Compared with the algorithm of the present invention, the traditional Harris corner detection algorithm lacks the last step of black dot detection and only obtains the coordinates Q of the corners (i.e., only performs the corner detection in step 2 of Embodiment 1).
[0103] The experimental data in this experiment were collected from the industrial site, with a total of 1443 images, including 447 images without black dots and 996 images with one black dot. Then, all the images were preprocessed by Gaussian filtering and piecewise linear transformation in sequence, and then black dot detection was performed on the 1443 preprocessed images respectively. The statistical detection results are shown in Tables 1 to 3.
[0104] Table 1 Statistical data of the black dot detection algorithm of the present invention
[0105]
[0106] Table 2 Statistical data of the traditional threshold segmentation algorithm experiment
[0107]
[0108]
[0109] Table 3 Statistical data of the traditional Harris corner detection method experiment
[0110]
[0111] It can be seen from the above experimental data that the detection accuracy of this patent is 100%. In comparison, the accuracy of the traditional threshold segmentation algorithm is 92.5%, while the accuracy of the traditional Harris corner detection method is only 4.9%. Since the traditional threshold segmentation algorithm only uses a single threshold as the standard for dividing whether it is a black dot, it is easily affected by the imaging stability. For some black dots, the gray value after imaging is relatively large, and the algorithm will miss detections. And due to the lack of secondary confirmation in the traditional Harris corner detection algorithm, some light guide points on the light guide plate are misjudged as black dots, resulting in a large number of false detections.
[0112] Through the detection test of multiple images of light guide plates, it is shown that the traditional Harris corner detection algorithm simply uses the corner detection algorithm without secondary confirmation, resulting in a high probability of false detection. This paper adds a new method to the existing algorithm to compare the grayscale mean of areas at different distances from the corner point to determine whether the corner point is a black point, greatly improving the accuracy of black point detection.
[0113] Finally, it should be noted that the above examples are merely specific embodiments of the present invention. Obviously, the present invention is not limited to the above examples and is subject to numerous variations. All variations that can be directly derived or conceived by a person of ordinary skill in the art from the disclosure of the present invention are considered to be within the scope of protection of the present invention.
Claims
1. A visual inspection method for black dot defects of a PAD light guide plate, characterized in that :Collect the image of the light guide plate and send it to the host computer for further preprocessing, including Gaussian filtering and piecewise linear transformation in sequence, then use the Harris corner detection algorithm to detect corners in the preprocessed image, detect black dots for the detected corners to determine whether they are black dot defects, and mark and circle the black dots in the host computer; The Harris corner detection algorithm is to move a local window in all directions of the image and judge whether the window is located at a corner by calculating the gray value change. When R>0, the center point of the window is the corner position, and the corner coordinate Q is the center point coordinate (x, y) of the window: In the formula, R is the corner response function value, λ1 and λ2 are the eigenvalues of matrix M, detM represents the value of determinant M, traceM represents the trace of matrix M, and α is an empirical constant with a value range between 0.04 and 0.06; detM = l1λ2 = AB - C 2 1-(12) traceM=l1+l2=A+B 1-(13) W is a window centered at (x, y), w(x, y) is the window function within the window, I x and I y are the partial derivatives of I(x, y) in the x - direction and y - direction respectively: The process of the black dot detection is as follows: Calculate the average gray value mean1 of the area within the Chebyshev distance of 5 from the corner coordinate Q, then calculate the average gray value mean2 of the area within the Chebyshev distance of 9 to 11 from the corner coordinate Q, and then judge whether the difference between the average gray values of the two areas is greater than the pre-set threshold (Threshold). The corner when mean2 - mean1>Threshold is a black dot; The formula for the Chebyshev distance is: Where x1, x2, y1, y2 are the coordinates of the points.
2. The visual detection method for black dot defects of a PAD light guide plate according to claim 1, characterized in that: When performing Gaussian filtering to smooth the pixels in the image neighborhood, pixels at different positions in the neighborhood are assigned different weights. The pixels closer to the center of the template have larger weights, and the pixels farther from the center of the template have smaller weights: Where f(x, y) is the pixel value before transformation, g(x, y) is the pixel value after transformation, and w(s, t) is the weight.
3. The visual detection method for black dot defects of a PAD light guide plate according to claim 2, characterized in that: The piecewise linear transformation is to highlight the gray interval of interest and relatively suppress those gray intervals that are not of interest: Where f(x, y) is the pixel value before transformation, g(x, y) is the pixel value after transformation, and L-1 is the maximum pixel value.
4. The visual detection method for black dot defects of a PAD light guide plate according to claim 3, characterized in that: Circling the black dot is to draw a circle with the black dot coordinate as the center and a radius of 10 pixels.
Citation Information
Patent Citations
Image corner point matching method based on self-adaptive threshold and RANSAC
CN108335319A
Method for visual detection of defects of light guide plate of two-side light-incoming type
CN108416766A