Printed matter quality visual inspection system based on image features
Through regional texture modeling and feature point density control, the problem of missed detection and missed detection in the dense and sparse texture areas in the printed quality visual inspection system is solved, and the dynamic matching of the number of feature points and the texture density is achieved, which improves the accuracy and robustness of the detection system.
Patent Information
- Application Number
- CN202510599298.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-10
- Publication Date
- 2025-08-22
AI Technical Summary
The existing printed quality visual inspection system has insufficient extraction of feature points in dense and sparse textures, resulting in mis-checking and missed inspection problems, making it difficult to take into account high-density texture suppression and low-texture feature compensation, affecting detection accuracy and robustness.
By constructing a regionalized texture modeling process, dynamically match the number of feature points and the local texture density of image, the grayscale symbiosis matrix and feature point density control module are used to adaptively allocate the upper limit of feature points density, suppress excessive gathering of feature points in high-texture areas and enhance the defect perception ability of low-texture areas.
It effectively suppresses the error detection problem of high-texture areas, enhances the defect perception ability of low-texture areas, reduces the missed detection rate, improves the adaptability and intelligent judgment level of the detection system, and optimizes the processing efficiency.
Smart Images

Figure CN120525822A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual inspection of printed matter quality, and in particular to a visual inspection system for printed matter quality based on image features. Background Art
[0002] The image-feature-based visual inspection system for printed product quality is an industrial visual intelligence system used in printing production lines. It uses high-speed industrial cameras to capture images of printed product surfaces, and uses image processing algorithms to extract key image features (such as color distribution, edge clarity, pattern integrity, ink consistency, and overprint deviation). It then combines machine learning or deep learning models to perform real-time analysis and classification of the captured images, automatically identifying defects in the printing process such as missing prints, smudges, ghosting, blurring, color difference, and misalignment. The system offers functions such as online detection, defect marking, data tracking, and feedback control, enabling high-precision and efficient quality control without interrupting the production process. It is widely used in packaging printing, label printing, bill printing, and other scenarios, effectively replacing manual spot checks and improving the consistency of printed products and the intelligence level of production lines.
[0003] The existing technology has the following deficiencies:
[0004] In the prior art, when extracting key image features from a captured printed surface image, a uniformly set upper limit on the density of local feature points is usually used as a control parameter. This means that a fixed limit is imposed on the number of extractable feature points per unit area within the entire image, thereby suppressing feature redundancy caused by an excessive number of feature points in dense areas. However, this approach fails to make differentiated adjustments based on the texture density of different image regions, and presents the following technical problems: On the one hand, for areas with highly dense textures (such as anti-counterfeiting shading, silk patterns, microstructure backgrounds, etc.), the overall upper limit constraint is insufficient, and the excessive aggregation of local feature points cannot be effectively suppressed, which can easily cause the image processing algorithm to mistakenly identify normal texture features as quality defects such as cracks, dirt, or ghosting, thereby causing a large number of misjudgments. On the other hand, in areas with relatively sparse textures (such as large backgrounds, solid color blocks, etc.), the uniform density limit results in an additional lack of effective feature point support in areas with a relatively small number of feature points, making it difficult to identify low-contrast defects such as slight dirt, ink accumulation, and overprint offset, resulting in the risk of missed detection. In severe cases, printing defects may flow into subsequent processes or the final product, posing a potential product quality risk. Therefore, the overall density upper limit control mechanism lacks adaptability to local structural differences in the image, making it difficult to balance high-density texture suppression and low-texture feature compensation, which restricts the accuracy and robustness of the printed product visual quality inspection system.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0006] The purpose of the present invention is to provide a visual inspection system for printed product quality based on image features. By constructing a regionalized texture modeling process, a dynamic matching of the number of feature points and the local texture density of the image is achieved, effectively suppressing the problem of false detection caused by excessive clustering of feature points in high-texture areas, while enhancing the perception of subtle defects in low-texture areas and reducing the missed detection rate. By spatially balancing the distribution of feature points, not only is the feature expression integrity of the entire image improved, but the processing efficiency of subsequent defect detection and matching algorithms is also optimized, fundamentally improving the adaptability and intelligent judgment level of the visual inspection system under multiple types of printing structures, thereby solving the problems in the above-mentioned background technology.
[0007] In order to achieve the above-mentioned object, the present invention provides the following technical solutions: a printed product quality visual inspection system based on image features, comprising an image partitioning module, a grayscale standardization and discretization module, a grayscale co-occurrence matrix construction module, a co-occurrence matrix normalization module, a texture feature extraction module, a texture density analysis module, a feature point density control module, and a feature point extraction and fusion module;
[0008] The image partitioning module divides the entire printed image into grids according to a set area size (such as 64×64 pixels or 128×128 pixels) to form multiple sub-areas of equal area;
[0009] Grayscale normalization and discretization module converts each sub-region image into a grayscale image, eliminates the interference introduced by color channel differences, unifies the image data expression, and then discretizes the grayscale values. For example, it compresses 256 grayscale levels to 8 or 16 levels (equally spaced or based on clustering) to construct a limited grayscale set.
[0010] Gray-level co-occurrence matrix construction module: In each sub-region after gray-level discretization, a gray-level co-occurrence matrix (GLCM) is constructed based on the spatial co-occurrence relationship of pixel gray-level pairs. The gray-level co-occurrence matrix reflects the relative spatial distribution pattern between gray-level values (such as horizontal direction, 45° direction, etc.);
[0011] The co-occurrence matrix normalization module normalizes the gray-level co-occurrence matrix so that each element represents the relative frequency of the corresponding gray-level pair.
[0012] The texture feature extraction module extracts key texture statistics from the normalized gray-level co-occurrence matrix and organizes the texture statistics into a unified texture data vector as the texture feature representation of the sub-region, which is used to quantify the texture properties of each sub-region;
[0013] The texture density analysis module uses feature engineering methods to extract high-dimensional statistical features reflecting the texture density from the texture data vectors of each sub-region, conducts in-depth analysis of the extracted features, and quantifies the texture density of each sub-region based on the analyzed features;
[0014] The feature point density control module adaptively assigns different feature point density limits to each sub-region based on its texture density. When the texture density is high, the upper limit of the feature point number is reduced to suppress feature point redundancy; when the texture density is low, the upper limit of the feature point number is increased to enhance the coverage of subtle defects. This achieves a responsive match between the number of feature points and regional complexity, fundamentally improving the system's ability to control false detections / missed detections.
[0015] The feature point extraction and fusion module, after completing the upper limit allocation of feature point density, performs feature point extraction operations (such as SIFT, ORB, SURF and other algorithms) on a sub-region basis, filters, screens and retains the extraction results according to the feature point density upper limit set for each sub-region, and finally merges the valid feature point sets of all sub-regions to form a multi-resolution, structurally balanced and density-controllable feature point set for the entire image, which is used for subsequent quality defect detection, template matching or target recognition tasks.
[0016] Preferably, a fixed window sliding is used to divide the entire printed image into grids according to a set area size. The specific steps are as follows:
[0017] First, set the size of each sub-region (e.g., 64×64 pixels) and determine the step size of the sliding window (usually the same as the region size to achieve non-overlapping partitioning, or set smaller than the region size to achieve overlapping sampling);
[0018] Secondly, starting from the upper left corner of the image, the sub-region is intercepted by sliding the window horizontally with a step size until it reaches the right boundary of the image;
[0019] Then, the starting row coordinate is moved vertically and the horizontal scanning process is repeated until the entire image is traversed;
[0020] During the division process, a unique index number is assigned to each generated sub-region, and its spatial information such as the coordinates of the upper left corner, row and column position, etc. is recorded, eventually forming a structured image region grid composed of all sub-regions for subsequent texture analysis and feature extraction.
[0021] Preferably, in each sub-region after grayscale discretization, a grayscale co-occurrence matrix is constructed based on the spatial co-occurrence relationship of pixel grayscale pairs. The specific steps are as follows:
[0022] First, set the direction of the co-occurrence matrix (such as horizontal 0°, vertical 90°, diagonal 45° or 135°) and the pixel spacing (usually 1);
[0023] Secondly, all pixels in the sub-area are traversed, and in the specified direction and pixel spacing, the combination pairs of the current pixel grayscale value and the grayscale value of its adjacent pixels are counted, and the count of the combination pair at the corresponding position in the co-occurrence matrix is increased by 1; the traversal is continued until the entire area is completed, and the original grayscale co-occurrence matrix is generated.
[0024] Preferably, all elements in the matrix are normalized, that is, each element is divided by the total number of pixel pairs, so that each element represents the relative frequency of the grayscale pair appearing in the sub-region; finally, a normalized grayscale co-occurrence matrix is obtained, which is used to quantitatively describe the texture space structural characteristics of the sub-region.
[0025] Preferably, feature engineering methods are used to extract high-dimensional statistical features reflecting the texture density from the texture data vectors of each sub-region, wherein the extracted features include the cumulative frequency ratios of all grayscale transition pairs in the grayscale co-occurrence matrix. After in-depth analysis of the extracted features, a grayscale perturbation density index is generated, and the texture density of each sub-region is quantified based on the grayscale perturbation density index.
[0026] Preferably, the specific steps of generating the grayscale disturbance density index after performing in-depth analysis on the cumulative frequency proportions of all grayscale transition pairs in the grayscale co-occurrence matrix are as follows:
[0027] In the normalized gray-level co-occurrence matrix, we first define the gray-level transition threshold θ, filter all gray-level pairs that satisfy |ij|≥θ, and construct the transition subset P. (i,j) , where the jump subset P (i,j) The expression is:
[0028] P (i,j) ={(i,j)∣|ij|≥θ,i,j∈Q (i,j)}
[0029] , where: Q (i,j) represents the set of all discretized gray levels (such as 8 or 16 gray levels). The jump threshold θ is usually set to 1 / 4 of the discrete gray levels or adaptively adjusted according to the texture type. i represents the gray value of the current pixel (the gray level after discretization, for example, in the range of 0-7 or 0-15); j represents the gray value of the neighboring pixel of the current pixel in the specified direction and pixel spacing.
[0030] Next, the weighted response of the jump pairs is enhanced by the perturbation response function to improve the sensitivity of the high-amplitude grayscale pairs to the density judgment. The expression of the perturbation response function is:
[0031] R perturb (i, j) = tanh(λ·|ij| α )
[0032] , where: R perturb (i, j) is the perturbation enhancement weight generated by the pixel pair composed of grayscale value i and grayscale value j in the image, λ is the perturbation enhancement factor, which controls the steepness of the response curve, α is the nonlinear power coefficient, usually ranging from 1.2 to 2.5, which controls the sensitivity of the perturbation response function to the increase of grayscale difference, and the tanh function is used to compress the growth trend and retain the boundary gradient information;
[0033] After obtaining the jump subset and its corresponding disturbance enhancement weight, the grayscale disturbance density index of the sub-region is calculated. The calculation expression is as follows:
[0034]
[0035] , where: G pdi is the grayscale perturbation density index, and G(i, j) is the relative frequency of the grayscale pair G(i, j) in the normalized grayscale co-occurrence matrix.
[0036] Preferably, Ψ(i, j) is a position mapping weight function used to additionally regulate the degree of separation of the diagonal lines, and is defined as:
[0037]
[0038] , where: β is the mapping magnification coefficient, which controls the exponential magnification effect when away from the diagonal line, and L is the grayscale discrete level (such as L = 8), which is used for normalization.
[0039] Preferably, different upper thresholds of feature point density are adaptively assigned to each sub-region according to the texture density of the sub-region. The specific steps are as follows:
[0040] The grayscale disturbance density index calculated for all sub-regions is normalized so that its value is uniformly mapped to the interval [0, 1] to obtain the normalized disturbance density factor. The normalized expression is:
[0041]
[0042] , where: z Indicates the disturbance density factor of the z-th sub-region, ranging from [0, 1]. The larger the value, the denser the texture. min(G pdi )、max(Gpdi ) represent the minimum and maximum values of the grayscale disturbance density index of all sub-regions in the current image respectively; is the grayscale disturbance density index of the z-th sub-region;
[0043] According to the normalized perturbation intensity factor Γ z Construct the feature point density adjustment factor, and the constructed expression is as follows:
[0044]
[0045] , where: Φ z is the feature point density adjustment factor of the zth sub-region. The larger the value, the more feature points are allowed to be extracted. τ is the upper limit of the maximum feature point density (such as the maximum number of feature points allowed to be extracted in each sub-region). δ is the control sensitivity coefficient, which controls the growth steepness of the tanh function. β x is a nonlinear enhancement exponent, usually ranging from 1.2 to 2, used to enhance the response suppression of high-density areas; the tanh function is used to ensure that the regulation output is continuous, smooth, and bounded;
[0046] Adjust the factor Φ according to the density of feature points z Set the upper limit of feature point extraction for the z-th sub-region. The expression is:
[0047]
[0048] , where: N z The upper limit of feature points that can be extracted from sub-region z is rounded down to the integer constraint. It is a rounding function to ensure that the result is the legal number of feature points.
[0049] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0050] By constructing a regionalized texture modeling process, this invention dynamically matches the number of feature points with the local texture density of the image. This effectively suppresses false detections caused by excessive clustering of feature points in high-texture areas, while enhancing the perception of subtle defects in low-texture areas and reducing missed detection rates. By spatially balancing the distribution of feature points, this method not only improves the integrity of the feature representation of the entire image but also optimizes the processing efficiency of subsequent defect detection and matching algorithms. This fundamentally enhances the adaptability and intelligent judgment capabilities of the visual inspection system for various types of printed structures, demonstrating its high versatility and engineering application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0052] Figure 1 The figure is a module diagram of a printed matter quality visual inspection system based on image features of the present invention. DETAILED DESCRIPTION
[0053] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0054] The present invention provides Figure 1 The printed product quality visual inspection system shown in the figure based on image features includes an image partitioning module, a region indexing and management module, a grayscale normalization and discretization module, a grayscale co-occurrence matrix construction module, a co-occurrence matrix normalization module, a texture feature extraction module, a texture density analysis module, a feature point density control module, and a feature point extraction and fusion module;
[0055] The image partitioning module divides the entire printed image into grids according to a set area size (such as 64×64 pixels or 128×128 pixels) to form multiple sub-areas of equal area;
[0056] The region index and management module assigns a unique index number to each sub-region and records its spatial information in the original image (upper left corner coordinates, row and column indexes, etc.), thus building a unified region management matrix.
[0057] Use fixed window sliding to divide the entire printed image into grids according to the set area size. The specific steps are as follows:
[0058] First, set the size of each sub-region (e.g., 64×64 pixels) and determine the step size of the sliding window (usually the same as the region size to achieve non-overlapping partitioning, or set smaller than the region size to achieve overlapping sampling);
[0059] Secondly, starting from the upper left corner of the image, the sub-region is intercepted by sliding the window horizontally with a step size until it reaches the right boundary of the image;
[0060] Then the starting row coordinate is moved vertically and the above horizontal scanning process is repeated until the entire image is traversed.
[0061] During the division process, a unique index number is assigned to each generated sub-region, and its spatial information such as the coordinates of the upper left corner, row and column position, etc. is recorded, eventually forming a structured image region grid composed of all sub-regions for subsequent texture analysis and feature extraction.
[0062] This step realizes the structured segmentation of the image and provides the basic data unit for the subsequent local feature perception and adaptive control.
[0063] Grayscale normalization and discretization module converts each sub-region image into a grayscale image, eliminates the interference introduced by color channel differences, unifies the image data expression, and then discretizes the grayscale values. For example, it compresses 256 grayscale levels to 8 or 16 levels (equally spaced or based on clustering) to construct a limited grayscale set.
[0064] Grayscale conversion improves the focus of texture information, while discretization reduces computational complexity and enhances the stability of texture statistics, avoiding feature distortion caused by local illumination disturbances or pixel noise.
[0065] Gray-level co-occurrence matrix construction module: In each sub-region after gray-level discretization, a gray-level co-occurrence matrix (GLCM) is constructed based on the spatial co-occurrence relationship of pixel gray-level pairs. The gray-level co-occurrence matrix reflects the relative spatial distribution pattern between gray-level values (such as horizontal direction, 45° direction, etc.);
[0066] The co-occurrence matrix normalization module normalizes the gray-level co-occurrence matrix so that each element represents the relative frequency of the corresponding gray-level pair.
[0067] In each sub-region after grayscale discretization, the grayscale co-occurrence matrix is constructed based on the spatial co-occurrence relationship of pixel grayscale pairs. The specific steps are as follows:
[0068] First, set the direction of the co-occurrence matrix (such as horizontal 0°, vertical 90°, diagonal 45° or 135°) and the pixel spacing (usually 1);
[0069] Secondly, all pixels in the sub-region are traversed, and in the specified direction and pixel spacing, the grayscale value of the current pixel and its adjacent pixel grayscale value are counted, and the count of the corresponding position of the combination pair in the co-occurrence matrix is increased by 1; the traversal is continued until the entire region is completed, and the original grayscale co-occurrence matrix is generated;
[0070] Next, all elements in the matrix are normalized, that is, each element is divided by the total number of pixel pairs, so that each element represents the relative frequency of the grayscale pair in the sub-region; finally, the normalized grayscale co-occurrence matrix is obtained, which is used to quantitatively describe the texture spatial structure characteristics of the sub-region.
[0071] This process realizes the structural mapping from local grayscale spatial relations to texture statistics, providing a data basis for subsequent texture feature extraction.
[0072] The co-occurrence matrix can effectively characterize the texture structure characteristics of an image region, such as directionality, repeatability, roughness, etc. Normalization ensures the comparability of features between different regions and serves as the standardized basis for the subsequent extraction of texture statistics.
[0073] The texture feature extraction module extracts key texture statistics from the normalized gray-level co-occurrence matrix and organizes the texture statistics into a unified texture data vector as the texture feature representation of the sub-region, which is used to quantify the texture properties of each sub-region;
[0074] Key texture statistics, such as contrast, energy, homogeneity, entropy, etc., the role of this step is to convert the local texture structure information contained in the normalized grayscale co-occurrence matrix into a numerical texture feature vector that is quantifiable, comparable, and can be used for subsequent analysis, so as to achieve accurate characterization of the texture properties of each sub-region. By extracting key statistics such as contrast, energy, homogeneity, and entropy from the co-occurrence matrix, the physical meanings such as the intensity of grayscale changes in the region, the degree of texture repetition, the concentration and complexity of grayscale distribution can be respectively characterized. Using the vector composed of these statistics as the texture feature of the sub-region can not only achieve the quantification of the differences in texture structures in different regions, but also provide a standardized and structured data basis for subsequent intelligent decision-making such as texture density analysis and adaptive control of feature point density.
[0075] The texture density analysis module uses feature engineering methods to extract high-dimensional statistical features reflecting the texture density from the texture data vectors of each sub-region, conducts in-depth analysis of the extracted features, and quantifies the texture density of each sub-region based on the analyzed features;
[0076] Feature engineering methods are used to extract high-dimensional statistical features reflecting the texture density from the texture data vectors of each sub-region. The extracted features include the cumulative frequency ratios of all grayscale transition pairs in the grayscale co-occurrence matrix. After in-depth analysis of the extracted features, a grayscale perturbation density index is generated. The texture density of each sub-region is quantified based on the grayscale perturbation density index.
[0077] The higher the cumulative frequency ratio of all grayscale transition pairs (i.e., pairs with large grayscale differences) in the grayscale co-occurrence matrix, the higher the texture density of the subregion. This is because grayscale transition pairs reflect the intensity of grayscale value changes between adjacent pixels in the image. When a region contains a large number of small and frequent structures such as alternating light and dark, edge texture, and detail disturbances, the grayscale differences between adjacent pixels are more likely to deviate from the main diagonal, exhibiting a high grayscale transition trend. In the grayscale co-occurrence matrix, the locations corresponding to these transition pairs accumulate more frequencies, forming a significant response in areas far from the diagonal. Therefore, the concentration of transition pair frequencies reflects the characteristics of strong grayscale disturbances, complex structures, and dense details within the region, and is an important indicator for identifying highly textured areas.
[0078] The specific steps for generating the grayscale disturbance density index after in-depth analysis of the cumulative frequency ratios of all grayscale transition pairs in the grayscale co-occurrence matrix are as follows:
[0079] In the normalized gray-level co-occurrence matrix, we first define the gray-level transition threshold θ, filter all gray-level pairs that satisfy |ij|≥θ, and construct the transition subset P. (i,j) , where the jump subset P (i,j) The expression is:
[0080] P (i,j) ={(i,j)∣|ij|≥θ,i,j∈Q (i,j)}
[0081] , where: Q (i,j) represents the set of all discretized gray levels (such as 8 or 16 gray levels). The jump threshold θ is usually set to 1 / 4 of the discrete gray levels or adaptively adjusted according to the texture type. i represents the gray value of the current pixel (the gray level after discretization, for example, in the range of 0-7 or 0-15); j represents the gray value of the neighboring pixel of the current pixel in the specified direction and pixel spacing.
[0082] Next, the weighted response of the jump pairs is enhanced by the perturbation response function to improve the sensitivity of the high-amplitude grayscale pairs to the density judgment. The expression of the perturbation response function is:
[0083] R perturb (i, j) = tanh(λ·|ij| α )
[0084] , where: R perturb(i, j) is the perturbation enhancement weight generated by the pixel pair composed of grayscale value i and grayscale value j in the image, λ is the perturbation enhancement factor, which controls the steepness of the response curve, α is the nonlinear power coefficient, usually ranging from 1.2 to 2.5, which controls the sensitivity of the perturbation response function to the increase of grayscale difference, and the tanh function is used to compress the growth trend and retain the boundary gradient information;
[0085] The purpose of this step is to perform structured extraction of pixel pairs in the high grayscale jump area in the co-occurrence matrix and apply amplitude enhancement to make the impact of grayscale disturbance more significant and directionally sensitive, providing a high-response feature set for the subsequent construction of grayscale disturbance density index.
[0086] After obtaining the jump subset and its corresponding disturbance enhancement weight, the grayscale disturbance density index of the sub-region is calculated. The calculation expression is as follows:
[0087]
[0088] , where: G pdi is the grayscale perturbation density index, G(i, j) is the relative frequency of the grayscale pair (i, j) in the normalized grayscale co-occurrence matrix; Ψ(i, j) is the position mapping weight function, which is used to additionally control the degree of distance between diagonals and is defined as:
[0089]
[0090] , where: β is the mapping magnification coefficient, which controls the exponential magnification effect when away from the diagonal line, and L is the grayscale discrete level (such as L = 8), which is used for normalization.
[0091] The purpose of this step is to fuse the frequency, jump amplitude and spatial offset characteristics to construct a weighted disturbance response, and quantify the regional texture disturbance density through multi-factor nonlinear coupling, providing a complexity measurement mechanism that is highly sensitive to grayscale fluctuations and resistant to misjudgment of smooth areas.
[0092] The grayscale perturbation density index (GPDDI), generated by performing a deep analysis of the cumulative frequency ratio of all grayscale transition pairs in the grayscale co-occurrence matrix, indicates that the larger the GPDDI value, the higher the texture density of the sub-region; conversely, the lower the texture density of the sub-region. The reason is that the GPDDI is calculated by analyzing the cumulative frequency of all grayscale transition pairs (i.e., pixel pairs with large grayscale differences) in the GPD matrix and combining their perturbation amplitude weights. A high frequency and large amplitude of transition pairs indicate that the pixel grayscale in the region has drastic changes, complex edge details, and rich directional changes, which is a typical high-frequency texture region. Conversely, if the GPD matrix is mainly concentrated near the diagonal, that is, the grayscale transitions are small, the grayscale distribution within the region is stable and the texture structure is simple, which is a low-density texture region. Therefore, a larger GPDDI value indicates that the grayscale perturbation in the unit region is stronger, the structure is more complex, and the texture density is also higher. It is a quantitative measurement indicator that combines energy enhancement and statistical distribution.
[0093] The feature point density control module adaptively assigns different feature point density limits to each sub-region based on its texture density. When the texture density is high, the upper limit of the feature point number is reduced to suppress feature point redundancy; when the texture density is low, the upper limit of the feature point number is increased to enhance the coverage of subtle defects. This achieves a responsive match between the number of feature points and regional complexity, fundamentally improving the system's ability to control false detections / missed detections.
[0094] According to the texture density of each sub-region, a different upper threshold of feature point density is adaptively assigned to the sub-region. The specific steps are as follows:
[0095] The grayscale disturbance density index calculated for all sub-regions is normalized so that its value is uniformly mapped to the interval [0, 1] to obtain the normalized disturbance density factor. The normalized expression is:
[0096]
[0097] , where: z Indicates the disturbance density factor of the z-th sub-region, ranging from [0, 1]. The larger the value, the denser the texture. min(G pdi )、max(G pdi ) represent the minimum and maximum values of the grayscale disturbance density index of all sub-regions in the current image respectively; is the grayscale disturbance density index of the z-th sub-region;
[0098] This normalization process makes the texture density of each sub-region have relative reference significance, establishes a standardized basis for subsequent dynamic regulation, and avoids the influence of the regulation accuracy due to the large span of the grayscale perturbation density index value.
[0099] According to the normalized perturbation intensity factor Γ z Construct the feature point density adjustment factor, and the constructed expression is as follows:
[0100]
[0101] , where: Φ z is the feature point density adjustment factor of the zth sub-region. The larger the value, the more feature points are allowed to be extracted. η is the upper limit of the maximum feature point density (such as the maximum number of feature points allowed to be extracted in each sub-region). δ is the control sensitivity coefficient, which controls the growth steepness of the tanh function. β x is a nonlinear enhancement exponent, usually ranging from 1.2 to 2, used to enhance the response suppression of high-density areas; the tanh function is used to ensure that the regulation output is continuous, smooth, and bounded;
[0102] This function reflects the "suppression mechanism" of dense areas: when the disturbance density factor approaches 1, the feature point density adjustment factor approaches 0, indicating that fewer feature points should be extracted from high-texture areas; conversely, when the disturbance density factor approaches 0, the feature point density adjustment factor approaches the upper limit of the maximum feature point density, giving low-texture areas a higher feature point coverage capability and achieving nonlinear modulation and suppression.
[0103] Adjust the factor Φ according to the density of feature points z Set the upper limit of feature point extraction for the z-th sub-region. The expression is:
[0104]
[0105] , where: N z The upper limit of feature points that can be extracted from sub-region z is rounded down to the integer constraint. It is a rounding function to ensure that the result is the number of legal feature points;
[0106] In the subsequent feature point extraction process (such as using SIFT, ORB and other algorithms), the extraction results are screened and retained according to the upper limit of the feature points of each sub-region, that is: if the actual number of extracted features exceeds the upper limit, the top N features are retained according to the response value. z feature points; through this step, the density control mechanism is implemented specifically at the feature point level, realizing the "texture-driven adaptive allocation of feature points", which improves the structural balance of the overall feature point distribution of the image, matching stability and defect detection sensitivity.
[0107] This step aims to establish a dynamic control mechanism for the number of feature points based on local texture perception, fundamentally addressing core issues in traditional image processing methods, such as false detection and missed detection, caused by fixed feature point density and uneven distribution. In actual printed image inspection, the texture structure of an image region often exhibits heterogeneity, resulting in significant differences in grayscale perturbations, high-frequency texture density, or low-frequency color block smoothness between subregions. Using a uniform upper limit for feature point density would be unable to adapt to this variation in texture complexity between regions. High-frequency texture regions are prone to feature point accumulation redundancy, causing the system to mistakenly report normal texture as defects. Meanwhile, in low-frequency regions, insufficient feature points may fail to cover true defects that are faint or have blurred edges, leading to the risk of missed detection. By introducing a texture representation metric called the grayscale perturbation density index and using it as a basis for adaptively adjusting the upper limit for feature point density in each subregion, this mechanism can adjust detection sensitivity and computational load in real time based on the image's structural complexity. In areas with dense textures, by lowering the upper limit of the number of feature points and compressing invalid or redundant feature responses, false detections are suppressed, while improving the processing efficiency of subsequent matching and classification modules. In areas with sparse textures, by appropriately raising the upper limit of feature point extraction, the perception of low-contrast, small-size or edge-blurred defects is enhanced, thereby improving the overall detection coverage and robustness of the system. In addition, this strategy also enhances the balance of the spatial distribution of image feature points, avoiding the concentration of feature points in specific structural areas, which causes matching failures or discrimination offsets. Overall, this step not only achieves the optimal scheduling of feature point resources within the region, but also deeply couples texture structure with feature extraction, enabling the visual inspection system to have intelligent response capabilities for complex image structures, significantly improving the system's generalization capabilities, anomaly positioning capabilities, and detection stability in different types of printed products, and is an important key link in achieving refined and highly reliable image quality inspection.
[0108] The feature point extraction and fusion module, after completing the upper limit of feature point density, performs feature point extraction operations (such as SIFT, ORB, SURF, etc.) on each sub-region one by one, filters, selects and retains the extraction results according to the feature point density upper limit set for each sub-region, and finally merges the valid feature point sets of all sub-regions to form a multi-resolution, structurally balanced, and density-controlled feature point set for the entire image, which is used for subsequent quality defect detection, template matching or target recognition tasks;
[0109] This step implements the previously implemented feature point density upper limit allocation strategy based on texture density into the actual feature point extraction process, ensuring that the number of feature points extracted from each subregion of the image strictly corresponds to its local structural complexity, thereby achieving adaptive and balanced spatial allocation of feature information. By independently executing feature extraction algorithms such as SIFT, ORB, or SURF within each subregion and combining them with a preset upper limit on the number of feature points, the extracted results are systematically screened and cropped. This effectively suppresses feature point redundancy in texture-dense areas, avoiding mismatches and feature masking caused by excessive feature point aggregation. It also enhances feature coverage in texture-sparse areas, improving the recognition of weak structures and fuzzy boundary defects. Finally, the filtered feature point sets from each subregion are merged into a unified feature point set for the entire image, constructing a high-quality feature representation framework with multi-resolution expressiveness, structural balance, and density adaptability. This provides a stable, reasonably distributed, and information-density-optimized feature foundation for subsequent tasks such as quality defect detection, template matching, pattern comparison, or target recognition, ultimately improving system processing efficiency, recognition accuracy, and robustness under complex image structures.
[0110] The above-mentioned visual inspection scheme for printed product quality based on local texture perception and density adaptive control mechanism can significantly improve the system's detection accuracy and robustness when processing images with uneven texture structure complexity. This scheme achieves dynamic matching of the number of feature points and the local texture density of the image by constructing a regionalized texture modeling process, effectively suppressing the false detection problem caused by excessive clustering of feature points in high-texture areas, while enhancing the perception of subtle defects in low-texture areas and reducing the missed detection rate. Through the spatially balanced control of the distribution of feature points, not only the integrity of the feature expression of the entire image is improved, but also the processing efficiency of the subsequent defect detection and matching algorithms is optimized, fundamentally improving the adaptability and intelligent judgment level of the visual inspection system under multiple types of printed structures, and has strong versatility and engineering promotion value.
[0111] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0112] The above description is merely illustrative of certain exemplary embodiments of the present invention. It goes without saying that those skilled in the art will be able to modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the scope of protection of the claims.
[0113] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0114] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection of some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0119] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A visual inspection system for printed matter quality based on image features, characterized in that: It includes image partition module, grayscale standardization and discretization module, grayscale co-occurrence matrix construction module, co-occurrence matrix normalization module, texture feature extraction module, texture density analysis module, feature point density control module, feature point extraction and fusion module; The image partitioning module divides the entire printed image into grids according to the set area size to form multiple sub-areas of equal area; Grayscale standardization and discretization module converts each sub-region image into a grayscale image, unifies the image data expression, and then discretizes the grayscale value to construct a limited grayscale level set; The gray-level co-occurrence matrix construction module constructs a gray-level co-occurrence matrix based on the spatial co-occurrence relationship of pixel gray-level pairs in each sub-region after gray-level discretization, and reflects the relative spatial distribution pattern between gray-level values through the gray-level co-occurrence matrix; The co-occurrence matrix normalization module normalizes the gray-level co-occurrence matrix so that each element represents the relative frequency of the corresponding gray-level pair. The texture feature extraction module extracts key texture statistics from the normalized gray-level co-occurrence matrix and organizes the texture statistics into a unified texture data vector as the texture feature representation of the sub-region, which is used to quantify the texture properties of each sub-region; The texture density analysis module uses feature engineering methods to extract high-dimensional statistical features reflecting the texture density from the texture data vectors of each sub-region, conducts in-depth analysis of the extracted features, and quantifies the texture density of each sub-region based on the analyzed features; Feature point density control module, which adaptively assigns different feature point density upper limits to each sub-region according to the texture density of the sub-region; The feature point extraction and fusion module, after completing the upper limit allocation of feature point density, performs feature point extraction operations on each sub-region one by one, merges the valid feature point sets of all sub-regions, and forms the feature point set of the entire image.
2. The printed matter quality visual inspection system based on image features according to claim 1, characterized in that: Use fixed window sliding to divide the entire printed image into grids according to the set area size. The specific steps are as follows: Set the size of each sub-region and determine the step size of the sliding window; Starting from the upper left corner of the printed image, the sub-region is cut out by sliding the window horizontally with a step size until it reaches the right boundary of the image; Move the starting row coordinate in the vertical direction and repeat the above horizontal scanning process until the entire printed image is traversed; During the division process, each generated sub-region is assigned a unique index number and its spatial information is recorded, ultimately forming a structured image region grid consisting of all sub-regions.
3. The printed matter quality visual inspection system based on image features according to claim 1, characterized in that: In each sub-region after grayscale discretization, the grayscale co-occurrence matrix is constructed based on the spatial co-occurrence relationship of pixel grayscale pairs. The specific steps are as follows: Set the direction and pixel spacing of the co-occurrence matrix; Traverse all pixels in the sub-region and count the combination pairs of the current pixel grayscale value and its adjacent pixel grayscale values in the specified direction and pixel spacing, and add 1 to the count of the combination pair at the corresponding position in the co-occurrence matrix; All pixels are traversed until the entire area is completed to generate the original gray-level co-occurrence matrix.
4. The printed matter quality visual inspection system based on image features according to claim 1, characterized in that: All elements in the matrix are normalized, that is, each element is divided by the total number of pixel pairs, so that each element represents the relative frequency of the grayscale pair in the sub-region; finally, the normalized grayscale co-occurrence matrix is obtained, which is used to quantitatively describe the texture spatial structure characteristics of the sub-region.
5. The printed matter quality visual inspection system based on image features according to claim 1, characterized in that: Feature engineering methods are used to extract high-dimensional statistical features reflecting the texture density from the texture data vectors of each sub-region. The extracted features include the cumulative frequency ratios of all grayscale transition pairs in the grayscale co-occurrence matrix. After in-depth analysis of the extracted features, a grayscale perturbation density index is generated. The texture density of each sub-region is quantified based on the grayscale perturbation density index.
6. The printed matter quality visual inspection system based on image features according to claim 5, characterized in that: The specific steps for generating the grayscale disturbance density index after in-depth analysis of the cumulative frequency ratios of all grayscale transition pairs in the grayscale co-occurrence matrix are as follows: In the normalized gray-level co-occurrence matrix, we first define the gray-level transition threshold θ, filter all gray-level pairs that satisfy |ij|≥θ, and construct the transition subset P. (i,j) , where the jump subset P (i,j) The expression is: P (i,j) ={(i,j)∣|ij|≥θ,i,j∈Q (i,j) }, where: Q (i,j) Represents the set of all discretized gray levels, i represents the gray value of the current pixel; j represents the gray value of the adjacent pixels of the current pixel in the specified direction and pixel spacing; The perturbation response function is used to enhance the weight response of the jump pair to improve the sensitivity of the high-amplitude grayscale pair to the density judgment. The expression of the perturbation response function is: R perturb (i, j) = tanh(λ·|ij| α ), where: R perturb (i, j) is the perturbation enhancement weight generated by the pixel pair composed of grayscale value i and grayscale value j in the image, λ is the perturbation enhancement factor, which controls the steepness of the response curve, α is the nonlinear power coefficient, and the tanh function is used to compress the growth trend and retain the boundary gradient information; After obtaining the jump subset and its corresponding disturbance enhancement weight, the grayscale disturbance density index of the sub-region is calculated. The calculation expression is as follows: , where: G pdi is the grayscale perturbation density index, and G(i, j) is the relative frequency of the grayscale pair (i, j) in the normalized grayscale co-occurrence matrix.
7. The printed matter quality visual inspection system based on image features according to claim 6, characterized in that: Ψ(i, j) is the position mapping weight function, which is used to additionally control the degree of distance between diagonals and is defined as: , where: β is the mapping magnification coefficient, which controls the exponential magnification effect when away from the diagonal line, and L is the grayscale discrete level, which is used for normalization.
8. The printed matter quality visual inspection system based on image features according to claim 6, characterized in that: According to the texture density of each sub-region, a different upper threshold of feature point density is adaptively assigned to the sub-region. The specific steps are as follows: The grayscale disturbance density index calculated for all sub-regions is normalized so that its value is uniformly mapped to the interval [0, 1] to obtain the normalized disturbance density factor. The normalized expression is: , where: z Indicates the disturbance intensity factor of the z-th sub-region, ranging from [0, 1]; min(G pdi )、max(G pdi ) represent the minimum and maximum values of the grayscale disturbance density index of all sub-regions in the current image respectively; is the grayscale disturbance density index of the z-th sub-region; According to the normalized perturbation intensity factor Γ z Construct the feature point density adjustment factor, and the constructed expression is as follows: , where: Φ z is the feature point density adjustment factor of the zth sub-region; η is the upper limit of the maximum feature point density; δ is the control sensitivity coefficient, which controls the growth steepness of the tanh function; β x is a nonlinear enhancement index used to enhance the response suppression of high-density areas; the tanh function is used to ensure that the regulation output is continuous, smooth, and bounded; Adjust the factor Φ according to the density of feature points z Set the upper limit of feature point extraction for the z-th sub-region. The expression is: , where: N z The upper limit of feature points that can be extracted from sub-region z is rounded down to the integer constraint. It is a rounding function to ensure that the result is the number of legal feature points.
Citation Information
Cited By
Image enhancement method and system for aerospace part inspection
CN120746849A
An image enhancement method and system for aerospace and aviation part inspection
CN120746849B