Intelligent printing quality detection method and system based on machine vision

CN122550520APending Publication Date: 2026-08-11YICHANG LANTIAN COLOR PRINTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0002]印刷行业普遍采用机器视觉开展印刷品表面质量检测,常规检测多采用普通可见光图像采集方式,未采用标准化光源配合多光谱图像采集模式,图像易受环境光照、照度不均因素干扰,采集到的原始图像存在照度噪声干扰,难以精准凸显印刷纹理细节缺陷特征

Benefits of technology

对标准化光源下采集的多光谱原始印刷图像进行金字塔分解,实现图像在多尺度空间下低频照度层与高频纹理层的分层剥离,将整体照度信息与细节纹理信息进行层级拆分,隔绝画面亮度偏移对纹理特征信息产生的干扰,使高频纹理层能够保留完整的印刷细节固有信息。在每一尺度高频纹理层内同步提取局部相位一致性与局部梯度方向直方图,将两类特征进行维度合并形成多尺度特征张量,丰富图像纹理表征的信息维度,完整保留不同层级下印刷纹理的边缘形态与灰度变化特征。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122550520A_ABST
    Figure CN122550520A_ABST
Patent Text Reader

Abstract

This invention relates to the field of printing visual inspection technology, specifically to a machine vision-based intelligent inspection method and system for printing quality. The method includes: acquiring a multispectral image of the printed matter to be inspected as the original printed image under standardized lighting conditions; decomposing the image into multi-scale low-frequency illumination layers and high-frequency texture layers using pyramid decomposition; extracting local phase consistency and local gradient direction histograms from the high-frequency texture layers at each scale; and fusing these histograms to construct a multi-scale feature tensor; inputting the multi-scale feature tensor into a pre-trained Siamese neural network to accurately calculate the structural similarity difference map between the original printed image and a standard template image; and using an adaptive threshold segmentation method to process the difference map, automatically extracting candidate defect regions and outputting their location coordinates as the detection result. This method effectively isolates interference from illumination levels, characterizes subtle features of the printing texture in multiple dimensions, and enhances the ability to identify image structural differences through deep learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printing visual inspection technology, and in particular to a method and system for intelligent inspection of printing quality based on machine vision. Background Technology

[0002] The printing industry commonly uses machine vision for surface quality inspection of printed materials. Conventional inspections often employ ordinary visible light image acquisition methods, lacking standardized light sources and multispectral image acquisition modes. This makes the images susceptible to interference from ambient lighting and uneven illumination, resulting in illuminance noise in the acquired raw images and hindering the accurate highlighting of printing texture details and defects. Conventional image analysis often uses single-scale feature extraction methods, lacking multi-scale hierarchical decomposition capabilities and the ability to separate image illuminance components from texture detail components. Feature extraction is also easily affected by low-frequency brightness shifts.

[0003] Traditional printing defect detection extracts only single-type image features, lacking a joint extraction mechanism for local phase consistency and local gradient direction histograms. This results in a single-dimensional feature representation, making it difficult to fully depict subtle texture variations in printed patterns. Image comparison often employs traditional grayscale difference matching algorithms, failing to incorporate Siamese neural networks for deep feature correlation calculations, thus hindering the accurate representation of subtle structural differences between the image under inspection and the standard template.

[0004] Defect region segmentation often uses fixed thresholds for image segmentation. However, the threshold parameters cannot adapt to the grayscale variations of different printing background colors and texture regions, easily leading to missed defect segmentation or incorrect background segmentation. It is necessary to establish a multi-scale hierarchical decomposition and multi-dimensional texture feature fusion extraction mechanism, relying on deep learning networks to perform structural difference comparisons, and combining this with adaptive threshold segmentation to complete defect localization. This addresses the shortcomings of existing detection methods, such as weak anti-interference capabilities, insufficient feature representation, and poor defect segmentation adaptability. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and to propose a machine vision-based intelligent detection method and system for printing quality.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a machine vision-based intelligent detection method for printing quality, comprising: Collect multispectral images of the printed matter to be inspected under a standardized light source as the original printed images; Perform pyramid decomposition on the original printed image to separate low-frequency illumination layers and high-frequency texture layers at multiple scales; Local phase consistency and local gradient orientation histograms are extracted from high-frequency texture layers at each scale and merged into a multi-scale feature tensor. The multi-scale feature tensor is input into a pre-trained Siamese neural network to calculate the structural similarity difference map between the original printed image and the standard template image; Adaptive threshold segmentation is performed on the structural similarity difference map to extract candidate defect regions, and the position coordinates of the candidate defect regions are output as printing quality detection results.

[0007] As a further aspect of the present invention, the specific steps for acquiring a multispectral image of the printed matter to be tested under a standardized light source as the original printed image are as follows: Lay the printed material to be tested flat on the surface of a conveyor belt moving at a constant speed, with the printed surface facing the collection device; Multiple narrowband light sources with different center wavelengths are installed above the conveyor belt, and each narrowband light source is lit up sequentially in time. During the illumination of each narrowband light source, the area array camera is synchronously triggered to acquire monochrome images in the spectral channels; Monochrome images acquired from all spectral channels are stacked into a three-dimensional image cube in ascending order of spectral wavelength; Dark field correction and bright field correction are performed on the three-dimensional image cube to eliminate sensor background noise and light source non-uniformity; The corrected 3D image cube is used as the original printed image.

[0008] As a further aspect of the present invention, the specific steps for performing pyramid decomposition on the original printed image to separate the low-frequency illumination layer and the high-frequency texture layer at multiple scales are as follows: Gaussian pyramid downsampling is performed on each spectral channel in the original printed image to generate a multi-layer Gaussian pyramid for the spectral channels; Perform Laplacian convolution on each layer of the Gaussian pyramid image to extract the bandpass component of each layer; The bandpass component is used as a high-frequency texture layer at the corresponding scale; The top layer image of the Gaussian pyramid is upsampled and interpolated multiple times and then subtracted from the corresponding layer of the original Gaussian pyramid to extract the low-frequency illumination layer at each scale. The high-frequency texture layers with all spectral channels at the same scale are stitched together along the spectral dimension to form a multispectral high-frequency texture tensor. The low-frequency illuminance layers with all spectral channels at the same scale are spliced ​​along the spectral dimension to form a multispectral low-frequency illuminance tensor.

[0009] As a further aspect of the present invention, the specific steps for extracting local phase consistency and local gradient direction histograms from the high-frequency texture layer at each scale and merging them into a multi-scale feature tensor are as follows: For each spatial location in the multispectral high-frequency texture tensor, calculate the logarithmic wave response of the spatial location in different directions; The local phase coherence value of each spatial location is calculated from the logarithmic wave response as the phase characteristic value of the spatial location; For each local image patch in the multispectral high-frequency texture tensor, calculate the gradient direction and gradient magnitude of each pixel within that local image patch; The gradient directions within each local image block are weighted according to a preset direction interval to generate a local gradient direction histogram vector. The phase feature value of each spatial location is concatenated with the local gradient direction histogram vector of the corresponding local image patch to form a joint feature vector. The joint feature vectors of all spatial locations are organized into a multi-scale feature tensor with the same spatial dimensions as the original printed image.

