Production speed regulation and control method and system for packaging bag printing

By using corner detection and geometric constraint segmentation to correct the packaging bag area, and combining dynamic time warping distance quantification of color differences, the quality analysis error caused by packaging bag rotation offset in the printing production line is solved, achieving efficient and precise production speed control and improving printing quality and efficiency.

CN121724907APending Publication Date: 2026-03-24GUANGZHOU ZHONGZHOU PLASTIC PROD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In the printing and packaging production line, packaging bags may rotate and shift due to mechanical vibration and other factors, causing the acquired images to be misaligned with the preset standard template. This affects the accuracy of quality analysis results, making it impossible to accurately control the production speed, resulting in quality fluctuations and low efficiency.

Method used

By segmenting the packaging bag area through corner detection and geometric constraints, correcting rotational offset, and quantifying color differences using dynamic time warping distance in the LAB color space, a relationship model between quality assessment value and production speed is constructed to achieve automated production speed control.

Benefits of technology

It improves the stability of printing quality and production efficiency, avoids errors and manual intervention in traditional methods, and achieves high-precision production speed control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724907A_ABST
    Figure CN121724907A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to a production speed regulation and control method and system for packaging bag printing. The method comprises the following steps: acquiring and segmenting a printed packaging bag image, and correcting rotation offset by using a histogram of oriented gradients to ensure image alignment. Then, the corrected image is converted into an LAB color space, the LAB color space is compared with a preset standard template, the ink color unevenness is calculated, and the printing quality is quantified. And finally, a relation model of the printing quality and the production speed is constructed based on historical data, the target production speed is determined, regulated and controlled, and balance of the printing efficiency and the quality is achieved. According to the invention, the influence of artificial experience dependence and image dislocation on quality evaluation is overcome, and the accuracy and stability of printing speed regulation and control are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data processing technology, and in particular to a method and system for controlling the production speed of packaging bag printing. Background Technology

[0002] Printing and packaging are crucial links in the commodity circulation process, and their quality directly affects the competitiveness of goods. Multicolor printing accuracy and ink color stability are core quality indicators for printed packaging. Ensuring these indicators is closely related to printing production speed. Excessive speed can easily lead to registration errors and uneven ink color, while insufficient speed reduces production efficiency. Therefore, setting a reasonable production speed is key to balancing quality and efficiency.

[0003] Currently, speed settings on printing and packaging production lines primarily rely on operator experience and judgment. This method is heavily influenced by subjective factors, making it difficult to achieve a precise match between speed and quality. This often results in suboptimal production efficiency or fluctuations in print quality. If the speed setting is unreasonable, the high-speed, continuous production process can quickly generate batch-sized quality defects, affecting production stability.

[0004] To address these issues, dynamic optimization technology for production speed based on real-time quality analysis of printed images has become an important direction for industry development. However, in actual production environments, when packaging bags are transported to the image acquisition area via conveyor belt, they are easily subject to rotational shifts due to various factors such as mechanical transmission vibration, film material tension fluctuations, and installation errors of the guiding device. This results in the packaging bag area in the acquired printed image being inconsistent in direction with the preset standard template, leading to regional misalignment. This misalignment causes quality assessment indicators such as ink contrast and registration deviation to lose their accurate benchmarks, resulting in distorted quality analysis results. Consequently, it becomes impossible to accurately determine the appropriate production speed based on the quality situation, reducing the accuracy of the speed control model based on quality feedback, and may even lead to erroneous production adjustment decisions. Summary of the Invention

[0005] To address the technical problem in actual production where packaging bags rotate and shift due to mechanical vibration and other factors, causing misalignment between the acquired images and the preset standard template, resulting in distorted quality analysis, affecting the accuracy of production speed control, and even leading to erroneous decisions, this invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a method for controlling the production speed of printing packaging bags, the method comprising the steps of: A process is initiated by acquiring an image to be processed from a printing production line, the image containing printed packaging bags; processing the image to segment out the packaging bag region; determining the rotational offset of the packaging bag region relative to a preset standard template, and performing rotational correction on the packaging bag region based on the rotational offset to obtain a corrected packaging bag region, aligning the packaging bag region with the preset standard template in the corrected direction; determining the quality assessment value of the packaging bag region by comparing the color difference between the corrected packaging bag region and the preset standard template; and determining a target control speed using a pre-built model of the relationship between the quality assessment value and historical production speed, along with the quality assessment value of the packaging bag region, and controlling the production speed of packaging bag printing based on the target control speed.

