Screen image defect type identification method based on vector similarity and related device

By obtaining the reference screen image of the touch screen to be detected and the type of defects marked, and using sparse dictionary and vector similarity algorithms to build defect space, the accuracy of manual recognition in touch screen defect detection is solved, and more efficient defect type recognition is achieved.

CN120495208APending Publication Date: 2025-08-15CHONGQING YOUTH VOCATIONAL & TECH COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510563196.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, touch screen defect detection relies on manual identification, resulting in repeated detection and missed detection, and has low accuracy.

Method used

By obtaining reference screen images of the touch screen to be detected and the type of defects marked, eigenvectors are extracted using sparse dictionary, defect types are identified using vector similarity algorithms, and defect space is constructed to improve accuracy.

Benefits of technology

It improves the accuracy of touch screen defect type recognition, reduces the error of manual detection, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495208A_ABST
    Figure CN120495208A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the field of image processing, and provides a screen image defect type identification method based on vector similarity, and the method comprises the steps: obtaining a screen image corresponding to a to-be-detected touch screen, obtaining a to-be-detected screen image, obtaining K reference screen images, and obtaining K reference screen images, obtaining a reference screen image set, obtaining feature vectors corresponding to the reference screen images in the reference screen image set according to a preset sparse dictionary, obtaining a reference feature vector set, extracting defect feature vectors in the to-be-detected screen image, obtaining a first target feature vector, and obtaining a second target feature vector; according to the reference feature vectors in the reference feature vector set, using a vector similarity algorithm to obtain a defect type corresponding to the first target feature vector, and obtaining a target defect type, thereby improving the accuracy of performing defect type identification on the to-be-detected screen image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a device related to a method for identifying screen image defect types based on vector similarity. Background Art

[0002] The touch screen production process is quite complicated. Due to mechanical errors, environment and manual operation, each production process will inevitably produce various defects. Different defects may occur in each link. For different types of defects, some defects are organic, such as scratches, cracks, glass inclusions, edge collapse, etc. Once these defects occur, the product is unqualified and cannot be repaired; while defects such as dirt, dust, fingerprints, etc. are non-organic and can be removed by cleaning, wiping, etc. Therefore, it is necessary to detect and identify various defects of the touch screen to reduce the cost of touch screen production.

[0003] In the existing solutions, most touch screen manufacturers still rely on manual inspection, which determines whether the touch screen has defects based on empirical values or comparison tables. This requires a large amount of data comparison. When performing a large amount of data comparison, manual inspection may also result in repeated inspections and missed inspections, resulting in low accuracy in identifying the defect type of the touch screen image. Summary of the Invention

[0004] The embodiments of the present application provide a method and related apparatus for identifying screen image defect types based on vector similarity, which can improve the accuracy of defect type identification for a screen image to be inspected.

[0005] A first aspect of an embodiment of the present application provides a method for identifying screen image defect types based on vector similarity, the method comprising:

[0006] Acquire a screen image corresponding to the touch screen to be detected, to obtain the screen image to be detected, wherein the touch screen to be detected is a touch screen with defects;

[0007] Acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are screen images with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types;

[0008] Acquire feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary to obtain a reference feature vector set;

[0009] Extracting a defect feature vector from the screen image to be inspected to obtain a first target feature vector;

[0010] A vector similarity algorithm is used according to the reference feature vectors in the reference feature vector set to obtain the defect type corresponding to the first target feature vector, thereby obtaining a target defect type.

[0011] In this example, the screen image to be detected is obtained by obtaining a screen image corresponding to the touch screen to be detected, wherein the touch screen to be detected is a touch screen with defects, K reference screen images are obtained to obtain a reference screen image set, wherein the reference screen image is a screen image with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types. According to a preset sparse dictionary, feature vectors corresponding to the reference screen images in the reference screen image set are obtained to obtain a reference feature vector set, the defect feature vectors in the screen image to be detected are extracted to obtain a first target feature vector, and a vector similarity algorithm is used according to the reference feature vectors in the reference feature vector set to obtain the defect type corresponding to the first target feature vector to obtain a target defect type, thereby improving the accuracy of defect type identification for the screen image to be detected.

[0012] In one possible implementation, a method for obtaining a reference feature vector set by obtaining feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary includes:

[0013] performing binarization and denoising on the reference screen images in the reference screen image set to obtain a first reference screen image set;

[0014] Constructing a pixel matrix corresponding to each first reference screen image in the first reference screen image set to obtain a first pixel matrix set;

[0015] Extracting sparse matrices corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set;

[0016] The second pixel matrices in the second pixel matrix set are converted into vectors to obtain a reference feature vector set.

[0017] In one possible implementation, a method for extracting a sparse matrix corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set includes:

[0018] constructing an optimization function corresponding to each first pixel matrix in the first pixel matrix set according to the preset sparse dictionary and the first pixel matrices in the first pixel matrix set to obtain a target optimization function set;

[0019] Iteratively solving the optimal solution corresponding to each objective optimization function in the objective optimization function set to obtain an objective function value set;

[0020] A sparse matrix corresponding to each objective function value in the objective function value set is obtained to obtain a second pixel matrix set.

[0021] In one possible implementation, a method for obtaining a target defect type by using a vector similarity algorithm to obtain a defect type corresponding to the first target feature vector based on a reference feature vector in the reference feature vector set includes:

[0022] constructing a feature vector space based on the reference feature vectors in the reference feature vector set to obtain a target defect space;

[0023] Using a vector similarity algorithm according to the target defect space, obtaining a reference feature vector that is most similar to the first target feature vector, to obtain a target reference feature vector;

[0024] Obtaining a defect type corresponding to the target reference feature vector to obtain a first defect type;

[0025] The first defect type is determined as the defect type corresponding to the first target feature vector to obtain a target defect type.

[0026] In one possible implementation, a method for constructing a feature vector space based on reference feature vectors in the reference feature vector set to obtain a target defect space includes:

[0027] Obtaining dimension information corresponding to a reference feature vector in the reference feature vector set to obtain a first dimension information set;

[0028] Obtain the first dimension information with the largest value in the first dimension information set to obtain the target dimension information;

[0029] Constructing a reference feature matrix according to the target dimension information and the reference feature vectors in the reference feature vector set to obtain a first reference feature matrix, wherein the rank corresponding to the first reference feature matrix is the same as the target dimension information;

[0030] Obtaining a covariance matrix corresponding to the first reference feature matrix to obtain a target covariance matrix;

[0031] Obtaining the eigenvalues corresponding to the target covariance matrix to obtain target eigenvalues;

[0032] Performing eigendecomposition on the target eigenvalue to obtain M basis vectors, where M is equal to the target dimension information;

[0033] Constructing an M-dimensional feature space according to the M basis vectors to obtain a first defect space;

[0034] The reference eigenvectors in the reference eigenvector matrix are filled into the first defect space according to their corresponding first dimension information to obtain a target defect space.

[0035] A second aspect of an embodiment of the present application provides a device for identifying screen image defect types based on vector similarity, the device comprising:

[0036] A first acquiring unit is configured to acquire a screen image corresponding to the touch screen to be detected, to obtain the screen image to be detected, wherein the touch screen to be detected is a touch screen with a defect;

[0037] a second acquiring unit, configured to acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are screen images with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types;

[0038] A construction unit, configured to obtain feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary, to obtain a reference feature vector set;

[0039] an extraction unit, configured to extract a defect feature vector from the screen image to be detected to obtain a first target feature vector;

[0040] The matching unit is configured to obtain a defect type corresponding to the first target feature vector by using a vector similarity algorithm according to the reference feature vectors in the reference feature vector set, thereby obtaining a target defect type.

[0041] In one possible implementation, the construction unit is specifically configured to:

[0042] performing binarization and denoising on the reference screen images in the reference screen image set to obtain a first reference screen image set;

[0043] Constructing a pixel matrix corresponding to each first reference screen image in the first reference screen image set to obtain a first pixel matrix set;

[0044] Extracting sparse matrices corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set;

[0045] The second pixel matrices in the second pixel matrix set are converted into vectors to obtain a reference feature vector set.

[0046] In one possible implementation, the construction unit is specifically configured to:

[0047] constructing an optimization function corresponding to each first pixel matrix in the first pixel matrix set according to the preset sparse dictionary and the first pixel matrices in the first pixel matrix set to obtain a target optimization function set;

[0048] Iteratively solving the optimal solution corresponding to each objective optimization function in the objective optimization function set to obtain an objective function value set;

[0049] A sparse matrix corresponding to each objective function value in the objective function value set is obtained to obtain a second pixel matrix set.

[0050] In one possible implementation, the matching unit is specifically configured to:

[0051] constructing a feature vector space based on the reference feature vectors in the reference feature vector set to obtain a target defect space;

[0052] Using a vector similarity algorithm according to the target defect space, obtaining a reference feature vector that is most similar to the first target feature vector, to obtain a target reference feature vector;

[0053] Obtaining a defect type corresponding to the target reference feature vector to obtain a first defect type;

[0054] The first defect type is determined as the defect type corresponding to the first target feature vector to obtain a target defect type.

[0055] In one possible implementation, the matching unit is specifically configured to:

[0056] Obtaining dimension information corresponding to a reference feature vector in the reference feature vector set to obtain a first dimension information set;

[0057] Obtain the first dimension information with the largest value in the first dimension information set to obtain the target dimension information;