[0010] As a further aspect of the present invention, the specific steps for inputting the multi-scale feature tensor into a pre-trained Siamese neural network to calculate the structural similarity difference map between the original printed image and the standard template image are as follows: Obtain a defect-free printed product of the same specifications as the printed product to be inspected as a standard sample, and perform the same preprocessing procedure as the original printed image on the standard sample to generate a standard multiscale feature tensor. The multi-scale feature tensor and the standard multi-scale feature tensor are respectively input into the two branch networks of the Siamese neural network; The two branches of the Siamese neural network output the first embedded feature vector of the multi-scale feature tensor and the second embedded feature vector of the standard multi-scale feature tensor, respectively. Calculate the cosine distance matrix between the first embedded feature vector and the second embedded feature vector; Apply a pointwise logarithmic transformation to each element of the cosine distance matrix to generate an initial difference response map; Median filtering is performed on the initial difference response map to suppress isolated noise points and generate the structural similarity difference map.

[0011] As a further aspect of the present invention, the specific steps for performing adaptive threshold segmentation on the structural similarity difference map to extract candidate defect regions are as follows: Calculate the mean and standard deviation of all pixel values ​​on the structural similarity difference map; The result of adding a multiple of the standard deviation to the mean is used as the dynamic segmentation threshold; Traverse each pixel in the structural similarity difference map and mark pixels with pixel values ​​greater than the dynamic segmentation threshold as potential defect pixels; Perform a connected component labeling algorithm on all potentially defective pixels to obtain multiple disconnected connected components; Calculate the total number of pixels for each connected component and discard connected components whose total number of pixels is less than a preset area threshold; The smallest bounding rectangle of each remaining connected component after removing small area components is taken as the candidate defect region.

[0012] As a further aspect of the present invention, the specific steps for performing defect category identification after outputting the position coordinates of the candidate defect area as the printing quality detection result are as follows: For each candidate defect region, a corresponding local image block is cropped from the original printed image; The local image patch is input into a pre-trained classification convolutional neural network; The classification convolutional neural network performs multiple convolution and pooling operations on the local image patch to extract depth feature maps; The deep feature map is mapped to probability distribution vectors of multiple defect categories through a fully connected layer; The category with the highest probability value is selected from the probability distribution vector as the defect category label for the candidate defect region; The defect category label of the candidate defect area is associated with the location coordinates and stored as the print quality inspection result.

[0013] As a further aspect of the present invention, the specific steps for performing defect region segmentation after outputting the position coordinates of the candidate defect region as the printing quality detection result are as follows: A region growing algorithm is performed on the structural similarity difference map using the center point of each candidate defect region as the seed point. The region growing algorithm starts from the seed point and spreads to adjacent pixels, including pixels with continuously changing difference values ​​in the growing region; Growth stops when the difference between all adjacent pixels on the boundary of the growth region and the mean of the current region exceeds a preset tolerance threshold. The growth region obtained after growth stops is used as the segmentation contour of the candidate defect region. Perform a morphological closing operation on the segmented contour to fill the small holes inside the contour; The segmented contour coordinates after morphological closing operations are used as the updated candidate defect region location coordinates.

[0014] As a further aspect of the present invention, the specific steps for performing false defect filtering after outputting the position coordinates of the candidate defect area as the printing quality detection result are as follows: Extract the local multispectral feature vector corresponding to each candidate defect region from the original printed image; Extract the local standard multispectral feature vectors at the same locations as each candidate defect region from the standard template image; Calculate the Mahalanobis distance between the local multispectral feature vector and the corresponding local standard multispectral feature vector for each candidate defect region; When the Mahalanobis distance is less than the preset false defect determination threshold, the candidate defect region is marked as a false defect and removed from the detection results; The coordinates of the remaining candidate defect areas after removing false defects are output as the final print quality inspection result.

[0015] As a further aspect of the present invention, the present invention also includes a machine vision-based intelligent printing quality inspection system, the system including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements the steps of the machine vision-based intelligent printing quality inspection method described above.

[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: Pyramid decomposition is performed on multispectral raw printed images acquired under standardized light sources to achieve layered separation of low-frequency illumination layers and high-frequency texture layers across multiple scales. This hierarchical separation of overall illumination information and detailed texture information isolates the interference of image brightness shifts on texture features, allowing the high-frequency texture layer to retain complete inherent printing detail information. Local phase consistency and local gradient direction histograms are simultaneously extracted within each scale's high-frequency texture layer. These two types of features are then merged to form a multi-scale feature tensor, enriching the information dimensions of image texture representation and fully preserving the edge morphology and grayscale variation features of printed textures at different levels.

[0017] Multi-scale feature tensors are input into a pre-trained Siamese neural network for feature computation, completing a deep feature comparison between the printed image to be inspected and the standard template image, generating a pixel-level structural similarity difference map, which characterizes the subtle structural deviations inside the printed image from a high-dimensional feature level, weakening the feature representation limitations of traditional grayscale comparison.

[0018] An adaptive threshold segmentation method is used to divide the structural similarity difference map into regions. The segmentation boundary is dynamically adjusted according to the grayscale distribution of the map itself, and the candidate defect regions are automatically extracted. The location information of the candidate defect regions is output in coordinate form, so as to accurately locate printing defects. It breaks away from the parameter constraints of the fixed threshold segmentation mode, adapts to the defect region segmentation under different printing background colors and texture distributions, and stably completes the automated quality judgment process of printed products. Attached Figure Description

[0019] Figure 1 This is a state diagram of the intelligent printing quality detection method based on machine vision described in this invention. Figure 2Workflow diagram for acquiring multispectral images as raw printing images; Figure 3 A flowchart illustrating the workflow for separating the low-frequency illumination layer and the high-frequency texture layer in pyramid decomposition. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0021] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0022] See Figure 1 The specific implementation of the intelligent printing quality detection method based on machine vision is as follows: A multispectral image of the printed matter to be inspected under a standardized light source is acquired as the original printing image; pyramid decomposition is performed on the original printing image to separate low-frequency illumination layers and high-frequency texture layers at multiple scales; local phase consistency and local gradient orientation histograms are extracted from the high-frequency texture layers at each scale and merged into a multi-scale feature tensor; the multi-scale feature tensor is input into a pre-trained Siamese neural network to calculate the structural similarity difference map between the original printing image and the standard template image; adaptive threshold segmentation is performed on the structural similarity difference map to extract candidate defect regions, and the position coordinates of the candidate defect regions are output as the printing quality detection result.

