Method for detecting edge breakage defect of light flux sheet
Through the combination of image acquisition and OpenCV library operators, the length, width and rotation angle of the light-passing sheet unit are automatically identified, which solves the time-consuming and labor-intensive problem of edge chipping defect detection in existing light-passing sheets and achieves efficient and accurate edge chipping. detection, reducing costs and improving product quality.
Patent Information
- Application Number
- CN202411061659.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-08-30
- 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 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 calculate the length of the light-passage unit. Width and rotation angle to detect chipping defects.
It achieves efficient and accurate detection of edge chipping defects, significantly improves detection accuracy and efficiency, reduces manual intervention, reduces production costs, and ensures product quality and reliability.
Smart Images

Figure CN118570215A
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 chipping defects in optical wafers. Background Art
[0002] Optical film, also known as thin-film optical film, has a complex and precise production process and plays a vital role in numerous fields, including lasers, solar cells, and fiber optic communications. Edge chipping refers to a series of defects such as peeling, cracks, or uneven edges that may occur on the edges of optical film due to improper cutting or uneven coating during the production process. These defects can lead to reduced product performance and even render it unusable.
[0003] Currently, the method for detecting chipped edges in optical fiber sheets involves workers using a microscope to inspect the edge of each optical fiber unit. Since optical fiber sheets typically consist of multiple optical fiber units, each ranging in length from 1.4 to 2.5 mm, workers must use a 10x eyepiece and manually adjust the position of the optical fiber unit in small increments to observe the defects in each unit. This process is not only time-consuming and labor-intensive, but also prone to oversight and errors. Furthermore, traditional inspection methods require significant human resources and training, resulting in high manual inspection costs.
[0004] Therefore, there is an urgent need for an efficient and accurate method for detecting chipping defects. Such a method could significantly improve the production quality of optical wafers, ensuring that each product meets high standards while reducing the need for manual intervention and thus lowering manufacturing costs. This would also help 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 chipping defects of optical pass wafers.
[0006] The purpose of the present invention is achieved through the following technical solution: A method for detecting edge chipping defects of optical fiber, comprising the following steps: S1, step of acquiring an original optical flow sheet image: first, acquiring an original optical flow sheet image by an image acquisition device, wherein the original optical flow sheet image includes multiple optical flow sheet unit images; S2. Size information acquisition step: convert the original optical 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 to obtain a Sobel image; binarize the Sobel image to highlight the edge features of the optical film unit to obtain an edge binary image; then perform a connected area detection on the edge binary image to 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 using the polygon approximation algorithm. Shape approximation is performed to obtain an approximated contour; then, a convex quadrilateral contour is selected from the approximated contour, and the maximum value of the cosine values of the four included angles of the convex quadrilateral contour is calculated by obtaining the vertex coordinates of the convex quadrilateral contour and comparing it with the set cosine value range. If the maximum value of the cosine values of the four included angles of the convex quadrilateral contour is within the set cosine value range, it is determined that the shape of the convex quadrilateral contour is close to a rectangle, thereby screening out convex quadrilateral contours with a shape close to a rectangle, and obtaining the minimum circumscribed tilted rectangle of the screened convex quadrilateral contour through the MinAreaRect operator in Opencv, and obtaining the four vertex coordinates of the minimum circumscribed tilted rectangle, that is, obtaining the actual length and width of the qualified light 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 in all directions 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 noise in the binary expanded image to ensure the accuracy of the detection process, and obtaining a denoised image; S4, optical pass unit area identification step: perform connected area detection on the denoised image obtained in step 3; then calculate the area of the qualified optical pass unit area based on the length and width information of the optical pass unit calculated in step 2, and filter out the connected areas that meet the set area size in the denoised image by multiplying by the set area ratio; at the same time, perform a blob detection on the denoised image to filter 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 obtain the center position coordinates of the optical pass unit area, and add the X coordinate of the center position coordinate to half of the optical pass unit length obtained in step 2 to obtain the first length value; subtract half of the optical pass unit length obtained in step 2 from the X coordinate of the center position coordinate to obtain to the second length value; the Y coordinate of the center position coordinate is added to 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 from 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 is located in the denoised image, 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 multiple qualified optical pass sheet unit areas is obtained, and then the areas where 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, light pass unit image extraction step: in the light pass unit group area obtained in step 4, the area where the single light pass unit is located is obtained one by one according to the index, and the minimum circumscribed rectangular area of the area where the light pass 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 light pass unit, that is, the preliminary identification area of the light pass unit is obtained; then, the light pass unit preliminary identification area is used to extract the light pass unit image part contained in the expanded image, that is, the light pass unit image extracted for the first time is obtained; the light pass unit image extracted for the first time is binarized to enhance the edge features, that is, the binary light pass unit image is obtained; the binary light pass unit image is subjected to connected area detection and area screening, that is, the area where the final light pass unit is located is obtained; then, the minimum circumscribed rectangle is created for the area where the final light pass unit is located, that is, the final light pass unit circumscribed rectangular area is obtained; then, the final light pass unit image is extracted from the light pass unit image extracted for the first time using the final light pass unit circumscribed rectangular area; 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 based on 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, 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.
[0007] Preferably, the size information acquisition step includes: converting the original light pass sheet image into a grayscale image and performing Gaussian blur processing, 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 Gaussian blurred grayscale image into absolute value images, and performing weighted fusion on the X-direction gradient map and the Y-direction gradient map of the Gaussian blurred grayscale image to generate a total gradient image, dividing the total gradient image into foreground and background, highlighting the edge area features of each light pass sheet unit in the Gaussian blurred grayscale image to obtain a Sobel image; then using an adaptive threshold method to binarize the Sobel image, dividing the Sobel image into edge areas and non-edge areas, and thereby obtaining an edge binary image; Perform a connected region 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. 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 unmarked, it will be marked as the same connected region; continue traversing each pixel of the image until all foreground pixels are assigned to the corresponding connected region; Finally, each pixel in the edge binary image contains a label of a connected region of a specific size. This label is used to identify each region and remove impurity regions smaller than the set area 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 polygonally approximated 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 obtained vertex coordinates of the convex quadrilateral outline 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:
[0008] 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, is a 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 outline of the convex quadrilateral is a qualified light pass sheet outline; 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 using the coordinates of the four vertices of the minimum circumscribed tilted rectangle:
[0009]
[0010]
[0011] Where, is the minimum circumscribed inclined rectangle length, is the minimum circumscribed tilted rectangle width, is the minimum circumscribed tilted rectangle rotation angle, is the minimum number of circumscribed tilted 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 minimum 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, which is 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 optical pass unit , the calculated minimum enclosing tilted rectangle width Corresponding width of optical pass unit , the calculated minimum circumscribed tilted rectangle rotation angle Corresponding to the rotation angle of the optical fiber unit , and perform subsequent edge chipping detection operations based on the identified length, width, and rotation angle information of the optical pass unit.
[0012] Preferably, the pre-processing step includes: expanding the original optical image by a first set number of pixels to obtain an expanded image; The expanded image is binarized and the Otsu algorithm is used to segment the expanded image so as to maximize the inter-class variance between the foreground and background of the expanded image. This method obtains a threshold value for dividing the expanded image into foreground and background, and finally obtains a binary expanded image.
[0013] Preferably, the opening operation includes: performing an opening operation on the binary expanded image to remove noise or holes in 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 noise on the boundaries; the expansion operation will cause the objects in the binary expanded image to grow again and restore them to their original shapes; 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. This step obtains a denoised image with noise or holes removed.
[0014] Preferably, the target area identification step includes extracting the area where each optical pass sheet unit is located in the expanded image, including the following steps: Connected region detection: Perform connected region detection on the denoised image to obtain multiple optical flow unit regions; Multiple pass sheet unit area selection: Calculate the qualified pass sheet unit area based on the calculated length and width of the pass sheet 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 optical pass unit, Represents the width of the optical pass unit; Removing the incomplete optical 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 filters out patches outside the set area size range; use the configured Blob detector to directly detect the denoised image to obtain The selected plaques are then obtained The center coordinates of each light channel unit; Removal of incomplete light channel unit areas on the edge areas 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 of the denoised image according to the following formula: like , then it is considered that the i-th light pass unit area is not on the edge area of the denoised image, where , represents the x-coordinate of the center of the i-th light channel unit, represents the y coordinate of the center of the i-th light channel unit, Represents the length of the optical pass 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 M represents the set number of pixels to be expanded; otherwise, the optical pass sheet unit area is considered to be on the edge area of the denoised image and is an incomplete optical pass sheet unit area. In actual detection, the incomplete optical pass sheet unit area on the edge area of the denoised image is removed, that is, an optical pass sheet unit group area consisting of multiple qualified optical pass sheet unit areas is obtained, and then the areas where individual optical pass sheet units are located are obtained one by one in the optical pass sheet unit group area according to the index.
[0015] Preferably, the target unit image extraction step includes: Obtain the area where each light pass unit is located one by one according to the index in the light pass unit group area, and create the minimum circumscribed rectangular area of the area where the light pass unit is located; Performing dilation processing on the minimum circumscribed rectangular area of the optical pass unit, expanding the circumscribed rectangular area of the optical pass unit to a set size in all directions, and obtaining a preliminary identification area of the optical pass unit; Performing a first extraction on the optical cell image, by traversing each pixel of the expanded image and removing pixels that exceed the initial identification area of the optical cell, thereby obtaining the first extracted optical cell image; performing a binarization operation on the optical pass sheet unit image extracted for the first time, adjusting the optical pass sheet unit in the optical pass sheet unit image extracted for the first time to white and adjusting the background to black, thereby obtaining a binarized optical pass sheet unit image; Connected region detection: Connected region detection is performed on the binary optical pass unit image. Each connected region is represented by a different grayscale value in the binary optical pass unit image, that is, multiple connected regions including a single optical pass unit region are obtained; Screening of the area of a single optical pass unit: the area of the qualified optical pass unit Multiplying by a set first area ratio, filtering out connected areas within a set area size range in the first extracted optical pass sheet unit image, that is, obtaining the final optical pass sheet unit area, and then converting the final optical pass sheet unit area into a final optical pass sheet unit circumscribed rectangular area; 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.
[0016] Preferably, the edge collapse detection step includes: Get the coordinate position of the centroid of the final rectangular area of the light pass unit: take the upper left corner of the rectangular area of the final light pass unit as the coordinate origin, set the pixel coordinates in the rectangular area of the final light pass unit 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: ; Where Σ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 channel 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 rectangular area of the light pass unit: Calculate the second-order covariance matrix of the final rectangular area of the light pass unit :
[0017] 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 rectangular area circumscribed by the final light-pass unit. It represents the direction of the width of the rectangular area circumscribed by 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:
[0018] 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:
[0019]
[0020] Where, Represents the length of the optical pass unit, Represents the width of the optical pass unit, It means half of the number of measurement rectangles drawn in the length direction of the circumscribed rectangular area of the final optical pass unit. Indicates half of the number of measurement rectangles drawn in the width direction of the circumscribed rectangular area of the final optical pass unit. , Take the remainder of the calculation result.
[0021] Preferably, 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 using the following method. Set the coordinate point: ( , ):
[0022]
[0023] The other target pixel point is the second target pixel point, which is obtained by the following method. Let the coordinate point ( , ):
[0024]
[0025] in, Indicates the row coordinate of the first target pixel, Indicates 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. Indicates the y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit, Indicates 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:
[0026] in Represents the line index value of the measurement line in the length direction of the rectangular area circumscribed by 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, in order to set the minimum chipping width within the tolerance range For width, Draw the first measurement rectangle to create the first measurement handle for the rotation angle; at the same time, take the second target pixel point ( , ) as the center, For the length, For width, For the rotation angle, draw a second measurement rectangle and create a second measurement handle.
[0027] 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 ( , ) perpendicular to the relative edge area of this image, and calculate the total length of the white area in the length distance direction between the edges , calculate the unit length The total length of the white area in the distance direction from the detected edge The difference :
[0028] like: , it is considered that the optical pass unit has edge collapse, where is the minimum chipping length within the tolerance range; Traverse the entire final optical pass unit image according to the above steps to obtain the final edge collapse result; The defect size range is ≤Result<Set minimum value is set as a small defect; The defect size range of the set minimum value ≤ Result < set median value is set as medium defect; The defect size range is set as a large defect if it is within the set median value ≤ Result < the set maximum value; 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 value and the number of large defects is 0, the edge chipping level is set to low; If the number of small defects and medium defects exceeds the set value and the number of large defects is 0, the chipping level is set to medium; If there are large defects, set the chipping level to high.
[0029] The present invention has the following advantages over the prior art: 1. High detection accuracy: By using a high-resolution camera to capture tiny changes in the edge of the optical wafer and combining it with an image processing algorithm, the present invention can accurately identify edge collapse defects and their severity.
[0030] 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.
[0031] 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.
[0032] 4. This invention uses image acquisition equipment to capture raw optical wafer images. This invention can automatically identify optical wafer unit chipping defects and their severity. This invention can not only be quickly executed on the production line, but also provide highly accurate results, virtually eliminating human error. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flow chart of edge collapse detection of the present invention; Figure 2 Examples of optical pass images for testing in the present invention; Figure 3 The edge binarization image after the Sobel operator binarization process is performed in the present invention; Figure 4 This is a schematic diagram of the principle of determining whether a convex quadrilateral is a rectangle according to the present invention; Figure 5 The present invention obtains the minimum circumscribed tilted rectangle vertex coordinate image; Figure 6 The schematic diagram of the calculation of the unit size and angle of the qualified optical pass sheet of the present invention; Figure 7 The image of the optical channel after pixel expansion of the present invention; Figure 8 A light channel image for which the present invention performs an opening operation to remove noise; Figure 9 The image of the optical transmission unit area after the connected area screening is performed in the present invention; Figure 10 An image of the center coordinates of the optical pass sheet unit is obtained after performing Blob detection in the present invention; Figure 11The present invention uses Blob detection to remove the incomplete light-pass unit area on the image boundary; Figure 12 The image of the optical pass sheet unit group area obtained by the present invention; Figure 13 The image of the optical pass sheet unit after the first extraction of the present invention; Figure 14 The image is obtained by binarizing the light flux sheet after the first extraction according to the present invention; Figure 15 The image of the optical pass sheet unit after the second extraction of the present invention; Figure 16 The schematic diagram of the method for obtaining the center coordinates of the measurement rectangle of the present invention; Figure 17 Draw a schematic diagram of the measurement rectangle for the present invention; Figure 18 This is a schematic diagram of the principle of drawing a measurement rectangle for the optical pass unit according to the present invention. DETAILED DESCRIPTION
[0034] The present invention will be described in further detail below with reference to the embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0035] A method for detecting edge chipping defects of a light-transmitting wafer comprises the following steps: Step 1: Acquiring the original optical channel image: First, an image acquisition device is used to acquire the original optical channel image, which contains multiple optical channel unit images. The key to this step is to ensure a high-quality original optical channel image so that subsequent processing can accurately analyze the optical channel characteristics.
[0036] Step 2: Size information acquisition step: Convert the original light channel 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 channel unit to obtain an edge binary image. Then, a connected area detection is performed on the edge binary image to remove the impurity area with an area 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. 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 with a shape close to a rectangle is screened out, and the minimum circumscribed tilted rectangle of the screened convex quadrilateral contour is obtained by the MinAreaRect operator in Opencv, and the four vertex coordinates of the minimum circumscribed tilted rectangle are obtained. 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.
[0037] Step 3: Preprocessing: The original optical image obtained in Step 1 is preprocessed. First, to make the original optical image clearer and reduce errors, the original optical image is expanded by 100 pixels (this can be adjusted flexibly according to actual needs, such as 60 pixels, 71 pixels, 112 pixels, or 120 pixels) to obtain an expanded image. The expanded image is then converted to a binary expanded image, dividing the pixels into foreground pixels and background pixels. Next, an opening operation (OpenCV's built-in algorithm) is performed to reduce noise in the binary expanded image to ensure the accuracy of the detection process and obtain a denoised image.
[0038] Step 4: Identification of optical fiber unit area: Perform connected area detection on the denoised image obtained in step 3; then calculate the area of the qualified optical fiber unit area based on the length and width information of the optical fiber unit calculated in step 2, and filter out 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 fiber unit area; at the same time, perform a blob detection on the denoised image, filter out all blob detection areas in the denoised image that are close to the area size of the qualified optical fiber unit area, and then obtain the center position coordinates of the optical fiber unit area, combined with the length and width information of the optical fiber unit obtained in step 2 (i.e., length The incomplete optical pass sheet unit area on the edge area of the denoised image can be removed. Specifically, half of the length of the optical pass sheet unit obtained in step 2 is added and subtracted according to the X coordinate of the center position, and half of the width of the optical pass sheet unit obtained in step 2 is added and subtracted according to the Y coordinate of the center position, and it is determined whether the obtained values exceed the area where the original optical pass sheet image in the denoised image is located. If the values exceed 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, a light pass sheet unit group area consisting of multiple qualified light pass sheet unit areas that are not on the image boundary can be obtained, and then the areas where individual light pass sheet units are located can be obtained one by one in the light pass sheet unit group area according to the index.
[0039] Step 5: Extraction of optical sheet unit image: in the optical sheet unit group area obtained in step 4, the area where the single optical 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 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 sheet unit, that is, the preliminary identification area of the optical sheet unit is obtained; then the preliminary identification area of the optical sheet unit is used to extract the optical sheet unit image part contained in the expanded image, that is, the optical sheet unit image extracted for the first time is obtained; the optical sheet unit image extracted for the first time is binarized to enhance the edge features, that is, the binary optical sheet unit image is obtained; the binary optical sheet unit image is detected for connected areas and screened for area, and the area where the final optical sheet unit is located is obtained; then, the minimum circumscribed rectangle is created for the area where the final optical sheet unit is located, and the final optical sheet unit circumscribed rectangular area is obtained; then, the final optical sheet unit circumscribed rectangular area is used to extract the final optical sheet unit image from the optical sheet unit image extracted for the first time.
[0040] 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 white area on the opposite side 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 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 unit image.
[0041] Specific: such as Figure 1 As shown in the optical wafer edge chipping defect detection method, in the original optical wafer image acquisition step 1, the image acquisition device is a detection device equipped with a high-resolution lens, which can clearly capture the original optical wafer image under high-speed operation, such as Figure 2 As shown, the entire optical pass sheet includes a plurality of optical pass sheet units; The size information acquisition step, step 2, pre-processes 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: 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 Gaussian blurred grayscale image into absolute value images respectively. Then, perform weighted fusion on the X-direction gradient map and Y-direction gradient map of the Gaussian blurred grayscale image to generate a total gradient image. The total gradient image can be divided into foreground and background, and the edge area features of each optical filter unit in the Gaussian blurred grayscale image are highlighted to obtain a Sobel image. Then, use the adaptive threshold method to binarize the Sobel image and divide the Sobel image into edge areas and non-edge areas to obtain an edge binary image, such as Figure 3 shown.
[0042] 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 as follows: traverse the image pixels from the upper left corner to the lower right corner of the edge binary image, and when an unlabeled foreground pixel is encountered, 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 unlabeled, it will be marked as the same connected region; continue traversing each pixel of the image until all foreground pixels are assigned to the corresponding connected region; Ultimately, each pixel in the edge binary image contains a label of a connected region of a specific size. This label is used to identify different regions, thereby removing impurity regions smaller than the set area in the edge binary image.
[0043] Step 2.3: Obtain an edge contour in the edge binary image according to an edge search algorithm, then perform polygonal approximation on the edge contour in the edge binary image to obtain an approximated contour; then select a convex quadrilateral contour from the approximated contour to obtain the coordinates of the four vertices of the convex quadrilateral contour; Calculate the cosine of the angle between the vertices of the convex quadrilateral contour by calculating 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 obtained vertex coordinates of the convex quadrilateral contour 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:
[0044] 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, is a 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 outline of the convex quadrilateral is a qualified light pass sheet outline; Step 2.4 creates the minimum circumscribed tilted rectangle of the qualified light pass outline, such as Figure 5As shown, the coordinates of the four vertices of the minimum circumscribed tilted rectangle are obtained. The following formula is used to calculate the length, width, and rotation angle of the minimum circumscribed tilted rectangle (i.e., the length, width, and rotation angle of the optical pass unit) using the coordinates of the four vertices of the minimum circumscribed tilted rectangle:
[0045]
[0046]
[0047] Where, is the minimum circumscribed inclined rectangle length, is the minimum circumscribed tilted rectangle width, is the minimum circumscribed tilted rectangle rotation angle, is the minimum number of circumscribed tilted 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 minimum 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, which is 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 optical pass unit , the calculated minimum enclosing tilted rectangle width Corresponding width of optical pass unit , the calculated minimum circumscribed tilted rectangle rotation angle Corresponding to the rotation angle of the optical fiber unit ,like Figure 6 As shown, For the The coordinates of the first point of the smallest circumscribed tilted rectangle, that is, the upper left corner, 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 tilted rectangle, i.e., the lower right corner coordinate, is used to perform subsequent edge chipping detection operations based on the length, width, and rotation angle information of the identified optical pass unit.
[0048] The preprocessing step (i.e., image preprocessing) includes the following sub-steps: Step 3.1 Figure 7 As shown, in order to make the boundary of the captured original optical flow sheet image clearer and meet the requirements of the connected area detection required later, the original optical flow sheet image obtained in step 1 is expanded to the surrounding area by a first set number of pixels, such as 100 pixels (the number of pixels can also be expanded to 60, 70, 75, 82, 90, 105, 112, etc., which can be selected according to actual needs), and finally an expanded image is obtained.
[0049] In step 3.2, the expanded image is binarized. Because defects in the optical film may cause some areas to be dark and unclear, the Otsu's method is used to segment the expanded image. The inter-class variance between the foreground and background of the expanded image is maximized, thereby obtaining the optimal threshold for dividing the expanded image into foreground and background. This threshold can be used to divide the expanded image into the foreground and background, and finally obtain a binary expanded image.
[0050] Step 3.3 Figure 8 As shown, an opening operation is performed on the binary expanded image to remove noise or holes in the expanded image. The process includes the following steps: first, an erosion operation, followed by a dilation operation. The erosion operation shrinks the objects in the expanded image and removes noise at their boundaries. The dilation operation re-grows the objects in the expanded image and restores them to their original shape. The combination of these two operations eliminates noise while maintaining the overall shape of the objects in the expanded image. This step results in a denoised image with no noise or holes removed.
[0051] Step 4 of optical fiber unit area identification requires identifying the area where each optical fiber unit is located in the expanded image, which mainly includes the following sub-steps: Step 4.1 performs connected region detection: performs connected region detection on the denoised image to obtain multiple optical flow unit regions.
[0052] Step 4.2 Figure 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 the set area ratio, the denoised image that meets the conditions is filtered out ( ), that is, select the area of the set size close to the area of the qualified optical pass unit, where Represents the length of the optical pass unit, Represents the width of the optical pass unit.
[0053] Step 4.3 Figure 10 As shown, Blob detection is used to obtain the coordinate information of the light channel unit: the Blob detector sets the detection pattern so that the Blob detector only detects quadrilateral patches; the Blob detector sets the detection area so that the Blob detector excludes patches that are not within the set area size range ( ) within the patch; 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.
[0054] Step 4.4 Figure 11 As shown, the removal of incomplete light channel unit areas on the edge areas of the denoised image is achieved by 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 in the edge area of the denoised image according to the following formula: like , then it is considered that the i-th light channel unit area is not in the edge area of the denoised image, where , represents the x-coordinate of the center of the i-th light channel unit, represents the y coordinate of the center of the i-th light channel unit, Represents the length of the optical pass 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, the optical pass sheet unit area is considered to be at the edge area of the denoised image, and in actual detection, the incomplete optical pass sheet unit area at the edge area of the denoised image will be removed.
[0055] Finally, if Figure 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 individual light pass sheet units are located can be obtained one by one in the light pass sheet unit group area according to the index.
[0056] The optical fiber unit image extraction step 5 can obtain individual optical fiber unit images one by one according to the index value. The detection mainly includes the following sub-steps: 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.
[0057] 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.
[0058] Step 5.3 Figure 13 As shown, the first extraction of the optical sheet unit image is performed by traversing each pixel of the expanded image and removing pixels that exceed the initial identification area of the optical sheet unit to obtain the first extracted optical sheet unit image.
[0059] Step 5.4 Figure 14 As shown, a binarization operation is performed on the optical pass sheet unit image extracted for the first time, so that the optical pass sheet units in the optical pass sheet unit image extracted for the first time are adjusted to white and the background is adjusted to black, thereby obtaining a binarized optical pass sheet unit image. Step 5.5 performs connected region detection: performs connected region detection 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.
[0060] Step 5.6: Screen the area of a single optical pass unit: Multiply by the set first area ratio (the first area ratio range is selectable ), the connected areas within the set area size range in the first extracted optical pass sheet unit image are screened out, that is, the area where the final optical pass sheet unit is located is obtained, and then the area where the final optical pass sheet unit is located is converted into the circumscribed rectangular area of the final optical pass sheet unit.
[0061] Step 5.7 Figure 15 As shown, the second extraction of the light pass unit image is performed: 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.
[0062] The edge chipping detection step 6 performs edge chipping detection on the final optical pass sheet unit image obtained in step 5. The detection mainly includes the following sub-steps: Step 6.1 Obtain the coordinate position of the center of mass of the circumscribed rectangular area of the final light pass unit: Take the upper left corner of the circumscribed rectangular area of the final light pass unit as the coordinate origin, set the pixel coordinates within the circumscribed rectangular area of the final light pass unit to (x, y), and the total number of pixels to N.
[0063] 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 channel 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.
[0064] Step 6.2 Obtain the rotation angle between the circumscribed rectangular area of the final optical pass unit and the positive direction of the X axis: Calculate the second-order covariance matrix of the circumscribed rectangular area of the final optical pass unit :
[0065] in, , which represents the discrete degree of the i-th pixel in the x direction.
[0066] , which represents the discrete degree of the i-th pixel in the y direction.
[0067] , represents the covariance of the i-th pixel in the x and y directions.
[0068] 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 rectangular area circumscribed by the final light-pass unit. It represents the direction of the width of the rectangular area circumscribed by 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, the larger eigenvalue is selected The corresponding eigenvector calculates the angle:
[0069] 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 ; 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:
[0070]
[0071] Where, Represents the length of the optical pass unit, Represents the width of the optical pass unit, It means half of the number of measurement rectangles drawn in the length direction of the circumscribed rectangular area of the final optical pass unit. Indicates half of the number of measurement rectangles drawn in the width direction of the circumscribed rectangular area of the final optical pass unit. , The calculation result is rounded down to an integer.
[0072] Take drawing a long axis measurement rectangle as an example to illustrate. Figure 16 As shown, the centroid coordinates of the rectangular area circumscribed by the final optical 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. Let the coordinate point ( , ):
[0073]
[0074] The other target pixel point is the second target pixel point, which is obtained by the following method. Let the coordinate point ( , ):
[0075]
[0076] in, Indicates the row coordinates of the target pixel, Represents the column coordinates of the target pixel point, 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. Indicates the y coordinate of the centroid of the circumscribed rectangular area of the final light pass unit, Indicates 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:
[0077] in , represents the line index value of the measurement line in the length direction of the rectangular area circumscribed by the final light pass unit; Then, if Figure 17 As shown, the first target pixel ( , ) as the center, is long, in order to set the minimum chipping width within the tolerance range For width, Draw the first measurement rectangle to create the first measurement handle for the rotation angle; at the same time, take the second target pixel point ( , ) as the center, For the length, For width, For the rotation angle, draw a second measurement rectangle and create a second measurement handle.
[0078] Step 6.4 performs the edge chipping measurement operation, such as Figure 18 As shown, using 20.11 library Operator, detect the final optical pass 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 ( , ) perpendicular to the relative edge area of this image, and calculate the total length of the white area in the long distance direction between the edges , calculate the unit length The total length of the white area in the long distance direction from the detected edge The difference :
[0079] like: , it is considered that the optical pass unit has edge collapse, where The minimum chipping length within the tolerance range; Step 6.5: traverse the entire final optical fiber unit image according to step 6.4 to obtain the edge chipping detection result of the optical fiber unit; The defect size range is ≤Result<the set minimum value 0.2mm is set as a small defect; The defect size range of the set minimum value ≤ Result < set median value 0.4mm is set as a medium defect; The defect size range of the set median value ≤ Result < set maximum value 0.5mm is defined 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 is less than 10, the number of medium defects is less than 4, and the number of large defects is 0, the edge chipping defect level of the optical pass unit is set to low; 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 chipping defect level of the optical fiber unit is set to medium; If there is a large defect, the edge chipping defect level of the optical pass unit is set to high.
[0080] Specifically, the results are stored in three arrays of edge chipping defects according to different range sizes. These three arrays represent edge chipping defects within different ranges. Assume that the three arrays are Array1 (first array), Array2 (second array), and Array3 (third array). The length of each array is recorded to determine the number of edge chipping defects in different areas. When recording the edge chipping of each optical element, these three arrays can be used to represent the distribution of edge chipping defects in different areas. For example, for small defects, the number of defects in Array1 is counted; for medium defects, the number of defects in Array2 is counted; for large defects, the number of defects in Array3 is counted.
[0081] Repeat step 6 to traverse each optical fiber unit image obtained in step 5. If the optical fiber unit has a chipping defect, record the center coordinates of the optical fiber unit and the corresponding chipping level (i.e., record the center coordinates of the optical fiber unit with the chipping defect and the chipping level). To verify the effectiveness of the aforementioned chipped-edge defect detection method for optical fiber wafers, four samples were randomly selected, including 2184 small optical fiber wafers and 394 chipped optical fiber wafers. Using the aforementioned algorithm, the defective number, defect rate, accuracy, and detection time of the optical fiber wafers after chipping detection were calculated. The statistical results are shown in Table 1.
[0082] Table 1
[0083] As shown in Table 1, the proposed detection algorithm achieved a defect rate of 17.31% for edge chipping detection of optical wafers, an accuracy rate of 95.93%, and a false positive rate of 1.32%. This error occurred when non-edge chipping was mistakenly identified as edge chipping. Inspection and analysis revealed that some samples experienced slight vibration during transmission, resulting in image distortion. These distortions were either prematurely removed by the detection system or falsely detected as edge chipping. Furthermore, the system's detection and recognition time was approximately 27 seconds, significantly reducing detection speed and meeting real-time requirements.
[0084] The above embodiments are only for understanding 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.
Citation Information
Patent Citations
Method of manufacturing optical display unit and manufacturing system of optical display unit
CN101925944A
Mobile phone glass cover plate window area defect detection method based on symmetry
CN114881915A
Method and device for automatically drawing structural cracks and precisely measuring widths thereof
US20200364849A1
Computer vision-based mobile terminal application control identification method
WO2022252239A1
