Defect identification method and device based on VR screen, equipment and storage medium

By binarizing and frame difference processing the original test image of the VR screen, combined with the clustering algorithm and boundary rectangle processing, the problem of false detection and missed detection of VR screen defects in the existing technology is solved, and more accurate edges are achieved. Identification of edge chipping defects improves detection efficiency and product consistency.

CN118537288APending Publication Date: 2024-08-23GOERTEK OPTICAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410370583.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing VR screen defect identification methods rely on human eye detection or machine vision software, which has a high rate of false detection and missed detection, and it is difficult for machine vision to accurately identify lens edge chipping defects.

Method used

By obtaining the original test image and performing binarization processing, the preset qualified template is used for frame difference processing to determine the outline of the suspected defect, and the edge chipping defect is accurately identified through clustering algorithm and boundary rectangle processing.

Benefits of technology

It improves the accuracy of VR screen defect identification, reduces false detection and missed detection, can more accurately identify lens edge chipping defects, and enhances production line inspection efficiency and product consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537288A
    Figure CN118537288A
Patent Text Reader

Abstract

The invention relates to the technical field of VR, in particular to a defect recognition method and device based on a VR screen, equipment and a storage medium, and the method comprises the steps: obtaining a test original image of a to-be-tested VR screen, and carrying out the binarization conversion of the test original image into a test binary image; determining a mapping binary image according to a preset qualified template and the test binary image, and performing frame difference processing on the test binary image and the mapping binary image to obtain a frame difference binary image; and determining a suspected defect contour of the test original image according to the frame difference binary image, and carrying out edge breakage defect identification according to the suspected defect contour. According to the invention, the accuracy of VR screen defect identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of VR (Virtual Reality) technology, and in particular to a defect identification method, device, equipment and storage medium based on a VR screen. Background Art

[0002] With the rapid development of VR (Virtual Reality) technology, many VR products have been developed and put into the market. In order to ensure that VR products can be widely used and provide a good user experience, the VR screen must be able to achieve a good resolution and must not have bad pixels or dirt. Therefore, users have put forward higher requirements for the identification of lens edge defects based on VR screens.

[0003] At present, most of the defect recognition methods for VR screens rely on human eye detection or machine vision software recognition. However, the above-mentioned VR screen defect recognition methods all have certain defects. On the one hand, the identification of lens edge collapse defects on VR screens through human eye detection not only poses a threat to employees' eyesight, but also has the problem of high false detection and missed detection rates; on the other hand, due to the small area of ​​lens edge collapse and the phenomenon of adhesion with the background, it is difficult for machine vision software to accurately identify lens edge collapse defects.

[0004] In summary, how to improve the accuracy of VR screen defect recognition is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a defect recognition method, device, equipment and storage medium based on VR screen, aiming to improve the accuracy of VR screen defect recognition.

[0006] To achieve the above objectives, the present application provides a defect recognition method based on a VR screen, and the defect recognition method based on a VR screen includes: Acquire a test original image of the VR screen to be tested, and convert the test original image into a test binary image by binarization; Determine a mapping binary image according to a preset qualified template and the test binary image, and perform frame difference processing on the test binary image and the mapping binary image to obtain a frame difference binary image; The suspected defect contour of the test original image is determined according to the frame difference binary image, and the edge collapse defect is identified according to the suspected defect contour.

[0007] Optionally, the step of determining the suspected defect contour of the test original image according to the frame difference binary image includes: Determine a plurality of foreground pixel points of the frame difference binary image, and perform clustering processing on each of the foreground pixel points according to a preset clustering algorithm to obtain cluster partitions; Boundary rectangle processing is performed according to the cluster partitioning to obtain a boundary rectangle area, and the boundary rectangle area is mapped to the contour shape area of ​​the test original image as the suspected defect contour of the test original image.

[0008] Optionally, the step of performing clustering processing on each of the foreground pixels according to a preset clustering algorithm to obtain cluster partitions includes: Determine a plurality of cluster centroid points specified by the clustering algorithm, and after sorting the Euclidean distances from each foreground pixel point to different cluster centroid points in ascending order, divide each foreground pixel point and the cluster centroid point with the closest distance into a group to obtain different cluster intervals; Detecting whether the pixel means between the foreground pixels in each clustering interval are consistent with the centroid value of the cluster centroid point in the same clustering interval; If not, the cluster centroid point is updated according to the pixel mean, and the step of sorting the Euclidean distances of each foreground pixel point to different cluster centroid points in ascending order is returned according to the updated cluster centroid point; Each clustering interval is used as a cluster partition until the pixel mean values ​​between the foreground pixels in each clustering interval are consistent with the centroid value of the cluster centroid point in the same clustering interval.

[0009] Optionally, the step of performing boundary rectangle processing according to the cluster partitioning to obtain a boundary rectangle area includes: According to a preset rectangular boundary function, a rectangular construction is performed on the foreground pixel point with the maximum coordinate and the foreground pixel point with the minimum coordinate in the cluster partition to obtain a rectangular outline; Determine the defect center position coordinates of the rectangular outline, and update the defect center position coordinates according to a preset X-axis threshold and a Y-axis threshold to obtain an updated width and an updated height of the rectangular outline; A boundary rectangular area is obtained according to the product of the update width and the update height.

[0010] Optionally, the step of identifying edge collapse defects according to the suspected defect contour includes: Binarizing the suspected defect contour into a contour binary image, and performing contour detection on the suspected defect contour according to a preset contour search algorithm to obtain a contour list; Traversing the contour areas corresponding to the contour boundaries of the contour list to obtain a target contour, wherein the target contour refers to a contour with the largest contour boundary area; In the contour binary image, each pixel in the target contour is filled with a white RGB value, and each pixel other than the target contour is filled with a black RGB value, to obtain a binary image to be tested; The pixel coordinates of each white pixel in the binary image to be tested on the original test image are determined, and edge collapse defects are identified based on the edge distance from each pixel coordinate to the mapped binary image.