[0023] In one embodiment of the present invention, see [reference] Figure 2 The printed material to be inspected is laid flat on the surface of a conveyor belt moving at a constant speed, with the printed surface facing the acquisition device. Multiple narrowband light sources with different center wavelengths are installed above the conveyor belt, and each narrowband light source is lit sequentially in time. During the lighting of each narrowband light source, a field array camera is synchronously triggered to acquire monochrome images in the spectral channels. The monochrome images acquired in all spectral channels are stacked into a three-dimensional image cube in ascending order of spectral wavelength. Dark field correction and bright field correction are performed on the three-dimensional image cube to eliminate sensor background noise and light source non-uniformity. The corrected three-dimensional image cube is used as the original printed image.

[0024] In practice, the printed material to be inspected is laid flat on the surface of a conveyor belt moving at a constant speed, with the printed surface facing the acquisition device. The speed of the conveyor belt is set to match the line scanning frequency of the area scan camera to ensure that the image does not stretch or deform during continuous acquisition. Multiple narrowband light sources with different center wavelengths are installed above the conveyor belt. The center wavelengths of the narrowband light sources are selected as 450 nm, 530 nm, 590 nm, and 670 nm, respectively. Each narrowband light source is lit sequentially in chronological order, with each light source lit for 10 milliseconds and an interval of 2 milliseconds between adjacent light sources. During the lighting period of each narrowband light source, the area scan camera is synchronously triggered to acquire monochrome images in the spectral channel. The exposure time was kept consistent with the illumination duration of the narrowband light source, both being 10 milliseconds, thus obtaining four monochrome images corresponding to the four spectral channels. The monochrome images acquired from all spectral channels were stacked into a three-dimensional image cube in ascending order of spectral wavelength. The three dimensions of the three-dimensional image cube represent the image height, image width, and spectral channel index, respectively. Dark-field correction and bright-field correction were performed on the three-dimensional image cube to eliminate sensor background noise and light source non-uniformity. Dark-field correction was achieved by acquiring dark-field images from the area array camera under completely dark conditions, while bright-field correction was achieved by acquiring bright-field images of each spectral channel under standard white board reflection conditions. The formula for calculating the corrected pixel value is as follows: in: Indicates wavelength Spatial position in the spectral channels The corrected pixel values, This represents the original pixel values. Indicates the position in the dark field image Pixel value at that location, Indicates wavelength Location in brightfield image under spectral channel Pixel value at that location, Indicates wavelength The target normalization coefficients of the spectral channels; the corrected 3D image cube is used as the original printed image.

[0025] In some embodiments, the number of narrowband light sources installed above the conveyor belt is adjusted according to the ink spectral characteristics of the printed matter to be tested. For printed matter containing special fluorescent inks, an additional narrowband light source with a center wavelength of 365 nanometers is added. The lighting sequence of the narrowband light sources is in order of wavelength from shortest to longest to avoid spectral crosstalk between different channels. During the lighting of each narrowband light source, the area array camera only acquires a monochromatic image of the corresponding spectral channel.

[0026] In some embodiments, the dark field images and bright field images acquired during dark field correction and bright field correction are pre-stored in the non-volatile memory of the detection system, and are re-acquired at predetermined intervals to compensate for changes caused by sensor dark current drift and light source aging; the target normalization coefficient in the correction formula The value is set to the reciprocal of the full-frame pixel mean of the bright-field image, ensuring that the pixel values ​​of the standard white board area in all spectral channels are normalized to around 1.0 after correction. Optionally, for different batches of printed materials to be inspected, if the reflectivity of the printing substrate changes, the bright-field image for each spectral channel is re-acquired and the target normalization coefficient for each wavelength is recalculated. To ensure consistent grayscale response of the original printed image across different batches; the ambient temperature of the standardized light source is controlled within the range of 20 to 25 degrees Celsius, and the driving current of the narrow-band light source is provided through a constant current source module to suppress wavelength drift of the light source with temperature.

[0027] Optionally, the area scan camera uses a CMOS sensor with a global shutter mode. After the narrowband light source is illuminated, the area scan camera is triggered to expose itself after a 1-millisecond delay to ensure the light source output reaches a stable state. A synchronous trigger signal is generated by a programmable logic controller and simultaneously distributed to the narrowband light source drive module and the area scan camera trigger interface, ensuring precise alignment between the image acquisition time of each spectral channel and the illumination time of the narrowband light source. It can be understood that when stacking the monochrome images of all spectral channels into a three-dimensional image cube in ascending order of spectral wavelength, no interpolation operation is performed between adjacent spectral channels, maintaining the original spatial resolution of each channel image. The dark field images acquired during dark field correction are multi-frame average images, generated by taking the arithmetic mean of each pixel of 32 consecutively acquired dark field images, to reduce the impact of random readout noise on the accuracy of dark field correction. It is understandable that a standard white board with a barium sulfate coating is used in the bright field correction process. The surface of the standard white board has Lambertian reflective properties, and the size of the white board is larger than the field of view of the area array camera to ensure the bright field correction accuracy within the entire acquisition field of view. For the bright field image acquired separately for each spectral channel, median filtering is performed before correction to eliminate local bright spot anomalies caused by tiny dust particles on the white board surface.

[0028] In one embodiment of the present invention, see [reference] Figure 3Gaussian pyramid downsampling is performed on each spectral channel of the original printed image to generate a multi-layer Gaussian pyramid for each spectral channel; Laplacian convolution is performed on each layer of the Gaussian pyramid image to extract the bandpass component of each layer; the bandpass component is used as the high-frequency texture layer at the corresponding scale; the top layer image of the Gaussian pyramid is upsampled and interpolated multiple times and then subtracted from the corresponding layer of the original Gaussian pyramid to extract the low-frequency illumination layer at each scale; the high-frequency texture layers of all spectral channels at the same scale are concatenated along the spectral dimension to form a multispectral high-frequency texture tensor; the low-frequency illumination layers of all spectral channels at the same scale are concatenated along the spectral dimension to form a multispectral low-frequency illumination tensor.

