Printing defect detection method and device

By segmenting and dual-detecting printed images, the accuracy and reliability issues of printing defect detection in existing technologies have been resolved, enabling rapid and accurate identification of printing defects, especially preventing minor defects from being missed, and improving the quality monitoring level of printed labels.

CN121481941APending Publication Date: 2026-02-06JIANGSU HIRAIN AUTOMOTIVE ELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511544111.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing methods for detecting printing defects are not very accurate or reliable. They are prone to false alarms and missed detections, especially under mechanical vibration and changes in lighting, making it difficult to meet the quality monitoring needs of modern industrial production.

Method used

By segmenting the image to be inspected into multiple sub-printed areas, using preset relative positions and sub-image comparisons, and combining positional information and image content for dual detection, a comprehensive defect detection result is generated, avoiding pixel-by-pixel comparison and improving detection accuracy and speed.

Benefits of technology

It enables rapid and accurate detection of printing defects, especially preventing minor defects such as broken lines from being missed, thus improving the reliability and comprehensiveness of printed label quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121481941A_ABST
    Figure CN121481941A_ABST
Patent Text Reader

Abstract

The invention discloses a printing defect detection method and device. Information of a first image is acquired; segmenting the first image to obtain N sub-printing areas in the first image, N being an integer greater than or equal to 1; the preset relative position is compared with the relative position of a target sub-printing area in the first image, a first type defect detection result is obtained, and the target sub-printing area is any one of the N sub-printing areas; comparing the preset sub-image with a sub-image in a target sub-printing area in the first image to obtain a second type of defect detection result; and generating a target detection result based on the first type of defect detection result and the second type of defect detection result. According to the embodiment of the invention, the accuracy and reliability of printing defect detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image processing, and particularly relates to a printing defect detection method and device. BACKGROUND

[0002] Product printing labels are important carriers for providing product model, purpose, brand and other information. In industrial production, various defects such as offset, ghosting, dirt, content loss, blur, broken line and the like are inevitably caused by factors such as manual operation, mechanical vibration, printer failure and the like.

[0003] Traditional printing defect detection methods mainly rely on manual visual inspection. However, the manual visual inspection method has significant shortcomings such as low efficiency, easy fatigue, high cost and the like, and is difficult to meet the urgent needs of product printing label quality monitoring in modern industrial production. Based on this, some existing technologies use image processing methods to detect printing defects, and recognize defects by comparing the differences between the to-be-detected image and the standard template image pixel by pixel. However, in actual application, due to the angle, size and position deviation between the real-time collected image and the standard template image caused by mechanical vibration, surface reflection and the like, and the random noise and halos caused by the influence of the detection environment light, the image registration accuracy is difficult to guarantee, and thus a large number of false positives and missed detections are caused, which seriously affects the accuracy and reliability of defect detection.

[0004] Therefore, the existing technology has the problem of low accuracy and reliability of printing defect detection. SUMMARY

[0005] The embodiments of the present application provide a printing defect detection method and device, which can improve the accuracy and reliability of printing defect detection.

[0006] In a first aspect, the embodiments of the present application provide a printing defect detection method, comprising: obtaining information of a first image; segmenting the first image to obtain N sub-printing areas in the first image, N being an integer greater than or equal to 1; comparing a preset relative position with a relative position of a target sub-printing area in the first image to obtain a first type of defect detection result, wherein the target sub-printing area is any one of the N sub-printing areas; comparing a preset sub-image with a sub-image in the target sub-printing area in the first image to obtain a second type of defect detection result; generating a target detection result based on the first type of defect detection result and the second type of defect detection result.

[0007] Based on the same inventive concept, in a second aspect, the embodiments of the present application also provide a printing defect detection device, comprising: an acquisition module configured to acquire information of the first image; a segmentation module configured to segment the first image to obtain N sub-printing areas in the first image, N being an integer greater than or equal to 1; a comparison module configured to compare a preset relative position with a relative position of a target sub-printing area in the first image to obtain a first type of defect detection result, the target sub-printing area being any one of the N sub-printing areas; the comparison module is further configured to compare a preset sub-image with a sub-image in the target sub-printing area in the first image to obtain a second type of defect detection result; a generation module configured to generate a target detection result based on the first type of defect detection result and the second type of defect detection result.

[0008] Based on the same inventive concept, in a third aspect, the embodiments of the present application further provide a printing defect detection device, which comprises a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the printing defect detection method in the first aspect or any of the embodiments of the first aspect.

[0009] Based on the same inventive concept, in a fourth aspect, the embodiments of the present application further provide a computer storage medium, which stores computer program instructions; the computer program instructions are executed by a processor to implement the printing defect detection method in the first aspect or any of the embodiments of the first aspect.

[0010] Based on the same inventive concept, in a fifth aspect, the embodiments of the present application further provide a computer program product, instructions in the computer program product are executed by a processor of a device to enable the device to execute the printing defect detection method in the first aspect or any of the embodiments of the first aspect.

[0011] The method and device for detecting printing defects provided by the embodiments of the present application, the method comprises the following steps: obtaining information of a first image to be detected, then segmenting the first image to be detected to obtain N sub-printing areas, each of which represents a printing unit, so as to perform more detailed defect detection. Then, the information of the preset relative position meeting the standard is compared with the information of the actual relative position of the target sub-printing area in the first image, whether the position of the sub-printing area deviates from the preset position can be detected, and whether there is a position deviation defect can be determined according to the degree of deviation, so that a first type of defect detection result can be obtained, whether there is a position deviation defect in the sub-printing area can be quickly and accurately determined, and it is not necessary to compare the differences between the image to be detected and the standard template image pixel by pixel to identify the position deviation defect, thereby improving the speed and accuracy of the printing defect detection. The target sub-printing area is any one of the N sub-printing areas. Then, the preset sub-image is compared with the sub-image in the target sub-printing area in the first image, whether the image in the sub-printing area is consistent with the expected image can be detected, so that a second type of defect detection result can be obtained, and detailed defect detection can be performed on each sub-printing area instead of general pixel-by-pixel comparison on the whole image, which is helpful for more accurate positioning and analysis of defects. Next, the target detection result can be generated based on the first type of defect detection result and the second type of defect detection result. By segmenting the image to be detected into a plurality of sub-printing areas and detecting the relative position of the sub-printing area in the image to be detected in combination with the preset relative position information corresponding to the sub-printing area, whether there is a position deviation defect in the sub-printing area can be accurately determined, and the first type of defect detection result can be generated. Meanwhile, the preset sub-image corresponding to the sub-printing area is compared with the sub-image in the target sub-printing area in the image to be detected, whether the image in the sub-printing area is consistent with the expected image can be detected, defects such as dirt, missing, ghosting, blur, broken line and the like can be detected, and the second detection result can be generated. Then, the first type of defect detection result and the second type of defect detection result are comprehensively combined to generate the final target detection result, the double detection of the position information and the image content is combined, various printing defects can be more comprehensively, accurately and reliably detected, and strong support is provided for improving the quality monitoring level of product printing labels. BRIEF DESCRIPTION OF DRAWINGS