[0058] Constructing a reference feature matrix according to the target dimension information and the reference feature vectors in the reference feature vector set to obtain a first reference feature matrix, wherein the rank corresponding to the first reference feature matrix is the same as the target dimension information;

[0059] Obtaining a covariance matrix corresponding to the first reference feature matrix to obtain a target covariance matrix;

[0060] Obtaining the eigenvalues corresponding to the target covariance matrix to obtain target eigenvalues;

[0061] Performing eigendecomposition on the target eigenvalue to obtain M basis vectors, where M is equal to the target dimension information;

[0062] Constructing an M-dimensional feature space according to the M basis vectors to obtain a first defect space;

[0063] The reference eigenvectors in the reference eigenvector matrix are filled into the first defect space according to their corresponding first dimension information to obtain a target defect space.

[0064] A third aspect of an embodiment of the present application provides a terminal, comprising a processor, an input device, an output device, and a memory, wherein the processor, input device, output device, and memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions and execute the step instructions in the first aspect of the embodiment of the present application.

[0065] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application.

[0066] A fifth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0068] Figure 1 A flowchart of a method for identifying screen image defect types based on vector similarity is provided for an embodiment of the present application;

[0069] Figure 2 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0070] Figure 3 A structural schematic diagram of a screen image defect type identification device based on vector similarity is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0072] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0073] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0074] To better understand the screen image defect type identification method based on vector similarity provided by the embodiments of the present application, we first briefly introduce the existing touch screen image defect detection methods. In existing solutions, most touch screen manufacturers still rely on manual inspection, manually judging whether the touch screen has defects based on empirical values or comparison tables. This requires a large amount of data comparison. When performing a large amount of data comparison, manual inspection may also result in duplicate detection and missed detection, resulting in low accuracy in identifying the defect type of the touch screen image.

[0075] In order to solve the above technical problems, an embodiment of the present application provides a method for identifying screen image defect types based on vector similarity. The method can obtain the defect features in the reference screen image and construct a defect space to obtain a target defect space. The reference feature vector that is most similar to the first target defect feature vector in the screen image to be detected is obtained in the target defect space through a vector similarity algorithm, and the defect type corresponding to the reference feature vector is determined as the defect type of the screen image to be detected to obtain the target defect type, thereby completing the screen image defect type identification of the screen image to be detected and improving the accuracy in identifying the defect type of the screen image to be detected.

[0076] See also Figure 1 , Figure 1 The present invention provides a flowchart of a method for identifying screen image defect types based on vector similarity. Figure 1 As shown, the method includes:

[0077] 101. Acquire a screen image corresponding to a touch screen to be detected, to obtain a screen image to be detected, wherein the touch screen to be detected is a touch screen with defects.

[0078] The screen image to be detected may be obtained by collecting the screen image of the touch screen to be detected through a universal image collecting device.

[0079] 102. Acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are defective screen images marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types.

[0080] Specifically, it can be achieved by obtaining product information of the touch screen to be detected, such as the specific model of the touch screen to be detected, the screen size of the touch screen to be detected, etc., and obtaining K and a reference screen image in a preset reference screen image database according to the product information of the touch screen to be detected to obtain a reference screen image set. The screen images in the preset reference screen image database are touch screen images of various defective models, and each screen image in the preset reference screen image database is marked with the corresponding product information of the touch screen and the defect type.

[0081] 103. Acquire feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary to obtain a reference feature vector set.

[0082] Specifically, the reference screen images in the reference screen image set may be binarized and denoised to obtain a first reference screen image set, a pixel matrix corresponding to the first reference screen image in the first reference screen image set may be obtained to obtain a first pixel matrix set, sparse matrices in each first pixel matrix in the first pixel matrix set may be extracted according to the preset sparse dictionary to obtain a second pixel matrix set, and the second pixel matrix in the second pixel matrix set may be converted into a vector to obtain a reference feature vector set.

[0083] 104. Extract the defect feature vector in the screen image to be detected to obtain a first target feature vector.

[0084] This can be done by binarizing and denoising the screen image to be detected to obtain a first screen image to be detected, obtaining a pixel matrix corresponding to the first screen image to be detected to obtain a third matrix, extracting a sparse matrix in the third matrix through a preset sparse dictionary to obtain a fourth pixel matrix, converting the fourth pixel matrix into a vector to obtain a first target feature vector.

[0085] 105. Use a vector similarity algorithm based on the reference feature vectors in the reference feature vector set to obtain the defect type corresponding to the first target feature vector to obtain a target defect type.

[0086] Specifically, a feature vector space is constructed based on the reference feature vectors in the reference feature vector set to obtain a target defect space, a reference feature vector that is most similar to the first target feature vector is obtained using a vector similarity algorithm based on the target defect space to obtain a target reference feature vector, and the defect type corresponding to the target reference feature vector is determined as the defect type corresponding to the screen image to be detected to obtain a target defect type.

