Online Visual Inspection Method and System for Printing Quality Based on Image Comparison
By analyzing the multi-dimensional differences between printed images and template images, feature points are selected and printed defect scores are constructed. This solves the problem of detection accuracy in complex textures and dynamic environments, and achieves efficient and accurate printed quality detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGXING HONGFENG PRINTING & DYEING
- Filing Date
- 2026-04-27
- Publication Date
- 2026-05-26
AI Technical Summary
Existing image comparison methods struggle to effectively distinguish between normal texture variations and genuine quality defects in complex textures and dynamic production environments, resulting in insufficient detection accuracy and stability, and failing to meet the demands for high-precision and high-efficiency online quality inspection.
By acquiring the printed image to be detected and the defect-free template image, the images are registered and segmented into multiple sub-regions. Multi-dimensional difference features are calculated, feature points are selected, and a printing defect score is constructed by combining the printing contrast, color difference matrix, and texture anomaly degree to determine the printing quality.
It significantly improves the detection sensitivity for complex textures and minute defects, reduces false alarms, and enhances the accuracy and robustness of online visual inspection, making it suitable for complex printing scenarios.
Smart Images

Figure CN122089744A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing. More specifically, this invention relates to an online visual inspection method and system for printing quality based on image comparison. Background Technology
[0002] Traditional printing quality inspection relies on manual visual inspection, which is inefficient and inconsistent. In recent years, machine vision-based image comparison methods have been increasingly applied to online printing quality inspection, mainly detecting defects through template matching, differential analysis, and other methods.
[0003] However, existing image comparison methods still fall short of ideal detection results when dealing with printed products featuring complex textures, multi-layer printing, and dynamic production environments. These methods often struggle to effectively distinguish between normal production texture variations and genuine quality defects, exhibiting significant limitations in accuracy, stability, and adaptability. They are prone to misjudgments or missed detections, failing to fully meet the demands for high-precision and high-efficiency online quality inspection. Summary of the Invention
[0004] To address the technical problem of poor detection performance in complex textures and dynamic production environments in the prior art, the present invention provides solutions in the following aspects.
[0005] In the first aspect, the online visual inspection method for print quality based on image comparison includes: Obtain the registration image of the printed image to be inspected and the corresponding defect-free template image; The registered image and the template image are respectively divided into multiple registered sub-regions and template sub-regions corresponding to multiple positions. The printing defect score of the registered sub-region is calculated based on the multi-dimensional difference features between the registered sub-region and its corresponding template sub-region in the template image. If the printing defect score of any registered sub-region is greater than the preset threshold, the quality of the printing image to be detected is deemed unqualified. Specifically, the printing contrast of each pixel within the registration sub-region is calculated, and feature points are selected from all pixels based on the printing contrast to form a feature point set. Based on the feature point set, the printing contrast, and the color difference matrix between the registration sub-region and the corresponding template sub-region, the texture anomaly degree of the registration sub-region is calculated. Based on the texture anomaly degree, the offset distance of the feature point set between the registration image and the template image, and the offset distance of the feature point set of the neighboring sub-regions of the registration sub-region between the registration image and the template image, the printing defect score is calculated.
[0006] Preferably, the acquisition of the registration image includes: The print image to be detected is subjected to color space conversion and multi-step cyclic shifting to obtain multiple aligned candidate images; Calculate the cosine similarity between each alignment candidate image and the template image, and select the alignment candidate image with the largest cosine similarity as the registration image.
[0007] Preferably, after obtaining the registration sub-region and the template sub-region, the method further includes: For any pixel within the registration sub-region, the difference between its channel value in each color channel and the channel value of the corresponding pixel in the template sub-region in the corresponding color channel is calculated to form the color difference matrix of the pixel.
[0008] Preferably, for any pixel within the registration sub-region as the target pixel, the contribution values of each color channel are accumulated to obtain the print contrast; wherein, the contribution value is the product of the channel weight factor, the texture unique factor, and the neighborhood complexity factor; The channel weighting factor is the ratio of the standard deviation of the channel values of all pixels in the registration sub-region on a single color channel to the sum of the standard deviations of the channel values of all pixels in the registration sub-region on all color channels. The neighborhood complexity factor is obtained by exponential calculation with the natural constant as the base and the difference between the standard deviation of the channel values of all pixels in the neighborhood of the target pixel in a single color channel and the standard deviation of the channel values of the target pixel in a single color channel as the exponent.
[0009] Preferably, the calculation of the texture uniqueness factor includes: For a target pixel, calculate the cosine similarity between the pixel matrix composed of the target pixel and its neighboring pixels and the pixel matrix corresponding to each other pixel in the registration sub-region. The number of pixels with a cosine similarity less than or equal to 0 is counted, and the ratio of this number to the total number of pixels in the registration sub-region is exponentially calculated to obtain the texture uniqueness factor.
[0010] Preferably, the calculation of the texture anomaly degree includes: The weights of feature points and non-feature points are determined by the ratio of the average print contrast of feature points in the feature point set to the average print contrast of pixels outside the feature point set. The mean of the standard deviations of the color difference values of the color difference matrices corresponding to all feature points is calculated to obtain the first consistency analysis. The cosine similarity between the color difference matrices of any two feature points is calculated, and the first average pattern difference is calculated based on the cosine similarity between the color difference matrices of all two feature points. The first consistency analysis and the first average pattern difference are added together to obtain the first comprehensive pattern dispersion. For non-feature points, the second comprehensive mode dispersion is calculated according to the calculation method of the first comprehensive mode dispersion; The degree of texture anomaly is obtained by weighting the dispersion of the first comprehensive mode and the dispersion of the second comprehensive mode based on the respective weights of the feature points and non-feature points.
[0011] Preferably, the calculation of the texture anomaly degree includes: Calculate the cosine similarity between the color difference matrices of any two feature points, and calculate the first average mode difference based on the cosine similarity between the color difference matrices of all any two feature points; The relative saliency weight of each feature point is calculated based on the printing contrast of each feature point. The standard deviation of each color difference value in the color difference matrix corresponding to each feature point is calculated as the color difference fluctuation degree of that feature point. The relative saliency weights of all feature points and the color difference fluctuation degree are multiplied, accumulated, and averaged to obtain a weighted average color difference fluctuation value. The product of the first average mode difference degree and the weighted average color difference fluctuation value is used as the texture anomaly degree.
[0012] Preferably, the printing defect score includes: The ratio of the mean offset distance of all feature points in the registration sub-region to the side length of the registration sub-region is calculated and used as the first parameter. The second parameter is obtained by calculating the ratio of the mean offset distance of all feature points in each neighboring sub-region of the registration sub-region to the side length of the corresponding neighboring sub-region and accumulating all neighboring sub-regions. The product of the sum of the first and second parameters and the degree of texture abnormality is used as the printing defect score.
[0013] Preferably, it further includes: Calculate the overall color difference between the registered image and the template image; If the overall color difference exceeds the preset tolerance threshold, the printing quality is directly determined to be unqualified.
[0014] Secondly, an online visual inspection system for printing quality based on image comparison includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the online visual inspection method for printing quality based on image comparison described in any one of the claims is implemented.
[0015] The beneficial effects of this invention are: This invention precisely selects feature points through multi-dimensional printing contrast, effectively improving the detection sensitivity for complex textures and minute defects. Comprehensive texture anomaly analysis based on feature points can comprehensively capture color differences and texture anomalies while significantly suppressing false alarms. By fusing texture anomaly and pattern spatial offset information, a unified defect evaluation index is constructed, enabling accurate judgment of printing defects. This invention significantly improves the accuracy, robustness, and practicality of online visual inspection in complex printing scenarios. Attached Figure Description
[0016] Figure 1 This is a flowchart of steps S1-S3 in the online visual inspection method for printing quality based on image comparison according to an embodiment of the present invention.
[0017] Figure 2 This is a flowchart illustrating the acquisition of printing defect scores in the online visual inspection method for printing quality based on image comparison, as described in this embodiment of the invention.
[0018] Figure 3 This is a schematic diagram of the online visual inspection system for printing quality based on image comparison, according to an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0020] Reference Figure 1 The online visual inspection method for printing quality based on image comparison includes steps S1-S3, as follows: S1: Obtain the registration image of the print to be inspected and the corresponding defect-free template image.
[0021] On printing production lines, due to factors such as continuous fabric movement, mechanical vibration, and camera installation position, the image to be inspected directly captured by the industrial camera often exhibits slight spatial offset or rotation compared to the pre-stored standard (defect-free) template image. Direct comparison can lead to serious false detections. Therefore, high-precision image registration is essential to ensure strict spatial alignment between the image to be inspected and the template image, laying the foundation for subsequent pixel-level difference analysis.
[0022] In one embodiment, a flawless printed image is pre-acquired or input and stored as a template image. RGB (Red-Green-Blue) images of the printed product to be inspected are acquired in real time using an industrial camera on the production line.
[0023] Furthermore, to improve registration robustness, the printed image to be detected is first converted from the RGB color space to the LAB color space (which better reflects the color difference perceived by the human eye). The converted printed image to be detected is then subjected to multi-step cyclic shifting to simulate possible image shifts.
[0024] Specifically, taking the column direction of the print image to be detected as an example, the step size is set to 1 pixel, and each column of the print image to be detected is cyclically translated in turn to generate multiple aligned candidate images with the same number of columns as the print image to be detected.
[0025] Furthermore, the cosine similarity between each alignment candidate image and the template image is calculated. From all alignment candidate images, the one with the largest cosine similarity to the template image is selected and determined as the final registration image.
[0026] At this point, a registration image with a spatial position highly consistent with the template image is obtained.
[0027] S2: Divide the registration image and template image into multiple registration sub-regions and template sub-regions corresponding to different positions. Calculate the printing defect score of the registration sub-region based on the multi-dimensional difference features between the registration sub-region and its corresponding template sub-region in the template image.
[0028] Because printed patterns are typically complex, containing multiple colors and textures, global contrast can easily mask minor local defects, and the importance of texture varies across different regions. By segmenting the registered image obtained in S1 into sub-regions for local analysis, this invention focuses on details and assigns higher detection sensitivity to key areas such as edges with complex textures and overprint boundaries. This invention uses pixel-level "print contrast" to filter key points that can represent texture features, and then integrates multi-dimensional information such as color difference distribution, texture pattern similarity, and pattern offset to construct a comprehensive score—the print defect score—that can accurately distinguish between normal texture variations and real defects.
[0029] Reference Figure 2 The process of obtaining the above-mentioned printing defect score includes steps S20-S22, as follows: S20: Calculate the print contrast of each pixel within the registration sub-region, and select feature points from all pixels based on the print contrast to form a feature point set.
[0030] In one embodiment, the registered image and the template image are each uniformly divided into multiple sub-regions of the same size, and a positional correspondence is established. For ease of subsequent analysis, the sub-regions obtained from the segmentation of the registered image are collectively referred to as registered sub-regions, and the sub-regions obtained from the segmentation of the template image are collectively referred to as template sub-regions.
[0031] Next, we analyze a single registration sub-region in the registered image. Taking any pixel within this registration sub-region as the target pixel, we calculate the print contrast of the target pixel using the following formula: In the formula, To determine the printing contrast of the target pixels. For the target pixel at the th The contribution value of each color channel This represents the total number of color channels. For the target pixel at the th Channel weighting factors on each color channel For the target pixel at the th Each color channel has a unique texture factor. For the target pixel at the th Neighborhood complexity factors on each color channel.
[0032] The aforementioned channel weighting factor is the ratio of the standard deviation of all pixel channel values within the registered sub-region on a single color channel to the sum of the standard deviations of all pixel channel values within the registered sub-region on all color channels. This channel weighting factor adaptively emphasizes the color channel that plays a dominant role in the texture of the current registered sub-region, making the print contrast calculation more visually salient. The larger the standard deviation of all pixel channel values within the registered sub-region on a single color channel, the larger the weighting factor of that channel, thus positively enhancing the contribution value of that channel.
[0033] The process of obtaining the aforementioned texture uniqueness factor is as follows: For the target pixel, the cosine similarity is calculated between the pixel matrix formed by the target pixel and its eight neighboring pixels and the pixel matrices of all other pixels within the registration sub-region. The number of pixels with a cosine similarity less than or equal to 0 is counted. Then, using the natural constant e as the base and the ratio of the number of pixels with a cosine similarity less than or equal to 0 to the total number of pixels within the registration sub-region as the exponent, an exponential operation is performed to obtain the texture uniqueness factor of the target pixel. This texture uniqueness factor effectively highlights pixels that differ significantly from their surroundings (potentially defect points or key texture points), avoiding interference from pixels in uniform regions. The greater the number of pixels with a cosine similarity not greater than 0, the more unique the neighborhood texture of the target pixel, and the larger the result of the exponential operation.
[0034] The aforementioned neighborhood complexity factor is calculated using the natural constant e as the base and the difference between the standard deviation of the channel values of all pixels in the target pixel's neighborhood in a single color channel and the standard deviation of the target pixel's channel value in a single color channel as the exponent. This neighborhood complexity factor amplifies the response of pixels located in complex areas such as texture edges and intersections, which are precisely the areas with a high incidence of defects.
[0035] Finally, the printing contrast of all pixels in the registration sub-region is calculated similarly based on the above calculation process of the printing contrast of the target pixel. Pixels with a normalized printing contrast value greater than a preset feature threshold (such as 0.6) are further marked as feature points of the registration sub-region, and all feature points are combined into a feature point set.
[0036] Similarly, the feature point set of each of the registration sub-regions is obtained.
[0037] S21: Calculate the degree of texture anomaly in the registration sub-region based on the feature point set, print contrast, and color difference matrix between the registration sub-region and the corresponding template sub-region.
[0038] Key feature points alone are not enough; it is also necessary to analyze the overall color and texture consistency of the registered sub-regions from a pattern perspective. In a normal printing area, the color difference distribution should be relatively uniform and the texture patterns similar, while defects can lead to abnormal local color differences and disordered texture patterns.
[0039] In one embodiment, firstly, for any pixel within the registration sub-region, the difference between its channel value in each color channel and the channel value of the corresponding pixel in the template sub-region in the corresponding color channel is calculated to form the pixel's color difference matrix. Since the above S20 ultimately selects feature points from the registration sub-region, the following analysis uses feature points as an example.
[0040] Next, taking any registered sub-region as the target sub-region, the average print contrast of all feature points and the average print contrast of non-feature points within the target sub-region are calculated. The ratio of the average print contrast of all feature points to the average print contrast of non-feature points is used as the weight of the feature points, and the reciprocal of the weight of the feature points is used as the weight of the non-feature points. The higher the average print contrast of the feature points relative to the average print contrast of the non-feature points, the greater the weight of the feature points, and the stronger their influence in the subsequent weighted summation, ensuring that the analysis focuses on highly significant regions.
[0041] Then, the mean of the standard deviations of the color difference values of the color difference matrices corresponding to all feature points is calculated as the first consistency analysis; the cosine similarity between the color difference matrices of all pairwise feature points is calculated, and an exponential function operation is performed with the natural constant e as the base and the negative value of the cosine similarity between the color difference matrices of any two feature points as the exponent. The results of the above calculations are accumulated and averaged to obtain the first average pattern difference; the first consistency analysis and the first average pattern difference are added together to obtain the first comprehensive pattern dispersion of the feature points.
[0042] In the first consistency analysis above, the larger the mean of the standard deviation of the color difference of the feature points, the stronger the color difference fluctuation of the feature points themselves; in the first average pattern difference degree, the lower the cosine similarity of the color difference matrix of each pair of feature points, that is, the less similar the texture patterns, the difference degree obtained by exponential operation grows non-linearly, thus making the first average pattern difference degree significantly increase.
[0043] Similarly, the second comprehensive pattern dispersion of non-feature points is calculated using the same method as the first comprehensive pattern dispersion calculation for the aforementioned feature points.
[0044] Finally, based on the respective weights of feature points and non-feature points, the weighted sum of the first and second integrated mode dispersions is used to obtain the texture anomaly degree of the target sub-region.
[0045] In another embodiment, the cosine similarity between the color difference matrices of all pairwise feature points is calculated. Using the natural constant e as the base and the negative value of the cosine similarity between any two feature point color difference matrices as the exponent, an exponential function operation is performed. This process is repeated for all pairwise feature points, and the calculated results are summed and averaged to obtain the first average pattern difference. The ratio of the print contrast of each feature point to the sum of the print contrasts of all feature points is calculated and used as the relative saliency weight of the corresponding feature point. The standard deviation of each color difference value within the color difference matrix corresponding to each feature point is calculated as the color difference fluctuation degree of that feature point. The product of the relative saliency weights of all feature points and the color difference fluctuation degree is summed and averaged to obtain a weighted average color difference fluctuation value. The product of the first average pattern difference and the weighted average color difference fluctuation value is used as the texture anomaly degree of the target sub-region.
[0046] The first embodiment for calculating the degree of texture anomalies uses a group-based weighted summation logic to pursue comprehensive detection; the second embodiment uses a global and local multiplication logic to pursue rigorous judgment. Both improve the robustness of texture anomaly analysis from different dimensions.
[0047] Similarly, the texture anomaly degree of all registered sub-regions can be calculated using the same calculation process for the target sub-region.
[0048] S22: Based on the degree of texture anomaly, the offset distance of the feature point set between the registered image and the template image, and the offset distance of the feature point set of the neighboring sub-region of the registered sub-region between the registered image and the template image, the printing defect score of the registered sub-region is calculated.
[0049] Besides color and texture anomalies, overall or localized misalignment of the printed pattern (misprinting) is also a significant defect. Spatial location information also needs to be considered. The coordinate offset distance of feature points between the registered image and the template image directly reflects the deformation or displacement of the pattern. Furthermore, considering the consistency of offset in neighboring sub-regions can distinguish between normal slight global jitter and abnormal local misalignment.
[0050] In one embodiment, for each feature point in the above target sub-region feature point set, the pixel point with the highest cosine similarity to its pixel matrix (3×3 neighborhood matrix) is searched in the global scope of the template image and used as the best matching point of the feature point. The Euclidean distance between the feature point and the corresponding best matching point is calculated as the offset distance of the feature point.
[0051] The first parameter is obtained by calculating the ratio of the mean offset distance of all feature points within the target sub-region to the side length of the target sub-region (for normalization purposes); the second parameter is obtained by calculating the ratio of the mean offset distance of all feature points in each of the target sub-regions (i.e., there are 8 neighboring sub-regions) to the side length of the corresponding neighboring sub-region and summing all the neighboring sub-regions.
[0052] The product of the sum of the first and second parameters and the degree of texture anomaly in the target sub-region is used as the printing defect score of the target sub-region. The printing defect score is positively driven by both the degree of texture anomaly and the positional offset anomaly (i.e., the sum of the first and second parameters).
[0053] Similarly, the printing defect scores of all registered sub-regions are calculated using the same calculation process as the target sub-regions.
[0054] S3: If the printing defect score of any registration sub-region is greater than the preset threshold, the quality of the printing image to be detected is determined to be unqualified.
[0055] In one embodiment, the printing defect scores calculated for all registered sub-regions in the registered image are normalized (e.g., using maximum and minimum value normalization). Then, a quality judgment threshold is set (e.g., 0.3 based on historical data or process requirements). All registered sub-regions are traversed. If the normalized value of the printing defect score of any registered sub-region is greater than the set quality judgment threshold, the quality of the printed product to be inspected is determined to be unqualified.
[0056] This completes the online visual inspection of the printing quality.
[0057] In addition, an optional rapid overall color difference screening method is provided: before analyzing the registration sub-regions of the registered image, the global average color difference between the registered image and the template image can be calculated first. If the overall color difference exceeds a large tolerance threshold, it indicates a serious overall color difference problem, and the image can be directly judged as unqualified without the need for subsequent complex calculations, thus improving detection efficiency.
[0058] This invention also provides an online visual inspection system for printing quality based on image comparison. For example... Figure 3 As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the online visual inspection method for printing quality based on image comparison according to the first aspect of the present invention.
[0059] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0060] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. An online visual inspection method for printing quality based on image comparison, characterized in that, include: Obtain the registration image of the printed image to be inspected and the corresponding defect-free template image; The registered image and the template image are respectively divided into multiple registered sub-regions and template sub-regions corresponding to multiple positions. The printing defect score of the registered sub-region is calculated based on the multi-dimensional difference features between the registered sub-region and its corresponding template sub-region in the template image. If the printing defect score of any registered sub-region is greater than the preset threshold, the quality of the printing image to be detected is deemed unqualified. In this process, the printing contrast of each pixel within the registration sub-region is calculated, and feature points are selected from all pixels based on the printing contrast to form a feature point set. Based on the feature point set, print contrast, and color difference matrix between the registration sub-region and the corresponding template sub-region, the texture abnormality degree of the registration sub-region is calculated; based on the texture abnormality degree, the offset distance of the feature point set between the registration image and the template image, and the offset distance of the feature point set of the neighboring sub-region of the registration sub-region between the registration image and the template image, the print defect score is calculated.
2. The online visual inspection method for printing quality based on image comparison according to claim 1, characterized in that, The acquisition of the registration image includes: The print image to be detected is subjected to color space conversion and multi-step cyclic shifting to obtain multiple aligned candidate images; Calculate the cosine similarity between each alignment candidate image and the template image, and select the alignment candidate image with the largest cosine similarity as the registration image.
3. The online visual inspection method for printing quality based on image comparison according to claim 1, characterized in that, After obtaining the registration sub-region and the template sub-region, the following is also included: For any pixel within the registration sub-region, the difference between its channel value in each color channel and the channel value of the corresponding pixel in the template sub-region in the corresponding color channel is calculated to form the color difference matrix of the pixel.
4. The online visual inspection method for printing quality based on image comparison according to claim 1, characterized in that, For any pixel within the registration sub-region as the target pixel, the contribution values of each color channel are accumulated to obtain the print contrast; wherein, the contribution value is the product of the channel weight factor, the texture unique factor, and the neighborhood complexity factor. The channel weighting factor is the ratio of the standard deviation of the channel values of all pixels in the registration sub-region on a single color channel to the sum of the standard deviations of the channel values of all pixels in the registration sub-region on all color channels. The neighborhood complexity factor is obtained by exponential calculation with the natural constant as the base and the difference between the standard deviation of the channel values of all pixels in the neighborhood of the target pixel in a single color channel and the standard deviation of the channel values of the target pixel in a single color channel as the exponent.
5. The online visual inspection method for printing quality based on image comparison according to claim 4, characterized in that, The calculation of the texture uniqueness factor includes: For a target pixel, calculate the cosine similarity between the pixel matrix composed of the target pixel and its neighboring pixels and the pixel matrix corresponding to each other pixel in the registration sub-region. The number of pixels with a cosine similarity less than or equal to 0 is counted, and the ratio of this number to the total number of pixels in the registration sub-region is exponentially calculated to obtain the texture uniqueness factor.
6. The online visual inspection method for printing quality based on image comparison according to claim 1 or 3, characterized in that, The calculation of the texture anomaly degree includes: The weights of feature points and non-feature points are determined by the ratio of the average print contrast of feature points in the feature point set to the average print contrast of pixels outside the feature point set. The mean of the standard deviations of the color difference values of the color difference matrices corresponding to all feature points is calculated to obtain the first consistency analysis. The cosine similarity between the color difference matrices of any two feature points is calculated, and the first average pattern difference is calculated based on the cosine similarity between the color difference matrices of all two feature points. The first consistency analysis and the first average pattern difference are added together to obtain the first comprehensive pattern dispersion. For non-feature points, the second comprehensive mode dispersion is calculated according to the calculation method of the first comprehensive mode dispersion; The degree of texture anomaly is obtained by weighting the dispersion of the first comprehensive mode and the dispersion of the second comprehensive mode based on the respective weights of the feature points and non-feature points.
7. The online visual inspection method for printing quality based on image comparison according to claim 1 or 3, characterized in that, The calculation of the texture anomaly degree includes: Calculate the cosine similarity between the color difference matrices of any two feature points, and calculate the first average mode difference based on the cosine similarity between the color difference matrices of all any two feature points; The relative saliency weight of each feature point is calculated based on the printing contrast of each feature point. The standard deviation of each color difference value in the color difference matrix corresponding to each feature point is calculated as the color difference fluctuation degree of that feature point. The relative saliency weights of all feature points and the color difference fluctuation degree are multiplied, accumulated, and averaged to obtain a weighted average color difference fluctuation value. The product of the first average mode difference degree and the weighted average color difference fluctuation value is used as the texture anomaly degree.
8. The online visual inspection method for printing quality based on image comparison according to claim 1, characterized in that, The printing defect score includes: The ratio of the mean offset distance of all feature points in the registration sub-region to the side length of the registration sub-region is calculated and used as the first parameter. The second parameter is obtained by calculating the ratio of the mean offset distance of all feature points in each neighboring sub-region of the registration sub-region to the side length of the corresponding neighboring sub-region and accumulating all neighboring sub-regions. The product of the sum of the first and second parameters and the degree of texture abnormality is used as the printing defect score.
9. The online visual inspection method for printing quality based on image comparison according to claim 1, characterized in that, Also includes: Calculate the overall color difference between the registered image and the template image; If the overall color difference exceeds the preset tolerance threshold, the printing quality is directly determined to be unqualified.
10. An online visual inspection system for printing quality based on image comparison, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the online visual inspection method for print quality based on image comparison according to any one of claims 1-9.