Methods, apparatus, equipment and storage media for detecting printing defects
By aligning and standardizing printed images using computer vision technology, the problem of relying on manual labor for printing defect detection has been solved, achieving automated, low-cost, and efficient detection.
Patent Information
- Application Number
- CN202310106900.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-02
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-02-02
AI Technical Summary
Current printing defect detection relies on manual inspection, resulting in wasted time and economic costs. Furthermore, existing automated inspection systems are costly, difficult to maintain, and not suitable for all processes.
Using computer vision technology, an initial target image and a reference image are acquired, the images are aligned using various methods, and color distribution features are standardized to obtain the final difference result for detecting printing defects.
It enables automated and low-cost printing defect detection, improves the accuracy and flexibility of detection, and reduces the hardware requirements for high-resolution cameras.
Smart Images

Figure CN118446950B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, electronic device, and readable storage medium for detecting printing defects. Background Technology
[0002] While the paper manufacturing and printing industries now possess relatively complete sets of machinery and equipment, they still heavily rely on manual inspection for printing defects in various stages, including pre-press, printing, post-press, and assembly. Because machines typically operate at high speeds, a large number of defective products are already produced before manual inspection, necessitating the disposal of these defective products and the recalibration of the machines. This process undoubtedly wastes both time and money. Therefore, automating the detection of printing defects has become an urgent problem to be solved.
[0003] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] The purpose of this disclosure is to provide a method, apparatus, electronic device, and readable storage medium for detecting printing defects, which can automatically detect printing defects.
[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0006] According to one aspect of this disclosure, a method for detecting printing defects is provided, comprising: acquiring an initial target image of a printed product to be inspected; acquiring a reference image corresponding to the printed product to be inspected; aligning the initial target image to the reference image using multiple methods to obtain a plurality of candidate transformed target images; determining a transformed target image based on the similarity between each candidate transformed target image and the reference image in the plurality of candidate preprocessed target images; performing color distribution feature standardization processing on the transformed target image based on the reference image to obtain a standardized transformed target image; and obtaining a final difference result based on the standardized transformed target image and the reference image, so as to detect printing defects in the printed product to be inspected based on the final difference result.
[0007] According to one embodiment of this disclosure, a plurality of candidate transformation target images include a first candidate transformation target image; the initial target image is aligned to the reference image using multiple methods to obtain a plurality of candidate transformation target images, including: calculating the affine transformation from the initial target image to the reference image using an iterative nearest neighbor algorithm to obtain an initial registration result between the initial target image and the reference image; subtracting pixels other than the overlapping points of the initial target image and the reference image in the initial registration result using a masking method to obtain a contour point sequence aligned from the initial target image to the reference image; and transforming the initial target image according to the contour point sequence aligned from the initial target image to the reference image to obtain the first candidate transformation target image.
[0008] According to one embodiment of this disclosure, a plurality of candidate transformation target images include a second candidate transformation target image; the initial target image is aligned to the reference image using multiple methods to obtain a plurality of candidate transformation target images, including: obtaining feature points in the initial target image and feature points in the reference image respectively; mapping the feature points in the initial target image to the feature points in the reference image to obtain a first homography matrix between the initial target image and the reference image; obtaining a first initial transformation target image and a first mask image based on the initial target image and the first homography matrix respectively; and removing blank pixels from the first initial transformation target image based on the first mask image to obtain the second candidate transformation target image.
[0009] According to one embodiment of this disclosure, obtaining a first initial transformed target image and a first mask image based on the initial target image and the first homography matrix respectively includes: multiplying the first homography matrix with the initial target image to obtain the first initial transformed target image; and multiplying the first homography matrix with a generated image to obtain the first mask image, wherein the generated image is an image filled with white pixels and of the same size as the initial target image.
[0010] According to one embodiment of this disclosure, a plurality of candidate transform target images include a third candidate transform target image; the initial target image is aligned to the reference image using multiple methods to obtain a plurality of candidate transform target images, including: obtaining markers in the initial target image and markers in the reference image respectively; matching the markers in the initial target image with the markers in the reference image to obtain a second homography matrix between the initial target image and the reference image; obtaining a second initial transform target image and a second mask image based on the initial target image and the second homography matrix respectively; and removing blank pixels from the second initial transform target image based on the second mask image to obtain the third candidate transform target image.
[0011] According to one embodiment of this disclosure, a standardized transformed target image is obtained by performing color distribution feature normalization processing on the transformed target image based on the reference image, including: obtaining a masked reference image; converting the transformed target image and the masked reference image from RGB color space to CIELAB color space respectively to obtain a transformed target image in CIELAB color space and a reference image in CIELAB color space; and performing color distribution feature normalization processing on the transformed target image in CIELAB color space based on the reference image in CIELAB color space to obtain the standardized transformed target image.
[0012] According to one embodiment of this disclosure, a standardized transformation target image in the CIELAB color space is obtained by performing color distribution feature normalization processing on a reference image in the CIELAB color space, based on the reference image in the CIELAB color space. This includes: denoising the transformed target image in the CIELAB color space using a Gaussian convolution kernel; obtaining the pixel mean and standard deviation of the denoised transformed target image in the CIELAB color space; obtaining the pixel mean and standard deviation of the reference image in the CIELAB color space; and performing color distribution feature normalization processing on the transformed target image in the CIELAB color space based on the pixel mean and standard deviation of the denoised transformed target image in the CIELAB color space and the pixel mean and standard deviation of the reference image in the CIELAB color space, thereby obtaining the standardized transformation target image.
[0013] According to one embodiment of this disclosure, determining a transformed target image based on the similarity between each candidate transformed target image among the plurality of candidate preprocessed target images and the reference image includes: performing masking processing on the reference image to obtain a masked reference image; for each candidate transformed target image, using a root mean square error (RMSE) metric to obtain a similarity score between the candidate transformed target image and the masked reference image, wherein a local search method is used to iteratively update the candidate transformed target images during the RMSE metric process; and taking the updated image of the candidate preprocessed target image with the highest similarity score to the masked reference image among the plurality of candidate preprocessed target images as the transformed target image.
[0014] According to one embodiment of this disclosure, the standardized transformation target image is an image in the CIELAB color space; obtaining a final difference result based on the standardized transformation target image and the reference image, and detecting printing defects in the printed product to be inspected based on the final difference result, includes: obtaining a reference image in the CIELAB color space; performing difference processing on the standardized transformation target image and the reference image in the CIELAB color space to obtain an initial difference result; performing threshold segmentation processing on the initial difference result to obtain a binarized difference result; performing morphological operation processing on the binarized difference result to obtain the final difference result, and detecting printing defects in the printed product to be inspected based on the final difference result.
[0015] According to another aspect of this disclosure, a printing defect detection device is provided, comprising: an acquisition module for acquiring an initial target image of a printed product to be inspected; the acquisition module is further configured to acquire a reference image corresponding to the printed product to be inspected; an image alignment module for aligning the initial target image to the reference image using multiple methods to obtain multiple candidate transformed target images; an image calibration module for determining a transformed target image based on the similarity between each candidate transformed target image in the multiple candidate preprocessed target images and the reference image; a color standardization module for performing color distribution feature standardization processing on the transformed target image based on the reference image to obtain a standardized transformed target image; and a difference module for obtaining a final difference result based on the standardized transformed target image and the reference image, so as to detect printing defects in the printed product to be inspected based on the final difference result.
[0016] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory, a processor, and executable instructions stored in the memory and executable in the processor, wherein the processor, when executing the executable instructions, implements any of the methods described above.
[0017] According to another aspect of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, which, when executed by a processor, implement any of the methods described above.
[0018] The printing defect detection method provided in the embodiments of this disclosure aligns the initial target image of the printed product to be detected with the corresponding reference image in multiple ways to obtain multiple candidate transformed target images. Then, based on the similarity between each candidate transformed target image and the reference image in the multiple candidate preprocessed target images, a transformed target image is determined. Based on the reference image, the color distribution feature of the transformed target image is standardized to obtain a standardized transformed target image. Finally, based on the standardized transformed target image and the reference image, a final difference result is obtained to detect printing defects in the printed product to be detected, thereby realizing automated detection of printing defects.
[0019] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this disclosure. Attached Figure Description
[0020] The above and other objects, features and advantages of this disclosure will become more apparent from a detailed description of exemplary embodiments thereof with reference to the accompanying drawings.
[0021] Figure 1 A schematic diagram of the structure of a printing defect detection system according to an embodiment of the present disclosure is shown.
[0022] Figure 2 A flowchart of a printing defect detection method according to an embodiment of this disclosure is shown.
[0023] Figure 3 It shows Figure 2 The step S206 shown is a schematic diagram of the processing procedure in one embodiment.
[0024] Figure 4 It is based on Figure 3 This diagram illustrates an image alignment process.
[0025] Figure 5 It shows Figure 2 The step S206 shown is a schematic diagram of the processing procedure in another embodiment.
[0026] Figure 6 It shows Figure 5 The step S506 shown is a schematic diagram of the processing procedure in one embodiment.
[0027] Figure 7 It is based on Figure 5 and Figure 6 This is a schematic diagram illustrating another image alignment process.
[0028] Figure 8 It shows Figure 2 The diagram shows a processing procedure for step S206 in another embodiment.
[0029] Figure 9 It is based on Figure 8 and Figure 6 This is a schematic diagram illustrating another image alignment process.
[0030] Figure 10 It shows Figure 2 The step S208 shown is a schematic diagram of the processing procedure in one embodiment.
[0031] Figure 11 It shows Figure 2 The step S210 shown is a schematic diagram of the processing procedure in one embodiment.
[0032] Figure 12 It shows Figure 11 The step S1106 shown is a schematic diagram of the processing procedure in one embodiment.
[0033] Figure 13 It shows Figure 2 The step S212 shown is a schematic diagram of the processing procedure in one embodiment.
[0034] Figure 14 It is based on Figures 2 to 13 The diagram shows a printing defect detection process.
[0035] Figure 15 A block diagram of a printing defect detection device according to an embodiment of the present disclosure is shown.
[0036] Figure 16 A block diagram of another printing defect detection device according to an embodiment of this disclosure is shown.
[0037] Figure 17 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0038] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.
[0039] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, apparatuses, steps, etc., can be employed. In other instances, well-known structures, methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0040] Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. The symbol " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0041] In this disclosure, unless otherwise expressly specified and limited, the term "connection" and similar terms should be interpreted broadly, for example, it can refer to an electrical connection or the ability to communicate with each other; it can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this disclosure according to the specific circumstances.
[0042] Common printing defects include smudges, excessive ink absorption, ghosting, and gear-like marks. After these defects are identified manually, the defective products are discarded, and the machine is recalibrated and put back into operation. This process needs to be repeated until products that meet the standards are produced, undoubtedly resulting in a significant waste of time and money.
[0043] Several solutions for printing defects have been developed in related technologies. For example, industrial printing press manufacturers such as Heidelberg Drucker Maschin and König Bauer provide online inspection and monitoring systems equipped with high-resolution color cameras and LED lighting technology for their own offset printing presses. However, this system (hereinafter referred to as the monitoring system) also has some problems.
[0044] First, this monitoring system is a special function included with the printing press system at the factory. If the printing press system is modified or updated after the sale, the monitoring system may not accept it and may also be incompatible with older printing press models. If the modification is made by a third-party supplier, the original manufacturer cannot provide lifetime after-sales service and warranty.
[0045] Secondly, this monitoring system typically consists of multiple cameras and LED lighting, installed after the last printing unit or coating machine of a large printing press (such as an offset printing press). If one of the cameras or LED lights malfunctions, the overall detection performance will be significantly reduced.
[0046] Furthermore, the printing press equipment and maintenance costs associated with adding this monitoring system are high. The high-resolution color camera used for inspection is unique and expensive, and it is difficult to find a substitute on the market.
[0047] Finally, not all processes can be covered by this monitoring system. Processes such as screen printing, die-cutting, foil laying, and assembly often rely on manual inspection, requiring experienced workers to identify defects and assess whether they are critical or within acceptable limits.
[0048] In the era of deep learning, computer vision is one of the most popular fields, with applications in various areas such as autonomous driving and facial recognition. Image processing is the core of computer vision, typically involving different steps: image acquisition, image enhancement, image representation, image description, and image recognition. The specific steps involved depend on the purpose and application of image processing.
[0049] Image acquisition is one of the fundamental steps in an image processing system. It involves acquiring optical images using appropriate devices, converting them into computer-processable images using an analog-to-digital converter, and then further processing them using a computer, such as enhancement, segmentation, representation, description, and recognition. Image enhancement refers to transforming and adjusting an image to make it more suitable for display and further analysis or manipulation. Image segmentation divides an image into multiple parts to reduce its complexity, allowing for further analysis of each part and identification of targets within the image. Image representation aims to represent and describe segments in an appropriate form, such as boundaries or complete regions, for further processing. Image description extracts structured, comparable attributes from an image for differentiation and analysis. After enhancement, segmentation, representation, and description steps, image recognition detects and analyzes the image, enabling automated processing, such as classifying locations, people, and objects.
[0050] This disclosure provides a printing defect detection method that utilizes intelligent image processing technology in computer vision to automatically detect and identify various defects on printed materials, thereby reducing the requirements for image acquisition hardware.
[0051] Figure 1 An exemplary system architecture 10 is shown that can be applied to the printing defect detection method or printing defect detection apparatus of this disclosure.
[0052] like Figure 1As shown, system architecture 10 may include terminal device 102, network 104, and server 106. Terminal device 102 may be various devices with shooting capabilities, including but not limited to smartphones, digital cameras, industrial cameras, scanners, and other devices. Network 104 serves as the medium for providing a communication link between terminal device 102 and server 106. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables. Server 106 may be a server or server cluster that provides various services, such as a server for data processing, a database server for data storage, and so on.
[0053] Terminal device 102 can interact with server 106 via network 104 to receive or send data. For example, terminal device 102 may capture an initial target image of the printed product to be inspected, and then send the initial target image to server 106 via network 104 for processing. Alternatively, server 106 may execute the printing defect detection method in this embodiment to obtain a final differential result, and then send the final differential result to terminal device 102, such as a smartphone, via network 104 for user viewing. Another example is that terminal device 102 may execute the printing defect detection method in this embodiment to obtain a final differential result, and then send the final differential result to server 106 via network 104 for storage.
[0054] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0055] Figure 2 This is a flowchart illustrating a printing defect detection method according to an exemplary embodiment. Figure 2 The method shown can be applied, for example, to... Figure 1 The server side of the system shown can also be applied to Figure 1 The terminal device shown.
[0056] refer to Figure 2 The method 20 provided in this embodiment may include the following steps.
[0057] In step S202, an initial target image of the printed product to be inspected is obtained.
[0058] In some embodiments, it may be used Figure 1 The terminal device 102 shown in the figure captures the printed product to be inspected and obtains an initial target image.
[0059] In step S204, a reference image corresponding to the printed product to be inspected is obtained.
[0060] In some embodiments, it may be used Figure 1 The terminal device 102 shown in the figure captures a reference (defect-free standard) product corresponding to the printed product to be inspected, and obtains a reference image.
[0061] In some embodiments, it may be used Figure 1 The terminal device 102 shown acquires a reference image and an initial target image under the same lighting conditions to minimize variations and enable better comparison and detection of defects.
[0062] In step S206, the initial target image is aligned to the reference image using various methods to obtain multiple candidate transformation target images.
[0063] In some embodiments, the product being photographed may not be placed in the same position during the acquisition of the reference image and the initial target image, resulting in incomplete alignment between the reference image and the initial target image. Various methods can be used to align the initial target image to the reference image, obtaining corresponding candidate transformed target images, and then selecting the alignment result most similar to the reference image.
[0064] In some embodiments, the plurality of candidate transformation target images may include a first candidate transformation target image, a second candidate transformation target image, and a third candidate transformation target image.
[0065] For example, a contouring method can be used to align the initial target image to a reference image to obtain a first candidate transformed target image. Specific implementation details can be found in [reference needed]. Figure 3 and Figure 4 .
[0066] For example, a feature point matching method can be used to align the initial target image with the reference image to obtain a second candidate transformed target image. Specific implementation details can be found in [reference needed]. Figures 5 to 7 .
[0067] For example, a marker matching method can be used to align the initial target image with the reference image to obtain a third candidate transformed target image. Specific implementation details can be found in [the relevant documentation / reference]. Figure 8 and Figure 9 .
[0068] In step S208, the transformation target image is determined based on the similarity between each candidate transformation target image and the reference image in the multiple candidate preprocessing target images.
[0069] In some embodiments, similarity scores between the first candidate transformed target image, the second candidate transformed target image, the third candidate transformed target image, and the reference image can be calculated respectively, and the image with the highest similarity score can be selected as the transformed target image. Specific implementation methods can be found in [reference needed]. Figure 10 .
[0070] In step S210, the color distribution features of the target image are standardized based on the reference image to obtain a standardized target image.
[0071] In some embodiments, the (masked) reference image and the transformed target image can be first converted from the RGB color space to the CIELAB color space, and then color distribution feature normalization processing can be performed. Specific implementation methods can be found in [reference needed]. Figure 11 and Figure 12 .
[0072] In step S212, the final difference result is obtained based on the standardized transformation of the target image and the reference image, so as to detect printing defects in the printed product to be detected according to the final difference result.
[0073] In some embodiments, the normalized transformed target image and the reference image after masking in the CIELAB color space can be subtracted, followed by thresholding and morphological operations to obtain the final difference result. Specific implementation details can be found in [reference needed]. Figure 13 .
[0074] In some embodiments, a database of the final difference results of a large number of printed products can be established, and algorithms such as deep learning models can be used to classify the final difference results to detect different types of defects. The classification algorithm can be implemented in the form of software or mobile device applications.
[0075] The printing defect detection method provided in this disclosure aligns the initial target image of the printed product to be inspected with a corresponding reference image using multiple methods. Then, the transformed target image with the highest similarity to the reference image is selected for color distribution feature standardization processing to obtain the final difference result. This achieves automated detection of factor defects and solves the technical problem of poor adaptability and low accuracy when a single image alignment method handles a large number of products with various types of defects. The method used in this disclosure relies on the processing of the initial target image and the reference image, does not require a high-resolution camera for image acquisition, has low hardware requirements, low installation costs, and is more flexible compared to online inspection equipment.
[0076] Figure 3 It shows Figure 2 The step S206 shown is a schematic diagram of the processing procedure in one embodiment. (See attached diagram.) Figure 3 As shown in the present embodiment, step S206 may further include the following steps.
[0077] Step S302: The iterative nearest neighbor algorithm is used to calculate the affine transformation from the initial target image to the reference image, and the initial registration result of the initial target image and the reference image is obtained.
[0078] Step S304: Using a masking method, pixels outside the overlap points between the initial target image and the reference image in the initial registration result are subtracted to obtain a sequence of contour points aligned between the initial target image and the reference image.
[0079] Step S306: Transform the initial target image according to the contour point sequence aligned with the reference image to obtain the first candidate transformed target image.
[0080] Figure 4 It is based on Figure 3 This diagram illustrates an image alignment process. Figure 4 As shown, refer to Figure 3 In step S302, the initial target image 4024 (with printing defects 400) is registered with the reference image 4022 to obtain an initial registration result 404. Then, in step S304, a binary mask is applied to remove pixels other than the intersection points of the two images, obtaining a contour point sequence 406 aligned between the initial target image and the reference image. Next, in step S306, the initial target image is transformed based on the contour point sequence 406 aligned between the initial target image and the reference image to obtain a transformed initial target image 408. Then, the transformed initial target image 408 can be masked to remove blank pixels, obtaining a first candidate transformed target image 4102. In the figure, 4104 is a mask image obtained based on the contour point sequence 406 aligned between the initial target image and the reference image and an image of the same size as the initial target image filled with white pixels.
[0081] According to the image alignment method provided in this disclosure, the iterative nearest neighbor algorithm is used to calculate the affine transformation from the initial target image to the reference image, and a binary mask is applied to mask pixels other than the intersection of the two images to obtain a contour point sequence that aligns the initial target image to the reference image. This provides aligned target and reference images for subsequent differential processing, thereby improving the accuracy of defect detection.
[0082] Figure 5 It shows Figure 2 The illustrated step S206 is a process diagram in another embodiment. (See diagram for example.) Figure 5 As shown in the present embodiment, step S206 may further include the following steps.
[0083] Step S502: Obtain feature points in the initial target image and feature points in the reference image respectively.
[0084] Step S504: Match the feature points in the initial target image with the feature points in the reference image to obtain the first homography matrix between the initial target image and the reference image. The homography matrix can represent a unique correspondence transformation relationship between two planes.
[0085] Step S506: Obtain the first initial transformed target image and the first mask image based on the initial target image and the first homography matrix, respectively.
[0086] In some embodiments, the first homography matrix can be multiplied by the initial target image and the blank image respectively to obtain the first initial transformed target image and the first mask image, respectively. Specific implementation methods can be found in [reference needed]. Figure 6 .
[0087] Step S508: Remove blank pixels from the first initial transformation target image based on the first mask image to obtain the second candidate transformation target image.
[0088] In some embodiments, the first initial transformation target image can be represented as T, and the first mask image can be represented as M. Then, the reference image after masking is T' = T × M.
[0089] Figure 6 It shows Figure 5 The step S506 shown is a schematic diagram of the processing procedure in one embodiment. (See attached diagram.) Figure 6 As shown in the present embodiment, step S506 may further include the following steps.
[0090] Step S602: Multiply the first homography matrix with the initial target image to obtain the first initial transformed target image.
[0091] Step S604: Multiply the first homography matrix with the generated image to obtain the first mask image, wherein the generated image is an image of the same size as the initial target image, filled with white pixels.
[0092] Figure 7 It is based on Figure 5 and Figure 6 This is a schematic diagram illustrating another image alignment process. (See diagram for example.) Figure 7 As shown, refer to Figure 5 First, in step S502, feature points in the initial target image 7024 (with printing defects 700) and feature points in the reference image 7022 are obtained respectively. Then, in step S504, the feature points in the initial target image 7024 are mapped to the feature points in the reference image 7022 to obtain a first homography matrix 704 between the initial target image 7024 and the reference image 7022. (Refer to...) Figure 6In step S602, the first homography matrix 704 is multiplied with the initial target image 7024 to obtain the first initial transformed target image 7062. In step S604, the first homography matrix 704 is multiplied with the generated image 7026, which is filled with white pixels and has the same size as the initial target image 7024, to obtain the first mask image 7064.
[0093] In some embodiments, the black triangular regions of the first mask image 7064 represent blank pixels. The initial target image 7024 and the reference image 7022 share the same blank pixel regions, and the first mask image 7064 can be used to determine which black pixels in the initial target image 7024 are blank pixels. In step S508, blank pixels in the first initial transformed target image 7062 can be removed based on the first mask image 7064 to obtain a second candidate transformed target image 708.
[0094] According to the image alignment method provided in this disclosure, a first homography matrix representing the transformation relationship between the initial target image and the reference image is obtained by matching the feature points corresponding to the initial target image and the reference image. The first homography matrix is then multiplied with the initial target image to obtain a first initial transformed target image. A mask is then used to remove the background blank pixels in the first initial transformed target image to obtain a second candidate transformed target image. This method can provide aligned target images and reference images for subsequent differential processing, thereby improving the accuracy of defect detection.
[0095] Figure 8 It shows Figure 2 The diagram illustrates step S206 in another embodiment. (See attached diagram.) Figure 8 As shown in the present embodiment, step S206 may further include the following steps.
[0096] Step S802: Obtain the markers in the initial target image and the markers in the reference image, respectively.
[0097] In some embodiments, reference marks such as alignment, sorting, positioning, and orientation of the printed matter during the printing process may be utilized.
[0098] Step S804: Match the markers in the initial target image with the markers in the reference image to obtain the second homography matrix between the initial target image and the reference image.
[0099] Step S806: Obtain the second initial transformed target image and the second mask image based on the initial target image and the second homography matrix, respectively.
[0100] In some embodiments, the second homography matrix can be multiplied by the initial target image and the blank image respectively to obtain the second initial transformed target image and the second mask image, and the specific implementation is similar. Figure 6 .
[0101] Step S808: Remove blank pixels from the second initial transformation target image based on the second mask image to obtain the third candidate transformation target image.
[0102] Figure 9 It is based on Figure 8 and Figure 6 This is a schematic diagram illustrating another image alignment process. (See diagram for example.) Figure 9 As shown, refer to Figure 8 First, in step S802, feature points in the initial target image 9024 (with printing defects 900) and feature points in the reference image 9022 are obtained respectively. Then, in step S804, the feature points in the initial target image 9024 are mapped to the feature points in the reference image 9022 to obtain a second homography matrix 904 between the initial target image 9024 and the reference image 9022. Then, in step S806, the second homography matrix 904 is multiplied by the initial target image 9024 to obtain a second initial transformed target image 9062, and the second homography matrix 904 is multiplied by a generated image 9026 of the same size as the initial target image 9024, filled with white pixels, to obtain a second mask image 9064. Then, in step S808, blank pixels in the second initial transformed target image 9062 can be removed according to the second mask image 9064 to obtain a third candidate transformed target image 908.
[0103] According to the image alignment method provided in this disclosure, a second homography matrix representing the transformation relationship between the initial target image and the reference image is obtained by matching the markers corresponding to the initial target image and the reference image. The second homography matrix is then multiplied with the initial target image to obtain a second initial transformed target image. Background blank pixels in the second initial transformed target image are removed using a mask to obtain a third candidate transformed target image. This method can provide aligned target images and reference images for subsequent differential processing, thereby improving the accuracy of defect detection.
[0104] Figure 10 It shows Figure 2 The step S208 shown is a schematic diagram of the processing procedure in one embodiment. (See attached diagram.) Figure 10 As shown in the present embodiment, step S208 may further include the following steps.
[0105] Step S1002: Perform masking on the reference image to obtain the masked reference image.
[0106] In some embodiments, the reference image can be represented as R, and the corresponding mask image (e.g., the first mask image and / or the second mask image mentioned above) can be represented as M. Then, the reference image after masking is R' = R × M.
[0107] Step S1004: For each candidate transform target image, the root mean square error metric method is used to obtain the similarity score between the candidate transform target image and the masked reference image. In the root mean square error metric process, a local search method is used to iteratively update the candidate transform target image.
[0108] In some embodiments, the similarity score SM (Similarity Metric) between the candidate transformed target image and the masked reference image can be represented as follows:
[0109]
[0110] In the formula, R′ (i,j) T′ represents the pixel in the i-th row and j-th column of the masked reference image R'. (i,j) M represents the pixel in the i-th row and j-th column of the candidate transformed target image T' (after masking). (i,j) Let ∑ represent the pixel in the i-th row and j-th column of the corresponding mask image (e.g., the first mask image and / or the second mask image mentioned above), i.e. ij M (i,j) T″ represents the sum of the pixel values in the candidate transform target image after removing blank pixels. (i,j) Indicates T′ (i,j) The pixels after iterative updates.
[0111] Step S1006: The updated image of the candidate preprocessing target image with the highest similarity score to the masked reference image among multiple candidate preprocessing target images is taken as the transformation target image.
[0112] The method provided in this disclosure employs a local search method to perform similarity measurement (i.e., calculate SM value) in each iteration, obtains candidate objects through operations such as translation, rotation and scaling, selects the best candidate object from them for affine transformation, and then enters the next iteration to obtain a finer search space scale, thereby achieving more accurate and more uniform subpixel alignment.
[0113] The Root Mean Squared Error (RMSE) metric is used to measure the similarity between the candidate preprocessed target image and the masked reference image, replacing the Mean Absolute Error (MAE) metric in related techniques. In the case of small patterns on a solid-color background, RMSE exhibits ideal sensitivity to outliers; therefore, any offset in image alignment will produce a significant RMSE error value. Dividing by the total pixel value after removing blank pixels provides a weighted error, which can be used for comparison with product images of different sizes. Furthermore, RMSE has a shorter computation time while maintaining accuracy, making it suitable for multiple calculations during iterative calibration, thus improving the efficiency of the calibration process.
[0114] Figure 11 It shows Figure 2 The step S210 shown is a schematic diagram of the processing procedure in one embodiment. (See attached diagram.) Figure 11 As shown in the present embodiment, step S210 may further include the following steps.
[0115] Step S1102: Obtain the reference image after masking.
[0116] In some embodiments, the masked reference image may be represented as R'.
[0117] Step S1104: Convert the target image and the masked reference image from the RGB color space to the CIELAB color space respectively to obtain the target image in the CIELAB color space and the reference image in the CIELAB color space.
[0118] In some embodiments, the transformed target image in the CIELAB color space can be represented as T L The reference image for the CIELAB color space can be represented as R. L .
[0119] Step S1106: Based on the reference image in the CIELAB color space, the color distribution feature of the transformed target image in the CIELAB color space is standardized to obtain a standardized transformed target image.
[0120] Figure 12 It shows Figure 11 The step S1106 shown is a schematic diagram of the processing procedure in one embodiment. (See attached diagram.) Figure 12 As shown in the present embodiment, step S1106 may further include the following steps.
[0121] Step S1202: Denoise the target image in the CIELAB color space using a Gaussian convolution kernel.
[0122] In some embodiments, the transformed target image in the CIELAB color space after denoising can be represented as T. L’ .
[0123] Step S1204: Obtain the pixel mean and standard deviation of the transformed target image in the CIELAB color space after denoising.
[0124] Step S1206: Obtain the pixel mean and standard deviation of the reference image in the CIELAB color space.
[0125] Step S1208: Based on the pixel mean and standard deviation of the transformed target image in the CIELAB color space after denoising and the pixel mean and standard deviation of the reference image in the CIELAB color space, the color distribution feature of the transformed target image in the CIELAB color space is standardized to obtain a standardized transformed target image.
[0126] In some embodiments, the target image T can be standardized and transformed. S It is expressed as follows:
[0127]
[0128] In the formula, The pixel mean of the reference image in the CIELAB color space. This represents the pixel mean of the target image after denoising in the CIELAB color space transformation. The pixel standard deviation of the reference image representing the CIELAB color space. This represents the pixel standard deviation of the target image after denoising in the CIELAB color space transformation.
[0129] According to the method provided in this disclosure, the RGB format image captured during the image acquisition stage is converted to the CIELAB color space and pixel normalized to transfer the color distribution characteristics of the target image to the color distribution characteristics of the reference image. Although both the reference image and the initial target image are captured under the same lighting conditions, the conversion between physical printed materials and digital images will amplify the differences between the reference image and the initial target image, regardless of the image acquisition device used. The CIELAB color space can offset the effects of converting printed materials (CMYK) to RGB digital images and compensate for image color differences caused by automatic exposure or color correction settings of the camera, ensuring that the comparison between the reference image and the target image is not affected and improving the accuracy of subsequent difference results.
[0130] Figure 13 It shows Figure 2 The diagram illustrates step S212 in one embodiment. (Refer to...) Figure 12 The target image for normalization transformation can be an image in the CIELAB color space. For example... Figure 13 As shown in the present embodiment, step S212 may further include the following steps.
[0131] Step S1302: Obtain a reference image for the CIELAB color space.
[0132] Step S1304: Perform difference processing on the normalized transformation target image and the reference image in the CIELAB color space to obtain the initial difference result.
[0133] Step S1306: Perform threshold segmentation on the initial difference result to obtain the binarized difference result.
[0134] In some embodiments, a thresholding method is used to detect outliers in the initial difference results. The binarized difference results output by the threshold segmentation are a binary mask (e.g., 0 if the pixel value is below a preset threshold, and 1 if it is greater than or equal to the threshold).
[0135] Step S1308: Perform morphological operations on the binarized difference results to obtain the final difference results, so as to detect printing defects in the printed products to be inspected based on the final difference results.
[0136] In some embodiments, morphological operations may include processes such as erosion and dilation.
[0137] According to the method provided in the embodiments of this disclosure, by performing morphological operations on the initial difference results of the standardized transformed target image and the reference image after threshold segmentation, noise in the binary mask during threshold segmentation can be eliminated, thereby improving the accuracy of the final difference results.
[0138] Figure 14 It is based on Figures 2 to 13 This diagram illustrates a printing defect detection process. Figure 14 The printing defect detection process shown may include the following steps S1402 to S1414.
[0139] Step S1402, Image Acquisition: Use an imaging device to acquire images of the printed product to be inspected and its corresponding reference product.
[0140] Step S1404: Preprocess the image acquired by the imaging device, such as by enhancement, segmentation, representation, etc., to obtain the reference image 14002 and the initial target image 14004.
[0141] Step S1406, image alignment, can be performed using three methods. For example, contouring (S14062), the specific implementation method can be found in [reference]. Figure 3 and Figure 4 For example, feature point alignment (S14064), the specific implementation method can be found in [reference needed]. Figures 5 to 7 For example, marker alignment (S14066), specific implementation details can be found in [reference needed]. Figure 8 and Figure 9 .
[0142] Step S1408 involves calibrating the initial alignment result. For detailed implementation instructions, please refer to [link / reference needed]. Figure 10 .
[0143] Step S1410: Perform color correction on the calibration result. For detailed implementation instructions, please refer to... Figure 11 and Figure 12 .
[0144] Step S1412: Threshold segmentation is performed on the initial difference result 14006 between the color-corrected transformed target image and the reference image (refer to step S1304) to obtain a binarized difference result 14008. For a detailed implementation, refer to step S1306.
[0145] Step S1414: Perform morphological operations on the thresholding result to obtain the final difference result 14010. For a detailed implementation, refer to step S1308.
[0146] Figure 15 This is a block diagram illustrating a printing defect detection device according to an exemplary embodiment. Figure 15 The device shown can be applied, for example, to... Figure 1 The server side of the system shown can also be applied to Figure 1 The terminal device shown.
[0147] refer to Figure 15 The apparatus 150 provided in this embodiment may include an acquisition module 1502, an image alignment module 1504, an image calibration module 1506, a color standardization module 1508, and a difference module 1510.
[0148] The acquisition module 1502 can be used to acquire an initial target image of the printed product to be inspected.
[0149] The acquisition module 1502 can also be used to acquire a reference image corresponding to the printed product to be inspected.
[0150] The image alignment module 1504 can be used to align the initial target image to the reference image in various ways to obtain multiple candidate transformation target images.
[0151] The image calibration module 1506 can be used to determine the transformed target image based on the similarity between each candidate transformed target image and the reference image in multiple candidate preprocessed target images.
[0152] The color normalization module 1508 can be used to normalize the color distribution features of the transformed target image based on the reference image to obtain a normalized transformed target image.
[0153] The difference module 1510 can be used to obtain the final difference result based on the standardized transformation target image and reference image, so as to detect printing defects in the printed product to be inspected based on the final difference result.
[0154] Figure 16 This is a block diagram illustrating a printing defect detection device according to an exemplary embodiment. Figure 16 The device shown can be applied, for example, to... Figure 1 The server side of the system shown can also be applied to Figure 1 The terminal device shown.
[0155] refer to Figure 16 The apparatus 160 provided in this embodiment may include an acquisition module 1602, an image alignment module 1604, an image calibration module 1606, a color normalization module 1608, and a difference module 1610. The image alignment module 1604 may include a contouring module 16042, a feature point module 16044, and a marking module 16046. The difference module 1610 may include a thresholding module 16102 and a morphological operation module 16104.
[0156] The acquisition module 1602 can be used to acquire an initial target image of the printed product to be inspected.
[0157] The acquisition module 1602 can also be used to acquire a reference image corresponding to the printed product to be inspected.
[0158] The image alignment module 1604 can be used to align the initial target image to the reference image in various ways to obtain multiple candidate transformation target images.
[0159] Multiple candidate transformation target images may include a first candidate transformation target image, a second candidate transformation target image, and a third candidate transformation target image.
[0160] The contouring module 16042 can be used to calculate the affine transformation from the initial target image to the reference image using an iterative nearest neighbor algorithm to obtain the initial registration result between the initial target image and the reference image; use a masking method to subtract pixels outside the overlapping points of the initial target image and the reference image in the initial registration result to obtain the contour point sequence aligned from the initial target image to the reference image; transform the initial target image according to the contour point sequence aligned from the initial target image to the reference image to obtain the first candidate transformed target image.
[0161] The feature point module 16044 can be used to obtain feature points in the initial target image and feature points in the reference image respectively; to match the feature points in the initial target image with the feature points in the reference image to obtain a first homography matrix between the initial target image and the reference image; to obtain a first initial transformed target image and a first mask image based on the initial target image and the first homography matrix respectively; and to remove blank pixels from the first initial transformed target image based on the first mask image to obtain a second candidate transformed target image.
[0162] The feature point module 16044 can also be used to multiply the first homography matrix with the initial target image to obtain the first initial transformed target image; and to multiply the first homography matrix with the generated image to obtain the first mask image, wherein the generated image is an image filled with white pixels and of the same size as the initial target image.
[0163] The marking module 16046 can be used to obtain the markings in the initial target image and the markings in the reference image respectively; to match the markings in the initial target image with the markings in the reference image to obtain a second homography matrix between the initial target image and the reference image; to obtain a second initial transformed target image and a second mask image based on the initial target image and the second homography matrix respectively; and to remove blank pixels in the second initial transformed target image based on the second mask image to obtain a third candidate transformed target image.
[0164] The image calibration module 1606 can be used to determine the transformed target image based on the similarity between each candidate transformed target image and the reference image in multiple candidate preprocessed target images.
[0165] The image calibration module 1606 can also be used to perform masking processing on the reference image to obtain a masked reference image. For each candidate transform target image, the root mean square error metric is used to obtain the similarity score between the candidate transform target image and the masked reference image. In the root mean square error metric process, a local search method is used to iteratively update the candidate transform target image. The updated image of the candidate preprocessed target image with the highest similarity score to the masked reference image among multiple candidate preprocessed target images is taken as the transform target image.
[0166] The color normalization module 1608 can be used to normalize the color distribution features of the transformed target image based on the reference image to obtain a normalized transformed target image.
[0167] The color normalization module 1608 can also be used to obtain a reference image after masking; convert the target image and the reference image after masking from the RGB color space to the CIELAB color space respectively to obtain the target image in the CIELAB color space and the reference image in the CIELAB color space; perform color distribution feature normalization processing on the target image in the CIELAB color space based on the reference image in the CIELAB color space to obtain a normalized target image.
[0168] The color normalization module 1608 can also be used to denoise the transformed target image in the CIELAB color space using a Gaussian convolution kernel; obtain the pixel mean and standard deviation of the denoised transformed target image in the CIELAB color space; obtain the pixel mean and standard deviation of the reference image in the CIELAB color space; and perform color distribution feature normalization processing on the transformed target image in the CIELAB color space based on the pixel mean and standard deviation of the denoised transformed target image in the CIELAB color space and the pixel mean and standard deviation of the reference image in the CIELAB color space to obtain a normalized transformed target image.
[0169] The difference module 1610 can be used to obtain the final difference result based on the standardized transformation target image and the reference image, so as to detect printing defects in the printed product to be inspected based on the final difference result.
[0170] The difference module 1610 can also be used to obtain a reference image in the CIELAB color space; perform difference processing on the normalized transformation target image and the reference image in the CIELAB color space to obtain the initial difference result.
[0171] The thresholding module 16102 can be used to perform threshold segmentation on the initial difference result to obtain a binary difference result.
[0172] The morphological operation module 16104 can be used to perform morphological operation processing on the binarized difference results to obtain the final difference results, so as to detect printing defects in the printed products to be inspected based on the final difference results.
[0173] The specific implementation of each module in the device provided in this embodiment can be referred to the content of the above method, and will not be repeated here.
[0174] Figure 17 A schematic diagram of the structure of an electronic device according to an embodiment of this disclosure is shown. It should be noted that... Figure 17 The devices shown are merely examples of computer systems and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0175] like Figure 17As shown, device 1700 includes a central processing unit (CPU) 1701, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1702 or a program loaded from storage section 1708 into random access memory (RAM) 1703. RAM 1703 also stores various programs and data required for the operation of device 1700. CPU 1701, ROM 1702, and RAM 1703 are interconnected via bus 1704. Input / output (I / O) interface 1705 is also connected to bus 1704.
[0176] The following components are connected to I / O interface 1705: an input section 1706 including a keyboard, mouse, etc.; an output section 1707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1708 including a hard disk, etc.; and a communication section 1709 including a network interface card such as a LAN card, modem, etc. The communication section 1709 performs communication processing via a network such as the Internet. A drive 1710 is also connected to I / O interface 1705 as needed. Removable media 1711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1710 as needed so that computer programs read from them can be installed into storage section 1708 as needed.
[0177] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1709, and / or installed from removable medium 1711. When the computer program is executed by central processing unit (CPU) 1701, it performs the functions defined above in the system of this disclosure.
[0178] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0179] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0180] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may be described as including an acquisition module, an image alignment module, an image calibration module, a color normalization module, and a difference module. The names of these modules do not necessarily limit the module itself; for example, the acquisition module may also be described as "a module for acquiring captured images from a connected imaging device."
[0181] In another aspect, this disclosure also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform:
[0182] The process involves: acquiring an initial target image of the printed product to be inspected; acquiring a reference image corresponding to the printed product; aligning the initial target image to the reference image using multiple methods to obtain multiple candidate transformed target images; determining the transformed target image based on the similarity between each candidate transformed target image and the reference image; standardizing the color distribution features of the transformed target image based on the reference image to obtain a standardized transformed target image; and obtaining the final difference result based on the standardized transformed target image and the reference image to detect printing defects in the printed product to be inspected.
[0183] Exemplary embodiments of this disclosure have been specifically shown and described above. It should be understood that this disclosure is not limited to the detailed structures, arrangements, or implementations described herein; rather, this disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.
Claims
1. A method for detecting printing defects, characterized in that, include: Acquire the initial target image of the printed product to be inspected; Obtain a reference image corresponding to the printed product to be inspected; The initial target image is aligned to the reference image using multiple methods to obtain multiple candidate transformation target images; The transformation target image is determined based on the similarity between each candidate transformation target image in the plurality of candidate preprocessed target images and the reference image; Based on the reference image, the color distribution feature of the transformed target image is standardized to obtain a standardized transformed target image; The final difference result is obtained based on the standardized transformed target image and the reference image, so as to detect printing defects in the printed product to be detected according to the final difference result.
2. The method according to claim 1, characterized in that, Multiple candidate transformation target images include the first candidate transformation target image; The initial target image is aligned to the reference image using multiple methods to obtain multiple candidate transformation target images, including: The iterative nearest neighbor algorithm is used to calculate the affine transformation from the initial target image to the reference image, and the initial registration result between the initial target image and the reference image is obtained. The pixels outside the overlap points between the initial target image and the reference image in the initial registration result are subtracted using a masking method to obtain the contour point sequence of the initial target image aligned with the reference image; The initial target image is transformed based on the contour point sequence aligned to the reference image to obtain the first candidate transformed target image.
3. The method according to claim 1, characterized in that, Multiple candidate transformation target images include a second candidate transformation target image; The initial target image is aligned to the reference image using multiple methods to obtain multiple candidate transformation target images, including: Feature points in the initial target image and feature points in the reference image are obtained respectively; By mapping the feature points in the initial target image to the feature points in the reference image, a first homography matrix between the initial target image and the reference image is obtained; The first initial transformed target image and the first mask image are obtained based on the initial target image and the first homography matrix, respectively. The blank pixels in the first initial transformation target image are removed from the first mask image to obtain the second candidate transformation target image.
4. The method according to claim 3, characterized in that, The first initial transformed target image and the first mask image are obtained based on the initial target image and the first homography matrix, respectively, including: Multiply the first homography matrix by the initial target image to obtain the first initial transformed target image; The first homography matrix is multiplied by the generated image to obtain the first mask image, wherein the generated image is an image of the same size as the initial target image, filled with white pixels.
5. The method according to claim 1, characterized in that, Multiple candidate transformation target images include a third candidate transformation target image; The initial target image is aligned to the reference image using multiple methods to obtain multiple candidate transformation target images, including: The markers in the initial target image and the markers in the reference image are obtained respectively; By mapping the markers in the initial target image to the markers in the reference image, a second homography matrix between the initial target image and the reference image is obtained; The second initial transformed target image and the second mask image are obtained based on the initial target image and the second homography matrix, respectively. The third candidate transformation target image is obtained by removing blank pixels from the second initial transformation target image based on the second mask image.
6. The method according to claim 1, characterized in that, Based on the reference image, the color distribution feature of the transformed target image is standardized to obtain a standardized transformed target image, including: Obtain the reference image after masking; The target image and the masked reference image are converted from RGB color space to CIELAB color space respectively to obtain the target image in CIELAB color space and the reference image in CIELAB color space. Based on the reference image in the CIELAB color space, the color distribution features of the transformed target image in the CIELAB color space are normalized to obtain the normalized transformed target image.
7. The method according to claim 6, characterized in that, Based on the reference image in the CIELAB color space, the color distribution feature of the transformed target image in the CIELAB color space is normalized to obtain a normalized transformed target image, including: The target image transformed in the CIELAB color space is denoised using a Gaussian convolution kernel; Obtain the pixel mean and standard deviation of the transformed target image in the CIELAB color space after denoising; Obtain the pixel mean and standard deviation of a reference image in the CIELAB color space; Based on the pixel mean and standard deviation of the transformed target image in the CIELAB color space after denoising, and the pixel mean and standard deviation of the reference image in the CIELAB color space, the color distribution feature of the transformed target image in the CIELAB color space is standardized to obtain the standardized transformed target image.
8. The method according to claim 1, characterized in that, The transformation target image is determined based on the similarity between each candidate transformed target image in the plurality of candidate preprocessed target images and the reference image, including: The reference image is masked to obtain a masked reference image; For each candidate transformed target image, the root mean square error metric method is used to obtain the similarity score between the candidate transformed target image and the masked reference image. In the root mean square error metric process, a local search method is used to iteratively update the candidate transformed target image. The updated image of the candidate preprocessed target image with the highest similarity score to the masked reference image among the plurality of candidate preprocessed target images is taken as the transformed target image.
9. The method according to claim 1, characterized in that, The target image for the normalization transformation is an image in the CIELAB color space; The final difference result is obtained based on the standardized transformed target image and the reference image, and printing defects of the printed product to be detected are detected based on the final difference result, including: Obtain a reference image for the CIELAB color space; The normalized transformation target image and the reference image in the CIELAB color space are subjected to difference processing to obtain the initial difference result; The initial difference result is subjected to threshold segmentation to obtain a binarized difference result; The binarized difference result is processed by morphological operations to obtain the final difference result, which is then used to detect printing defects in the printed product to be inspected.
10. A printing defect detection device, characterized in that, include: The acquisition module is used to acquire the initial target image of the printed product to be inspected; The acquisition module is also used to acquire a reference image corresponding to the printed product to be inspected; An image alignment module is used to align the initial target image to the reference image using multiple methods to obtain multiple candidate transformation target images; An image calibration module is used to determine the transformed target image based on the similarity between each candidate transformed target image in the plurality of candidate preprocessed target images and the reference image; The color normalization module is used to perform color distribution feature normalization processing on the transformed target image based on the reference image to obtain a normalized transformed target image; The difference module is used to obtain a final difference result based on the standardized transformed target image and the reference image, so as to detect printing defects in the printed product to be detected based on the final difference result.
11. An electronic device, comprising: A memory, a processor, and executable instructions stored in the memory and executable in the processor, characterized in that the processor, when executing the executable instructions, implements the method as described in any one of claims 1-9.
12. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that, When the executable instructions are executed by the processor, they implement the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Planar printing defect detection method, device and system
CN110956630A
Image defect detection method and device, electronic equipment and storage medium
CN111028213A