[0087] In this example, the screen image to be detected is obtained by obtaining a screen image corresponding to the touch screen to be detected, wherein the touch screen to be detected is a touch screen with defects, K reference screen images are obtained to obtain a reference screen image set, wherein the reference screen image is a screen image with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types. According to a preset sparse dictionary, feature vectors corresponding to the reference screen images in the reference screen image set are obtained to obtain a reference feature vector set, the defect feature vectors in the screen image to be detected are extracted to obtain a first target feature vector, and a vector similarity algorithm is used according to the reference feature vectors in the reference feature vector set to obtain the defect type corresponding to the first target feature vector to obtain a target defect type, thereby improving the accuracy of defect type identification for the screen image to be detected.

[0088] In one possible implementation, a method for obtaining a reference feature vector set by obtaining feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary includes:

[0089] A1. performing binarization and denoising on the reference screen images in the reference screen image set to obtain a first reference screen image set;

[0090] A2. Construct a pixel matrix corresponding to each first reference screen image in the first reference screen image set to obtain a first pixel matrix set;

[0091] A3. Extracting sparse matrices corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set;

[0092] A4. Convert the second pixel matrices in the second pixel matrix set into vectors to obtain a reference feature vector set;

[0093] Specifically, the reference screen images in the reference screen image set may be binarized and denoised using a general binarization method and a general denoising method to obtain the first reference screen image set.

[0094] After obtaining the first reference screen image set, a pixel matrix corresponding to the first reference screen image in the first reference screen image set may be constructed using a general image pixel matrix construction method to obtain a first pixel matrix set.

[0095] After obtaining the first pixel matrix set, it is possible to construct an optimization function corresponding to each first pixel matrix in the first pixel matrix set based on the preset sparse dictionary and the first pixel matrix in the first pixel matrix set to obtain a target optimization function set, use an iterative method to solve the optimal solution of the target optimization function to obtain a target function value set, obtain a sparse matrix corresponding to the target function value in the target function value set, and obtain a second pixel matrix set.

[0096] After obtaining the second pixel matrix set, the second pixel matrices in the second pixel matrix set may be converted into vectors using a general vector matrix conversion method to obtain a reference feature vector set.

[0097] In one possible implementation, a method for extracting a sparse matrix corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set includes:

[0098] B1. constructing an optimization function corresponding to each first pixel matrix in the first pixel matrix set according to the preset sparse dictionary and the first pixel matrices in the first pixel matrix set to obtain a target optimization function set;

[0099] B2. Iteratively solving the optimal solution corresponding to each target optimization function in the target optimization function set to obtain a target function value set;

[0100] B3. Obtain a sparse matrix corresponding to each objective function value in the objective function value set to obtain a second pixel matrix set.

[0101] Since industrial products such as touch screens have regular textures, when defects appear on the touch screen, the defects will destroy the regular texture of the touch, causing the image corresponding to the defect to destroy the low rank of the defect-free touch screen image, thereby resulting in sparsity. Therefore, the defect-free part of the reference screen image can be used as the background part of the reference screen image, and the defective part of the reference screen image can be used as the foreground part of the reference screen image, thereby converting the defect extraction problem of the reference screen image into the problem of separating the foreground and background of the reference screen image.

[0102] Specifically, the optimization function corresponding to each first pixel matrix in the first pixel matrix set can be constructed by minimizing the norm to obtain a target optimization function set. The mathematical expression of the target optimization function in the target optimization function set is as follows:

[0103]

[0104] Where L(A) is the function value corresponding to the objective function in the objective function set; X represents the first pixel matrix in the first pixel matrix set; D represents the preset sparse dictionary; A represents the sparse matrix in the first pixel matrix to be solved; || || F represents the Frobenius norm; λ represents the regularization parameter in the objective function, which can be determined by user input or system default; || ||1 represents the l1 norm.

[0105] After obtaining the objective function set, the objective function A can be initialized to obtain an initialized sparse matrix; the gradient value of the objective function is calculated according to the initialized sparse matrix, the first pixel matrix in the first pixel matrix set and the preset sparse dictionary to obtain a first gradient value; the initialized sparse matrix is updated according to the first gradient value to obtain an updated sparse matrix; the optimization model is calculated according to the updated sparse matrix to determine whether it meets the preset convergence condition. If the preset convergence condition is met, the function value of L(A) is output to obtain the objective function value. If the preset convergence condition is not met, the gradient value of the objective function value is recalculated according to the updated sparse matrix, and the first sparse matrix is updated according to the recalculated gradient value until the updated sparse matrix meets the preset convergence condition, and the function value of the objective function at this time is output to obtain the objective function value; the objective function value corresponding to each objective function value in the objective function value set is obtained to obtain the objective function value set. Wherein, the mathematical expression of the preset convergence condition is: ‖A t+1 -A t || F <∈,A t A represents the updated sparse matrix output by the optimization model at the t-1 iteration; t+1The updated sparse matrix output by the optimization model at t iterations; ∈ represents the convergence threshold, which is a small positive number that can be determined by user input or system default.