[0012] Other features, objects, and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments thereof as taken in conjunction with the accompanying drawings, in which like or similar numerals designate like or similar features, and in which:

[0013] Figure 1 is a common printing label defect schematic diagram in the method for detecting printing defects provided by the embodiments of the present application; Figure 2is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 3 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 4 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 5 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 6 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 7 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 8 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 9 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 10 is another flowchart of a method for detecting a printing defect provided by an embodiment of the present application; Figure 11 is a schematic diagram of a detection result in a method for detecting a printing defect provided by an embodiment of the present application; Figure 12 is a schematic diagram of a detection device for detecting a printing defect provided by an embodiment of the present application; Figure 13 is a schematic diagram of a detection device for detecting a printing defect provided by an embodiment of the present application. DETAILED DESCRIPTION

[0014] The features and exemplary embodiments of various aspects of the present application will be described in detail below, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are configured only to explain the present application, and are not configured to limit the present application. The present application can be implemented without some of these specific details by those skilled in the art. The following description of the embodiments is merely to provide a better understanding of the present application by showing examples of the present application.

[0015] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0016] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0017] Various modifications and variations can be made to this application without departing from its spirit or scope, which will be apparent to those skilled in the art. Therefore, this application is intended to cover modifications and variations falling within the scope of the corresponding claims (the claimed technical solutions) and their equivalents. It should be noted that the implementation methods provided in the embodiments of this application can be combined with each other without contradiction.

[0018] Before describing the technical solutions provided in the embodiments of this application, in order to facilitate understanding of the embodiments of this application, this application first specifically explains the problems existing in the related technologies: Product labels are an important carrier of information such as product model, purpose, and brand. In industrial production, various defects are inevitable due to factors such as manual operation, mechanical vibration, and printer malfunctions. These defects include misalignment, ghosting, dirt, missing content, blurriness, and broken lines. Figure 1 As shown, Figure 1 This is a diagram illustrating common defects in product printing labels.

[0019] The related printing defect detection method mainly relies on manual inspection. However, the manual inspection method has significant disadvantages such as low efficiency, fatigue, high cost, and the like, and is difficult to meet the urgent needs of product printing label quality monitoring in modern industrial production. Based on this, some existing technologies use an image processing method to detect printing defects, and identify defects by comparing differences between a to-be-detected image and a standard template image pixel by pixel. However, in actual application, due to reasons such as mechanical vibration, surface reflection, and the like, there are deviations in angle, size, and position between a real-time collected image and a standard template image, and random noise and halos appear due to the influence of the detection environment light, which makes it difficult to guarantee the image registration accuracy, and further causes more false positives and missed detections, seriously affecting the accuracy and reliability of defect detection. Therefore, the related technology has the problem of low accuracy and reliability of printing defect detection.

[0020] In addition, due to the obvious but small size of the broken line defect feature, the difference method of pixel-by-pixel comparison is easy to cause the small defect (such as broken line) to be missed.

[0021] Based on this, the embodiment of the present application provides a printing defect detection method, device, equipment, medium and program product, which can improve the accuracy and reliability of printing defect detection, and can also prevent small defects (such as broken lines) from being missed.

[0022] The printing defect detection method provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0023] Figure 2 is a flowchart of a printing defect detection method provided by the embodiment of the present application, as shown in Figure 2 the method can include steps S110-S150.

[0024] S110, obtaining information of a first image.

[0025] The image to be detected can be referred to as the first image.

[0026] Specifically, when detecting whether the first image has a printing defect, first, the image information of the first image is obtained, for example, the image information of the first image can be obtained through a camera.

[0027] S120, segmenting the first image to obtain N sub-printing areas in the first image, N being an integer greater than or equal to 1.

[0028] Specifically, by analyzing the content in the first image, the first image can be segmented to obtain a printing area and a background area in the first image, and the printing area can also be segmented into N sub-printing areas, each sub-printing area representing a printing unit, so as to perform more detailed defect detection.

[0029] In one example, the sub-printing area is a rectangular area.

[0030] S130, comparing the preset relative position with the relative position of the target sub-printing area in the first image to obtain a first type of defect detection result, wherein the target sub-printing area is any one of the N sub-printing areas.

[0031] Each sub-printing area in the first image corresponds to a preset relative position.

[0032] The target sub-printing area is any one of the N sub-printing areas Specifically, comparing the information of the preset relative position meeting the standard with the information of the actual relative position of the sub-printing area in the first image can detect whether the position of the sub-printing area deviates from the preset position, and according to the degree of deviation, it can be judged whether there is a deviation defect, so as to obtain the first type of defect detection result, which can quickly and accurately judge whether the sub-printing area has a position deviation defect, without comparing the differences between the to-be-detected image and the standard template image pixel by pixel to identify the deviation defect, thereby improving the speed and accuracy of the printing defect detection.

[0033] S140, comparing the preset sub-image with the sub-image in the target sub-printing area in the first image to obtain a second type of defect detection result.

[0034] Specifically, comparing the preset sub-image with the sub-image in the target sub-printing area in the first image can detect whether the image in the sub-printing area is consistent with the expected image, thereby obtaining the second type of defect detection result, which can conduct detailed defect detection on each sub-printing area instead of general pixel-by-pixel comparison on the entire image, which helps to more quickly and accurately locate and analyze defects, and can detect defects such as dirt, missing, ghosting, blur, and broken lines.

[0035] S150, generating a target detection result based on the first type of defect detection result and the second type of defect detection result.

[0036] Specifically, based on the first type of defect detection result and the second type of defect detection result, a comprehensive target detection result can be generated, and the target detection result includes various defect information detected.

[0037] According to the method for detecting printing defects provided in the embodiments of the present application, information of the first image to be detected is acquired, and then the first image to be detected is segmented to obtain N sub-printing areas, each of which represents a printing unit, so as to perform more detailed defect detection. Then, the information of the preset relative position meeting the standard is compared with the information of the actual relative position of the target sub-printing area in the first image, whether the position of the sub-printing area deviates from the preset position can be detected, and whether there is a deviation defect can be determined according to the degree of deviation, so that the first type of defect detection result can be obtained, whether the position of the sub-printing area deviates can be quickly and accurately determined, the angle, size and position deviation problems caused by mechanical vibration and the like in the related art are solved, and the accuracy of image registration is improved. The target sub-printing area is any one of the N sub-printing areas. Then, the preset sub-image is compared with the sub-image in the target sub-printing area in the first image, whether the image in the sub-printing area is consistent with the expected image can be detected, so that the second type of defect detection result can be obtained, and detailed defect detection can be performed on each sub-printing area instead of general pixel-by-pixel comparison on the whole image, which is helpful for more accurate positioning and analysis of defects. Next, the target detection result can be generated based on the first type of defect detection result and the second type of defect detection result. By segmenting the image to be detected into a plurality of sub-printing areas and detecting the relative position of the sub-printing area in the image to be detected in combination with the preset relative position information corresponding to the sub-printing area, whether the position of the sub-printing area deviates can be accurately determined, and the first type of defect detection result can be generated. Meanwhile, the preset sub-image corresponding to the sub-printing area is compared with the sub-image in the target sub-printing area in the image to be detected, whether the image in the sub-printing area is consistent with the expected image can be detected, defects such as dirt, missing, ghosting, blur and broken line can be detected, and the second detection result can be generated. Then, the first type of defect detection result and the second type of defect detection result are comprehensively combined to generate the final target detection result, which combines the dual detection of position information and image content, can more comprehensively, accurately and reliably detect various printing defects, and provides strong support for improving the quality monitoring level of product printing labels.

