CN109816640B - Product verification method based on picture comparison - Google Patents

Product verification method based on picture comparison Download PDF

Info

Publication number
CN109816640B
CN109816640B CN201910014861.8A CN201910014861A CN109816640B CN 109816640 B CN109816640 B CN 109816640B CN 201910014861 A CN201910014861 A CN 201910014861A CN 109816640 B CN109816640 B CN 109816640B
Authority
CN
China
Prior art keywords
picture
template
sample
translation
dividing
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
CN201910014861.8A
Other languages
Chinese (zh)
Other versions
CN109816640A (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.)
Nanjing Fujitsu Nanda Software Technology Co Ltd
Original Assignee
Nanjing Fujitsu Nanda Software Technology 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 Nanjing Fujitsu Nanda Software Technology Co Ltd filed Critical Nanjing Fujitsu Nanda Software Technology Co Ltd
Priority to CN201910014861.8A priority Critical patent/CN109816640B/en
Publication of CN109816640A publication Critical patent/CN109816640A/en
Application granted granted Critical
Publication of CN109816640B publication Critical patent/CN109816640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention provides a product verification method based on image comparison, which comprises the following steps: scanning a sample template and a first sample printed in batches to obtain a template picture and a sample picture respectively, and performing binarization processing on the template picture and the sample picture respectively; performing template matching operation on the sample picture and the template picture; taking the matching coincident point as a reference, carrying out multi-scale translation on the comparison reference point of the sample picture according to a coordinate system with the vertical X direction and the Y direction to obtain a translation sample picture set; dividing each translation sample picture in the template picture and the translation sample picture set into a plurality of small pictures according to the same dividing position so as to obtain a template divided picture set and a translation sample divided picture set respectively; and performing exclusive OR operation on the template segmentation picture set and the segmentation pictures at the same position in each translation sample segmentation picture set.

Description

