A method for detecting edge collapse defects of optical wafers
Through the combination of image acquisition and OpenCV library operators, the automatic identification and measurement of edge chipping defects in light-pass sheets is realized, which solves the time-consuming, labor-intensive and high-cost problems of existing detection methods, and improves detection efficiency and product quality.
Patent Information
- Application Number
- CN202411061659.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-08-05
AI Technical Summary
The existing methods for detecting edge chipping defects in light-pass sheets are time-consuming and labor-intensive, are prone to oversights and errors, and require a large amount of human resources, resulting in high costs and difficulty in ensuring product quality.
The image acquisition device is used to obtain the light-passage sheet image, and the operators in the OpenCV library are used to perform edge feature extraction, binarization processing and connected area detection. The polygon approximation algorithm and Blob detection are combined to automatically identify and measure the edge collapse of the light-passage sheet unit. defect.
It achieves efficient and accurate edge chipping defect detection, reduces manual intervention, improves detection efficiency and product quality, and reduces costs.
Smart Images

Figure CN118570215B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a method for detecting edge collapse defects of a light-transmitting wafer. Background Art
[0002] Optical film, also known as optical thin film, has a complex and precise production process and plays an important role in many fields such as lasers, solar cells, and optical fiber communications. Edge collapse refers to a series of problems such as peeling, cracks, or uneven edges on the edges of optical film due to improper cutting or uneven coating during the production process. This defect will lead to a decline in product performance and even make it unable to be used normally.
[0003] At present, the method of detecting the edge collapse defects of the optical plate is that workers use a microscope to check the edge area of each optical plate unit. Since the general optical plate includes multiple optical plate units, each optical plate unit is between 1.4-2.5 mm in length, workers need to use a 10x eyepiece to manually adjust the position of the optical plate in small increments to observe the defects of each optical plate unit. This process is not only time-consuming and labor-intensive, but also prone to negligence and errors. In addition, traditional detection methods require a lot of human resources and training, resulting in high manual inspection costs.
[0004] Therefore, there is an urgent need to provide an efficient and accurate method for detecting chipping defects. This method can significantly improve the production quality of optical wafers, ensuring that each product meets high standards, while reducing the need for manual intervention, thereby reducing manufacturing costs. This also helps to improve product reliability and reduce the risk of after-sales service and product recalls. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the purpose of the present invention is to provide a method for detecting edge collapse defects of a light-transmitting wafer.
[0006] The purpose of the present invention is achieved through the following technical solution: A method for detecting edge collapse defects of a light-through sheet comprises the following steps:
[0007] S1, step of acquiring an original light sheet image: first, acquiring an original light sheet image through an image acquisition device, wherein the original light sheet image includes a plurality of light sheet unit images;
[0008] S2, size information acquisition step: convert the original optical pass film image obtained in step 1 into a grayscale image, and perform Gaussian blur processing, use the Sobel operator in the OpenCV4.5.1 library to extract the edge features of the grayscale image after Gaussian blur processing, and obtain the Sobel image; binarize the Sobel image to highlight the edge features of the optical pass film unit to obtain the edge binary image; then perform a connected area detection on the edge binary image, and then remove the impurity area with an area smaller than the set value in the edge binary image, and then obtain the edge contour in the edge binary image according to the edge search algorithm, and then polygonize the edge contour in the edge binary image through the polygon approximation algorithm. shape approximation to obtain the approximated contour; then select a convex quadrilateral contour from the approximated contour, obtain the vertex coordinates of the convex quadrilateral contour, calculate the maximum value of the cosine values of the four angles of the convex quadrilateral contour and compare it with the set cosine value range, if the maximum value of the cosine values of the four angles of the convex quadrilateral contour is within the set cosine value range, then it is judged that the shape of the convex quadrilateral contour is close to a rectangle, thereby screening out convex quadrilateral contours with shapes close to rectangles, and obtain the minimum circumscribed tilted rectangle of the screened convex quadrilateral contour through the MinAreaRect operator in Opencv, and obtain the four vertex coordinates of the minimum circumscribed tilted rectangle, that is, obtain the actual length and width of the qualified optical pass unit and the rotation angle information according to the four vertex coordinates;
[0009] S3, preprocessing step: preprocessing the original optical image obtained in step 1, expanding the original optical image to all sides to obtain an expanded image; then converting the expanded image into a binary expanded image, dividing the pixels into foreground pixels and background pixels; then performing an opening operation to reduce the noise in the binary expanded image to ensure the accuracy of the detection process and obtain a denoised image;
[0010] S4, the optical pass unit area identification step: the denoised image obtained in step 3 is subjected to connected area detection; the qualified optical pass unit area is calculated according to the length and width information of the optical pass unit calculated in step 2, and the connected area in the denoised image that meets the set area size is screened out by multiplying by the set area ratio; at the same time, a Blob detection is performed on the denoised image to screen out all Blob detection areas in the denoised image that are close to the area size of the qualified optical pass unit area, and then the center position coordinates of the optical pass unit area are obtained, and the X coordinates of the center position coordinates are added to half of the length of the optical pass unit obtained in step 2 to obtain the first length value; the X coordinates of the center position coordinates are subtracted from half of the length of the optical pass unit obtained in step 2 to obtain to the second length value; the Y coordinate of the center position coordinate is added with half of the width of the optical pass sheet unit obtained in step 2 to obtain the first width value; the Y coordinate of the center position coordinate is subtracted with half of the width of the optical pass sheet unit obtained in step 2 to obtain the second width value; if the first length value, the second length value, the first width value or the second width value exceeds the area where the original optical pass sheet image in the denoised image is located, it is determined that the optical pass sheet unit area is on the edge area of the denoised image and is an incomplete optical pass sheet unit area, and the incomplete optical pass sheet unit area on the edge area of the denoised image is removed; finally, an optical pass sheet unit group area consisting of a plurality of qualified optical pass sheet unit areas is obtained, and then the areas where the individual optical pass sheet units are located are obtained one by one in the optical pass sheet unit group area according to the index;
[0011] S5, the step of extracting the image of the optical pass sheet unit: in the optical pass sheet unit group area obtained in step 4, the area where the single optical pass sheet unit is located is obtained one by one according to the index, and the minimum circumscribed rectangular area of the area where the optical pass sheet unit is located is created, and then the minimum circumscribed rectangular area is expanded to ensure that the minimum circumscribed rectangular area covers the entire optical pass sheet unit, that is, the preliminary identification area of the optical pass sheet unit is obtained; then, the optical pass sheet unit preliminary identification area is used to extract the optical pass sheet unit image part contained in the expanded image, that is, the optical pass sheet unit image extracted for the first time is obtained; the optical pass sheet unit image extracted for the first time is binarized to enhance the edge features, that is, the binary optical pass sheet unit image is obtained; the binary optical pass sheet unit image is connected to detect the area and screen the area, that is, the area where the final optical pass sheet unit is located is obtained; then, the minimum circumscribed rectangle is created for the area where the final optical pass sheet unit is located, that is, the final optical pass sheet unit circumscribed rectangular area is obtained; then, the final optical pass sheet unit circumscribed rectangular area is used to extract the final optical pass sheet unit image from the optical pass sheet unit image extracted for the first time;
[0012] S6, edge chipping detection step: calculate the rotation angle of the circumscribed rectangular area of the final optical pass unit obtained in step 5, and then draw a measurement rectangle for the extracted final optical pass unit image according to the actual length and width of the qualified optical pass unit calculated in step 2 and the set minimum edge chipping value information, detect the edge area of the final optical pass unit image, and use the formed measurement handle to calculate the length of the final optical pass unit image, and compare it with the actual length of the qualified optical pass unit obtained in step 2. If it is less than the set range value, it is determined that there is edge chipping and recorded, and the entire optical pass unit image is repeatedly detected to obtain the number of edge chips of this optical pass unit. In this way, all optical pass unit images are traversed according to the index in step 5, and the edge chipping defect level of each optical pass unit image is determined.
[0013] Preferably, the size information acquisition step includes: converting the original optical pass sheet image into a grayscale image, and performing Gaussian blur processing, and then using the Sobel operator in the OpenCV4.5.1 library to convert the X-direction gradient map and the Y-direction gradient map of the grayscale image after Gaussian blur into absolute value images, and weightedly fusing the X-direction gradient map and the Y-direction gradient map of the grayscale image after Gaussian blur to generate a total gradient image, dividing the total gradient image into a foreground and a background, highlighting the edge area features of each optical pass sheet unit in the grayscale image after Gaussian blur, and obtaining a Sobel image; and then using an adaptive threshold method to binarize the Sobel image, dividing the Sobel image into an edge area and a non-edge area, and then obtaining an edge binary image;
[0014] Perform a connected region detection on the edge binary image, and then remove the impurity area whose area is smaller than the set value in the edge binary image. The basic principle is: traverse the image pixels from the upper left corner to the lower right corner of the edge binary image, and when encountering an unmarked foreground pixel, start marking a new connected region; for the current foreground pixel, expand the connected region by searching its adjacent pixels; if the adjacent pixel is also a foreground pixel and is not marked, it will be marked as the same connected region; continue to traverse each pixel of the image until all foreground pixels are assigned to the corresponding connected region;
[0015] Finally, each pixel in the edge binary image contains a label of a connected region of a specific size, which is used to identify each region and remove impurity regions smaller than the set area in the edge binary image.
[0016] Then, the edge contour in the edge binary image is obtained according to the edge search algorithm, and then the edge contour in the edge binary image is approximated by polygon to obtain the approximated contour; then the convex quadrilateral contour is selected in the approximated contour to obtain the vertex coordinates of the convex quadrilateral contour; the cosine value of the angle is calculated based on the vertex coordinates of the convex quadrilateral contour, and the angle between the three adjacent points is calculated. , , The cosine value of the angle between the two vectors is formed and the maximum value is selected to determine whether the coordinates of the convex quadrilateral contour vertices obtained meet the set conditions, that is, to determine whether the shape of the convex quadrilateral is close to a rectangle, as shown in the following formula:
[0017]
[0018] In the formula is the x-coordinate value of the ith vertex of the convex quadrilateral, is the y coordinate value of the i-th vertex of the convex quadrilateral, is the x-coordinate value of the i+1th vertex of the convex quadrilateral, is the y coordinate value of the i+1th vertex of the convex quadrilateral, is the x-coordinate value of the i+2th vertex of the convex quadrilateral, is the y coordinate value of the i+2th vertex of the convex quadrilateral, For vector and vector The angle between two vectors, is the vector value composed of the i-th vertex and the i+1-th vertex, is the vector value composed of the i+1th vertex and the i+2th vertex, is the maximum cosine value calculated, if If the value of is less than 0.4, it is considered that the shape of the convex quadrilateral is close to a rectangle, and the contour of the convex quadrilateral is a qualified light pass sheet contour;
[0019] Create the minimum circumscribed tilted rectangle of the qualified light pass sheet outline and obtain the coordinates of the four vertices of the minimum circumscribed tilted rectangle. The following formula is used to calculate the length, width and rotation angle of the minimum circumscribed tilted rectangle through the coordinates of the four vertices of the minimum circumscribed tilted rectangle:
[0020]
[0021]
[0022]
[0023] In the formula, is the minimum circumscribed inclined rectangle length, is the minimum circumscribed oblique rectangle width, is the rotation angle of the minimum circumscribed tilted rectangle, is the minimum number of circumscribed inclined rectangles, For the The x-coordinate value of the first point of the smallest circumscribed tilted rectangle, which is the upper left corner. For the The y coordinate value of the first point of the smallest circumscribed tilted rectangle, which is the upper left corner. For the The x-coordinate value of the second point of the smallest circumscribed tilted rectangle, i.e. the upper right corner. For the The y coordinate value of the second point of the smallest circumscribed tilted rectangle, which is the upper right corner point. For the The x-coordinate value of the third point of the smallest circumscribed tilted rectangle, which is the lower right corner. For the The y coordinate value of the third point of the minimum circumscribed tilted rectangle, that is, the lower right corner point; calculate the length, width and rotation angle information of the minimum circumscribed tilted rectangle to obtain the length, width and rotation angle information of the corresponding qualified optical pass unit, and calculate the length of the minimum circumscribed tilted rectangle Corresponding length of the optical pass unit , the calculated minimum enclosing tilted rectangle width Corresponding to the width of the optical pass unit , the calculated minimum circumscribed tilted rectangle rotation angle Corresponding to the rotation angle of the optical channel unit , and the subsequent edge collapse detection operation is performed based on the identified length, width and rotation angle information of the optical pass unit.
[0024] Preferably, the preprocessing step includes: expanding the original optical transmission sheet image by a first set number of pixels to obtain an expanded image;
[0025] The outward-expanded image is binarized, and the Otsu algorithm is used to segment the outward-expanded image to maximize the inter-class variance between the foreground and background of the outward-expanded image, thereby obtaining a threshold for dividing the outward-expanded image into foreground and background. The threshold divides the outward-expanded image into foreground and background, and finally obtains a binary outward-expanded image.
[0026] Preferably, the opening operation includes: performing an opening operation on the binary expanded image to remove noise or holes on the binary expanded image, including the following steps: first performing an erosion operation and then performing an expansion operation; the erosion operation will shrink the objects in the binary expanded image and remove the noise on the boundary; the expansion operation will cause the objects in the binary expanded image to grow again and restore to their original shape; through the combination of these two operations, the noise is eliminated and the overall shape of the objects in the binary expanded image is maintained, and this step obtains a denoised image with noise or holes removed.
[0027] Preferably, the target area identification step includes: extracting the area where each optical pass sheet unit is located in the external expansion image, including the following steps:
[0028] Connected region detection: Perform connected region detection on the denoised image to obtain multiple optical flow unit regions;
[0029] Multiple light pass unit area selection: Calculate the qualified light pass unit area based on the calculated length and width of the light pass unit , by multiplying by the set area ratio, the connected areas in the denoised image with an area size within the set range are screened out, that is, the area of the qualified optical pass unit area of the set size is selected, where Represents the length of the light channel unit, Represents the width of the optical pass unit;
[0030] Removing the incomplete light pass unit area on the edge area of the image includes the following steps:
[0031] Use Blob detection to obtain the coordinate information of the light channel unit: the Blob detector sets the detection style so that the Blob detector only detects quadrilateral patches, and sets the detection area so that the Blob detector screens out patches outside the set area size range; use the configured Blob detector to directly detect the denoised image and obtain The selected plaques are then obtained The center coordinates of the light channel unit;
[0032] Removal of incomplete light-pass unit areas at the edge of the denoised image: The center coordinates of the light pass unit are combined with the length and width of the light pass unit obtained in step 2 to determine whether the i-th light pass unit area is on the edge area of the denoised image according to the following formula:
[0033] like , it is considered that the i-th optical pass unit area is not on the edge area of the denoised image, where , represents the x-coordinate of the center of the ith light channel unit, represents the y coordinate of the center of the i-th light channel unit, Represents the length of the light channel unit, Represents the width of the optical pass unit, Represents the rotation angle of the optical pass unit, L represents the length of the denoised image, W represents the width of the denoised image, and M represents the set number of pixels to be expanded; otherwise, it is considered that the optical pass unit area is on the edge area of the denoised image and is an incomplete optical pass unit area. The actual detection removes the incomplete optical pass unit area on the edge area of the denoised image, that is, the optical pass unit group area composed of multiple qualified optical pass unit areas is obtained, and then the area where the single optical pass unit is located is obtained one by one in the optical pass unit group area according to the index.
[0034] Preferably, the target unit image extraction step includes:
[0035] In the optical pass unit group area, the area where each optical pass unit is located is obtained one by one according to the index, and the minimum circumscribed rectangular area of the area where the optical pass unit is located is created;
[0036] The minimum circumscribed rectangular area of the optical pass unit is expanded, and the circumscribed rectangular area of the optical pass unit is expanded to a set size in all directions to obtain a preliminary identification area of the optical pass unit;
[0037] The light pass unit image is extracted for the first time, by traversing each pixel of the external expansion image and removing the pixels beyond the initial identification area of the light pass unit, to obtain the light pass unit image extracted for the first time;
[0038] Performing a binarization operation on the light pass sheet unit image extracted for the first time, so that the light pass sheet unit in the light pass sheet unit image extracted for the first time is adjusted to white, and the background is adjusted to black, thereby obtaining a binarized light pass sheet unit image;
[0039] Connected region detection: Connected region detection is performed on the binary optical pass sheet unit image. Each connected region is represented by a different grayscale value in the binary optical pass sheet unit image, that is, multiple connected regions including a single optical pass sheet unit region are obtained;
[0040] Screening of the area of a single optical pass unit: The area of a qualified optical pass unit is Multiplying by the set first area ratio, screening out the connected areas within the set area size range in the optical pass sheet unit image extracted for the first time, that is, obtaining the area where the final optical pass sheet unit is located, and then converting the area where the final optical pass sheet unit is located into the circumscribed rectangular area of the final optical pass sheet unit;
[0041] The second extraction of the light pass unit image: by traversing each pixel in the light pass unit image extracted for the first time, and removing the pixels outside the circumscribed rectangular area of the final light pass unit, the final light pass unit image is obtained.
[0042] Preferably, the edge collapse detection step comprises:
[0043] Get the centroid coordinate position of the final optic unit circumscribed rectangular area: take the upper left corner of the final optic unit circumscribed rectangular area as the coordinate origin, set the pixel coordinates in the final optic unit circumscribed rectangular area as (x, y), and the total number of pixels as N;
[0044] The x-coordinate of the center of mass: ;
[0045] The y coordinate of the center of mass: ;
[0046] Among them, Σx and Σy are the sum of the x-coordinate and y-coordinate of all pixels respectively; the centroid coordinates of the circumscribed rectangular area of the final light pass unit are obtained , The x-coordinate of the centroid of the circumscribed rectangular area of the final light-pass unit. The y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit;
[0047] Get the rotation angle of the final optic unit circumscribed rectangular area: Calculate the second-order covariance matrix of the final optic unit circumscribed rectangular area :
[0048]
[0049] in, , represents the discrete degree of the i-th pixel in the x direction;
[0050] , represents the discrete degree of the i-th pixel in the y direction;
[0051] , represents the covariance of the i-th pixel in the x and y directions;
[0052] Calculate the eigenvalues of the above covariance matrix and With the eigenvector and , the eigenvalues of the covariance matrix represents the variance of the principal axis, represents the variance of the secondary axis, and the eigenvector Indicates the direction of the length of the circumscribed rectangular area of the final light pass unit, It represents the direction of the width of the circumscribed rectangular area of the final light pass unit; the direction parameter is the angle of the eigenvector corresponding to the main eigenvalue. > , choose a large eigenvalue The corresponding eigenvector Calculate the angle:
[0053]
[0054] in, is the eigenvector The component in the x direction, is the eigenvector The component in the y direction, It is the angle between the length of the rectangular area circumscribed by the final optical pass unit and the positive direction of the X axis, and the range is ;
[0055] Set the minimum chipping width within the tolerance range , respectively calculate the number of measurement rectangles drawn in the length and width directions of the circumscribed rectangular area of the final light pass unit:
[0056]
[0057]
[0058] In the formula, Represents the length of the light channel unit, Represents the width of the optical pass unit, It means that half of the number of measurement rectangles are drawn in the length direction of the circumscribed rectangular area of the final optical pass unit. It means that half of the number of measurement rectangles drawn in the width direction of the circumscribed rectangular area of the final optical pass unit is drawn. , The remainder of the calculation result is taken down.
[0059] Preferably, when drawing the long axis measurement rectangle, the centroid coordinates of the circumscribed rectangular area of the final optical pass unit are used. As the origin, For distance, along The direction is extended to both sides to find the position coordinates of two target pixel points, one of which is the first target pixel point. The position coordinates of the first target pixel point are obtained by the following method. Set the coordinate point: ( , ):
[0060]
[0061]
[0062] Another target pixel point is the second target pixel point, which is obtained by the following method. Let the coordinate point ( , ):
[0063]
[0064]
[0065] in, represents the row coordinate of the first target pixel, represents the column coordinates of the first target pixel, represents the row coordinate of the second target pixel, represents the column coordinates of the second target pixel, The x-coordinate of the centroid of the circumscribed rectangular area of the final light-pass unit. The y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit, It represents the angle between the length direction of the circumscribed rectangular area of the final optical pass unit and the positive direction of the X axis. Indicates the distance between the target pixel and the centroid of the circumscribed rectangular area of the final light pass unit. Its value is:
[0066]
[0067] in Represents the line index value of the measurement line in the length direction of the circumscribed rectangular area of the final optical pass unit. The minimum chipping width within the set tolerance range;
[0068] Then, take the first target pixel ( , ) as the center, is long to set the minimum chipping width within the tolerance range For width, Draw the first measurement rectangle to create the first measurement handle; at the same time, take the second target pixel point ( , ) as the center, For long, For width, For the rotation angle, draw a second measurement rectangle and create a second measurement handle.
[0069] Preferably, the edge collapse measurement operation is performed using 20.11 Library operator, detects the final optical pass unit image through the generated first measurement handle ( , ) is perpendicular to the relative edge area of this image, and the final optical pass unit image ( , ) is perpendicular to the relative edge area of this image, and the total length of the white area in the length distance direction between the edges is calculated respectively. , calculate the unit length The total length of the white area in the direction of the distance from the detected edge The difference :
[0070]
[0071] like: , it is considered that the optical pass unit has edge collapse, where is the minimum chipping length within the tolerance range;
[0072] According to the above steps, the entire final light pass unit image is traversed to obtain the final edge collapse result;
[0073] The defect size range is ≤Result<Set the minimum value to set as a small defect;
[0074] The defect size range of the set minimum value ≤ Result < the set median value is set as a medium defect;
[0075] The defect size range within the set median value ≤ Result < set maximum value is set as a large defect;
[0076] Recording detected small defects in a first array, recording detected medium defects in a second array, and recording detected large defects in a third array;
[0077] Counting the number of defects in the first array, the second array, and the third array;
[0078] If the number of small defects and the number of medium defects are less than the set values and the number of large defects is 0, the edge chipping level is set to low;
[0079] If the number of small defects and the number of medium defects are more than the set value and the number of large defects is 0, the edge chipping level is set to medium;
[0080] If there are large defects, set the chipping level to high.
[0081] The present invention has the following advantages over the prior art:
[0082] 1. High detection accuracy: By using a high-resolution camera to capture minute changes in the edge of the optical pass sheet and combining it with an image processing algorithm, the present invention can accurately identify edge collapse defects and their severity.
[0083] 2. High detection efficiency: The present invention can quickly complete the detection of a large number of optical fiber units through a series of efficient image processing steps, such as edge feature extraction, binarization processing, connected area detection, etc.; compared with traditional manual detection, it greatly improves the detection efficiency and shortens the production cycle.
[0084] 3. High flexibility and scalability: The detection method of the present invention can be adjusted and optimized according to different production requirements and standards; it can adapt to different types of optical film detection by changing the parameters of the image acquisition device or adjusting the threshold in the image processing algorithm, and has good flexibility and scalability.
[0085] 4. The present invention uses an image acquisition device to obtain the original optical film image. The present invention can automatically identify the optical film unit edge collapse defect and its severity. The present invention can not only be quickly executed on the production line, but also provide highly accurate results, almost eliminating human errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 This is a flow chart of edge collapse detection of the present invention;
[0087] Figure 2 Examples of optical pass sheet images for testing in the present invention;
[0088] Figure 3 The edge binarization image after the Sobel operator binarization process is performed in the present invention;
[0089] Figure 4 The schematic diagram of the present invention for determining whether a convex quadrilateral is a rectangle;
[0090] Figure 5 The present invention is to obtain the minimum circumscribed inclined rectangle vertex coordinate image;
[0091] Figure 6 The schematic diagram of the present invention for calculating the unit size and angle of a qualified optical pass sheet;
[0092] Figure 7 The image of the optical channel after pixel expansion of the present invention;
[0093] Figure 8 The light-through image of the present invention is subjected to an opening operation to remove noise;
[0094] Fig. 9 The image of the optical pass sheet unit area after the connected area area screening is performed in the present invention;
[0095] Fig.10 An image of the center coordinates of the light-through sheet unit is obtained after the Blob detection of the present invention;
[0096] Fig.11 The present invention uses Blob detection to remove the incomplete light-through sheet unit area on the image boundary;
[0097] Fig.12 An image of the optical pass sheet unit group region obtained by the present invention;
[0098] Fig.13 The image of the light-through sheet unit after the first extraction of the present invention;
[0099] Fig.14 The image is obtained by binarizing the light flux sheet after the first extraction in the present invention;
[0100] Fig.15 The optical pass sheet unit image after the second extraction of the present invention;
[0101] Fig.16 A schematic diagram of obtaining the center coordinates of a measuring rectangle for the present invention;
[0102] Fig.17 Draw a schematic diagram of the measurement rectangle for the present invention;
[0103] Fig.18 This is a schematic diagram of the principle of drawing a measurement rectangle for a light pass unit according to the present invention. DETAILED DESCRIPTION
[0104] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0105] A method for detecting edge collapse defects of a light-transmitting wafer comprises the following steps:
[0106] Step 1: Acquisition of original optical film image: First, the original optical film image is acquired through the image acquisition device, and the original optical film image contains multiple optical film unit images. The key to this step is to ensure that a high-quality original optical film image is obtained so that the subsequent processing can accurately analyze the characteristics of the optical film.
[0107] Step 2: Size information acquisition step: Convert the original light pass sheet image obtained in step 1 into a grayscale image and perform Gaussian blur processing. Then use the Sobel operator in the OpenCV4.5.1 library to extract the edge features of the grayscale image after Gaussian blur processing to obtain a Sobel image; then binarize the Sobel image to highlight the edge features of the light pass sheet unit to obtain an edge binary image. Then, a connected area detection is performed on the edge binary image to remove the impurity area whose area is less than the set value in the edge binary image. Then, the edge contour in the edge binary image is obtained according to the edge search algorithm, and then the polygon approximation algorithm is used, that is, the ApproxPolyDP operator in Opencv is used to perform polygon approximation on the edge contour in the edge binary image to obtain the approximated contour; then a convex quadrilateral contour is selected from the approximated contour, and the maximum value of the cosine value of the four angles of the convex quadrilateral contour is calculated by obtaining the vertex coordinate position of the convex quadrilateral contour and comparing it with the set cosine value range, so as to determine whether the shape of the convex quadrilateral is close to a rectangle, and the convex quadrilateral contour whose shape is close to a rectangle is screened out, and the minimum circumscribed inclined rectangle of the screened convex quadrilateral contour is obtained by the MinAreaRect operator in Opencv, and the four vertex coordinates of the minimum circumscribed inclined rectangle are obtained, and the actual length and width dimensions and rotation angle information of the qualified optical pass unit can be obtained according to the four vertex coordinates.
[0108] Step 3: Preprocessing step: Preprocess the original optical image obtained in step 1. First, in order to make the outline of the entire original optical image clearer and reduce the error, the original optical image needs to be expanded by 100 pixels (which can be flexibly adjusted according to actual needs, such as 60 pixels, 71 pixels, 112 pixels or 120 pixels, etc.) to obtain an expanded image; then convert the expanded image into a binary expanded image, and divide the pixels into foreground pixels and background pixels. Then perform an open operation (Opencv's own algorithm) to reduce the noise in the binary expanded image to ensure the accuracy of the detection process and obtain a denoised image.
[0109] Step 4: Identification of the optical pass unit area: Perform a connected area detection on the denoised image obtained in step 3; calculate the area of the qualified optical pass unit area according to the length and width information of the optical pass unit calculated in step 2, and select the connected areas that meet the conditions in the denoised image by multiplying by the set area ratio, that is, select the area of the set size close to the area of the qualified optical pass unit area; at the same time, perform a Blob detection on the denoised image, and select all Blob detection areas in the denoised image that are close to the area size of the qualified optical pass unit area, and then obtain the center position coordinates of the optical pass unit area, combined with the length and width information of the optical pass unit obtained in step 2 (that is: length The incomplete optical pass sheet unit area on the edge area of the denoised image can be removed; specifically: according to the X coordinate of the center position, half of the length of the optical pass sheet unit obtained in step 2 is added and subtracted respectively, and at the same time, according to the Y coordinate of the center position, half of the width of the optical pass sheet unit obtained in step 2 is added and subtracted respectively, and it is judged whether the obtained value exceeds the area where the original optical pass sheet image in the denoised image is located. If it exceeds the area where the original optical pass sheet image in the denoised image is located, it is judged that the optical pass sheet unit area is on the edge area of the denoised image and is an incomplete optical pass sheet unit area, and the incomplete optical pass sheet unit area on the edge area of the denoised image is removed;
[0110] Finally, a light pass sheet unit group area which is not on the image boundary and is composed of a plurality of qualified light pass sheet unit areas can be obtained, and then the areas where single light pass sheet units are located can be obtained one by one in the light pass sheet unit group area according to the index.
[0111] Step 5: Photoelectric sheet unit image extraction step: in the photoelectric sheet unit group area obtained in step 4, the area where the single photoelectric sheet unit is located is obtained one by one according to the index, and the minimum circumscribed rectangular area of the area where the photoelectric sheet unit is located is created, and then the minimum circumscribed rectangular area is expanded to ensure that the minimum circumscribed rectangular area covers the entire photoelectric sheet unit, that is, the preliminary identification area of the photoelectric sheet unit is obtained; then the photoelectric sheet unit preliminary identification area is used to extract the photoelectric sheet unit image part contained in the expanded image, that is, the photoelectric sheet unit image extracted for the first time is obtained; the photoelectric sheet unit image extracted for the first time is binarized to enhance the edge features, that is, the binary photoelectric sheet unit image is obtained; the binary photoelectric sheet unit image is connected to the area detection and area screening to obtain the final photoelectric sheet unit area; then, the minimum circumscribed rectangle is created for the area where the final photoelectric sheet unit is located to obtain the final photoelectric sheet unit circumscribed rectangular area; then, the final photoelectric sheet unit circumscribed rectangular area is used to extract the final photoelectric sheet unit image from the photoelectric sheet unit image extracted for the first time.
[0112] Step 6: Edge chipping detection step: According to the rotation angle of the circumscribed rectangular area of the final optical pass unit obtained in step 5, and according to the actual length and width dimensions of the qualified optical pass unit calculated in step 2 and the set minimum edge chipping value information, draw a measurement rectangle for the extracted final optical pass unit image, detect the edge area of the final optical pass unit image, and use the formed measurement handle to calculate the length of the opposite white area of the final optical pass unit image, and compare it with the actual length dimension of the qualified optical pass unit obtained in step 2. If it is less than the set range value, it is determined that there is an edge chipping and recorded. Repeat the detection of the entire optical pass unit image to obtain the number of edge chips of the optical pass unit. In this way, all optical pass unit images are traversed according to the index in step 5 to determine the edge chipping defect level of the entire optical pass image.
[0113] Specific: such as Figure 1 As shown, in the optical pass sheet edge chipping defect detection method, in the original optical pass sheet image acquisition step 1, the image acquisition device is a detection device equipped with a high-resolution lens, which can clearly acquire the original optical pass sheet image under high-speed operation, such as Figure 2 As shown, the entire optical pass sheet includes a plurality of optical pass sheet units;
[0114] The size information acquisition step, step 2, preprocesses the original optical sheet image obtained in step 1 to obtain the length, width and tilt angle information of the optical sheet unit, including the following sub-steps:
[0115] Step 2.1: Convert the original optical filter image into a grayscale image and perform Gaussian blur processing. Then, use the Sobel operator in the OpenCV4.5.1 library to convert the X-direction gradient map and Y-direction gradient map of the grayscale image after Gaussian blur into absolute value images respectively. Perform weighted fusion on the X-direction gradient map and Y-direction gradient map of the grayscale image after Gaussian blur to generate a total gradient image. The total gradient image can be divided into foreground and background, highlighting the edge area features of each optical filter unit in the grayscale image after Gaussian blur to obtain a Sobel image. Then, use the adaptive threshold method to binarize the Sobel image, divide the Sobel image into edge areas and non-edge areas, and then obtain an edge binary image, such as Figure 3 shown.
[0116] Step 2.2 performs a connected region detection on the edge binary image, and then removes the impurity region whose area is smaller than the set value in the edge binary image. The basic principle is: traverse the image pixels from the upper left corner to the lower right corner of the edge binary image, and when encountering an unmarked foreground pixel, start marking a new connected region; for the current foreground pixel, expand the connected region by searching its adjacent pixels; if the adjacent pixel is also a foreground pixel and is not marked, it will be marked as the same connected region; continue to traverse each pixel of the image until all foreground pixels are assigned to the corresponding connected region;
[0117] Finally, each pixel in the edge binary image contains a label of a connected region of a specific size, which is used to identify different regions, thereby removing impurity regions smaller than the set area in the edge binary image.
[0118] Step 2.3: Obtain the edge contour in the edge binary image according to the edge search algorithm, and then perform polygonal approximation on the edge contour in the edge binary image to obtain the approximated contour; then select the convex quadrilateral contour in the approximated contour to obtain the coordinates of the four vertices of the convex quadrilateral contour;
[0119] Calculate the cosine of the angle between the vertices of the convex quadrilateral contour by calculating the cosine of the three adjacent points , , The cosine value of the angle between the two vectors is formed and the maximum value is selected to determine whether the coordinates of the convex quadrilateral contour vertices obtained meet the requirements, that is, to determine whether the shape of the convex quadrilateral is close to a rectangle, such as Figure 4 As shown, is the coordinate of the ith vertex of the convex quadrilateral, are the coordinates of the i+1th vertex of the convex quadrilateral, is the coordinate of the i+2th vertex of the convex quadrilateral, as follows:
[0120]
[0121] In the formula is the x-coordinate value of the ith vertex of the convex quadrilateral, is the y coordinate value of the i-th vertex of the convex quadrilateral, is the x-coordinate value of the i+1th vertex of the convex quadrilateral, is the y coordinate value of the i+1th vertex of the convex quadrilateral, is the x-coordinate value of the i+2th vertex of the convex quadrilateral, is the y coordinate value of the i+2th vertex of the convex quadrilateral, For vector and vector The angle between two vectors, The vector value composed of the i-th vertex and the i+1-th vertex, is the vector value composed of the i+1th vertex and the i+2th vertex, is the maximum cosine value calculated, if If the value of is less than 0.4, it is considered that the shape of the convex quadrilateral is close to a rectangle, and the contour of the convex quadrilateral is a qualified light pass sheet contour;
[0122] Step 2.4 Create the minimum circumscribed tilted rectangle of the qualified light pass outline, such as Figure 5 As shown, the coordinates of the four vertices of the minimum circumscribed inclined rectangle are obtained. The following formula is used to calculate the length, width and rotation angle of the minimum circumscribed inclined rectangle (i.e., calculate the length, width and rotation angle of the optical pass unit) through the coordinates of the four vertices of the minimum circumscribed inclined rectangle:
[0123]
[0124]
[0125]
[0126] In the formula, is the minimum circumscribed inclined rectangle length, is the minimum circumscribed oblique rectangle width, is the rotation angle of the minimum circumscribed tilted rectangle, is the minimum number of circumscribed inclined rectangles, For the The x-coordinate value of the first point of the smallest circumscribed tilted rectangle, which is the upper left corner. For the The y coordinate value of the first point of the smallest circumscribed tilted rectangle, which is the upper left corner. For the The x-coordinate value of the second point of the smallest circumscribed tilted rectangle, i.e. the upper right corner. For the The y coordinate value of the second point of the smallest circumscribed tilted rectangle, which is the upper right corner point. For the The x-coordinate value of the third point of the smallest circumscribed tilted rectangle, which is the lower right corner. For the The y coordinate value of the third point of the minimum circumscribed tilted rectangle, that is, the lower right corner point; calculate the length, width and rotation angle information of the minimum circumscribed tilted rectangle to obtain the length, width and rotation angle information of the corresponding qualified optical pass unit, and calculate the length of the minimum circumscribed tilted rectangle Corresponding length of the optical pass unit , the calculated minimum enclosing tilted rectangle width Corresponding to the width of the optical pass unit , the calculated minimum circumscribed tilted rectangle rotation angle Corresponding to the rotation angle of the optical unit ,like Figure 6 As shown, For the The coordinates of the first point of the smallest circumscribed tilted rectangle, i.e. the upper left corner point. For the The coordinates of the second point of the smallest circumscribed tilted rectangle, i.e. the upper right corner. For the The third point of the smallest circumscribed inclined rectangle, i.e., the lower right corner point coordinate, is used to perform subsequent edge collapse detection operations based on the length, width, and rotation angle information of the identified optical pass unit.
[0127] The preprocessing step (i.e. image preprocessing) consists of the following sub-steps:
[0128] Step 3.1 Figure 7 As shown, in order to make the boundary of the captured original optical flux image clearer and meet the connected area detection required later, the original optical flux image obtained in step 1 is expanded to the surrounding by a first set number of pixels, such as 100 pixels (it can also be expanded to 60, 70, 75, 82, 90, 105, 112 pixels, etc., which can be selected according to actual needs), and finally an expanded image is obtained.
[0129] Step 3.2 performs a binarization operation on the outward-expanded image. Because defects in the optical film may cause some areas to be dark and unclear, the Otsu's method is used to segment the outward-expanded image to maximize the inter-class variance between the foreground and background of the outward-expanded image, thereby obtaining the optimal threshold for dividing the outward-expanded image into foreground and background. This threshold can divide the outward-expanded image into foreground and background, and finally obtain a binary outward-expanded image.
[0130] Step 3.3 Figure 8As shown, the binary expanded image is opened to remove noise or holes on the binary expanded image, including the following steps: first performing an erosion operation and then performing an expansion operation. The erosion operation will shrink the objects in the binary expanded image and remove the noise on the boundary. The expansion operation will make the objects in the binary expanded image grow again and restore to their original shape. Through the combination of these two operations, the noise can be eliminated and the overall shape of the objects in the binary expanded image can be maintained. This step can obtain a denoised image with noise or holes removed.
[0131] The optical pass sheet unit area identification step 4 needs to identify the area where each optical pass sheet unit is located in the external expansion image, which mainly includes the following sub-steps:
[0132] Step 4.1 performs connected region detection: performs connected region detection on the denoised image to obtain multiple optical path unit regions.
[0133] Step 4.2 Fig. 9 As shown, multiple optical pass unit area screening is performed: the qualified optical pass unit area is calculated according to the length and width information of the optical pass unit calculated in step 2 , by multiplying by the set area ratio, filter out the denoising images that meet the conditions ( ), that is, select the area of the set size close to the area of the qualified optical pass unit area, where Represents the length of the light channel unit, Represents the width of the light channel unit.
[0134] Step 4.3 Fig.10 As shown, Blob detection is used to obtain the coordinate information of the light channel unit: the Blob detector sets the detection style so that the Blob detector only detects the patches of quadrilateral style; the Blob detector sets the detection area so that the Blob detector screens out the patches that are not within the set area size range ( ) within the image; use the configured Blob detector to directly detect the denoised image and obtain The selected plaques are then obtained The center coordinates of the light channel unit.
[0135] Step 4.4 Fig.11 As shown, the removal of incomplete light channel unit areas on the edge area of the denoised image is achieved by The center coordinates of the light pass sheet unit are combined with the length and width of the light pass sheet unit obtained in step 2 to determine whether the i-th light pass sheet unit area is in the edge area of the denoised image according to the following formula:
[0136] like , then it is considered that the i-th light pass unit area is not in the edge area of the denoised image, where , represents the x-coordinate of the center of the ith light channel unit, represents the y coordinate of the center of the i-th light channel unit, Represents the length of the light channel unit, Represents the width of the optical pass unit, represents the rotation angle of the optical pass sheet unit, L represents the length of the denoised image, W represents the width of the denoised image, and 100 represents the set number of pixels for the above-mentioned pixel expansion (it can also be 60, 72, 83, 94, 105, 116, etc., which can be selected according to actual needs); otherwise, it is considered that the optical pass sheet unit area is on the edge area of the denoised image, and the incomplete optical pass sheet unit area in the edge area of the denoised image will be removed in actual detection.
[0137] Finally, if Fig.12 As shown, a light pass sheet unit group area on the edge area of the denoised image composed of multiple qualified light pass sheet unit areas is obtained, and then the areas where single light pass sheet units are located can be obtained one by one in the light pass sheet unit group area according to the index.
[0138] The light pass sheet unit image extraction step 5 can obtain individual light pass sheet unit images one by one according to the index value, and the detection mainly includes the following sub-steps:
[0139] Step 5.1 obtains the area where each light pass unit is located one by one according to the index in the light pass unit group area, and creates the minimum circumscribed rectangular area of the area where the light pass unit is located.
[0140] Step 5.2 performs expansion processing on the minimum circumscribed rectangular area of the optical pass unit, expands the circumscribed rectangular area of the optical pass unit to a set size in all directions, and obtains a preliminary identification area of the optical pass unit.
[0141] Step 5.3 Fig.13 As shown, the first extraction of the light-pass unit image is performed by traversing each pixel of the externally expanded image and removing the pixels beyond the initial identification area of the light-pass unit, thereby obtaining the light-pass unit image extracted for the first time.
[0142] Step 5.4 Fig.14 As shown, a binarization operation is performed on the light pass sheet unit image extracted for the first time, so that the light pass sheet unit in the light pass sheet unit image extracted for the first time is adjusted to white and the background is adjusted to black, thereby obtaining a binarized light pass sheet unit image.
[0143] Step 5.5 performs connected region detection: performs connected region detection on the binary light pass sheet unit image, each connected region is represented by a different grayscale value in the binary light pass sheet unit image, that is, multiple connected regions including a single light pass sheet unit region are obtained.
[0144] Step 5.6: Screen the area of a single light pass unit: Multiply by the set first area ratio (the first area ratio range can be selected ), filter out the connected areas within the set area size range in the optical pass sheet unit image extracted for the first time, that is, obtain the area where the final optical pass sheet unit is located, and then convert the area where the final optical pass sheet unit is located into the circumscribed rectangular area of the final optical pass sheet unit.
[0145] Step 5.7 Fig.15 As shown, the second extraction of the light pass sheet unit image is performed: each pixel in the light pass sheet unit image extracted for the first time is traversed, and the pixels outside the circumscribed rectangular area of the final light pass sheet unit are removed to obtain the final light pass sheet unit image.
[0146] The edge chipping detection step 6 performs edge chipping detection on the final optical pass sheet unit image obtained in step 5, and the detection mainly includes the following sub-steps:
[0147] Step 6.1 obtains the centroid coordinate position of the circumscribed rectangular area of the final light pass unit: the upper left corner of the circumscribed rectangular area of the final light pass unit is taken as the coordinate origin, the pixel coordinates in the circumscribed rectangular area of the final light pass unit are set to (x, y), and the total number of pixels is N.
[0148] The x-coordinate of the center of mass: ;
[0149] The y coordinate of the center of mass: ;
[0150] Among them, Σx and Σy are the sum of the x-coordinate and y-coordinate of all pixels respectively. The centroid coordinates of the circumscribed rectangular area of the final light-pass unit can be obtained , The x-coordinate of the centroid of the circumscribed rectangular area of the final light-pass unit. Indicates the y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit.
[0151] Step 6.2 Obtain the rotation angle between the circumscribed rectangular area of the final light pass unit and the positive direction of the X axis: Calculate the second-order covariance matrix of the circumscribed rectangular area of the final light pass unit :
[0152]
[0153] in, , which indicates the discrete degree of the i-th pixel in the x direction.
[0154] , which indicates the discrete degree of the i-th pixel in the y direction.
[0155] , represents the covariance of the i-th pixel in the x and y directions.
[0156] Calculate the eigenvalues of the above covariance matrix and With the eigenvector and , the eigenvalues of the covariance matrix represents the variance of the principal axis, represents the variance of the secondary axis, and the eigenvector Indicates the direction of the length of the circumscribed rectangular area of the final light pass unit, It represents the direction of the width of the circumscribed rectangular area of the final light pass unit; the direction parameter is the angle of the eigenvector corresponding to the main eigenvalue. > , choose a large eigenvalue The corresponding eigenvector calculation angle, that is, choose the larger eigenvalue The corresponding eigenvector calculates the angle:
[0157]
[0158] in, is the eigenvector The component in the x direction, is the eigenvector The component in the y direction, It is the angle between the length of the rectangular area circumscribed by the final optical pass unit and the positive direction of the X axis, and the range is ;
[0159] Step 6.3 Set the minimum chipping width within the tolerance range , respectively calculate the number of measurement rectangles drawn in the length and width directions of the circumscribed rectangular area of the final light pass unit:
[0160]
[0161]
[0162] In the formula, Represents the length of the light channel unit, Represents the width of the optical pass unit, It means that half of the number of measurement rectangles are drawn in the length direction of the circumscribed rectangular area of the final optical pass unit. It means that half of the number of measurement rectangles drawn in the width direction of the circumscribed rectangular area of the final optical pass unit is drawn. , The calculation result is rounded down to an integer.
[0163] Take drawing a long axis measurement rectangle as an example. Fig.16 As shown, the centroid coordinates of the rectangular area circumscribed by the final optical pass unit are As the origin, For distance, along The direction is extended to both sides to find the position coordinates of the two target pixel points. The position coordinates of the two target pixel points are obtained by the following method. One of the target pixel points is the first target pixel point. The position coordinates of the first target pixel point are obtained by the following method. Suppose the coordinate point ( , ):
[0164]
[0165]
[0166] Another target pixel point is the second target pixel point, which is obtained by the following method. Let the coordinate point ( , ):
[0167]
[0168]
[0169] in, Represents the row coordinates of the target pixel, Represents the column coordinates of the target pixel, represents the row coordinate of the second target pixel, represents the column coordinates of the second target pixel, The x-coordinate of the centroid of the circumscribed rectangular area of the final light-pass unit. The y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit, It represents the angle between the length direction of the circumscribed rectangular area of the final optical pass unit and the positive direction of the X axis. Indicates the distance between the target pixel and the centroid of the circumscribed rectangular area of the final light pass unit. Its value is:
[0170]
[0171] in , represents the line index value of the measurement straight line in the length direction of the circumscribed rectangular area of the final light pass unit;
[0172] Then, if Fig.17 As shown, the first target pixel point ( , ) as the center, is long to set the minimum chipping width within the tolerance range For width, Draw the first measurement rectangle to create the first measurement handle; at the same time, take the second target pixel point ( , ) as the center, For long, For width, For the rotation angle, draw a second measurement rectangle and create a second measurement handle.
[0173] Step 6.4 performs the edge collapse measurement operation, such as Fig.18 As shown, using 20.11 Library operator, detects the final optical pass sheet unit image through the first measurement handle generated in step 6.3 ( , ) is perpendicular to the relative edge area of this image, and the final optical pass unit image ( , ) is perpendicular to the relative edge area of this image, and the total length of the white area in the long distance direction between the edges is calculated respectively. , calculate the unit length The total length of the white area in the long distance direction from the detected edge The difference :
[0174]
[0175] like: , it is considered that the optical pass unit has edge collapse, where The minimum chipping length within the tolerance range;
[0176] Step 6.5: traverse the entire final optical pass sheet unit image according to step 6.4 to obtain the edge collapse detection result of the optical pass sheet unit;
[0177] The defect size range is ≤Result<Set minimum value 0.2mm is set as a small defect;
[0178] The defect size range of the set minimum value ≤ Result < set median value 0.4mm is set as a medium defect;
[0179] The defect size range of the set median value ≤ Result < the set maximum value 0.5mm is set as a large defect;
[0180] Recording detected small defects in a first array, recording detected medium defects in a second array, and recording detected large defects in a third array;
[0181] Counting the number of defects in the first array, the second array, and the third array;
[0182] If the number of small defects is less than 10, the number of medium defects is less than 4, and the number of large defects is 0, the edge collapse defect level of the optical pass unit is set to low;
[0183] If the number of small defects is more than 10 or the number of medium defects is more than 4, and the number of large defects is 0, the edge collapse defect level of the optical pass unit is set to medium;
[0184] If there is a large defect, the edge collapse defect level of the optical pass unit is set to high level.
[0185] Specifically, the results are stored in three arrays of edge collapse defects according to different range sizes. These three arrays represent edge collapse defects in different ranges. Assume that the three arrays are Array1 (first array), Array2 (second array) and Array3 (third array). Record the length of each array to determine the number of edge collapse defects in different areas. When recording the edge collapse of each optical pass unit, these three arrays can be used to represent the distribution of edge collapse defects in different areas. For example, for small defects, count the number of defects in Array1; for medium defects, count the number of defects in Array2; for large defects, count the number of defects in Array3.
[0186] In this way, each image of the optical pass unit obtained in step 5 is traversed according to step 6. If the optical pass unit has a chipping defect, the center coordinates of the optical pass unit and the corresponding chipping level are recorded (that is, the center coordinates of the optical pass unit with the chipping defect and the chipping level are recorded);
[0187] In order to verify the effectiveness of the above-mentioned method for detecting the edge collapse of optical pass sheets, 4 samples were randomly selected, including 2184 small optical pass sheet units and 394 optical pass sheet unit samples with edge collapse. The above-mentioned algorithm was used for detection, and the defective number, defective rate, accuracy rate and recognition time of the optical pass sheet units after the edge collapse detection were counted. The statistical results are shown in Table 1.
[0188] Table 1
[0189]
[0190] As shown in Table 1, the defect rate of the detection algorithm for the edge collapse of the optical plate is 17.31%, the accuracy rate is 95.93%, and the false detection rate is 1.32%. Among them, the false detection of non-edge collapse is wrongly judged as edge collapse; after inspection and analysis, some samples have slight jitter during the transmission process, resulting in partial distortion of the image, which is identified by the detection system as a distorted image and removed in advance or mistakenly detected as an edge collapse image. In addition, the detection and recognition time of this system is about 27s, which can greatly reduce the detection speed and meet the real-time requirements.
[0191] The above embodiments are only used to understand the present invention. It should be noted that, for those skilled in the art, several improvements can be made to the present invention without departing from the principles of the present invention, and these improvements will also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting edge collapse defects of optical pass film, characterized in that: The following steps are involved: S1, step of acquiring an original light sheet image: first, acquiring an original light sheet image through an image acquisition device, wherein the original light sheet image includes a plurality of light sheet unit images; S2, size information acquisition step: convert the original optical pass film image obtained in step 1 into a grayscale image, and perform Gaussian blur processing, use the Sobel operator in the OpenCV4.5.1 library to extract the edge features of the grayscale image after Gaussian blur processing, and obtain the Sobel image; binarize the Sobel image to highlight the edge features of the optical pass film unit to obtain the edge binary image; then perform a connected area detection on the edge binary image, and then remove the impurity area with an area smaller than the set value in the edge binary image, and then obtain the edge contour in the edge binary image according to the edge search algorithm, and then polygonize the edge contour in the edge binary image through the polygon approximation algorithm. shape approximation to obtain the approximated contour; then select a convex quadrilateral contour from the approximated contour, obtain the vertex coordinates of the convex quadrilateral contour, calculate the maximum value of the cosine values of the four angles of the convex quadrilateral contour and compare it with the set cosine value range, if the maximum value of the cosine values of the four angles of the convex quadrilateral contour is within the set cosine value range, then it is judged that the shape of the convex quadrilateral contour is close to a rectangle, thereby screening out convex quadrilateral contours with shapes close to rectangles, and obtain the minimum circumscribed tilted rectangle of the screened convex quadrilateral contour through the MinAreaRect operator in Opencv, and obtain the four vertex coordinates of the minimum circumscribed tilted rectangle, that is, obtain the actual length and width of the qualified optical pass unit and the rotation angle information according to the four vertex coordinates; S3, preprocessing step: preprocessing the original optical image obtained in step 1, expanding the original optical image to all sides to obtain an expanded image; then converting the expanded image into a binary expanded image, dividing the pixels into foreground pixels and background pixels; then performing an opening operation to reduce the noise in the binary expanded image to ensure the accuracy of the detection process and obtain a denoised image; S4, the optical pass unit area identification step: the denoised image obtained in step 3 is subjected to connected area detection; the qualified optical pass unit area is calculated according to the length and width information of the optical pass unit calculated in step 2, and the connected area in the denoised image that meets the set area size is screened out by multiplying by the set area ratio; at the same time, a Blob detection is performed on the denoised image to screen out all Blob detection areas in the denoised image that are close to the area size of the qualified optical pass unit area, and then the center position coordinates of the optical pass unit area are obtained, and the X coordinates of the center position coordinates are added to half of the length of the optical pass unit obtained in step 2 to obtain the first length value; the X coordinates of the center position coordinates are subtracted from half of the length of the optical pass unit obtained in step 2 to obtain to the second length value; the Y coordinate of the center position coordinate is added with half of the width of the optical pass sheet unit obtained in step 2 to obtain the first width value; the Y coordinate of the center position coordinate is subtracted with half of the width of the optical pass sheet unit obtained in step 2 to obtain the second width value; if the first length value, the second length value, the first width value or the second width value exceeds the area where the original optical pass sheet image in the denoised image is located, it is determined that the optical pass sheet unit area is on the edge area of the denoised image and is an incomplete optical pass sheet unit area, and the incomplete optical pass sheet unit area on the edge area of the denoised image is removed; finally, an optical pass sheet unit group area consisting of a plurality of qualified optical pass sheet unit areas is obtained, and then the areas where the individual optical pass sheet units are located are obtained one by one in the optical pass sheet unit group area according to the index; S5, the step of extracting the image of the optical pass sheet unit: in the optical pass sheet unit group area obtained in step 4, the area where the single optical pass sheet unit is located is obtained one by one according to the index, and the minimum circumscribed rectangular area of the area where the optical pass sheet unit is located is created, and then the minimum circumscribed rectangular area is expanded to ensure that the minimum circumscribed rectangular area covers the entire optical pass sheet unit, that is, the preliminary identification area of the optical pass sheet unit is obtained; then, the optical pass sheet unit preliminary identification area is used to extract the optical pass sheet unit image part contained in the expanded image, that is, the optical pass sheet unit image extracted for the first time is obtained; the optical pass sheet unit image extracted for the first time is binarized to enhance the edge features, that is, the binary optical pass sheet unit image is obtained; the binary optical pass sheet unit image is connected to detect the area and screen the area, that is, the area where the final optical pass sheet unit is located is obtained; then, the minimum circumscribed rectangle is created for the area where the final optical pass sheet unit is located, that is, the final optical pass sheet unit circumscribed rectangular area is obtained; then, the final optical pass sheet unit circumscribed rectangular area is used to extract the final optical pass sheet unit image from the optical pass sheet unit image extracted for the first time; S6, edge chipping detection step: calculate the rotation angle of the circumscribed rectangular area of the final optical pass unit obtained in step 5, and then draw a measurement rectangle for the extracted final optical pass unit image according to the actual length and width of the qualified optical pass unit calculated in step 2 and the set minimum edge chipping value information, detect the edge area of the final optical pass unit image, and use the formed measurement handle to calculate the length of the final optical pass unit image, and compare it with the actual length of the qualified optical pass unit obtained in step 2. If it is less than the set range value, it is determined that there is edge chipping and recorded, and the entire optical pass unit image is repeatedly detected to obtain the number of edge chips of this optical pass unit. In this way, all optical pass unit images are traversed according to the index in step 5, and the edge chipping defect level of each optical pass unit image is determined.
2. The method for detecting edge collapse defects of optical pass sheets according to claim 1, characterized in that: The size information acquisition step comprises: The original optical filter image is converted into a grayscale image and Gaussian blurred. Then, the Sobel operator in the OpenCV4.5.1 library is used to convert the X-direction gradient map and the Y-direction gradient map of the grayscale image after Gaussian blur into absolute value images, and the X-direction gradient map and the Y-direction gradient map of the grayscale image after Gaussian blur are weighted fused to generate a total gradient image. The total gradient image is divided into foreground and background, and the edge area features of each optical filter unit in the grayscale image after Gaussian blur are highlighted to obtain a Sobel image. Then, the Sobel image is binarized using the adaptive threshold method, and the Sobel image is divided into edge areas and non-edge areas, thereby obtaining an edge binary image. Perform a connected region detection on the edge binary image, and then remove the impurity region whose area is smaller than the set value in the edge binary image; Then, the edge contour in the edge binary image is obtained according to the edge search algorithm, and then the edge contour in the edge binary image is approximated by polygon to obtain the approximated contour; then the convex quadrilateral contour is selected in the approximated contour to obtain the vertex coordinates of the convex quadrilateral contour; the cosine value of the angle is calculated based on the vertex coordinates of the convex quadrilateral contour, and the angle between the three adjacent points is calculated. , , The cosine value of the angle between the two vectors is formed and the maximum value is selected to determine whether the coordinates of the convex quadrilateral contour vertices obtained meet the set conditions, that is, to determine whether the shape of the convex quadrilateral is close to a rectangle, as shown in the following formula: In the formula is the x-coordinate value of the ith vertex of the convex quadrilateral, is the y coordinate value of the i-th vertex of the convex quadrilateral, is the x-coordinate value of the i+1th vertex of the convex quadrilateral, is the y coordinate value of the i+1th vertex of the convex quadrilateral, is the x-coordinate value of the i+2th vertex of the convex quadrilateral, is the y coordinate value of the i+2th vertex of the convex quadrilateral, For vector and vector The angle between two vectors, is the vector value composed of the i-th vertex and the i+1-th vertex, is the vector value composed of the i+1th vertex and the i+2th vertex, is the maximum cosine value calculated, if If the value of is less than 0.4, it is considered that the shape of the convex quadrilateral is close to a rectangle, and the contour of the convex quadrilateral is a qualified light pass sheet contour; Create the minimum circumscribed tilted rectangle of the qualified light pass sheet outline and obtain the coordinates of the four vertices of the minimum circumscribed tilted rectangle. The following formula is used to calculate the length, width and rotation angle of the minimum circumscribed tilted rectangle through the coordinates of the four vertices of the minimum circumscribed tilted rectangle: In the formula, is the minimum circumscribed inclined rectangle length, is the minimum circumscribed oblique rectangle width, is the minimum circumscribed tilted rectangle rotation angle, is the minimum number of circumscribed inclined rectangles, For the The x coordinate value of the first point of the smallest circumscribed tilted rectangle, which is the upper left corner. For the The y coordinate value of the first point of the smallest circumscribed tilted rectangle, which is the upper left corner, For the The x-coordinate value of the second point of the smallest circumscribed tilted rectangle, i.e. the upper right corner. For the The y coordinate value of the second point of the smallest circumscribed tilted rectangle, which is the upper right corner point. For the The x-coordinate value of the third point of the smallest circumscribed tilted rectangle, which is the lower right corner. For the The y coordinate value of the third point of the minimum circumscribed tilted rectangle, that is, the lower right corner point; calculate the length, width and rotation angle information of the minimum circumscribed tilted rectangle to obtain the length, width and rotation angle information of the corresponding qualified optical pass unit, and calculate the length of the minimum circumscribed tilted rectangle Corresponding length of the optical pass unit , the calculated minimum enclosing tilted rectangle width Corresponding to the width of the optical pass unit , the calculated minimum circumscribed tilted rectangle rotation angle Corresponding to the rotation angle of the optical unit , and the subsequent edge collapse detection operation is performed based on the identified length, width and rotation angle information of the optical pass unit.
3. The method for detecting edge collapse defects of optical pass sheets according to claim 1, characterized in that: The pre-processing step comprises: Expanding the original optical channel image to all sides by a first set number of pixels to obtain an expanded image; The outward-expanded image is binarized, and the Otsu algorithm is used to segment the outward-expanded image to maximize the inter-class variance between the foreground and background of the outward-expanded image, thereby obtaining a threshold for dividing the outward-expanded image into foreground and background. The threshold divides the outward-expanded image into foreground and background, and finally obtains a binary outward-expanded image.
4. The method for detecting edge collapse defects of optical pass sheets according to claim 3, characterized in that: The opening operation includes: performing an opening operation on the binary expanded image to remove noise or holes on the binary expanded image, including the following steps: first performing an erosion operation and then performing an expansion operation; the erosion operation will shrink the object in the binary expanded image and remove the noise on the boundary; the expansion operation will make the object in the binary expanded image grow again and restore it to the original shape; through the combination of these two operations, the noise is eliminated and the overall shape of the object in the binary expanded image is maintained, and this step obtains a denoised image with noise or holes removed.
5. The method for detecting edge collapse defects of optical pass sheets according to claim 1 or 2, characterized in that: The optical pass sheet unit area identification step comprises: Extracting the area where each optical pass sheet unit is located in the expanded image includes the following steps: Connected region detection: Perform connected region detection on the denoised image to obtain multiple optical flow unit regions; Multiple light pass unit area selection: Calculate the qualified light pass unit area based on the calculated length and width of the light pass unit , by multiplying by the set area ratio, the connected areas in the denoised image with an area size within the set range are screened out, that is, the area of the qualified optical pass unit area of the set size is selected, where Represents the length of the light channel unit, Represents the width of the optical pass unit; Removing the incomplete light pass unit area on the edge area of the image includes the following steps: Use Blob detection to obtain the coordinate information of the light channel unit: the Blob detector sets the detection style so that the Blob detector only detects quadrilateral patches, and sets the detection area so that the Blob detector screens out patches outside the set area size range; use the configured Blob detector to directly detect the denoised image and obtain The selected plaques are then obtained The center coordinates of the light channel unit; Removal of incomplete light-pass unit areas at the edge of the denoised image: The center coordinates of the light pass unit are combined with the length and width of the light pass unit obtained in step 2 to determine whether the i-th light pass unit area is on the edge area of the denoised image according to the following formula: like , it is considered that the i-th optical pass unit area is not on the edge area of the denoised image, where , represents the x-coordinate of the center of the ith light channel unit, represents the y coordinate of the center of the i-th light channel unit, Represents the length of the light channel unit, Represents the width of the optical pass unit, Represents the rotation angle of the optical pass unit, L represents the length of the denoised image, W represents the width of the denoised image, and M represents the set number of pixels to be expanded; otherwise, it is considered that the optical pass unit area is on the edge area of the denoised image and is an incomplete optical pass unit area. The actual detection removes the incomplete optical pass unit area on the edge area of the denoised image, that is, the optical pass unit group area composed of multiple qualified optical pass unit areas is obtained, and then the area where the single optical pass unit is located is obtained one by one in the optical pass unit group area according to the index.
6. The method for detecting edge collapse defects of optical pass sheets according to claim 5, characterized in that: The light transmission unit image extraction step comprises: In the optical pass unit group area, the area where each optical pass unit is located is obtained one by one according to the index, and the minimum circumscribed rectangular area of the area where the optical pass unit is located is created; The minimum circumscribed rectangular area of the optical pass unit is expanded, and the circumscribed rectangular area of the optical pass unit is expanded to a set size in all directions to obtain a preliminary identification area of the optical pass unit; The light pass unit image is extracted for the first time, by traversing each pixel of the external expansion image and removing the pixels beyond the initial identification area of the light pass unit, to obtain the light pass unit image extracted for the first time; Performing a binarization operation on the light pass sheet unit image extracted for the first time, so that the light pass sheet unit in the light pass sheet unit image extracted for the first time is adjusted to white, and the background is adjusted to black, thereby obtaining a binarized light pass sheet unit image; Connected region detection: Connected region detection is performed on the binary optical pass sheet unit image. Each connected region is represented by a different grayscale value in the binary optical pass sheet unit image, that is, multiple connected regions including a single optical pass sheet unit region are obtained; Screening of the area of a single optical pass unit: The area of a qualified optical pass unit is Multiplying by the set first area ratio, screening out the connected areas within the set area size range in the optical pass sheet unit image extracted for the first time, that is, obtaining the area where the final optical pass sheet unit is located, and then converting the area where the final optical pass sheet unit is located into the circumscribed rectangular area of the final optical pass sheet unit; The second extraction of the light pass unit image: by traversing each pixel in the light pass unit image extracted for the first time, and removing the pixels outside the circumscribed rectangular area of the final light pass unit, the final light pass unit image is obtained.
7. The method for detecting edge collapse defects of optical pass sheets according to claim 1 or 6, characterized in that: The edge collapse detection step comprises: Get the centroid coordinate position of the final optic unit circumscribed rectangular area: take the upper left corner of the final optic unit circumscribed rectangular area as the coordinate origin, set the pixel coordinates in the final optic unit circumscribed rectangular area as (x, y), and the total number of pixels as N; The x-coordinate of the center of mass: ; The y coordinate of the center of mass: ; Among them, Σx and Σy are the sum of the x-coordinate and y-coordinate of all pixels respectively; the centroid coordinates of the circumscribed rectangular area of the final light pass unit are obtained , The x-coordinate of the centroid of the circumscribed rectangular area of the final light-pass unit. The y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit; Get the rotation angle of the final optic unit circumscribed rectangular area: Calculate the second-order covariance matrix of the final optic unit circumscribed rectangular area : in, , represents the discrete degree of the i-th pixel in the x direction; , represents the discrete degree of the i-th pixel in the y direction; , represents the covariance of the i-th pixel in the x and y directions; Calculate the eigenvalues of the above covariance matrix and With the eigenvector and , the eigenvalues of the covariance matrix represents the variance of the principal axis, represents the variance of the secondary axis, and the eigenvector Indicates the direction of the length of the circumscribed rectangular area of the final light pass unit, It represents the direction of the width of the circumscribed rectangular area of the final light pass unit; the direction parameter is the angle of the eigenvector corresponding to the main eigenvalue. > , choose a large eigenvalue The corresponding eigenvector Calculate the angle: in, is the eigenvector The component in the x direction, is the eigenvector The component in the y direction, It is the angle between the length of the rectangular area circumscribed by the final optical pass unit and the positive direction of the X axis, and the range is ; Set the minimum chipping width within the tolerance range , respectively calculate the number of measurement rectangles drawn in the length and width directions of the circumscribed rectangular area of the final light pass unit: In the formula, Represents the length of the light channel unit, Represents the width of the optical pass unit, It means that half of the number of measurement rectangles are drawn in the length direction of the circumscribed rectangular area of the final optical pass unit. It means that half of the number of measurement rectangles drawn in the width direction of the circumscribed rectangular area of the final optical pass unit is drawn. , The remainder of the calculation result is taken down.
8. The method for detecting edge collapse defects of optical pass sheets according to claim 7, characterized in that: When drawing the long axis measurement rectangle, the centroid coordinates of the rectangular area circumscribed by the final optical pass unit are used. As the origin, For distance, along The direction is extended to both sides to find the position coordinates of two target pixel points, one of which is the first target pixel point. The position coordinates of the first target pixel point are obtained by the following method. Set the coordinate point: ( , ): Another target pixel is the second target pixel, which is obtained by the following method. Let the coordinate point ( , ): in, represents the row coordinate of the first target pixel, represents the column coordinates of the first target pixel, represents the row coordinate of the second target pixel, represents the column coordinates of the second target pixel, The x-coordinate of the centroid of the circumscribed rectangular area of the final light-pass unit. The y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit, It represents the angle between the length direction of the circumscribed rectangular area of the final optical pass unit and the positive direction of the X axis. Indicates the distance between the target pixel and the centroid of the circumscribed rectangular area of the final light pass unit. Its value is: in Represents the line index value of the measurement line in the length direction of the circumscribed rectangular area of the final optical pass unit. The minimum chipping width within the set tolerance range; Then, take the first target pixel ( , ) as the center, is long to set the minimum chipping width within the tolerance range For width, Draw the first measurement rectangle to create the first measurement handle; at the same time, take the second target pixel point ( , ) as the center, For long, For width, For the rotation angle, draw a second measurement rectangle and create a second measurement handle.
9. The method for detecting edge collapse defects of optical pass sheets according to claim 8, characterized in that: To perform edge chipping measurement, use 20.11 Library operator, detects the final optical pass unit image through the generated first measurement handle ( , ) is perpendicular to the relative edge area of this image, and the final optical pass unit image ( , ) is perpendicular to the relative edge area of this image, and the total length of the white area in the length distance direction between the edges is calculated respectively. , calculate the unit length The total length of the white area in the direction of the distance from the detected edge The difference : like: , it is considered that the optical pass unit has edge collapse, where is the minimum chipping length within the tolerance range; According to the above steps, the entire final light pass unit image is traversed to obtain the final edge collapse result; The defect size range is ≤Result<Set the minimum value to set as a small defect; The defect size range of the set minimum value ≤ Result < the set median value is set as a medium defect; The defect size range within the set median value ≤ Result < set maximum value is set as a large defect; Recording detected small defects in a first array, recording detected medium defects in a second array, and recording detected large defects in a third array; Counting the number of defects in the first array, the second array, and the third array; If the number of small defects and the number of medium defects are less than the set values and the number of large defects is 0, the edge chipping level is set to low; If the number of small defects and the number of medium defects are more than the set value and the number of large defects is 0, the edge chipping level is set to medium; If there are large defects, set the chipping level to high.