[0106] Specifically, the gradient value of the objective function may be calculated according to the initialized sparse matrix, the first pixel matrix in the first pixel matrix set, and a preset sparse dictionary to obtain a first gradient value; and the initialized sparse matrix may be updated according to the first gradient value to obtain a first sparse matrix:

[0107]

[0108] Where t represents the number of iterations of the optimization model; represents the gradient value of the objective function when the optimization model is iterated t times; D represents the preset sparse dictionary; D T represents the transposed matrix of the preset sparse dictionary; X represents the first pixel matrix in the first pixel matrix set; A t A represents the updated sparse matrix output by the optimization model at the t-1 iteration; t+1 The updated sparse matrix output by the optimization model at t iterations; soft(.,.) represents the soft threshold function; α represents the step size parameter, which is a constant and can be determined by user input or system default; λ represents the regularization parameter in the objective function and can be determined by user input or system default.

[0109] After obtaining the objective function value set, the second pixel matrix set may be obtained by acquiring the updated sparse matrix used when calculating each objective function value in the objective function value set.

[0110] In this example, by constructing an objective function and using an iterative method to solve the sparse matrix in each first pixel matrix, the accuracy of obtaining the sparse matrix in the first pixel matrix is improved, thereby improving the accuracy of defect type identification for the screen image to be inspected.

[0111] In one possible implementation, a method for obtaining a target defect type by using a vector similarity algorithm to obtain a defect type corresponding to the first target feature vector based on a reference feature vector in the reference feature vector set includes:

[0112] C1. constructing a feature vector space based on the reference feature vectors in the reference feature vector set to obtain a target defect space;

[0113] C2. Using a vector similarity algorithm according to the target defect space, obtain a reference feature vector that is most similar to the first target feature vector to obtain a target reference feature vector;

[0114] C3. Obtain the defect type corresponding to the target reference feature vector to obtain a first defect type;

[0115] C4. Determine the first defect type as the defect type corresponding to the first target feature vector to obtain a target defect type.

[0116] It can be achieved by obtaining the dimensional information corresponding to each reference eigenvector in the reference eigenvector set to obtain a first dimensional information set; constructing a feature matrix based on the first dimensional information in the first dimensional information set and the reference eigenvector in the reference eigenvector set to obtain a first reference feature matrix; determining M basis vectors based on the first reference feature matrix; and constructing a feature vector space based on the M basis vectors and the reference eigenvector in the reference eigenvector set to obtain a target defect space.

[0117] After obtaining the target defect space, the first target feature vector can be vector-decomposed in the direction of M basis vectors by a general vector decomposition method to obtain M first sub-target feature vectors; the similarity between each first sub-target feature vector and each defect feature vector in the target defect space can be calculated using a vector similarity algorithm to obtain M first similarity sets; the first similarity with the smallest value in the M first similarity sets can be obtained to obtain a target similarity set; the defect feature vector corresponding to each target similarity in the target similarity set can be obtained to obtain a target defect feature vector set; the target defect feature vectors in the target defect feature vector set can be vector-combined by a general vector combination method to obtain a target reference feature vector.

[0118] Specifically, the similarity between each first sub-target feature vector and each defect feature vector in the target defect space can be calculated by the method shown in the following formula to obtain M first similarity sets:

[0119]

[0120] Where sim(B,C) represents the first similarity in the M first similarity sets; B represents the M first sub-target feature vectors; b i represents the first sub-target feature vector corresponding to the i-th dimension information in the M first sub-target feature vectors; C represents the target defect space; c j Represents the defect feature vector corresponding to the jth dimension in the target defect space.

[0121] After obtaining the target reference feature vector, the first defect type may be obtained by acquiring the defect type corresponding to the target reference feature vector, and the first defect type may be determined as the defect type corresponding to the first target feature vector to obtain the target defect type.

[0122] In this example, a target defect space is obtained by constructing a defect space; the first target feature vector is decomposed in the direction of M basis vectors to obtain M first sub-target feature vectors; a vector similarity algorithm is used to calculate the similarity between each first sub-target feature vector and each defect feature vector in the target defect space to obtain M first similarity sets; thereby, similarity calculations can be performed on the first target feature vector in different dimensions, which improves the efficiency of obtaining the target reference feature vector and thereby improves the accuracy in defect type identification of the screen image to be inspected.

[0123] In one possible implementation, a method for constructing a feature vector space based on reference feature vectors in the reference feature vector set to obtain a target defect space includes:

[0124] D1. Obtain dimension information corresponding to the reference feature vector in the reference feature vector set to obtain a first dimension information set;

[0125] D2. Obtain the first dimension information with the largest value in the first dimension information set to obtain the target dimension information;

[0126] D3. Construct a reference feature matrix based on the target dimension information and the reference feature vectors in the reference feature vector set to obtain a first reference feature matrix, wherein the rank corresponding to the first reference feature matrix is the same as the target dimension information;

[0127] D4. Obtain a covariance matrix corresponding to the first reference feature matrix to obtain a target covariance matrix;

[0128] D5. Obtain the eigenvalue corresponding to the target covariance matrix to obtain the target eigenvalue;

[0129] D6. Perform eigendecomposition on the target eigenvalue to obtain M basis vectors, where M is equal to the target dimension information;

[0130] D7. Construct an M-dimensional feature space based on the M basis vectors to obtain a first defect space;

[0131] D8. Fill the reference eigenvectors in the reference eigenvector matrix into the first defect space according to their corresponding first dimensional information to obtain a target defect space.

[0132] The first dimensional information set may be obtained by obtaining dimensional information corresponding to the reference feature vectors in the reference feature vector set through a general dimensional information acquisition method.

[0133] After obtaining the first dimensional information set, the target dimensional information may be obtained by acquiring the first dimensional information with the largest value in the first dimensional information set.

[0134] A reference feature matrix is constructed using a general feature matrix construction method based on the target dimension information and the reference feature vectors in the reference feature vector set to obtain a first reference feature matrix. Each row in the first reference feature matrix corresponds to a reference feature vector; each column in the first reference feature matrix corresponds to a first dimension information; and the last column of the first reference feature matrix corresponds to the target dimension information.

[0135] After obtaining the first reference feature matrix, the covariance matrix corresponding to the first reference feature matrix can be obtained by a general covariance matrix acquisition method to obtain a target covariance matrix; and the eigenvalues corresponding to the target covariance matrix are calculated to obtain target eigenvalues.

[0136] Because the covariance matrix is a symmetric matrix, the eigenvectors obtained by performing eigendecomposition on the image's feature matrix can be used as a feature representation of the image. Therefore, the target eigenvalues can be eigendecomposed using a common eigendecomposition method to obtain M basis vectors. These M basis vectors serve as the basis of a multidimensional feature space to construct an M-dimensional feature space, thereby obtaining a first defect space.

[0137] After obtaining the first defect space, each reference feature vector in the reference feature vector set can be decomposed in the direction of M basis vectors to obtain M defect feature vector sets; the defect feature vectors in the M defect feature vector sets are filled into the first defect space according to their corresponding first dimension information to obtain the target defect space.

[0138] In this example, a target eigenvalue is obtained by constructing a feature matrix corresponding to the reference eigenvectors in the reference eigenvector set and calculating the eigenvalues of the covariance matrix of the feature matrix. The target eigenvalue is then decomposed into M basis vectors, so that each basis vector can represent a feature representation in the screen image. Each reference eigenvector in the reference eigenvector set is eigen-decomposed in the direction of the M basis vectors to obtain a set of M defect feature vectors. A defect space is then constructed based on the defect features in the M defect feature vector sets to obtain a target defect space. This allows the linear representation of the defect feature vectors in the target defect space to accurately represent the defect type marked in each reference screen image, such as scratches, cracks, deformations, edge damage, or cut corners. This improves the accuracy of the obtained target defect space, and in turn improves the accuracy of defect type identification in the screen image to be inspected.

[0139] For the same example as above, please refer to Figure 2 , Figure 2 A schematic diagram of the structure of a terminal provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the system comprises a processor, an input device, an output device and a memory, which are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions, and the program includes instructions for executing the following steps;

[0140] Acquire a screen image corresponding to the touch screen to be detected, to obtain the screen image to be detected, wherein the touch screen to be detected is a touch screen with defects;

[0141] Acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are screen images with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types;

[0142] Acquire feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary to obtain a reference feature vector set;

[0143] Extracting a defect feature vector from the screen image to be inspected to obtain a first target feature vector;

[0144] A vector similarity algorithm is used according to the reference feature vectors in the reference feature vector set to obtain the defect type corresponding to the first target feature vector, thereby obtaining a target defect type.

[0145] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to implement the above functions, the terminal includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment provided in this document, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0146] The embodiment of the present application can divide the terminal into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.

[0147] In line with the above, please see Figure 3 , Figure 3 The present invention provides a schematic diagram of a device for identifying screen image defect types based on vector similarity. Figure 3 As shown, the device includes:

[0148] The first acquiring unit 301 is configured to acquire a screen image corresponding to a touch screen to be detected, where the touch screen to be detected is a touch screen with a defect;

[0149] A second acquiring unit 302 is configured to acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are screen images with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types;

[0150] A construction unit 303 is configured to obtain feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary to obtain a reference feature vector set;

[0151] An extraction unit 304 is configured to extract a defect feature vector from the screen image to be detected to obtain a first target feature vector;

[0152] The matching unit 305 is configured to obtain the defect type corresponding to the first target feature vector by using a vector similarity algorithm according to the reference feature vectors in the reference feature vector set, thereby obtaining a target defect type.

[0153] In a possible implementation, the construction unit 303 is specifically configured to:

[0154] performing binarization and denoising on the reference screen images in the reference screen image set to obtain a first reference screen image set;

[0155] Constructing a pixel matrix corresponding to each first reference screen image in the first reference screen image set to obtain a first pixel matrix set;

[0156] Extracting sparse matrices corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set;

[0157] The second pixel matrices in the second pixel matrix set are converted into vectors to obtain a reference feature vector set.

[0158] In a possible implementation, the construction unit 303 is specifically configured to:

[0159] constructing an optimization function corresponding to each first pixel matrix in the first pixel matrix set according to the preset sparse dictionary and the first pixel matrices in the first pixel matrix set to obtain a target optimization function set;

[0160] Iteratively solving the optimal solution corresponding to each objective optimization function in the objective optimization function set to obtain an objective function value set;

[0161] A sparse matrix corresponding to each objective function value in the objective function value set is obtained to obtain a second pixel matrix set.

[0162] In a possible implementation, the matching unit 305 is specifically configured to:

[0163] constructing a feature vector space based on the reference feature vectors in the reference feature vector set to obtain a target defect space;

[0164] Using a vector similarity algorithm according to the target defect space, obtaining a reference feature vector that is most similar to the first target feature vector, to obtain a target reference feature vector;

[0165] Obtaining a defect type corresponding to the target reference feature vector to obtain a first defect type;

[0166] The first defect type is determined as the defect type corresponding to the first target feature vector to obtain a target defect type.

[0167] In a possible implementation, the matching unit 305 is specifically configured to:

[0168] Obtaining dimension information corresponding to a reference feature vector in the reference feature vector set to obtain a first dimension information set;

[0169] Obtain the first dimension information with the largest value in the first dimension information set to obtain the target dimension information;

[0170] Constructing a reference feature matrix according to the target dimension information and the reference feature vectors in the reference feature vector set to obtain a first reference feature matrix, wherein the rank corresponding to the first reference feature matrix is the same as the target dimension information;

[0171] Obtaining a covariance matrix corresponding to the first reference feature matrix to obtain a target covariance matrix;

[0172] Obtaining the eigenvalues corresponding to the target covariance matrix to obtain target eigenvalues;

[0173] Performing eigendecomposition on the target eigenvalue to obtain M basis vectors, where M is equal to the target dimension information;

[0174] Constructing an M-dimensional feature space according to the M basis vectors to obtain a first defect space;

[0175] The reference eigenvectors in the reference eigenvector matrix are filled into the first defect space according to their corresponding first dimension information to obtain a target defect space.

[0176] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the screen image defect type identification methods based on vector similarity as described in the above method embodiments.

[0177] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program enables a computer to execute part or all of the steps of any one of the screen image defect type identification methods based on vector similarity as recorded in the above method embodiments.

[0178] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0179] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0180] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0181] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0182] In addition, the functional units in the various embodiments of the application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software program modules.

[0183] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0184] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which may include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.

[0185] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for identifying screen image defect types based on vector similarity, characterized in that: The method comprises: Acquire a screen image corresponding to the touch screen to be detected, to obtain the screen image to be detected, wherein the touch screen to be detected is a touch screen with defects; Acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are screen images with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types; Acquire feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary to obtain a reference feature vector set; Extracting a defect feature vector from the screen image to be inspected to obtain a first target feature vector; A vector similarity algorithm is used according to the reference feature vectors in the reference feature vector set to obtain the defect type corresponding to the first target feature vector, thereby obtaining a target defect type.

2. The method for identifying screen image defect types based on vector similarity according to claim 1, characterized in that: The acquiring, according to a preset sparse dictionary, feature vectors corresponding to the reference screen images in the reference screen image set to obtain a reference feature vector set includes: performing binarization and denoising on the reference screen images in the reference screen image set to obtain a first reference screen image set; Constructing a pixel matrix corresponding to each first reference screen image in the first reference screen image set to obtain a first pixel matrix set; Extracting sparse matrices corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set; The second pixel matrices in the second pixel matrix set are converted into vectors to obtain a reference feature vector set.