[0029] In the specific implementation, the original printed image contains four spectral channels corresponding to monochrome images acquired under narrowband light source illumination of 450 nm, 530 nm, 590 nm, and 670 nm, respectively. The image size of each spectral channel is 2048 pixels × 2048 pixels. Gaussian pyramid downsampling is performed on each spectral channel in the original printed image to generate a multi-layer Gaussian pyramid for the spectral channel. The number of layers in the Gaussian pyramid is set to 5. The 0th layer is the original resolution image. The 1st layer is generated by performing a 5×5 Gaussian kernel convolution on the 0th layer image and then downsampling every other row and column. The 2nd to 4th layers are generated in the same way. Laplacian operator convolution is performed on each layer of the Gaussian pyramid image to extract the bandpass component of each layer. The Laplacian operator uses a 3×3 discrete convolution kernel with the kernel matrix [[0,1,0],[1,-4,1],[0,1,0]]. The result of the Laplacian operator convolution is used as the high-frequency texture layer at the corresponding scale. The top image of the Gaussian pyramid is upsampled and interpolated multiple times and then subtracted from the corresponding layer of the original Gaussian pyramid to extract the low-frequency illumination layer at each scale. The top image is the 4th layer image. It is first upsampled to the size of the 3rd layer by bilinear interpolation. The 4th layer image is obtained by subtracting the upsampled image from the 3rd layer Gaussian pyramid image. The 4th layer image is then upsampled three times and subtracted from the 0th layer Gaussian pyramid image to obtain the 0th scale low-frequency illumination layer.

[0030] High-frequency texture layers with all spectral channels at the same scale are stitched together along the spectral dimension to form a multispectral high-frequency texture tensor. The dimensions of the multispectral high-frequency texture tensor are represented as H×W×C×L, where H is the image height, W is the image width, C is the number of spectral channels, and L is the number of Gaussian pyramid layers. Low-frequency illumination layers with all spectral channels at the same scale are stitched together along the spectral dimension to form a multispectral low-frequency illumination tensor. The multispectral low-frequency illumination tensor has the same dimensional structure as the multispectral high-frequency texture tensor.

[0031] In practice, the Gaussian kernel weights used in the Gaussian pyramid downsampling process are generated using a Gaussian function: in: This represents the offset of the convolution kernel relative to the center pixel. and The weighting coefficient of location, The value is set to 1.0, and the kernel size is 5×5. and The values ​​of all values ​​are integers from -2 to 2, and the sum of all weight coefficients after normalization is 1. The downsampling process of each Gaussian pyramid image layer is performed by a factor of 2 in both the horizontal and vertical directions, and the position information of discarded pixels is not retained. In some embodiments, when the original printed image contains 6 spectral channels, the number of Gaussian pyramid layers is adaptively determined according to the minimum image size, and the maximum number of layers when the image is downsampled to a short side length of not less than 32 pixels is taken as the actual number of pyramid layers. Gaussian pyramid downsampling is performed independently for each spectral channel, and the number of pyramid layers between different spectral channels is kept consistent to ensure the scale alignment of each spectral channel during subsequent stitching.

[0032] In some embodiments, before convolution with the Laplacian operator, edge padding is performed on each layer of the Gaussian pyramid image. The padding width is 1 pixel, and the padding value is set to the mirror value of the boundary pixel to ensure that the output image after convolution has the same size as the input image. The extracted high-frequency texture layer values ​​cover the positive and negative value regions, and the low-frequency illumination layer values ​​are consistent with the original pixel grayscale range. Optionally, during the upsampling and interpolation process of the top layer image of the Gaussian pyramid, upsampling is achieved by inserting zero-value rows and columns between image pixels, and interpolation uses a bicubic interpolation algorithm with a cubic spline function with a parameter of -0.5. During multiple upsampling and interpolation operations, Gaussian filtering is performed after each upsampling to eliminate high-frequency artifacts introduced by interpolation. The Gaussian filter kernel size is 3×3, and the standard deviation is 0.8.

[0033] Optionally, when stitching the high-frequency texture layer along the spectral dimension, images of the same scale in different spectral channels are arranged in ascending order of spectral wavelength, with the 450 nm channel as the first dimension, the 530 nm channel as the second dimension, the 590 nm channel as the third dimension, and the 670 nm channel as the fourth dimension; the same spectral channel order is used when stitching the low-frequency illumination layer along the spectral dimension.

[0034] It can be understood that each element in the multispectral high-frequency texture tensor represents high-frequency texture information at a specific spectral channel, spatial location, and scale. The sign of the value reflects the polarity of the brightness change at that location, and the absolute value reflects the texture intensity. Similarly, each element in the multispectral low-frequency illumination tensor reflects the slowly varying components of the lighting conditions and the reflective properties of the printing substrate. It can also be understood that the top-level image of the Gaussian pyramid is reused as a subtraction benchmark when extracting low-frequency illumination layers at various scales. No subtraction operation is performed on the top-level image itself; the low-frequency illumination layer at the top scale is directly defined as the top-level Gaussian pyramid image itself. After multi-level Gaussian pyramid decomposition, the high-frequency texture layer and the low-frequency illumination layer are used in subsequent multi-scale feature extraction steps.

[0035] In one embodiment of the present invention, the logarithmic wavelet response of each spatial location in the multispectral high-frequency texture tensor in different directions is calculated; the local phase consistency value of each spatial location is calculated from the logarithmic wavelet response as the phase feature value of the spatial location; the gradient direction and gradient magnitude of each pixel within each local image block in the multispectral high-frequency texture tensor are calculated; the gradient directions within each local image block are weighted and voted according to a preset direction interval to generate a local gradient direction histogram vector; the phase feature value of each spatial location is concatenated with the local gradient direction histogram vector of the corresponding local image block to form a joint feature vector; and the joint feature vectors of all spatial locations are organized into a multi-scale feature tensor with the same spatial size as the original printed image.

[0036] A defect-free printed product of the same specifications as the printed product to be inspected is obtained as a standard sample, and the same preprocessing procedure as the original printed image is performed on the standard sample to generate a standard multi-scale feature tensor. The multi-scale feature tensor and the standard multi-scale feature tensor are respectively input into two branches of a Siamese neural network. The two branches of the Siamese neural network output the first embedded feature vector of the multi-scale feature tensor and the second embedded feature vector of the standard multi-scale feature tensor, respectively. The cosine distance matrix between the first embedded feature vector and the second embedded feature vector is calculated. A pointwise logarithmic transformation is applied to each element in the cosine distance matrix to generate an initial difference response map. Median filtering is performed on the initial difference response map to suppress isolated noise points and generate the structural similarity difference map.