[0038] The embodiments of the present application will be described below in combination with Figures 3-5 The specific process of segmenting the first image to obtain N sub-printing areas in the first image in the method for detecting printing defects provided in the embodiments of the present application will be introduced.

[0039] Figure 3 Another flowchart of the method for detecting printing defects provided in the embodiments of the present application.

[0040] In some embodiments, as Figure 3As shown, step S120 of segmenting the first image to obtain N sub-printing regions in the first image can include steps S121-S123.

[0041] S121, using a preset semantic recognition model, recognizing text line information and graphic block information in the first image; based on the text line information and the graphic block information in the first image, segmenting the first image to obtain P sub-printing regions and a background region, P being an integer greater than or equal to 1.

[0042] Specifically, through the trained semantic recognition model, the text content (such as title, paragraph, etc. text line) and graphic elements (such as charts, logos, decorative patterns, QR codes, etc. graphic blocks) in the first image can be parsed to accurately locate their positions and boundaries. Subsequently, based on the recognized text and graphic information as the segmentation basis, the first image is divided into P sub-printing regions (such as independent text blocks, chart units, QR codes, etc.) with independent meanings and a background region.

[0043] S122, extracting a background image in the background region and performing binaryzation processing on the background image to obtain a binaryzation background image; using a preset semantic recognition model, recognizing text line information and graphic block information in the binaryzation background image; based on the text line information and the graphic block information in the binaryzation background image, segmenting the binaryzation background image to obtain Q sub-printing regions, Q being an integer greater than or equal to 0.

[0044] Specifically, the background image is extracted from the background region of the first image, and through binaryzation processing, it is converted into a simplified image containing only black and white pixels to highlight potential printing elements. Subsequently, a pre-trained semantic recognition model is used to analyze the binaryzation processed background image, locate the positions and contours of possible residual text lines (such as blurred text, watermarks) and graphic blocks (such as dark lines, symbols), and further segment the background image into Q sub-printing regions with clear content characteristics (Q≥0), Q=0 indicating that the background region has no printing content. This process realizes fine detection by combining image binaryzation and semantic segmentation technology.

[0045] S123, among the P sub-printing regions and the Q sub-printing regions, finding and merging sub-printing regions in the same row to obtain N sub-printing regions, the sum of P and Q being greater than or equal to N.

[0046] Specifically, from the P+Q sub-regions segmented from the first image, adjacent sub-regions in the same text line or graphic line in the horizontal dimension (such as continuous text paragraphs accidentally segmented, decorative lines across regions, etc.) can be identified through coordinate positioning, and then these spatially continuous and semantically associated sub-regions are merged to finally generate N more complete printed blocks (N≤P+Q). This merging operation eliminates the problem of excessive fragmentation caused by the limitations of the segmentation algorithm.

[0047] The embodiment of the present application significantly improves the quality inspection efficiency of complex printed matter through hierarchical fine processing. Specifically, first, the semantic recognition model is used to accurately locate the sub-printing area, segment the image into independent semantic units (P sub-printing areas) and background areas to avoid content confusion, then the background area is binarized and enhanced for secondary recognition, which can capture hidden printed content such as fuzzy watermarks and dark lines (Q sub-printing areas), forming a full-dimensional detection of printed content, and then the P+Q sub-printing areas are merged at the line level to eliminate the problem of excessive fragmentation caused by algorithm segmentation, making the detection unit more consistent with the actual printing layout logic.

[0048] Figure 4 is another flowchart of the method for detecting printing defects provided by the embodiment of the present application, which introduces the specific process of how to find sub-printing areas in the same line.

[0049] In some embodiments, as shown in Figure 4 finding sub-printing areas in the same line in the P sub-printing areas and the Q sub-printing areas in step S123 can include steps S1231 and S1232.

[0050] S1231, in the P sub-printing areas and the Q sub-printing areas, obtaining information of a projection line overlap ratio and information of a distance of any two sub-printing areas in a preset reading direction.

[0051] Specifically, after all (P+Q) sub-printing areas are segmented from the first image, the overlap ratio of the projection line segments of any two sub-printing areas in the preset reading direction (such as horizontally from left to right) can be calculated first to determine whether they belong to the same line; secondly, the interval distance of the two sub-printing areas in the preset reading direction (such as horizontally from left to right) is measured.

[0052] S1232, in the case where the projection line overlap ratio is greater than or equal to a first preset threshold and the distance is less than or equal to a second preset threshold, determining that any two sub-printing areas are sub-printing areas in the same line.

[0053] Specifically, if the overlap ratio of the projected lines of two sub-printed areas is greater than or equal to a first preset threshold (e.g., 0.5) and the distance between them in a preset reading direction (e.g., horizontal from left to right) is less than or equal to a second preset threshold (e.g., 25 pixels), it indicates that these two areas have sufficient alignment accuracy and meet the inline element spacing specifications, and therefore can be determined to belong to the same printed line. This dual-threshold logic effectively avoids misjudgments that may be caused by a single indicator, thereby significantly improving the accuracy and robustness of line structure recognition.

[0054] This application's embodiments significantly optimize the accuracy and robustness of printed line structure recognition through a dual-threshold determination mechanism. By simultaneously verifying the projection overlap and spacing of any two sub-printed areas: a projection line overlap ratio greater than or equal to a first threshold ensures visual alignment of elements (e.g., straight text lines), while a spacing less than or equal to a second threshold constrains the reasonable density of elements within the line. This composite determination logic effectively solves the misjudgment problem that may be caused by a single indicator, avoiding both incorrectly grouping misaligned but adjacent elements into a single line and forcibly merging aligned but excessively spaced elements.

[0055] Figure 5 This is another flowchart illustrating the printing defect detection method provided in the embodiments of this application.

[0056] In some embodiments, such as Figure 5 As shown, before comparing the preset relative position with the relative position of the target sub-printed area in the first image in step S130 to obtain the first type of defect detection result, the printing defect detection method may further include step S160.

[0057] S160, among multiple preset sub-printing areas, determine the target preset sub-printing area corresponding to the target sub-printing area.

[0058] Among them, the preset sub-printing area is a sub-printing area that meets the standard requirements.