3. The method for identifying screen image defect types based on vector similarity according to claim 2, characterized in that: The extracting, according to a preset sparse dictionary, sparse matrices corresponding to the respective first pixel matrices in the first pixel matrix set to obtain a second pixel matrix set includes: constructing an optimization function corresponding to each first pixel matrix in the first pixel matrix set according to the preset sparse dictionary and the first pixel matrices in the first pixel matrix set to obtain a target optimization function set; Iteratively solving the optimal solution corresponding to each objective optimization function in the objective optimization function set to obtain an objective function value set; A sparse matrix corresponding to each objective function value in the objective function value set is obtained to obtain a second pixel matrix set.

4. The method for identifying screen image defect types based on vector similarity according to claim 3, characterized in that: The step of obtaining the defect type corresponding to the first target feature vector by using a vector similarity algorithm according to the reference feature vectors in the reference feature vector set to obtain the target defect type includes: constructing a feature vector space based on the reference feature vectors in the reference feature vector set to obtain a target defect space; Using a vector similarity algorithm according to the target defect space, obtaining a reference feature vector that is most similar to the first target feature vector, to obtain a target reference feature vector; Obtaining a defect type corresponding to the target reference feature vector to obtain a first defect type; The first defect type is determined as the defect type corresponding to the first target feature vector to obtain a target defect type.

5. The method for identifying screen image defect types based on vector similarity according to claim 4, characterized in that: The step of constructing a feature vector space based on the reference feature vectors in the reference feature vector set to obtain a target defect space includes: Obtaining dimension information corresponding to a reference feature vector in the reference feature vector set to obtain a first dimension information set; Obtain the first dimension information with the largest value in the first dimension information set to obtain the target dimension information; Constructing a reference feature matrix according to the target dimension information and the reference feature vectors in the reference feature vector set to obtain a first reference feature matrix, wherein the rank corresponding to the first reference feature matrix is the same as the target dimension information; Obtaining a covariance matrix corresponding to the first reference feature matrix to obtain a target covariance matrix; Obtaining the eigenvalues corresponding to the target covariance matrix to obtain target eigenvalues; Performing eigendecomposition on the target eigenvalue to obtain M basis vectors, where M is equal to the target dimension information; Constructing an M-dimensional feature space according to the M basis vectors to obtain a first defect space; The reference eigenvectors in the reference eigenvector matrix are filled into the first defect space according to their corresponding first dimension information to obtain a target defect space.

6. A device for identifying screen image defect types based on vector similarity, characterized in that: The device comprises: A first acquiring unit is configured to acquire a screen image corresponding to the touch screen to be detected, to obtain the screen image to be detected, wherein the touch screen to be detected is a touch screen with a defect; a second acquiring unit, configured to acquire K reference screen images to obtain a reference screen image set, wherein the reference screen images are screen images with defects marked with defect types, and the reference screen images in the reference screen image set correspond to different defect types; A construction unit, configured to obtain feature vectors corresponding to reference screen images in the reference screen image set according to a preset sparse dictionary, to obtain a reference feature vector set; an extraction unit, configured to extract a defect feature vector from the screen image to be detected to obtain a first target feature vector; The matching unit is configured to obtain a defect type corresponding to the first target feature vector by using a vector similarity algorithm according to the reference feature vectors in the reference feature vector set, thereby obtaining a target defect type.

7. The device for identifying screen image defect types based on vector similarity according to claim 6, characterized in that: In terms of obtaining the reference feature vector set by acquiring the feature vectors corresponding to the reference screen images in the reference screen image set according to a preset sparse dictionary, the construction unit is specifically configured to: performing binarization and denoising on the reference screen images in the reference screen image set to obtain a first reference screen image set; Constructing a pixel matrix corresponding to each first reference screen image in the first reference screen image set to obtain a first pixel matrix set; Extracting sparse matrices corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain a second pixel matrix set; The second pixel matrices in the second pixel matrix set are converted into vectors to obtain a reference feature vector set.

8. The device for identifying screen image defect types based on vector similarity according to claim 7, characterized in that: In terms of extracting the sparse matrix corresponding to each first pixel matrix in the first pixel matrix set according to a preset sparse dictionary to obtain the second pixel matrix set, the construction unit is specifically configured to: constructing an optimization function corresponding to each first pixel matrix in the first pixel matrix set according to the preset sparse dictionary and the first pixel matrices in the first pixel matrix set to obtain a target optimization function set; Iteratively solving the optimal solution corresponding to each objective optimization function in the objective optimization function set to obtain an objective function value set; A sparse matrix corresponding to each objective function value in the objective function value set is obtained to obtain a second pixel matrix set.

9. A terminal, characterized in that: The invention comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the screen image defect type identification method based on vector similarity as described in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When executed by a processor, the program instructions enable the processor to execute the method for identifying screen image defect types based on vector similarity according to any one of claims 1 to 5.