Product verification method based on picture comparison
Technical Field
The invention relates to a product verification method based on picture comparison, and belongs to the technical field of picture processing.
Background
With the economic development, the material demands of people gradually show personalized trends, and new requirements are also put forward for factory production. In the past, factory production has been mass production in one production line and the same product has been produced. But will present the production needs of small-scale and multi-variety in the future. Labels, certificates, nameplates, etc. attached to the products are not product bodies, but are also part of the products, and accurate information is required. For the case that the information on the product body and the nameplate/label/qualification and the like are inconsistent, the product body is qualitatively the defective product, so whether the nameplate/label/qualification is correct is also important.
Currently, the fabrication of nameplates/labels/qualifiers in factories is prepared in 2 steps of sample and lot. After the sample is made, a plurality of people will normally perform a confirmation signature to ensure correctness. Then, when printing in batches, the first sheet of the batch is compared with the sample, and the signature is confirmed by a plurality of persons. This process results in high mental stress on workers and high personnel costs. In order to improve the efficiency of comparing the first sheets printed in batches with the samples and improve the physical and psychological health condition of workers, a solution for realizing accurate comparison by an image technology is proposed.
Disclosure of Invention
The invention aims to provide a product verification method based on image comparison.
The technical scheme adopted by the invention is as follows: the product verification method based on image comparison comprises the following steps:
step one: scanning a sample template and a first sample printed in batches to obtain a template picture and a sample picture respectively, and performing binarization processing on the template picture and the sample picture respectively;
step two: performing template matching operation on the sample picture and the template picture, setting the matching precision to be not less than 50-90%, and if matching is successful, obtaining a matching coincidence point of the sample picture and the template picture; if the matching is unsuccessful, a matching coincidence point cannot be obtained, and the processing is stopped;
step three: taking the matching coincident point as a reference, carrying out multi-scale translation on the comparison reference point of the sample picture according to a set translation scale by taking the vertical X direction and the Y direction as a coordinate system to obtain a translation sample picture set, wherein the translation sample picture set is { translation sample picture 1, translation sample picture 2, translation sample pictures 3 and …, and translation sample picture N };
step four: dividing each translation sample picture in the template picture and the translation sample picture set into a plurality of small pictures according to the same dividing position so as to respectively obtain a template dividing picture set and N translation sample dividing picture sets, wherein the template dividing picture set is { a template dividing picture 1, a template dividing picture 2, template dividing pictures 3 and … and a template dividing picture N };
step five: and D, respectively performing exclusive OR operation on the template segmentation picture set obtained in the step four and the segmentation pictures at the same position in each translation sample segmentation picture set, and selecting the picture with the minimum pixel number and 1 pixel value from exclusive OR operation results as an exclusive OR result picture.
Preferably, the method further comprises the following steps after the fifth step:
step six: carrying out or operation on the exclusive or result picture obtained in the fifth step and the split pictures in the N translation sample split picture sets according to the same position;
step seven: splicing the result pictures obtained by the OR operation according to the dividing positions to form a first new picture, splicing the exclusive-or result pictures obtained by the exclusive-or operation according to the dividing positions to form a second new picture, and subtracting the first new picture from the second new picture to obtain a third new picture;
step eight: and feeding back the position information with the pixel value of 1 in the third new picture to the binarized template picture, so as to obtain different contents of the template picture and the sample picture.
Preferably, in step seven, morphological expansion processing is performed on the first new picture, and the second new picture is subtracted from the first new picture after expansion processing to obtain a third new picture.
Preferably, the expansion coefficient is positively correlated with the size of the connected domain in the picture, and the expansion coefficient is subjected to step value according to the size of the connected domain.
Preferably, in the second step, a central region ROI of the sample picture is selected to perform a template matching operation with the template picture, and the area of the central region ROI is not less than 1/4 of the sample picture.
The beneficial effects of the invention are as follows:
the invention provides a product verification method based on image comparison, which is characterized in that after binarization processing is respectively carried out on a template image and a sample image, segmentation, exclusive-OR operation and/or operation are carried out, so that the matching operation can be carried out on the template image and the sample image efficiently and accurately, different positions can be output accurately, and the comparison efficiency and the comparison accuracy are improved.
Detailed Description
The invention is further described in connection with the following detailed description, in order to make the technical means, the creation characteristics, the achievement of the purpose and the effect of the invention easy to understand.
The invention provides a product verification method based on picture comparison, which is used for matching and comparing a template picture with a first sample picture printed in batches, so that it is determined that a plane printing indication label such as a nameplate/label/qualification certificate cannot be wrong in a factory, and the defective rate is reduced.
Specifically, a product verification method based on image comparison comprises the following steps:
step one: scanning a sample template and a first sample printed in batches to obtain a template picture and a sample picture respectively, and performing binarization processing on the template picture and the sample picture respectively;
step two: performing template matching operation on the sample picture and the template picture, setting the matching precision to be not less than 50-90%, and if matching is successful, obtaining a matching coincidence point of the sample picture and the template picture; if the matching is unsuccessful, a matching coincidence point cannot be obtained, and the processing is stopped;
step three: taking the matching coincident point as a reference, carrying out multi-scale translation on the comparison reference point of the sample picture according to a set translation scale by taking the vertical X direction and the Y direction as a coordinate system to obtain a translation sample picture set, wherein the translation sample picture set is { translation sample picture 1, translation sample picture 2, translation sample pictures 3 and …, and translation sample picture N };
step four: dividing each of the template picture and the translation sample picture in the translation sample picture set into a plurality of small pictures according to the same dividing position so as to respectively obtain a template division picture set and N translation sample division picture sets, wherein the template division picture set is { template division picture 1, template division picture 2, template division picture 3, … and template division picture N }, and the translation sample picture 1 in the translation sample division picture set is { translation sample picture 1 division 1, translation sample picture 1 division 2, translation sample picture 1 division 3, …, translation sample picture 1 division N }, and so on;
step five: respectively performing exclusive-or operation on the template segmentation picture set obtained in the fourth step and the segmentation pictures at the same position in each translation sample segmentation picture set, and selecting a picture with the minimum pixel number and 1 pixel value from exclusive-or operation results as an exclusive-or result picture, for example, such as: the template segmentation picture 1 and the translation sample picture 1 are subjected to exclusive or operation, the template segmentation picture 1 and the translation sample picture 2 are subjected to exclusive or operation, …, the template segmentation picture 1 and the translation sample picture N are subjected to exclusive or operation, and so on;
step six: carrying out or operation on the exclusive or result picture obtained in the fifth step and the divided pictures in the N translation sample divided picture sets according to the same position, so as to ensure the integrity of a comparison result;
step seven: splicing the result pictures obtained by the OR operation according to the dividing positions to form a first new picture, splicing the exclusive-or result pictures obtained by the exclusive-or operation according to the dividing positions to form a second new picture, and subtracting the first new picture from the second new picture to obtain a third new picture;
step eight: and feeding back the position information with the pixel value of 1 in the third new picture to the binarized template picture, so as to obtain different contents of the template picture and the sample picture.
In the second step, selecting a central region ROI of the sample picture and the template picture to perform template matching operation, wherein the area of the central region ROI is not less than 1/4 of the sample picture; moreover, it is preferable that the matching accuracy is not less than 90% to improve the accuracy of matching coincident point selection.
In addition, in order to remove the noise problem in the picture, in step seven, morphological expansion processing is performed on the first new picture, and the second new picture is subtracted from the first new picture after expansion processing to obtain a third new picture. And the expansion coefficient is positively correlated with the size of the connected domain in the picture, and the expansion coefficient is subjected to step value according to the size of the connected domain.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.