[0059] Specifically, among a number of pre-stored preset sub-printing areas that meet the standard requirements, the target preset sub-printing area that meets the standard requirements corresponding to the target sub-printing area in the first image is determined.

[0060] Step S130 compares the preset relative position with the relative position of the target sub-printed area in the first image to obtain the first type of defect detection result, which may include steps S131 and S132.

[0061] S131, in the first correspondence between the preset sub-printing area and the preset relative position, obtain the target preset relative position corresponding to the target preset sub-printing area.

[0062] The preset relative position is a relative position that meets the standard requirements.

[0063] Specifically, after determining the target preset sub-printing area that meets the standard requirements corresponding to the target sub-printing area in the first image, the target preset relative position that meets the standard requirements corresponding to the target preset sub-printing area can be found according to the first correspondence.

[0064] S132, compare the preset relative position of the target with the relative position of the target sub-printed area in the first image to obtain the first type of defect detection result.

[0065] Specifically, after finding the target preset relative position that meets the standard requirements corresponding to the target sub-printed area in the first image, the target preset relative position that meets the standard requirements can be compared with the actual relative position of the target sub-printed area in the first image to obtain the first type of defect detection result.

[0066] This application embodiment determines the target preset sub-printing area (i.e., the reference area that meets the standard requirements) corresponding to the target sub-printing area, and compares the difference between the actual relative position of the target sub-printing area and the preset relative position of the target preset sub-printing area (i.e., the relative position that meets the standard requirements), thereby enabling more accurate detection of the first type of defect.

[0067] Figure 6 This is another flowchart illustrating the printing defect detection method provided in the embodiments of this application.

[0068] In some embodiments, such as Figure 6 As shown, before determining the target preset sub-printing area corresponding to the target sub-printing area in multiple preset sub-printing areas in step S160, the printing defect detection method may further include steps S171 to S174.

[0069] S171, Obtain information about the defect-free second image.

[0070] S172, the second image is segmented to obtain multiple preset sub-printing areas in the second image.

[0071] S173, determine the hierarchical identification information corresponding to the preset sub-printing area based on the location information of the preset sub-printing area and the overlap area ratio between each preset sub-printing area.

[0072] S174, Based on the layer identification information corresponding to the preset sub-printing area, generate a second correspondence between the preset sub-printing area and the layer identification information.

[0073] Among them, the hierarchical identification information is unique.

[0074] Specifically, information about a defect-free good product image is obtained. This good product image is used to generate a second correspondence between preset sub-printing areas and hierarchical identification information. This good product image can be called a second image. Then, the second image is divided into multiple preset sub-printing areas, and the hierarchical identification information of each area is determined according to the position information of these areas and the overlap area ratio between the areas, thereby establishing a correspondence between preset sub-printing areas and hierarchical identification information.

[0075] Step S160, in multiple preset sub-printing areas, determines the target preset sub-printing area corresponding to the target sub-printing area, which may include steps S161 and S162.

[0076] S161, based on the position information of the sub-printed areas in the first image and the overlap area ratio between each sub-printed area, determine the layer identification information corresponding to the sub-printed areas in the first image.

[0077] S162, in multiple preset sub-printing areas, based on the second correspondence between the preset sub-printing areas and the hierarchical identification information, determine the target preset sub-printing area corresponding to the target sub-printing area, and the hierarchical identification information corresponding to the target sub-printing area is the same as the hierarchical identification information corresponding to the target preset sub-printing area.

[0078] Specifically, by analyzing the positional information of the sub-printed regions and the overlap ratio between regions in the first image, the unique hierarchical identification information corresponding to each sub-printed region can be determined. Then, by utilizing the correspondence between preset sub-printed regions and hierarchical identification information, preset sub-printed regions with the same hierarchical identification as the sub-printed regions in the first image can be quickly found.

[0079] This application embodiment establishes a correspondence between a preset sub-printing area and unique hierarchical identification information by using a defect-free good product image (second image). Then, by comparing the hierarchical identification information, the target preset sub-printing area corresponding to the target sub-printing area in the first image can be determined. By comparing the hierarchical information, the preset sub-printing area corresponding to the target sub-printing area can be found more quickly and accurately, thereby improving the efficiency and accuracy of defect detection.

[0080] It should be noted that by introducing hierarchical identification information, a set of multi-level cascading standard templates has been established, which can quickly find the standard preset sub-printing areas corresponding to each sub-printing area in the first image, thus avoiding the problems of low registration accuracy and slow speed caused by the deformation of large-format full-page images.

[0081] Figure 7 This is another flowchart illustrating the printing defect detection method provided in the embodiments of this application.

[0082] In some embodiments, such asFigure 7 As shown, step S140 compares the preset sub-image with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result, which may include steps S141 and S142.

[0083] S141, in the third correspondence between the preset sub-printing area and the preset sub-image, obtain the target preset sub-image corresponding to the target preset sub-printing area.

[0084] S142, compare the target preset sub-image with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result.

[0085] Among them, the preset sub-image is the sub-image that meets the standard requirements corresponding to the preset sub-printing area.

[0086] Specifically, based on the correspondence between preset sub-printing areas and preset sub-images, a target preset sub-image matching the target preset sub-printing area can be found. Then, this target preset sub-image is compared with the actual sub-image within the target sub-printing area in the first image. This allows for the accurate detection of second-type defects (such as dirt, missing parts, ghosting, blurring, broken lines, etc.). Detailed defect detection can be performed on each sub-printing area without the need for a general pixel-by-pixel comparison of the entire image, which helps to more accurately locate and analyze defects.

[0087] This application embodiment achieves accurate detection of second-type defects (such as dirt, missing parts, ghosting, blurring, broken lines, etc.) by comparing a preset standard sub-image (preset sub-image) with the corresponding sub-image of the sub-printing area in the actual printed image. It does not require a general pixel-by-pixel comparison of the entire image, but performs detailed defect analysis on each sub-printing area, which helps to locate and analyze defects more quickly.

[0088] Figure 8 This is another flowchart illustrating the printing defect detection method provided in the embodiments of this application.

[0089] In some embodiments, such as Figure 8 As shown, before obtaining the target preset sub-image corresponding to the target preset sub-printing area in the third correspondence between the preset sub-printing area and the preset sub-image in step S141, the printing defect detection method may further include steps S181 to S187.

[0090] S181, obtain information on M defect-free third images, where M is an integer greater than or equal to 1.

[0091] S182, the third image is segmented to obtain multiple sub-printed regions in the third image.

[0092] S183, based on the location information of the sub-printed areas in the third image and the overlap ratio between each sub-printed area, determine the hierarchical identification information corresponding to the sub-printed areas in the third image.

[0093] In one example, if the overlap ratio between two sub-printed areas in the third image is greater than or equal to 0.95, the smaller frame is considered a sub-frame of the larger frame and is reflected in the hierarchical identification information. In other words, the hierarchical identification information not only contains the hierarchical information of each sub-printed area, but also the positional relationship between sub-printed areas of different levels.