[0037] In practical implementation, the dimensions of the multispectral high-frequency texture tensor are 2048 pixels × 2048 pixels × 4 spectral channels × 5 scales. For each spatial location in the multispectral high-frequency texture tensor, the logarithmic wavelet response in different directions is calculated. The logarithmic wavelet filter is set to 6 directions corresponding to 0 degrees, 30 degrees, 60 degrees, 90 degrees, 120 degrees, and 150 degrees respectively. The local phase coherence value of each spatial location is calculated from the logarithmic wavelet response as the phase characteristic value of the spatial location. The formula for calculating the local phase coherence value is as follows: in: Indicates spatial location The local phase consistency value at that location. Representing scale direction Logarithmic summation of wave response amplitude This indicates the phase value of the response. This represents the average phase value across all directions at this scale. This indicates the operation of taking the positive part. To prevent positive integers with zero denominators, the gradient direction and magnitude of each pixel within each local image patch in the multispectral high-frequency texture tensor are calculated. The size of each local image patch is set to 16 pixels × 16 pixels. The gradient directions within each local image patch are weighted according to preset direction intervals to generate a local gradient direction histogram vector. The number of direction intervals is set to 9, each interval covering 20 degrees, and the weighting of the voting is taken as the gradient magnitude of the current pixel. The phase feature value of each spatial location is concatenated with the local gradient direction histogram vector of the corresponding local image patch to form a joint feature vector. The phase feature value is a scalar, the local gradient direction histogram vector is 9-dimensional, and the joint feature vector is 10-dimensional. The joint feature vectors of all spatial locations are organized into a multi-scale feature tensor with the same spatial size as the original printed image. The multi-scale feature tensor has dimensions of 2048 pixels × 2048 pixels × 10 feature dimensions.

[0038] In some embodiments, the size of the local image patch is adaptively set according to the resolution of the multispectral high-frequency texture tensor. The size of the local image patch is adjusted to 8 pixels × 8 pixels for the feature map corresponding to the highest level of the pyramid decomposition. The number of directional intervals of the gradient direction histogram is set to 8, and each interval covers 45 degrees. The gradient calculation uses the Sobel operator, with the horizontal convolution kernel being [[-1,0,1],[-2,0,2],[-1,0,1]] and the vertical convolution kernel being [[-1,-2,-1],[0,0,0],[1,2,1]].

[0039] In some embodiments, during the weighted voting process, when the gradient direction falls on the boundary between two directional intervals, the gradient magnitude of the pixel is linearly interpolated and assigned to the two adjacent intervals; after the local gradient direction histogram vector is generated, L2 norm normalization is performed, and the values ​​of each dimension are divided by the vector magnitude. Optionally, the number of directions of the logarithmic wavelet filter is set to 4, corresponding to 0 degrees, 45 degrees, 90 degrees, and 135 degrees respectively, and the filter bank in each direction contains 3 logarithmic wavelet functions of different scales; during the local phase consistency calculation, the positive part operation directly assigns values ​​less than zero to zero. Optionally, the two branches of the Siamese neural network have the same network structure and share weight parameters, and each branch contains four convolutional layers and two fully connected layers; the multi-scale feature tensor and the standard multi-scale feature tensor are respectively input into the two branches, and the first embedded feature vector and the second embedded feature vector are respectively output, and the dimensions of the two embedded feature vectors are both 128-dimensional; the cosine distance matrix between the first embedded feature vector and the second embedded feature vector is calculated; a pointwise logarithmic transformation is applied to each element in the cosine distance matrix to generate an initial difference response map, and the pointwise logarithmic transformation adopts... ,in The cosine distance value is represented; median filtering is performed on the initial difference response map to suppress isolated noise points and generate a structural similarity difference map. The median filter window size is set to 5 pixels × 5 pixels.

[0040] It is understandable that the multi-scale feature tensor is perfectly aligned with the original printed image in spatial dimension, facilitating pixel-by-pixel comparison by the Siamese neural network. Before median filtering, the initial difference response map is expanded by mirror boundary, and after filtering, the expanded portion is truncated to maintain the image size. It is also understandable that the Siamese neural network uses a contrastive loss function during training. The training dataset includes images of defect-free printed materials and images of various types of defective printed materials. Paired feature tensors at the same spatial location are used as positive samples, and paired feature tensors at different spatial locations or different samples are used as negative samples, as shown in Table 1.

[0041] Table 1: Local Gradient Direction Histogram Parameter Configuration Table In one embodiment, the mean and standard deviation of all pixel values ​​in the structural similarity difference map are calculated; the mean plus a multiple of the standard deviation is used as a dynamic segmentation threshold; each pixel in the structural similarity difference map is traversed, and pixels with pixel values ​​greater than the dynamic segmentation threshold are marked as potential defect pixels; a connected component labeling algorithm is performed on all potential defect pixels to obtain multiple unconnected connected components; the total number of pixels in each connected component is calculated, and connected components with a total number of pixels less than a preset area threshold are removed; the minimum bounding rectangle of each remaining connected component after removing small-area components is used as a candidate defect region. For each candidate defect region, a corresponding local image patch is cropped from the original printed image; the local image patch is input into a pre-trained classification convolutional neural network; the classification convolutional neural network performs multiple convolution and pooling operations on the local image patch to extract a depth feature map; the depth feature map is mapped to a probability distribution vector of multiple defect categories through a fully connected layer; the category with the highest probability value is selected from the probability distribution vector as the defect category label of the candidate defect region; the defect category label of the candidate defect region is associated with the location coordinates and stored as a printing quality detection result.

[0042] In practice, the structural similarity difference map is 2048 pixels × 2048 pixels, with each pixel value ranging from 0 to 2. The mean μ and standard deviation σ of all pixel values ​​on the structural similarity difference map are calculated, with a mean of 0.15 and a standard deviation of 0.08. The mean plus three times the standard deviation is used as the dynamic segmentation threshold, and the formula for the dynamic segmentation threshold is: in: Indicates the dynamic segmentation threshold. This represents the arithmetic mean of all pixel values ​​on the structural similarity difference map. This represents the sample standard deviation of all pixel values ​​on the structural similarity difference map. The multiplier is used as a factor; each pixel in the structural similarity difference map is traversed and pixels with pixel values ​​greater than the dynamic segmentation threshold are marked as potential defect pixels; a connected component marking algorithm is performed on all potential defect pixels to obtain multiple unconnected connected components. The connected component marking algorithm adopts a two-pass scanning marking method based on 8-neighborhood connectivity; the total number of pixels in each connected component is calculated and connected components with a total number of pixels less than a preset area threshold are removed. The preset area threshold is set to 50 pixels; the minimum bounding rectangle of each remaining connected component after removing small area components is taken as the candidate defect region.

[0043] In some embodiments, the multiplier k is selected between 2.5 and 4.0 based on the sensitivity requirements for printing defect detection. For printings requiring detection of minor defects, the multiplier k is set to 2.5; for printings focusing only on larger, more obvious defects, the multiplier k is set to 4.0. During the first scan of the connected component labeling algorithm, a temporary label is assigned to each potential defect pixel, and the equivalence relationships between the labels are recorded. During the second scan, the equivalent labels are merged into a unique label. In some embodiments, the preset area threshold is adjusted according to the printing size and defect type. For text-based printing, the area threshold is set to 30 pixels; for large-area pattern printing, the area threshold is set to 80 pixels. The minimum bounding rectangle is determined by calculating the minimum row coordinates, maximum row coordinates, minimum column coordinates, and maximum column coordinates of all pixels in the connected components. The rectangle's boundary is parallel to the image coordinate axes.