[0007] This invention uses printed packaging bag images as a basis. First, corner detection and geometric constraints are used to precisely segment the packaging bag area. Then, the packaging bag area is corrected based on rotational offset to solve misalignment problems caused by mechanical vibration and other factors. Next, the color difference between the corrected area and a preset standard template is compared to determine the quality assessment value, achieving quality quantification in a way that closely resembles human visual perception. Finally, using a model relating the quality assessment value to production speed, the target speed is adjusted based on the obtained quality assessment value, replacing the traditional fixed-speed mode and manual intervention. This effectively avoids quality analysis distortion problems, improves the automation level of the production line, and ensures production efficiency and product quality stability.

[0008] Preferably, the step of processing the image to be processed to segment the packaging bag region in the image to be processed includes: processing the image to be processed by corner detection to obtain all corners in the image to be processed; identifying four vertex corners to define the packaging bag region based on all corners in the image to be processed and preset geometric features of the packaging bag; and segmenting the image to be processed based on the four vertex corners to obtain the packaging bag region.

[0009] This invention first processes the image to be processed using a corner detection algorithm to obtain all corner points in the image. Then, based on the preset geometric features of the packaging bag, it accurately identifies the four vertex corner points of the packaging bag region from all the corner points. Finally, it segments the image based on these four vertex corner points, effectively and accurately extracting the packaging bag region from complex images containing background. This provides a precise and complete analysis object for subsequent operations such as determining rotation offset and quality assessment based on the packaging bag region.

[0010] Preferably, the step of identifying the four vertex corners used to define the packaging bag region based on all corner points in the image to be processed and the preset geometric features of the packaging bag includes: constructing a standard packaging bag angle sequence based on the preset geometric features of the packaging bag; grouping all corner points in the image to be processed to obtain at least one candidate corner point group, and calculating the candidate angle sequence corresponding to each candidate corner point group; determining the probability that each candidate corner point group is the four vertex corner points of the packaging bag region by calculating the difference between the standard packaging bag angle sequence and each candidate angle sequence; and determining the candidate corner point group with the highest probability as the four vertex corner points of the packaging bag region.

[0011] Preferably, determining the rotational offset of the packaging bag area relative to the preset standard template includes: acquiring the orientation gradient histogram of the packaging bag area and extracting the peak gradient orientation angle therein to obtain the peak gradient orientation angle of the packaging bag area; acquiring the orientation gradient histogram of the preset standard template and extracting the peak gradient orientation angle therein to obtain the peak gradient orientation angle of the preset standard template; calculating multiple deviation angles between the peak gradient orientation angle of the packaging bag area and the peak gradient orientation angle of the preset standard template, and determining the mode of the multiple deviation angles to use the mode as the rotational offset.

[0012] This invention obtains the orientation gradient histogram of the packaging bag area and extracts the peak gradient direction angle. Simultaneously, it obtains the orientation gradient histogram and peak gradient direction angle of a preset standard template, calculates multiple deviation angles between the two, and takes the mode as the rotational offset. This method can accurately capture the rotational offset characteristics of the packaging bag area caused by mechanical vibration, etc. Using the mode as the offset effectively avoids deviations caused by local interference, ensuring the accuracy of the rotational offset.

[0013] Preferably, the step of determining the quality assessment value of the packaging bag area by comparing the color difference between the corrected packaging bag area and the preset standard template includes: performing grid processing on the corrected packaging bag area to obtain multiple first grid units; performing grid processing on the preset standard template to obtain multiple second grid units; calculating the ink color unevenness of each first grid unit relative to the corresponding second grid unit to obtain the ink color unevenness of the first grid unit; and calculating the quality assessment value of the packaging bag area based on the ink color unevenness of all first grid units.

[0014] This invention transforms macroscopic quality assessment into the calculation of ink uniformity within microscopic grid units by separately gridding the corrected packaging bag area and a preset standard template. First, it refines the comparison to each first and second grid unit, accurately capturing local ink color differences; then, it summarizes the results of all first grid units to obtain the overall quality assessment value. This approach not only ensures precise identification of local defects in printed materials but also enables hierarchical analysis through gridding, providing quantitative evidence for quality assessment from the overall perspective to the details. This provides accurate and detailed feedback for subsequent dynamic adjustment of production speed based on quality.

[0015] Preferably, the step of calculating the ink color uniformity relative to the corresponding second grid cell to obtain the ink color uniformity of the first grid cell includes: converting the image data in the first grid cell and its corresponding second grid cell from the RGB color space to the LAB color space; obtaining the sequence of channel values ​​in the first grid cell in the LAB color space to obtain the first channel value sequence; obtaining the sequence of channel values ​​in the second grid cell in the LAB color space to obtain the second channel value sequence; and calculating the ink color uniformity of the first grid cell based on the dynamic time warping distance between the first channel value sequence and the second channel value sequence.