Claims (4)

1. The product verification method based on image comparison is characterized by comprising the following steps of:
step one: scanning a sample template and a first sample printed in batches to obtain a template picture and a sample picture respectively, and performing binarization processing on the template picture and the sample picture respectively;
step two: performing template matching operation on the sample picture and the template picture, setting the matching precision to be not less than 50-90%, and if matching is successful, obtaining a matching coincidence point of the sample picture and the template picture; if the matching is unsuccessful, a matching coincidence point cannot be obtained, and the processing is stopped;
step three: taking the matching coincident point as a reference, carrying out multi-scale translation on the comparison reference point of the sample picture according to a set translation scale by taking the vertical X direction and the Y direction as a coordinate system to obtain a translation sample picture set, wherein the translation sample picture set is { translation sample picture 1, translation sample picture 2, translation sample pictures 3 and …, and translation sample picture N };
step four: dividing each translation sample picture in the template picture and the translation sample picture set into a plurality of small pictures according to the same dividing position so as to respectively obtain a template dividing picture set and N translation sample dividing picture sets, wherein the template dividing picture set is { a template dividing picture 1, a template dividing picture 2, template dividing pictures 3 and … and a template dividing picture N };
step five: respectively carrying out exclusive or operation on the template segmentation picture set obtained in the step four and the segmentation pictures at the same position in each translation sample segmentation picture set, and selecting a picture with the minimum pixel number and 1 pixel value from exclusive or operation results as an exclusive or result picture;
step six: carrying out or operation on the exclusive or result picture obtained in the fifth step and the split pictures in the N translation sample split picture sets according to the same position;
step seven: splicing the result pictures obtained by the OR operation according to the dividing positions to form a first new picture, splicing the exclusive-or result pictures obtained by the exclusive-or operation according to the dividing positions to form a second new picture, and subtracting the first new picture from the second new picture to obtain a third new picture;
step eight: and feeding back the position information with the pixel value of 1 in the third new picture to the binarized template picture, so as to obtain different contents of the template picture and the sample picture.
2. The picture contrast-based product verification method as claimed in claim 1, wherein: in the seventh step, morphological expansion processing is performed on the first new picture, and the second new picture is subtracted from the first new picture after expansion processing to obtain a third new picture.
3. The picture contrast-based product verification method as claimed in claim 2, wherein: the expansion coefficient is positively correlated with the size of the connected domain in the picture, and the expansion coefficient is subjected to step value according to the size of the connected domain.
4. The picture contrast-based product verification method as claimed in claim 1, wherein: in the second step, a central region ROI of the sample picture is selected to perform template matching operation with the template picture, and the area of the central region ROI is not less than 1/4 of the sample picture.
CN201910014861.8A 2019-01-08 2019-01-08 Product verification method based on picture comparison Active CN109816640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910014861.8A CN109816640B (en) 2019-01-08 2019-01-08 Product verification method based on picture comparison

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910014861.8A CN109816640B (en) 2019-01-08 2019-01-08 Product verification method based on picture comparison