[0011] Optionally, the step of identifying edge collapse defects based on the edge distance from each pixel coordinate point to the mapped binary image includes: After determining the edge distance from each pixel coordinate point to the mapped binary image, obtaining the distance mean between each edge distance; Performing variance processing according to the distance mean and any one of the edge distances to obtain an actual variance value corresponding to the binary image to be tested, and determining whether the actual variance value is greater than a preset variance threshold; If the actual variance value is less than or equal to the preset variance threshold, it is determined that the VR screen to be tested is a qualified product; If the actual variance value is greater than a preset variance threshold, it is determined that the VR screen to be tested is a defective product with chipped edges.

[0012] Optionally, the step of determining a mapped binary image based on a preset qualified template and the test binary image comprises: Determine a qualified VR screen with the same specifications as the VR screen to be tested, and create a template for the sample image of the qualified VR screen according to a preset given contour shape function to obtain a preset qualified template; The qualified template is template matched with the test binary image according to a preset template matching function to obtain a matching contour area between the test binary image and the qualified template, and the matching contour area is mapped to the test original image to obtain a mapped binary image.

[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a defect recognition device based on a VR screen, and the defect recognition device based on a VR screen of the present application includes: An acquisition module is used to acquire a test original image of the VR screen to be tested, and convert the test original image into a test binary image through binarization; A processing module, used for determining a mapping binary image according to a preset qualified template and the test binary image, and performing frame difference processing on the test binary image and the mapping binary image to obtain a frame difference binary image; The recognition module is used to determine the suspected defect contour of the test original image according to the frame difference binary image, and to perform edge collapse defect recognition according to the suspected defect contour.

[0014] The various functional modules of the defect recognition device based on VR screen of the present application implement the steps of the defect recognition method based on VR screen of the present application as described above during operation.

[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a VR screen-based defect recognition device, which includes a memory, a processor, and a VR screen-based defect recognition program stored in the memory and executable on the processor, and the VR screen-based defect recognition program implements the steps of the above-mentioned VR screen-based defect recognition method when executed by the processor.

[0016] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a VR screen-based defect recognition program is stored on the computer-readable storage medium. When the VR screen-based defect recognition program is executed by the processor, the steps of the above-mentioned VR screen-based defect recognition method are implemented.

[0017] The present application provides a defect recognition method based on a VR screen to optimize the existing VR screen defect recognition method. Specifically, the present application can timely obtain the test original image of the VR screen to be tested, and then binarize the test original image into a test binary image, which not only simplifies the complexity of subsequent processing, but also effectively removes the influence of image noise that may be contained in the test original image on the recognition of edge collapse defects, making the recognition of edge collapse defects more accurate and reliable; next, based on the preset qualified template and the test binary image, the mapped binary image of the VR screen to be tested in an ideal state can be accurately obtained, and the test binary image and the mapped binary image are subjected to frame difference processing to obtain a frame difference binary image, thereby effectively highlighting the difference between the test original image and the qualified template, so that the suspected defect contour of the test original image can be accurately located based on the frame difference binary image, thereby avoiding the false detection and missed detection caused by manual identification of lens edge collapse; finally, targeted edge collapse defect identification is performed based on the suspected defect contour, so that the lens edge collapse defect can be identified more accurately, avoiding the phenomenon that the existing machine vision software is difficult to distinguish lens edge collapse, thereby effectively improving the accuracy of VR screen defect identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of the first embodiment of the defect recognition method based on VR screen of the present application; Figure 2is the original test image involved in the embodiment of the present application; Figure 3 is a test binary image involved in the embodiment of the present application; Figure 4 It is the original template image involved in the embodiment of the present application; Figure 5 is a template binary image involved in the embodiment of the present application; Figure 6 The mapped binary image involved in the embodiment of the present application; Figure 7 It is the suspected defect profile involved in the embodiment of the present application; Figure 8 The binary image to be tested involved in the embodiment of the present application; Fig. 9 It is the arc-shaped area involved in the embodiment of the present application; Fig.10 It is a structural schematic diagram of a defect recognition device based on a VR screen involved in an embodiment of the present application; Fig.11 This is a schematic diagram of the structure of a defect identification device based on a VR screen involved in an embodiment of the present application.

[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0020] The present application embodiment provides a defect recognition method based on a VR screen, referring to Figure 1 As shown, Figure 1 It is a flow chart of the first embodiment of the defect recognition method based on VR screen of the present application.

[0021] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0022] With the booming development of the VR market, the quality of VR products and user experience have become the key to competition. As the core component of VR products, the quality of VR screens directly determines the user's visual experience. At this stage, for the assembled VR all-in-one machine, first control the VR module to output picture cards of different colors, and then the human eye uses the lens to check whether there are defects under different picture cards. The defects are manifested as dark spots on the green screen, bright spots on the green screen, bright spots on the red screen, dark spots on the red screen, bright spots on the black screen, dark spots on the white screen, scratches, edge overflow, transparent defects or defects on the lens. It is worth mentioning that although the surface defects of the lens can be well distinguished by machine vision software at this stage, for the defects of edge collapse, due to the small area of ​​the defect and the characteristics of adhesion with the background, it is difficult for machine vision software to accurately identify the edge collapse defects of the lens.

[0023] In order to solve the technical problem that the above-mentioned prior art is difficult to accurately identify lens edge collapse defects, the present application provides a defect identification method, device, equipment and storage medium based on a VR screen.

[0024] The defect recognition method based on VR screen of the present application is executed by a terminal device that performs Fresnel pattern detection on VR module, and specifically, the control center in the terminal device executes the following defect recognition method based on VR screen. The execution subject of the present application will not be described in detail in the following embodiments.

[0025] The defect recognition method based on VR screen in this application includes: Step S10: obtaining a test original image of the VR screen to be tested, and converting the test original image into a test binary image through binarization.

[0026] In this embodiment, the image output by the VR screen to be tested is photographed or recorded by an image acquisition device, and the following images can be acquired: Figure 2 The original test image shown in FIG. 1 is then binarized using the adaptive binarization method to obtain the following Figure 3 The test binary image shown not only simplifies the complexity of subsequent processing, but also effectively removes the influence of image noise that may be contained in the original test image on the recognition of edge chipping defects, making the recognition of edge chipping defects more accurate and reliable.

[0027] It should be noted that the image acquisition device includes but is not limited to a camera or a webcam. The image acquisition device can be integrated in a VR all-in-one machine equipped with the VR screen to be tested, or can be externally installed outside the VR all-in-one machine equipped with the VR screen to be tested. The VR screen to be tested can be understood as a VR screen that has not undergone defect identification, and the VR screen includes but is not limited to an OLED (Organic Light-Emitting Diode) screen. Image noise refers to unnecessary or redundant interference information in the original test image, such as uneven lighting and sensor noise.

[0028] In addition, it should be noted that the adaptive binarization method can be understood as a process of converting the pixel value of each pixel in the test original image into two extreme values ​​(usually 0 and 255, i.e., black pixel value and white pixel value). Exemplarily, in the adaptive binarization process, the test original image is divided into many small local areas according to a preset ratio, and each local area calculates a local threshold value based on the statistical information of its pixel value (such as the average value or median value). Then, the pixel value of each pixel in the same local area is compared with the corresponding local threshold value. If the pixel value of a pixel is greater than the local threshold value, the pixel value of the pixel is set to a white pixel value, otherwise it is set to a black pixel value, thereby reducing the impact of noise on image quality to a certain extent, which makes the test binary image obtained by the adaptive binarization method clearer and smoother, and improves the image quality.

[0029] Step S20: determining a mapped binary image according to a preset qualified template and the test binary image, and performing frame difference processing on the test binary image and the mapped binary image to obtain a frame difference binary image.

[0030] In this embodiment, the mapped binary image of the VR screen to be tested in an ideal state can be accurately obtained based on the preset qualified template and the test binary image, and frame difference processing is performed on the test binary image and the mapped binary image, which can effectively highlight the difference between the test original image and the qualified template, and provide accurate and reliable frame difference binary images for subsequent defect identification processing.

[0031] It should be noted that the preset qualified template is constructed based on the sample image of the qualified VR screen. Among them, the qualified VR screen refers to the VR screen with the same specifications as the VR screen to be tested and without defects; the sample image can be understood as the image output by the qualified VR screen acquired by the image acquisition device, also known as the template original image. The template original image is as follows: Figure 4 As shown, Figure 4 It is the template original image involved in the embodiment of the present application, and the width and height of the template original image may be inconsistent with the width and height of the test original image.

[0032] In a specific embodiment, the template original image is binarized according to the above-mentioned adaptive binarization method to obtain the following Figure 5 After the template binary image shown in the figure is taken, the template original image is template created according to the preset given contour shape function, and the preset qualified template can be quickly and accurately obtained, which effectively improves the efficiency and accuracy of template creation; next, the qualified template is template matched with the test binary image according to the preset template matching function to obtain the matching contour area of ​​the test binary image and the qualified template, and the matching contour area is mapped to the test original image, which can accurately obtain the following Figure 6 The mapped binary image shown intuitively displays the area in the test original image that matches the qualified template, providing strong support for subsequent defect recognition processing.

[0033] Step S30: determining the suspected defect contour of the test original image according to the frame difference binary image, and performing edge collapse defect recognition according to the suspected defect contour.

[0034] In this embodiment, due to the instability of the edge of the VR screen lens to be tested, when template matching is performed according to the preset template matching function, the edge part is easily misjudged as edge collapse, so the obtained frame difference binary image will retain edge information, that is, based on the frame difference binary image, the suspected defect contour of the test original image can be accurately located, thereby avoiding false detection and missed detection caused by manual identification of lens edge collapse; finally, targeted edge collapse defect identification is performed based on the suspected defect contour, so that the lens edge collapse defect can be identified more accurately, avoiding the phenomenon that the existing machine vision software is difficult to distinguish lens edge collapse, thereby effectively improving the accuracy of VR screen defect identification.

[0035] In summary, the present application provides a defect recognition method based on a VR screen to optimize the existing VR screen defect recognition method. Specifically, the present application can timely obtain the test original image of the VR screen to be tested, and then binarize the test original image into a test binary image, which not only simplifies the complexity of subsequent processing, but also effectively removes the influence of image noise that may be contained in the test original image on the recognition of edge collapse defects, making the recognition of edge collapse defects more accurate and reliable; next, based on the preset qualified template and the test binary image, the mapped binary image of the VR screen to be tested in an ideal state can be accurately obtained, and the test binary image and the mapped binary image are subjected to frame difference processing to obtain a frame difference binary image, thereby effectively highlighting the difference between the test original image and the qualified template, so that the suspected defect contour of the test original image can be accurately located based on the frame difference binary image, thereby avoiding the false detection and missed detection caused by manual identification of lens edge collapse; finally, targeted edge collapse defect identification is performed based on the suspected defect contour, so that the lens edge collapse defect can be identified more accurately, avoiding the phenomenon that the existing machine vision software is difficult to distinguish lens edge collapse, thereby effectively improving the accuracy of VR screen defect identification.

[0036] Furthermore, based on the first embodiment of the defect recognition method based on a VR screen of the present application, a second embodiment of the defect recognition method based on a VR screen of the present application is proposed.

[0037] Furthermore, in some feasible embodiments, the above step S30: determining the suspected defect contour of the test original image according to the frame difference binary image, further includes the following implementation steps: Step S301: determining a plurality of foreground pixels of the frame difference binary image, and performing clustering processing on each of the foreground pixels according to a preset clustering algorithm to obtain cluster partitions; In this embodiment, each pixel point whose pixel value exceeds a preset background pixel threshold is traversed from the frame difference binary image, and these pixel points are used as multiple foreground pixel points of the frame difference binary image; then, each foreground pixel point can be automatically divided into different cluster partitions according to its characteristics (such as color, brightness, texture, etc.) through a preset clustering algorithm, so that different areas or categories in the frame difference binary image can be segmented more accurately, providing a basis for subsequent analysis and processing.

[0038] Step S302: performing boundary rectangle processing according to the cluster partitioning to obtain a boundary rectangle area, and mapping the boundary rectangle area to the contour shape area of ​​the test original image as the suspected defect contour of the test original image.

[0039] In this embodiment, according to the preset rectangular boundary function, the foreground pixel points with the maximum coordinates and the foreground pixel points with the minimum coordinates in the cluster partition are constructed into rectangles, and the rectangular outline containing each foreground pixel point in the cluster partition can be accurately obtained, which ensures the close match between the rectangular outline and the actual defect shape, and provides accurate basic data for subsequent defect analysis; next, by determining the defect center position coordinates of the rectangular outline, and updating it according to the preset X-axis and Y-axis thresholds, the width and height of the rectangular outline can be further optimized to obtain the boundary rectangular area, which helps to reduce the deviation between the rectangular outline and the actual edge collapse defect, and improve the coverage accuracy of the boundary rectangular area on the edge collapse defect, thereby effectively improving the accuracy and stability of edge collapse defect recognition; finally, the boundary rectangular area is mapped to the contour shape area of ​​the test original image, so that the suspected defect contour in the test original image can be more accurately identified. That is, the mapping method of the boundary rectangular area adopted in this application ensures that the defect contour corresponds to the actual defect position in the original image, thereby effectively improving the accuracy of edge collapse defect recognition.

[0040] Furthermore, in some other feasible embodiments, the above step S301: clustering the foreground pixels according to a preset clustering algorithm to obtain cluster partitions may also include the following implementation steps: Step S3011: Determine multiple cluster centroid points specified by the clustering algorithm, and sort the Euclidean distances from each foreground pixel point to different cluster centroid points in order from small to large, and then divide each foreground pixel point and the cluster centroid point with the closest distance into a group to obtain different cluster intervals.

[0041] In this embodiment, a plurality of cluster centroid points specified by a preset clustering algorithm are first determined, and then the Euclidean distances of each foreground pixel point to different cluster centroid points are sorted in ascending order, so that each pixel point can be quickly and accurately divided into the cluster interval corresponding to the nearest cluster centroid point. That is, the present application uses the Euclidean distance as the basis for division, which can effectively measure the similarity between each foreground pixel point; in addition, since the Euclidean distance takes into account the positional relationship of the foreground pixel points in the multidimensional space, it can more accurately reflect the actual distance between the pixel points, which helps to improve the accuracy of clustering, so that the multiple foreground pixel points in each cluster interval have higher similarity and consistency.

[0042] It should be noted that the initial cluster centroid point refers to a pixel point representing any value in each corresponding cluster interval, which can be customized according to application requirements, and this application does not impose any restrictions here.

[0043] Step S3012: Detect whether the pixel means between the foreground pixels in each cluster interval are consistent with the centroid value of the cluster centroid point in the same cluster interval.

[0044] In this embodiment, it is detected whether the pixel mean between each foreground pixel point in each cluster interval is the same as the centroid value of the cluster centroid point, or it is detected whether the pixel mean between each foreground pixel point in each cluster interval is in the threshold interval corresponding to the centroid value.

[0045] Step S3013: if not, then update the cluster centroid point according to the pixel mean, and return to the step of sorting the Euclidean distances of each foreground pixel point to different cluster centroid points in ascending order according to the updated cluster centroid point; Step S3014: until the pixel mean values ​​between the foreground pixels in each cluster interval are consistent with the centroid value of the cluster centroid point in the same cluster interval, each cluster interval is used as a cluster partition.

[0046] In this embodiment, if there is a pixel mean between each foreground pixel point in a clustering interval that is different from the centroid value of the cluster centroid point, or there is a pixel mean between each foreground pixel point in a clustering interval that is not within the threshold interval corresponding to the centroid value, the cluster centroid point is updated according to the pixel mean, and the step of sorting the Euclidean distances of each foreground pixel point to different cluster centroid points in order from small to large is returned according to the updated cluster centroid point; until the pixel mean between each foreground pixel point in each clustering interval is consistent with the centroid value of the cluster centroid point in the same clustering interval, each clustering interval is used as a cluster partition. In other words, the present application can determine the accuracy of the current clustering result by detecting whether the pixel mean between each foreground pixel point in each clustering interval is consistent with the centroid value of the cluster centroid point. If not, the cluster centroid point is updated according to the pixel mean. Specifically, after taking the pixel mean as the centroid value of the cluster centroid point, the Euclidean distance is recalculated for sorting, thereby optimizing the clustering result. This process can be iterated continuously until a high clustering accuracy is achieved (that is, until the pixel means between the foreground pixels in each cluster interval are consistent with the centroid value of the cluster centroid point), and each cluster interval is used as a cluster partition, thereby improving the stability and reliability of cluster partitions.

[0047] It should be noted that there are multiple cluster partitions, and they are equal to the number of cluster centroid points.

[0048] Furthermore, in some feasible embodiments, the above step S302: performing boundary rectangle processing according to the cluster partitioning to obtain a boundary rectangle area may also include the following implementation steps: Step S3021: constructing a rectangle for the foreground pixel point with the maximum coordinate and the foreground pixel point with the minimum coordinate in the cluster partition according to a preset rectangular boundary function to obtain a rectangular outline.

[0049] In this embodiment, the foreground pixel points with the maximum coordinates and the foreground pixel points with the minimum coordinates in the cluster partition are firstly clustered, and then the foreground pixel points with the maximum coordinates and the foreground pixel points with the minimum coordinates are rectangularly constructed through a preset rectangular boundary function. The rectangular outline containing each foreground pixel point in the cluster partition can be accurately obtained, which ensures a close match between the rectangular outline and the actual defect shape, and provides accurate basic data for subsequent defect analysis.

[0050] It should be noted that the preset rectangular boundary function can be understood as boundRect; the foreground pixel point with the maximum coordinate can be understood as the pixel point with the maximum value on the X-axis and the maximum value on the Y-axis in the cluster partition; the foreground pixel point with the minimum coordinate can be understood as the pixel point with the minimum value on the X-axis and the minimum value on the Y-axis in the cluster partition.

[0051] Step S3022: Determine the defect center position coordinates of the rectangular outline, and update the defect center position coordinates according to a preset X-axis threshold and a Y-axis threshold to obtain an updated width and an updated height of the rectangular outline.

[0052] In this embodiment, after determining the coordinates of the upper left corner and the lower right corner of the rectangle specified by the rectangular outline, and based on the average of the coordinates of the upper left corner and the lower right corner of the rectangle, the defect center position coordinates (x, y) of the rectangular outline are obtained, and then the defect center position coordinates are updated according to the preset X-axis threshold and Y-axis threshold to obtain the updated width and updated height of the rectangular outline, and then the width and height of the rectangular outline can be further optimized to obtain the boundary rectangular area, which helps to reduce the deviation between the rectangular outline and the actual edge collapse defect, and improve the coverage accuracy of the boundary rectangular area on the edge collapse defect, thereby effectively improving the accuracy and stability of edge collapse defect identification.

[0053] It should be noted that the preset X-axis threshold and Y-axis threshold can be customized according to application requirements, and this application does not impose any restrictions here. Exemplarily, after extracting the rectangular outline containing all foreground pixels in the cluster partition through boundRect, the defect center position coordinates (x, y) of the rectangular outline are updated according to the preset X-axis threshold 25 and the Y-axis threshold 25 to obtain a new interception position coordinate rectangular area Rect_new (x-25, y-25, 50, 50), thereby determining that the updated width and updated height of the rectangular outline are both 50 pixels.

[0054] Step S3023: Obtain a boundary rectangular area according to the product of the update width and the update height.

[0055] In this embodiment, the boundary rectangular area can be accurately obtained according to the product of the update width and the update height; next, the boundary rectangular area is mapped to the contour shape area of ​​the test original image, and the contour shape area is cut off from the test original image, so that the following can be accurately obtained: Figure 7 The suspected defect outline is shown. That is, the present application adopts the mapping method of the boundary rectangular area to ensure that the defect outline corresponds to the actual defect position in the original image, thereby effectively improving the accuracy of edge collapse defect recognition.

[0056] Furthermore, in some other feasible embodiments, the above step S30: identifying edge collapse defects according to the suspected defect contour may also include the following implementation steps: Step A10: Binarize the suspected defect contour and convert it into a contour binary image, and perform contour detection on the suspected defect contour according to a preset contour search algorithm to obtain a contour list.

[0057] In this embodiment, the suspected defect contour is binarized and converted into a contour binary image according to the adaptive binarization method, which effectively removes the interference of image noise in the suspected defect contour, making the subsequent contour detection more efficient and accurate; then, the suspected defect contour is detected according to the preset contour search algorithm, and a contour list containing at least one clear contour boundary can be accurately extracted.

[0058] Step A20: Traverse the contour areas corresponding to the contour boundaries in the contour list to obtain a target contour, where the target contour refers to a contour with the largest contour boundary area.

[0059] In this embodiment, by traversing the contour areas corresponding to each contour boundary in the contour list, the target contour with the largest contour area can be found. Since the defect represented by the target contour is the most significant or main defect in the test original image, not only can the edge collapse defects that may exist in the test original image be quickly locked, but also some misdetected contours with smaller areas that may be caused by noise or interference can be eliminated, thereby enhancing the accuracy of defect identification.

[0060] Step A30: In the contour binary image, each pixel in the target contour is filled with a white RGB value, and each pixel other than the target contour is filled with a black RGB value, to obtain a binary image to be tested.

[0061] In this embodiment, each pixel in the target contour is filled with white RGB value, and each pixel other than the target contour is filled with black RGB value in the contour binary image, so that the binary image to be tested can be accurately obtained.

[0062] It should be noted that the white RGB value refers to the values ​​of the three color channels of red (R), green (G), and blue (B) corresponding to white in the RGB (Red-Green-Blue) color mode. For example, specifically, in the RGB color mode, the RGB value of white is (255, 255, 255).

[0063] The black RGB value refers to the values ​​of the three color channels of red (R), green (G), and blue (B) corresponding to black in the RGB (Red-Green-Blue) color mode. For example, specifically, in the RGB color mode, the RGB value of black is (0, 0, 0).

[0064] In a specific embodiment, each pixel point within the target contour with the largest contour area is set to 255 (i.e., white RGB value), and each pixel point outside the target contour is set to 0 (i.e., black RGB value), and the following is obtained: Figure 8 The binary image to be tested is shown.

[0065] Step A40: determining the pixel coordinates of each white pixel in the binary image to be tested on the original test image, and identifying edge collapse defects based on the edge distance from each pixel coordinate to the mapped binary image.

[0066] In this embodiment, the pixel coordinates of each white pixel in the binary image to be tested on the original test image are determined, and the edge collapse defect is identified based on the edge distance from each pixel coordinate to the mapped binary image.

[0067] It should be noted that the expression of the pixel coordinate point is , where rect.x is the starting x-coordinate of the binary image to be tested corresponding to the original test image, and rect.y is the starting y-coordinate of the binary image to be tested corresponding to the original test image. is the x-coordinate of the ith white pixel on the binary image to be tested, is the y coordinate of the i-th white pixel on the binary image to be tested.

[0068] Furthermore, in some other feasible embodiments, the above step A40: identifying edge collapse defects according to the edge distance from each pixel coordinate point to the mapped binary image may also include the following implementation steps: Step A401: after determining the edge distance from each pixel coordinate point to the mapped binary image, obtaining the distance mean between each edge distance; Step A402: performing variance processing according to the distance mean and any one of the edge distances to obtain an actual variance value corresponding to the binary image to be tested, and determining whether the actual variance value is greater than a preset variance threshold.

[0069] In this embodiment, after determining the edge distance from each pixel coordinate point to the mapped binary image, the mean distance from each pixel coordinate point to the edge of the mapped binary image is calculated, so that the overall distribution of the pixel points to the edge in the image can be objectively quantified. This quantification method helps to eliminate the influence of subjective judgment and provide more accurate image quality evaluation; next, variance processing is performed based on the distance mean and any edge distance to obtain the actual variance value corresponding to the binary image to be tested, and it is judged whether the actual variance value is greater than the preset variance threshold, and this objective standard judgment method is used to reduce human errors and effectively improve the accuracy of defect recognition.

[0070] It should be noted that the distance mean calculation expression is shown in the following formula 1: = ...Formula 1 in, is the mean distance, It refers to the edge distance from the pixel coordinate point of the i-th white pixel to the mapped binary image. Indicates the number of white pixels.

[0071] The actual variance value corresponding to the binary image to be tested can be understood as calculated according to the actual variance value calculation expression as follows: Fig. 9 The actual variance value of the arc-shaped area shown, and the actual variance value calculation expression is shown in the following formula 2: - )*( - )…Formula 2 in, Indicates the actual variance value.