[0016] Preferably, the step of calculating the ink color uniformity of the first grid cell based on the dynamic time warping distance between the first channel value sequence and the second channel value sequence includes: for each first grid cell, calculating the dynamic time warping distance between its first channel value sequence and the second channel value sequence of the corresponding second grid cell on each channel; calculating the normalized value of the dynamic time warping distance; adding the normalized values ​​of the dynamic time warping distance of all channels of the first grid cell, and then dividing by the total number of channels to obtain the ink color uniformity of the first grid cell.

[0017] This invention quantifies the ink color uniformity of the first grid unit by constructing an ink color uniformity formula. Dynamic time warping distance adapts to minute printing deformations, and by combining the maximum channel value with preset minute values, it accurately characterizes ink color differences from multiple channel dimensions. This effectively identifies local ink color uniformity problems, providing fine-grained, human-perceptually-aligned quantitative indicators for quality assessment, supporting high-precision printing quality analysis, assisting in production speed control decisions, and improving product quality stability.

[0018] Preferably, the step of calculating the quality assessment value of the packaging bag area based on the ink color uniformity of all first grid cells includes: calculating the average value of the ink color uniformity of all first grid cells, and normalizing the average value to obtain a normalized average ink color uniformity value; the quality assessment value of the packaging bag area is the result of 1 minus the normalized average ink color uniformity value.

[0019] Preferably, the pre-constructed relationship model between the quality assessment value and the production speed includes: using the quality assessment value of the packaging bag area and its corresponding production speed as a data point to establish or update the relationship model between the quality assessment value and the production speed; wherein, the relationship model between the quality assessment value and the production speed is obtained by function fitting to historical data containing multiple data points.

[0020] In a second aspect, the present invention provides a production speed control system for printing packaging bags. The production speed control system for printing packaging bags includes a memory and a processor. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the production speed control method for printing packaging bags according to the first aspect of the present invention is implemented.

[0021] By adopting the above technical solution, a computer program for controlling the production speed of packaging bag printing according to the first aspect of the present invention is generated and stored in a memory so that it can be loaded and executed by a processor, thereby creating a terminal device based on the memory and the processor for convenient use.

[0022] The beneficial effects of this invention are as follows: This invention constructs an automated closed-loop control system, achieving dynamic adjustment of production speed through real-time monitoring and quantitative evaluation. This avoids the blindness of traditional fixed-speed modes and the lag and subjective problems of manual intervention, thus improving the automation level, efficiency, and product quality stability of the production line. This invention employs a segmentation method based on corner detection and geometric feature constraints, combined with a rotation correction method based on the mode of the directional gradient histogram. This allows for accurate extraction of packaging bag areas from complex backgrounds and posture correction, exhibiting strong anti-interference capabilities and laying the foundation for high-precision color quality evaluation. This invention innovatively uses dynamic time-warped distance (DTW) to measure color differences in the LAB color space through gridded local comparison. This effectively identifies local defects, and the evaluation results closely match human visual perception and tolerate minor stretching deformation. It transforms subjective quality judgments into objective, quantitative evaluation values, resulting in more scientific and reliable results. Attached Figure Description

[0023] Figure 1 A flowchart of a production speed control method for printing packaging bags provided in an embodiment of the present invention; Figure 2 This is a schematic diagram showing the installation location of the image acquisition device provided in an embodiment of the present invention; Figure 3 This is a structural block diagram of a production speed control system for printing packaging bags, provided as an embodiment of the present invention. Detailed Implementation

[0024] The first aspect of this invention provides a method for controlling the production speed of packaging bag printing, such as... Figure 1As shown, the method includes steps S100-S500: Step S100: Obtain the image to be processed from the printing production line. The image to be processed contains the printed packaging bag.

[0025] It should be noted that, in order to capture images of the continuously moving packaging bags on the production line without any omissions, this step has been carefully considered from hardware selection and physical deployment to operating parameter settings.

[0026] Specifically, the first step is to select a suitable image acquisition device. As a preferred implementation, the image acquisition device can be a high-resolution global shutter CMOS or CCD camera, for example, with a resolution of at least [missing information]. Set the pixel count and frame rate to 30fps or higher to ensure that clear, blur-free image details of the packaging bag are captured even when it is moving at high speed.

[0027] In terms of physical deployment, the image acquisition device should be securely mounted directly above the finished product transport line. To ensure that newly printed packaging bags can be reliably captured, a reasonable distance must be maintained between the device and the printing equipment. For example, such as... Figure 2 As shown, if the length of the printed packaging bag is The image acquisition device can be installed at a distance from the center of the current printing equipment. The downstream position allows for sufficient margin for the transfer and stability of the packaging bags.

[0028] In terms of operating parameter settings, in order to achieve zero missed images, the camera's acquisition cycle needs to be dynamically matched with the production speed.

[0029] Specifically, the collection cycle Satisfying the relation: ; in, It is the distance from the point where printing is completed to the point where the camera captures the data; The speed of the printing production line.

[0030] For example, if the sampling distance It is 1 meter long, and the current production speed is... If the speed is 0.2 m / s, the acquisition period should be set to 5 seconds, meaning the camera should trigger an image capture every 5 seconds.

[0031] Furthermore, as a preferred implementation, the acquired raw image can be preprocessed to improve the accuracy of subsequent analysis. The preprocessing steps may include: first, processing the raw image using a median filtering algorithm, which effectively removes random impulse noise such as salt-and-pepper noise, and better preserves image edge details compared to linear methods such as mean filtering; then, converting the denoised color image to a grayscale image to reduce the computational complexity of subsequent algorithms such as corner detection. These preprocessing methods are existing technologies and will not be elaborated upon further.

[0032] At this point, a pre-processed image containing the printed packaging bag has been obtained.

[0033] Step S200: Process the image to be processed to segment out the packaging bag area in the image to be processed.

[0034] It should be noted that the acquired images to be processed usually contain background areas such as conveyor belts. In order to eliminate their interference with subsequent quality analysis, the packaging bag area must first be accurately segmented from the image.

[0035] Specifically, firstly, the image to be processed is processed using a corner detection algorithm. For example, the Harris corner detection algorithm or the Shi-Tomasi corner detection algorithm can be used to perform calculations on the entire image to obtain all corners with high response values; these corners constitute the complete corner set. The corner detection algorithms mentioned above are existing technologies and will not be elaborated upon here.

[0036] Secondly, based on the preset geometric features of the packaging bag, the four vertex corners of the packaging bag area are identified. Given that packaging bags are typically rectangular or approximately rectangular, their four interior corners are... Left and right. Based on this prior knowledge, a standard packaging bag angle sequence is constructed. Theoretically, this standard packaging bag angle sequence is: ,in Then, all corner points detected in the image are grouped. For example, four corner points are arbitrarily selected as a candidate corner point group, and the interior angles of the quadrilateral formed by connecting these four corner points in sequence are calculated to form a candidate angle sequence. The probability that the candidate angle sequence constitutes the vertex of the actual packaging bag is evaluated by calculating the difference between the candidate angle sequence and the standard packaging bag angle sequence.

[0037] Based on the above logic, the probability that the candidate corner point group constitutes the actual vertices of the packaging bag satisfies the following relationship: ; in, It is the first The probability that a candidate corner point group is the four vertex corner points of the actual packaging bag; It is the first The quadrilateral formed by the candidate corner point group is the first... One interior angle; This is the first standard packaging bag template. In this embodiment, the interior angles are... ; This is the total number of interior angles. In this embodiment, since the packaging bag is usually rectangular or approximately rectangular, ; It is a natural exponential function; It is the absolute value symbol; It is a preset sensitivity coefficient, a positive real number, used to adjust the sensitivity of the probability to angular deviation.

[0038] In this formula, the summation term The sum of the absolute deviations of the interior angles of the quadrilateral formed by the candidate corner point group from the interior angles of the standard rectangle was calculated. The smaller this value, the closer the candidate corner point group is to the standard rectangle geometrically. Since the negative exponential function is a monotonically decreasing function, its value decreases exponentially as the sum of the absolute deviations increases. Sensitivity coefficient. This controls the rate of decay.

[0039] Overall, the formula maps the deviation of the geometric angle to a probability score in the interval (0,1). When the angle sequence formed by the candidate corner point group perfectly matches the standard sequence, the sum of the deviations is 0, and the probability is... It reaches its maximum value of 1; as the deviation increases, the probability... The size is rapidly reduced, thus enabling the effective differentiation of the corner point combination that best matches the preset geometric features.

[0040] As a preferred implementation method, It can be set to 0.01, a value that allows for a certain degree of flexibility in the packaging bag during actual production, while also providing a very low probability of handling shapes with significant angular deviations formed by incorrect corner combinations. Implementers can set this value according to their needs.

[0041] Finally, by traversing all possible candidate corner groups and calculating their corresponding probabilities. The candidate corner points with the highest probability are identified as the four vertices of the packaging bag region. Based on these four vertices, perspective transformation is applied to the original image. Using the coordinates of these four vertices, the corresponding perspective transformation matrix is ​​calculated and applied to the image, thereby cropping and correcting the tilted, non-rectangular packaging bag region into a standard, upright rectangular image. This image is the segmented packaging bag region. Perspective transformation is an existing technique and will not be elaborated upon here.

[0042] At this point, the segmentation of the image to be processed has been completed, and the packaging bag area has been obtained.

[0043] Step S300: Determine the rotation offset of the packaging bag area relative to the preset standard template, and perform rotation correction on the packaging bag area based on the rotation offset to obtain the corrected packaging bag area so that the packaging bag area is aligned with the preset standard template in the direction.

[0044] After obtaining the segmented packaging bag area in step S200, although its outline has been corrected to a rectangle, the printed content inside, such as text and patterns, may still exhibit in-plane rotation due to the packaging bag's orientation on the conveyor belt. To ensure accurate pixel-level color comparison with the preset standard template, this rotation must first be corrected.

[0045] It should be noted that the core purpose of this step is to eliminate the rotational offset of the packaging bag area relative to the preset standard template, ensuring that the content orientations of the two are perfectly aligned. This is a crucial prerequisite for achieving high-precision, high-reliability color difference analysis, directly impacting the accuracy of the final quality assessment.

[0046] Specifically, multiple deviation angles between the peak gradient direction angles are calculated, and the mode is determined as the final rotation offset. Its detailed implementation process includes steps S310-S330: Step S310: Obtain the peak gradient direction angle of the packaging bag area and the peak gradient direction angle of the preset standard template respectively.

[0047] First, obtain the orientation gradient histogram of the packaging bag region, and extract the peak gradient orientation angles representing its main texture directions from the histogram, thus obtaining a set of peak gradient orientation angles for the packaging bag region. This set can be represented as... ,in, It is the set of peak gradient direction angles in the packaging bag region. It extracts the first element representing the main texture direction from the histogram of the orientation gradient of the packaging bag area. Each peak gradient direction angle. Simultaneously, in the same manner, the orientation gradient histogram of a preset standard template is obtained, and the peak gradient direction angles are extracted to obtain a set of peak gradient direction angles for a preset standard template. This set can be represented as... ,in, It is the set of peak gradient direction angles of a preset standard template. It extracts the first element representing the main texture direction from the orientation gradient histogram of a preset standard template. The peak gradient direction angle. Obtaining the image's directional gradient histogram is a current technique and will not be elaborated upon here.

[0048] Step S320: Calculate all deviation angles between the peak gradient direction angle of the packaging bag area and the peak gradient direction angle of the preset standard template.

[0049] Specifically, it is about the set Each angle in the set is respectively related to the set The difference between each angle is calculated to obtain a list containing all possible deviation angles.

[0050] Step S330: Determine the mode of the deviation angle as the rotation offset.

[0051] Finally, statistical analysis is performed on the list of deviation angles obtained in the previous step to determine the angle value that appears most frequently, which is the mode. Since the true rotational offset affects all features, the correct deviation angle appears repeatedly in the calculation results, while deviations caused by noise or minor features are more discrete. Therefore, this mode most stably represents the overall rotational offset of the entire packaging bag area. This mode is determined as the final rotational offset.

[0052] After determining the rotation offset, an angle of 10° needs to be applied to the packaging bag area. The correction is performed using affine transformation.

[0053] As a preferred implementation, in order to standardize the instruction format for rotation transformation and ensure the standardization of calculation, the required correction angle can be normalized so that it is always a positive value.

[0054] Specifically, if the calculated correction angle If it is negative, then add it. This is converted into an equivalent positive angle value. This avoids rotational misalignment that may occur due to the logical difference in handling positive and negative angles, and simplifies the instructions to the downstream control module.

[0055] To more clearly illustrate the process of obtaining the rotation offset, an example is provided: Suppose the set of peak gradient direction angles extracted from the orientation gradient histogram of the packaging bag region is... The set of peak gradient direction angles extracted from the directional gradient histogram of the preset standard template is as follows: The calculated deviation angles are as follows: Analyzing the list reveals... It appeared twice, making it the most frequent value among all values. Therefore, the mode of this list is... The mode is determined as the rotation offset, i.e. After determining the rotation offset, a rotation angle of is applied to the segmented packaging bag area. By performing an affine transformation, the corrected packaging bag area can be obtained, which is perfectly aligned with the direction of the preset standard template.

[0056] At this point, the packaging bag area after rotation correction has been obtained.

[0057] Step S400: Determine the quality assessment value of the packaging bag area by comparing the color difference between the corrected packaging bag area and the preset standard template.

[0058] It should be noted that after obtaining the packaging bag area aligned with the preset standard template in both shape and orientation, the core task of this step is to objectively and quantitatively evaluate its printing quality based on its color difference from the preset standard template, and ultimately determine a comprehensive quality assessment value. Its detailed implementation process includes steps S410-S430: Step S410: Pre-process the packaging bag area.

[0059] It should be noted that, in order to ensure the accuracy, robustness and computational efficiency of the evaluation results, this embodiment performs two key preprocessing steps, namely meshing and color space conversion, before performing the core difference calculation.

[0060] Mesh processing decomposes the packaging bag area into multiple independent analysis units. This not only enables precise location and quantification of local printing defects such as ink spots and streaks, preventing them from being masked by global averaging, but also significantly improves computational efficiency by shortening the processing sequence length of subsequent algorithms.

[0061] Color space conversion solves the fundamental problem of color difference measurement. This is because the RGB color space commonly used in industrial cameras does not correspond linearly to human visual perception. By converting it to the LAB color space, which has a uniform perception, we can ensure that the color differences calculated later can more realistically reflect the quality perceived by the human eye.

[0062] Therefore, the combination of these two preprocessing steps lays a solid foundation for subsequent accurate, efficient, and human-visually-compliant quality assessment using the Dynamic Time Warping (DTW) algorithm.

[0063] Specifically, firstly, the corrected packaging bag area is subjected to the same gridding process as a preset standard template, resulting in multiple first grid units and multiple second grid units. For example, each area is divided into... Each grid cell, such as Each first grid cell in the corrected packaging bag area corresponds one-to-one with a second grid cell in the same position in the preset standard template. Then, the image data in all the first grid cells and their corresponding second cells are converted from the RGB color space to the LAB color space.

[0064] Step S420: Calculate the local ink color unevenness.

[0065] It should be noted that the core of printing quality lies in the accuracy and uniformity of color. This step quantifies quality by performing a gridded local comparison between the corrected packaging bag area and a preset standard template. However, in actual printing, due to factors such as slight stretching, deformation, or ink bleeding of the material, even after macroscopic geometric correction, local nonlinear misalignment may still exist between the color sequence of pixels within the grid unit and the preset standard template. To address this issue, this invention introduces the Dynamic Time Warping (DTW) algorithm. The DTW algorithm can effectively measure the similarity between two sequences with local temporal differences. Therefore, this algorithm can penetrate the interference of the aforementioned nonlinear misalignment, thereby accurately quantifying subtle defects such as true ink color unevenness and color drift caused by factors such as printing speed fluctuations.

[0066] Specifically, in the LAB color space, the pixel value sequences of each channel in the first grid cell and its corresponding second grid cell are obtained respectively, thereby obtaining the first channel value sequence and the second channel value sequence.

[0067] Subsequently, based on the dynamic time warping (DTW) distance between the first and second channel value sequences, the difference between them in each color channel is calculated. To comprehensively evaluate the non-uniformity of each grid cell across all color channels and normalize it for subsequent global evaluation, the logic of the ink non-uniformity calculation formula in this invention is as follows: the DTW distance of each channel is normalized, and then the average of the normalized distances of all channels is calculated, which is used as the comprehensive non-uniformity index of the grid cell.

[0068] Based on the above logic, the ink color unevenness satisfies the following relationship: ; in, It is the first The ink color uniformity of the first grid cell; It is the first The first channel value sequence of the first grid cell and the second channel value sequence of the corresponding second grid cell are in the... Dynamic time-normalized distance on each channel; All first grid cells are in the first... The maximum value of the dynamic time warp distance on each channel; It is a first preset tiny value used to prevent ink color unevenness from being 0. It can be 0.01 or set according to requirements; This is a second preset microvalue used to prevent the denominator from being 0. It can be 0.01 or set according to requirements. This represents the total number of channels.

[0069] In this formula, This normalizes the DTW distance of a single channel, mapping the DTW distance value of a single channel to... Within the range, potential differences in numerical scale between different color channels are eliminated. By summing and averaging the normalized distances of all channels, a comprehensive evaluation of the non-uniformity of a single grid cell across all color dimensions is achieved.

[0070] This formula quantifies the multidimensional color difference between a grid cell and a preset standard template into a single, normalized non-uniformity value. This accurately reflects the local printing quality. When the... The printing quality of the first grid cell is very high, almost identical to the preset standard template, and all its channels... All will approach 0, thus making It also approaches 0. Conversely, if there is a significant color deviation, one or more channels... It will increase, which in turn leads to The value increases accordingly, accurately reflecting the decline in local printing quality.

[0071] Calculate the ink color non-uniformity of each of the first grid cells one by one according to the above steps. .

[0072] Step S430: Calculate the global quality assessment value.

[0073] It should be noted that the ink color uniformity of all first grid cells is calculated according to the above steps. Then, based on these values, a global quality assessment value can be calculated, which is the final quality assessment value for the entire packaging bag area.

[0074] Specifically, the average value of the ink color uniformity of all first grid cells is first calculated. Then, the average value of ink unevenness is normalized by minimax. Finally, 1 minus the normalized average value is taken as the final quality assessment value. By this definition, the quality assessment value is positively correlated with print quality. When the overall print quality of the packaging bag is very high, the average value of ink unevenness... When the print quality approaches 0, the quality assessment value approaches 1. When print quality declines, An increase in the value leads to a decrease in the quality assessment value. This definition method makes the assessment results intuitive and easy to understand, facilitating their use in subsequent production speed control models.

[0075] At this point, the quality assessment value for the packaging bag area was obtained.

[0076] Step S500: Using a pre-built model showing the relationship between quality assessment values ​​and historical production speeds, as well as the quality assessment values ​​of the packaging bag area, determine the target control speed, and adjust the production speed of packaging bag printing based on the target control speed.

[0077] It should be noted that, in order to transform abstract quality assessment values ​​into specific and effective control instructions for the production line, this step uses a real-time, adaptive modeling method to dynamically capture the specific relationship between printing quality and production speed in the current production batch. This real-time modeling method can more accurately reflect the impact of immediate factors such as the current state of the equipment, ambient temperature and humidity, and ink batch on printing quality, thereby making control decisions more targeted and timely. Specifically, the detailed implementation process of this step includes steps S510-S530: Step S510: Construct a model showing the relationship between quality assessment values ​​and historical production speeds.

[0078] The system will continuously record and store two key data points for each package bag collected and evaluated in the current production batch: the quality assessment value of the package bag area. The actual production speed corresponding to the production of packaging bags . It is the first Quality assessment values ​​for each packaging area. It is the first The actual production speed corresponding to the production of each packaging bag. These two data points constitute a data point. The actual production speed during packaging bag production can be detected by installing a speed sensor in the printing equipment area.

[0079] When speed adjustment decisions are needed, the system will utilize all historical data points collected up to the current moment. By using the least squares method to fit the function, a fitting function reflecting the relationship between the quality assessment value and the production speed under the current working conditions is constructed. It is the first Quality assessment values ​​for each packaging area. It is the first The actual production speed corresponding to the production of each packaging bag.

[0080] As a preferred implementation, a linear relationship model can be fitted, which takes the following form: ; in, It's production speed. It is a quality assessment value. and These are the function coefficients obtained through least squares fitting. A positive value usually indicates that, under the current operating conditions, a higher quality assessment value allows for setting a higher production speed.

[0081] Step S520: Determine the target control speed.

[0082] After obtaining the aforementioned real-time fitting function, the system assigns a preset ideal quality assessment value. Substitute the values ​​into the function to solve for the ideal control speed that the production line should achieve under the ideal quality. .

[0083] It should be noted that, considering step S400, even in the ideal case where it is completely consistent with the preset standard template, due to the preset minute value... The presence of this leads to uneven ink color distribution in each grid cell. The theoretical minimum value is For example, 0.01, therefore the final quality assessment value The theoretical maximum value is Based on this, the ideal quality assessment value It can be set to its theoretically optimal value, such as 0.99.

[0084] Will Substituting the values ​​into the fitting function, the ideal control speed can be calculated: ; in, It is the ideal speed control for printing packaging bags. It is the ideal quality assessment value for packaging bag printing. and The coefficients are obtained by fitting the function using the least squares method.

[0085] Should This is the target speed for this adjustment. It represents the optimal production speed that the equipment can handle under current production conditions in order to achieve near-perfect printing quality.

[0086] Step S530: Execute speed control.

[0087] Finally, the system will calculate the target control speed. The control system sends commands to the core drive unit of the production line, instructing it to precisely adjust the production speed to... .

[0088] By continuously collecting data → fitting the model in real time and substituting the ideal value to solve the problem → executing the adjustment cycle, this invention realizes a highly adaptive production speed optimization strategy, which can dynamically adjust the production rhythm while ensuring the optimal printing quality, and achieve a balance between efficiency and quality.

[0089] The second aspect of this embodiment provides a production speed control system for printing packaging bags, such as... Figure 3 As shown, the production speed control system for packaging bag printing includes a memory and a processor. The memory stores computer program instructions, which, when executed by the processor, implement the first aspect of the present invention: a production speed control method for packaging bag printing.

[0090] The production speed control system for printing packaging bags also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0091] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (DRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (DRAM), high-bandwidth memory, hybrid memory cube, etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device.

[0092] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for controlling the production speed of packaging bag printing, characterized in that, Including the following steps: Acquire images to be processed from the printing production line, the images containing printed packaging bags; The image to be processed is processed to segment out the packaging bag area in the image to be processed; Determine the rotation offset of the packaging bag area relative to the preset standard template, and perform rotation correction on the packaging bag area based on the rotation offset to obtain the corrected packaging bag area so that the packaging bag area is aligned with the preset standard template in the direction. The quality assessment value of the packaging bag area is determined by comparing the color difference between the corrected packaging bag area and the preset standard template. By using a pre-built model showing the relationship between quality assessment values ​​and historical production speeds, as well as the quality assessment values ​​of the packaging bag area, a target control speed is determined, and the production speed of packaging bag printing is controlled based on the target control speed.

2. The production speed control method for printing packaging bags according to claim 1, characterized in that, The step of processing the image to be processed to segment the packaging bag region in the image to be processed includes: The image to be processed is processed by corner detection to obtain all corner points in the image to be processed; Based on all corner points in the image to be processed and the preset geometric features of the packaging bag, identify four vertex corner points used to define the packaging bag area; Based on the four vertex corners, the image to be processed is segmented to obtain the packaging bag area.

3. The production speed control method for printing packaging bags according to claim 2, characterized in that, The step of identifying four vertex corners to define the packaging bag region based on all corner points in the image to be processed and the preset geometric features of the packaging bag includes: Based on the preset geometric features of the packaging bags, a standard packaging bag angle sequence is constructed; All corner points in the image to be processed are grouped to obtain at least one candidate corner point group, and the candidate included angle sequence corresponding to each candidate corner point group is calculated. By calculating the difference between the standard packaging bag angle sequence and each candidate angle sequence, the probability that each candidate corner point group is one of the four vertex corner points of the packaging bag region is determined. The candidate corner point group with the highest probability is determined as the four vertex corner points of the packaging bag area.

4. The production speed control method for printing packaging bags according to claim 1, characterized in that, Determining the rotational offset of the packaging bag area relative to the preset standard template includes: Obtain the orientation gradient histogram of the packaging bag region and extract the peak gradient orientation angle to obtain the peak gradient orientation angle of the packaging bag region; Obtain the directional gradient histogram of the preset standard template and extract the peak gradient direction angle therein to obtain the peak gradient direction angle of the preset standard template; Calculate multiple deviation angles between the peak gradient direction angle of the packaging bag area and the peak gradient direction angle of the preset standard template, and determine the mode of the multiple deviation angles, so as to use the mode as the rotation offset.

5. The production speed control method for printing packaging bags according to claim 1, characterized in that, The step of determining the quality assessment value of the packaging bag area by comparing the color difference between the corrected packaging bag area and the preset standard template includes: The corrected packaging bag area is then gridded to obtain multiple first grid units; The preset standard template is meshed to obtain multiple second mesh units; For each first grid cell, calculate its ink color non-uniformity relative to the corresponding second grid cell to obtain the ink color non-uniformity of the first grid cell; The quality assessment value of the packaging bag area is calculated based on the ink color uniformity of all first grid cells.

6. The production speed control method for printing packaging bags according to claim 5, characterized in that, The calculation of the ink color non-uniformity relative to the corresponding second grid cell to obtain the ink color non-uniformity of the first grid cell includes: The image data in the first grid cell and its corresponding second grid cell are converted from the RGB color space to the LAB color space. In the LAB color space, the sequence of channel values ​​within the first grid cell is obtained to obtain the first channel value sequence; in the LAB color space, the sequence of channel values ​​within the second grid cell is obtained to obtain the second channel value sequence. The ink color non-uniformity of the first grid cell is calculated based on the dynamic time warping distance between the first channel value sequence and the second channel value sequence.

7. The production speed control method for printing packaging bags according to claim 6, characterized in that, The calculation of the ink color non-uniformity of the first grid cell based on the dynamic time warping distance between the first channel value sequence and the second channel value sequence includes: For each first grid cell, calculate the dynamic time warping distance between its first channel value sequence and the second channel value sequence of the corresponding second grid cell in each channel; Calculate the normalized value of the dynamic time-warped distance; The normalized values ​​of the dynamic time-normalized distances of all channels in the first grid cell are summed and then divided by the total number of channels to obtain the ink color uniformity of the first grid cell.

8. The production speed control method for printing packaging bags according to claim 5, characterized in that, The calculation of the quality assessment value of the packaging bag area based on the ink color uniformity of all first grid cells includes: Calculate the average value of the ink color uniformity of all the first grid cells, and normalize the average value to obtain the normalized average value of ink color uniformity. The quality assessment value of the packaging bag area is the result of subtracting the mean value of the normalized ink color uniformity from 1.

9. The production speed control method for printing packaging bags according to claim 1, characterized in that, The pre-built model relating quality assessment values ​​to production speed includes: The quality assessment value of the packaging bag area and its corresponding production speed are used as a data point to establish or update the relationship model between the quality assessment value and the production speed. The relationship model between the quality assessment value and the production speed is obtained by fitting a function to historical data containing multiple data points.

10. A production speed control system for printing packaging bags, characterized in that, The production speed control system for packaging bag printing includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a production speed control method for packaging bag printing according to any one of claims 1-9.