CN114677373A - Printed matter content error detection method and device, electronic equipment and medium - Google Patents

Printed matter content error detection method and device, electronic equipment and medium Download PDF

Info

Publication number
CN114677373A
CN114677373A CN202210583860.7A CN202210583860A CN114677373A CN 114677373 A CN114677373 A CN 114677373A CN 202210583860 A CN202210583860 A CN 202210583860A CN 114677373 A CN114677373 A CN 114677373A
Authority
CN
China
Prior art keywords
image
detected
printed matter
gray scale
target contour
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
Application number
CN202210583860.7A
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.)
Guangzhou Qinglian Network Technology Co ltd
Original Assignee
Guangzhou Qinglian Network 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 Guangzhou Qinglian Network Technology Co ltd filed Critical Guangzhou Qinglian Network Technology Co ltd
Priority to CN202210583860.7A priority Critical patent/CN114677373A/en
Publication of CN114677373A publication Critical patent/CN114677373A/en
Pending 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/608Rotation of whole images or parts thereof by skew deformation, e.g. two-pass or three-pass rotation

Landscapes

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

Abstract

The invention relates to the technical field of computer vision processing, and aims to provide a method and a device for detecting errors of printed matter contents, electronic equipment and a medium. The method comprises the following steps: acquiring an initial electronic document corresponding to a to-be-detected printed matter, and acquiring a standard image corresponding to the to-be-detected printed matter according to the initial electronic document; carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter; comparing and detecting the standard image and the image to be detected to obtain a detection result of the printed matter to be detected; and obtaining the yield of the printed matter of the same batch with the printed matter to be detected according to all detection results of the printed matter of the same batch with the printed matter to be detected. The invention can realize automatic detection of the printed matter, has high detection precision and can effectively save the labor cost.

Description