[0072] Step A403: if the actual variance value is less than or equal to a preset variance threshold, the VR screen to be tested is determined to be a qualified product; Step A404: If the actual variance value is greater than a preset variance threshold, it is determined that the VR screen to be tested is a defective product with chipped edges.

[0073] In this embodiment, by comparing the actual variance value with the preset variance threshold, the VR screen with edge collapse defects can be quickly identified. Specifically, if the actual variance value is less than or equal to the preset variance threshold, the VR screen to be tested is determined to be a qualified product; if the actual variance value is greater than the preset variance threshold, the VR screen to be tested is determined to be an edge collapse defective product. This automated variance comparison and judgment process can greatly speed up the speed of quality inspection, avoid false detection caused by manual intervention and subjective judgment, help improve the efficiency of the entire production line, reduce production costs, and ensure that only VR screens that meet quality standards can pass the inspection, thereby enhancing product consistency and reliability.

[0074] It should be noted that the variance comparison judgment process is as follows:

[0075] in, is the preset variance threshold, It means that the VR screen to be tested is a qualified product. It means that the VR screen to be tested is a defective product with chipped edges.

[0076] Furthermore, in some feasible embodiments, in the above step S20: determining the mapped binary image according to the preset qualified template and the test binary image, the following implementation steps may also be included: Step S201: determining a qualified VR screen having the same product specifications as the VR screen to be tested, and creating a template for the sample image of the qualified VR screen according to a preset given contour shape function to obtain a preset qualified template.