Publications (2)

Publication Number Publication Date
CN109816640A CN109816640A (en) 2019-05-28
CN109816640B true CN109816640B (en) 2023-05-12

Family

ID=66604173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910014861.8A Active CN109816640B (en) 2019-01-08 2019-01-08 Product verification method based on picture comparison

Country Status (1)

Country Link
CN (1) CN109816640B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147838B (en) * 2019-05-20 2021-07-02 苏州微创关节医疗科技有限公司 Product specification inputting and detecting method and system
CN112417187A (en) * 2020-11-25 2021-02-26 山东浪潮商用系统有限公司 Multi-picture comparison method based on NFS

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104200204A (en) * 2014-09-02 2014-12-10 福建富士通信息软件有限公司 Picture processing device and method
CN106326887A (en) * 2016-08-29 2017-01-11 东方网力科技股份有限公司 Method and device for checking optical character recognition result
CN106682698A (en) * 2016-12-29 2017-05-17 成都数联铭品科技有限公司 OCR identification method based on template matching
CN107506767A (en) * 2017-09-22 2017-12-22 江苏海事职业技术学院 The method and apparatus of digital adhesion identification in a kind of picture

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104200204A (en) * 2014-09-02 2014-12-10 福建富士通信息软件有限公司 Picture processing device and method
CN106326887A (en) * 2016-08-29 2017-01-11 东方网力科技股份有限公司 Method and device for checking optical character recognition result
CN106682698A (en) * 2016-12-29 2017-05-17 成都数联铭品科技有限公司 OCR identification method based on template matching
CN107506767A (en) * 2017-09-22 2017-12-22 江苏海事职业技术学院 The method and apparatus of digital adhesion identification in a kind of picture

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于模板匹配方法的不均匀照度车牌图像识别;凌翔等;《重庆交通大学学报(自然科学版)》;20180702(第08期);全文 *

Also Published As

Publication number Publication date
CN109816640A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN103439348B (en) Remote controller key defect detection method based on difference image method
CN106934800B (en) Metal plate strip surface defect detection method and device based on YOLO9000 network
CN103745475B (en) Detection and positioning method used for spherical pin element
CN109816640B (en) Product verification method based on picture comparison
CN109308700A (en) A kind of visual identity defect inspection method based on printed matter character
US9733200B2 (en) Defect judging device, radiography system, and defect judging method
CN111080622A (en) Neural network training method, workpiece surface defect classification and detection method and device
CN104318573B (en) Label defect inspection method
CN105184770A (en) Solder ball positioning and parameter identification method for ball grid array pin chip
CN111259184B (en) Image automatic labeling system and method for new retail
CN110705486B (en) Method for identifying inclined digital on express bill based on video image
CN110287940B (en) Palm print identification method and system based on artificial intelligence
CN113920117A (en) Panel defect area detection method and device, electronic equipment and storage medium
CN109919154B (en) Intelligent character recognition method and device
CN103531498B (en) Wafer defect analytical system
CN111105396A (en) Printed matter quality detection method and system based on artificial intelligence
CN116309597B (en) Visual on-line detection method and device for medicine box mixed-loading defects
CN103177416B (en) A kind of QR code image position method based on least square method
CN116071365A (en) Part detection method, device, equipment and storage medium
CN113808108B (en) Visual detection method and system for defects of printing film
CN107516309B (en) Visual inspection method for defects of printing panel
CN109065474B (en) Automatic inking method for wafer defects
CN112435041A (en) Production batch tracking code generation method and device based on quality tracing
CN105044941B (en) The size detecting method of litho pattern
CN103677474A (en) High-precision small-piece collaging system for preparing monolithic integrated capacitive touch screen

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