Printed matter content error detection method and device, electronic equipment and medium
Technical Field
The invention relates to the technical field of computer vision processing, in particular to a method and a device for detecting errors of printed matter contents, electronic equipment and a medium.
Background
Printed matters such as labels and specifications of various parts of products are various, and contents such as key information of the parts are mainly recorded, but problems such as missing printing and error printing easily occur in the process of batch printing of the printed matters, so that the contents of the printed matters need to be corrected and checked after the printed matters are printed.
At present, the method for detecting errors of printed matters such as labels, specifications and the like mainly comprises the step of comparing printed contents line by line according to initial electronic documents of the printed matters by equipping full-time proofreaders. However, in the process of using the prior art, the inventor finds that at least the following problems exist in the prior art: firstly, the working quality of the proofreading personnel is difficult to evaluate and supervise; in addition, the non-defective rate of the printed products is inconvenient to accurately count, and the counting difficulty is high; finally, when the number of printed matters is large, a plurality of dedicated proofreaders are often required to be equipped, so that the labor cost for proofreading is high.
Disclosure of Invention
The present invention is directed to solve the above technical problems to at least some extent, and the present invention provides a method and an apparatus for error detection of printed matter content, an electronic device, and a medium.
The technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for detecting errors in printed matter content, comprising:
acquiring an initial electronic document corresponding to a to-be-detected printed matter, and obtaining a standard image corresponding to the to-be-detected printed matter according to the initial electronic document;
carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter;
comparing and detecting the standard image and the image to be detected to obtain a detection result of the printed matter to be detected;
and obtaining the yield of the printed matters in the same batch with the printed matters to be detected according to all detection results of the printed matters in the same batch with the printed matters to be detected.
The invention can realize automatic detection of the printed matter, has high detection precision and can effectively save the labor cost. Specifically, in the implementation process, the initial electronic document corresponding to the to-be-detected printed matter and the standard image corresponding to the to-be-detected printed matter are obtained, the corresponding to-be-detected image is obtained by carrying out image acquisition processing on the to-be-detected printed matter, then the standard image and the to-be-detected image are compared and detected to obtain the detection result of the to-be-detected printed matter, and finally the yield of the to-be-detected printed matter in the same batch is obtained based on all the detection results according to the to-be-detected printed matter in the same batch. In the process, the standard image corresponding to the printed matter to be detected and the image to be detected corresponding to the printed matter to be detected are executed through the machine, automatic detection is achieved based on the machine, the detection is efficient and convenient, the problem that manual correction causes quality control difficulty and detection accuracy control difficulty is solved, and meanwhile labor cost can be effectively saved.
In one possible design, obtaining an initial electronic document corresponding to a to-be-tested printed matter, and obtaining a standard image corresponding to the to-be-tested printed matter according to the initial electronic document, includes:
acquiring a presswork number corresponding to a presswork to be detected, and acquiring an initial electronic document corresponding to the presswork to be detected according to the presswork number;
and performing image conversion on the initial electronic document to obtain a standard image corresponding to the to-be-detected printed matter.
In one possible design, performing image conversion on the initial electronic document to obtain a standard image corresponding to the to-be-detected printed matter, includes:
acquiring the format type of the initial electronic document, and performing image conversion on different types of the initial electronic documents according to the following steps:
if the initial electronic document is in doc format or docx format, converting the initial electronic document into pdf format data by using pdfboss-word for Python, and then converting the pdf format data into image format data by using pdf2image to obtain a standard image corresponding to the to-be-detected printed matter;
if the initial electronic document is in pdf format, converting the initial electronic document into data in image format by using a pdf2image library to obtain a standard image corresponding to the to-be-detected printed matter;
and if the initial electronic document is in an image format, directly outputting the initial electronic document as a standard image corresponding to the to-be-detected printed matter.
In one possible design, the image acquisition processing is performed on the to-be-detected printed matter to obtain the to-be-detected image corresponding to the to-be-detected printed matter, and the image acquisition processing includes:
carrying out image acquisition processing on the to-be-detected printed matter to obtain image acquisition information corresponding to the to-be-detected printed matter;
carrying out mean filtering on the image acquisition information so as to remove noise data in the image acquisition information and obtain a filtered image;
carrying out contour extraction processing on the filtered image so as to remove background image data in the filtered image and obtain a target contour image corresponding to the to-be-detected printed matter;
carrying out angle correction processing on the target contour image to obtain a corrected target contour image;
and acquiring pixel information corresponding to the corrected target contour image from the image acquisition information, and acquiring an image to be detected according to the corrected target contour image and the pixel information corresponding to the corrected target contour image.
In one possible design, the target outline image is a rectangular image; carrying out angle correction processing on the target contour image, wherein the angle correction processing comprises the following steps:
acquiring the vertex coordinates of the target contour image, and obtaining a rotation angle according to the vertex coordinates of the target contour imageαWherein the angle of rotationαComprises the following steps:
Figure 754925DEST_PATH_IMAGE001
wherein, the first and the second end of the pipe are connected with each other,x 1 the abscissa of the vertex at the upper left corner of the target contour image,y 1 is the ordinate of the top left corner vertex of the target contour image,x 2 as the abscissa of the vertex of the upper right corner of the target contour image,y 2 the vertical coordinate of the top right corner vertex of the target contour image is taken as the vertical coordinate;
according to the angle of rotationαObtaining a transformation matrix corresponding to the target contour imageMWherein the matrix is transformedMComprises the following steps:
Figure 892646DEST_PATH_IMAGE002
according to the transformation matrixMAnd rotating the target contour image to obtain a corrected target contour image, wherein the vertex coordinates of the corrected target contour image are as follows:
Figure DEST_PATH_IMAGE003
Figure 574425DEST_PATH_IMAGE004
wherein, the [ alpha ], [ beta ] -ax 1 ’,y 1 ]To correct the coordinate of the apex of the upper left corner of the target contour image, [ alpha ] of the upper left corner of the target contour imagex 2 ’,y 2 ]The coordinates of the vertex at the upper right corner of the corrected target contour image are obtained.
In one possible design, the comparing and detecting the standard image and the image to be detected includes:
respectively calculating the gray value of each pixel point in the standard image and the image to be detected, and obtaining a first gray map corresponding to the standard image and a second gray map corresponding to the image to be detected according to all the gray values in the standard image and the image to be detected;
respectively carrying out region division on the first gray scale image and the second gray scale image to obtain a plurality of blocks corresponding to the first gray scale image and a plurality of blocks corresponding to the second gray scale image;
and comparing and detecting a plurality of blocks corresponding to the first gray scale image and a plurality of blocks corresponding to the second gray scale image one by one so as to realize the comparison and detection of the standard image and the image to be detected.
In one possible design, comparing and detecting a plurality of blocks corresponding to the first gray scale map and a plurality of blocks corresponding to the second gray scale map one by one includes:
acquiring a first block in the designated area of the first gray scale map and a second block in the designated area of the second gray scale map, and calculating the similarity between the first gray scale map and the second gray scale map by adopting a normalization product correlation gray scale matching method, wherein the similarity is the detection result of the to-be-detected printed matter; wherein the similarity is:
Figure DEST_PATH_IMAGE005
wherein the content of the first and second substances,S(m,n) Is the first gray scale imagemGo to the firstnThe gray function of the block of columns,T(m,n) Is the first in the second gray scale mapmGo to the firstnA gray function of blocks of columns, M being the maximum number of rows of blocks in the first gray scale map or the second gray scale map, N being the maximum number of columns of blocks in the first gray scale map or the second gray scale map,R(m,n) Is the similarity between the first and second gray scale maps.
In a second aspect, the invention provides a printed matter content error detection apparatus for implementing the printed matter content error detection method according to any one of the above items; the printed matter content error detection device comprises:
a standard image acquisition module: the system comprises a processing unit, a processing unit and a processing unit, wherein the processing unit is used for acquiring an initial electronic document corresponding to a to-be-detected printed matter and acquiring a standard image corresponding to the to-be-detected printed matter according to the initial electronic document;
the to-be-detected image acquisition module is used for carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter;
the image detection module is respectively in communication connection with the standard image acquisition module and the to-be-detected image acquisition module and is used for comparing and detecting the standard image and the to-be-detected image to obtain a detection result of the to-be-detected printed matter;
and the yield calculation module is in communication connection with the image detection module and is used for obtaining the yield of the printed matters in the same batch with the printed matters to be detected according to all detection results of the printed matters in the same batch with the printed matters to be detected.
In a third aspect, the present invention provides an electronic device, comprising:
a memory for storing computer program instructions; and the number of the first and second groups,
a processor for executing the computer program instructions to perform the operations of the print content error detection method as described in any one of the above.
In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-readable computer program instructions configured to, when executed, perform operations of the print content error detection method as in any one of the above.
Drawings
FIG. 1 is a flow chart of a method of error detection of printed matter content in accordance with the present invention;
FIG. 2 is a block diagram of a method for error detection of print content in accordance with the present invention.
Detailed Description
The invention is further described with reference to the following figures and specific embodiments.
It will be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another.
It should be understood that, for the term "and/or" as may appear herein, it is merely an associative relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, B exists alone, and A and B exist at the same time.
It should also be noted that, in some alternative implementations, the functions/acts noted may occur out of the order noted in the figures. For example, two figures shown in succession may, in fact, be executed substantially concurrently, or the figures may sometimes be executed in the reverse order, depending upon the functionality/acts involved.
Example 1:
in a first aspect, the present embodiment provides a method for detecting an error in content of a printed matter, which may be, but is not limited to be, executed by a computer device or a virtual machine with certain computing resources, for example, executed by an electronic device such as a personal computer, a smart phone, a personal digital assistant, or a wearable device, or executed by a virtual machine, so as to implement automatic detection on the printed matter, and improve detection efficiency and accuracy.
As shown in fig. 1, a method for detecting an error in the content of a printed matter may include, but is not limited to, the following steps:
s1, obtaining an initial electronic document corresponding to a to-be-detected printed matter, and obtaining a standard image corresponding to the to-be-detected printed matter according to the initial electronic document; it should be noted that, in this embodiment, the initial electronic documents corresponding to all the prints to be tested, and the identification information such as the print serial number and the product model are pre-stored in the server of the product archive management system, so as to serve as standard information for performing error detection on the prints to be tested. It should be appreciated that the format of the initial electronic document corresponding to the print under test is kept consistent with the format of the print under test in order to reduce the computational effort of the computer during the inspection process.
In step S1, obtaining an initial electronic document corresponding to a printed matter to be tested, and obtaining a standard image corresponding to the printed matter to be tested according to the initial electronic document includes:
s101, acquiring a printed matter number corresponding to a printed matter to be detected, and acquiring an initial electronic document corresponding to the printed matter to be detected according to the printed matter number; specifically, the number of the printed matter can be obtained by the user according to a preset operation manual recorded with printed matter features and corresponding numbers, or can be read from the content printed in advance on the printed matter to be tested by the user, which is not limited herein, so that the computer can quickly retrieve and obtain the initial electronic document pre-stored in the server of the product file management system according to the number of the printed matter.
And S102, performing image conversion on the initial electronic document to obtain a standard image corresponding to the to-be-detected printed matter.
In step S102, performing image conversion on the initial electronic document to obtain a standard image corresponding to the to-be-detected printed matter, including:
acquiring the format type of the initial electronic document, and performing image conversion on different types of the initial electronic documents according to the following steps:
if the initial electronic document is in DOC format or DOCX format, then using pdfbos-Word for Python (a functional rich Python library used for creating and operating Word documents and also used for converting DOCX and DOC files into PDF format files with high fidelity) to convert the initial electronic document into PDF format data, and then using PDF2image (a Python library including one Python2.7 and 3.4+ modules which package pdftoppm and pdftocairo and can convert PDF format files into image files) to convert PDF format data into image format data, so as to obtain a standard image corresponding to the to-be-tested printed product;
if the initial electronic document is in pdf format, converting the initial electronic document into data in image format by using a pdf2image library to obtain a standard image corresponding to the to-be-detected printed matter;
and if the initial electronic document is in an image format, directly outputting the initial electronic document as a standard image corresponding to the to-be-detected printed matter.
And S2, carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter.
In step S2, performing image acquisition processing on the to-be-detected printed matter to obtain an to-be-detected image corresponding to the to-be-detected printed matter, including:
s201, image acquisition processing is carried out on the to-be-detected printed matter, and image acquisition information corresponding to the to-be-detected printed matter is obtained.
S202, performing mean filtering on the image acquisition information so as to remove noise data in the image acquisition information and obtain a filtered image. Specifically, in this embodiment, when performing mean filtering on the image acquisition information, the mean filtering may be implemented by, but not limited to, a blu function (which is a function used by OpenCV for performing image blur processing), and it should be noted that the blu function may perform mean filtering processing on corresponding data by using a normalized box filter, and may process pictures with any number of channels, so that the application range is wide.
S203, carrying out contour extraction processing on the filtered image so as to remove background image data in the filtered image and obtain a target contour image corresponding to the to-be-detected printed matter; it should be noted that, in this embodiment, the target outline image is a circumscribed outline image that includes print content and has the smallest area in the to-be-detected printed matter. Specifically, in this embodiment, when performing the contour extraction process on the filtered image, the contour extraction process may be implemented by, but not limited to, a findContours function (a function that can search for an image contour from a binary image).
S204, carrying out angle correction processing on the target contour image to obtain a corrected target contour image; specifically, in this embodiment, when performing the angle correction on the target contour image, the method may be, but is not limited to, using an open-source computer vision algorithm library OpenCv (which is a cross-platform computer vision and machine learning software library issued based on apache2.0 license), and is not limited herein.
In this embodiment, the target contour image is a rectangular image; carrying out angle correction processing on the target contour image, wherein the angle correction processing comprises the following steps:
s2041, acquiring vertex coordinates of the target contour image, and obtaining a rotation angle according to the vertex coordinates of the target contour imageαWherein the angle of rotationαComprises the following steps:
Figure 250126DEST_PATH_IMAGE001
wherein, the first and the second end of the pipe are connected with each other,x 1 the abscissa of the vertex at the upper left corner of the target contour image,y 1 is the ordinate of the top left corner vertex of the target contour image,x 2 as the abscissa of the vertex of the upper right corner of the target contour image,y 2 and the ordinate of the vertex at the upper right corner of the target contour image.
Specifically, in this embodiment, when obtaining the vertex coordinates of the target outline image, the vertex coordinates may be implemented by, but not limited to, a bounding select function (a function for obtaining a minimum regular rectangle enclosing the outline of the image).
S2042. according to the rotation angleαObtaining a transformation matrix corresponding to the target contour imageMWherein the matrix is transformedMComprises the following steps:
Figure 455979DEST_PATH_IMAGE002
s2043. according to the transformation matrixMAnd rotating the target contour image to obtain a corrected target contour image, wherein the vertex coordinates of the corrected target contour image are as follows:
Figure 182627DEST_PATH_IMAGE003
Figure 769728DEST_PATH_IMAGE004
wherein [ 2 ], [ 2 ]x 1 ’,y 1 ]To correct the coordinates of the vertex at the upper left corner of the target contour image, specifically,x 1 for the abscissa of the vertex at the upper left corner of the corrected target contour image,y 1 in order to correct the ordinate of the apex of the upper left corner of the target profile image after the correction, the value ofx 2 ’, y 2 ]To correct the coordinates of the vertex at the upper right corner of the target contour image, specifically,x 2 for the abscissa of the vertex at the upper right corner of the corrected target contour image,y 2 the vertical coordinate of the vertex at the upper right corner of the corrected target contour image is shown.
Specifically, in this embodiment, the target contour image may be rotated by, but not limited to, using a cvwarp affine function (a function used by OpenCV for performing affine transformation on an image).
S205, pixel information corresponding to the corrected target contour image is obtained from the image acquisition information, and an image to be detected is obtained according to the corrected target contour image and the pixel information corresponding to the corrected target contour image.
Specifically, acquiring pixel information corresponding to the corrected target contour image from the image acquisition information, and obtaining an image to be measured according to the corrected target contour image and the pixel information corresponding to the corrected target contour image, includes:
and S2051, extracting pixel information corresponding to the corrected target contour image from the image acquisition information according to the vertex coordinates of the corrected target contour image.
And S2052, carrying out image fusion processing on the pixel information and the corrected target contour image to obtain an image to be detected.
It should be noted that, if redundant blank image data exists in the standard image corresponding to the initial electronic document, the standard image may be processed according to the processing procedures of the above-mentioned contour extraction processing and angle correction processing in the image to be detected, so as to obtain a final standard image, so as to improve the accuracy of the comparison detection between the standard image and the image to be detected.
It should be understood that, in the present embodiment, the execution order of step S1 and step S2 is not limited, that is, step S1 is executed first or step S2 is executed first, and the present invention is not limited herein.
And S3, comparing and detecting the standard image and the image to be detected to obtain a detection result of the printed matter to be detected.
In step S3, comparing and detecting the standard image and the to-be-detected image, including:
s301, gray values of each pixel point in the standard image and the image to be detected are calculated respectively, and a first gray map corresponding to the standard image and a second gray map corresponding to the image to be detected are obtained according to all the gray values in the standard image and the image to be detected; specifically, in the first grayscale image or the second grayscale image, the grayscale value of the designated pixel point is:
Figure 949037DEST_PATH_IMAGE006
wherein the content of the first and second substances,Gray(i,j)is the first gray scale image or the second gray scale imageiGo to the firstjThe gray values of the column pixels are compared,R(i, j)is the first image in the standard image corresponding to the first gray scale image or the second image to be measured corresponding to the second gray scale imageiGo to the firstjColumn pixel points are onRThe luminance values of the components are then compared,G(i,j)is the first image in the standard image corresponding to the first gray scale image or the second image to be measured corresponding to the second gray scale imageiGo to the firstjColumn pixel points are atGThe luminance values of the components are then compared,B(i,j)is the first image in the standard image corresponding to the first gray scale image or the image to be measured corresponding to the second gray scale imageiGo to the firstjColumn pixel points are atBLuminance values of the components; it should be understood that specifying pixel points correspondsRLuminance values of the components,GLuminance value of component andBthe brightness value of the component constitutes the gray value of the pixel point.
S302, area division is respectively carried out on the first gray scale image and the second gray scale image, and a plurality of blocks corresponding to the first gray scale image and a plurality of blocks corresponding to the second gray scale image are obtained.
And S303, comparing and detecting a plurality of blocks corresponding to the first gray scale image and a plurality of blocks corresponding to the second gray scale image one by one so as to realize the comparison and detection of the standard image and the image to be detected. In this embodiment, a computer vision algorithm is used to compare and detect the plurality of blocks corresponding to the first gray scale map and the plurality of blocks corresponding to the second gray scale map one by one.
It should be further noted that, in this embodiment, the setting of performing comparison detection on the corresponding block after performing area division on the first grayscale image and the second grayscale image may be convenient to improve the accuracy of performing comparison detection on the standard image and the image to be detected.
Specifically, in this embodiment, when the first grayscale image and the second grayscale image are divided into regions, the size of each region is determined based on the sizes of the first grayscale image and the second grayscale image, and then the width-height division interval data of a plurality of blocks is determined, the size of each region can be determined according to the user requirement, so that the problem that the computation amount of a computer is infinitely increased while the contrast detection accuracy is improved is avoided.
Specifically, in step S303, comparing and detecting a plurality of blocks corresponding to the first gray scale map and a plurality of blocks corresponding to the second gray scale map one by one, includes:
acquiring a first block in the designated area of the first gray scale map and a second block in the designated area of the second gray scale map, and calculating the similarity between the first gray scale map and the second gray scale map by adopting a normalization product correlation gray scale matching method, wherein the similarity is the detection result of the to-be-detected printed matter; wherein the similarity is:
Figure 411111DEST_PATH_IMAGE005
wherein, the first and the second end of the pipe are connected with each other,S(m,n) Is the first gray scale imagemGo to the firstnThe gray function of the block of columns,T(m,n) Is the first in the second gray scale mapmGo to the firstnA gray function of blocks of columns, M being the maximum number of rows of blocks in the first gray scale map or the second gray scale map, N being the maximum number of columns of blocks in the first gray scale map or the second gray scale map,R(m,n) Is the similarity between the first and second gray scale maps.
Specifically, in this embodiment, a similarity threshold may be set according to an actual situation, and when the similarity is greater than the similarity threshold, it is determined that the to-be-detected printed matter is qualified in detection, otherwise, it is determined that the to-be-detected printed matter is unqualified in detection. In this embodiment, in the detection process, when the similarity between the designated area of the to-be-detected printed matter and the standard image is smaller than the similarity threshold, the area may be marked, so that the user may quickly confirm and inspect the unqualified area in the to-be-detected printed matter.
In this embodiment, when the standard image and the image to be detected are compared and detected, the method further includes:
judging whether the sizes of the standard image and the image to be detected are the same or not, if so, comparing and detecting the standard image and the image to be detected; if not, converting the size of the standard image and the size of the image to be detected into the same size by using a resize function so as to ensure that the detection areas are aligned, and then comparing and detecting the standard image and the image to be detected after the sizes are converted.
And S4, obtaining the yield of the printed matter of the same batch with the printed matter to be detected according to all detection results of the printed matter of the same batch with the printed matter to be detected.
In this embodiment, the formula for calculating the yield is
Figure 257844DEST_PATH_IMAGE007
Wherein, in the process,R X the yield of the product is high,A X to test the number of acceptable prints,B X is the total number of the printed matters in the same batch with the printed matter to be tested,Xrepresenting the number corresponding to the printed matter of the same batch of the printed matter to be tested.
This embodiment can realize the automated inspection to the printed matter, and it is high to detect the precision simultaneously, can effectively practice thrift the human cost. Specifically, in the implementation process of this embodiment, an initial electronic document corresponding to a to-be-detected printed matter and a standard image corresponding to the to-be-detected printed matter are obtained, an image to be detected is obtained by performing image acquisition processing on the to-be-detected printed matter, then the standard image and the to-be-detected image are subjected to contrast detection to obtain a detection result of the to-be-detected printed matter, and finally, a yield of the to-be-detected printed matter in the same batch is obtained based on all detection results according to the to-be-detected printed matter in the same batch. In the process, the standard image corresponding to the printed matter to be detected and the image to be detected corresponding to the printed matter to be detected are executed through the machine, automatic detection is achieved based on the machine, the detection is efficient and convenient, the problem that manual correction causes quality control difficulty and detection accuracy control difficulty is solved, and meanwhile labor cost can be effectively saved.
Example 2:
the embodiment provides a printed matter content error detection device, which is used for realizing the printed matter content error detection method in the embodiment 1; the printed matter content error detection device comprises:
a standard image acquisition module: the system comprises a processing unit, a processing unit and a processing unit, wherein the processing unit is used for acquiring an initial electronic document corresponding to a to-be-detected printed matter and acquiring a standard image corresponding to the to-be-detected printed matter according to the initial electronic document;
the to-be-detected image acquisition module is used for carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter;
the image detection module is respectively in communication connection with the standard image acquisition module and the to-be-detected image acquisition module and is used for comparing and detecting the standard image and the to-be-detected image to obtain a detection result of the to-be-detected printed matter;
and the yield calculation module is in communication connection with the image detection module and is used for obtaining the yield of the printed matters in the same batch with the printed matters to be detected according to all detection results of the printed matters in the same batch with the printed matters to be detected.
Example 3:
on the basis of embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smart phone, a tablet computer, a notebook computer, or a desktop computer, etc. The electronic device may be referred to as a terminal, a portable terminal, a desktop terminal, or the like, and includes:
a memory for storing computer program instructions; and (c) a second step of,
a processor for executing the computer program instructions to perform the operations of the print content error detection method as described in any of embodiment 1.
Example 4:
on the basis of any embodiment of embodiments 1 to 3, the present embodiment discloses a computer-readable storage medium for storing computer-readable computer program instructions configured to, when executed, perform the operations of the print content error detection method according to embodiment 1.
It should be noted that the functions described herein, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
Finally, it should be noted that the present invention is not limited to the above alternative embodiments, and that various other forms of products can be obtained by anyone in light of the present invention. The above detailed description should not be taken as limiting the scope of the invention, which is defined by the appended claims, which are intended to be interpreted according to the breadth to which the description is entitled.

Claims (10)

1. A method for error detection of printed matter content, comprising: the method comprises the following steps:
acquiring an initial electronic document corresponding to a to-be-detected printed matter, and acquiring a standard image corresponding to the to-be-detected printed matter according to the initial electronic document;
carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter;
comparing and detecting the standard image and the image to be detected to obtain a detection result of the printed matter to be detected;
and obtaining the yield of the printed matter of the same batch with the printed matter to be detected according to all detection results of the printed matter of the same batch with the printed matter to be detected.
2. The method of claim 1, wherein the error detection of the content of the printed matter comprises: the method for obtaining the standard image comprises the following steps of obtaining an initial electronic document corresponding to a to-be-detected printed matter, and obtaining a standard image corresponding to the to-be-detected printed matter according to the initial electronic document:
acquiring a presswork number corresponding to a presswork to be detected, and acquiring an initial electronic document corresponding to the presswork to be detected according to the presswork number;
and performing image conversion on the initial electronic document to obtain a standard image corresponding to the to-be-detected printed matter.
3. The method of claim 2, wherein the error detection of the content of the printed matter comprises: performing image conversion on the initial electronic document to obtain a standard image corresponding to the to-be-detected printed matter, wherein the image conversion comprises the following steps:
acquiring the format type of the initial electronic document, and performing image conversion on different types of the initial electronic documents according to the following steps:
if the initial electronic document is in doc format or docx format, converting the initial electronic document into pdf format data by using pdfboss-word for Python, and then converting the pdf format data into image format data by using pdf2image to obtain a standard image corresponding to the to-be-detected printed matter;
if the initial electronic document is in a pdf format, converting the initial electronic document into data in an image format by using a pdf2image library to obtain a standard image corresponding to the to-be-detected printed matter;
and if the initial electronic document is in an image format, directly outputting the initial electronic document as a standard image corresponding to the to-be-detected printed matter.
4. The method of claim 1, wherein the error detection of the content of the printed matter comprises: carrying out image acquisition processing on the to-be-detected printed matter to obtain to-be-detected images corresponding to the to-be-detected printed matter, wherein the image acquisition processing comprises the following steps:
carrying out image acquisition processing on the to-be-detected printed matter to obtain image acquisition information corresponding to the to-be-detected printed matter;
carrying out mean value filtering on the image acquisition information so as to remove noise data in the image acquisition information and obtain a filtered image;
carrying out contour extraction processing on the filtered image so as to remove background image data in the filtered image and obtain a target contour image corresponding to the to-be-detected printed matter;
carrying out angle correction processing on the target contour image to obtain a corrected target contour image;
and acquiring pixel information corresponding to the corrected target contour image from the image acquisition information, and acquiring an image to be detected according to the corrected target contour image and the pixel information corresponding to the corrected target contour image.
5. The method of claim 4, wherein the error detection of the content of the printed matter comprises: the target outline image is a rectangular image; carrying out angle correction processing on the target contour image, wherein the angle correction processing comprises the following steps:
acquiring the vertex coordinates of the target contour image, and obtaining a rotation angle according to the vertex coordinates of the target contour imageαWherein the angle of rotationαComprises the following steps:
Figure 294912DEST_PATH_IMAGE001
wherein the content of the first and second substances,x 1 the abscissa of the vertex at the upper left corner of the target contour image,y 1 is the ordinate of the top left corner vertex of the target contour image,x 2 as the abscissa of the vertex of the upper right corner of the target contour image,y 2 the vertical coordinate of the vertex of the upper right corner of the target contour image is taken as the vertical coordinate;
according to the angle of rotationαObtaining a transformation matrix corresponding to the target contour imageMWherein, changingMatrix arrayMComprises the following steps:
Figure 877072DEST_PATH_IMAGE002
according to the transformation matrixMAnd rotating the target contour image to obtain a corrected target contour image, wherein the vertex coordinates of the corrected target contour image are as follows:
Figure 894706DEST_PATH_IMAGE003
Figure 920431DEST_PATH_IMAGE004
wherein, the [ alpha ], [ beta ] -ax 1 ’,y 1 ]To correct the coordinate of the apex of the upper left corner of the target contour image, [ alpha ] of the upper left corner of the target contour imagex 2 ’,y 2 ]The coordinates of the vertex at the upper right corner of the corrected target contour image are obtained.
6. The method of claim 1, wherein the error detection of the content of the printed matter comprises: and comparing and detecting the standard image and the image to be detected, wherein the method comprises the following steps:
respectively calculating the gray value of each pixel point in the standard image and the image to be detected, and obtaining a first gray map corresponding to the standard image and a second gray map corresponding to the image to be detected according to all the gray values in the standard image and the image to be detected;
respectively carrying out region division on the first gray scale image and the second gray scale image to obtain a plurality of blocks corresponding to the first gray scale image and a plurality of blocks corresponding to the second gray scale image;
and comparing and detecting a plurality of blocks corresponding to the first gray scale image and a plurality of blocks corresponding to the second gray scale image one by one so as to realize the comparison and detection of the standard image and the image to be detected.
7. The method of claim 6, wherein the error detection of the content of the printed matter comprises: comparing and detecting a plurality of blocks corresponding to the first gray scale map and a plurality of blocks corresponding to the second gray scale map one by one, comprising the following steps:
acquiring a first block in the designated area of the first gray scale map and a second block in the designated area of the second gray scale map, and calculating the similarity between the first gray scale map and the second gray scale map by adopting a normalization product correlation gray scale matching method, wherein the similarity is the detection result of the to-be-detected printed matter; wherein the similarity is:
Figure 887599DEST_PATH_IMAGE005
wherein the content of the first and second substances,S(m,n) Is the first gray scale imagemGo to the firstnThe gray function of the block of columns,T(m,n) Is the first in the second gray scale mapmGo to the firstnA gray function of blocks of columns, M being the maximum number of rows of blocks in the first gray scale map or the second gray scale map, N being the maximum number of columns of blocks in the first gray scale map or the second gray scale map,R(m,n) Is the similarity between the first and second gray scale maps.
8. A printed matter content error detection apparatus, characterized by: for implementing a print content error detection method according to any one of claims 1 to 7; the printed matter content error detection device comprises:
a standard image acquisition module: the system comprises a processing unit, a processing unit and a processing unit, wherein the processing unit is used for acquiring an initial electronic document corresponding to a to-be-detected printed matter and acquiring a standard image corresponding to the to-be-detected printed matter according to the initial electronic document;
the to-be-detected image acquisition module is used for carrying out image acquisition processing on the to-be-detected printed matter to obtain a to-be-detected image corresponding to the to-be-detected printed matter;
the image detection module is respectively in communication connection with the standard image acquisition module and the to-be-detected image acquisition module and is used for comparing and detecting the standard image and the to-be-detected image to obtain a detection result of the to-be-detected printed matter;
and the yield calculation module is in communication connection with the image detection module and is used for obtaining the yield of the printed matters in the same batch with the printed matters to be detected according to all detection results of the printed matters in the same batch with the printed matters to be detected.
9. An electronic device, characterized in that: the method comprises the following steps:
a memory for storing computer program instructions; and the number of the first and second groups,
a processor for executing the computer program instructions to perform the operations of the print content error detection method of any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-readable computer program instructions, characterized in that: the computer program instructions are configured to perform the operations of the print content error detection method of any of claims 1 to 7 when executed.
CN202210583860.7A 2022-05-27 2022-05-27 Printed matter content error detection method and device, electronic equipment and medium Pending CN114677373A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210583860.7A CN114677373A (en) 2022-05-27 2022-05-27 Printed matter content error detection method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210583860.7A CN114677373A (en) 2022-05-27 2022-05-27 Printed matter content error detection method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN114677373A true CN114677373A (en) 2022-06-28