[0077] In this embodiment, the template original image is binarized using an adaptive binarization method to obtain the following Figure 5 After obtaining the template binary image shown in the figure, the template original image is created according to the preset given contour shape function, so that the preset qualified template can be obtained quickly and accurately, which effectively improves the efficiency and accuracy of template creation.

[0078] It should be noted that the preset given contour shape function refers to the function "create_shape_model".

[0079] Step S202: performing template matching on the qualified template and the test binary image according to a preset template matching function to obtain a matching contour area between the test binary image and the qualified template, and mapping the matching contour area to the test original image to obtain a mapped binary image.

[0080] In this embodiment, the qualified template is matched with the test binary image according to the preset template matching function to obtain the matching contour area of ​​the test binary image and the qualified template, and the matching contour area is mapped to the test original image, so that the following can be accurately obtained: Figure 6 The mapped binary image shown intuitively displays the area in the test original image that matches the qualified template, providing strong support for subsequent defect recognition processing.

[0081] It should be noted that the preset template matching function refers to the function "find_shape_model".

[0082] Exemplarily, the test binary image is scaled, rotated, and translated according to the function "find_shape_model" until the test binary image basically coincides with the qualified template, and then an area with the same contour shape as the qualified template (i.e., the matching contour area) is found in the test binary image. That is, the present application effectively improves the matching precision and accuracy of obtaining the matching contour area by using the function "find_shape_model".