[0044] Optionally, before executing the connected component labeling algorithm, a morphological dilation operation is performed on the potential defect pixels. The dilation kernel uses a 3-pixel × 3-pixel matrix of all 1s to connect adjacent potential defect pixels into a larger connected component, avoiding the segmentation of the same defect into multiple connected components due to small gaps. Optionally, after removing small-area components, the minimum bounding rectangle of each connected component is expanded by 5 pixels in each of the four directions, so that the expanded rectangular area completely covers the defect and its surrounding background area. If the rectangle boundary exceeds the original image boundary during the expansion process, the original image boundary value is used for truncation.

[0045] It is understandable that the dynamic segmentation threshold adapts to the statistical characteristics of each structural similarity difference map. When the mean and standard deviation of different printed images differ significantly, the segmentation threshold is adjusted accordingly, eliminating the need to manually set a fixed threshold. It is also understandable that the method for calculating the area of ​​a connected component is to count the number of pixels contained within that component. Removing components with an area smaller than the threshold can filter out pseudo-defect regions caused by noise or minor texture variations (see Table 2).

[0046] Table 2: Connectivity Component Labeling and Candidate Region Extraction Parameter Configuration Table In the specific implementation, for each candidate defect region, a corresponding local image patch is cropped from the original printed image. The original printed image contains four spectral channels, and the size of the local image patch is 64 pixels × 64 pixels × 4 spectral channels. The local image patch is input into a pre-trained classification convolutional neural network. The classification convolutional neural network performs multiple convolution and pooling operations on the local image patch to extract depth feature maps. The network structure contains 3 convolutional layers and 3 pooling layers. The convolutional kernel size of each convolutional layer is 3×3, and the number of convolutional kernels is 32, 64, and 128, respectively. The pooling layers use 2×2 max pooling operation with a stride of [missing value]. 2. The deep feature map is mapped to a probability distribution vector of multiple defect categories through a fully connected layer. The fully connected layer contains 256 neurons, and the number of neurons in the output layer is equal to the total number of defect categories. The total number of defect categories is set to 5, corresponding to five types of defects: scratches, ink spots, missing prints, burrs, and foreign objects. The category with the highest probability value is selected from the probability distribution vector as the defect category label of the candidate defect region. The defect category label of the candidate defect region is associated with the position coordinates and stored as the printing quality detection result. The position coordinates are represented by four values: the row coordinate of the top left corner, the column coordinate of the top left corner, the height of the rectangle, and the width of the rectangle.

[0047] In some embodiments, each convolutional layer in the classification convolutional neural network is followed by a batch normalization layer and a linear rectified activation layer. The batch normalization layer normalizes the convolutional output, and the negative slope of the linear rectified activation layer is 0. The depth feature map output by the last pooling layer has a size of 4 pixels × 4 pixels × 128 channels. After being flattened, it is converted into a 2048-dimensional feature vector and then input into the fully connected layer. In some embodiments, the total number of defect categories is configured according to the actual printing process requirements. For color printing, the color difference category is added, and the total number of defect categories is set to 6. For label printing, the foreign object category is reduced, and the total number of defect categories is set to 4. The output layer of the classification convolutional neural network uses the Softmax activation function to convert the real number vector output by the fully connected layer into the probability value of each defect category. The sum of the probabilities of all categories is 1.

[0048] Optionally, the classification convolutional neural network uses a cross-entropy loss function during training, employing local image patches labeled with defect categories as training samples. Each defect category contains at least 2000 training samples. A stochastic gradient descent optimizer is used during training, with the initial learning rate set to 0.001, decaying to 0.9 times the original rate every 10 training epochs. Optionally, when the size of the local image patch corresponding to the candidate defect region is greater than 64 pixels × 64 pixels, the local image patch is scaled to 64 pixels × 64 pixels using bilinear interpolation before being input into the classification convolutional neural network; when the size of the local image patch is less than 64 pixels × 64 pixels, pixels are padded outwards from the center point of the candidate defect region to 64 pixels × 64 pixels, with the padding value being the mirror image value of the image boundary pixels.

[0049] It is understandable that the associated storage of print quality inspection results includes defect category labels and corresponding location coordinates. The inspection results are exported as a JSON file in a structured format for easy subsequent quality statistics and defect tracing. It is also understandable that the deep feature maps extracted by the classification convolutional neural network have stronger class discrimination capabilities compared to the original pixels. Different defect categories are separable in the deep feature space, and end-to-end defect category identification is achieved through fully connected layers and Softmax layers.

[0050] In one embodiment of the present invention, a region growing algorithm is executed on the structural similarity difference map using the center point of each candidate defect region as the seed point. The region growing algorithm spreads from the seed point to adjacent pixels and includes pixels with continuously changing difference values ​​in the growing region. Growth stops when the deviation between the difference values ​​of all adjacent pixels on the boundary of the growing region and the current region mean exceeds a preset tolerance threshold. The growing region obtained after stopping growth is used as the segmentation contour of the candidate defect region. Morphological closing operation is performed on the segmentation contour to fill the small holes inside the contour. The coordinates of the segmentation contour after morphological closing operation are used as the updated position coordinates of the candidate defect region. Local multispectral feature vectors corresponding to each candidate defect region are extracted from the original printed image. Local standard multispectral feature vectors at the same position as each candidate defect region are extracted from the standard template image. The Mahalanobis distance between the local multispectral feature vector of each candidate defect region and the corresponding local standard multispectral feature vector is calculated. When the Mahalanobis distance is less than a preset false defect judgment threshold, the candidate defect region is marked as a false defect and removed from the detection result. The position coordinates of the remaining candidate defect region after removing false defects are output as the final printing quality detection result.

[0051] In the specific implementation, for each candidate defect region obtained after candidate defect region extraction, the coordinates of the center point of the smallest bounding rectangle of the candidate defect region on the structural similarity difference map are used as the seed point. A region growing algorithm is executed on the structural similarity difference map using the center point of each candidate defect region as the seed point. The region growing algorithm spreads from the seed point to adjacent pixels and includes pixels with continuously changing difference values ​​in the growing region. The growth criterion is set to the absolute value of the difference between the difference value of adjacent pixels and the mean of the difference values ​​of all pixels in the current growing region being less than 0.05. Growth stops when the deviation of the difference values ​​of all adjacent pixels on the boundary of the growing region from the mean of the current region exceeds a preset tolerance threshold, which is set to 0.08. The growing region obtained after stopping growth is used as the segmentation contour of the candidate defect region. Morphological closing operations are performed on the segmentation contour to fill small holes inside the contour. The morphological closing operation uses a 5-pixel × 5-pixel elliptical structural element, first performing dilation and then erosion. The coordinates of the segmentation contour after morphological closing are used as the updated position coordinates of the candidate defect region.