[0094] S184, among the M third images, obtain the M sub-images corresponding to the same type of sub-printing area, and the layer identification information corresponding to the same type of sub-printing area is the same.

[0095] S185, merge the M sub-images corresponding to the same type of sub-printing area to obtain the merged sub-image.

[0096] S186, divide each pixel value in the fused sub-image by M to obtain the preset sub-image corresponding to the same type of sub-printing area.

[0097] S187, Based on the preset sub-images corresponding to the same type of sub-printing area, generate a third correspondence between the preset sub-printing area and the preset sub-image.

[0098] Specifically, multiple defect-free images of good products are acquired. These good product images are used to generate a third correspondence between preset sub-printing regions and preset sub-images; these good product images can be referred to as the third image. Then, multiple sub-printing regions are segmented from the defect-free good product image (the third image), and the hierarchical identifiers of these regions are determined. Next, sub-images within the same hierarchical identifier are fused, and their average value is calculated to generate a preset sub-image. This preset sub-image is then used as the sub-image that meets the standard requirements corresponding to the preset sub-printing region. A third correspondence between the preset sub-printing region and the preset sub-image can then be established. This improves the accuracy and representativeness of the preset sub-images, providing a more reliable reference standard for subsequent defect detection. It reduces subsequent false detections caused by color differences, thickness variations, etc., that may exist in a single standard image, effectively reduces the influence of lighting conditions, and improves the robustness of the detection.

[0099] This application embodiment obtains multiple defect-free good product images in advance, segments sub-printing areas from these images, determines layer identifiers, and merges similar sub-images to generate accurate preset sub-images. This establishes a correspondence between preset sub-printing areas and preset sub-images, improving the accuracy and representativeness of preset sub-images. This provides a more reliable reference standard for subsequent defect detection, effectively reducing the impact of factors such as color difference, thickness, and lighting on the detection results, and enhancing the robustness and accuracy of the detection.

[0100] Figure 9 This is another flowchart illustrating the printing defect detection method provided in the embodiments of this application.

[0101] In some embodiments, such as Figure 9 As shown, before generating the target detection result based on the first type of defect detection result and the second type of defect detection result in step S150, the printing defect detection method may further include step S190.

[0102] S190: Using a preset broken wire defect recognition model, identify broken wire defects in the first image and obtain the third type of defect detection result.

[0103] Specifically, the first image can be analyzed using a trained target recognition model (broken line defect recognition model) to detect and identify broken line defects, and a third type of defect detection result can be obtained based on this. This allows for the discovery and recording of quality problems caused by broken lines in the image.

[0104] Step S150 generates target detection results based on the first type of defect detection results and the second type of defect detection results, which may include step S151.

[0105] S151, Based on the first type of defect detection results, the second type of defect detection results, and the third type of defect detection results, generate the target detection results.

[0106] Specifically, by integrating the first type of defect detection results (such as offset defects in sub-printing areas), the second type of defect detection results (such as dirt, missing parts, ghosting, blurring, etc.), and the third type of defect detection results (for the identification of broken lines), a comprehensive and detailed target detection result is finally generated, which comprehensively reflects the various defects present on the printed matter.

[0107] This application embodiment utilizes a preset line break defect identification model to detect specific third-type defects (such as line break defects), thereby enabling more comprehensive detection of first-type (such as offset), second-type (such as dirt, missing, ghosting, blur, etc.) and third-type defects in printed materials. As a result, the generated target detection results are more detailed and reliable, preventing minor defects (such as line break) from being missed and improving the accuracy of printed material quality assessment.

[0108] Figure 10 This is another flowchart illustrating the printing defect detection method provided in the embodiments of this application.

[0109] In some embodiments, such as Figure 10As shown, before step S190 uses a preset broken line defect recognition model to identify broken line defects in the first image and obtain the third type of defect detection result, the printing defect detection method may also include steps S201 to S204.

[0110] S201, Obtain information from a grayscale image without broken lines.

[0111] S202 uses simulation software to generate a grayscale image with a broken wire defect.

[0112] For example, set the width of the broken line to 1-3 pixels and the number to 1-5 pixels, randomly generate the location of the broken line defect, and set the color of the broken line defect to the background color.

[0113] S203, a grayscale image with a broken line defect is fused with two grayscale images without broken line defects to obtain a color image.

[0114] S204. Using color images as training samples, supervised training is performed on the original broken wire defect recognition model to obtain the preset broken wire defect recognition model.

[0115] Specifically, firstly, images without broken wire defects are collected and processed into grayscale to obtain grayscale images without broken wire defects. Then, simulation software can be used to generate grayscale images containing broken wire defects, where the broken wire is the same color as the background area. Then, the grayscale image containing broken wire defects is fused with two grayscale images without defects to generate an RGB color image. For example, the broken wire defect is cyan in the RGB broken wire defect image rather than the background color. Then, the color image is used as a training sample to supervise the training of the initial broken wire defect recognition model until an optimized broken wire defect recognition model that can recognize broken wire defects is obtained, which is the preset broken wire defect recognition model.

[0116] Step S190 uses a preset broken wire defect recognition model to identify broken wire defects in the first image and obtains the third type of defect detection result, which may include steps S191 to S193.

[0117] S191, perform grayscale processing on the first image to obtain the target grayscale image.

[0118] S192, the target grayscale image is fused with two grayscale images without broken lines to obtain the target color image.

[0119] S193: Using a pre-set broken line defect recognition model, identify broken line defects in the target color image and obtain the third type of defect detection result.

[0120] Specifically, the process of using the trained wire breakage defect recognition model is as follows: First, the first image is converted into a grayscale image to obtain the target grayscale image. Then, this target grayscale image is fused with two grayscale images without wire breakage defects to generate a target color image. The target color image is then input into the preset wire breakage defect recognition model, which analyzes the target color image and identifies the wire breakage defects within it, thus obtaining the third type of defect detection result and improving the detection rate of wire breakage defects.

[0121] This application embodiment utilizes a defect-free grayscale image and simulation software to generate a grayscale image containing a broken line defect. A color image is then created using image fusion technology, and this color image is used as a training sample to perform supervised training on the broken line defect recognition model, resulting in an optimized preset model. This preset model can efficiently and accurately identify broken line defects in the first image, obtaining the third type of defect detection result, thus improving the detection accuracy of broken line defects and providing strong support for the quality control of printed materials.

[0122] In one example, the defect detection process for the first image is as follows: 1) Detect the first type of defects (such as offset defects).

[0123] Obtain the outer perimeter of the printed label of the product to be inspected (the outer perimeter of the first image), denoted as label_rect.

[0124] Obtain the edges of each sub-printed region in the first image, calculate the minimum bounding rectangle of the sub-printed region (i.e., the sub-printed region is a rectangle), and segment the first image according to the rectangle to obtain N sub-printed regions in the first image, denoted as detect_rect.

[0125] Then, the minimum spacing (min_spacings) of the four sides of label_rect and detect_rect (i.e., the relative position of the sub-printed area in the first image) is calculated. Based on the set threshold (i.e., the preset relative position), it is determined whether there is an offset defect. For example, by matching the preset relative position with the relative position of the sub-printed area in the first image, the detection result of the first type of defect (such as offset defect) can be obtained. If the match is successful (the relative position offset is small), there is no offset defect; if the match fails (the relative position offset is large), there is an offset defect.

[0126] 2) Adjust the size of the image to be detected (first image) to match the size of the template image (second image) used for modeling. The first image after size adjustment is denoted as resize_detect_image.

[0127] 3) Detect the second type of defects (such as dirt, missing parts, ghosting, blurring, etc.).

[0128] 3.1) Identify the preset sub-printing area to be detected (target preset sub-printing area).

[0129] In one example, it determines whether the bounding boxes of preset sub-printing regions have a cascading relationship. If so, iterates through the sub-boundaries first, and then through the parent bounding box. For example, it determines whether the bounding boxes of preset sub-printing regions have a cascading relationship based on the overlap area ratio between them. For instance, if the overlap area ratio between preset sub-printing region 1 and preset sub-printing region 2 is greater than 0.95, and preset sub-printing region 1 is the smaller bounding box and preset sub-printing region 2 is the larger bounding box, then the smaller bounding box (preset sub-printing region 1) is considered a sub-bounding of the larger bounding box (preset sub-printing region 2). For example, preset sub-printing region 1 can be detected first, and then preset sub-printing region 2 can be detected.

[0130] In another example, the detection order of the preset sub-printed areas can be determined based on the hierarchical identification information (representing the cascading relationship) corresponding to the preset sub-printed areas.

[0131] 3.2) Find the standard image corresponding to the preset sub-printing area. For example, in the third correspondence between preset sub-printing areas and preset sub-images, obtain the target preset sub-image corresponding to the target preset sub-printing area.

[0132] In one example, the standard position of the bounding box of each preset sub-printing area (the position of the preset sub-printing area) and the standard template image corresponding to the standard position (the preset sub-image corresponding to the preset sub-printing area, which can be denoted as gold_template_image) are traversed and loaded.

[0133] 3.3) Find the actual image corresponding to the preset sub-printing area, and align the standard image corresponding to the preset sub-printing area with the actual image.

[0134] For example, the process of obtaining the sub-image (actual image) in each sub-printed area in the first image is as follows: the bounding box is expanded by 1.5 times, and the corresponding position image in the resize_detect_image of the first image (the sub-image in the sub-printed area, denoted as crop_detect_image) is cropped.

[0135] The process of finding the actual image corresponding to the preset sub-printed area is as follows: the preset sub-image gold_template_image is registered with the sub-image crop_detect_image in each sub-printed area (the registration method can be feature point matching, optical flow matching, etc.). If the registration is successful, the registered image match_crop_detect_image (the actual image corresponding to the preset sub-printed area) is obtained. Otherwise, the detection of the bounding box is skipped, and the content of the bounding box is added to the background area of ​​the image to be detected.

[0136] 3.4) Compare the target preset sub-image with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result.

[0137] For example, a brightness and darkness difference detection is performed between the preset sub-image gold_template_image and the sub-image match_crop_detect_image in the sub-printed region. That is, the preset sub-image gold_template_image is dilated / shrunk and eroded with a kernel size of 3×3 to obtain bright and dark templates; then, the difference is processed between the preset sub-image gold_template_image and the actual sub-image match_crop_detect_image to determine whether the first image has bright and dark defects, including possible dirt, missing parts, ghosting, and blurring defects.

[0138] For example, during comparison, if a brighter area is found in the sub-printed area image than the corresponding area of ​​the bright template, then these brighter areas are bright defects; if a darker area is found in the sub-printed area image than the corresponding area of ​​the dark template, then these darker areas are dark defects. For example, in a color poster, under normal circumstances, a certain pattern should be complete and vibrant (similar to a standard sample), but during printing, this part of the pattern was not printed well, missing some colors, causing this area to appear darker than the surrounding area. This is a dark defect caused by a defect in the printed material.

[0139] 3.5) After completing the defect detection in the sub-printing area, merge the detected defect sub-images into the full-page defect image, and replace the content within the bounding box with the background color.

[0140] In this embodiment, the offset defect is first accurately detected by comparing the relative position of the sub-printed area in the first image with the standard relative position; then the image size is adjusted to ensure the uniformity of the detection benchmark; for the second type of defect, the preset sub-printed area detection order is first clarified, then the standard and actual images are accurately obtained and registered and aligned, then the brightness and darkness deviation detection is used to comprehensively find defects such as dirt and missing parts, and finally the defect sub-images are merged to obtain the defect image, thereby improving the quality and efficiency of printed defect detection.

[0141] In one example, actual testing showed that the defect detection time for a single product printed label was approximately 200ms, and the achieved detection effect was as follows: Figure 11 As shown, it can reliably detect defects such as broken lines, offsets, dirt, missing parts, ghosting, and blurring. The defect detection rate of the embodiments in this application is high, robust, and fast.

[0142] Based on the same inventive concept, embodiments of this application also provide a device for detecting printing defects, such as... Figure 12 As shown, the device 1200 may include an acquisition module 1210, a segmentation module 1220, a comparison module 1230, and a generation module 1240: The acquisition module 1210 is used to acquire information from the first image; The segmentation module 1220 is used to segment the first image to obtain N sub-printed regions in the first image, where N is an integer greater than or equal to 1; The comparison module 1230 is used to compare the preset relative position with the relative position of the target sub-printed area in the first image to obtain the first type of defect detection result, wherein the target sub-printed area is any one of the N sub-printed areas; The comparison module 1230 is also used to compare the preset sub-image with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result; The generation module 1240 is used to generate target detection results based on the first type of defect detection results and the second type of defect detection results.

[0143] In some embodiments, the segmentation module is used to segment the first image to obtain N sub-printed regions in the first image. Specifically, it can be used to: identify text line information and graphic block information in the first image using a preset semantic recognition model; segment the first image based on the text line information and graphic block information in the first image to obtain P sub-printed regions and a background region, where P is an integer greater than or equal to 1; extract the background image within the background region and then perform binarization processing on the background image to obtain a binarized background image; identify text line information and graphic block information in the binarized background image using a preset semantic recognition model; segment the binarized background image based on the text line information and graphic block information in the binarized background image to obtain Q sub-printed regions, where Q is an integer greater than or equal to 0; find sub-printed regions in the same row among the P and Q sub-printed regions and merge the sub-printed regions in the same row to obtain N sub-printed regions, where the sum of P and Q is greater than or equal to N.

[0144] In some embodiments, the segmentation module is used to find sub-printing areas in the same row among P sub-printing areas and Q sub-printing areas. Specifically, it can be used to: obtain information on the overlap ratio of projection lines of any two sub-printing areas in a preset reading direction and information on the distance between them; and determine any two sub-printing areas as sub-printing areas in the same row if the overlap ratio of projection lines is greater than or equal to a first preset threshold and the distance is less than or equal to a second preset threshold.

[0145] In some embodiments, before the comparison module compares the preset relative position with the relative position of the target sub-printed area in the first image to obtain a first type of defect detection result, the apparatus further includes a determination module: the determination module is used to determine, among a plurality of preset sub-printed areas, a target preset sub-printed area corresponding to the target sub-printed area; the comparison module is used to compare the preset relative position with the relative position of the target sub-printed area in the first image to obtain a first type of defect detection result, specifically used to: obtain the target preset relative position corresponding to the target preset sub-printed area in a first correspondence between preset sub-printed areas and preset relative positions; compare the target preset relative position with the relative position of the target sub-printed area in the first image to obtain a first type of defect detection result.

[0146] In some embodiments, before the determining module determines the target preset sub-printing area corresponding to the target sub-printing area among multiple preset sub-printing areas, the apparatus further includes: an acquisition module, further configured to acquire information of a defect-free second image; a segmentation module, further configured to segment the second image to obtain multiple preset sub-printing areas in the second image; a determining module, further configured to determine the hierarchical identification information corresponding to the preset sub-printing area based on the position information of the preset sub-printing area and the overlap area ratio between each preset sub-printing area; a generating module, further configured to generate a second correspondence between the preset sub-printing area and the hierarchical identification information based on the hierarchical identification information corresponding to the preset sub-printing area; the determining module is configured to determine the target preset sub-printing area corresponding to the target sub-printing area among multiple preset sub-printing areas, specifically configured to: determine the hierarchical identification information corresponding to the sub-printing area in the first image based on the position information of the sub-printing area in the first image and the overlap area ratio between each sub-printing area; and determine the target preset sub-printing area corresponding to the target sub-printing area among multiple preset sub-printing areas based on the second correspondence between the preset sub-printing area and the hierarchical identification information, wherein the hierarchical identification information corresponding to the target sub-printing area is the same as the hierarchical identification information corresponding to the target preset sub-printing area.

[0147] In some embodiments, the comparison module is used to compare a preset sub-image with a sub-image within the target sub-printing area in the first image to obtain a second type of defect detection result. Specifically, it can be used to: obtain a target preset sub-image corresponding to the target preset sub-printing area in a third correspondence between the preset sub-printing area and the preset sub-image; and compare the target preset sub-image with a sub-image within the target sub-printing area in the first image to obtain a second type of defect detection result.

[0148] In some embodiments, before the acquisition module acquires the target preset sub-image corresponding to the target preset sub-printing region in the third correspondence between the preset sub-printing region and the preset sub-image, the device further includes a fusion module and a calculation module: the acquisition module is further configured to acquire information of M defect-free third images, where M is an integer greater than or equal to 1; the segmentation module is further configured to segment the third images to obtain multiple sub-printing regions in the third images; the determination module is further configured to determine the hierarchical identification information corresponding to the sub-printing regions in the third images based on the position information of the sub-printing regions in the third images and the overlap area ratio between each sub-printing region; the acquisition module is further configured to acquire M sub-images corresponding to the same type of sub-printing regions from the M third images, where the hierarchical identification information corresponding to the same type of sub-printing regions is the same; the fusion module is configured to fuse the M sub-images corresponding to the same type of sub-printing regions to obtain a fused sub-image; the calculation module is configured to divide each pixel value in the fused sub-image by M to obtain a preset sub-image corresponding to the same type of sub-printing region; and the generation module is further configured to generate a third correspondence between the preset sub-printing region and the preset sub-image based on the preset sub-images corresponding to the same type of sub-printing regions.

[0149] In some embodiments, before the generation module generates a target detection result based on the first type of defect detection result and the second type of defect detection result, the device further includes an identification module: the identification module is used to identify a broken wire defect in the first image using a preset broken wire defect identification model to obtain a third type of defect detection result; the generation module is used to generate a target detection result based on the first type of defect detection result and the second type of defect detection result, specifically it can be used to generate a target detection result based on the first type of defect detection result, the second type of defect detection result and the third type of defect detection result.

[0150] In some embodiments, before the identification module identifies the broken wire defect in the first image using a preset broken wire defect identification model and obtains the third type of defect detection result, the device further includes a training module: an acquisition module, further configured to acquire information of a grayscale image without broken wire defects; a generation module, further configured to generate a grayscale image with broken wire defects using simulation software; a fusion module, further configured to fuse a grayscale image with broken wire defects with two grayscale images without broken wire defects to obtain a color image; and a training module, configured to use the color image as a training sample to perform supervised training on the original broken wire defect identification model to obtain a preset broken wire defect identification model. The recognition module is used to identify broken wire defects in the first image using a preset broken wire defect recognition model, and obtain the third type of defect detection result. Specifically, it can be used to: process the first image into grayscale to obtain a target grayscale image; fuse the target grayscale image with two grayscale images without broken wire defects to obtain a target color image; and use the preset broken wire defect recognition model to identify broken wire defects in the target color image to obtain the third type of defect detection result.

[0151] The various modules in the printing defect detection device provided in this application embodiment can achieve... Figures 2-10 The functions of each step in the provided method for detecting printing defects, and the corresponding technical effects they achieve, will not be elaborated here for the sake of brevity.

[0152] Figure 13 A schematic diagram of the hardware structure of the printing defect detection device provided in an embodiment of this application is shown.

[0153] The device for detecting printing defects may include a processor 1301 and a memory 1302 storing computer program instructions.

[0154] Specifically, the processor 1301 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0155] Memory 1302 may include mass storage for data or instructions. For example, and not limitingly, memory 1302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where suitable, memory 1302 may include removable or non-removable (or fixed) media. Where suitable, memory 1302 may be internal or external to a printing defect detection device. In a particular embodiment, memory 1302 is a non-volatile solid-state memory.

[0156] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0157] The processor 1301 reads and executes computer program instructions stored in the memory 1302 to implement any of the printing defect detection methods in the above embodiments.

[0158] In one example, the printing defect detection device may also include a communication interface 1303 and a bus 1304. Wherein, as... Figure 13 As shown, the processor 1301, memory 1302, and communication interface 1303 are connected through bus 1304 and complete communication with each other.

[0159] The communication interface 1303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0160] Bus 1304 includes hardware, software, or both, that couples components of the printing defect detection device together. For example, and not limitingly, the device can execute the printing defect detection method of the embodiments of this application based on individual units / components in the printing defect detection apparatus, thereby achieving integration. Figures 2-10 The method for detecting printing defects is described.

[0161] Furthermore, in conjunction with the printing defect detection methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the printing defect detection methods in the above embodiments.

[0162] This application also provides a computer program product, wherein the instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform various processes implementing any of the above-described embodiments of the printing defect detection method.