[0083] In summary, since the edge chipping defect on the lens is not only difficult to detect, but also requires constant changing of the detection position during manual inspection, which will increase the labor intensity of the operator, the edge chipping defect is determined by the defect recognition method based on the VR screen provided in the present application, which not only has high accuracy, but also can greatly reduce the labor intensity of the operator and improve the production line inspection efficiency. Specifically, the defect recognition method based on the VR screen provided in the present application can be well applied to the automatic detection of lens defects on the production line, which not only reduces the cost, but also reduces the damage to the workers' eyes caused by the operation, improves the efficiency of defect recognition, and reduces the missed detection rate.

[0084] In addition, this application also provides a defect recognition device based on VR screen, please refer to Fig.10 , Fig.10 It is a structural schematic diagram of a defect identification device based on a VR screen involved in an embodiment of the present application.

[0085] The defect recognition device based on VR screen in this application includes: The acquisition module H01 is used to acquire the test original image of the VR screen to be tested, and convert the test original image into a test binary image through binarization; The processing module H02 is used to determine a mapping binary image according to a preset qualified template and the test binary image, and perform frame difference processing on the test binary image and the mapping binary image to obtain a frame difference binary image; The identification module H03 is used to determine the suspected defect contour of the test original image according to the frame difference binary image, and to identify the edge collapse defect according to the suspected defect contour.

