CN114049320A - Device missing AI quality inspection method and device based on picture similarity - Google Patents
Device missing AI quality inspection method and device based on picture similarity Download PDFInfo
- Publication number
- CN114049320A CN114049320A CN202111324858.XA CN202111324858A CN114049320A CN 114049320 A CN114049320 A CN 114049320A CN 202111324858 A CN202111324858 A CN 202111324858A CN 114049320 A CN114049320 A CN 114049320A
- Authority
- CN
- China
- Prior art keywords
- picture
- similarity
- graph
- target
- missing
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20112—Image segmentation details
- G06T2207/20132—Image cropping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
Abstract
The invention discloses a device missing AI quality inspection method based on picture similarity, which comprises the following steps: summarizing device pictures collected under different exposure degrees; intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain a similarity basic graph according to the device intercepted picture; cutting the picture to be detected according to the coordinates of the similarity basic graph to obtain a target graph to be detected; converting the similarity basic graph and the target graph to be detected into a gray graph, and scaling the image to (M +1) × M by neglecting the aspect ratio; calculating the difference value of adjacent pixels between adjacent rows of two (M +1) M gray-scale graphs to obtain M pictures, and calculating the reference hash value of the similarity basic graph and the target hash value of the target graph to be detected; and performing absolute value subtraction on the reference hash value and the target hash value, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value, and judging whether the device is missing or not.
Description
Technical Field
The invention belongs to the technical field of image recognition, and particularly relates to a device missing AI quality inspection method and device based on picture similarity.
Background
In recent years, with the development of intelligent technology, most models based on image labeling are subjected to quality inspection, however, in a real industrial scene, a large amount of data for labeling model training needs expensive labeling cost, and pictures need to be acquired for each different installation height and exposure degree, which also increases labor cost, so that the problem of industrial quality inspection can be solved by a picture similarity algorithm and fixed-point parameter adjustment based on a small amount of data in a specific place.
The patent application No. 202110364231.0 discloses that LabelImg picture is adopted for labeling, and an EfficientDet algorithm is adopted for target detection, so that a cross entropy loss function is improved, the method adopts a target detection algorithm in deep learning, the identification precision of the method depends on the collection of a large amount of data under different environments and the quality of data labeling, and the labor cost is very high; a method based on AI quality inspection and industrial big data analysis, patent application No. 202010824570.8, it mainly establishes a product picture database and state database first, through the AI interface disposed, carry on the reverse reasoning, fill the flaw data, and carry on the trend analysis to the flaw data, adjust the operating parameter according to association rule and trend analysis result finally, this method exists to the data dependence degree high, and need AI algorithm model accuracy high, can reason out flaw data fill database, otherwise still need to carry on the manual work to check and put in storage, therefore, this method has the drawback that the degree of dependence to the manual work is high.
In order to solve the problem that the AI quality inspection has high dependence on data and manpower, the prior art needs to be improved and developed.
Disclosure of Invention
Aiming at the defects or the improvement requirements of the prior art, the invention provides a device missing AI quality inspection scheme based on picture similarity, which is used for solving the problem of high data and manual dependence degree in device missing quality inspection.
In order to achieve the above object, according to an aspect of the present invention, there is provided a device missing AI quality inspection method based on picture similarity, including:
(1) summarizing device pictures collected under different exposure degrees;
(2) intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain a similarity basic graph according to the device intercepted picture;
(3) cutting the picture to be detected according to the coordinates of the similarity basic graph to obtain a target graph to be detected;
(4) converting the similarity basic graph and the target graph to be detected into a gray graph, and scaling the image to (M +1) × M by neglecting the aspect ratio;
(5) calculating the difference value of adjacent pixels between adjacent lines for two (M +1) M gray-scale graphs to obtain M pictures, and calculating a reference hash value alpha of a similarity basic graph and a target hash value beta of a target graph to be detected;
(6) and performing absolute value subtraction on the reference hash value alpha and the target hash value beta, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value theta, and judging whether the device is missing or not.
In an embodiment of the present invention, the step (2) of calculating the similarity base map specifically includes: adding the corresponding pixel values of the device captured pictures of each picture under different exposure degrees, dividing the added pixel values by the number of the pictures to obtain an average value picture of the device captured pictures, and storing the average value picture as a similarity basic picture.
In one embodiment of the invention, there are two exposures, the device at the first exposure intercepting picture x1Devices at a second exposureCapturing picture x2Intercepting pictures according to the two devices to obtain a similarity basic graphThe pixel value of (2).
In an embodiment of the present invention, the value of M is 8.
In an embodiment of the present invention, the step (6) of determining whether a device is missing specifically includes:
if the | alpha-beta | is less than theta, the basic picture is similar to the target picture, and the quality inspection device is not lost;
if the alpha-beta is larger than theta, the basic picture is not similar to the target picture, and the quality inspection device is lost.
According to another aspect of the present invention, a device missing AI quality inspection apparatus based on picture similarity is further provided, including a picture acquisition module, a similarity base graph calculation module, a target graph to be detected clipping module, a picture conversion scaling module, a hash value calculation module, and a missing determination module, wherein:
the picture acquisition module is used for summarizing the pictures with devices acquired under different exposure degrees;
the similarity basic graph calculating module is used for intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain the similarity basic graph according to the device intercepted picture;
the target image to be detected cutting module is used for cutting the image to be detected according to the coordinates of the similarity basic image to obtain a target image to be detected;
the image conversion and scaling module is used for converting the similarity basic graph and the target graph to be detected into a gray graph and scaling the image to (M +1) × M by neglecting the aspect ratio;
the hash value calculation module is used for calculating the difference value of adjacent pixels between adjacent lines of two (M +1) M gray level graphs to obtain M pictures, and calculating a reference hash value alpha of the similarity basic graph and a target hash value beta of a target graph to be detected;
and the missing judgment module is used for performing absolute value subtraction on the reference hash value alpha and the target hash value beta, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value theta, and judging whether the device is missing or not.
In an embodiment of the present invention, the similarity base map calculated by the similarity base map calculating module specifically includes: adding the corresponding pixel values of the device captured pictures of each picture under different exposure degrees, dividing the added pixel values by the number of the pictures to obtain an average value picture of the device captured pictures, and storing the average value picture as a similarity basic picture.
In one embodiment of the invention, there are two exposures, the device at the first exposure intercepting picture x1And intercepting picture x by device under the second exposure2Intercepting pictures according to the two devices to obtain a similarity basic graphThe pixel value of (2).
In an embodiment of the present invention, the value of M is 8.
In an embodiment of the present invention, the missing judgment module judges whether a device is missing, specifically:
if the | alpha-beta | is less than theta, the basic picture is similar to the target picture, and the quality inspection device is not lost;
if the alpha-beta is larger than theta, the basic picture is not similar to the target picture, and the quality inspection device is lost.
Generally, compared with the prior art, the technical scheme of the invention has the following beneficial effects:
according to the method, a device missing algorithm is defined according to the characteristics of an industrial quality inspection device missing scene, the device missing algorithm is combined with different OPT illumination of an industrial camera, pictures with devices under different illumination are collected, the coordinates of the pictures where the devices are located are intercepted, the average image pixel value of the devices is worked out to be used as a basic graph, a new graph is intercepted according to the coordinates with the devices to obtain a target graph, a threshold value is set, hash values are respectively obtained according to the similarity of the pictures, the hash values of the basic graph and the hash values of the target graph are subtracted to obtain an absolute value to obtain a difference value, if the difference value is smaller than the threshold value, the pictures are similar, and the devices are not missing; if the difference value is larger than the threshold value, the pictures are dissimilar, the device is lost, and an alarm is given, so that the method has the advantages of wide applicable scenes, high precision, simplicity in deployment and capability of quick multiplexing.
Drawings
FIG. 1 is a schematic flow chart of a device missing AI quality inspection method based on picture similarity according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device missing AI quality inspection apparatus based on picture similarity according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
In order to solve the problems in the prior art, as shown in fig. 1, the invention provides a device missing AI quality inspection method based on picture similarity, which comprises the following steps:
(1) summarizing device pictures collected under different exposure degrees;
(2) intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain a similarity basic graph according to the device intercepted picture;
the similarity basic diagram obtained by calculation specifically comprises the following steps: adding corresponding pixel values of device captured pictures of each picture under different exposure degrees, dividing the pixel values by the number of the pictures to obtain an average value picture of the device captured pictures, and storing the average value picture as a similarity basic picture;
the OPT industrial camera is generally two exposure levels, so that only two picture devices under different exposure levels are acquired in the invention.
Device intercepting picture x under first exposure1And intercepting picture x by device under the second exposure2Intercepting pictures according to the two devices to obtain a similarity basic graphThe pixel value of (2).
(3) Cutting the picture to be detected according to the coordinates of the similarity basic graph to obtain a target graph to be detected;
(4) converting the similarity basic graph and the target graph to be detected into a gray graph, and scaling the image to (M +1) × M by neglecting the aspect ratio;
in the embodiment of the invention, the value of M is 8;
(5) calculating the difference value of adjacent pixels between adjacent lines for two (M +1) M gray-scale graphs to obtain M pictures, and calculating a reference hash value alpha of a similarity basic graph and a target hash value beta of a target graph to be detected;
(6) and performing absolute value subtraction on the reference hash value alpha and the target hash value beta, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value theta, and judging whether the device is missing or not. The method comprises the following specific steps:
if the | alpha-beta | is less than theta, the basic picture is similar to the target picture, and the quality inspection device is not lost;
if the alpha-beta is larger than theta, the basic picture is not similar to the target picture, and the quality inspection device is lost.
Further, as shown in fig. 2, the present invention further provides a device missing AI quality inspection apparatus based on picture similarity, which includes a picture acquisition module, a similarity base graph calculation module, a target graph to be detected clipping module, a picture conversion scaling module, a hash value calculation module, and a missing determination module, wherein:
the picture acquisition module is used for summarizing the pictures with devices acquired under different exposure degrees;
the similarity basic graph calculating module is used for intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain the similarity basic graph according to the device intercepted picture;
the target image to be detected cutting module is used for cutting the image to be detected according to the coordinates of the similarity basic image to obtain a target image to be detected;
the image conversion and scaling module is used for converting the similarity basic graph and the target graph to be detected into a gray graph and scaling the image to (M +1) × M by neglecting the aspect ratio;
the hash value calculation module is used for calculating the difference value of adjacent pixels between adjacent lines of two (M +1) M gray level graphs to obtain M pictures, and calculating a reference hash value alpha of the similarity basic graph and a target hash value beta of a target graph to be detected;
and the missing judgment module is used for performing absolute value subtraction on the reference hash value alpha and the target hash value beta, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value theta, and judging whether the device is missing or not.
Further, the similarity base map calculated by the similarity base map calculation module specifically includes: adding the corresponding pixel values of the device captured pictures of each picture under different exposure degrees, dividing the added pixel values by the number of the pictures to obtain an average value picture of the device captured pictures, and storing the average value picture as a similarity basic picture.
Further, there are two exposure levels, the device at the first exposure level intercepts the picture x1And intercepting picture x by device under the second exposure2Intercepting pictures according to the two devices to obtain a similarity basic graphThe pixel value of (2).
Further, the value of M is 8.
Further, the missing judgment module judges whether the device is missing, specifically:
if the | alpha-beta | is less than theta, the basic picture is similar to the target picture, and the quality inspection device is not lost;
if the alpha-beta is larger than theta, the basic picture is not similar to the target picture, and the quality inspection device is lost.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. A device missing AI quality inspection method based on picture similarity is characterized by comprising the following steps:
(1) summarizing device pictures collected under different exposure degrees;
(2) intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain a similarity basic graph according to the device intercepted picture;
(3) cutting the picture to be detected according to the coordinates of the similarity basic graph to obtain a target graph to be detected;
(4) converting the similarity basic graph and the target graph to be detected into a gray graph, and scaling the image to (M +1) × M by neglecting the aspect ratio;
(5) calculating the difference value of adjacent pixels between adjacent lines for two (M +1) M gray-scale graphs to obtain M pictures, and calculating a reference hash value alpha of a similarity basic graph and a target hash value beta of a target graph to be detected;
(6) and performing absolute value subtraction on the reference hash value alpha and the target hash value beta, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value theta, and judging whether the device is missing or not.
2. The method for device missing AI quality inspection based on picture similarity according to claim 1, wherein the similarity base map calculated in the step (2) specifically comprises: adding the corresponding pixel values of the device captured pictures of each picture under different exposure degrees, dividing the added pixel values by the number of the pictures to obtain an average value picture of the device captured pictures, and storing the average value picture as a similarity basic picture.
4. The image similarity-based device missing AI quality inspection method of claim 1 or 2, wherein M is 8.
5. The method for device missing AI quality inspection based on picture similarity according to claim 1 or 2, wherein the step (6) of determining whether a device is missing specifically comprises:
if the | alpha-beta | is less than theta, the basic picture is similar to the target picture, and the quality inspection device is not lost;
if the alpha-beta is larger than theta, the basic picture is not similar to the target picture, and the quality inspection device is lost.
6. The utility model provides a device disappearance AI quality inspection device based on picture similarity which characterized in that, includes picture collection module, similarity basis picture calculation module, treats that the target map of detecting is tailor module, picture conversion zoom module, hash value calculation module and disappearance judgement module, wherein:
the picture acquisition module is used for summarizing the pictures with devices acquired under different exposure degrees;
the similarity basic graph calculating module is used for intercepting the device in each picture under different exposure degrees according to the position of the device to obtain the device intercepted picture of each picture under different exposure degrees, and calculating to obtain the similarity basic graph according to the device intercepted picture;
the target image to be detected cutting module is used for cutting the image to be detected according to the coordinates of the similarity basic image to obtain a target image to be detected;
the image conversion and scaling module is used for converting the similarity basic graph and the target graph to be detected into a gray graph and scaling the image to (M +1) × M by neglecting the aspect ratio;
the hash value calculation module is used for calculating the difference value of adjacent pixels between adjacent lines of two (M +1) M gray level graphs to obtain M pictures, and calculating a reference hash value alpha of the similarity basic graph and a target hash value beta of a target graph to be detected;
and the missing judgment module is used for performing absolute value subtraction on the reference hash value alpha and the target hash value beta, calculating the similarity between the basic graph and the target graph according to a preset hash threshold value theta, and judging whether the device is missing or not.
7. The device-missing AI quality inspection apparatus according to claim 6, wherein the similarity base map calculation module calculates a similarity base map specifically as follows: adding the corresponding pixel values of the device captured pictures of each picture under different exposure degrees, dividing the added pixel values by the number of the pictures to obtain an average value picture of the device captured pictures, and storing the average value picture as a similarity basic picture.
8. The device-missing AI quality inspection apparatus of claim 7 based on picture similarity wherein there are two exposures and the device at the first exposure intercepts picture x1And intercepting picture x by device under the second exposure2Intercepting pictures according to the two devices to obtain a similarity basic graphThe pixel value of (2).
9. The device-missing AI quality inspection apparatus of claim 6 or 7 based on picture similarity wherein M is 8.
10. The device-missing AI quality inspection apparatus according to claim 6 or 7, wherein the missing determination module determines whether a device is missing, specifically:
if the | alpha-beta | is less than theta, the basic picture is similar to the target picture, and the quality inspection device is not lost;
if the alpha-beta is larger than theta, the basic picture is not similar to the target picture, and the quality inspection device is lost.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111324858.XA CN114049320A (en) | 2021-11-10 | 2021-11-10 | Device missing AI quality inspection method and device based on picture similarity |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111324858.XA CN114049320A (en) | 2021-11-10 | 2021-11-10 | Device missing AI quality inspection method and device based on picture similarity |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114049320A true CN114049320A (en) | 2022-02-15 |
Family
ID=80208113
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111324858.XA Pending CN114049320A (en) | 2021-11-10 | 2021-11-10 | Device missing AI quality inspection method and device based on picture similarity |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114049320A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116609339A (en) * | 2023-04-28 | 2023-08-18 | 江苏智马科技有限公司 | Method and system for detecting shape defect of rotor punching sheet |
EP4325261A1 (en) * | 2022-08-16 | 2024-02-21 | Fiberfox, Inc. | Apparatus and method for verifying optical fiber work using artificial intelligence |
-
2021
- 2021-11-10 CN CN202111324858.XA patent/CN114049320A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP4325261A1 (en) * | 2022-08-16 | 2024-02-21 | Fiberfox, Inc. | Apparatus and method for verifying optical fiber work using artificial intelligence |
CN116609339A (en) * | 2023-04-28 | 2023-08-18 | 江苏智马科技有限公司 | Method and system for detecting shape defect of rotor punching sheet |
CN116609339B (en) * | 2023-04-28 | 2024-03-12 | 江苏智马科技有限公司 | Method and system for detecting shape defect of rotor punching sheet |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11380232B2 (en) | Display screen quality detection method, apparatus, electronic device and storage medium | |
CN114049320A (en) | Device missing AI quality inspection method and device based on picture similarity | |
CN106327488B (en) | Self-adaptive foreground detection method and detection device thereof | |
CN113902641B (en) | Data center hot zone judging method and system based on infrared image | |
CN107045723A (en) | Smog recognition methods based on transmissivity dynamic detection | |
CN113657423A (en) | Target detection method suitable for small-volume parts and stacked parts and application thereof | |
CN113313107A (en) | Intelligent detection and identification method for multiple types of diseases on cable surface of cable-stayed bridge | |
CN115311623A (en) | Equipment oil leakage detection method and system based on infrared thermal imaging | |
CN113487563B (en) | EL image-based self-adaptive detection method for hidden cracks of photovoltaic module | |
CN112669301B (en) | High-speed rail bottom plate paint removal fault detection method | |
CN116993745B (en) | Method for detecting surface leakage of water supply pipe based on image processing | |
CN115797411B (en) | Method for online recognition of hydropower station cable bridge deformation by utilizing machine vision | |
CN113052103A (en) | Electrical equipment defect detection method and device based on neural network | |
CN112950565A (en) | Method and device for detecting and positioning water leakage of data center and data center | |
CN111767826A (en) | Timing fixed-point scene abnormity detection method | |
CN112560574A (en) | River black water discharge detection method and recognition system applying same | |
CN112801963B (en) | Video image occlusion detection method and system | |
CN113496159B (en) | Multi-scale convolution and dynamic weight cost function smoke target segmentation method | |
CN114862786A (en) | Retinex image enhancement and Ostu threshold segmentation based isolated zone detection method and system | |
CN113569956A (en) | Mountain fire disaster investigation and identification method based on AI algorithm | |
CN116934636B (en) | Intelligent management system for water quality real-time monitoring data | |
CN113808089A (en) | Water surface oil stain detection method | |
CN111652015B (en) | Method and system for selecting key faces in picture | |
CN116665030A (en) | Water quality transparency detection method based on embedded system | |
CN110849876A (en) | Multi-scale-based background modeling SF6Gas infrared dynamic detection method |
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 |