CN111080626B - Detection method and electronic equipment - Google Patents

Detection method and electronic equipment Download PDF

Info

Publication number
CN111080626B
CN111080626B CN201911316484.XA CN201911316484A CN111080626B CN 111080626 B CN111080626 B CN 111080626B CN 201911316484 A CN201911316484 A CN 201911316484A CN 111080626 B CN111080626 B CN 111080626B
Authority
CN
China
Prior art keywords
image
normal
space
training
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911316484.XA
Other languages
Chinese (zh)
Other versions
CN111080626A (en
Inventor
刘景贤
刘永华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201911316484.XA priority Critical patent/CN111080626B/en
Publication of CN111080626A publication Critical patent/CN111080626A/en
Application granted granted Critical
Publication of CN111080626B publication Critical patent/CN111080626B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30121CRT, LCD or plasma display

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a detection method and electronic equipment, which are characterized in that a first image aiming at the surface of a screen to be detected is obtained, a first training model is utilized to map the first image from an image space to a feature space, a feature parameter to be detected aiming at the first image is obtained, a normal feature parameter matched with the feature parameter to be detected is determined in a normal feature parameter set used for training by the first training model, a second training model is utilized to map the normal feature parameter from the feature space to the image space, a second image aiming at the normal feature parameter is obtained, whether the first image is matched with the second image is judged, if so, the first image is determined to be a normal image, and if not, the first image is determined to be an abnormal image.

Description

Detection method and electronic equipment
Technical Field
The present invention relates to the field of image detection technologies, and in particular, to a detection method and an electronic device.
Background
The electronic equipment detects defects on the surface of the screen before leaving the factory to determine whether the surface of the screen has defects.
At present, the defect detection method is to define the defect type of the screen surface in advance, so that a sample training model is manufactured to detect the screen surface. For example, an image of the surface of a screen without defects is acquired, scratches are added to the image, and the positions of the scratches are framed on the image, thereby defining the types of defects as scratches.
Then, when a defect which is not within the defined range appears on the screen surface, the defect cannot be detected by adopting the detection mode, and the detection accuracy is reduced.
Disclosure of Invention
In view of the above, the present invention provides a detection method and an electronic device to solve the above technical problems.
In order to achieve the above purpose, the present invention provides the following technical solutions:
A method of detection comprising:
acquiring a first image aiming at the surface of a screen to be detected;
mapping the first image from an image space to a feature space by using a first training model, and acquiring feature parameters to be detected for the first image;
Determining normal characteristic parameters matched with the characteristic parameters to be detected from a normal characteristic parameter set used for training by the first training model;
Mapping the normal characteristic parameters from a characteristic space to an image space by using a second training model, and obtaining a second image aiming at the normal characteristic parameters;
Judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Preferably, the method further comprises:
Performing first training on a normal image by using a first training model, mapping the normal image from an image space to a feature space, and generating normal feature parameters; the first training is used for enabling normal characteristic parameters of a plurality of normal images to be as close as possible in a characteristic space, and generating a normal characteristic parameter set for training;
Performing second training on the normal characteristic parameters by using a second training model, mapping the normal characteristic parameters from a characteristic space to an image space, and generating a normal reconstruction image; the second training is used for enabling the normal reconstruction image to be consistent with the normal image as much as possible.
Preferably, the method further comprises:
Performing first training on the abnormal image by using the first training model, mapping the abnormal image from an image space to a feature space, and generating abnormal feature parameters; the first training enables the abnormal characteristic parameters of the abnormal image to be far away from the normal characteristic parameters as far as possible in a characteristic space;
And performing second training on the abnormal characteristic parameters by using the second training model, mapping the abnormal characteristic parameters from a characteristic space to an image space, and generating an abnormal reconstruction image, wherein the second training enables the abnormal reconstruction image to be consistent with the abnormal image as much as possible.
Preferably, the determining whether the first image and the second image are matched, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image includes:
calculating a distance between the first image and the second image;
And judging whether the distance is smaller than a preset first distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Preferably, the calculating the distance between the first image and the second image includes:
Calculating a distance between the integral image of the first image and the integral image of the second image;
Or dividing the first image and the second image into a plurality of areas respectively, wherein the area division modes of the first image and the second image are the same;
calculating a distance between regions where the first image and the second image are at the same position;
And judging whether the distances corresponding to the areas are smaller than a preset second distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
An electronic device, comprising:
A memory for storing a program;
The processor is used for executing and acquiring a first image aiming at the surface of a screen to be detected by running the program, mapping the first image from an image space to a feature space by utilizing a first training model, acquiring feature parameters to be detected aiming at the image to be detected, determining normal feature parameters matched with the feature parameters to be detected in a normal feature parameter set used for training by the first training model, mapping the normal feature parameters from the feature space to the image space by utilizing a second training module, acquiring a second image aiming at the normal feature parameters, judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Preferably, the method further comprises:
and the image collector is used for collecting a first image aiming at the surface of the screen to be detected.
Preferably, the processor is further configured to perform a first training on a normal image by using a first training model, map the normal image from an image space to a feature space, generate a normal feature parameter, perform a second training on the normal feature parameter by using a second training model, map the normal feature parameter from the feature space to the image space, and generate a normal reconstructed image;
the first training is used for enabling normal characteristic parameters of a plurality of normal images to be as close as possible in a characteristic space, and generating a normal characteristic parameter set for training; the second training is used for enabling the normal reconstruction image to be consistent with the normal image as much as possible.
Preferably, the processor is further configured to perform a first training on the abnormal image by using the first training model, map the abnormal image from an image space to a feature space, generate an abnormal feature parameter, perform a second training on the abnormal feature parameter by using the second training model, map the abnormal feature parameter from the feature space to the image space, and generate an abnormal reconstructed image;
The first training enables the abnormal characteristic parameters of the abnormal image to be far away from the normal characteristic parameters as far as possible in a characteristic space; the second training enables the positive anomaly reconstruction image to be consistent with the anomaly image as much as possible.
Preferably, the processor determines whether the first image and the second image are matched, if so, determines that the first image is a normal image, and if not, determines that the first image is an abnormal image, including:
calculating a distance between the first image and the second image;
And judging whether the distance is smaller than a preset first distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Compared with the prior art, the application provides a detection method, which comprises the steps of obtaining a first image aiming at the surface of a screen to be detected, mapping the first image from an image space to a feature space by using a first training model, obtaining feature parameters to be detected aiming at the image to be detected, determining normal feature parameters matched with the feature parameters to be detected in a normal feature parameter set used for training by using the first training model, mapping the normal feature parameters from the feature space to the image space by using a second training module, obtaining a second image aiming at the normal feature parameters, judging whether the first image and the second image are matched, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image; therefore, the method and the device can acquire the second image through the first training model and the second training model by utilizing the first image, and determine whether the first image is an abnormal image or not by judging whether the first image is matched with the second image or not, so that the accuracy of screen surface detection is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a detection method according to an embodiment of the present application;
FIG. 2 is a flow chart of a detection method according to another embodiment of the present application;
FIG. 3 is a flow chart of a detection method according to another embodiment of the present application;
FIG. 4a is a diagram of one implementation of calculating a distance between a first image and a second image provided in yet another method embodiment of the present application;
FIG. 4b is another implementation of calculating a distance between a first image and a second image provided in yet another method embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
Fig. 6 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
An embodiment of the method of the present application provides a detection method, as shown in fig. 1, including the following steps:
step 101: acquiring a first image aiming at the surface of a screen to be detected;
Specifically, the staff can deploy the image collector on the production line of the screen of the production electronic equipment, and control the image collector to collect the first image aiming at the surface of the screen to be detected by controlling shooting conditions such as illumination.
Step 102: and mapping the first image from the image space to the feature space by using a first training model, and acquiring feature parameters to be detected for the first image.
In this embodiment, the first training model is capable of mapping an image from an image space to a feature space. In particular, the first training model may be an encoder.
Step 103: and determining normal characteristic parameters matched with the characteristic parameters to be detected from a normal characteristic parameter set used for training by the first training model.
The normal characteristic parameter set is a set which is generated by mapping the image space to the characteristic space and is formed by carrying out first training on a plurality of normal images in advance by a first training model, so that the plurality of normal characteristic parameters are as close as possible.
The feature space of the plurality of normal feature parameters being as close as possible may mean that the plurality of normal feature parameters are collected in a certain range, for example, in a preset range. Specifically, the first training model may have a convolutional neural network model, and the normal image is first trained through the convolutional neural network model.
It is understood that a normal image is an image taken by photographing for a non-defective screen surface.
In the present application, the normal characteristic parameter in the normal characteristic parameter set that matches the characteristic parameter to be detected may refer to the normal characteristic parameter in the normal characteristic parameter set that is most similar to the characteristic parameter to be detected.
Step 104: and mapping the normal characteristic parameters from the characteristic space to the image space by using a second training model, and acquiring a second image aiming at the normal characteristic parameters.
The second training model, which may be a decoder, is capable of mapping the feature parameters from the feature space to the image space.
The second training model is a model which performs second training on a plurality of normal characteristic parameters in advance, so that the normal characteristic parameters are mapped from the characteristic space to the normal reconstructed image generated by the image space and the normal image are consistent as much as possible.
Specifically, the second training model may have a convolutional neural network model, and the normal characteristic parameters are second trained through the convolutional neural network model.
It is understood that the normal reconstructed image and the normal image are consistent as much as possible, which means that the similarity between the normal reconstructed image and the normal image is as high as possible, for example, greater than a predetermined similarity. It should be noted that, the two images that are as consistent as possible refer to a normal reconstructed image and a normal image that have the same normal feature parameters, that is, the normal feature parameters used in the normal reconstructed image are the same as the normal feature parameters generated in the normal image.
Step 105: judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Specifically, the distance between the first image and the second image may be calculated, whether the distance is smaller than a preset first distance is determined, if yes, the first image is determined to be a normal image, and if not, the first image is determined to be an abnormal image.
Wherein the distance between the first image and the second image may be calculated using an MSE (mean spuare error, mean square error) algorithm.
When the first image is determined to be a normal image, it can be determined that the screen surface to be detected has no defect, and when the first image is determined to be an abnormal image, it can be determined that the screen surface to be detected has a defect, so that defect detection of the screen surface to be detected is realized.
In this embodiment, a first image for a surface of a screen to be detected is obtained, a first training model is used to map the first image from an image space to a feature space, a feature parameter to be detected for the image to be detected is obtained, a normal feature parameter matched with the feature parameter to be detected is determined in a normal feature parameter set used for training by the first training model, a second training model is used to map the normal feature parameter from the feature space to the image space, a second image for the normal feature parameter is obtained, whether the first image is matched with the second image is judged, if so, the first image is determined to be a normal image, and if not, the first image is determined to be an abnormal image; therefore, the method and the device can acquire the second image through the first training model and the second training model by utilizing the first image, and determine whether the first image is an abnormal image or not by judging whether the first image is matched with the second image or not, so that the accuracy of screen surface detection is improved.
Another embodiment of the present application provides a detection method, as shown in fig. 2, including the following steps:
Step 201: performing first training on a normal image by using a first training model, mapping the normal image from an image space to a feature space, and generating normal feature parameters;
wherein the first training model is capable of mapping an image from an image space to a feature space. In particular, the first training model may be an encoder. And the first training is used for making the normal characteristic parameters of the plurality of normal images as close as possible in the characteristic space, and generating a normal characteristic parameter set for training. Specifically, the first training model may have a convolutional neural network model, and the normal image is first trained through the convolutional neural network model.
The feature space of the plurality of normal feature parameters being as close as possible may mean that the plurality of normal feature parameters are clustered within a certain range, such as within a preset range.
It is understood that a normal image is an image taken by photographing for a non-defective screen surface.
Step 202: performing second training on the normal characteristic parameters by using a second training model, mapping the normal characteristic parameters from a characteristic space to an image space, and generating a normal reconstruction image;
Wherein the second training model is capable of mapping the feature parameters from the feature space to the image space, and in particular, the second training model may be a decoder. And the second training is used for enabling the normal reconstructed image to be consistent with the normal image as much as possible, wherein the normal reconstructed image is consistent with the normal image as much as possible, which means that the similarity between the normal reconstructed image and the normal image is as high as possible, for example, the similarity is larger than a preset similarity. It should be noted that, the two images that are as consistent as possible refer to a normal reconstructed image and a normal image that have the same normal feature parameters, that is, the normal feature parameters used in the normal reconstructed image are the same as the normal feature parameters generated in the normal image.
Specifically, the second training model may have a convolutional neural network model, and the normal characteristic parameters are second trained through the convolutional neural network model.
Step 203: acquiring a first image aiming at the surface of a screen to be detected;
Step 204: mapping the first image from an image space to a feature space by using a first training model, and acquiring feature parameters to be detected for the first image;
Step 205: determining normal characteristic parameters matched with the characteristic parameters to be detected from a normal characteristic parameter set used for training by the first training model;
Step 206: mapping the normal characteristic parameters from a characteristic space to an image space by using a second training model, and obtaining a second image aiming at the normal characteristic parameters;
Step 207: judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
In this embodiment, the first training model and the second training model may be trained in advance by using the normal image, so that the first image on the screen surface to be detected is detected by using the first training model and the second training model, and whether the first image is an abnormal image is determined, thereby improving accuracy of screen surface detection.
In order to further improve the accuracy of the detection, in another embodiment of the method of the present application, the first training model and the second training model are further trained, specifically, as shown in fig. 3, a detection method may include the following steps:
step 301: performing first training on a normal image by using a first training model, mapping the normal image from an image space to a feature space, and generating normal feature parameters;
The first training is used for enabling normal characteristic parameters of a plurality of normal images to be as close as possible in a characteristic space, and generating a normal characteristic parameter set for training.
Step 302: performing second training on the normal characteristic parameters by using a second training model, mapping the normal characteristic parameters from a characteristic space to an image space, and generating a normal reconstruction image;
The second training is used for enabling the normal reconstruction image to be consistent with the normal image as much as possible.
Step 303: performing first training on the abnormal image by using a first training model, mapping the abnormal image from an image space to a feature space, and generating abnormal feature parameters;
it can be understood that the abnormal image is an image captured by shooting for a defective screen surface.
The first training enables the abnormal characteristic parameters of the abnormal image to be far away from the normal characteristic parameters as far as possible in the characteristic space; the abnormal characteristic parameter being as far away from the normal characteristic parameter as possible in the characteristic space may refer to that the abnormal characteristic parameter is located outside a preset range of the normal characteristic parameter.
The first training model may have a convolutional neural network model, and the first training is performed on the abnormal image through the convolutional neural network model.
Step 304: performing second training on the abnormal characteristic parameters by using a second training model, mapping the abnormal characteristic parameters from a characteristic space to an image space, and generating an abnormal reconstruction image;
The second training enables the abnormal reconstruction image to be consistent with the abnormal image as much as possible. The abnormal reconstructed image and the abnormal image being consistent as much as possible means that the similarity between the abnormal reconstructed image and the abnormal image is as high as possible, if the similarity is larger than a preset similarity. The two images that are as consistent as possible are referred to as an abnormal reconstructed image and an abnormal image that have the same abnormal feature parameters, that is, the abnormal feature parameters used in the abnormal reconstructed image are the same as the abnormal feature parameters generated in the abnormal image.
Specifically, the second training model may have a convolutional neural network model, and the abnormal feature parameters are second trained through the convolutional neural network model.
Step 305: acquiring a first image aiming at the surface of a screen to be detected;
step 306: mapping the first image from an image space to a feature space by using a first training model, and acquiring feature parameters to be detected for the first image;
Step 307: determining normal characteristic parameters matched with the characteristic parameters to be detected from a normal characteristic parameter set used for training by the first training model;
Step 308: mapping the normal characteristic parameters from a characteristic space to an image space by using a second training model, and obtaining a second image aiming at the normal characteristic parameters;
Step 309: judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
If the first image is a normal image, a normal image (second image) which is most similar to the first image can be determined through the first training model and the second training model, and the similarity between the reconstructed second image and the first image is high because the similarity between the normal images is high.
If the first image is an abnormal image, a normal image (second image) which is most similar to the first image can be determined through the first training model and the second training model, and the difference between the reconstructed second image and the first image is larger.
In this embodiment, the first training model and the second training model may be trained in advance by using the normal image and the abnormal image, so that the first image on the screen surface to be detected is detected by using the first training model and the second training model, and whether the first image is the abnormal image is determined, thereby improving accuracy of screen surface detection.
In a further method embodiment of the application, two implementations of calculating the distance between the first image and the second image are mainly described.
Specifically, in one implementation, calculating the distance between the first image and the second image includes: a distance between the global image of the first image and the global image of the second image is calculated.
As shown in fig. 4a, the first image is P1, the second image is P2, and the distance between the overall image of P1 and the overall image of P2 can be calculated.
In another implementation, calculating the distance between the first image and the second image includes:
(1) Dividing the first image and the second image into a plurality of areas respectively, wherein the area dividing modes of the first image and the second image are the same;
(2) Calculating a distance between regions where the first image and the second image are at the same position;
(3) And judging whether the distances corresponding to the areas are smaller than a preset second distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
As shown in fig. 4b, the first image is P1, the second image is P2, the same region division manner is adopted for dividing P1 and P2 into 9 regions, the distance between the 1 st region of P1 and the 1 st region of P2, the distance between the 2 nd region of P1 and the 2 nd region of P2, the distance between the 3rd region of P1 and the 3rd region of P2, the distance between the 4 th region of P1 and the 4 th region of P2, the distance between the 5 th region of P1 and the 5 th region of P2, the distance between the 6 th region of P1 and the 6 th region of P2, the distance between the 7 th region of P1 and the 7 th region of P2, the distance between the 8 th region of P1 and the 8 th region of P2, and the distance between the 9 th region of P1 and the 9 th region of P2 are all smaller than the preset second distance, if the calculated distances are determined, the P1 is a normal image, if the P1 is determined to be an abnormal image, the abnormal image is determined.
Corresponding to the detection method, the embodiment of the device of the application also provides an electronic device, and the description is given below through several embodiments.
An embodiment of a device of the present application provides an electronic apparatus, as shown in fig. 5, including: a memory 110, a processor 120; wherein:
A memory 110 for storing a program;
The processor 120 is configured to perform obtaining a first image for a surface of a screen to be detected by running the program, map the first image from an image space to a feature space by using a first training model, obtain a feature parameter to be detected for the image to be detected, determine a normal feature parameter matching the feature parameter to be detected in a normal feature parameter set used for training by using the first training model, map the normal feature parameter from the feature space to the image space by using a second training module, obtain a second image for the normal feature parameter, determine whether the first image is matched with the second image, determine that the first image is a normal image if the first image is matched with the second image, and determine that the first image is an abnormal image if the first image is not matched with the second image.
Specifically, the staff can deploy the image collector on the production line of the screen of the production electronic equipment, and control the image collector to collect the first image aiming at the surface of the screen to be detected by controlling shooting conditions such as illumination. In one implementation, the image collector is independent of the electronic device, which acquires the image by communicating with the image collector.
In this embodiment, the first training model is capable of mapping an image from an image space to a feature space. In particular, the first training model may be an encoder.
The normal characteristic parameter set is a set which is generated by mapping the image space to the characteristic space and is formed by carrying out first training on a plurality of normal images in advance by a first training model, so that the plurality of normal characteristic parameters are as close as possible.
The feature space of the plurality of normal feature parameters being as close as possible may mean that the plurality of normal feature parameters are collected in a certain range, for example, in a preset range. Specifically, the first training model may have a convolutional neural network model, and the normal image is first trained through the convolutional neural network model.
It is understood that a normal image is an image taken by photographing for a non-defective screen surface.
In the present application, the normal characteristic parameter in the normal characteristic parameter set that matches the characteristic parameter to be detected may refer to the normal characteristic parameter in the normal characteristic parameter set that is most similar to the characteristic parameter to be detected.
The second training model, which may be a decoder, is capable of mapping the feature parameters from the feature space to the image space.
The second training model is a model which performs second training on a plurality of normal characteristic parameters in advance, so that the normal characteristic parameters are mapped from the characteristic space to the normal reconstructed image generated by the image space and the normal image are consistent as much as possible.
Specifically, the second training model may have a convolutional neural network model, and the normal characteristic parameters are second trained through the convolutional neural network model.
It is understood that the normal reconstructed image and the normal image are consistent as much as possible, which means that the similarity between the normal reconstructed image and the normal image is as high as possible, for example, greater than a predetermined similarity. It should be noted that, the two images that are as consistent as possible refer to a normal reconstructed image and a normal image that have the same normal feature parameters, that is, the normal feature parameters used in the normal reconstructed image are the same as the normal feature parameters generated in the normal image.
Specifically, the processor 120 determines whether the first image and the second image are matched, if so, determines that the first image is a normal image, and if not, determines that the first image is an abnormal image, which may include: and calculating the distance between the first image and the second image, judging whether the distance is smaller than a preset first distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Wherein the distance between the first image and the second image may be calculated using an MSE (mean spuare error, mean square error) algorithm.
When the first image is determined to be a normal image, it can be determined that the screen surface to be detected has no defect, and when the first image is determined to be an abnormal image, it can be determined that the screen surface to be detected has a defect, so that defect detection of the screen surface to be detected is realized.
In this embodiment, the processor maps a first image for a surface of a screen to be detected from an image space to a feature space by using a first training model, obtains a feature parameter to be detected for the image to be detected, determines a normal feature parameter matched with the feature parameter to be detected in a normal feature parameter set used for training by using the first training model, maps the normal feature parameter from the feature space to the image space by using a second training module, obtains a second image for the normal feature parameter, determines whether the first image is matched with the second image, determines that the first image is a normal image if the first image is matched with the second image, and determines that the first image is an abnormal image if the first image is not matched with the second image; therefore, the method and the device can acquire the second image through the first training model and the second training model by utilizing the first image, and determine whether the first image is an abnormal image or not by judging whether the first image is matched with the second image or not, so that the accuracy of screen surface detection is improved.
Another embodiment of the present application provides an electronic device, as shown in fig. 6, including: a memory 110, a processor 120, and an image collector 130; wherein:
A memory 110 for storing a program;
an image collector 130 for collecting a first image for the screen surface to be detected.
In this embodiment, the image collector is part of the electronic device.
The processor 120 is configured to perform acquiring the first image by running the program, map the first image from an image space to a feature space by using a first training model, acquire a feature parameter to be detected for the image to be detected, determine a normal feature parameter matched with the feature parameter to be detected in a normal feature parameter set used for training by using the first training model, map the normal feature parameter from the feature space to the image space by using a second training module, acquire a second image for the normal feature parameter, determine whether the first image is matched with the second image, determine that the first image is a normal image if the first image is matched with the second image, and determine that the first image is an abnormal image if the first image is not matched with the second image.
In this embodiment, the processor 120 determines whether the first image and the second image are matched, if so, determines that the first image is a normal image, and if not, determines that the first image is an abnormal image, including: calculating a distance between the first image and the second image; and judging whether the distance is smaller than a preset first distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
Therefore, the method and the device can acquire the second image through the first training model and the second training model by utilizing the first image, and determine whether the first image is an abnormal image or not by judging whether the first image is matched with the second image or not, so that the accuracy of screen surface detection is improved.
In yet another embodiment of the present application, the processor is further configured to perform a first training on a normal image using a first training model, map the normal image from an image space to a feature space, generate a normal feature parameter, perform a second training on the normal feature parameter using a second training model, map the normal feature parameter from the feature space to the image space, and generate a normal reconstructed image.
Wherein the first training model is capable of mapping an image from an image space to a feature space. In particular, the first training model may be an encoder. And the first training is used for making the normal characteristic parameters of the plurality of normal images as close as possible in the characteristic space, and generating a normal characteristic parameter set for training. Specifically, the first training model may have a convolutional neural network model, and the normal image is first trained through the convolutional neural network model.
The feature space of the plurality of normal feature parameters being as close as possible may mean that the plurality of normal feature parameters are clustered within a certain range, such as within a preset range.
It is understood that a normal image is an image taken by photographing for a non-defective screen surface.
Wherein the second training model is capable of mapping the feature parameters from the feature space to the image space, and in particular, the second training model may be a decoder. And the second training is used for enabling the normal reconstructed image to be consistent with the normal image as much as possible, wherein the normal reconstructed image is consistent with the normal image as much as possible, which means that the similarity between the normal reconstructed image and the normal image is as high as possible, for example, the similarity is larger than a preset similarity. It should be noted that, the two images that are as consistent as possible refer to a normal reconstructed image and a normal image that have the same normal feature parameters, that is, the normal feature parameters used in the normal reconstructed image are the same as the normal feature parameters generated in the normal image.
Specifically, the second training model may have a convolutional neural network model, and the normal characteristic parameters are second trained through the convolutional neural network model.
In yet another embodiment of the present application, the processor is further configured to perform a first training on the abnormal image using a first training model, map the abnormal image from the image space to the feature space, generate an abnormal feature parameter, perform a second training on the abnormal feature parameter using a second training model, map the abnormal feature parameter from the feature space to the image space, and generate an abnormal reconstructed image.
It can be understood that the abnormal image is an image captured by shooting for a defective screen surface.
The first training enables the abnormal characteristic parameters of the abnormal image to be far away from the normal characteristic parameters as far as possible in the characteristic space; the abnormal characteristic parameter being as far away from the normal characteristic parameter as possible in the characteristic space may refer to that the abnormal characteristic parameter is located outside a preset range of the normal characteristic parameter.
The first training model may have a convolutional neural network model, and the first training is performed on the abnormal image through the convolutional neural network model.
The second training enables the abnormal reconstruction image to be consistent with the abnormal image as much as possible. The abnormal reconstructed image and the abnormal image being consistent as much as possible means that the similarity between the abnormal reconstructed image and the abnormal image is as high as possible, if the similarity is larger than a preset similarity. The two images that are as consistent as possible are referred to as an abnormal reconstructed image and an abnormal image that have the same abnormal feature parameters, that is, the abnormal feature parameters used in the abnormal reconstructed image are the same as the abnormal feature parameters generated in the abnormal image.
Specifically, the second training model may have a convolutional neural network model, and the abnormal feature parameters are second trained through the convolutional neural network model.
In yet another apparatus embodiment of the present application, the processor calculates a distance between the first image and the second image, comprising:
A distance between the global image of the first image and the global image of the second image is calculated.
Or the processor calculates a distance between the first image and the second image, comprising: dividing the first image and the second image into a plurality of areas, calculating the distance between the areas where the first image and the second image are located at the same position, judging whether the distances corresponding to the areas are smaller than a preset second distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
The first image and the second image are divided in the same area mode.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.A method of detection comprising:
acquiring a first image aiming at the surface of a screen to be detected;
mapping the first image from an image space to a feature space by using a first training model, and acquiring feature parameters to be detected for the first image;
Performing first training on a normal image by using a first training model, mapping the normal image from an image space to a feature space, and generating normal feature parameters; the first training is used for enabling normal characteristic parameters of a plurality of normal images to be as close as possible in a characteristic space, and generating a normal characteristic parameter set for training;
Determining normal characteristic parameters matched with the characteristic parameters to be detected in a normal characteristic parameter set for training;
mapping normal characteristic parameters matched with the characteristic parameters to be detected from a characteristic space to an image space by using a second training model, and obtaining a second image aiming at the normal characteristic parameters matched with the characteristic parameters to be detected;
Judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
2. The method of claim 1, further comprising:
Performing second training on the normal characteristic parameters by using a second training model, mapping the normal characteristic parameters from a characteristic space to an image space, and generating a normal reconstruction image; the second training is used for enabling the normal reconstruction image to be consistent with the normal image as much as possible.
3. The method of claim 2, further comprising:
Performing first training on the abnormal image by using the first training model, mapping the abnormal image from an image space to a feature space, and generating abnormal feature parameters; the first training enables the abnormal characteristic parameters of the abnormal image to be far away from the normal characteristic parameters as far as possible in a characteristic space;
And performing second training on the abnormal characteristic parameters by using the second training model, mapping the abnormal characteristic parameters from a characteristic space to an image space, and generating an abnormal reconstruction image, wherein the second training enables the abnormal reconstruction image to be consistent with the abnormal image as much as possible.
4. The method of claim 1, the determining whether the first image and the second image match, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image, comprising:
calculating a distance between the first image and the second image;
And judging whether the distance is smaller than a preset first distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
5. The method of claim 4, the calculating a distance between the first image and the second image comprising:
Calculating a distance between the integral image of the first image and the integral image of the second image;
Or dividing the first image and the second image into a plurality of areas respectively, wherein the area division modes of the first image and the second image are the same;
calculating a distance between regions where the first image and the second image are at the same position;
And judging whether the distances corresponding to the areas are smaller than a preset second distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
6. An electronic device, comprising:
A memory for storing a program;
The processor is used for executing and acquiring a first image aiming at the surface of a screen to be detected, mapping the first image from an image space to a feature space by utilizing a first training model, acquiring feature parameters to be detected aiming at the first image, determining normal feature parameters matched with the feature parameters to be detected in a normal feature parameter set for training, mapping the normal feature parameters matched with the feature parameters to be detected from the feature space to the image space by utilizing a second training model, acquiring a second image aiming at the normal feature parameters matched with the feature parameters to be detected, judging whether the first image is matched with the second image, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image;
The processor is further used for performing first training on the normal images by using a first training model, mapping the normal images from an image space to a feature space to generate normal feature parameters, and the first training is used for enabling the normal feature parameters of the plurality of normal images to be as close as possible in the feature space to generate a normal feature parameter set for training.
7. The electronic device of claim 6, further comprising:
and the image collector is used for collecting a first image aiming at the surface of the screen to be detected.
8. The electronic device of claim 6, the processor further configured to perform a second training on the normal feature parameters using a second training model, map the normal feature parameters from feature space to image space, and generate a normal reconstructed image;
The second training is used for enabling the normal reconstruction image to be consistent with the normal image as much as possible.
9. The electronic device of claim 8, the processor further configured to perform a first training on an anomaly image using the first training model, map the anomaly image from image space to feature space, generate an anomaly feature parameter, perform a second training on the anomaly feature parameter using the second training model, map the anomaly feature parameter from feature space to image space, generate an anomaly reconstruction image;
the first training enables the abnormal characteristic parameters of the abnormal image to be far away from the normal characteristic parameters as far as possible in a characteristic space; the second training enables the abnormal reconstruction image to be consistent with the abnormal image as much as possible.
10. The electronic device of claim 6, the processor to determine whether the first image and the second image match, if so, to determine that the first image is a normal image, and if not, to determine that the first image is an abnormal image, comprising:
calculating a distance between the first image and the second image;
And judging whether the distance is smaller than a preset first distance, if so, determining that the first image is a normal image, and if not, determining that the first image is an abnormal image.
CN201911316484.XA 2019-12-19 2019-12-19 Detection method and electronic equipment Active CN111080626B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911316484.XA CN111080626B (en) 2019-12-19 2019-12-19 Detection method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911316484.XA CN111080626B (en) 2019-12-19 2019-12-19 Detection method and electronic equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202410831259.4A Division CN118840324A (en) 2019-12-19 Detection method and electronic equipment

Publications (2)

Publication Number Publication Date
CN111080626A CN111080626A (en) 2020-04-28
CN111080626B true CN111080626B (en) 2024-06-18

Family

ID=70315626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911316484.XA Active CN111080626B (en) 2019-12-19 2019-12-19 Detection method and electronic equipment

Country Status (1)

Country Link
CN (1) CN111080626B (en)

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718869B (en) * 2016-01-15 2019-07-02 网易(杭州)网络有限公司 The method and apparatus of face face value in a kind of assessment picture
EP3718119A1 (en) * 2017-11-27 2020-10-07 Deciphex Automated screening of histopathology tissue samples via analysis of a normal model
CN108414525A (en) * 2018-01-30 2018-08-17 广东溢达纺织有限公司 Fabric defect detection method, device, computer equipment and storage medium
CN108734690B (en) * 2018-03-02 2021-12-14 苏州汉特士视觉科技有限公司 Visual defect detection equipment and detection method thereof
CN108537152B (en) * 2018-03-27 2022-01-25 百度在线网络技术(北京)有限公司 Method and apparatus for detecting living body
CN109377544B (en) * 2018-11-30 2022-12-23 腾讯科技(深圳)有限公司 Human face three-dimensional image generation method and device and readable medium
CN109726756A (en) * 2018-12-25 2019-05-07 北京旷视科技有限公司 Image processing method, device, electronic equipment and storage medium
CN109886242A (en) * 2019-03-01 2019-06-14 中国科学院重庆绿色智能技术研究院 A kind of method and system that pedestrian identifies again
CN110046551B (en) * 2019-03-18 2021-04-20 中国科学院深圳先进技术研究院 Method and equipment for generating face recognition model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
严伟 等.BP和SAE深度神经网络方法的织物缺陷检测研究.智能物联技术.2018,(03),全文. *
王宪保 等.基于堆叠降噪自动编码器的胶囊缺陷检测方法.计算机科学.2016,(02),全文. *

Also Published As

Publication number Publication date
CN111080626A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
WO2022042579A1 (en) Lcd screen defect detection method and apparatus
CN115082464B (en) Method and system for identifying weld data in welding process of dust remover
CN111047568B (en) Method and system for detecting and identifying steam leakage defect
CN107702663B (en) Point cloud registration method based on rotating platform with mark points
CN108871185B (en) Method, device and equipment for detecting parts and computer readable storage medium
CN107133623B (en) Pointer position accurate detection method based on background difference and circle center positioning
WO2017071406A1 (en) Method and system for detecting pin of gold needle element
CN113820333B (en) Battery pole piece abnormality detection method, device, upper computer and detection system
CN111612773B (en) Thermal infrared imager and real-time automatic blind pixel detection processing method
CN111640088A (en) Electronic component polarity detection method and system based on deep learning and electronic device
CN116519707A (en) Lithium battery defect detection method and device based on machine vision and electronic equipment
CN111665249B (en) Light intensity adjusting method and system and optical detection equipment
CN111080626B (en) Detection method and electronic equipment
CN110322508B (en) Auxiliary positioning method based on computer vision
CN110738606A (en) Image correction method, device, terminal and storage medium for multi-light source system
CN112950493A (en) Method and device for correcting image distortion of linear array camera of rail train
CN118840324A (en) Detection method and electronic equipment
TWI793035B (en) Image noise identification method and image analysis device
CN116430069A (en) Machine vision fluid flow velocity measuring method, device, computer equipment and storage medium
CN114529543B (en) Installation detection method and device for peripheral screw gasket of aero-engine
CN113139955B (en) Photovoltaic module fault identification method and system based on double-light image
CN112529883A (en) Patch detection method and device based on image edge recognition
CN108509845B (en) Visual inspection method for transformer substation instrument equipment inspection based on feature fitting
CN115803610A (en) Image acquisition method and device and storage medium
CN113643374A (en) Multi-view camera calibration method, device, equipment and medium based on road characteristics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant