Carton printing quality detection method based on industrial vision

By introducing intermodulation sideband energy ratio analysis into carton printing inspection, the problem of distinguishing between false stripes and genuine printed stripes was solved, achieving high-precision and stable carton printing quality inspection that can adapt to different machine speeds and batch variations.

CN121639666APending Publication Date: 2026-03-10LUJIANG ZHENGDA PACKAGING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511907669.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Traditional visual inspection algorithms struggle to distinguish between false stripes caused by the superposition of structural cycles and genuine printed stripes in carton printing, resulting in unstable inspection results, a high false judgment rate, and significant impact from variations in machine speed, batch size, and cardboard type.

Method used

By acquiring grayscale images of cardboard boxes, selecting regions of interest along the width, performing detrending and windowing processing, calculating the proportion of intermodulation sideband energy, and using preset thresholds to determine the printing quality of cardboard boxes, a stable distinction can be achieved between false stripes and real printed stripes.

Benefits of technology

It improves the stability and anti-interference of carton printing quality inspection, and realizes high-precision online real-time inspection, independent of changes in light and machine speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639666A_ABST
    Figure CN121639666A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of carton printing quality detection, and discloses a carton printing quality detection method based on industrial vision, which comprises the following steps: firstly, obtaining a carton gray scale image containing a machine direction and a width direction, and selecting a plurality of regions of interest extending along the machine direction along the width direction; and carrying out detrending and Hanning window weighting processing on the machine direction gray scale signal of each region to obtain a standard machine direction signal. Discrete Fourier transform is carried out on the standard signal to obtain a power spectrum, and an aggregation power spectrum is obtained through median aggregation. Determining a first dominant frequency and a second dominant frequency according to a peak screening condition, and calculating corresponding sum frequency and difference frequency positions; and performing energy integration in each frequency interval according to a preset bandwidth to obtain main frequency and side band energy, and then calculating an intermodulation side band energy ratio. And determining a judgment threshold value by utilizing the ratio mean value and the standard deviation of the qualified samples, comparing the intermodulation side band energy ratio of the carton to be detected with the threshold value, and finally outputting a qualified or unqualified detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cardboard box printing quality inspection technology, and more specifically, to a cardboard box printing quality inspection method based on industrial vision. Background Technology

[0002] Corrugated cardboard is widely used as the printing substrate for cartons, and its forming structure consists of top and bottom sheets and a corrugated core. To improve compressive strength, two layers of corrugated core with different specifications are often used to form a B / C or E / B double-layer structure. During flexographic direct printing, the periodic undulations on the cardboard surface cause uneven distribution of printing pressure, resulting in periodic changes in ink deposition and light reflectivity with flute pitch. The image captured by the camera thus appears as bright and dark bands along the paper feed direction. These bands vary significantly under different flute types, coated papers, or varnishing methods, and are a unique source of image interference in carton printing quality inspection. Traditional visual inspection algorithms are mostly based on spatial domain grayscale differences or two-dimensional spectral energy, but they struggle to reliably distinguish this complex structure.

[0003] When the camera samples at a fixed linear speed, a fixed ratio is formed between the geometric period of the cardboard and the camera sampling interval. Even minute speed deviations or synchronization errors can cause spatial frequency drift, resulting in the structural texture overlapping with the actual printed stripes in the frequency spectrum. Furthermore, factors such as the illumination angle, surface gloss, and ink thickness during the printing process cause multiplicative changes in reflection intensity, further amplifying the interaction between different periodic components. This results in a large number of stripe signals in the image that resemble visual process defects, leading to frequent threshold drift in the detection system and an increased false positive rate.

[0004] In double-corrugated cardboard, the two corrugated layers have different pitches. and The corresponding spatial frequency , When the thickness of the printed ink layer and the intensity of light change periodically with surface micro-deformation, the reflected signal contains both sets of frequency components. Since camera imaging follows a multiplicative model of light reflection, the product of the two periodic signals generates new sum and difference frequency components in the frequency domain. These additional components appear as new stripe patterns in the image, with their spatial period typically between the original B-flute and C-flute pitches, making them visually almost indistinguishable from real printed stripes.

[0005] These false bands, caused by the superposition of structural cycles, are not controlled by the actual changes in printing defects, but are highly similar to defect bands in image energy distribution, making them the most significant source of interference and technical challenge in carton printing quality inspection. Summary of the Invention

[0006] This invention provides a method for inspecting the printing quality of cardboard boxes based on industrial vision, which solves the technical problem of achieving stable differentiation between false stripes and real printed stripes caused by the superposition of structural cycles in cardboard printing scenarios with double corrugated structures, so that the inspection results remain consistent and reliable under different machine speeds, batches and cardboard types.

[0007] This invention provides a method for inspecting the printing quality of cardboard boxes based on industrial vision, comprising: Obtain a grayscale image of the carton, which includes the machine orientation and the width orientation; where the machine orientation is the direction in which the carton runs in the printing production line, and the width orientation is the direction perpendicular to the machine orientation; Select several regions of interest extending along the machine direction from the grayscale image along the radial direction; Detrending and windowing processes were performed on the azimuth signals of each region of interest to obtain standard azimuth signals. The power spectrum of the standard direction signal is estimated and aggregated to obtain the aggregated power spectrum. The first and second dominant frequencies are determined from the aggregated power spectrum based on preset peak screening conditions, and the positions of the sum frequency and difference frequency are calculated based on the first and second dominant frequencies. Based on the preset bandwidth, energy is integrated in the frequency ranges corresponding to the first main frequency, the second main frequency, the sum frequency, and the difference frequency, respectively, to obtain the total energy corresponding to the first main frequency, the second main frequency, the sum frequency, and the difference frequency, and then the energy ratio of the intermodulation side band is calculated. The judgment threshold is determined based on the proportion of intermodulation side energy of a pre-set qualified cardboard box sample; Acquire a grayscale image of the carton to be inspected, compare the intermodulation sideband energy ratio with the judgment threshold, and output the judgment result of whether it is qualified or unqualified.

[0008] The beneficial effects of this invention include: by introducing quantitative analysis of the intermodulation sideband energy ratio in carton printing inspection, a stable distinction is achieved between periodic textures caused by corrugated structures and genuine printing defects. This invention utilizes the frequency domain energy of grayscale images to separate false bands caused by structural superposition from process-related bands based on energy ratio, unaffected by machine speed, lighting, or batch variations, thereby significantly improving the consistency and anti-interference capability of the inspection. This invention achieves high-precision quality assessment relying solely on the image itself, possessing comprehensive advantages such as robust structure, simple algorithm, and online real-time application. Attached Figure Description

[0009] Figure 1 This is a flowchart of a cardboard box printing quality inspection method based on industrial vision according to the present invention. Detailed Implementation

[0010] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.

[0011] like Figure 1 As shown, a method for inspecting the printing quality of cardboard boxes based on industrial vision includes: Obtain a grayscale image of the carton, which includes the machine orientation and the width orientation; where the machine orientation is the direction in which the carton runs in the printing production line, and the width orientation is the direction perpendicular to the machine orientation; Select several regions of interest extending along the machine direction from the grayscale image along the radial direction; Detrending and windowing processes were performed on the azimuth signals of each region of interest to obtain standard azimuth signals. The power spectrum of the standard direction signal is estimated and aggregated to obtain the aggregated power spectrum. The first and second dominant frequencies are determined from the aggregated power spectrum based on preset peak screening conditions, and the positions of the sum frequency and difference frequency are calculated based on the first and second dominant frequencies. Based on the preset bandwidth, energy is integrated in the frequency ranges corresponding to the first main frequency, the second main frequency, the sum frequency, and the difference frequency, respectively, to obtain the total energy corresponding to the first main frequency, the second main frequency, the sum frequency, and the difference frequency, and then the energy ratio of the intermodulation side band is calculated. The judgment threshold is determined based on the proportion of intermodulation side energy of a pre-set qualified cardboard box sample; Acquire a grayscale image of the carton to be inspected, compare the intermodulation sideband energy ratio with the judgment threshold, and output the judgment result of whether it is qualified or unqualified.

[0012] In one embodiment of the present invention, selecting several regions of interest extending along the radial direction of a grayscale image includes: Obtain the radial and amplitude coordinates of the grayscale image; Set the number of regions of interest, the width of the horizontal safety boundary, and the width of the regions of interest; Determine the minimum, maximum, minimum, and maximum coordinates of the grayscale image, and ensure that the sum of twice the width of the radial safety boundary and the product of the radial width of the region of interest and the number of regions of interest does not exceed the difference between the maximum and minimum coordinates of the radial direction. Determine the central radial coordinates of each region of interest based on the maximum radial coordinate, the minimum radial coordinate, the radial safety boundary width, and the number of regions of interest, so that the regions of interest are evenly distributed in the radial direction; The machine direction coverage range of each region of interest is the entire area from the minimum machine direction coordinate to the maximum machine direction coordinate, and the radial coverage range is the area centered on the corresponding central radial coordinate with the radial width of the region of interest as the total width.

[0013] The machine direction coordinate of the grayscale image is an identifier for the pixel position along the running direction of the carton on the production line in the grayscale image. For example, the horizontal pixel numbers increase sequentially from left to right; the radial coordinate of the grayscale image is an identifier for the pixel position perpendicular to the machine direction in the grayscale image. For example, the vertical pixel numbers increase sequentially from top to bottom; the acquisition method of the machine direction coordinate and the radial coordinate of the grayscale image is to directly read the pixel dimension information of the grayscale image through the image acquisition software supporting the industrial camera. For example, for a grayscale image of 1920×1080 pixels, the range of the machine direction coordinate of the grayscale image is 0-1919, and the range of the radial coordinate of the grayscale image is 0-1079.

[0014] The number of regions of interest is the total number of narrow strip regions divided in the radial direction for subsequent signal analysis; the number of regions of interest needs to balance detection coverage and calculation efficiency. Detection coverage means that when the number of regions of interest is too small, it is easy to miss defects at different radial positions, and calculation efficiency means that when the number of regions of interest is too large, it will increase the data processing time; the recommended supplementary value for the number of regions of interest is 8 to 16. This value is based on the common sizes of the carton幅面. For example, for a carton with a width of 1 meter, if 8 regions of interest are selected, each region of interest can cover a width of about 12 cm, which can balance detection coverage and calculation efficiency.

[0015] The radial safety boundary width is the pixel width reserved at both ends of the grayscale image in the radial direction without dividing the regions of interest; the role of the radial safety boundary width is to avoid detection errors caused by imaging distortion of the industrial camera at the edges of the grayscale image (such as edge blurring, geometric stretching); the recommended supplementary value for the radial safety boundary width is 5% to 10% of the total pixel length of the grayscale image in the radial direction. For example, when the total number of pixels in the radial direction of the grayscale image is 1000, the radial safety boundary width is 50 to 100 pixels, and this value can adapt to the edge distortion range of most industrial cameras.

[0016] The radial width of a region of interest (ROI) is the pixel length of a single ROI in the radial direction. The radial width of the ROI must satisfy the condition that the sum of twice the radial safety boundary width and the ROI's radial width multiplied by the number of ROIs does not exceed the difference between the maximum and minimum radial coordinates of the grayscale image. The formula for calculating the radial width of the ROI is as follows: First, calculate the effective radial distribution range, which equals the maximum radial coordinate of the grayscale image minus the minimum radial coordinate, and then minus twice the radial safety boundary width. Second, calculate the radial width of the ROI, which equals the effective radial distribution range divided by the number of ROIs. The result is rounded to the nearest integer. If there is a remainder, it is evenly distributed among the first 1 to n ROIs to ensure that the sum of the radial widths of all ROIs does not exceed the effective radial distribution range.

[0017] The minimum coordinate of a grayscale image is the smallest pixel position identifier in the grayscale image along the radial direction; the minimum coordinate of a grayscale image is usually 0, where 0 represents the pixel number at the beginning of the grayscale image along the radial direction.

[0018] The maximum coordinate in the longitudinal direction of a grayscale image is the identifier of the maximum pixel position in the longitudinal direction of the grayscale image; the maximum coordinate in the longitudinal direction of a grayscale image is equal to the total number of pixels in the longitudinal direction of the grayscale image minus 1. For example, when the total number of pixels in the longitudinal direction of a grayscale image is 1000, the maximum coordinate in the longitudinal direction of the grayscale image is 999.

[0019] The minimum coordinate of the grayscale image is the smallest pixel position identifier in the grayscale image along the direction of the direction of the direction; the minimum coordinate of the grayscale image is usually 0, where 0 represents the pixel number at the beginning of the direction of the grayscale image.

[0020] The maximum coordinate of a grayscale image in the direction of rotation is the position of the largest pixel in the grayscale image in the direction of rotation. The maximum coordinate of a grayscale image in the direction of rotation is equal to the total number of pixels in the grayscale image in the direction of rotation minus 1. For example, when the total number of pixels in the grayscale image in the direction of rotation is 2000, the maximum coordinate of the grayscale image in the direction of rotation is 1999.

[0021] The center radial coordinates of each region of interest (ROI) are the center pixel positions of a single ROI in the radial direction. The purpose of these center radial coordinates is to accurately locate the extent of the ROI and ensure that each ROI is equidistant along the radial direction. The formula for calculating the center radial coordinates of each ROI is as follows: First, calculate the starting radial coordinates of the first ROI, which equals the minimum radial coordinate of the grayscale image plus the width of the radial safety boundary. Second, calculate the radial spacing between adjacent ROIs, which equals (maximum radial coordinate of the grayscale image minus the minimum radial coordinate of the grayscale image minus twice the width of the radial safety boundary) divided by (the number of ROIs minus one). Third, calculate the center radial coordinates of the first ROI, which equals the starting radial coordinate of the first ROI plus (the radial width of the ROI divided by two). Fourth, calculate the center radial coordinates of the nth ROI (where n ranges from 2 to the number of ROIs), which equals the center radial coordinates of the first ROI plus (n minus one) multiplied by the radial spacing between adjacent ROIs.

[0022] The directional coverage of a region of interest (ROI) is the pixel range of a single ROI in the directional direction. The specific range of the ROI's directional coverage is the entire area from the minimum directional coordinate of the grayscale image to the maximum directional coordinate of the grayscale image. The purpose of setting the ROI's directional coverage to this range is to ensure that grayscale signals in all directional directions are acquired and to avoid missing stripe defects in the directional direction.

[0023] The radial coverage of a region of interest (ROI) is the pixel range of a single ROI in the radial direction. The purpose of the radial coverage is to ensure the accurate positioning of ROIs and that there is no overlap or omission between them. The formula for calculating the radial coverage of an ROI is as follows: First, calculate the starting coordinates of the radial coverage of the ROI. The starting coordinates are equal to the center radial coordinates of the ROI minus (the radial width of the ROI divided by two). Second, calculate the ending coordinates of the radial coverage of the ROI. The ending coordinates are equal to the center radial coordinates of the ROI plus (the radial width of the ROI divided by two). Third, verification and fine-tuning: If the starting coordinates of the radial coverage of the ROI are less than (the minimum radial coordinates of the grayscale image plus the radial safety boundary width), or the ending coordinates of the radial coverage of the ROI are greater than (the maximum radial coordinates of the grayscale image minus the radial safety boundary width), then the center radial coordinates of the ROI need to be fine-tuned until the radial coverage of the ROI is within the valid range.

[0024] In one embodiment of the present invention, the homing signals of each region of interest are subjected to detrending and windowing processing to obtain standard homing signals, including: For each region of interest, the mean gray value of all radial pixels at the same azimuth position is calculated to obtain the azimuth signal of that region of interest; The linear trend corresponding to each machine direction signal is obtained by first-order polynomial least squares fitting. Subtract the corresponding linear trend from each direction signal to obtain the detrended direction signal; The standard directional signal is obtained by weighting each detrended directional signal using the Hanning window.

[0025] The orientation signal of the region of interest is a one-dimensional data sequence formed by arranging the average gray values ​​of all radial pixels at the same orientation position corresponding to all orientation positions within a single region of interest in order of orientation coordinates. Its length is equal to the total number of pixels in the orientation direction of the grayscale image, reflecting the grayscale change trend along the orientation of the region.

[0026] First-order polynomial least squares fitting is a mathematical method that constructs a first-order polynomial of the form y = ax + b (where x is the azimuth coordinate, y is the mean gray value of the fitted image, a is the slope, and b is the intercept). The goal is to minimize the sum of squared errors between the fitted value calculated by this polynomial and the mean gray value of each azimuth position in the azimuth signal, thereby extracting the linear gray-level trend in the azimuth signal. The calculation formula is as follows: First, let the azimuth coordinates of the azimuth signal be x1, x2, ..., x (n is the total number of azimuth pixels), and the corresponding mean gray values ​​be y1, y2, ..., y; Second, calculate the mean x, which is equal to the sum of the squared errors of all values ​​from x1 to x2. n The sum is divided by n; the third step is to calculate the mean of y, which is equal to the sum of all y1 to y2. n The first step is to divide the sum of all (xᵢ-x_mean)(yᵢ-y_mean) by n; the fourth step is to calculate the slope a, which is equal to the sum of all (xᵢ-x_mean)(yᵢ-y_mean) divided by the sum of all (xᵢ-x_mean)² (i from 1 to n); the fifth step is to calculate the intercept b, which is equal to the y_mean minus (a multiplied by the x_mean); the sixth step is to obtain the first-order polynomial y=a*x+b, which is the linear trend expression obtained by fitting.

[0027] The linear trend corresponding to each heading signal is a gray value sequence that describes the linear change of the heading signal along the heading coordinates, obtained by fitting a first-order polynomial least squares. The linear trend value of each heading position in the gray value sequence is equal to the calculation result of the fitted first-order polynomial under the heading coordinates, and is used to characterize the slow linear gray-level drift in the heading signal caused by uneven illumination, camera angle deviation, etc.

[0028] The detrended orientation signal is a one-dimensional data sequence formed by subtracting the linear trend value corresponding to each orientation position from the mean gray value of each orientation position in a single orientation signal. It is used to eliminate the interference of linear gray-level drift on subsequent spectrum analysis and retain the periodic gray-level changes in the orientation signal related to corrugated structure and printing defects. The calculation formula is: for each orientation position i in the orientation signal, the detrended orientation signal value is equal to the mean gray value yᵢ at that position minus the linear trend value at that position (i.e., the calculated value of the first-order polynomial at xᵢ is a*xᵢ+b).

[0029] The Hanning window is a smooth window function whose function value varies along the length of the signal as a cosine curve, with the function values ​​at both ends approaching 0 and the function value in the middle approaching 1. It is used to weight the detrended directional signal to suppress spectral leakage caused by signal truncation during the discrete Fourier transform. The calculation formula is as follows: Let the length of the detrended directional signal be N (i.e., the total number of directional pixels). The window function value of the Hanning window at the k-th position (k ranges from 0 to N-1) is equal to 0.5 minus (0.5 multiplied by cosine (2 multiplied by pi multiplied by k divided by (N-1))).

[0030] Weighted processing multiplies the signal value at each position in the detrended directional signal with the window function value of the corresponding position in the Hanning window, so that the amplitude at both ends of the signal is smoothly attenuated, avoiding abrupt changes at the signal truncation point.

[0031] The standard azimuth signal is a one-dimensional data sequence formed by weighting the detrended azimuth signal using the Hanning window. This sequence eliminates linear gray-scale drift and spectral leakage interference.

[0032] In one embodiment of the present invention, the standard homing signals are subjected to homing power spectrum estimation and aggregation processing to obtain an aggregated power spectrum, including: Perform a discrete Fourier transform on each standard machine direction signal to obtain the complex frequency domain response corresponding to each standard machine direction signal; Calculate the corresponding mechanical power spectrum for each complex frequency domain response; For each discrete frequency position, the values ​​of all mechanical power spectra at that discrete frequency position are collected, and the collected values ​​are aggregated using the median method to obtain the aggregated power spectrum.

[0033] The Discrete Fourier Transform (DFT) is a mathematical method that transforms each standard directional signal (one-dimensional data sequence) in the time domain into a complex data sequence in the frequency domain. Its purpose is to convert the signal's time-domain representation of directional position and grayscale values ​​into a frequency-domain representation of its complex response, thereby extracting the frequency components of the signal. The calculation formula is as follows: First, let the time-domain sequence of each standard directional signal be x0, x1, ..., x... ₋1(n is the signal length, i.e., the total number of machine-oriented pixels), the value range of frequency index k is 0 to n-1; the second step is to calculate the complex frequency domain response value X(k) for each frequency index k, X(k) is equal to the sum of all time domain values ​​x multiplied by [cosine (2 multiplied by pi multiplied by k multiplied by m divided by n) minus imaginary unit j multiplied by sine (2 multiplied by pi multiplied by k multiplied by m divided by n)] (m ranges from 0 to n-1); the third step is to traverse all frequency indices k to obtain the complete complex frequency domain response sequence.

[0034] The complex frequency domain response corresponding to each standard homing signal is a complex sequence that corresponds one-to-one with each standard homing signal, obtained by discrete Fourier transform. Each complex number contains a real part and an imaginary part, which respectively reflect the phase and amplitude information of the corresponding frequency component, and its length is the same as the length of each standard homing signal.

[0035] Each complex frequency domain response refers to the complex frequency domain response corresponding to each standard mechanical signal, that is, the complex sequence obtained after the discrete Fourier transform of a single standard mechanical signal.

[0036] The corresponding directional power spectrum is a one-dimensional data sequence that reflects the energy distribution of the signal at different frequency positions, calculated based on each complex frequency domain response. The value at each frequency position represents the energy intensity of that frequency component. The calculation formula is as follows: First, for each complex number X(k) in each complex frequency domain response, calculate its magnitude, which is equal to the square root of (the square of the real part of X(k) plus the square of the imaginary part of X(k)). Second, calculate the square of the complex magnitude. Third, divide the square of the magnitude by the length n of each standard directional signal to obtain the power value corresponding to the frequency index k. Fourth, traverse all frequency indices k and arrange the power values ​​corresponding to each frequency index in order to obtain the corresponding directional power spectrum.

[0037] Each discrete frequency position refers to a single position in the machine-directed power spectrum divided by the frequency index. Each position corresponds to a specific discrete frequency (the frequency value is equal to the frequency index divided by the signal length). All machine-directed power spectra have the same number of discrete frequency positions, and they correspond one-to-one.

[0038] The value of all directional power spectrum at this discrete frequency position refers to the set of power values ​​at the same frequency index as the current discrete frequency position in all corresponding directional power spectra. For example, if there are 8 standard directional signals, then this set contains 8 power values.

[0039] The median method is a statistical aggregation method for all mechanical power spectrum values ​​at a discrete frequency position. By selecting the median value of the numerical sequence as the aggregation result, it suppresses abnormal noise in individual mechanical power spectra (such as sudden power value changes caused by local contamination). Specifically, the first step is to arrange the values ​​of all mechanical power spectra at the discrete frequency position in ascending order to form an ordered sequence. The second step is to take the median value if the number of values ​​in the ordered sequence is odd, and take the median value at the middle position of the sequence if the number of values ​​in the ordered sequence is even.

[0040] Aggregation refers to the process of processing the values ​​of all mechanical power spectra at each discrete frequency position using the median method to obtain a single value representing the energy at that frequency position, and integrating the aggregation results of all discrete frequency positions into a unified spectrum.

[0041] The aggregated power spectrum is a one-dimensional data sequence formed by aggregating the values ​​of each discrete frequency position using the median method and arranging them in frequency index order. This spectrum integrates the frequency domain energy information of all standard directional signals and has stronger resistance to noise interference.

[0042] In one embodiment of the present invention, determining a first dominant frequency and a second dominant frequency from the aggregated power spectrum based on preset peak screening conditions, and calculating the positions of the sum frequency and difference frequency based on the first dominant frequency and the second dominant frequency, includes: Set a peak threshold factor, calculate the median of all values ​​in the aggregate power spectrum, and determine the energy threshold based on the peak threshold factor and the median. Screen the discrete frequency positions in the aggregated power spectrum whose values ​​are not lower than the energy threshold to form a candidate position set; Set a minimum interval parameter, which is a positive integer less than the length of the polymerization power spectrum; Select the discrete frequency position with the largest value from the candidate position set as the position corresponding to the first dominant frequency; Select the discrete frequency position corresponding to the first main frequency from the candidate position set, whose interval with the position corresponding to the first main frequency is not less than the minimum interval parameter and whose value is the largest, as the position corresponding to the second main frequency; Based on the length of the aggregate power spectrum, the positions corresponding to the first main frequency and the second main frequency are respectively converted into the first main frequency and the second main frequency; The discrete frequency resolution is calculated based on the length of the aggregated power spectrum. Based on the first main frequency, the second main frequency, and the discrete frequency resolution, the position of the discrete frequency corresponding to the difference frequency is determined by rounding. Based on the first main frequency, the second main frequency, and the discrete frequency resolution, the discrete frequency position corresponding to the sum frequency is determined by rounding and modulo operations; wherein, the modulo operation is used to limit the discrete frequency position corresponding to the sum frequency to the effective discrete frequency position range of the aggregated power spectrum.

[0043] The peak threshold factor is a coefficient used to multiply the median of all values ​​in the aggregate power spectrum to determine the energy threshold. Its purpose is to screen out potential peak positions above the noise level and avoid misjudging noise as the effective dominant frequency. The peak threshold factor has a value of 3-5.

[0044] The median of all values ​​in the aggregated power spectrum is the value at the middle position of the sequence after arranging the power values ​​at all discrete frequency positions in the aggregated power spectrum in ascending order (if the number of values ​​is odd, the exact middle value is taken; if it is even, the average of the two middle values ​​is taken). It is used to characterize the noise baseline level of the aggregated power spectrum.

[0045] The energy threshold is a power value threshold used to screen the effective peak positions in the polymerization power spectrum. Power values ​​below this threshold are considered noise, and those above the threshold are considered potential peaks. The calculation formula is: the energy threshold is equal to the median of all values ​​in the polymerization power spectrum multiplied by the peak threshold factor.

[0046] The candidate position set is a set of positions formed by filtering out all discrete frequency positions in the aggregated power spectrum whose power values ​​are not lower than the energy threshold. This set contains all potential effective dominant frequency positions.

[0047] The minimum interval parameter is a positive integer used to limit the minimum distance between the position corresponding to the first main frequency and the position corresponding to the second main frequency, thereby avoiding misjudging the side lobe position of the same main frequency as the position of the second main frequency; supplementary value suggestion: it is recommended to take a value of 5%-8% of the aggregate power spectrum length (based on the engineering experience that the main frequency interval of double corrugated B / C flute is usually 5%-8% of the spectrum length, to ensure the distinction between the two main frequencies).

[0048] The position corresponding to the first dominant frequency is the discrete frequency position with the largest power value in the aggregate power spectrum in the candidate position set. This position corresponds to the dominant frequency with the strongest energy in the double corrugated structure (usually the C-flute dominant frequency).

[0049] The position corresponding to the second dominant frequency is the candidate position set where the interval between the position corresponding to the first dominant frequency (i.e., the absolute value of the difference between the two positions) is not less than the minimum interval parameter, and the position corresponding to the discrete frequency position with the largest power value in the aggregate power spectrum is the position corresponding to the second strongest dominant frequency in the double corrugated structure (usually the B-flute dominant frequency).

[0050] The length of the aggregated power spectrum is the total number of discrete frequency positions in the aggregated power spectrum, which is equal to the length of the standard machine direction signal (i.e., the total number of pixels in the machine direction of the grayscale image).

[0051] The first dominant frequency is the actual frequency value converted from the position corresponding to the first dominant frequency, reflecting the spatial frequency of the strongest flute type (such as C flute) in the double corrugated structure; the calculation formula is: the first dominant frequency is equal to the position corresponding to the first dominant frequency divided by the length of the polymer power spectrum.

[0052] The second dominant frequency is the actual frequency value converted from the position corresponding to the second dominant frequency, reflecting the spatial frequency of the second strongest corrugated type (such as B-flute) in the double corrugated structure; the calculation formula is: the second dominant frequency is equal to the position corresponding to the second dominant frequency divided by the length of the polymerization power spectrum.

[0053] Discrete frequency resolution is the frequency interval between two adjacent discrete frequency positions in the aggregate power spectrum, used to convert frequency values ​​into corresponding discrete frequency positions; the calculation formula is: discrete frequency resolution equals 1 divided by the length of the aggregate power spectrum.

[0054] The discrete frequency position corresponding to the difference frequency is the discrete frequency position corresponding to the difference frequency (absolute value) between the first and second main frequencies of the double-corrugated circuit. The calculation formula is as follows: First, calculate the frequency value of the difference frequency, which is equal to the absolute value of the first main frequency minus the second main frequency; Second, calculate the initial discrete frequency position corresponding to the difference frequency, which is equal to the frequency value of the difference frequency divided by the discrete frequency resolution; Third, round the initial position to obtain the integer position, which is the discrete frequency position corresponding to the difference frequency.

[0055] The discrete frequency position corresponding to the sum frequency is the discrete frequency position corresponding to the sum of the first and second dominant frequencies of the double-corrugated power spectrum. Since the sum frequency may exceed the effective frequency range of the aggregated power spectrum, it needs to be limited by modulo operation. The calculation formula is as follows: First, calculate the frequency value of the sum frequency, which is equal to the first dominant frequency plus the second dominant frequency; Second, calculate the initial discrete frequency position corresponding to the sum frequency, which is equal to the frequency value of the sum frequency divided by the discrete frequency resolution; Third, round the initial position to obtain the integer position; Fourth, take the modulo of the length of the aggregated power spectrum with this integer position (i.e., the remainder when the integer position is divided by the length of the aggregated power spectrum) to obtain the discrete frequency position corresponding to the sum frequency.

[0056] The modulo operation is used to limit the initial integer position corresponding to the sum frequency to the effective discrete frequency range of the aggregate power spectrum (i.e., from 0 to the length of the aggregate power spectrum minus 1), so as to avoid the position being invalid due to the sum frequency exceeding the effective frequency range. The operation rule is: divide the integer position corresponding to the sum frequency by the length of the aggregate power spectrum, and take the remainder after the division operation as the final position.

[0057] In one embodiment of the present invention, based on a preset bandwidth, energy integration is performed within the frequency intervals corresponding to the first dominant frequency, the second dominant frequency, the sum frequency, and the difference frequency, respectively, to obtain the total energy corresponding to the first dominant frequency, the second dominant frequency, the sum frequency, and the difference frequency, including: Define the frequency bandwidth half-width; where the frequency bandwidth half-width is a positive integer; For the positions corresponding to the first main frequency, the second main frequency, the sum frequency, and the difference frequency, corresponding frequency intervals are determined respectively. Each frequency interval is centered on the corresponding position, and the interval between the discrete frequency position and the corresponding center position does not exceed half the bandwidth of the frequency band. At the same time, the discrete frequency position in the interval belongs to the effective discrete frequency position range of the aggregated power spectrum. The aggregated power spectrum values ​​in each frequency range are summed to obtain the total energy corresponding to the first dominant frequency, the total energy corresponding to the second dominant frequency, the total energy corresponding to the sum frequency, and the total energy corresponding to the difference frequency.

[0058] The frequency bandwidth half-width is a positive integer (unit: number of discrete frequency positions) used to determine the left and right extension range of each frequency interval. Its function is to cover the energy of the first dominant frequency, the second dominant frequency, the sum frequency, the difference frequency and their side lobes, so as to avoid energy omissions due to slight frequency position drift. The frequency bandwidth half-width is taken as 2%-3% of the aggregated power spectrum length (based on the engineering experience that the side lobes of the double corrugated dominant frequency are usually distributed in the range of ±2%-3% of the spectrum length at the center position, to ensure the integrity of the energy integration).

[0059] The corresponding frequency interval is a discrete frequency range constructed around the positions corresponding to the first dominant frequency, the second dominant frequency, the sum frequency, and the difference frequency. This range is used to limit the energy integration range, ensuring that only the energy of the target frequency and sidelobes is integrated. The calculation formula is as follows: First, determine the center position of the interval (i.e., the position corresponding to the first dominant frequency, the second dominant frequency, the sum frequency, and the difference frequency); Second, calculate the starting position of the interval, which is equal to the center position minus half the frequency bandwidth; Third, calculate the ending position of the interval, which is equal to the center position plus half the frequency bandwidth; Fourth, verification and adjustment: If the starting position is less than 0, adjust the starting position to 0; if the ending position is greater than (aggregate power spectrum length minus 1), adjust the ending position to (aggregate power spectrum length minus 1); the adjusted range from the starting position to the ending position is the corresponding frequency interval.

[0060] The effective discrete frequency position range of the aggregated power spectrum is all legal discrete frequency position intervals in the aggregated power spectrum, that is, the integer range from 0 to (aggregated power spectrum length minus 1). Positions outside this range have no corresponding power values ​​and must be excluded when determining the frequency interval.

[0061] The aggregated power spectrum value within each frequency interval refers to the set of power values ​​at all discrete frequency positions within the corresponding frequency interval in the aggregated power spectrum.

[0062] The total energy corresponding to the first dominant frequency is the sum of all the aggregate power spectrum values ​​within the frequency range corresponding to the first dominant frequency, reflecting the total energy intensity of the first dominant frequency and its sidelobes; the calculation formula is: the total energy corresponding to the first dominant frequency is equal to the sum of all the aggregate power spectrum values ​​from the start position to the end position within the frequency range corresponding to the first dominant frequency.

[0063] The total energy corresponding to the second dominant frequency is the sum of all the aggregate power spectrum values ​​within the frequency range corresponding to the second dominant frequency, reflecting the total energy intensity of the second dominant frequency and its sidelobes; the calculation formula is: the total energy corresponding to the second dominant frequency is equal to the sum of all the aggregate power spectrum values ​​from the start position to the end position within the frequency range corresponding to the second dominant frequency.

[0064] The total energy corresponding to the sum frequency is the sum of all the aggregate power spectrum values ​​within the frequency interval corresponding to the sum frequency, reflecting the total energy intensity of the sum frequency and its sidelobes; the calculation formula is: the total energy corresponding to the sum frequency is equal to the sum of all the aggregate power spectrum values ​​from the start position to the end position within the frequency interval corresponding to the sum frequency.

[0065] The total energy corresponding to the difference frequency is the sum of all the aggregate power spectrum values ​​within the frequency range corresponding to the difference frequency, reflecting the total energy intensity of the difference frequency and its side lobes; the calculation formula is: the total energy corresponding to the difference frequency is equal to the sum of all the aggregate power spectrum values ​​from the start position to the end position within the frequency range corresponding to the difference frequency.

[0066] In one embodiment of the present invention, calculating the intermodulation side band energy ratio includes: Add the total energy corresponding to the sum frequency to the total energy corresponding to the difference frequency to obtain the total sideband energy; Add the total energy corresponding to the first main frequency to the total energy corresponding to the second main frequency to obtain the total main frequency energy; Divide the total energy of the sideband by the total energy of the main frequency to obtain the percentage of intermodulation sideband energy.

[0067] The total sideband energy is the sum of the sum and difference frequency sideband energies generated by the intermodulation of the first and second main frequencies of the double corrugated circuit. It is used as the numerator for subsequent calculation of the intermodulation sideband energy ratio. The calculation formula is: the total sideband energy equals the total energy corresponding to the sum frequency plus the total energy corresponding to the difference frequency.

[0068] The total energy of the main frequency is the sum of the energies of the first and second main frequencies in the double corrugated structure, and is used as the denominator for subsequent calculations of the intermodulation side band energy ratio; the calculation formula is: the total energy of the main frequency equals the total energy corresponding to the first main frequency plus the total energy corresponding to the second main frequency.

[0069] The intermodulation sideband energy ratio is the ratio of the total sideband energy to the total main frequency energy. It is used to quantify the intensity of the sideband energy generated by the mutual modulation of the double corrugated structure relative to the main frequency energy. It is the core of distinguishing between false stripes and real defects in carton printing. The calculation formula is: the intermodulation sideband energy ratio equals the total sideband energy divided by the total main frequency energy. The calculation result is rounded to 4 decimal places.

[0070] In one embodiment of the present invention, determining the judgment threshold based on the intermodulation side energy ratio of a preset qualified cardboard box sample includes: Multiple qualified cardboard box samples were selected, and the corresponding intermodulation side band energy ratio was calculated for each qualified cardboard box sample. Calculate the sample mean of the intermodulation side band energy percentage for all qualified carton samples; Calculate the unbiased standard deviation of the intermodulation band energy percentage for all qualified carton samples; Set statistical coefficients; The decision threshold is obtained by adding the product of the sample mean, the statistical coefficient, and the unbiased standard deviation.

[0071] Multiple qualified carton samples refer to a set of grayscale images corresponding to actual cartons selected from normal production batches that are free of printing strip defects (such as no obvious uneven stripes) and have qualified corrugated structures; the number of samples selected is 30 or more.

[0072] The unbiased standard deviation of the intermodulation side energy percentage of all qualified carton samples is a statistic reflecting the dispersion of the intermodulation side energy percentage of qualified samples. It is used to measure the fluctuation range of qualified samples. Unbiasedness means that this statistic can estimate the population standard deviation without bias (because only a portion of the samples are selected, not the entire population). The calculation formula is as follows: First, calculate the difference between the intermodulation side energy percentage of each qualified carton sample and the sample mean, and record it as each difference. Second, calculate the square of each difference, and record it as each difference square. Third, calculate the sum of the squares of all differences, and record it as the sum of the squares of differences. Fourth, calculate the unbiased standard deviation, which is equal to the square root of the sum of the squares of differences divided by (total number of samples minus 1).

[0073] The statistical coefficient is used to amplify the unbiased standard deviation and control the coverage of qualified sample judgment. The larger the coefficient, the higher the judgment threshold and the greater the proportion of qualified samples covered; the statistical coefficient is 3.

[0074] The judgment threshold is the critical value that distinguishes whether a carton under test is qualified or not. If the intermodulation side energy ratio of the carton under test is lower than or equal to the threshold, it is judged as qualified; if it is higher, it is judged as unqualified. The calculation formula is: the judgment threshold is equal to the sample mean of the intermodulation side energy ratio of all qualified carton samples, plus (statistical coefficient multiplied by the unbiased standard deviation of the intermodulation side energy ratio of all qualified carton samples).

[0075] In one embodiment of the present invention, a grayscale image of the cardboard box to be inspected is acquired, the intermodulation sideband energy ratio is compared with a judgment threshold, and a judgment result of pass or fail is output, including: Obtain the grayscale image of the cardboard box to be inspected; Calculate the percentage of intermodulation side band energy corresponding to the carton to be tested; Compare the percentage of intermodulation side band energy of the carton to be tested with the judgment threshold. If the percentage of energy on the intermodulation side of the carton to be tested is less than or equal to the judgment threshold, it is considered qualified. If the percentage of energy on the intermodulation side of the carton to be tested is greater than the judgment threshold, it is deemed unqualified.

[0076] The pass / fail result means that the proportion of intermodulation side energy of the carton under test does not exceed the normal fluctuation range of the qualified sample, indicating that its printing strip interference is at an acceptable level and there are no real printing defects.

[0077] The non-conforming result means that the proportion of intermodulation band energy on the test carton exceeds the normal fluctuation range of qualified samples, indicating that there are real defects in its printing process (such as uneven ink deposition, stripes caused by abnormal pressure), or excessive intermodulation interference in the double corrugated structure.

[0078] The embodiments of this example have been described above. However, this example is not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of this example, and all of them are within the protection scope of this example.

Claims

1. A method for detecting the printing quality of a carton based on industrial vision, characterized in that, The method comprises the following steps: Obtain a gray image of a carton, the gray image containing a machine direction and a width direction; wherein the machine direction is the running direction of the carton in the printing production line, and the width direction is perpendicular to the machine direction; Select a plurality of regions of interest extending along the machine direction from the gray image along the width direction; Respectively perform detrending and windowing on the machine direction signals of the regions of interest to obtain standard machine direction signals; Respectively perform machine direction power spectrum estimation and aggregation on the standard machine direction signals to obtain an aggregated power spectrum; Determine a first main frequency and a second main frequency from the aggregated power spectrum based on preset peak value screening conditions, and calculate the positions of the sum frequency and the difference frequency according to the first main frequency and the second main frequency; Based on a preset bandwidth, respectively perform energy integration in the frequency range corresponding to the first main frequency, the second main frequency, the sum frequency and the difference frequency to obtain the total energy corresponding to the first main frequency, the second main frequency, the sum frequency and the difference frequency, and further calculate the intermodulation sideband energy proportion; Determine a judgment threshold based on the intermodulation sideband energy proportion of a preset qualified carton sample; Obtain a gray image of a carton to be detected, compare the intermodulation sideband energy proportion with the judgment threshold, and output a qualified or unqualified judgment result.

2. The method for detecting the printing quality of carton based on industrial vision according to claim 1, characterized in that, Selecting a plurality of regions of interest extending along the machine direction from the gray image along the width direction comprises: Obtaining the machine direction coordinates and the width direction coordinates of the gray image; Setting the number of regions of interest, the width direction safety boundary width, and the width direction width of the regions of interest; Determining the width direction minimum coordinate, the width direction maximum coordinate, the machine direction minimum coordinate and the machine direction maximum coordinate of the gray image, and the sum of the width direction safety boundary width multiplied by the width direction width of the regions of interest multiplied by the number of regions of interest is not more than the difference between the width direction maximum coordinate and the width direction minimum coordinate; Determining the center width direction coordinates of the regions of interest according to the width direction maximum coordinate, the width direction minimum coordinate, the width direction safety boundary width and the number of regions of interest, so that the regions of interest are equally distributed along the width direction; The machine direction coverage range of each region of interest is the entire region from the machine direction minimum coordinate to the machine direction maximum coordinate, and the width direction coverage range is a region centered at the corresponding center width direction coordinate and having a total width equal to the width direction width of the region of interest.

3. The method for detecting the printing quality of carton based on industrial vision according to claim 2, characterized in that, Respectively performing detrending and windowing on the machine direction signals of the regions of interest to obtain standard machine direction signals comprises: For each region of interest, calculating the average of the gray values of all width direction pixels at the same machine direction position to obtain the machine direction signal of the region of interest; Obtaining the linear trend corresponding to each machine direction signal by using first-order polynomial least squares fitting; Subtracting the linear trend corresponding to each machine direction signal from the machine direction signal to obtain the detrended machine direction signal; Performing weighted processing on each detrended machine direction signal by using a Hanning window to obtain the standard machine direction signal.

4. The method for detecting the printing quality of carton based on industrial vision according to claim 3, characterized in that, Respectively performing machine direction power spectrum estimation and aggregation on the standard machine direction signals to obtain an aggregated power spectrum comprises: Respectively performing discrete Fourier transform on each standard machine direction signal to obtain the complex frequency domain response corresponding to each standard machine direction signal; Respectively calculating the machine direction power spectrum corresponding to each complex frequency domain response; For each discrete frequency position, collecting the values of all machine direction power spectrums at the discrete frequency position, and aggregating the collected values by using the median to obtain the aggregated power spectrum.

5. The method for detecting the printing quality of carton based on industrial vision according to claim 4, characterized in that, The first main frequency and the second main frequency are determined from the aggregated power spectrum based on preset peak screening conditions, and the sum frequency and the difference frequency positions are calculated according to the first main frequency and the second main frequency, including: A peak threshold factor is set, the median of all values of the aggregated power spectrum is calculated, and the energy threshold is determined according to the peak threshold factor and the median; The discrete frequency positions of the aggregated power spectrum whose values are not lower than the energy threshold are screened to form a candidate position set; A minimum interval parameter is set, and the minimum interval parameter is a positive integer smaller than the length of the aggregated power spectrum; The discrete frequency position with the largest value is selected from the candidate position set as the position corresponding to the first main frequency; The discrete frequency position with the largest value and the interval from the position corresponding to the first main frequency not less than the minimum interval parameter is selected from the candidate position set as the position corresponding to the second main frequency; The position corresponding to the first main frequency and the position corresponding to the second main frequency are converted into the first main frequency and the second main frequency respectively according to the length of the aggregated power spectrum; The discrete frequency resolution is calculated according to the length of the aggregated power spectrum; The discrete frequency position corresponding to the difference frequency is determined by rounding operation according to the first main frequency, the second main frequency and the discrete frequency resolution; The discrete frequency position corresponding to the sum frequency is determined by rounding operation and modulo operation according to the first main frequency, the second main frequency and the discrete frequency resolution; wherein the modulo operation is used to limit the discrete frequency position corresponding to the sum frequency within the range of the effective discrete frequency positions of the aggregated power spectrum.

6. The method for detecting the printing quality of carton based on industrial vision according to claim 5, characterized in that, Based on the preset bandwidth, energy integration is performed in the frequency interval corresponding to the first main frequency, the second main frequency, the sum frequency and the difference frequency respectively to obtain the total energy corresponding to the first main frequency, the second main frequency, the sum frequency and the difference frequency respectively, including: A frequency bandwidth half-width is set; wherein the frequency bandwidth half-width is a positive integer; For the position corresponding to the first main frequency, the position corresponding to the second main frequency, the position corresponding to the sum frequency and the position corresponding to the difference frequency, the corresponding frequency interval is determined respectively, each frequency interval takes the corresponding position as the center, and the interval of the discrete frequency positions within the interval from the corresponding center position is not more than the frequency bandwidth half-width, and the discrete frequency positions within the interval belong to the range of the effective discrete frequency positions of the aggregated power spectrum; The aggregated power spectrum values in each frequency interval are summed respectively to obtain the total energy corresponding to the first main frequency, the total energy corresponding to the second main frequency, the total energy corresponding to the sum frequency and the total energy corresponding to the difference frequency.

7. The method for detecting the printing quality of carton based on industrial vision according to claim 6, characterized in that, The intermodulation sideband energy ratio is calculated, including: The total energy corresponding to the sum frequency and the total energy corresponding to the difference frequency are added to obtain the sideband total energy; The total energy corresponding to the first main frequency and the total energy corresponding to the second main frequency are added to obtain the main frequency total energy; The intermodulation sideband energy ratio is obtained by dividing the sideband total energy by the main frequency total energy.

8. The method for detecting the printing quality of carton based on industrial vision according to claim 7, characterized in that, The determination threshold is determined based on the intermodulation sideband energy ratio of the preset qualified carton sample, including: A plurality of qualified carton samples are selected, and the corresponding intermodulation sideband energy ratio is calculated for each qualified carton sample; The sample mean of the intermodulation sideband energy ratios corresponding to all qualified carton samples is calculated; The unbiased standard deviation of the intermodulation sideband energy ratios corresponding to all qualified carton samples is calculated; A statistical coefficient is set; The determination threshold is obtained by adding the product of the sample mean, the statistical coefficient and the unbiased standard deviation.

9. The method for detecting the printing quality of carton based on industrial vision according to claim 8, characterized in that, The gray-scale image of the paper box to be detected is acquired, the intermodulation sideband energy proportion is compared with a judgment threshold, and a judgment result of qualification or disqualification is output, including: A gray-scale image of a paper box to be detected is acquired; The intermodulation sideband energy proportion corresponding to the paper box to be detected is calculated; The intermodulation sideband energy proportion corresponding to the paper box to be detected is compared with a judgment threshold; If the intermodulation sideband energy proportion corresponding to the paper box to be detected is less than or equal to the judgment threshold, it is judged to be qualified; If the intermodulation sideband energy proportion corresponding to the paper box to be detected is greater than the judgment threshold, it is judged to be unqualified.