Panel defect detection method, storage medium and terminal device
By reconstructing panel images using principal component analysis, the problems of misjudgment in manual inspection and insufficient accuracy in automated inspection are solved, achieving efficient and accurate defect detection of display panels.
Patent Information
- Application Number
- CN202110148640.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-02
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-02-02
AI Technical Summary
In existing technologies, display panel defect detection relies on manual inspection, which is prone to eye fatigue and misjudgment. Furthermore, automated detection methods are not accurate enough under conditions of inconsistent lighting and unclear images. In particular, deep learning network training requires a large amount of manual annotation and is difficult to adapt to diverse defect types.
Principal component analysis is used to determine the principal component matrix by acquiring defect-free panel images, and then reconstruct the panel images to identify defective regions, reducing reliance on preset defect images and improving detection accuracy.
It improves the accuracy of display panel defect detection, reduces manual intervention, lowers training costs, and adapts to the identification of diverse defect types.
Smart Images

Figure CN114926385B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of panel processing, in particular to a panel defect detection method, a storage medium and a terminal device. BACKGROUND
[0002] In industrial production, quality detection of products is an indispensable process. Quality detection is mainly divided into three categories: defect detection, tolerance detection and component measurement, wherein defect detection is used to find various defects that affect the appearance or function of the product. However, at present, defect detection of display panels is generally carried out by manual work, but the detection personnel will make mistakes due to visual fatigue when doing a large amount of repetitive work, thereby affecting the quality of the display panel. SUMMARY
[0003] The technical problem to be solved by the present application is to provide a panel defect detection method, a storage medium and a terminal device to solve the problems of the prior art.
[0004] In order to solve the above technical problems, the first aspect of the present application provides a panel defect detection method, which comprises:
[0005] obtaining a panel image to be detected;
[0006] determining a principal component matrix corresponding to the panel image, wherein the principal component matrix is determined based on a plurality of reference images, and the similarity between each reference image in the plurality of reference images and the panel image satisfies a preset condition;
[0007] determining a predicted image corresponding to the panel image based on the principal component matrix and the panel image;
[0008] identifying a defect area in the panel image based on the predicted image and the panel image.
[0009] The panel defect detection method, wherein the obtaining of the panel image to be detected comprises:
[0010] obtaining a candidate panel image corresponding to the panel to be detected;
[0011] dividing the candidate panel image into a plurality of sub-images based on a preset template image, wherein the similarity between each sub-image in the plurality of sub-images and the preset template image satisfies a preset condition;
[0012] selecting an image block from the plurality of sub-images, and taking each selected image block as a panel image to be detected.
[0013] The panel defect detection method, wherein the principal component matrix is included in a principal component matrix set, and the determination process of the principal component matrix set comprises:
[0014] obtaining a plurality of training panel images, wherein each of the plurality of training panel images does not carry a defect region;
[0015] determining a plurality of training image block sets based on the plurality of training panel images, wherein each of the plurality of training image block sets comprises a plurality of training image blocks, and a similarity between any two of the plurality of training image blocks satisfies a preset condition;
[0016] determining a principal component matrix corresponding to each of the plurality of training image block sets based on a principal component analysis manner, to obtain a principal component matrix set.
[0017] The panel defect detection method, wherein the determining the plurality of training image block sets based on the plurality of training panel images specifically comprises:
[0018] selecting a plurality of sub-training images in each of the plurality of training panel images based on a preset template image;
[0019] for each of the plurality of sub-training images, selecting a plurality of training image blocks in the sub-training image, to obtain the plurality of training image blocks;
[0020] dividing the plurality of training image blocks into the plurality of training image block sets according to a similarity between each of the plurality of training image blocks.
[0021] The panel defect detection method, wherein before the selecting the plurality of sub-training images in each of the plurality of training panel images based on the preset template image, the method further comprises:
[0022] selecting a target panel image in the plurality of training panel images;
[0023] selecting a target sub-image in the target panel image, and taking the target sub-image as the preset template image.
[0024] The panel defect detection method, wherein the preset template image comprises at least one periodic image region, and when the preset template image is divided into a plurality of sub-template images with the periodic image region as a reference, each of the plurality of sub-template images comprises a periodic image region.
[0025] The panel defect detection method, wherein before the selecting the plurality of sub-training images in each of the plurality of training panel images based on the preset template image, the method further comprises:
[0026] for each of the plurality of training panel images, taking the training panel image as a to-be-adjusted image;
[0027] adjust the to-be-adjusted image based on the preset template image to obtain an adjusted image, wherein the adjusted image has at least one training image region that meets a preset condition in terms of coincidence with the preset template image;
[0028] take the adjusted image as a training panel image.
[0029] The panel defect detection method, wherein the determination of the principal component matrix corresponding to each training image block set based on the principal component analysis manner specifically comprises:
[0030] For each training image block set, convert each training image block in the training image block set into a reference vector;
[0031] determine a reference matrix based on all the converted reference vectors;
[0032] determine a plurality of target vectors corresponding to the reference matrix by using the principal component analysis manner, and form a matrix of the plurality of target vectors as the principal component matrix corresponding to the training image block set.
[0033] The panel defect detection method, wherein the determination of the principal component matrix corresponding to the panel image specifically comprises:
[0034] obtain a training image block set corresponding to the panel image, wherein the similarity between the panel image and any training image block in the training image block set meets a preset condition;
[0035] select a principal component matrix corresponding to the training image block set from the principal component matrix set, and take the selected principal component matrix as the principal component matrix corresponding to the panel image.
[0036] The panel defect detection method, wherein, before the division of the candidate panel image into a plurality of sub-images based on the preset template image, the method further comprises:
[0037] take the candidate panel image as a to-be-adjusted image;
[0038] adjust the to-be-adjusted image based on the preset template image to obtain an adjusted image, and take the adjusted image as a candidate panel image, wherein the adjusted image has at least one candidate image region that meets a preset condition in terms of coincidence with the preset template image;
[0039] take the adjusted image as a candidate panel image.
[0040] The panel defect detection method, wherein the adjustment of the to-be-adjusted image based on the preset template image to obtain an adjusted image specifically comprises:
[0041] selecting a candidate image region in the image to be adjusted based on the preset template image, wherein the similarity between the image content corresponding to the candidate image region and the image content corresponding to the preset template image meets a preset condition;
[0042] determining the adjustment parameter corresponding to the image to be adjusted based on the candidate image region, wherein the adjustment parameter comprises a rotation parameter and a scaling parameter;
[0043] adjusting the image to be adjusted based on the adjustment parameter to obtain an adjusted image.
[0044] The panel defect detection method, wherein the adjustment parameter comprises a rotation parameter and a scaling parameter; and the determination of the adjustment parameter corresponding to the image to be adjusted based on the candidate image region specifically comprises:
[0045] selecting a plurality of control image regions in the image to be adjusted based on the candidate image region;
[0046] obtaining a target pixel element corresponding to each control image region in the plurality of control image regions, and determining the rotation parameter corresponding to the image to be adjusted based on the target pixel element;
[0047] determining the scaling parameter corresponding to the image to be adjusted according to the image size of the candidate image region and the image size of the preset template image, to obtain the adjustment parameter corresponding to the image to be adjusted.
[0048] The panel defect detection method, wherein the determination of the adjustment parameter corresponding to the image to be adjusted based on the candidate image region specifically comprises:
[0049] identifying a linear region in the candidate image region;
[0050] obtaining an included angle between the linear region and a preset direction, and determining the rotation parameter corresponding to the image to be adjusted based on the included angle;
[0051] determining the scaling parameter corresponding to the image to be adjusted according to the image size of the candidate image region and the image size of the preset template image, to obtain the adjustment parameter corresponding to the image to be adjusted.
[0052] The panel defect detection method, wherein the determination of the predicted image corresponding to the panel image based on the principal component matrix and the panel image specifically comprises:
[0053] converting the panel image into an image vector, wherein the vector dimension of the image vector is equal to the number of pixel points included in the panel image;
[0054] When the panel image does not include a preset panel region of the panel to be detected, the panel image corresponds to a predicted image is determined based on a vector product of the image vector and the principal component matrix, wherein the preset panel region includes a panel edge of the panel to be detected and / or a character region in the panel to be detected.
[0055] The panel defect detection method, wherein the determining of the predicted image corresponding to the panel image based on the principal component matrix and the panel image specifically comprises:
[0056] The panel image is converted into an image vector, wherein a vector dimension of the image vector is equal to a number of pixel points included in the panel image;
[0057] When the panel image includes a preset panel region of the panel to be detected, each candidate pixel position included in an image region corresponding to the preset panel region is acquired, wherein the preset panel region includes a panel edge of the panel to be detected and / or a character region in the panel to be detected;
[0058] For each candidate pixel position, an element item in the image vector corresponding to the candidate pixel position is set to a preset value to obtain a reference image vector;
[0059] The predicted image corresponding to the panel image is determined based on the reference image vector, the principal component matrix and a preset standard image vector.
[0060] The panel defect detection method, wherein the determining of the defect region in the panel image based on the panel image and the predicted image specifically comprises:
[0061] The panel image and the predicted image are matched to determine a mismatch region of the panel image and the predicted image;
[0062] The acquired mismatch region is taken as the defect region in the panel image.
[0063] The second aspect of the embodiments of the present application provides a computer readable storage medium, the computer readable storage medium stores one or more programs, the one or more programs can be executed by one or more processors to implement the steps in the panel defect detection method as described in any of the above.
[0064] The third aspect of the embodiments of the present application provides a terminal device, which comprises a processor, a memory and a communication bus; the memory stores a computer readable program which can be executed by the processor;
[0065] The communication bus realizes the connection and communication between the processor and the memory;
[0066] The processor implements the steps in the panel defect detection method as claimed in any of the above when executing the computer readable program.
[0067] Beneficial effects: compared with the prior art, the present application provides a panel defect detection method, a storage medium and a terminal device, the method comprises: acquiring a panel image to be detected; determining a principal component matrix corresponding to the panel image; determining a predicted image corresponding to the panel image based on the principal component matrix and the panel image; and identifying a defect region in the panel image based on the predicted image and the panel image. The present application determines the panel image by a principal component matrix to reconstruct the panel image to obtain a predicted image corresponding to the panel image, and determines the defect region in the panel image based on the predicted image and the panel image, which can improve the accuracy of defect detection. BRIEF DESCRIPTION OF DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0069] Figure 1 A flowchart of the panel defect detection method provided by the present application.
[0070] Figure 2 An illustration of a periodic image region in the panel defect detection method provided by the present application.
[0071] Figure 3 An illustration of a preset template image in the panel defect detection method provided by the present application.
[0072] Figure 4 An illustration of the process of selecting a sub-image in the candidate panel image in the panel defect detection method provided by the present application.
[0073] Figure 5 An illustration of the process of selecting a sub-image in the candidate panel image in the panel defect detection method provided by the present application.
[0074] Figure 6 An illustration of the process of selecting a sub-image in the candidate panel image in the panel defect detection method provided by the present application.
[0075] Figure 7 An illustration of a linear region in the candidate panel image in the panel defect detection method provided by the present application.
[0076] Figure 8An illustration of a linear region in a candidate panel image in the panel defect detection method provided by the present application.
[0077] Figure 9 An illustration of a sub-image in the panel defect detection method provided by the present application.
[0078] Figure 10 An illustration of a target image region in the panel defect detection method provided by the present application.
[0079] Figure 11 An illustration of an image block in the panel defect detection method provided by the present application.
[0080] Figure 12 A flowchart of the principal component matrix determination process in the panel defect detection method provided by the present application.
[0081] Figure 13 A flowchart of the predicted image determination process in the panel defect detection method provided by the present application.
[0082] Figure 14 A structural schematic diagram of the terminal device provided by the present application. DETAILED DESCRIPTION
[0083] The present application provides a panel defect detection method, a storage medium and a terminal device. In order to make the purpose, technical solutions and effects of the present application more clear and explicit, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0084] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an" and "the" used herein also include the plural forms. It should be further understood that the phrase "comprising" used in the specification of the present application means that the features, integers, steps, operations, elements and / or components exist, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their combinations. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any single unit and all combinations of the associated listed items.
[0085] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It should also be understood that the terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein. In addition, it should be understood that the sequence of the steps in the embodiments and the size of the steps do not mean the order of execution, and the execution order of the processes is determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the application.
[0086] The inventors have found that, in industrial production, product quality detection is an indispensable process. Quality detection is mainly divided into three categories: defect detection, tolerance detection, and component measurement. Defect detection is used to find various defects that affect the appearance or function of the product. Common defect types on display panels include particle foreign matter, fiber foreign matter, panel holes, water marks, etc., and defects on the panel can cause the circuit of the panel to be open or shorted. Therefore, it is necessary to determine the accurate information of the defect position on the display panel. At present, defect detection on the display panel is generally performed manually, but the detection personnel may make mistakes due to visual fatigue when performing a large amount of repetitive work, thereby affecting the quality of the display panel.
[0087] To solve the above problems, at present, the panel image of the display panel is generally obtained based on industrial vision, and then the defect area of the display panel is obtained by recognizing the panel image. The recognition method for recognizing the panel image generally includes clustering method, edge detection method, region growing method, graph partition method, and deep learning network (such as Mask RCNN, Unet, deeplab, etc.).
[0088] For the display panel of a television / mobile phone product, most of the serious defects occur on the circuit components, and the texture characteristics of the defects are affected by the texture of the circuit components, which affects the segmentation accuracy based on clustering or region growing. In addition, when the automatic quality detection equipment takes pictures of the defects, the light is not constant, and the camera is easy to be out of focus when taking pictures during movement, so that the contrast of part of the defects is low and the edges are not clear. The non-constant image brightness and the unclear edges limit the performance of the segmentation methods such as edge detection method, region growing method, and graph partition method.
[0089] For a deep learning network, the deep learning network needs to be trained before determining panel defects based on the deep learning network, and the defects of the training pictures need to be pixel-level labeled in the training process, which needs to consume a large amount of human resources. In addition, in order to be applicable to various panel defects, a preset number of training defect pictures of each type of panel defect need to be collected for training. However, the defect type distribution on the actual production line is uneven, and the probability of occurrence of some defect types is small, and it is difficult to collect a preset number of training images, so that the segmentation network model applicable to the defect type cannot be trained, and thus some defect types cannot be recognized.
[0090] To solve the above problems, in the embodiment of the present application, a panel image to be detected is obtained; a principal component matrix corresponding to the panel image is determined, and a prediction image corresponding to the panel image is determined based on the principal component matrix and the panel image; and a defect region in the panel image is identified based on the prediction image and the panel image. In the embodiment of the present application, only a preset number of defect-free panel images need to be obtained before panel defect detection, and the principal component matrix is determined based on the obtained defect-free panel images, so that when the panel image is determined and identified, each image block is reconstructed based on the principal component matrix to obtain a prediction image block corresponding to each image block, and the defect region in the panel image is determined based on the prediction image block and the panel image, which can improve the accuracy of defect detection.
[0091] The application content will be further described by the description of the embodiments in combination with the drawings.
[0092] Figure 1 is a flowchart of a panel defect detection method provided by the embodiment. The method can be executed by a panel defect detection device, which can be realized by software and applied to electronic devices such as PC, tablet computer, server or personal digital assistant, etc. Referring to Figure 1 The panel defect detection method provided by the embodiment specifically includes:
[0093] S10, obtaining a panel image to be detected.
[0094] Specifically, the panel image can include all panel defects of the panel to be detected, or can include part of the panel region of the panel to be detected. When the panel image includes part of the panel region of the panel to be detected, the panel image can include multiple pixel units in the panel to be detected, or can include one pixel unit in the panel to be detected, or can include part of the region in one pixel unit, etc. In addition, the panel image can be an RGB color image, or can be a Y channel grayscale image, etc.
[0095] In one implementation manner of the embodiment, the obtaining of the panel image to be detected can specifically include:
[0096] S11, acquire a candidate panel image corresponding to a panel to be detected;
[0097] S12, divide the candidate panel image into a plurality of sub-images based on a preset template image;
[0098] S13, select an image block from the plurality of sub-images, and take each selected image block as a panel image to be detected.
[0099] Specifically, in the step S11, the candidate panel image can be a candidate panel image collected in real time or at a preset interval during the production of the panel by an image collection device (such as a camera or a camera, etc.) pre-set on the production line of the panel; or a candidate panel image obtained from the local storage space of the electronic device running the generation method of the panel defect detection model; or a candidate panel image returned by the server based on the image acquisition request received by the server after sending an image acquisition request to the image storage server; of course, the candidate panel image can also be obtained by other ways, and the specific acquisition method is not limited here. Wherein, the panel to be detected corresponding to the candidate panel image can be a TFT-LCD panel, an LCD panel, an integrated circuit panel or a chip panel, etc., and the panel to be detected can include a circuit area and a non-circuit area, etc.
[0100] In the step S12, the preset template image can be pre-set, and the preset template image includes at least one periodic image area, and when the preset template image is divided into a plurality of sub-template images with the periodic image area as the reference, each sub-template image in the plurality of sub-template images includes a periodic image area. Wherein, the periodic image area corresponds to a periodic region in the panel to be detected, in other words, the panel to be detected includes a plurality of periodic regions, and the components in each periodic region in the plurality of periodic regions and the positional relationship between the components are the same; the image content contained in the periodic image area is a periodic region in the panel image to be detected. For example, the periodic image area is an image as shown in Figure 2 , and the preset template image is an image as shown in Figure 3 . Of course, in actual application, the image content contained in the periodic image area is a pixel unit in the panel image to be detected.
[0101] Each of the plurality of sub-images is contained in a candidate panel image, and a similarity of each of the plurality of sub-images to the preset template image satisfies a preset condition. The preset condition can be preset to measure the similarity of the sub-image to the preset template image. In an implementation manner, the preset condition can be that a similarity of image content of the sub-image to image content of the preset template image reaches a preset threshold value, and an image size of the sub-image is the same as an image size of the preset template image, so that when the sub-image and the preset template image are overlapped, an object carried by the sub-image reaches a preset requirement on an object corresponding to the object in the preset template image. The preset threshold value can be 99%, and the preset requirement can be 99.5%.
[0102] In an implementation manner of the embodiment, as shown in Figure 4 In the implementation manner, the candidate panel image is divided into the plurality of sub-images in a sliding window manner. In the sliding window manner, the candidate panel image is taken as a base image, and the preset template image is taken as a target image. The target image is slid on the base image to match the base image and the target image, and an image region with a similarity to the target image satisfying a preset condition is selected as a sub-image.
[0103] In an implementation manner of the embodiment, to reduce a calculation amount in the matching of the candidate panel image and the preset template image, before the sliding window manner is used to divide, as shown in Figure 5 In the implementation manner, the part edge information in the preset template image and the part edge information in the candidate panel image are acquired (for example, a gradient modulus or a Canny algorithm is used). After the part edge information in the preset template image and the part edge information in the candidate panel image are acquired, a part edge binary image corresponding to the candidate panel image is taken as a base image, and a part edge binary image corresponding to the preset template image is taken as a target image. The target image is slid on the base image to match the base image and the target image, and an image region with a similarity to the target image satisfying a preset condition is selected as a sub-image. The similarity can be a sum of absolute values of differences between pixel values of each pixel point in an edge information binary image of the sub-image and pixel values of each pixel point in an edge information binary image of the target image. The preset condition can be that the similarity is minimum, or the similarity is less than a preset threshold value.
[0104] In an implementation manner of the embodiment, as shown in Figure 6As shown, due to the distribution regularity of the components in the to-be-detected panel in the horizontal direction and the vertical direction, the candidate panel image is accumulated and summed in the horizontal direction and the vertical direction to obtain a candidate projection vector in the horizontal direction and a candidate projection vector in the vertical direction, the preset template image is accumulated and summed in the horizontal direction to obtain a target projection vector in the horizontal direction, and the preset template image is accumulated and summed in the vertical direction to obtain a target projection vector in the vertical direction, and finally the candidate projection vector and the target projection vector are matched in the horizontal direction and the vertical direction respectively to obtain a matching position in the horizontal direction and a matching position in the vertical direction, and each sub-image is determined based on the matching positions.
[0105] In one implementation form of the embodiment, before the candidate panel image is divided into a plurality of sub-images based on the preset template image, the method further includes:
[0106] The candidate panel image is taken as a to-be-adjusted image.
[0107] The to-be-adjusted image is adjusted based on the preset template image to obtain an adjusted image.
[0108] The adjusted image is taken as a candidate panel image.
[0109] Specifically, the adjustment of the to-be-adjusted image means scaling and rotating the to-be-adjusted image, so that at least one candidate image region in the adjusted image is aligned with the preset template image, and the coincidence degree of the candidate image region with the preset template image meets a preset requirement, for example, the coincidence degree is greater than a preset threshold, such as 99%.
[0110] In one implementation form of the embodiment, the adjustment of the to-be-adjusted image based on the preset template image to obtain an adjusted image specifically includes:
[0111] selecting a candidate image region in the to-be-adjusted image based on the preset template image, wherein the similarity of the image content corresponding to the candidate image region to the image content corresponding to the preset template image meets a preset condition;
[0112] determining an adjustment parameter corresponding to the image to be adjusted based on the candidate image region;
[0113] adjusting the image to be adjusted based on the adjustment parameter to obtain an adjusted image.
[0114] Specifically, the image to be adjusted has a plurality of periodically repeated component structures in a horizontal direction or a vertical direction, the preset template image has at least one periodically repeated component structure (for example, a pixel unit or the like) in the horizontal direction or the vertical direction, and the periodically repeated component structure in the preset template image is the same as the periodically repeated component structure in the image to be adjusted. Thus, after the preset template image is obtained, a candidate image region can be selected from the image to be adjusted, the candidate image region includes the periodically repeated component structures in a number same as that of the periodically repeated component structures included in the preset template image, and the periodically repeated component structures in the candidate image region are arranged in a same direction as that of the periodically repeated component structures in the preset template image, for example, both are arranged in the horizontal direction, both are arranged in the vertical direction, or the like, so that the similarity of image content corresponding to the candidate image region and the image content corresponding to the preset template image meets a preset requirement, for example, the similarity is greater than a preset similarity threshold, such as 99%, 99.5%, or the like.
[0115] The adjustment parameter includes a rotation parameter and a scaling parameter, the scaling parameter is used to adjust the image size of the image to be adjusted, so that the region size of the candidate image region in the adjusted image obtained by adjustment is same as the image size of the preset template image, and the rotation parameter is used to rotate the image content in the image to be adjusted, so that the image content in the candidate image region in the adjusted image obtained by adjustment is aligned with the image content in the preset template image. This is because there is a difference in magnification between different shooting cameras, so that the size of the component in the panel image obtained by shooting has a certain range of fluctuation, and the shooting camera and the panel to be detected have a certain inclination, so that the panel region in the panel image obtained by shooting has a certain inclination, and by adjusting the image to be adjusted, the periodically repeated component structure in the image to be adjusted is aligned with the periodically repeated component structure in the preset template image, and the periodically repeated component structure in the training panel image used for subsequent determination of the principal component matrix is aligned with the periodically repeated component structure in the preset template image, so that the periodically repeated component structure in the panel image is aligned with the periodically repeated component structure in the training panel image used for determination of the principal component matrix, so that the principal component matrix can be used to represent the panel image, and the prediction image corresponding to the panel image is obtained, and the accuracy of the prediction image is improved.
[0116] In one implementation manner of the embodiment, the determination of the adjustment parameter corresponding to the image to be adjusted based on the candidate image region specifically includes:
[0117] selecting a plurality of reference image regions based on the candidate image region in the image to be adjusted;
[0118] obtaining target pixel elements corresponding to each of the plurality of reference image regions, and determining a rotation parameter of the image to be adjusted based on the target pixel elements;
[0119] determining a scaling parameter of the image to be adjusted according to the image size of the candidate image region and the image size of the preset template image, to obtain an adjustment parameter of the image to be adjusted.
[0120] Specifically, the similarity of each of the plurality of reference image regions to the candidate image region satisfies a preset condition. It can be understood that the periodic repeating component structure included in each of the plurality of reference image regions is the same as the periodic repeating component structure included in the candidate image region, and the number of periodic repeating component structures included in each of the plurality of reference image regions is the same as the number of periodic repeating component structures included in the candidate image region. In the image region set composed of the plurality of reference image regions and the candidate image region, the arrangement directions of any two image regions are the same, for example, both in the horizontal direction or both in the vertical direction, etc.
[0121] The target pixel elements corresponding to each of the plurality of reference image regions can be determined based on candidate pixel elements in the candidate image region, and the pixel position of the candidate pixel elements in the candidate image region corresponds to the pixel position of each target pixel element in the reference image region. For example, the candidate pixel element is at the top left corner of the candidate image region, and each target pixel element is at the top left corner of the corresponding reference image region. Of course, in actual application, the candidate pixel element can be the center point, the top right corner of the candidate image region, a vertex of the component structure in the candidate image region, etc.
[0122] After obtaining the target pixel elements corresponding to each of the plurality of reference image regions, a line connecting the target pixel elements is determined, the slope of the line in the coordinate system of the image to be adjusted is determined, the inclination angle of the image to be adjusted is determined based on the slope, and the rotation parameter of the image to be adjusted is determined based on the inclination angle. For example, the slope of the line in the coordinate system of the image to be adjusted is 1 / 2, the inclination angle is 30 degrees, and the rotation parameter of the image to be adjusted is 30 degrees.
[0123] The scaling parameter is a scaling ratio of scaling the image size of the candidate image region to the image size of the preset template image, so that when the scaling parameter is determined, the scaling parameter can be determined by calculating the ratio of the image size of the candidate image region to the image size of the preset template image. In addition, the width-to-height ratio of the candidate image region is the same as the width-to-height ratio of the preset template image, so that the ratio of the image size of the candidate image region to the image size of the preset template image can be the ratio of the height of the candidate image region to the height of the preset template image, or the ratio of the width of the candidate image region to the width of the preset template image. For example, the region size of the candidate image region is 56*56, and the image size of the preset template image is 28*28, so the ratio of the image size of the candidate image region to the image size of the preset template image is 2, and the scaling parameter is 1 / 2.
[0124] In one implementation form of the embodiment, the determining the adjustment parameter corresponding to the image to be adjusted based on the candidate image region specifically comprises:
[0125] identifying a linear region in the candidate image region;
[0126] obtaining an included angle between the linear region and a preset direction, and determining a rotation parameter corresponding to the image to be adjusted based on the included angle;
[0127] determining a scaling parameter corresponding to the image to be adjusted according to the image size of the candidate image region and the image size of the preset template image, to obtain the adjustment parameter corresponding to the image to be adjusted.
[0128] Specifically, the linear region refers to an image region in which a component extending along a horizontal direction or a vertical direction is located. There are data lines and / or bus structures extending along a horizontal direction or a vertical direction in the panel to be detected, so that the candidate image region includes an image region corresponding to the data lines and / or bus structures extending along a horizontal direction or a vertical direction. Thus, after the candidate image region is obtained, edge information of the candidate image region can be extracted (for example, using Sobel / Canny operators), and then a linear region in the candidate image region can be determined based on the edge information (using Hough Transform or Line segment detector (LSD) algorithm), to obtain the linear region, for example, the straight line region B in Figure 8 In addition, in actual applications, the component structure included in the candidate image region can also include a linear region, so that the linear region can also be an image region corresponding to a linear part of the component structure, for example, as shown in Figure 7 The linear region is the straight line region A in Figure 7
[0129] After the linear region is obtained, an included angle between the linear region and a preset direction is obtained, and a rotation parameter corresponding to the image to be adjusted is determined based on the included angle. For example, if the linear region extends along a vertical direction, the preset direction is the vertical direction, and if the linear region extends along a horizontal direction, the preset direction is the horizontal direction. After the included angle is obtained, the rotation parameter corresponding to the image to be adjusted is determined, and after the candidate image region is rotated by the rotation parameter, the included angle between the linear region in the candidate image region and the preset direction is zero degrees.
[0130] In the step S13, the image block is contained in one of the sub-images, and the image block can be part of an image region in a target image region in the sub-image. For example, the sub-image is an image as shown in FIG. 6, the target image region is an image as shown in FIG. 7, and the image block can be an image as shown in FIG. 8. Figure 9 In actual applications, after the candidate panel image corresponding to the panel to be detected is obtained, in order to determine all defect regions corresponding to the candidate panel image, after a plurality of sub-images are obtained, each of the sub-images can be divided into a plurality of image blocks, each of the image blocks is regarded as a panel image, and each of the panel images is subjected to subsequent steps to obtain panel defects corresponding to each of the panel images. Finally, all of the panel regions obtained are regarded as panel defects corresponding to the candidate panel image. In this embodiment, in order to facilitate understanding, an example in which defect regions corresponding to one image block are determined is described. Figure 10 Figure 11
[0131] In one implementation form of the embodiment, the selecting an image block from the plurality of sub-images and taking the selected image block as the panel image can specifically be selecting a target sub-image from the plurality of sub-images, dividing the target sub-image into a plurality of image blocks according to a preset division manner, and finally selecting an image block from the plurality of divided image blocks as the panel image. The preset division manner can be preset, for example, the sub-image is equally divided into a plurality of image blocks (for example, equally divided into 3 image blocks, etc.) according to the image size, or the sub-image is divided into a plurality of sub-units based on the target image region, and then the sub-units are equally divided into a plurality of image blocks, etc. In actual application, not all defects in a pixel unit of the panel to be detected will affect the screen quality, so only part of the region needs to be detected for defects. Therefore, a plurality of regions of interest can be selected in the pixel unit in advance, then the image regions corresponding to the sensing regions are selected in the sub-image, and the selected image regions are taken as a plurality of image blocks. In actual application, the image width of the image block can be equal to the width of the periodic image region, and the height can be 40-100 pixels, so that the size of the image block is not too small to cause the defect region to be unable to be recovered, and the size of the image block is not too large to increase the calculation complexity of principal component analysis. Generally, the block size between 40-100 pixels can achieve a balance between performance and complexity.
[0132] For example, the sub-image is as shown in the image of Figure 10 The width of the sub-image is one time the width of the pixel unit, and the equal division ratio is 3. The sub-image is equally divided into three image blocks along the height direction, wherein the uppermost image block corresponds to the pattern texture of the horizontal running circuit, and the lower two image blocks correspond to the pattern texture of the vertical running circuit.
[0133] S20, determining a principal component matrix corresponding to the panel image.
[0134] Specifically, the principal component matrix is determined based on a plurality of reference images, each reference image in the plurality of reference images satisfies a preset condition with the panel image, the principal component matrix is determined based on the plurality of reference images to represent the panel image, and when the panel image carries a defect region, the defect region in the panel image can be repaired. The preset condition is the same as the similarity of the sub-image to the preset template image satisfying the preset condition, which is used to measure the similarity of the reference image to the panel image. For details of the preset condition, refer to the description of the similarity of the sub-image to the preset template image satisfying the preset condition, which will not be repeated here.
[0135] In one implementation form of the embodiment, the principal component matrix is included in a principal component matrix set, and the determination of the principal component matrix corresponding to the panel image specifically includes:
[0136] obtain a training image block set corresponding to the panel image;
[0137] select a principal component matrix corresponding to the training image block set from the principal component matrix set, and use the selected principal component matrix as the principal component matrix corresponding to the panel image.
[0138] Specifically, the principal component matrix set includes a plurality of principal component matrices, each of the plurality of principal component matrices corresponds to a training image block set, the principal component matrix is determined based on the training image block set, and the principal component matrix is used to restore an image similar to any training image block in the training image block set. Thus, when determining the principal component matrix corresponding to the panel image, the training image block set corresponding to the panel image is selected from the principal component matrix set, the similarity between any training image block in the training image block set and the panel image satisfies the preset condition, after obtaining the training image block set, the principal component matrix corresponding to the training image block set is selected, and the selected principal component matrix is used as the principal component matrix corresponding to the panel image. In this way, the principal component matrix can be used to determine the predicted panel image corresponding to the panel image.
[0139] In one implementation of the embodiment, as shown in FIG. 3, the process of determining the principal component matrix set includes: Figure 12
[0140] obtain a plurality of training panel images;
[0141] determine a plurality of training image block sets based on the plurality of training panel images;
[0142] determine the principal component matrix corresponding to each training image block set based on the principal component analysis method, to obtain the principal component matrix set.
[0143] Specifically, each of the plurality of training panel images does not carry a defect area, there can be training panel image A and training panel image B in the plurality of training panel images, the brightness of the training panel image A is different from the brightness of the training panel image B, there can also be training panel image C and training panel image D, the brightness of the training panel image C is different from the color of the training panel image D, so that the principal component matrix determined based on the training panel image can be used for panel images of different brightness and different color.
[0144] Each of the plurality of training image block sets comprises a plurality of training image blocks, and a similarity between any two training image blocks of the plurality of training image blocks satisfies a preset condition. For example, the training image block set comprises training image block A and training image block B, and the similarity between training image block A and training image block B satisfies the preset condition. In one implementation form of the embodiment, the determining the plurality of training image block sets based on the plurality of training panel images specifically comprises:
[0145] selecting a plurality of sub-training images in the training panel images based on the preset template image;
[0146] For each sub-training image of the plurality of sub-training images, a plurality of training image blocks are selected in the sub-training image to obtain the plurality of training image blocks;
[0147] The plurality of training image blocks are divided into the plurality of training image block sets according to the similarity between each training image block of the plurality of training image blocks.
[0148] Specifically, the similarity between each sub-training image of the plurality of sub-training images and the preset template image satisfies the preset condition. The sub-training image comprises at least one periodically repeated component structure in a horizontal direction or a vertical direction, the preset template image comprises at least one periodically repeated component structure (for example, a pixel unit, etc.) in the horizontal direction or the vertical direction, the periodically repeated component structure in the preset template image is the same as the periodically repeated component structure in the sub-training image, the number of the periodically repeated component structures included in the sub-training image is the same as the number of the periodically repeated component structures included in the preset template image, and the arrangement direction of the periodically repeated component structures in the sub-training image is the same as the arrangement direction of the periodically repeated component structures in the preset template image, for example, both are arranged in the horizontal direction, both are arranged in the vertical direction, etc., so that the similarity between the image content corresponding to the candidate image region and the image content corresponding to the preset template image satisfies the preset condition. In addition, the selection manner of the plurality of training image blocks in the sub-training image is the same as the selection manner of the image block in the plurality of sub-training images, which will not be described here.
[0149] Further, after obtaining the plurality of training image blocks, the similarity between each pair of the training image blocks is calculated, and the training image blocks whose similarity satisfies the preset condition are placed in a training image block set, so that the similarity between any two training image blocks in the training image block set satisfies the preset condition. In an implementation, the process of dividing the plurality of training image blocks into a plurality of training image block sets according to the similarity between each pair of the training image blocks can be: taking the plurality of training image blocks obtained as an image block set, selecting a first image block in the image block set, calculating the similarity between the first image block and the remaining image blocks in the image block set respectively, selecting second image blocks whose similarity satisfies the preset condition, and taking the set of the first image block and the selected second image blocks as a training image block set. However, the process of selecting a first image block in the image block set is continued until there is no training image block in the image block set, so as to obtain a plurality of training image block sets. Of course, in actual application, other ways can also be used to determine the plurality of training image block sets, for example, using a clustering analysis method.
[0150] In an implementation of the embodiment, the preset template image can be determined based on the plurality of training images. Accordingly, before the plurality of sub-training images are selected from the plurality of training panel images based on the preset template image, the method further includes:
[0151] selecting a target panel image from the plurality of training panel images;
[0152] selecting a target sub-image from the target panel image, and taking the target sub-image as the preset template image.
[0153] Specifically, the target panel image can be any image in the plurality of training panel images, or can be an image including at least one periodic structure component in the target panel image, for example, an image including at least one pixel unit, etc. After obtaining the target panel image, the target panel image can be rotated, so that the component extending along the preset direction in the panel image in the target panel image is located in an image region in the rotated target panel image, and the angle between the image region and the preset direction is zero, where the preset direction can be a vertical direction or a horizontal direction, etc.
[0154] After the target panel image after rotation is obtained, a target sub-image is selected in the target panel image. The target sub-image can include one periodic structure component or multiple periodic structure components. In this embodiment, the target sub-image can include multiple periodic structure components, so that the matching error is reduced when the candidate panel image is matched by using the preset template image or the training panel image is matched by using the preset template image. For example, when the preset template image includes one pixel unit, the matching accuracy can reach 1 pixel, and when the preset template image includes four adjacent pixel units, the matching accuracy can reach 0.25 pixel accuracy.
[0155] In an implementation manner of this embodiment, since each training panel image can be obtained by using different cameras, the tilt angles of the panel regions in the training panel images obtained by using different cameras can be different, and the magnifications of the cameras can be different, and the scaling ratios of the training panel images obtained by using different cameras can be different. Therefore, after a plurality of training panel images are obtained, each training panel image can be adjusted based on the preset template image to obtain an adjusted training panel image. Correspondingly, before the plurality of sub-training images are selected in each training panel image based on the preset template image, the method further includes: for each training panel image, taking the training panel image as a to-be-adjusted image; adjusting the to-be-adjusted image based on the preset template image to obtain an adjusted image; and taking the adjusted image as a training panel image, wherein the adjusted image has at least one training image region, and the coincidence degree between the training image region and the preset template image meets a preset condition. The adjustment process of the training panel image is the same as the adjustment process of the candidate panel image, and details are not repeated here.
[0156] In an implementation manner of this embodiment, the determination of the principal component matrix corresponding to each training image block set based on the principal component analysis manner includes the following steps.
[0157] For each training image block set, each training image block in the training image block set is converted into a reference vector.
[0158] Based on all the converted reference vectors, a reference matrix is determined.
[0159] The principal component analysis manner is used to determine a plurality of target vectors corresponding to the reference matrix, and a matrix formed by the plurality of target vectors is taken as the principal component matrix corresponding to the training image block set.
[0160] Specifically, the reference vectors are vector representations of the training image blocks, each vector element in the reference vectors corresponds to a pixel point in the training image blocks, and the number of vector elements included in the reference vectors is equal to the number of pixel points included in the training image blocks. In other words, for each training image block, the training image block is unfolded into a one-dimensional vector, and the one-dimensional vector obtained by unfolding is the reference vector converted from the training image block.
[0161] The image sizes of the training image blocks in the training image block set are the same, in other words, the number of pixel points included in the training image blocks in the training image block set is the same. Correspondingly, the number of vector elements included in the reference vectors converted from the training image blocks is the same, so that after all the reference vectors are obtained, all the reference vectors can form a reference matrix, the number of rows of the reference matrix is equal to the number of vector elements included in the reference vectors, and the number of columns of the reference matrix is equal to the number of reference vectors. For example, the reference vector is a 1*n vector, the number of reference vectors is m, and then a matrix of m*n is obtained.
[0162] The number of the plurality of target vectors is less than the number of the reference vectors, and the number of vector elements included in each target vector in the plurality of target vectors is equal to the number of vector elements included in the reference vectors. After the plurality of target vectors are obtained, a matrix formed by the plurality of target vectors is taken as a principal component matrix corresponding to the training image block set. In this way, the principal component matrix can represent a panel image that meets a preset condition in terms of similarity to the training image blocks, and when a prediction image corresponding to the panel image is determined by the principal component matrix, a defect area in the panel image is repaired, so that the obtained prediction image does not carry the defect area.
[0163] S30, determining a prediction image corresponding to the panel image based on the principal component matrix and the panel image.
[0164] Specifically, the prediction image is an image obtained by repairing the panel image based on the principal component matrix, the prediction image includes image content of the panel image, and a defect area in the panel image is recovered by the principal component matrix, so that the prediction image does not carry the defect area.
[0165] In one implementation manner of the embodiment, the determination of the prediction image corresponding to the panel image based on the principal component matrix and the panel image specifically includes:
[0166] Converting the panel image into an image vector;
[0167] When the panel image does not include a preset panel area of the panel to be detected, determining the prediction image corresponding to the panel image based on a vector product of the image vector and the principal component matrix.
[0168] Specifically, the image vector is a vector representation of the panel image, and a vector dimension of the image vector is equal to a number of pixel points included in the panel image. A conversion process of the image vector is the same as a conversion process of the reference vector, which will not be described herein again, and can be referred to the conversion process of the reference vector.
[0169] The preset panel region includes a panel edge of the panel to be detected and / or a character region in the panel to be detected. It can be understood that the panel region corresponding to the panel image does not include the panel edge of the panel to be detected and / or the character region in the panel to be detected. At this time, as shown in FIG. 2, all pixel points in the panel image can be used to reconstruct the panel image, and the predicted image is obtained by vector multiplication of the image vector and the principal component matrix. Figure 13
[0170] In one implementation manner of the embodiment, the determining, based on the principal component matrix and the panel image, of the predicted image corresponding to the panel image specifically includes:
[0171] converting the panel image into an image vector;
[0172] when the panel image includes a preset panel region of the panel to be detected, obtaining each candidate pixel position included in an image region corresponding to the preset panel region;
[0173] for each candidate pixel position, setting an element item in the image vector corresponding to the candidate pixel position to a preset value to obtain a reference image vector;
[0174] determining, based on the reference image vector, the principal component matrix, and a preset standard image vector, of the predicted image corresponding to the panel image.
[0175] Specifically, when the panel image does not include the preset panel region of the panel to be detected, it is indicated that part of pixel points in the panel image cannot be used to restore the panel image, and thus pixel values of the part of pixel points can be set to a preset value (for example, 0, etc.), and the part of pixel points does not work in principal component analysis. Thus, when the panel image does not include the preset panel region of the panel to be detected, each candidate pixel position of each pixel point included in an image region corresponding to the preset panel region is selected, and pixel values of the selected each candidate pixel position are set to a preset value to obtain a reference image vector.
[0176] In the embodiment, the reference image vector is obtained, and a preset standard image vector corresponding to principal component analysis is obtained, wherein the preset standard image vector is obtained by averaging the reference vectors corresponding to each of the training image blocks in the plurality of training image blocks. After the preset standard image vector is obtained, the panel image is projected to a K-dimensional feature space by using the principal component matrix and the preset standard image vector to obtain a feature matrix, and the predicted image is obtained by inverse transformation of the feature matrix, wherein K is the number of target feature vectors included in the principal component matrix, and K is a positive integer.
[0177] In the embodiment, the panel image is obtained, and a principal component matrix corresponding to the panel image is determined. Then, a predicted image corresponding to the panel image is determined based on the principal component matrix and the panel image. Finally, a defect region in the panel image is identified based on the predicted image and the panel image.
[0178] Specifically, the predicted image is an image obtained by repairing the panel image by using the principal component space, the predicted image includes the image content of the panel image, and the defect region in the panel image is repaired by using the principal component analysis, so that the predicted image does not carry the defect. Based on this, after the predicted image is obtained, the predicted image and the panel image can be matched, the image region in the predicted image that does not match the panel image is selected, and the selected image region is taken as the defect region in the panel image. Correspondingly, the defect region in the panel image is determined based on the panel image and the predicted image, specifically as follows.
[0179] The panel image and the predicted image are matched to determine the unmatched region of the panel image and the predicted image.
[0180] The obtained unmatched region is taken as the defect region in the panel image.
[0181] Specifically, the matching of the panel image and the predicted image means matching the image content of the panel image and the image content of the predicted image, wherein the matching is specifically matching the pixel point of the panel image and the to-be-matched pixel point in the predicted image, wherein the pixel position of the pixel point in the panel image is the same as the pixel position of the to-be-matched pixel point in the predicted image. Any pixel point in the unmatched region, the to-be-matched pixel point corresponding to the pixel point in the predicted image is different from the pixel value of the pixel point.
[0182] In summary, the panel defect detection method provided in the embodiment includes obtaining a panel image to be detected, determining a principal component matrix corresponding to the panel image, determining a predicted image corresponding to the panel image based on the principal component matrix and the panel image, and identifying a defect region in the panel image based on the predicted image and the panel image. In the application, the panel image is reconstructed by using the principal component matrix to obtain the predicted image corresponding to the panel image, and the defect region in the panel image is determined based on the predicted image and the panel image, so that the accuracy of defect detection can be improved.
[0183] Based on the panel defect detection method described above, the embodiment provides a computer readable storage medium, the computer readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the panel defect detection method described in the above embodiment.
[0184] Based on the panel defect detection method described above, the present application further provides a terminal device, as shown in the figure, which includes at least one processor 20, a display screen 21, and a memory 22, and can further include a communications interface 23 and a bus 24. Wherein, the processor 20, the display screen 21, the memory 22 and the communications interface 23 can complete the communication among each other through the bus 24. The display screen 21 is set to display the user guide interface preset in the initial setting mode. The communications interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to execute the method in the above embodiment. Figure 14
[0185] In addition, the logic instructions in the memory 22 described above can be realized in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium.
[0186] The memory 22 as a kind of computer readable storage medium can be set to store software programs, computer executable programs, such as program instructions or modules corresponding to the method in the embodiment of the present disclosure. The processor 20 runs the software program, instruction or module stored in the memory 22, thereby executing function application and data processing, that is, realizing the method in the above embodiment.
[0187] The memory 22 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory. For example, a variety of media that can store program codes, such as U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., can also be a transient storage medium.
[0188] In addition, the specific process of the storage medium and the plurality of instructions in the terminal device loaded and executed by the processor has been described in detail in the above method, which will not be repeated here.
[0189] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the same; although the present application has been described in detail with reference to the foregoing examples, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for detecting panel defects, characterized in that, The method includes: Obtain the panel image to be detected; The principal component matrix corresponding to the panel image is determined, wherein the principal component matrix is determined based on several reference images, and the similarity between each of the several reference images and the panel image satisfies a preset condition; Based on the principal component matrix and the panel image, determine the predicted image corresponding to the panel image; Based on the predicted image and the panel image, identify the defective regions in the panel image; The principal component matrix is included in the principal component matrix set, and determining the principal component matrix corresponding to the panel image specifically includes: Obtain a reference image corresponding to the panel image, wherein the similarity between the reference image and the panel image satisfies a preset condition; Select the principal component matrix corresponding to the control image from the set of principal component matrices, and use the selected principal component matrix as the principal component matrix corresponding to the panel image; The principal component matrix is used to recover panel images whose similarity to the control image meets preset conditions.
2. The panel defect detection method according to claim 1, characterized in that, The acquisition of the panel image to be detected specifically includes: Obtain candidate panel images corresponding to the panel to be detected; The candidate panel image is divided into several sub-images based on a preset template image, wherein the similarity between each sub-image and the preset template image satisfies a preset condition. Select an image patch from several sub-images and use the selected image patch as the panel image to be detected.
3. The panel defect detection method according to claim 1, characterized in that, The process of determining the principal component matrix set includes: Acquire several training panel images, wherein each training panel image in the several training panel images does not carry defect regions; Several training image patch sets are determined based on several training panel images. Each training image patch set in the several training image patch sets includes several training image patches. The similarity between any two training image patches in the several training image patches satisfies a preset condition. Principal component analysis is used to determine the principal component matrix corresponding to each training image patch set, so as to obtain the principal component matrix set.
4. The panel defect detection method according to claim 3, characterized in that, Determining a set of training image patches based on a set of training panel images specifically includes: Select several sub-training images from each training panel image based on a preset template image; For each sub-training image in a plurality of sub-images, a plurality of training image blocks are selected in that sub-training image to obtain a plurality of training image blocks; Several training image patches are divided into several training image patch sets according to their similarity.
5. The panel defect detection method according to claim 4, characterized in that, Before selecting several sub-training images from each training panel image based on a preset template image, the method further includes: Select a target panel image from a number of training panel images; Select a target sub-image from the target panel image and use the target sub-image as a preset template image.
6. The panel defect detection method according to claim 1, 4 or 5, characterized in that, The preset template image includes at least one periodic image region, and when the preset template image is divided into several sub-template images based on the periodic image region, each sub-template image in the several sub-template images includes a periodic image region.
7. The panel defect detection method according to claim 4, characterized in that, Before selecting several sub-training images from each training panel image based on a preset template image, the method further includes: For each training panel image, use that training panel image as the image to be adjusted; The image to be adjusted is adjusted based on the preset template image to obtain the adjusted image; The adjusted image is used as a training panel image, wherein the adjusted image has at least one training image region, and the overlap between the training image region and the preset template image satisfies a preset condition.
8. The panel defect detection method according to claim 3, characterized in that, The process of determining the principal component matrix corresponding to each training image patch set based on principal component analysis to obtain the principal component matrix set specifically includes: For each set of training image patches, each training image patch in that set is converted into a reference vector; Based on all the reference vectors obtained from the transformation, determine the reference matrix; Principal component analysis is used to determine several target vectors corresponding to the reference matrix, and the matrix formed by these target vectors is used as the principal component matrix corresponding to the training image patch set.
9. The panel defect detection method according to claim 2, characterized in that, Before dividing the candidate panel image into several sub-images based on the preset template image, the method further includes: The candidate panel image is used as the image to be adjusted. The image to be adjusted is adjusted based on the preset template image to obtain the adjusted image; The adjusted image is used as a candidate panel image, wherein the adjusted image has at least one candidate image region, and the overlap between the candidate image region and the preset template image satisfies a preset condition.
10. The panel defect detection method according to claim 7 or 9, characterized in that, The process of adjusting the image to be adjusted based on the preset template image to obtain the adjusted image specifically includes: Based on the preset template image, a candidate image region is selected in the image to be adjusted, wherein the similarity between the image content corresponding to the candidate image region and the image content corresponding to the preset template image satisfies a preset condition. The adjustment parameters corresponding to the image to be adjusted are determined based on the candidate image region, wherein the adjustment parameters include rotation parameters and scaling parameters; The image to be adjusted is adjusted based on the adjustment parameters to obtain the adjusted image.
11. The panel defect detection method according to claim 10, characterized in that, The step of determining the adjustment parameters corresponding to the image to be adjusted based on the candidate image region specifically includes: Based on the candidate image regions, several comparison image regions are selected from the image to be adjusted; Obtain the target pixel elements corresponding to each of the several reference image regions, and determine the rotation parameters corresponding to the image to be adjusted based on the connection of the target pixel elements; Based on the image size of the candidate image region and the image size of the preset template image, the scaling parameters corresponding to the image to be adjusted are determined to obtain the adjustment parameters corresponding to the image to be adjusted.
12. The panel defect detection method according to claim 10, characterized in that, The step of determining the adjustment parameters corresponding to the image to be adjusted based on the candidate image region specifically includes: Identify linear regions within the candidate image regions; Obtain the angle between the linear region and the preset direction, and determine the rotation parameters corresponding to the image to be adjusted based on the angle; Based on the image size of the candidate image region and the image size of the preset template image, the scaling parameters corresponding to the image to be adjusted are determined to obtain the adjustment parameters corresponding to the image to be adjusted.
13. The panel defect detection method according to claim 1, characterized in that, The step of determining the predicted image corresponding to the panel image based on the principal component matrix and the panel image specifically includes: The panel image is converted into an image vector, wherein the vector dimension of the image vector is equal to the number of pixels included in the panel image; When the panel image does not include the preset panel area of the panel to be detected, the predicted image corresponding to the panel image is determined based on the vector product of the image vector and the principal component matrix, wherein the preset panel area includes the panel edge of the panel to be detected and / or the text area in the panel to be detected.
14. The panel defect detection method according to claim 1, characterized in that, The step of determining the predicted image corresponding to the panel image based on the principal component matrix and the panel image specifically includes: The panel image is converted into an image vector, wherein the vector dimension of the image vector is equal to the number of pixels included in the panel image; When the panel image includes a preset panel area of the panel to be detected, the positions of each candidate pixel in the image area corresponding to the preset panel area are obtained, wherein the preset panel area includes the panel edge of the panel to be detected and / or the text area in the panel to be detected. For each candidate pixel location, the element corresponding to that candidate pixel location in the image vector is set to a preset value to obtain a reference image vector; Based on the reference image vector, principal component matrix, and preset standard image vector, the predicted image corresponding to the panel image is determined.
15. The panel defect detection method according to claim 1, characterized in that, Specifically, determining the defect region in the panel image based on the panel image and the predicted image involves: The panel image is matched with the predicted image to determine the mismatched areas between the panel image and the predicted image; The mismatched areas are identified as defective areas in the panel image.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the panel defect detection method as described in any one of claims 1-15.
17. A terminal device, characterized in that, include: Processor, memory, and communication bus; the memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it implements the steps in the panel defect detection method as described in any one of claims 1-15.
Citation Information
Patent Citations
Mura defect detection method based on sample learning and human visual characteristics
CN106650770A