Family

ID=82079347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210583860.7A Pending CN114677373A (en) 2022-05-27 2022-05-27 Printed matter content error detection method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114677373A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009319A (en) * 2023-08-07 2023-11-07 广州青莲网络科技有限公司 Database operation method, system and storage medium based on large language model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015114833A1 (en) * 2014-02-03 2015-08-06 株式会社プロスパークリエイティブ Image inspecting device and image inspecting program
CN105117704A (en) * 2015-08-25 2015-12-02 电子科技大学 Text image consistency comparison method based on multiple features
CN107832024A (en) * 2017-11-09 2018-03-23 山形印刷(无锡)有限公司 A kind of printing process for preventing printed data mistake and print system
CN110675376A (en) * 2019-09-20 2020-01-10 福建工程学院 PCB defect detection method based on template matching
CN110940670A (en) * 2019-11-25 2020-03-31 佛山缔乐视觉科技有限公司 Flexible printing label printing head draft detection system based on machine vision and implementation method thereof
CN112085707A (en) * 2020-08-18 2020-12-15 北京华夏视科技术股份有限公司 Printed matter color detection method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015114833A1 (en) * 2014-02-03 2015-08-06 株式会社プロスパークリエイティブ Image inspecting device and image inspecting program
CN105117704A (en) * 2015-08-25 2015-12-02 电子科技大学 Text image consistency comparison method based on multiple features
CN107832024A (en) * 2017-11-09 2018-03-23 山形印刷(无锡)有限公司 A kind of printing process for preventing printed data mistake and print system
CN110675376A (en) * 2019-09-20 2020-01-10 福建工程学院 PCB defect detection method based on template matching
CN110940670A (en) * 2019-11-25 2020-03-31 佛山缔乐视觉科技有限公司 Flexible printing label printing head draft detection system based on machine vision and implementation method thereof
CN112085707A (en) * 2020-08-18 2020-12-15 北京华夏视科技术股份有限公司 Printed matter color detection method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009319A (en) * 2023-08-07 2023-11-07 广州青莲网络科技有限公司 Database operation method, system and storage medium based on large language model
CN117009319B (en) * 2023-08-07 2024-01-26 广州青莲网络科技有限公司 Database operation method, system and storage medium based on large language model

