CN114612458A - Flexo printing first piece detection method based on electronic sample manuscript - Google Patents
Flexo printing first piece detection method based on electronic sample manuscript Download PDFInfo
- Publication number
- CN114612458A CN114612458A CN202210279030.5A CN202210279030A CN114612458A CN 114612458 A CN114612458 A CN 114612458A CN 202210279030 A CN202210279030 A CN 202210279030A CN 114612458 A CN114612458 A CN 114612458A
- Authority
- CN
- China
- Prior art keywords
- matching
- flexo printing
- flexo
- electronic sample
- electronic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30124—Fabrics; Textile; Paper
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Biophysics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Molecular Biology (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Biomedical Technology (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Probability & Statistics with Applications (AREA)
- Quality & Reliability (AREA)
- Physiology (AREA)
- Genetics & Genomics (AREA)
- Inking, Control Or Cleaning Of Printing Machines (AREA)
- Image Processing (AREA)
Abstract
The invention provides a flexo printing first item detection method based on an electronic sample manuscript, which adopts a coarse-fine matching method to avoid the problem of poor performance when a global matching algorithm is singly used for matching a weak texture or a repeated texture area; according to the method for combining the SuperPoint and the GNN through rough matching, as the attention mechanism refers to the idea that a person compares two images, self attention and cross attention are aggregated, so that the matching precision far exceeds the violence matching and the rapid nearest neighbor searching algorithm; fine matching is carried out to finish the fine tuning of the content of the local area, the complete matching of the electronic sample manuscript and the first flexo printing piece is realized, and further the pixel-level detection precision is realized; the method comprises the steps of using an electronic sample segmentation result as a clustering algorithm of a constraint condition, converting a flexo printing first piece segmentation problem into an optimization problem with the minimum difference with an electronic sample binary image, and accelerating the time for solving the optimization algorithm by adopting a genetic algorithm, thereby realizing effective segmentation of the first piece image and improving the speed and precision of the algorithm.
Description
Technical Field
The invention relates to the field of textile industry detection, in particular to a flexo printing first piece detection method based on an electronic sample manuscript.
Background
Flexography refers to a printing process that uses a flexographic plate to transfer ink through an anilox roller. At present, water-based ink and UV ink used for flexible printing do not contain benzene, ester and ketone with strong toxicity, and also do not contain heavy metal harmful to human bodies. The flexographic printing ink layer has a thickness of about half that of gravure printing, and the ink consumption per unit area is much smaller than that of gravure printing. In addition, the flexible printing belongs to light pressure printing, the energy consumption of equipment is low, the damage of a plate making process to the environment is small, and the printing endurance of over million printing times reduces the material loss caused by the halt and plate change of long-version orders. Therefore, flexographic printing is one of the accepted green printing methods in the industry.
Due to the remarkable environmental properties, flexography accounts for over 70% of the U.S. packaging printing market, and approximately 50% in western european countries. In the 80 s of the 20 th century, as more and more foreign enterprises in the fields of fast food, cosmetics and the like enter China, flexible printing is introduced into China and gradually developed. At present, the flexible printing in China is widely applied to the fields of corrugated cases, labels, aseptic liquid packaging, paper cup bags, napkins and the like, and gradually occupies a leading position. In the fields of flexible package printing and book printing, flexible printing also begins to occupy a place, and shows strong growth momentum and development potential. For enterprise manufacturers, the product quality is a foundation for enterprise development and competition, and the improvement of the printing quality is very important for the flexo printing industry.
Before the mass production of the flexo labels, workers must go through the first flexo inspection process after each shift, production change and equipment adjustment, namely, the first printed product or the first few flexo products must be compared with the electronic sample for inspection, so as to find the problem of printing quality as early as possible. The flexographic label process flow is shown in figure 1. Currently, the first pass of flexography adopts three manual checks: self-checking, mutual checking and special checking. However, the printed matter on the flexo labels relates to languages around the world (over 5000 characters), and the printed character content is numerous, with an average of over 200 characters per label. This results in high labor intensity, time and labor consumption, and easy omission of inspection, which leads to the batch out-of-tolerance, repair and scrap of the flexible printed labels and serious economic loss. Therefore, the high-precision automatic detection method for the first flexo printing piece has important practical significance for the flexo printing process.
Although machine vision has been widely applied to the detection of textile printing content, in the past, more researches are carried out on the characteristics that printing defects generated in the batch printing process are detected by taking a printing genuine product as a template, and a genuine product image cannot be provided for a flexo printing first product.
The prior art discloses a flexible printing label printing first manuscript detection system based on machine vision and a patent of an implementation method thereof, wherein the method comprises the steps of establishing a PDF template of a flexible printing label, and determining a content area of a flexible printing first manuscript to be detected by using binarization processing; collecting a detected image of an object to be detected in a linear motion process; splicing the acquired images by using a Surf algorithm and a RANSAC algorithm; then, sorting the characteristic point pairs by using an approximate nearest neighbor fast dictionary lookup method, selecting a plurality of groups of characteristic point pairs to calculate a transformation matrix of the characteristic point pairs, and mapping and transforming the spliced detected image to obtain a first image; finally, finely adjusting the character position of the electronic sample document by using a gray template matching method, calculating the difference between the electronic sample document and the binary image of the first image to be detected, and determining the defect position by using the distance image; however, the electronic sample and the first flexo print have different thicknesses and large gray characteristic differences, and contain a large number of repeated textures, and the features extracted by the Surf algorithm cannot be accurately described, so that a large number of mismatching situations inevitably occur, and further extremely high missing rate and misdetection rate are caused.
Disclosure of Invention
The invention provides a flexo printing first piece detection method based on an electronic sample manuscript with higher precision.
In order to achieve the technical effects, the technical scheme of the invention is as follows:
a flexo printing first piece detection method based on an electronic sample manuscript comprises the following steps:
s1: extracting the over points of the electronic sample draft and the first flexo printing piece to obtain the key point positions and the visual feature descriptors of the electronic sample draft and the first flexo printing piece, and completing the rough matching of the electronic sample draft and the first flexo printing piece; (ii) a
S2: performing fine matching on the electronic sample draft and the first flexo printing piece which are subjected to the coarse matching in the step S1;
s3: and detecting the defects of the flexo printing first piece which is matched in the step S2.
Further, the SuperPoint of the electronic sample and the first flexo print is extracted by using a SuperPoint self-monitoring network, wherein the training process of the SuperPoint self-monitoring network comprises the following steps:
s11: pre-training a basic detector, wherein angular points of virtual geometric shapes of the electronic sample manuscript and the flexo first-part are known and are directly used as a labeled data set to train the basic detector, so that VGG16 is used as the basic detector, and network parameters are trained to extract the angular points of the geometric shapes;
s12: marking interest points, namely extracting the corner points of the first flexo print and the electronic sample manuscript respectively by adopting the pre-trained basic detection network in the step S11 to mark the interest points;
s13: respectively carrying out homography transformation on the first flexo printing piece and the electronic sample manuscript in the step S12 for N times, and respectively labeling interest points of each transformed image through a basic detector; random accessAnd constructing a loss function by the secondary image according to the extracted interest points in two different postures each time, constructing an interest point loss function and a descriptor loss function by taking the self-labeling of the interest points in one posture as a true value and the other posture as an observation result, wherein the training target needs to enable the distance between matched points to be small and the distance between non-matched points to be large, and obtaining a SuperPoint detection network and completing SuperPoint detection after combined training.
Further, because a large amount of repeated content information exists between the electronic sample and the first flexo printing piece, a large amount of matching redundancy is caused, the matching redundancy is solved by using a GNN network introducing an attention mechanism and combining an allocation optimization solution mode, and the GNN network completes matching by adopting an end-to-end training mode through the following steps:
1) inputting the I-th visual characteristic descriptor corresponding to the electronic sample manuscript and the first flexo printing part respectivelyAndand coordinate positionAnd
2) the GNN network firstly uses a Keypoint encoder to respectively locate the key pointsAndand visual descriptorsAndmapping to node information in a graph, howeverThen self and cross attention are used as edges to aggregate node information of the layers to obtain super featuresAnd
3) and finally, calculating to obtain a distribution matrix according to the super-features, and outputting a distribution matrix with row-column normalization through iteration optimization of a Sinkhorn algorithm. And carrying out affine transformation by taking the characteristic point pairs corresponding to the horizontal and vertical coordinates of the maximum value of each column of the distribution matrix as matching point pairs to complete the rough matching of the electronic sample manuscript and the first flexo printing piece.
Further, the specific process of step S2 is:
the content of the electronic sample is clear and black and white, and a fixed threshold value is adopted to extract sub-content blocks F of different characters or patterns of the electronic samplesLet the coordinate of the center point of the sub-content block be (X)s,Ys) Dimension of (W)s,Hs) With FsFor the template graph, performing NCC search matching in the corresponding region in the flexo first image R, setting the variable δ as the search expansion base, and calculating the NCC corresponding to each search point (x, y) as follows:
wherein F (x + m, y + n) is a gray value of an F pixel (x + m, y + n) of the electronic sample draft, R (m, n) is a gray value of an R pixel (m, n) of the first flexo image, an ncc (x, y) similarity matrix of (2 δ +1) × (2 δ +1) is obtained, and a pixel corresponding to the maximum value ncc (x, y) is recorded as:
P(Xmax,Ymax)=argmax[ncc(x,y)] (5)
according to P (X)max,Ymax) Coordinate (X) with the center points,Ys) Obtaining an offset delta p;
ΔP=(Xmax-Xs,Ymax-Ys) (6)
sub-content block FsAnd (4) translating the delta P, and finishing the fine matching between the first flexo printing piece and the electronic manuscript by operating all the sub-blocks according to the formulas (1) to (6).
Further, sub-content blocks F of different text or patterns of the electronic sample are extracted using 128 as a fixed thresholds。
Further, the step S3 includes constraint clustering: converting the first flexography image segmentation problem into an optimization problem with the minimum difference with a sample document segmentation graph, namely:
T∈[min(c1,c2),max(c1,c2)](10)
wherein F and R are respectively the electronic sample manuscript and the first flexo printing image after coarse-fine matching, and the clustering image R meeting the requirement (7) is solvedtIn order to reduce the solving time of the optimization algorithm, the best segmentation result of the flexo printing first piece is obtained by adopting a K-means clustering method to obtain clustering centers c1 and c2, the initialization of the segmentation of the flexo printing first piece image is completed, and the optimization problem (7) is solved by adopting a genetic algorithm by taking (c1+ c2)/2 as one of the initialized seeds of the genetic algorithm.
Further, the step S3 further includes defect detection:
the first flexo printing piece may cause a burr phenomenon due to the disconnection of content strokes or the local diffusion and protrusion of ink, the constraint clustering segmentation is difficult to inhibit the error, and the subsequent defect detection is influenced, so a distance transformation method is provided for defect evaluation, and an edge distance function is defined as follows:
wherein the content of the first and second substances,setting the minimum circumscribed rectangular area of the ith target in the thresholded electronic sample as deltaFThen, thenFor constraint of first flexo print correspondence delta after clusteringFAnd (3) evaluating a certain edge pixel point in the regional contour point set E by adopting the following strategies:
wherein, TdSetting the threshold parameter as 1.0, adopting (12) to carry out point-by-point evaluation on all target edge points of the electronic sample manuscript to obtain corresponding flexible printing first piece, and when the matching distance is greater than the set defect evaluation threshold parameter TdIf the defect detection result is positive, the defect detection is finished, and if the defect detection result is negative, the defect detection is finished.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
(1) the problem of poor performance when a global matching algorithm is used alone to match weak texture or repeated texture areas is solved by adopting a coarse-fine matching method; according to the method for combining the SuperPoint and the GNN in the rough matching mode, the attention mechanism refers to the idea that a person compares two images, and self attention and cross attention are aggregated, so that the matching precision is far beyond the violence matching and the rapid nearest neighbor searching algorithm; meanwhile, fine matching completes the fine tuning of the contents of the local area, so that the complete matching of the electronic sample manuscript and the first flexo printing piece can be realized, the pixel-level detection precision is further realized, and fine defects can be detected;
(2) constraint clustering and defect assessment are provided for defect detection, so that the problem that the first label piece is difficult to divide due to the phenomenon of bottom penetration is solved, and the condition that false detection and over-killing are caused by burrs due to local ink diffusion is avoided; the detection precision and speed of the algorithm are ensured, so that the detection accuracy is improved on the premise of meeting the requirement of the production speed in the actual production process;
(3) the method can finish first piece detection within reasonable time, on the basis of ensuring that the omission factor is 0%, the false detection rate can be controlled to be 1.6%, the average Dice coefficient of defect detection is as high as 0.924, the detection time is only 2.774s/pcs, and the detection time is in the same order of magnitude as that of the traditional algorithm, so that the requirements of actual engineering are met; therefore, the method is the best mode in the field of flexo printing first-piece defect detection in the existing fabric defect detection method.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a diagram of a specific process of the method of the present invention;
fig. 3 is a schematic diagram of a SuperPoint training process.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;
it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.
Example 1
As shown in fig. 1, a method for detecting a flexible print first based on an electronic proof includes the following steps:
s1: extracting the over points of the electronic sample draft and the first flexo printing piece to obtain the key point positions and the visual feature descriptors of the electronic sample draft and the first flexo printing piece, and completing the rough matching of the electronic sample draft and the first flexo printing piece; (ii) a
S2: performing fine matching on the electronic sample draft and the first flexo printing piece which are subjected to the coarse matching in the step S1;
s3: and detecting the defects of the flexo printing first piece which is matched in the step S2.
Extracting the super points of the electronic sample and the first flexo printing piece by using a SuperPoint self-monitoring network, wherein the training process of the SuperPoint self-monitoring network comprises the following steps:
s11: pre-training a basic detector, wherein angular points of virtual geometric shapes of the electronic sample manuscript and the flexo first piece are known and are directly used as a labeled data set to train the basic detector, so that VGG16 is used as the basic detector to train network parameters to extract the angular points of the geometric shapes;
s12: marking interest points, namely extracting the corner points of the first flexo print and the electronic sample manuscript respectively by adopting the pre-trained basic detection network in the step S11 to mark the interest points;
s13: respectively carrying out homography transformation on the first flexo printing piece and the electronic sample manuscript in the step S12 for N times, and respectively labeling interest points of each transformed image through a basic detector; get at randomAnd constructing a loss function by the secondary image according to the extracted interest points in two different postures each time, constructing an interest point loss function and a descriptor loss function by taking the self-labeling of the interest points in one posture as a true value and the other posture as an observation result, wherein the training target needs to enable the distance between matched points to be small and the distance between non-matched points to be large, and obtaining a SuperPoint detection network and completing SuperPoint detection after combined training.
Because a large amount of repeated content information exists between the electronic sample manuscript and the first flexo printing piece, a large amount of matching redundancy is caused, the matching redundancy is solved by using a GNN network introducing an attention mechanism and combining an allocation optimization solving mode, and the GNN network adopts an end-to-end training mode to complete matching through the following steps:
1) inputting 1 st visual characteristic descriptor corresponding to electronic sample manuscript and first flexible printing piece respectivelyAndand coordinate positionAnd
2) the GNN network firstly uses a Keypoint encoder to respectively locate the key pointsAndand visual descriptorsAndmapping to node information in the graph, and then aggregating the node information of the graph layer by using self and cross attention as edges to obtain the super-characteristicsAnd
3) and finally, calculating to obtain a distribution matrix according to the super-features, and outputting a distribution matrix with row-column normalization through iteration optimization of a Sinkhorn algorithm. And carrying out affine transformation by taking the characteristic point pairs corresponding to the horizontal and vertical coordinates of the maximum value of each column of the distribution matrix as matching point pairs to complete the rough matching of the electronic sample manuscript and the first flexo printing piece.
Example 2
As shown in fig. 1-2, a method for detecting a flexo print first based on an electronic proof includes the following steps:
s1: extracting the over points of the electronic sample draft and the first flexo printing piece to obtain the key point positions and the visual feature descriptors of the electronic sample draft and the first flexo printing piece, and completing the rough matching of the electronic sample draft and the first flexo printing piece; (ii) a
S2: performing fine matching on the electronic sample draft and the first flexo printing piece which are subjected to the coarse matching in the step S1;
s3: and detecting the defects of the flexo printing first piece which is matched in the step S2.
The method comprises the following steps of extracting the super points of the electronic sample draft and the first flexo printing piece by adopting a SuperPoint self-monitoring network, wherein the training process of the SuperPoint self-monitoring network comprises the following steps:
s11: pre-training a basic detector, wherein angular points of virtual geometric shapes of the electronic sample manuscript and the flexo first piece are known and are directly used as a labeled data set to train the basic detector, so that VGG16 is used as the basic detector to train network parameters to extract the angular points of the geometric shapes;
s12: marking interest points, namely extracting the corner points of the first flexo print and the electronic sample manuscript respectively by adopting the pre-trained basic detection network in the step S11 to mark the interest points;
s13: respectively carrying out homography transformation on the first flexo printing piece and the electronic sample manuscript in the step S12 for N times, and respectively labeling interest points of each transformed image through a basic detector; random accessAnd constructing a loss function by the secondary image according to the extracted interest points in two different postures each time, constructing an interest point loss function and a descriptor loss function by taking the self-labeling of the interest points in one posture as a true value and the other posture as an observation result, wherein the training target needs to enable the distance between matched points to be small and the distance between non-matched points to be large, and obtaining a SuperPoint detection network and completing SuperPoint detection after combined training.
Because a large amount of repeated content information exists between the electronic sample manuscript and the first flexo printing piece, a large amount of matching redundancy is caused, the matching redundancy is solved by using a GNN network introducing an attention mechanism and combining an allocation optimization solving mode, and the GNN network adopts an end-to-end training mode to complete matching through the following steps:
1) inputting 1 st visual characteristic descriptor corresponding to electronic sample manuscript and first flexible printing piece respectivelyAndand coordinate positionAnd
2) the GNN network firstly uses a Keypoint encoder to respectively locate the key pointsAndand visual descriptorsAndmapping to node information in the graph, and then aggregating the node information of the graph layer by using self and cross attention as edges to obtain the super-characteristicsAnd
3) and finally, calculating to obtain a distribution matrix according to the super-features, and outputting a distribution matrix with row-column normalization through iteration optimization of a Sinkhorn algorithm. And carrying out affine transformation by taking the characteristic point pairs corresponding to the horizontal and vertical coordinates of the maximum value of each column of the distribution matrix as matching point pairs to complete the rough matching of the electronic sample manuscript and the first flexo printing piece.
The specific process of step S2 is:
the content of the electronic sample is clear and black and white, and the fixed threshold (the fixed threshold is 128) is adopted to extract the non-content of the electronic sampleSub-content block F with same characters or patternssLet the coordinate of the center point of the sub-content block be (X)s,Ys) Dimension of (W)s,Hs) With FsFor the template graph, performing NCC search matching in the corresponding region in the flexo first image R, setting the variable δ as the search expansion base, and calculating the NCC corresponding to each search point (x, y) as follows:
wherein F (x + m, y + n) is a gray value of an F pixel (x + m, y + n) of the electronic sample draft, R (m, n) is a gray value of an R pixel (m, n) of the first flexo image, an ncc (x, y) similarity matrix of (2 δ +1) × (2 δ +1) is obtained, and a pixel corresponding to the maximum value ncc (x, y) is recorded as:
P(Xmax,Ymax)=argmax[ncc(x,y)] (5)
according to P (X)max,Ymax) Coordinate (X) with the center points,Ys) Obtaining an offset delta P;
ΔP=(Xmax-Xs,Ymax-Ys) (6)
sub-content block FsAnd (4) translating the delta P, and finishing the fine matching between the first flexo printing piece and the electronic manuscript by operating all the sub-blocks according to the formulas (1) to (6).
Step S3 includes constrained clustering: converting the first flexography image segmentation problem into an optimization problem with the minimum difference with a sample document segmentation graph, namely:
T∈[min(c1,c2),max(c1,c2)] (10)
wherein F and R are respectively the electronic sample manuscript and the first flexo printing image after coarse-fine matching, and the clustering image R meeting the requirement (7) is solvedtIn order to reduce the solving time of the optimization algorithm, the best segmentation result of the flexo printing first piece is obtained by adopting a K-means clustering method to obtain clustering centers c1 and c2, the initialization of the segmentation of the flexo printing first piece image is completed, and the optimization problem (7) is solved by adopting a genetic algorithm by taking (c1+ c2)/2 as one of the initialized seeds of the genetic algorithm.
Step S3 further includes defect detection:
the first flexo printing piece may cause a burr phenomenon due to the disconnection of content strokes or the local diffusion and protrusion of ink, the constraint clustering segmentation is difficult to inhibit the error, and the subsequent defect detection is influenced, so a distance transformation method is provided for defect evaluation, and an edge distance function is defined as follows:
wherein the content of the first and second substances,setting the minimum circumscribed rectangular area of the ith target in the thresholded electronic sample as deltaFThen, thenFor constraint of first flexo print correspondence delta after clusteringFAnd (3) evaluating a certain edge pixel point in the regional contour point set E by adopting the following strategies:
wherein, TdSetting the threshold parameter as 1.0, adopting (12) to evaluate all target edge points of the electronic sample document point by point, and when the matching distance is large, adopting the corresponding flexo printing first pieceAt a set defect evaluation threshold parameter TdIf the defect detection result is positive, the defect detection is finished, and if the defect detection result is negative, the defect detection is finished.
Example 3
As shown in fig. 1-2, the present patent proposes a method for detecting a first piece of flexo printing based on an electronic proof, which is used to solve the problem of detecting defects of a flexo printing label, and comprises the following specific steps:
(1) coarse matching
Because the electronic sample manuscript and the first flexo printing piece have different contents and thicknesses and large gray characteristic difference, the characteristics extracted by the traditional method cannot accurately describe the electronic sample manuscript and the first flexo printing piece. And the SuperPoint adopts a deep learning network and calculates a loss function by a pose, so that the common characteristics between two images can be well represented. Therefore, SuperPoint self-monitoring networks are used to extract the super points of electronic proofs and flexo originals. In order to improve generalization capability, random scaling and rotation are carried out on pictures in a training phase so as to carry out data enhancement. The SuperPoint self-monitoring network training is divided into three steps (as shown in FIG. 3):
A. the base detector is pre-trained. Since the corner points of the virtual geometry of the electronic proof and the flexo print are known, they are used directly as the labeled data set to train the underlying detector. The network parameters are trained to extract the corner points of the geometry using VGG16 as the basis detector.
B. And marking the interest points. And D, respectively extracting the corner points of the first flexo printing piece and the electronic sample manuscript by adopting the pre-trained basic detection network in the step A, and marking the interest points.
C. SuperPoint detection:
and I, respectively carrying out N times of homography transformation on the flexo printing first piece and the electronic sample manuscript in the step B in order to enhance the generalization capability of the network, and respectively labeling interest points of each transformed image through a basic detector.
And ② combined training. Get at randomA secondary image, each time constructing a loss function by the extracted interest points of two different postures,the method comprises the steps of constructing an interest point loss function and a descriptor loss function by taking the self-labeling of interest points in one posture as a true value and taking the other posture as an observation result, wherein the training target needs to enable the distance between matching points to be small and the distance between non-matching points to be large. And obtaining the SuperPoint detection network after the combined training.
Because there is a lot of repeated content information between the electronic sample and the flexo print first, and the traditional matching method only matches according to the similarity of each group of feature descriptors, a lot of matching redundancy may be caused. The complex feature matching problem can be solved by using the GNN network introducing the attention mechanism and combining an allocation optimization solution mode. The GNN network adopts an end-to-end training mode to complete matching through the following steps:
inputting the I-th visual characteristic descriptor corresponding to the electronic sample manuscript and the first flexo printing part respectivelyAndand coordinate positionAnd
secondly, the GNN network firstly uses a Keypoint coder to respectively position the key pointsAndand visual descriptorsAndmapping to node information in a graph, and then using self-sumCross attention is used as an edge to aggregate node information of layers to obtain super featuresAnd
and thirdly, calculating a score matrix according to the hyper-features, and outputting a distribution matrix with normalized rows and columns through iteration optimization of a Sinkhorn algorithm. And carrying out affine transformation by taking the characteristic point pairs corresponding to the horizontal and vertical coordinates of the maximum value of each column of the distribution matrix as matching point pairs to complete the rough matching of the electronic sample manuscript and the first flexo printing piece.
(2) Precision matching
The coarsely matched electronic proof and the first flexo image are substantially aligned. However, in the process of flexo printing, the plate material can generate local relative offset, so that the content of the first flexo printing piece and the electronic manuscript always have local offset, and the complete alignment of the content is difficult to realize through global affine transformation or perspective transformation.
The content of the electronic sample is clear and black and white, and a fixed threshold (128) is adopted to extract sub-content blocks F of different characters or patterns of the electronic samplesLet the coordinate of the center point of the sub-content block be (X)s,Ys) Dimension of (W)s,Hs) With FsFor the template graph, performing NCC search matching in the corresponding region in the flexo first image R, setting the variable δ as the search expansion base, and calculating the NCC corresponding to each search point (x, y) as follows:
x∈[xs-δ:Xs+δ],y∈[Ys-δ:Ys+δ] (2)
wherein F (x + m, y + n) is a gray value of an F pixel (x + m, y + n) of the electronic sample draft, R (m, n) is a gray value of an R pixel (m, n) of the first flexo image, an ncc (x, y) similarity matrix of (2 δ +1) × (2 δ +1) is obtained, and a pixel corresponding to the maximum value ncc (x, y) is recorded as:
P(Xmax,Ymax)=argmax[ncc(x,y)] (5)
according to P (X)max,Ymax) Coordinate (X) with the center points,Ys) Obtaining an offset delta P;
ΔP=(Xmax-Xs,Ymax-Ys) (6)
sub-content block FsAnd (4) translating the delta P, and operating all the sub-blocks according to the formulas (1) to (6) to finish the fine matching between the flexible printing first piece and the electronic sample manuscript.
(3) Defect detection
(ii) constrained clustering
The background penetration phenomenon is generated in different colors and thicknesses of the fabric plate, so that errors may exist in the division of the first flexo printing piece content, and therefore the thresholded result of the finely-adjusted electronic sample is taken as a constraint condition, and a constraint clustering method is provided for accurately extracting the first flexo printing piece content. Converting the first flexography image segmentation problem into an optimization problem with the minimum difference with a sample document segmentation graph, namely:
T∈[min(c1,c2),max(c1,c2)] (10)
wherein F and R are respectively the electronic sample manuscript and the first flexo printing image after coarse-fine matching, and the clustering image R meeting the requirement (7) is solvedtIn order to reduce the solving time of the optimization algorithm, the best segmentation result of the flexo printing first piece is obtained by adopting a K-means clustering method to obtain clustering centers c1 and c2, the initialization of the segmentation of the flexo printing first piece image is completed, and the optimization problem (7) is solved by adopting a genetic algorithm by taking (c1+ c2)/2 as one of the initialized seeds of the genetic algorithm.
② Defect evaluation
The first flexo printing piece may cause a burr phenomenon due to the disconnection of content strokes or the local diffusion and protrusion of ink, and the constraint clustering segmentation is difficult to inhibit the error and influence the subsequent defect detection, so that a distance transformation method is provided for defect evaluation. Define the edge distance function as:
wherein the content of the first and second substances,setting the minimum circumscribed rectangular area of the ith target in the thresholded electronic sample as deltaFThen, thenFor constraint of first flexo print correspondence delta after clusteringFAnd (3) evaluating a certain edge pixel point in the regional contour point set E by adopting the following strategies:
wherein, TdIs a threshold parameter. Because the content of the flexo printing first piece and the electronic sample manuscript has small thickness deviation and the early warning is given when the defect required by the actual production of an enterprise exceeds 0.3 square millimeter, T is setd1.0, adopting (12) to evaluate all target edge points of the electronic sample document point by pointFirst piece of flexible printing, when the matching distance is larger than the set defect evaluation threshold parameter TdAnd if the first piece is not a printing certified product, the first piece can be subjected to defect detection.
The same or similar reference numerals correspond to the same or similar parts;
the positional relationships depicted in the drawings are for illustrative purposes only and are not to be construed as limiting the present patent;
it should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.
Claims (10)
1. A flexo printing first piece detection method based on an electronic sample manuscript is characterized by comprising the following steps:
s1: extracting the over points of the electronic sample draft and the first flexo printing piece to obtain the key point positions and the visual feature descriptors of the electronic sample draft and the first flexo printing piece, and completing the rough matching of the electronic sample draft and the first flexo printing piece;
s2: performing fine matching on the electronic sample draft and the first flexo printing piece which are subjected to the coarse matching in the step S1;
s3: and detecting the defects of the flexo printing first piece which is matched in the step S2.
2. The method according to claim 1, wherein in step S1, a SuperPoint self-monitoring network is used to extract the super points of the electronic sample and the flexo printing first item.
3. The method of claim 2, wherein the training process for the SuperPoint self-supervision network is:
s11: taking VGG16 as a basic detector, training network parameters and extracting geometric corner points;
s12: marking interest points, namely extracting the corner points of the first flexo print and the electronic sample manuscript respectively by adopting the pre-trained basic detection network in the step S11 to mark the interest points;
s13: respectively carrying out homography transformation on the first flexo printing piece and the electronic sample manuscript in the step S12 for N times, and respectively labeling interest points of each transformed image through a basic detector; random accessAnd constructing a loss function by the secondary image according to the extracted interest points in two different postures each time, constructing an interest point loss function and a descriptor loss function by taking the self-labeling of the interest points in one posture as a true value and the other posture as an observation result, wherein the training target needs to enable the distance between matched points to be small and the distance between non-matched points to be large, and obtaining a SuperPoint detection network and completing SuperPoint detection after combined training.
4. The method of claim 3, wherein the corner points of the virtual geometry of the electronic proof and the flexo print are known and used directly as the labeled data set to train the underlying detector.
5. The method of claim 4, wherein a large amount of matching redundancy is caused by a large amount of repeated content information between the electronic proof and the flexo print, the matching redundancy is solved using a GNN network with attention mechanism and combining with an allocation optimization solution, and the GNN network uses an end-to-end training method to complete matching through the following steps:
1) inputting the I-th visual characteristic descriptor corresponding to the electronic sample manuscript and the first flexo printing part respectivelyAndand coordinate positionAnd
2) the GNN network firstly uses a Keypoint encoder to respectively locate the key pointsAndand visual descriptorsAndmapping the node information in the graph, and then aggregating the node information of the graph layer by using self and cross attention as edges to obtain the super-feature fl FAnd fl R;
3) And finally, calculating to obtain a distribution matrix according to the super-features, and outputting a distribution matrix with row-column normalization through iteration optimization of a Sinkhorn algorithm. And carrying out affine transformation by taking the characteristic point pairs corresponding to the horizontal and vertical coordinates of the maximum value of each column of the distribution matrix as matching point pairs to complete the rough matching of the electronic sample manuscript and the first flexo printing piece.
6. The method for detecting a flexible print head based on an electronic proof according to claim 5, wherein the specific process of step S2 is:
the content of the electronic sample is clear and black and white, and a fixed threshold value is adopted to extract sub-content blocks F of different characters or patterns of the electronic samplesSetting the center of the content blockThe point coordinate is (X)s,Ys) Dimension of (W)s,Hs) With FsFor the template graph, performing NCC search matching in the corresponding region in the flexo first image R, setting the variable δ as the search expansion base, and calculating the NCC corresponding to each search point (x, y) as follows:
x∈[Xs-δ:Xs+δ],y∈[Ys-δ:Ys+δ] (2)
wherein F (x + m, y + n) is a gray value of an F pixel (x + m, y + n) of the electronic sample draft, R (m, n) is a gray value of an R pixel (m, n) of the first flexo image, an ncc (x, y) similarity matrix of (2 δ +1) × (2 δ +1) is obtained, and a pixel corresponding to the maximum value ncc (x, y) is recorded as:
P(Xmax,Ymax)=argmax[ncc(x,y)] (5)
according to P (X)max,Ymax) Coordinate (X) with the center points,Ys) Obtaining an offset delta P;
ΔP=(Xmax-Xs,Ymax-Ys) (6)
sub-content block FsAnd (4) translating the delta P, and finishing the fine matching between the first flexo printing piece and the electronic manuscript by operating all the sub-blocks according to the formulas (1) to (6).
7. The method of claim 6, wherein the sub-content blocks F of different text or graphics of the electronic proof are extracted using 128 as a fixed thresholds。
8. The method of electronic proof-based flexo print leader detection according to claim 7, wherein said step S3 includes constrained clustering: converting the first flexography image segmentation problem into an optimization problem with the minimum difference with a sample document segmentation graph, namely:
T∈[min(c1,c2),max(c1,c2)] (10)
wherein F and R are respectively the electronic sample manuscript and the first flexo printing image after coarse-fine matching, and the clustering image R meeting the requirement (7) is solvedtIn order to reduce the solving time of the optimization algorithm, the best segmentation result of the flexo printing first piece is obtained by adopting a K-means clustering method to obtain clustering centers c1 and c2, the initialization of the segmentation of the flexo printing first piece image is completed, and the optimization problem (7) is solved by adopting a genetic algorithm by taking (c1+ c2)/2 as one of the initialized seeds of the genetic algorithm.
9. The method of claim 8, wherein the step S3 further includes defect detection:
the first flexo printing piece may cause a burr phenomenon due to the disconnection of content strokes or the local diffusion and protrusion of ink, the constraint clustering segmentation is difficult to inhibit the error, and the subsequent defect detection is influenced, so a distance transformation method is provided for defect evaluation, and an edge distance function is defined as follows:
wherein the content of the first and second substances,setting the minimum circumscribed rectangular area of the ith target in the thresholded electronic sample as deltaFThen, thenCorrespondence of flexographic prints after constraint clusteringFAnd (3) evaluating a certain edge pixel point in the regional contour point set E by adopting the following strategies:
wherein, TdAdopting (12) to evaluate all target edge points of the electronic sample document point by point to obtain corresponding flexo printing first parts as threshold parameters, and when the matching distance is greater than the set defect evaluation threshold parameter TdIf the defect detection result is positive, the defect detection is finished, and if the defect detection result is negative, the defect detection is finished.
10. The electronic proof-based flexo print first item detection method of claim 9, wherein said T isdSet to 1.0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210279030.5A CN114612458A (en) | 2022-03-21 | 2022-03-21 | Flexo printing first piece detection method based on electronic sample manuscript |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210279030.5A CN114612458A (en) | 2022-03-21 | 2022-03-21 | Flexo printing first piece detection method based on electronic sample manuscript |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114612458A true CN114612458A (en) | 2022-06-10 |
Family
ID=81863962
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210279030.5A Pending CN114612458A (en) | 2022-03-21 | 2022-03-21 | Flexo printing first piece detection method based on electronic sample manuscript |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114612458A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114882037A (en) * | 2022-07-11 | 2022-08-09 | 北京中科慧眼科技有限公司 | Image defect detection method and system based on dynamic printing mask |
CN116993996A (en) * | 2023-09-08 | 2023-11-03 | 腾讯科技(深圳)有限公司 | Method and device for detecting object in image |
-
2022
- 2022-03-21 CN CN202210279030.5A patent/CN114612458A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114882037A (en) * | 2022-07-11 | 2022-08-09 | 北京中科慧眼科技有限公司 | Image defect detection method and system based on dynamic printing mask |
CN116993996A (en) * | 2023-09-08 | 2023-11-03 | 腾讯科技(深圳)有限公司 | Method and device for detecting object in image |
CN116993996B (en) * | 2023-09-08 | 2024-01-12 | 腾讯科技(深圳)有限公司 | Method and device for detecting object in image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114612458A (en) | Flexo printing first piece detection method based on electronic sample manuscript | |
CN103439348B (en) | Remote controller key defect detection method based on difference image method | |
CN106446750B (en) | A kind of bar code read method and device | |
CN102629322B (en) | Character feature extraction method based on stroke shape of boundary point and application thereof | |
CN109117885B (en) | Stamp identification method based on deep learning | |
CN103093240A (en) | Calligraphy character identifying method | |
CN110378239A (en) | A kind of real-time traffic marker detection method based on deep learning | |
CN106529532A (en) | License plate identification system based on integral feature channels and gray projection | |
CN106778779A (en) | A kind of electric injection molding machine mould detection method | |
CN110414309A (en) | A kind of automatic identifying method of vehicle nameplate | |
CN102289681A (en) | Method for matching envelope images | |
CN106570887A (en) | Adaptive Mean Shift target tracking method based on LBP features | |
CN109658404A (en) | A kind of corrugated board intelligent detecting method extracted based on image outline with cluster | |
CN110533660B (en) | Method for detecting silk-screen defect of electronic product shell | |
CN117830315B (en) | Real-time monitoring method and system for printing machine based on image processing | |
CN102194125B (en) | Forged seal imprint inspection method and recording medium | |
CN112884741B (en) | Printing apparent defect detection method based on image similarity comparison | |
CN106599910B (en) | Mimeograph documents discrimination method based on texture recombination | |
CN111967457A (en) | OCR detection method based on deep learning | |
CN115601760A (en) | Defect evaluation method for first flexo printing piece | |
CN106056575A (en) | Image matching method based on object similarity recommended algorithm | |
Wang et al. | FRCA: High-efficiency container number detection and recognition algorithm with enhanced attention | |
CN114996500B (en) | Trademark graph retrieval method | |
CN103617627A (en) | Detection method for defects of printing characters on relay based on image registration technology | |
CN107045635A (en) | A kind of paper image paging sub title processing method of online paper-marking system |
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 |