[0052] In some embodiments, the neighboring pixels used in the region growing algorithm are defined as the four neighboring pixels of the current growing region boundary pixel, i.e., the four directions of up, down, left, and right, excluding the diagonal direction to reduce the wrong inclusion of noisy pixels; the judgment criterion for the continuous change of the difference value in the growth criterion adopts the form of relative deviation. When the deviation between the difference value of the neighboring pixel and the region mean exceeds the tolerance threshold, the pixel is not included and the growth in that boundary direction stops.

[0053] In some embodiments, the preset tolerance threshold is adjusted based on the overall contrast of the structural similarity difference map. When the standard deviation of the pixel values ​​in the structural similarity difference map is less than 0.03, the tolerance threshold is reduced to 0.05; when the standard deviation is greater than 0.10, the tolerance threshold is increased to 0.12. The size of the structuring element in the morphological closing operation is set according to the size of the holes in the segmented contour. For contours with holes smaller than 10 pixels in diameter, a 3-pixel × 3-pixel square structuring element is used. Optionally, during the execution of the region growing algorithm, the update value of the average value of the growing region after each new pixel is included is recorded. When the number of newly included pixels is less than 5 in three consecutive iterations, the growing algorithm is terminated early without waiting for all directions of the boundary to stop growing. After the morphological closing operation, small holes with a diameter of less than 3 pixels that still exist inside the segmented contour are not filled again to avoid excessive smoothing that leads to distortion of the contour boundary.

[0054] Optionally, the updated candidate defect region coordinates are stored as a sequence of polygon vertices. These vertices are simplified by extracting pixels from the segmentation contour boundaries and using the Douglas-Peucker algorithm, with a simplification tolerance of 2 pixels. This reduces the number of stored coordinates while preserving the main features of the contour shape. It can be understood that the region growing algorithm, starting from a seed point and gradually expanding, can accurately segment irregularly shaped defect regions, obtaining more precise defect boundaries compared to a fixed-size minimum bounding rectangle. Morphological closing operations fill the holes, making the defect contour continuous and complete, facilitating subsequent feature extraction and statistical analysis. In the specific implementation, the local multispectral feature vector corresponding to each candidate defect region is extracted from the original printed image. The original printed image contains four spectral channels. The local multispectral feature vector extraction area is taken as all pixels inside the contour corresponding to the updated candidate defect region's position coordinates. For each spectral channel, four statistics—mean, standard deviation, skewness, and kurtosis—are calculated for the pixels inside the contour. A total of 16-dimensional local multispectral feature vectors are generated from the four spectral channels. The local standard multispectral feature vector at the same position as each candidate defect region is extracted from the standard template image. The standard template image has the same spectral channel configuration as the original printed image, extracts pixels inside the same contour coordinates, and calculates the same 16-dimensional statistics. The Mahalanobis distance between the local multispectral feature vector of each candidate defect region and the corresponding local standard multispectral feature vector is calculated. The Mahalanobis distance calculation formula is: in: Represents local multispectral eigenvectors With local standard multispectral eigenvectors Mahalanobis distance between them and Both are 16-dimensional column vectors. This represents the 16×16 covariance matrix estimated from a large sample of defect-free printed materials. This represents the inverse of the covariance matrix; when the Mahalanobis distance is less than the preset false defect judgment threshold, the candidate defect region is marked as a false defect and removed from the detection result. The preset false defect judgment threshold is set to 3.0; the position coordinates of the remaining candidate defect region after removing the false defects are output as the final printing quality detection result.

[0055] In some embodiments, the statistics extracted from the local multispectral feature vector also include the texture features of local image patches. These texture features are calculated using a gray-level co-occurrence matrix and include four parameters: contrast, energy, homogeneity, and correlation. The four spectral channels add a total of 16 features, expanding the total dimension of the local multispectral feature vector to 32. The covariance matrix is ​​estimated based on 50,000 contour regions randomly sampled from 2,000 defect-free printed samples. In some embodiments, the preset false defect threshold is adjusted according to the texture complexity of the printing substrate. For simple coated paper printed materials, the threshold is set to 2.5, and for complex textured fabric printed materials, the threshold is set to 4.0. During the Mahalanobis distance calculation, when the covariance matrix is ​​a singular matrix, a pseudo-inverse matrix is ​​used instead of the inverse matrix. The pseudo-inverse matrix is ​​obtained through singular value decomposition.

[0056] Optionally, the estimation of the covariance matrix is ​​based on 200 defect-free standard samples collected in the offline stage. For each sample, 200 contour regions are randomly selected to calculate local multispectral feature vectors, resulting in a total of 40,000 feature vector samples. The covariance matrix between each dimension of these feature vector samples is calculated and saved. In the online detection stage, the pre-stored covariance matrix and its inverse matrix are directly called to participate in the Mahalanobis distance calculation.

[0057] Optionally, before extracting the local multispectral feature vector, the pixel values ​​within the candidate defect region contour are normalized. The pixel values ​​of each spectral channel are linearly scaled to the range of 0 to 1, and the normalization parameters are statistically obtained from the entire original printed image. After calculating the Mahalanobis distance, the distance value is compared with a false defect judgment threshold. Candidate defect regions with values ​​less than the threshold are discarded and not included in subsequent output. It can be understood that Mahalanobis distance considers the correlation between the dimensions of the feature vector and, compared to Euclidean distance, more accurately measures the degree of difference between the local multispectral feature vector and the standard feature vector, effectively distinguishing between real defects and false defects caused by inherent texture variations in the printing substrate. It can also be understood that the coordinates of the remaining candidate defect regions after removing false defects are output in JSON format. Each coordinate record contains the polygon vertex sequence of the defect contour, the coordinates of the defect center point, and the parameters of the defect's bounding rectangle, facilitating downstream equipment to perform defect marking or removal operations based on the coordinate information.