[0163] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0164] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0165] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for detecting printing defects, characterized in that, include: Obtain information from the first image; The first image is segmented to obtain N sub-printed regions in the first image, where N is an integer greater than or equal to 1; The preset relative position is compared with the relative position of the target sub-printed area in the first image to obtain the first type of defect detection result, wherein the target sub-printed area is any one of the N sub-printed areas; The preset sub-image is compared with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result; Based on the detection results of the first type of defect and the detection results of the second type of defect, the target detection results are generated.

2. The method according to claim 1, characterized in that, The segmentation of the first image to obtain N sub-printed regions in the first image includes: Using a preset semantic recognition model, text line information and graphic block information in the first image are identified; based on the text line information and graphic block information in the first image, the first image is segmented to obtain P sub-printing areas and background areas, where P is an integer greater than or equal to 1; After extracting the background image within the background region, the background image is binarized to obtain a binarized background image. Using the preset semantic recognition model, text line information and graphic block information in the binarized background image are identified. Based on the text line information and graphic block information in the binarized background image, the binarized background image is segmented to obtain Q sub-printing regions, where Q is an integer greater than or equal to 0. In the P sub-printing areas and the Q sub-printing areas, find sub-printing areas in the same row and merge them to obtain N sub-printing areas, where the sum of P and Q is greater than or equal to N.

3. The method according to claim 2, characterized in that, The step of searching for sub-printing areas in the same row within the P sub-printing areas and the Q sub-printing areas includes: In the P sub-printing areas and the Q sub-printing areas, obtain information on the overlap ratio of projection lines between any two sub-printing areas in a preset reading direction and information on the distance between them; If the overlap ratio of the projection lines is greater than or equal to a first preset threshold and the distance is less than or equal to a second preset threshold, then any two sub-printing areas are determined to be sub-printing areas in the same row.

4. The method according to claim 1, characterized in that, Before comparing the preset relative position with the relative position of the target sub-printed area in the first image to obtain the first type of defect detection result, the method further includes: In multiple preset sub-printing areas, determine the target preset sub-printing area corresponding to the target sub-printing area; The step of comparing the preset relative position with the relative position of the target sub-printed area in the first image to obtain a first type of defect detection result includes: In the first correspondence between the preset sub-printing area and the preset relative position, the target preset relative position corresponding to the target preset sub-printing area is obtained; The target's preset relative position is compared with the target sub-printed area's relative position in the first image to obtain the first type of defect detection result.

5. The method according to claim 4, characterized in that, Before determining the target preset sub-printing area corresponding to the target sub-printing area among multiple preset sub-printing areas, the method further includes: Obtain information from a defect-free second image; The second image is segmented to obtain multiple preset sub-printing regions in the second image; Based on the location information of the preset sub-printing areas and the overlap area ratio between each preset sub-printing area, the hierarchical identification information corresponding to the preset sub-printing area is determined; Based on the hierarchical identification information corresponding to the preset sub-printing area, a second correspondence between the preset sub-printing area and the hierarchical identification information is generated; The step of determining the target preset sub-printing area corresponding to the target sub-printing area among multiple preset sub-printing areas includes: Based on the location information of the sub-printed areas in the first image and the overlap area ratio between each sub-printed area, determine the hierarchical identification information corresponding to the sub-printed areas in the first image. In the plurality of preset sub-printing areas, a target preset sub-printing area corresponding to the target sub-printing area is determined according to the second correspondence between the preset sub-printing area and the hierarchical identification information, wherein the hierarchical identification information corresponding to the target sub-printing area is the same as the hierarchical identification information corresponding to the target preset sub-printing area.

6. The method according to claim 4, characterized in that, The step of comparing the preset sub-image with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result includes: In the third correspondence between the preset sub-printing area and the preset sub-image, the target preset sub-image corresponding to the target preset sub-printing area is obtained; The target preset sub-image is compared with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result.

7. The method according to claim 6, characterized in that, Before obtaining the target preset sub-image corresponding to the target preset sub-printing area in the third correspondence between the preset sub-printing area and the preset sub-image, the method further includes: Obtain information from M defect-free third images, where M is an integer greater than or equal to 1; The third image is segmented to obtain multiple sub-printed regions in the third image; Based on the location information of the sub-printed areas in the third image and the overlap ratio between each sub-printed area, the hierarchical identification information corresponding to the sub-printed areas in the third image is determined. Among the M third images, M sub-images corresponding to the same type of sub-printing area are obtained, and the hierarchical identification information corresponding to the same type of printing area is the same; The M sub-images corresponding to the same type of sub-printing area are merged to obtain the merged sub-image; Divide each pixel value in the fused sub-image by M to obtain a preset sub-image corresponding to the same type of sub-printing area; Based on the preset sub-images corresponding to the same type of sub-printing area, a third correspondence between the preset sub-printing area and the preset sub-image is generated.

8. The method according to claim 1, characterized in that, Before generating the target detection result based on the first type of defect detection result and the second type of defect detection result, the method further includes: Using a pre-defined wire breakage defect recognition model, wire breakage defects in the first image are identified to obtain the third type of defect detection results; The step of generating target detection results based on the first type of defect detection results and the second type of defect detection results includes: The target detection result is generated based on the first type of defect detection result, the second type of defect detection result, and the third type of defect detection result.

9. The method according to claim 8, characterized in that, Before identifying the broken wire defects in the first image using a preset broken wire defect recognition model and obtaining the third type of defect detection result, the method further includes: Obtain information from grayscale images without broken lines; Using simulation software, a grayscale image with a broken wire defect is generated; A color image is obtained by fusing one grayscale image with the broken line defect with two grayscale images without the broken line defect. The color image is used as a training sample to perform supervised training on the original wire breakage defect recognition model, thereby obtaining the preset wire breakage defect recognition model. The step of using a preset broken wire defect recognition model to identify broken wire defects in the first image and obtaining a third type of defect detection result includes: The first image is processed to obtain the target grayscale image; The target grayscale image is fused with the two grayscale images without broken lines to obtain the target color image; Using a pre-defined broken line defect recognition model, broken line defects in the target color image are identified, and a third type of defect detection result is obtained.

10. A device for detecting printing defects, characterized in that, include: The acquisition module is used to acquire information from the first image; The segmentation module is used to segment the first image to obtain N sub-printed regions in the first image, where N is an integer greater than or equal to 1; The comparison module is used to compare the preset relative position with the relative position of the target sub-printed area in the first image to obtain a first type of defect detection result, wherein the target sub-printed area is any one of the N sub-printed areas; The comparison module is also used to compare the preset sub-image with the sub-image within the target sub-printing area in the first image to obtain the second type of defect detection result; The generation module is used to generate target detection results based on the first type of defect detection results and the second type of defect detection results.

Citation Information

Patent Citations

  • Multi-scale image segmentation method based on hierarchical region merging

    CN110517269A

  • presswork surface defect detection method based on multi-partition matching and difference model learning

    CN112598631A

  • Printing pattern defect detection method and system and readable storage medium

    CN118379279A

  • Image-text printing quality analysis system based on machine vision

    CN119131809A