CN113850756A - Label defect detection method based on template comparison - Google Patents

Label defect detection method based on template comparison Download PDF

Info

Publication number
CN113850756A
CN113850756A CN202110972099.1A CN202110972099A CN113850756A CN 113850756 A CN113850756 A CN 113850756A CN 202110972099 A CN202110972099 A CN 202110972099A CN 113850756 A CN113850756 A CN 113850756A
Authority
CN
China
Prior art keywords
template
detected
sample
pass filtering
images
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.)
Withdrawn
Application number
CN202110972099.1A
Other languages
Chinese (zh)
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.)
Jingrui Vision Intelligent Technology Shanghai Co ltd
Huaneng Laiwu Power Generation Co Ltd
Original Assignee
Jingrui Vision Intelligent Technology Shanghai Co 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 Jingrui Vision Intelligent Technology Shanghai Co ltd filed Critical Jingrui Vision Intelligent Technology Shanghai Co ltd
Priority to CN202110972099.1A priority Critical patent/CN113850756A/en
Publication of CN113850756A publication Critical patent/CN113850756A/en
Withdrawn legal-status Critical Current

Links

Images

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

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)
  • Image Processing (AREA)

Abstract

The invention discloses a label defect detection method based on template comparison in the field of label detection, which comprises the following steps: the method comprises the following steps: selecting a template image; step two: making a template, generating a plurality of template characteristic images, and making a standard model of an object or a region to be detected; step three: carrying out picture calibration on a sample to be detected; step four: acquiring a template characteristic image, and comparing the template characteristic image with the sample characteristic image; step five: and (4) testing the characteristic images of the multiple samples to be detected, judging whether the accuracy rate reaches the standard, and directly jumping to the step one to manufacture the template again if the accuracy rate does not reach the standard. The method has strong adaptability when detecting standard plane products with complex contents, and different products can be used only by creating different templates, so the operation is simple and convenient; meanwhile, the algorithm complexity is greatly reduced compared with the conventional algorithm, the operation speed is guaranteed, and the method is suitable for scenes with high real-time requirements.

Description