[0086] Optionally, the identification module H03 may further include: A clustering partition unit, used to determine a plurality of foreground pixels of the frame difference binary image, and perform clustering processing on each of the foreground pixels according to a preset clustering algorithm to obtain cluster partitions; A rectangle processing unit is used to perform boundary rectangle processing according to the cluster partition to obtain a boundary rectangle area, and map the boundary rectangle area to the contour shape area of ​​the test original image as the suspected defect contour of the test original image.

[0087] Optionally, the identification module H03 may further include: A sorting unit, used to determine a plurality of cluster centroid points specified by the clustering algorithm, sort the Euclidean distances of each foreground pixel point to different cluster centroid points in ascending order, and then group each foreground pixel point and the cluster centroid point with the closest distance into a group to obtain different cluster intervals; A detection unit, used for detecting whether the pixel means between the foreground pixels in each clustering interval are consistent with the centroid value of the cluster centroid point in the same clustering interval; A returning unit, for, if not, updating the cluster centroid point according to the pixel mean, and returning to execute the step of sorting the Euclidean distances of each foreground pixel point to different cluster centroid points in ascending order according to the updated cluster centroid point; The iteration termination unit is used to treat each clustering interval as a cluster partition until the pixel mean between each foreground pixel point in each clustering interval is consistent with the centroid value of the cluster centroid point in the same clustering interval.