Similar Documents

Publication Publication Date Title
CN109886928B (en) Target cell marking method, device, storage medium and terminal equipment
CN107492091B (en) Label appearance detection method based on machine vision and terminal equipment
CN108764352B (en) Method and device for detecting repeated page content
CN110647882A (en) Image correction method, device, equipment and storage medium
CN110197180B (en) Character defect detection method, device and equipment
CN111325717B (en) Mobile phone defect position identification method and equipment
CN111680690A (en) Character recognition method and device
CN110276759B (en) Mobile phone screen bad line defect diagnosis method based on machine vision
CN115273115A (en) Document element labeling method and device, electronic equipment and storage medium
CN102737240B (en) Method of analyzing digital document images
CN113781396A (en) Screen defect detection method, device, equipment and storage medium
CN114638294A (en) Data enhancement method and device, terminal equipment and storage medium
CN115482186A (en) Defect detection method, electronic device, and storage medium
CN112419207A (en) Image correction method, device and system
CN113538603A (en) Optical detection method and system based on array product and readable storage medium
CN114677373A (en) Printed matter content error detection method and device, electronic equipment and medium
CN115512381A (en) Text recognition method, text recognition device, text recognition equipment, storage medium and working machine
CN111626145A (en) Simple and effective incomplete form identification and page-crossing splicing method
US20120249837A1 (en) Methods and Systems for Real-Time Image-Capture Feedback
CN110956147A (en) Method and device for generating training data
CN112069974B (en) Image recognition method and system for recognizing defects of components
CN112036232A (en) Image table structure identification method, system, terminal and storage medium
CN111325106A (en) Method and device for generating training data
CN108564571B (en) Image area selection method and terminal equipment
CN116012860A (en) Teacher blackboard writing design level diagnosis method and device 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220628

RJ01 Rejection of invention patent application after publication