Label defect detection method based on template comparison
Technical Field
The invention relates to the field of label detection, in particular to a label defect detection method based on template comparison.
Background
In industrial detection, the detection requirements for labels are increasing day by day, and the label detection generally encounters the problems of complex background, more textures, more characters and the like, so that great challenges are brought to defect identification; the invention uses a template comparison mode to detect products from different degrees, and has the advantages of greatly inhibiting false detection caused by complex textures and flexibly customizing the defect detection size.
The traditional defect detection mode is generally to filter the information belonging to the label by analyzing the characteristics of the defect and then filtering the information in a filtering mode so as to highlight the defect; however, the method has a good effect on products with simple contents and uncomplicated backgrounds, and is easy to cause false detection on labels with a large amount of contents.
Disclosure of Invention
The invention aims to provide a label defect detection method based on template comparison, which has strong adaptability and simple operation.
The purpose of the invention is realized as follows: a label defect detection method based on template comparison comprises the following steps:
the method comprises the following steps: selecting a template image;
step two: making a template, generating a plurality of template characteristic images, and making a standard model of an object or a region to be detected;
step three: carrying out picture calibration on a sample to be detected;
step four: acquiring a template characteristic image, and comparing the template characteristic image with the sample characteristic image;
step five: and (4) testing the characteristic images of the multiple samples to be detected, judging whether the accuracy rate reaches the standard, and directly jumping to the step one to manufacture the template again if the accuracy rate does not reach the standard.
Preferably, the method for manufacturing the template in the second step is as follows:
step A: selecting a to-be-detected object without defects to take a picture, and selecting an area to be detected in the picture or the whole object to perform template manufacturing according to needs;
and B: the two filtered images are obtained by filtering the regions through low-pass filtering and high-pass filtering, the low-pass filtering is used for removing the defects of the regions with higher change frequency in the background and larger detection area, and the high-pass filtering is used for detecting the regions with more obvious change and smaller area.
And C: and (3) performing binarization processing on the two obtained filtered images, and performing binarization on the same region for multiple times according to a lighting condition, wherein if 85, 150 and 200 are set as threshold values in a region brightness range of 0-255, 6 template characteristic images can be generated.
Preferably, the low-pass filtering and the high-pass filtering adopt a low-pass filter based on a Gaussian operator and a high-pass filtering based on a Krisch operator.
Preferably, the method of the third step is as follows:
selecting a plurality of angular points with obvious characteristics on the template characteristic image, finding out corresponding angular points on a sample to be detected, carrying out affine and perspective transformation on the sample to be detected, and aligning the sample to be detected with the template.
Preferably, the method of the fourth step is as follows:
and (3) generating 6 sample characteristic images of the sample to be detected by the method of the second step, comparing the 6 sample characteristic images with the 6 template characteristic images generated by the second step, and restricting the precision of the defect by setting a gray difference threshold, a defect width threshold, a defect area threshold and the like because the sample characteristic images are not completely the same as the template characteristic images.
Preferably, the line scan camera is used to acquire the template feature image.
Compared with the prior art, the invention has the advantages that:
the invention mainly aims at detecting standard plane products with complex contents, has strong adaptability to the contents of the products, can be used by only creating different templates for different products, and is simple and convenient to operate.
A4096-point line scan camera is selected in the aspect of hardware, so that the illumination uniformity of images is guaranteed, the algorithm complexity is reduced greatly compared with that of a conventional algorithm, the operation speed is guaranteed, and the method is very suitable for scenes with high real-time requirements.
Drawings
FIG. 1 is a schematic flow chart of the present invention.
Detailed Description
As shown in fig. 1, a method for detecting a defect of a tag based on template comparison includes the following steps:
the method comprises the following steps: selecting a template image;
step two: making a template, generating a plurality of template characteristic images, and making a standard model of an object or a region to be detected;
step three: carrying out picture calibration on a sample to be detected;
step four: acquiring a template characteristic image, and comparing the template characteristic image with the sample characteristic image;
step five: and (4) testing the characteristic images of the multiple samples to be detected, judging whether the accuracy rate reaches the standard, and directly jumping to the step one to manufacture the template again if the accuracy rate does not reach the standard.
The method for manufacturing the template in the second step comprises the following steps:
step A: selecting a to-be-detected object without defects to take a picture, and selecting an area to be detected in the picture or the whole object to perform template manufacturing according to needs;
and B: the two filtered images are obtained by filtering the regions through low-pass filtering and high-pass filtering, the low-pass filtering is used for removing the defects of the regions with higher change frequency in the background and larger detection area, and the high-pass filtering is used for detecting the regions with more obvious change and smaller area.
And C: and (3) performing binarization processing on the two obtained filtered images, and performing binarization on the same region for multiple times according to a lighting condition, wherein if 85, 150 and 200 are set as threshold values in a region brightness range of 0-255, 6 template characteristic images can be generated.
The low-pass filtering and the high-pass filtering adopt a low-pass filter based on a Gaussian operator and a high-pass filtering based on a Krisch operator.
The method of the third step is as follows:
selecting a plurality of angular points with obvious characteristics on the template characteristic image, finding out corresponding angular points on a sample to be detected, carrying out affine and perspective transformation on the sample to be detected, and aligning the sample to be detected with the template.
The method of the fourth step is as follows:
and (3) generating 6 sample characteristic images of the sample to be detected by the method of the second step, comparing the 6 sample characteristic images with the 6 template characteristic images generated by the second step, and restricting the precision of the defect by setting a gray difference threshold, a defect width threshold, a defect area threshold and the like because the sample characteristic images are not completely the same as the template characteristic images.
The present invention is not limited to the above-mentioned embodiments, and based on the technical solutions disclosed in the present invention, those skilled in the art can make some substitutions and modifications to some technical features without creative efforts according to the disclosed technical contents, and these substitutions and modifications are all within the protection scope of the present invention.

Claims (5)