[0088] Optionally, the identification module H03 may further include: A construction unit, used for performing rectangle construction on the foreground pixel point with the maximum coordinate and the foreground pixel point with the minimum coordinate in the cluster partition according to a preset rectangular boundary function to obtain a rectangular outline; An updating unit, used to determine the defect center position coordinates of the rectangular outline, and update the defect center position coordinates according to a preset X-axis threshold and a Y-axis threshold to obtain an updated width and an updated height of the rectangular outline; The calculation unit is used to obtain a boundary rectangular area according to the product of the update width and the update height.

[0089] Optionally, the identification module H03 may further include: A contour search unit, used to convert the suspected defect contour into a contour binary image through binarization, and perform contour detection on the suspected defect contour according to a preset contour search algorithm to obtain a contour list; A traversal unit, used for traversing the contour areas corresponding to the contour boundaries in the contour list to obtain a target contour, wherein the target contour refers to a contour with the largest contour boundary area; A filling unit, used for filling each pixel in the target contour with a white RGB value in the contour binary image, and filling each pixel except the target contour with a black RGB value, so as to obtain a binary image to be tested; The defect recognition unit is used to determine the pixel coordinates of each white pixel in the binary image to be tested on the original test image, and to perform edge collapse defect recognition based on the edge distance from each pixel coordinate to the mapped binary image.

[0090] Optionally, the processing module H02 may further include: A mean value calculation unit, configured to obtain a distance mean value between each edge distance after determining the edge distance from each pixel coordinate point to the mapped binary image; A judging unit, configured to perform variance processing according to the distance mean and any one of the edge distances to obtain an actual variance value corresponding to the binary image to be tested, and to judge whether the actual variance value is greater than a preset variance threshold; A qualified result output unit, used for determining that the VR screen to be tested is a qualified product if the actual variance value is less than or equal to a preset variance threshold; The defect result output unit is used to determine that the VR screen to be tested is an edge chipping defective product if the actual variance value is greater than a preset variance threshold.

[0091] Optionally, the identification module H03 may further include: A creation unit, used to determine a qualified VR screen with the same specifications as the VR screen product to be tested, and to create a template for the sample image of the qualified VR screen according to a preset given contour shape function to obtain a preset qualified template; A mapping unit is used to perform template matching between the qualified template and the test binary image according to a preset template matching function to obtain a matching contour area between the test binary image and the qualified template, and map the matching contour area to the test original image to obtain a mapped binary image.

[0092] The various functional modules of the defect recognition device based on VR screen of the present application implement the steps of the defect recognition method based on VR screen of the present application as described above during operation.

[0093] In addition, the present application also provides a defect recognition device based on a VR screen. Fig.11 , Fig.11 The structure diagram of the defect recognition device based on VR screen involved in the embodiment of the present application is shown in FIG. The defect recognition device based on VR screen in the embodiment of the present application can be a device for locally running the defect recognition method based on VR screen.

[0094] like Fig.11 As shown, the defect recognition device based on the VR screen in the embodiment of the present application may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface).

[0095] The memory 1005 is arranged on the main body of the defect recognition device based on the VR screen, and a program is stored in the memory 1005, and the program implements the corresponding operation when it is executed by the processor 1001. The memory 1005 is also used to store parameters for use by the defect recognition device based on the VR screen. The memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.

[0096] Those skilled in the art will understand that Fig.11 The structure of the VR screen-based defect identification device shown in the figure does not constitute a limitation of the VR screen-based defect identification device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0097] like Fig.11 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a VR screen-based defect recognition program of a VR screen-based defect recognition device.

[0098] exist Fig.11 In the VR screen-based defect recognition device shown, the processor 1001 can be used to call the VR screen-based defect recognition program of the VR screen-based defect recognition device stored in the memory 1005, and execute any step of the above-mentioned VR screen-based defect recognition method.

[0099] In addition, the present application provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores a defect recognition program based on a VR screen, and when the defect recognition program based on a VR screen is executed by a processor, the steps of the above-mentioned defect recognition method based on a VR screen are implemented.