[0058] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for intelligent detection of printing quality based on machine vision, characterized in that, Perform the following steps; Collect multispectral images of the printed matter to be inspected under a standardized light source as the original printed images; Perform pyramid decomposition on the original printed image to separate low-frequency illumination layers and high-frequency texture layers at multiple scales; Local phase consistency and local gradient orientation histograms are extracted from high-frequency texture layers at each scale and merged into a multi-scale feature tensor. The multi-scale feature tensor is input into a pre-trained Siamese neural network to calculate the structural similarity difference map between the original printed image and the standard template image; Adaptive threshold segmentation is performed on the structural similarity difference map to extract candidate defect regions, and the position coordinates of the candidate defect regions are output as printing quality detection results. 2.The machine vision-based printed quality intelligent detection method according to claim 1, characterized in that, The specific steps for acquiring multispectral images of the printed matter to be inspected under a standardized light source as the original printed image are as follows: Lay the printed material to be tested flat on the surface of a conveyor belt moving at a constant speed, with the printed surface facing the collection device; Multiple narrowband light sources with different center wavelengths are installed above the conveyor belt, and each narrowband light source is lit up sequentially in time. During the illumination of each narrowband light source, the area array camera is synchronously triggered to acquire monochrome images in the spectral channels; Monochrome images acquired from all spectral channels are stacked into a three-dimensional image cube in ascending order of spectral wavelength; Dark field correction and bright field correction are performed on the three-dimensional image cube to eliminate sensor background noise and light source non-uniformity; The corrected 3D image cube is used as the original printed image. 3.The machine vision-based printed quality intelligent detection method according to claim 2, characterized in that, The specific steps for performing pyramid decomposition on the original printed image to separate the low-frequency illumination layer and high-frequency texture layer at multiple scales are as follows: Gaussian pyramid downsampling is performed on each spectral channel in the original printed image to generate a multi-layer Gaussian pyramid for the spectral channels; Perform Laplacian convolution on each layer of the Gaussian pyramid image to extract the bandpass component of each layer; The bandpass component is used as a high-frequency texture layer at the corresponding scale; The top layer image of the Gaussian pyramid is upsampled and interpolated multiple times and then subtracted from the corresponding layer of the original Gaussian pyramid to extract the low-frequency illumination layer at each scale. The high-frequency texture layers with all spectral channels at the same scale are stitched together along the spectral dimension to form a multispectral high-frequency texture tensor. The low-frequency illuminance layers with all spectral channels at the same scale are spliced ​​along the spectral dimension to form a multispectral low-frequency illuminance tensor. 4.The machine vision-based printed quality intelligent detection method according to claim 3, characterized in that, The specific steps for extracting local phase consistency and local gradient orientation histograms from high-frequency texture layers at each scale and merging them into a multi-scale feature tensor are as follows: For each spatial location in the multispectral high-frequency texture tensor, calculate the logarithmic wave response of the spatial location in different directions; The local phase coherence value of each spatial location is calculated from the logarithmic wave response as the phase characteristic value of the spatial location; For each local image patch in the multispectral high-frequency texture tensor, calculate the gradient direction and gradient magnitude of each pixel within that local image patch; The gradient directions within each local image block are weighted according to a preset direction interval to generate a local gradient direction histogram vector. The phase feature value of each spatial location is concatenated with the local gradient direction histogram vector of the corresponding local image patch to form a joint feature vector. The joint feature vectors of all spatial locations are organized into a multi-scale feature tensor with the same spatial dimensions as the original printed image.

5. The machine vision-based printed quality intelligent detection method according to claim 4, characterized in that, The specific steps for inputting the multi-scale feature tensor into a pre-trained Siamese neural network to calculate the structural similarity difference map between the original printed image and the standard template image are as follows: Obtain a defect-free printed product of the same specifications as the printed product to be inspected as a standard sample, and perform the same preprocessing procedure as the original printed image on the standard sample to generate a standard multiscale feature tensor. The multi-scale feature tensor and the standard multi-scale feature tensor are respectively input into the two branch networks of the Siamese neural network; The two branches of the Siamese neural network output the first embedded feature vector of the multi-scale feature tensor and the second embedded feature vector of the standard multi-scale feature tensor, respectively. Calculate the cosine distance matrix between the first embedded feature vector and the second embedded feature vector; Apply a pointwise logarithmic transformation to each element of the cosine distance matrix to generate an initial difference response map; Median filtering is performed on the initial difference response map to suppress isolated noise points and generate the structural similarity difference map.

6. The intelligent printing quality detection method based on machine vision according to claim 5, characterized in that, The specific steps for performing adaptive threshold segmentation on the structural similarity difference map to extract candidate defect regions are as follows: Calculate the mean and standard deviation of all pixel values ​​on the structural similarity difference map; The result of adding a multiple of the standard deviation to the mean is used as the dynamic segmentation threshold; Traverse each pixel in the structural similarity difference map and mark pixels with pixel values ​​greater than the dynamic segmentation threshold as potential defect pixels; Perform a connected component labeling algorithm on all potentially defective pixels to obtain multiple disconnected connected components; Calculate the total number of pixels for each connected component and discard connected components whose total number of pixels is less than a preset area threshold; The smallest bounding rectangle of each remaining connected component after removing small area components is taken as the candidate defect region.

7. The intelligent printing quality detection method based on machine vision according to claim 6, characterized in that, After outputting the location coordinates of the candidate defect area as the printing quality inspection result, the specific steps for performing defect category identification are as follows: For each candidate defect region, a corresponding local image block is cropped from the original printed image; The local image patch is input into a pre-trained classification convolutional neural network; The classification convolutional neural network performs multiple convolution and pooling operations on the local image patch to extract depth feature maps; The deep feature map is mapped to probability distribution vectors of multiple defect categories through a fully connected layer; The category with the highest probability value is selected from the probability distribution vector as the defect category label for the candidate defect region; The defect category label of the candidate defect area is associated with the location coordinates and stored as the print quality inspection result.

8. The intelligent printing quality detection method based on machine vision according to claim 1, characterized in that, After outputting the position coordinates of the candidate defect region as the printing quality inspection result, the specific steps for performing defect region segmentation are as follows: A region growing algorithm is performed on the structural similarity difference map using the center point of each candidate defect region as the seed point. The region growing algorithm starts from the seed point and spreads to adjacent pixels, including pixels with continuously changing difference values ​​in the growing region; Growth stops when the difference between all adjacent pixels on the boundary of the growth region and the mean of the current region exceeds a preset tolerance threshold. The growth region obtained after growth stops is used as the segmentation contour of the candidate defect region. Perform a morphological closing operation on the segmented contour to fill the small holes inside the contour; The segmented contour coordinates after morphological closing operations are used as the updated candidate defect region location coordinates.

9. The intelligent printing quality detection method based on machine vision according to claim 1, characterized in that, After outputting the position coordinates of the candidate defect area as the printing quality inspection result, the specific steps for performing false defect filtering are as follows: Extract the local multispectral feature vector corresponding to each candidate defect region from the original printed image; Extract the local standard multispectral feature vectors at the same locations as each candidate defect region from the standard template image; Calculate the Mahalanobis distance between the local multispectral feature vector and the corresponding local standard multispectral feature vector for each candidate defect region; When the Mahalanobis distance is less than the preset false defect determination threshold, the candidate defect region is marked as a false defect and removed from the detection results; The coordinates of the remaining candidate defect areas after removing false defects are output as the final print quality inspection result.

10. A machine vision-based intelligent inspection system for printing quality, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the intelligent printing quality detection method based on machine vision as described in any one of claims 1 to 9.