1. A label defect detection method based on template comparison is characterized by comprising the following steps:
the method comprises the following steps: selecting a template image;
step two: making a template, generating a plurality of template characteristic images, and making a standard model of an object or a region to be detected;
step three: carrying out picture calibration on a sample to be detected;
step four: acquiring a template characteristic image, and comparing the template characteristic image with the sample characteristic image;
step five: and (4) testing the characteristic images of the multiple samples to be detected, judging whether the accuracy rate reaches the standard, and directly jumping to the step one to manufacture the template again if the accuracy rate does not reach the standard.
2. The method for detecting label defects based on template comparison as claimed in claim 1, wherein the method for making the template in the second step is as follows:
step S1: selecting a to-be-detected object without defects to take a picture, and selecting an area to be detected in the picture or the whole object to perform template manufacturing according to needs;
step S2: the two filtered images are obtained by filtering the regions through low-pass filtering and high-pass filtering, the low-pass filtering is used for removing the defects of the regions with higher change frequency in the background and larger detection area, and the high-pass filtering is used for detecting the regions with more obvious change and smaller area.
Step S3: and (3) performing binarization processing on the two obtained filtered images, and performing binarization on the same region for multiple times according to a lighting condition, wherein if 85, 150 and 200 are set as threshold values in a region brightness range of 0-255, 6 template characteristic images can be generated.
3. The method of claim 2, wherein the method comprises: the low-pass filtering and the high-pass filtering adopt a low-pass filter based on a Gaussian operator and a high-pass filtering based on a Krisch operator.
4. The method for detecting the label defect based on the template comparison as claimed in claim 1, wherein the method of the third step is as follows:
selecting a plurality of angular points with obvious characteristics on the template characteristic image, finding out corresponding angular points on a sample to be detected, carrying out affine and perspective transformation on the sample to be detected, and aligning the sample to be detected with the template.
5. The method for detecting the label defect based on the template comparison as claimed in claim 1, wherein the method of the fourth step is as follows:
and (3) generating 6 sample characteristic images of the sample to be detected by the method of the second step, comparing the 6 sample characteristic images with the 6 template characteristic images generated by the second step, and restricting the precision of the defect by setting a gray difference threshold, a defect width threshold, a defect area threshold and the like because the sample characteristic images are not completely the same as the template characteristic images.
CN202110972099.1A 2021-08-24 2021-08-24 Label defect detection method based on template comparison Withdrawn CN113850756A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110972099.1A CN113850756A (en) 2021-08-24 2021-08-24 Label defect detection method based on template comparison

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110972099.1A CN113850756A (en) 2021-08-24 2021-08-24 Label defect detection method based on template comparison

Publications (1)

Publication Number Publication Date
CN113850756A true CN113850756A (en) 2021-12-28

Family

ID=78976067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110972099.1A Withdrawn CN113850756A (en) 2021-08-24 2021-08-24 Label defect detection method based on template comparison

Country Status (1)

Country Link
CN (1) CN113850756A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114354491A (en) * 2021-12-30 2022-04-15 苏州精创光学仪器有限公司 DCB ceramic substrate defect detection method based on machine vision

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114354491A (en) * 2021-12-30 2022-04-15 苏州精创光学仪器有限公司 DCB ceramic substrate defect detection method based on machine vision

Similar Documents

Publication Publication Date Title
WO2022062812A1 (en) Screen defect detection method, apparatus, and electronic device
CN107705288B (en) Infrared video detection method for dangerous gas leakage under strong interference of pseudo-target motion
US7480407B2 (en) Surface region identification by image area segmentation
CN109242853B (en) PCB defect intelligent detection method based on image processing
CN109472271B (en) Printed circuit board image contour extraction method and device
CN114240939B (en) Method, system, equipment and medium for detecting appearance defects of mainboard components
CN112308854B (en) Automatic detection method and system for chip surface flaws and electronic equipment
CN113034488B (en) Visual inspection method for ink-jet printed matter
JP2004077164A (en) Defect inspection method
CN112767369A (en) Defect identification and detection method and device for small hardware and computer readable storage medium
CN114820627A (en) Textile quality detection method based on optical means
CN113706490B (en) Wafer defect detection method
CN114463296B (en) Light-weight part defect detection method based on single sample learning
CN104118609A (en) Labeling quality detecting method and device
CN106228541A (en) The method and device of screen location in vision-based detection
JP2008175588A (en) Visual examination device
CN111739003B (en) Machine vision method for appearance detection
CN111426693A (en) Quality defect detection system and detection method thereof
CN113269769A (en) Defect detection method, system and equipment based on image registration
CN113850756A (en) Label defect detection method based on template comparison
JP2012108026A (en) Detection method of foreign material-contaminated product
CN111724375A (en) Screen detection method and system
Jahangir Alam et al. Analysis of a printed complex image quality checking method of fabric cloth for development of an automated quality checking system
CN113192061B (en) Extraction method and device of LED package appearance detection image, electronic equipment and storage medium
CN115239690A (en) PCB line sequence detection method and system based on image recognition

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
TA01 Transfer of patent application right

Effective date of registration: 20230109

Address after: 271100 douxianmen village, Gaozhuang sub district office, Laiwu District, Jinan City, Shandong Province

Applicant after: HUANENG LAIWU POWER GENERATION Co.,Ltd.

Applicant after: Jingrui vision intelligent technology (Shanghai) Co.,Ltd.

Address before: 200333 room 808, 8th floor, No.6 Lane 600, Yunling West Road, Putuo District, Shanghai

Applicant before: Jingrui vision intelligent technology (Shanghai) Co.,Ltd.

TA01 Transfer of patent application right
WW01 Invention patent application withdrawn after publication

Application publication date: 20211228

WW01 Invention patent application withdrawn after publication