[0100] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0101] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, disk, optical disk) as mentioned above, including a number of instructions for enabling a defect recognition device based on a VR screen (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0103] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A defect recognition method based on VR screen, characterized in that: The defect recognition method based on VR screen includes: Acquire a test original image of the VR screen to be tested, and convert the test original image into a test binary image by binarization; Determine a mapping binary image according to a preset qualified template and the test binary image, and perform frame difference processing on the test binary image and the mapping binary image to obtain a frame difference binary image; The suspected defect contour of the test original image is determined according to the frame difference binary image, and the edge collapse defect is identified according to the suspected defect contour.

2. The defect recognition method based on VR screen according to claim 1, characterized in that: The step of determining the suspected defect contour of the test original image according to the frame difference binary image comprises: Determine a plurality of foreground pixel points of the frame difference binary image, and perform clustering processing on each of the foreground pixel points according to a preset clustering algorithm to obtain cluster partitions; Boundary rectangle processing is performed according to the cluster partitioning to obtain a boundary rectangle area, and the boundary rectangle area is mapped to the contour shape area of ​​the test original image as the suspected defect contour of the test original image.

3. The defect recognition method based on VR screen as claimed in claim 2, characterized in that: The step of clustering the foreground pixels according to a preset clustering algorithm to obtain cluster partitions includes: Determine a plurality of cluster centroid points specified by the clustering algorithm, and after sorting the Euclidean distances from each foreground pixel point to different cluster centroid points in ascending order, divide each foreground pixel point and the cluster centroid point with the closest distance into a group to obtain different cluster intervals; Detecting whether the pixel means between the foreground pixels in each clustering interval are consistent with the centroid value of the cluster centroid point in the same clustering interval; If not, the cluster centroid point is updated according to the pixel mean, and the step of sorting the Euclidean distances of each foreground pixel point to different cluster centroid points in ascending order is returned according to the updated cluster centroid point; Each clustering interval is used as a cluster partition until the pixel mean values ​​between the foreground pixels in each clustering interval are consistent with the centroid value of the cluster centroid point in the same clustering interval.

4. The defect recognition method based on VR screen as claimed in claim 2, characterized in that: The step of performing boundary rectangle processing according to the cluster partitioning to obtain a boundary rectangle area comprises: According to a preset rectangular boundary function, a rectangular construction is performed on the foreground pixel point with the maximum coordinate and the foreground pixel point with the minimum coordinate in the cluster partition to obtain a rectangular outline; Determine the defect center position coordinates of the rectangular outline, and update the defect center position coordinates according to a preset X-axis threshold and a Y-axis threshold to obtain an updated width and an updated height of the rectangular outline; A boundary rectangular area is obtained according to the product of the update width and the update height.

5. The defect recognition method based on VR screen according to claim 1, characterized in that: The step of identifying edge collapse defects based on the suspected defect contour comprises: Binarizing the suspected defect contour into a contour binary image, and performing contour detection on the suspected defect contour according to a preset contour search algorithm to obtain a contour list; Traversing the contour areas corresponding to the contour boundaries of the contour list to obtain a target contour, wherein the target contour refers to a contour with the largest contour boundary area; In the contour binary image, each pixel in the target contour is filled with a white RGB value, and each pixel other than the target contour is filled with a black RGB value, to obtain a binary image to be tested; The pixel coordinates of each white pixel in the binary image to be tested on the original test image are determined, and edge collapse defects are identified based on the edge distance from each pixel coordinate to the mapped binary image.

6. The defect recognition method based on VR screen as claimed in claim 5, characterized in that: The step of identifying edge collapse defects based on the edge distance from each pixel coordinate point to the mapped binary image comprises: After determining the edge distance from each pixel coordinate point to the mapped binary image, obtaining the distance mean between each edge distance; Performing variance processing according to the distance mean and any one of the edge distances to obtain an actual variance value corresponding to the binary image to be tested, and determining whether the actual variance value is greater than a preset variance threshold; If the actual variance value is less than or equal to the preset variance threshold, it is determined that the VR screen to be tested is a qualified product; If the actual variance value is greater than a preset variance threshold, it is determined that the VR screen to be tested is a defective product with chipped edges.

7. The defect recognition method based on VR screen according to claim 1, characterized in that: The step of determining the mapped binary image based on the preset qualified template and the test binary image comprises: Determine a qualified VR screen with the same specifications as the VR screen to be tested, and create a template for the sample image of the qualified VR screen according to a preset given contour shape function to obtain a preset qualified template; The qualified template is template matched with the test binary image according to a preset template matching function to obtain a matching contour area between the test binary image and the qualified template, and the matching contour area is mapped to the test original image to obtain a mapped binary image.

8. A defect recognition device based on a VR screen, characterized in that: The defect recognition device based on VR screen includes: An acquisition module is used to acquire a test original image of the VR screen to be tested, and convert the test original image into a test binary image through binarization; A processing module, used for determining a mapping binary image according to a preset qualified template and the test binary image, and performing frame difference processing on the test binary image and the mapping binary image to obtain a frame difference binary image; The recognition module is used to determine the suspected defect contour of the test original image according to the frame difference binary image, and to perform edge collapse defect recognition according to the suspected defect contour.

9. A defect recognition device based on a VR screen, characterized in that: The VR screen-based defect recognition device includes a memory, a processor, and a VR screen-based defect recognition program stored in the memory and executable on the processor. When the processor executes the VR screen-based defect recognition program, it implements the steps of the VR screen-based defect recognition method as described in any one of claims 1 to 7.

10. A storage medium, the storage medium being a computer-readable storage medium, characterized in that: The computer-readable storage medium stores a VR screen-based defect recognition program, and when the VR screen-based defect recognition program is executed by a processor, the steps of the VR screen-based defect recognition method as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Wafer defect classification method and device based on wafer graph

    CN119580021A