Paper box face paper positioning error automatic compensation method and system based on visual recognition
By using industrial camera image acquisition and multi-dimensional image processing technology, the multi-dimensional positioning deviation of the paper box face paper is compensated in real time, which solves the problem of insufficient positioning accuracy in high-speed production and improves the processing accuracy and stability of the paper box face paper.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU FOUR COLOR PRINTING
- Filing Date
- 2026-05-27
- Publication Date
- 2026-06-23
Smart Images

Figure CN122265408A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printing and packaging technology, and in particular to a method and system for automatic compensation of paper box face paper positioning error based on visual recognition. Background Technology
[0002] In the field of cardboard box linerboard processing, machine vision image recognition technology is widely used in the positioning and detection process. By acquiring images of the linerboard surface through image acquisition devices and using image processing algorithms to extract feature markers or edge contour information, the system can identify and calculate its planar position parameters, providing a positional reference for subsequent processing steps such as printing registration and die-cutting alignment. This technology relies on image feature analysis to achieve non-contact detection and can simultaneously acquire multi-dimensional positional information of the linerboard. In high-speed production, operators observed that when the face paper enters the die-cutting process from the printing unit, misalignment frequently occurs between the die-cutting blade and the pre-set cutting line of the face paper. This manifests as irregular burrs on the edges of the die-cut boxes, or partial cutting of the printed pattern. The root cause of this phenomenon lies in the fact that during high-speed transport, the face paper is affected by multiple dynamic interferences, including material deformation, gaps in the mechanical transmission system, and fluctuations in paper feed speed. This results in real-time, multi-dimensional positioning deviations. Existing machine vision-based positioning systems often employ static detection logic with fixed thresholds, failing to incorporate real-time deviation data for dynamic closed-loop compensation. Consequently, the positioning accuracy cannot adapt to the dynamic changes under high-speed conditions. This problem directly reduces the dimensional consistency of the die-cut boxes, leading to misalignment in the box forming process during subsequent folding. In some products, the lid cannot close tightly due to crease misalignment, affecting the structural integrity and reliability of the packaged products. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, the present invention provides the following technical solution: An automatic compensation method for carton faceplate positioning error based on visual recognition includes: acquiring carton faceplate images in real time using a calibrated industrial camera; performing distortion correction and inverse perspective transformation on the acquired original faceplate images to obtain orthorectified images; extracting subpixel coordinates of faceplate reference marks based on the orthorectified images; performing multi-dimensional registration calculations with a preset standard positioning coordinate template to generate a multi-dimensional deviation description tensor; performing sliding window statistics and trend separation on the multi-dimensional deviation description tensor along the time sampling index direction to obtain deviation trend components and deviation random components; constructing a weighted directed acyclic deviation propagation graph based on the deviation trend components and deviation random components; generating a servo control compensation parameter set by inferring and calculating through a pre-trained multi-dimensional error compensation model based on the attribute values of each deviation node and the propagation weight values of the directed edges in the weighted directed acyclic deviation propagation graph; and sending each compensation component in the servo control compensation parameter set to the corresponding servo actuator in real time according to the execution priority label to perform closed-loop position compensation and dynamic convergence verification, thus completing fully automatic real-time compensation for carton faceplate positioning error.
[0004] Further, the steps for generating the multidimensional deviation description tensor include: performing intrinsic and extrinsic parameter calibration on the industrial camera to obtain the camera's intrinsic and extrinsic parameter matrices; performing radial and tangential distortion correction on the acquired original image of the face paper based on the distortion coefficients in the camera's intrinsic parameter matrix to obtain a distorted image; calculating the homography matrix between the face paper plane and the imaging plane based on the extrinsic parameter matrix, performing an inverse perspective transformation on the distorted image based on the homography matrix to eliminate trapezoidal distortion caused by camera mounting tilt, and obtaining an orthorectified image; performing reference mark extraction and subpixel coordinate positioning on the orthorectified image; establishing a standard positioning coordinate template, and performing multidimensional registration calculation based on the actual reference coordinate set and the standard positioning coordinate template to generate the multidimensional deviation description tensor.
[0005] Furthermore, the steps for performing intrinsic and extrinsic parameter calibration and distortion correction on the industrial camera include: using the Zhang Zhengyou calibration method, acquiring calibration image sequences in multiple poses using a checkerboard calibration board, extracting corner coordinates from each frame in the calibration image sequence, and solving the camera intrinsic and extrinsic parameter matrices through the correspondence between the corner coordinates and the physical coordinates of the calibration board; performing radial and tangential distortion correction on each pixel coordinate in the original image of the paper according to the distortion coefficients in the camera intrinsic parameter matrix, and reconstructing the pixel grayscale values using bilinear interpolation to obtain the distortion-free image.
[0006] Furthermore, the steps for constructing a weighted directed acyclic deviation propagation graph include: setting a sliding statistical window for each deviation type of each benchmark marker along the third dimension of the multidimensional deviation description tensor, i.e., the time sampling index direction; calculating the moving mean and moving standard deviation of the deviation values within the sliding statistical window; performing trend separation on the time series of deviation values for each deviation type of each benchmark marker; and constructing a weighted directed acyclic deviation propagation graph based on the statistical properties of the deviation trend component and the deviation random component.
[0007] Furthermore, the steps for performing trend separation include: applying second-order polynomial least squares fitting to the deviation numerical time series, extracting the low-frequency gradual variation component in the deviation time series to obtain the deviation trend component; and subtracting the deviation trend component from the deviation numerical time series to obtain the deviation random component.
[0008] Further, the steps for generating the servo control compensation parameter set include: performing topological sorting on the weighted directed acyclic deviation propagation graph to obtain the topological execution sequence of the deviation nodes; extracting deviation trend component values, moving standard deviation values, and moving mean values from each deviation node according to the order of the topological execution sequence, extracting propagation weight values and time delay values from each directed edge, flattening and concatenating all extracted values into a one-dimensional feature vector according to the order of the topological execution sequence, denoted as the deviation propagation feature vector; collecting real-time operating parameters of the equipment, normalizing the real-time operating parameters, and concatenating them with the deviation propagation feature vector to form a joint input vector; inputting the joint input vector into a pre-trained multi-dimensional error compensation model for inference calculation, and outputting the servo control compensation parameter set.
[0009] Furthermore, the step of inputting the joint input vector into the pre-trained multi-dimensional error compensation model for inference calculation includes: the multi-dimensional error compensation model is a multi-layer fully connected neural network, the dimension of its input layer is consistent with the dimension of the joint input vector, and the dimension of its output layer corresponds to the number of servo axes that need to be compensated multiplied by the number of degrees of freedom for compensation of each servo axis; the joint input vector is fed into the input layer of the multi-dimensional error compensation model, and after nonlinear transformation of each hidden layer, the original compensation numerical sequence is generated in the output layer; the original compensation numerical sequence is structured and parsed according to the servo axis number and the compensation degree of freedom number, and the lateral compensation amount, longitudinal compensation amount and rotational compensation amount are assigned to the corresponding servo axes respectively, and encapsulated to form a servo control compensation parameter group.
[0010] Furthermore, the steps for performing closed-loop position compensation and dynamic convergence verification include: determining the distribution order according to the execution priority marker of each compensation component in the servo control compensation parameter group; prioritizing the distribution of rotational compensation to the rotary servo axis actuator; then sequentially distributing longitudinal compensation to the longitudinal servo axis actuator and lateral compensation to the lateral servo axis actuator; after receiving the corresponding compensation component, each servo actuator drives the servo motor to perform position fine-tuning using pulse commands; after each servo actuator completes position fine-tuning, the industrial camera is triggered to re-acquire the paper image at the compensated workstation; the compensated multidimensional deviation description tensor is recalculated according to the above-mentioned processing flow for generating the multidimensional deviation description tensor; and the compensated lateral deviation component, longitudinal deviation component, and rotational deviation component are extracted; the absolute value of the residual deviation is calculated for each of the compensated lateral deviation component, longitudinal deviation component, and rotational deviation component; and each absolute value of the residual deviation is compared with the corresponding preset convergence threshold.
[0011] Further, the step of calculating the absolute value of the residual deviation and comparing it with the preset convergence threshold includes: calculating the maximum value among the absolute values of the compensated lateral deviation components of all reference marks as the absolute value of the lateral residual deviation; calculating the maximum value among the absolute values of the compensated longitudinal deviation components of all reference marks as the absolute value of the longitudinal residual deviation; calculating the maximum value among the absolute values of the compensated rotational deviation components of all reference mark pairs as the absolute value of the rotational residual deviation; if the absolute value of the lateral residual deviation is greater than or equal to the lateral convergence threshold, or the absolute value of the longitudinal residual deviation is greater than or equal to the longitudinal convergence threshold, or the absolute value of the rotational residual deviation is greater than or equal to the rotational convergence threshold, then it is determined that the current compensation has not converged, the compensated multidimensional deviation description tensor is updated again with a weighted directed acyclic deviation propagation graph, and the steps of generating servo control compensation parameter sets and performing closed-loop position compensation and dynamic convergence verification are performed sequentially for iterative compensation; a maximum number of iterations is set, and if convergence is still not achieved after the maximum number of iterations is reached, an abnormal alarm is triggered and the current multidimensional deviation description tensor and servo control compensation parameter set are recorded to the abnormal log.
[0012] An automatic compensation system for cardboard box top sheet positioning error based on vision recognition is used to implement the aforementioned automatic compensation method for cardboard box top sheet positioning error based on vision recognition. The system includes: a multidimensional deviation description tensor generation module: used to acquire cardboard box top sheet images in real time using a calibrated industrial camera, perform distortion correction and inverse perspective transformation on the acquired original top sheet images to obtain orthorectified images, extract sub-pixel coordinates of the top sheet reference marks based on the orthorectified images, and perform multidimensional registration calculations with a preset standard positioning coordinate template to generate a multidimensional deviation description tensor; and a weighted directed acyclic deviation propagation graph construction module: used to perform a sliding window operation on the multidimensional deviation description tensor along the time sampling index direction. The statistical and trend separation process yields the deviation trend component and the deviation random component. A weighted directed acyclic deviation propagation graph is constructed based on these components. The servo control compensation parameter set generation module generates the servo control compensation parameter set by inferring and calculating the attribute values of each deviation node and the propagation weights of the directed edges in the weighted directed acyclic deviation propagation graph using a pre-trained multi-dimensional error compensation model. The closed-loop position compensation and convergence verification module distributes each compensation component in the servo control compensation parameter set to the corresponding servo actuator in real time according to the execution priority marker, performing closed-loop position compensation and dynamic convergence verification to complete fully automatic real-time compensation of the paper tray face positioning error.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention effectively solves the problem of insufficient positioning accuracy caused by optical distortion, perspective projection deviation, and multi-dimensional positioning deviation coupling in the processing of cardboard box face paper by using industrial camera image acquisition and multi-dimensional image processing technology. Specifically, the Zhang Zhengyou calibration method is used to accurately solve the camera's intrinsic and extrinsic parameters. By correcting radial and tangential distortion (with reprojection error controlled within 0.3 pixels), nonlinear geometric deviations caused by lens optical characteristics are eliminated, restoring the linear mapping relationship between pixel coordinates and physical coordinates of the face paper in the distorted image. Based on the extrinsic parameter matrix, a homography matrix is constructed and an inverse perspective transformation is performed to convert the trapezoidal distortion image acquired by the tilted camera into an orthorectified image, ensuring that the pixel and physical coordinate ratios of each region of the image are consistent, providing geometrically uniform image input for subsequent positioning.
[0014] In the benchmark positioning stage, adaptive Gaussian filtering combined with Canny edge detection and connected component geometric feature filtering (area 200-800 pixels, roundness 0.75-1.0, aspect ratio 0.8-1.25) is used to achieve accurate recognition of benchmarks in complex printing backgrounds. The gray-scale centroid method is used to calculate sub-pixel level centroid coordinates, breaking through the limitation of integer pixel grids and improving the positioning accuracy to the sub-pixel level, providing high-precision coordinate data for deviation calculation.
[0015] To address the multi-dimensional coupling characteristics of positioning deviations, a third-order multi-dimensional deviation description tensor containing lateral, longitudinal, and rotational deviation components is constructed, preserving information on the spatial distribution of reference markers, deviation types, and temporal evolution. Through sliding window statistics and second-order polynomial trend separation, the deviation is decomposed into systematic trend components and random disturbance components. By combining cross-correlation coefficients and time-delay analysis, a weighted directed acyclic deviation propagation graph is constructed, explicitly characterizing the causal propagation path and intensity between deviations at different locations and in different dimensions (propagation weights are integrated with correlation coefficients and random fluctuation amplitudes), providing structured deviation correlation knowledge for the compensation model.
[0016] Finally, a joint input vector is constructed based on the topological features of the deviation propagation graph and the real-time operating parameters of the equipment. Servo control parameters are generated by reasoning through a pre-trained multi-dimensional error compensation model. Combined with a closed-loop iterative compensation mechanism (lateral residual deviation ≤ 0.1 mm, rotational residual deviation ≤ 0.05 degrees), fully automatic real-time compensation of positioning error is achieved, improving the positioning accuracy and stability of paper box surface processing. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the automatic compensation method for paper box face paper positioning error based on visual recognition in this invention; Figure 2 This is a schematic diagram of inverse perspective transformation in an embodiment of the present invention; Figure 3 This is a schematic diagram of the reference marker geometric feature screening in an embodiment of the present invention; Figure 4 This is a schematic diagram of subpixel localization using the grayscale centroid method in an embodiment of the present invention; Figure 5 This is a schematic diagram of a weighted directed acyclic deviation propagation graph in an embodiment of the present invention; Figure 6 This is a block diagram of the input feature combination of the multi-dimensional error compensation model in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the execution order of servo compensation priority in an embodiment of the present invention; Figure 8 This is a flowchart illustrating the closed-loop compensation iterative convergence verification process in an embodiment of the present invention. Figure 9 This is a functional block diagram of the automatic compensation system for paper box face paper positioning error based on visual recognition in this invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Example 1: Please see Figure 1 As shown, this embodiment provides an automatic compensation method for paper box face paper positioning error based on visual recognition, including: S1: Real-time acquisition of cardboard box face paper images using a calibrated industrial camera; distortion correction and inverse perspective transformation are performed on the acquired original face paper images to obtain orthorectified images; sub-pixel coordinates of face paper reference marks are extracted based on orthorectified images; multi-dimensional registration calculation is performed with preset standard positioning coordinate templates to generate multi-dimensional deviation description tensors. Further, step S1 includes: S11: Perform intrinsic and extrinsic parameter calibration on the industrial camera to obtain the camera intrinsic and extrinsic parameter matrices; perform radial and tangential distortion correction on the acquired original paper image based on the distortion coefficients in the camera intrinsic parameter matrix to obtain a distortion-free image; Further, step S11 includes: S111: The Zhang Zhengyou calibration method is adopted. A checkerboard calibration board is used to acquire a sequence of calibration images in multiple poses. Corner coordinates are extracted from each frame in the calibration image sequence. The camera intrinsic and extrinsic parameter matrices are solved by the correspondence between the corner coordinates and the physical coordinates of the calibration board. The camera intrinsic parameter matrix includes focal length parameters, principal point coordinates, and distortion coefficients. The extrinsic parameter matrix includes rotation matrices and translation vectors, used to describe the spatial rigid body transformation relationship between the camera coordinate system and the world coordinate system where the face paper is located. Specifically, the implementation process of the Zhang Zhengyou calibration method is as follows: The checkerboard calibration board is placed within the field of view of the industrial camera. Keeping the calibration board stationary, the pose angle and distance of the calibration board relative to the camera are changed sequentially. One frame of image is acquired in at least 15 different poses, forming a calibration image sequence. Sub-pixel level corner extraction is performed on each frame in the calibration image sequence to obtain the pixel coordinates of all checkerboard intersections in each frame. A correspondence is established between the pixel coordinates in each frame of the image and the known physical coordinates of the corresponding intersections on a checkerboard calibration board. A nonlinear optimization method that minimizes the reprojection error is used to jointly solve for the camera intrinsic and extrinsic parameter matrices. The reprojection error refers to the Euclidean distance between the calculated pixel coordinates obtained by reprojecting the calibration board's physical coordinates onto the image plane using the solved camera intrinsic and extrinsic parameter matrices, and the actually extracted pixel coordinates. For example, the reprojection error should be controlled within 0.3 pixels to meet the requirements of subsequent sub-pixel level positioning accuracy.
[0021] S112: Based on the distortion coefficients in the camera intrinsic parameter matrix, radial and tangential distortion corrections are performed on each pixel coordinate in the original image of the face paper. Bilinear interpolation is then used to reconstruct the pixel grayscale value to obtain a distortion-free image. The radial distortion correction is used to eliminate barrel or pincushion distortion caused by uneven lens curvature, and the tangential distortion correction is used to eliminate tilt distortion caused by the lens optical axis not being strictly perpendicular to the imaging plane. Specifically, the distortion correction calculation process is as follows: For any distorted pixel coordinate in the original image of the face paper, the ideal distortion-free pixel coordinate corresponding to that distorted pixel coordinate is calculated using the radial and tangential distortion parameters in the distortion coefficients, following a reverse mapping method. Since the ideal distortion-free pixel coordinate usually does not fall on an integer pixel grid, a bilinear interpolation method is used to calculate the corrected grayscale value of that pixel position by weighted averaging the grayscale values of the four nearest neighbor integer pixels surrounding the ideal distortion-free pixel coordinate. The above distortion correction and interpolation calculations are performed on all pixel coordinates in the original image of the face paper one by one to generate a distortion-free image.
[0022] Specifically, an industrial camera is installed above the processing station of printing or post-printing equipment to capture real-time images of the face paper as it passes through the processing station. Due to unavoidable optical distortion in the lens of the industrial camera during manufacturing, without distortion correction, a non-linear deviation will exist between the pixel coordinates of the reference marker in the original face paper image and their actual physical coordinates on the face paper plane. This deviation will be directly transmitted to the subsequent positioning error calculation stage, causing the error calculation result to include optical distortion components, thus failing to accurately reflect the actual positioning deviation of the face paper. Through distortion correction in step S11, the non-linear geometric distortion caused by the lens's optical characteristics in the original face paper image is eliminated, restoring a linear or approximately linear mapping relationship between the pixel coordinates in the distorted image and the physical coordinates on the face paper plane. This provides geometric accuracy assurance for the inverse perspective transformation in step S12 and the sub-pixel coordinate positioning in step S13.
[0023] S12: Calculate the homography matrix between the paper plane and the imaging plane based on the extrinsic parameter matrix. Perform inverse perspective transformation on the distorted image based on the homography matrix to eliminate trapezoidal distortion caused by camera mounting tilt and obtain an orthorectified image.
[0024] Specifically, the calculation process of the homography matrix is as follows: Since the paperboard face sheets are approximately in the same plane at the processing station, the geometric mapping relationship between the face sheet plane and the imaging plane can be described by a 3x3 homography matrix. Based on the rotation matrix and translation vector in the extrinsic parameter matrix, combined with the camera intrinsic parameter matrix, the column vector corresponding to the face sheet plane normal vector in the rotation matrix is removed, and then the homography matrix is constructed in conjunction with the translation vector and the camera intrinsic parameter matrix. The execution process of the inverse perspective transformation is as follows: For each pixel coordinate in the distorted image, the corresponding physical coordinate in the face sheet plane coordinate system is calculated using the inverse matrix of the homography matrix. Then, the physical coordinates in the face sheet plane coordinate system are mapped back to the pixel grid of the orthorectified image according to the preset spatial resolution. For coordinates that do not fall on the integer pixel grid, the grayscale value is reconstructed using the bilinear interpolation method to generate the orthorectified image. The orthorectified image is equivalent to the image acquired when the camera optical axis is strictly perpendicular to the face sheet plane, eliminating trapezoidal distortion and scale non-uniformity caused by the camera installation angle deviation. See also Figure 2This is a schematic diagram of inverse perspective transformation provided in an embodiment of this application. As shown in the figure, the left side shows an actual scene where an industrial camera is tilted and installed above a processing station. There is a tilt angle θ between the camera's optical axis and the paper plane, and four circular reference marks are set on the paper plane. Since the optical axis is not strictly perpendicular to the paper plane, the distortion-corrected image acquired by the camera exhibits trapezoidal distortion characteristics, as shown in the upper right image. Its internal pixel grid shows an uneven distribution, narrower at the top and wider at the bottom. The spacing between the reference marks closer to the camera is reduced, while the spacing between the reference marks farther from the camera is enlarged, resulting in inconsistent scale ratios at different locations in the image. After inverse perspective transformation processing based on the homography matrix, the orthorectified image in the lower right is obtained, where the pixel grid is restored to a uniform and equally spaced distribution, and the relative positional relationship between the four reference marks is consistent with the actual physical layout on the paper plane. In high-precision positioning error compensation scenarios for cardboard box face sheets, if perspective distortion is not eliminated, the coordinates of the reference markers extracted from the image will contain systematic geometric deviations introduced by the camera's tilt. These deviations are coupled with the positioning deviation of the face sheet itself, making it impossible to accurately separate the true positioning error of the face sheet in subsequent deviation calculations. By transforming the image from perspective projection space back to orthographic projection space through inverse perspective transformation, a uniform proportional relationship is ensured between the pixel coordinates at each position in the orthographically corrected image and the physical coordinates of the face sheet plane. This provides a geometrically consistent image foundation for subsequent sub-pixel-level reference marker positioning and multi-dimensional deviation registration calculations.
[0025] Specifically, in actual printing and packaging production lines, the installation position of industrial cameras is limited by factors such as equipment structure, processing station layout, and paper feed channel space. The camera's optical axis is usually not perfectly perpendicular to the paper plane, but rather at a certain angle. This tilted installation method results in perspective distortion in the acquired distorted images. This manifests as the area closer to the camera in the paper image being magnified, while the area farther from the camera is shrunk, forming a trapezoidal distortion. If perspective distortion is not eliminated, the proportional relationship between the pixel coordinates of the reference markers at different positions in the distorted image and their actual physical coordinates is inconsistent. The reference marker coordinates extracted directly from the distorted image will contain systematic geometric deviations introduced by perspective projection. These deviations will couple with the positioning deviation of the paper itself, making it impossible to accurately separate the true positioning error of the paper in subsequent deviation calculations. Step S12 transforms the distorted image from perspective projection space back to orthographic projection space of the face paper plane using a homography matrix. This ensures that the pixel coordinates at each position in the orthographically corrected image have a uniform proportional relationship with the physical coordinates on the face paper plane. This provides geometrically consistent image input for step S13, ensuring that the subsequently extracted reference marker coordinates accurately reflect the actual spatial position of the face paper at the processing station. The execution of step S12 depends on the extrinsic parameter matrix solved in step S11. Without the extrinsic parameter matrix provided in step S11, step S12 cannot calculate the homography matrix, thus preventing the inverse perspective transformation.
[0026] S13: Perform reference mark extraction and subpixel coordinate localization on the orthorectified image.
[0027] Further, step S13 includes: S131: Adaptive Gaussian filtering is applied to the orthorectified image to suppress printing ink noise, followed by Canny edge detection to obtain a binary edge image. Specifically, the adaptive Gaussian filtering process is as follows: the standard deviation parameter of the Gaussian filter kernel is adaptively adjusted according to the local gray-level variance of the orthorectified image. A smaller standard deviation is used in areas with large gray-level variance to preserve edge details, while a larger standard deviation is used in areas with small gray-level variance to fully smooth printing ink texture noise. The Canny edge detection includes three processing steps: gradient calculation, non-maximum suppression, and dual-threshold hysteresis connection. The high and low thresholds of the dual thresholds are adaptively determined based on the gradient magnitude distribution of the filtered image. The high threshold is taken as the 85th percentile of the cumulative gradient magnitude histogram, and the low threshold is 0.4 times the high threshold. After adaptive Gaussian filtering and Canny edge detection, the orthorectified image is output as a binary edge image consisting of a foreground pixel value of 1 and a background pixel value of 0.
[0028] S132: In the binary edge image, candidate reference marker regions are located through connected component analysis. Three geometric features—area, roundness, and aspect ratio—are extracted from each candidate reference marker region. Candidate reference marker regions whose three geometric features all fall within a preset geometric feature range are selected as valid reference marker regions. (See also...) Figure 3 This is a schematic diagram of the reference marker geometric feature screening provided in this application embodiment. As shown in the figure, the upper frame lists the preset geometric feature ranges, including an area range of 200 to 800 pixels, a roundness range of 0.75 to 1.0, and an aspect ratio range of 0.8 to 1.25. Below, three candidate regions extracted through connected component analysis and their geometric feature calculation results are displayed side-by-side. The candidate region on the left is circular; its area of 502, roundness of 0.95, and aspect ratio of 1.00 all fall within the preset range, and all three features are marked with a pass symbol, ultimately being determined as a valid reference marker region. The candidate region in the middle is elongated; although its area of 350 falls within the preset range, its roundness is only 0.28 and its aspect ratio is as high as 3.00, both features failing the screening and being excluded. The candidate region on the right is an irregular polygon; although its area of 680 is within the range, its roundness of 0.58 and aspect ratio of 1.37 both exceed the preset range, and it is also excluded. In printed images of cardboard box linerboards, the surface is printed with complex patterns, text, and color blocks. Edge detection generates a large number of connected regions that are not reference markers. The geometry of these regions differs significantly from that of standard circular reference markers. By using joint constraints on three geometric features—area, roundness, and aspect ratio—we can effectively distinguish between genuine reference markers and false candidate regions generated by printing texture noise. This ensures that subsequent sub-pixel localization and deviation calculations are performed only on valid reference markers, avoiding errors in compensation parameter calculations due to false detections.
[0029] S133: For each valid reference marker region, the sub-pixel-level centroid coordinates are calculated using the gray-scale centroid method. The sub-pixel-level centroid coordinates of all valid reference marker regions are then aggregated to form the actual reference coordinate set. Specifically, the calculation process of the gray-scale centroid method is as follows: For each valid reference marker region, using the smallest bounding rectangle of that region as the calculation window, the gray-scale values of each pixel within the corresponding window in the orthorectified image are extracted, and the gray-scale weighted centroid coordinates are calculated. See [link to relevant documentation] Figure 4This is a schematic diagram of subpixel localization using the grayscale centroid method provided in this application embodiment. As shown in the figure, the calculation principle of the grayscale centroid within a 5×5 pixel grid area is illustrated using this example. Each square in the grid represents a pixel unit, and the value within the square is the grayscale value of that pixel. The dashed circle represents the actual physical outline boundary of the reference mark. It can be observed that the pixel grayscale value in the central area of the reference mark is relatively high, such as reaching 245 at row 3, column 3, gradually decreasing towards the outer edges, with the grayscale value dropping to the range of 20 to 30. This reflects the gradual transition of grayscale between the edge of the reference mark and the background paper. The black dot marked by the crosshairs in the figure represents the subpixel centroid coordinates obtained through grayscale weighting calculation. This position is significantly deviated from the integer pixel center point at row 3, column 3, demonstrating the core capability of subpixel-level localization to overcome the resolution limitations of integer pixel grids. During high-speed processing of cardboard box linerboard, the actual geometric center of the reference mark usually does not fall exactly at the center of a pixel. If only integer pixel-level positioning is used, the positioning error can reach half a pixel size, corresponding to a physical distance of tens of micrometers under a high-resolution industrial camera. This quantization error will be directly transmitted to the deviation calculation stage, significantly reducing the accuracy limit of the compensation system. The gray-scale centroid method uses the spatial distribution information of the gray values of each pixel within the marked area for weighted averaging, improving the positioning accuracy to the sub-pixel level and providing high-precision coordinate input for subsequent multi-dimensional registration calculation.
[0030] Specifically, step S13 employs a combination of adaptive Gaussian filtering and Canny edge detection to extract the reference marker, a method designed specifically for the unique characteristics of printed images of cardboard box faces. The surface of cardboard box faces is typically printed with complex patterns, text, and color blocks, which manifest as rich grayscale textures and color variations in the image, creating strong background interference. Reference markers are usually designed as high-contrast circular or cross-shaped marks, with edge gradient features higher than those of the printed texture. Adaptive Gaussian filtering can smooth printed texture noise while preserving the edge sharpness of the reference marker, while the dual-threshold mechanism of Canny edge detection effectively separates the edges of the reference marker from the edges of the printed texture. Connected component analysis combined with a three-geometric-feature screening method can accurately identify the reference marker from a large number of candidate regions by utilizing the geometric differences between the reference marker and other printed elements, eliminating false candidate regions caused by printed pattern edges. The grayscale centroid method utilizes the spatial distribution information of grayscale values within the reference marker region to improve positioning accuracy from pixel-level to sub-pixel-level, which is crucial for high-precision positioning error compensation. If step S13 lacks sub-pixel level positioning capability, the deviation component calculated in the subsequent step S14 will include pixel quantization error, which can reach tens of micrometers under high-resolution cameras, reducing the upper limit of the accuracy of the compensation system.
[0031] S14: Establish a standard positioning coordinate template, perform multi-dimensional registration calculation based on the actual reference coordinate set and the standard positioning coordinate template, and generate a multi-dimensional deviation description tensor.
[0032] Further, step S14 includes: S141: Based on the design layout file of the cardboard box facesheet, extract the nominal position coordinates of each reference mark under ideal processing conditions and establish a standard positioning coordinate template. The standard positioning coordinate template includes the nominal horizontal coordinates, nominal vertical coordinates, and nominal azimuth angles between each pair of reference marks. Specifically, the design layout file is the pre-press design data file of the cardboard box facesheet, which contains the precise design coordinates of each reference mark in the facesheet plane coordinate system. Read the nominal horizontal and nominal vertical coordinates of each reference mark from the design layout file, and simultaneously calculate the angle between the line connecting each pair of adjacent reference marks and the horizontal axis of the facesheet. Use this angle as the nominal azimuth angle of the reference mark pair. Store the nominal horizontal coordinates, nominal vertical coordinates, and nominal azimuth angles of all reference marks according to the spatial topological order of the reference marks to form the standard positioning coordinate template. The standard positioning coordinate template is re-established when the production batch is changed and remains unchanged within the same production batch.
[0033] S142: Pair each sub-pixel-level centroid coordinate in the actual reference coordinate set with the corresponding nominal position coordinate in the standard positioning coordinate template point by point, and calculate the lateral deviation component and longitudinal deviation component between each pair of paired points; simultaneously calculate the rotational deviation component between the direction of the line connecting the reference marks in the actual reference coordinate set and the corresponding nominal azimuth angle in the standard positioning coordinate template. Specifically, the point-by-point pairing method is as follows: according to the spatial topological order of the reference marks, pair the i-th sub-pixel-level centroid coordinate in the actual reference coordinate set with the i-th nominal position coordinate in the standard positioning coordinate template, where i ranges from 1 to the number of valid reference mark areas. For each pair of paired points, the lateral deviation component is equal to the lateral coordinate of the sub-pixel-level centroid of the reference mark in the actual reference coordinate set minus the nominal lateral coordinate of the corresponding reference mark in the standard positioning coordinate template; the longitudinal deviation component is equal to the longitudinal coordinate of the sub-pixel-level centroid of the reference mark in the actual reference coordinate set minus the nominal longitudinal coordinate of the corresponding reference mark in the standard positioning coordinate template. The rotational deviation component is calculated as follows: For each pair of adjacent reference marks in the actual reference coordinate set, calculate the actual angle between the direction of their connecting line and the horizontal axis of the face paper. Subtract the nominal azimuth angle of the corresponding reference mark pair in the standard positioning coordinate template from the actual angle. The difference is the rotational deviation component of the reference mark pair.
[0034] S143: Assemble the lateral deviation components, longitudinal deviation components, and rotational deviation components into a third-order tensor structure according to the spatial topological order of the reference markers, generating a multidimensional deviation description tensor. Specifically, the first dimension of the multidimensional deviation description tensor corresponds to the reference marker number index, the second dimension corresponds to the deviation type index, and the third dimension corresponds to the time sampling sequence index. The deviation type index includes three deviation types: lateral deviation component, longitudinal deviation component, and rotational deviation component. The time sampling sequence index corresponds to the frame number of the continuously acquired sheet image. After acquiring one frame of sheet image and completing steps S11 to S142, the calculated lateral deviation components, longitudinal deviation components, and rotational deviation components of each reference marker are filled into the corresponding time sampling sequence index position in the multidimensional deviation description tensor. Each element in the multidimensional deviation description tensor stores the deviation value of the corresponding reference marker at the corresponding sampling time for the corresponding deviation type. For example, if four reference markers are set on the face paper, and there are three types of deviations, and 50 frames of images are continuously collected, then the size of the multidimensional deviation description tensor is 4 x 3 x 50. The deviation value of the second reference marker at the sampling time of the 10th frame for the third type of deviation (rotational deviation component) is stored in the 2nd row, 3rd column, and 10th layer position of the multidimensional deviation description tensor. This third-order tensor structure differs from ordinary two-dimensional matrices or one-dimensional vectors. The third-order tensor structure can simultaneously retain the spatial distribution information of the reference markers, the multidimensional information of the deviation types, and the temporal evolution information within the same data entity. This allows subsequent step S2 to perform statistical analysis and feature extraction along any dimension without splitting and reorganizing the data.
[0035] Specifically, in step S14, assembling the lateral deviation component, longitudinal deviation component, and rotational deviation component into a third-order tensor structure instead of a simple vector or matrix is designed based on the multi-source coupling characteristics of the paperboard faceplate positioning deviation. During high-speed printing and post-printing processing, the faceplate positioning deviation is not a simple offset in a single dimension, but simultaneously includes lateral offset in the paper feed direction, longitudinal offset perpendicular to the paper feed direction, and rotational offset around the faceplate center. Furthermore, these three deviation components are interconnected and exhibit dynamic evolution over time. For example, the rotational deviation of the faceplate can cause different projection offsets of the reference marks at different positions in the lateral and longitudinal directions, while the cumulative effect of mechanical transmission gaps can cause each deviation component to exhibit a trend-like drift over time. Using a third-order tensor structure to store the multi-dimensional deviation description tensor can fully preserve the spatial distribution characteristics, multi-dimensional coupling characteristics, and temporal evolution characteristics of the deviation, providing a structured data foundation for trend separation and deviation propagation relationship analysis in step S2. If the three deviation components are stored as independent time series, the spatial correlation information between different benchmarks and different deviation types will be lost, making it impossible for step S2 to fully analyze the propagation path and coupling mechanism of the deviation. The multidimensional deviation description tensor output by step S14 serves as the sole input variable for step S2, carrying all the original deviation information required for subsequent deviation analysis and compensation parameter generation.
[0036] S2: Perform sliding window statistical and trend separation on the multidimensional deviation description tensor along the time sampling index direction to obtain the deviation trend component and the deviation random component. Construct a weighted directed acyclic deviation propagation graph based on the deviation trend component and the deviation random component. Further, step S2 includes: S21: Along the third dimension of the multidimensional deviation description tensor, i.e., the time sampling index direction, a sliding statistical window is set for each deviation type of each reference marker. Within the sliding statistical window, the moving mean and moving standard deviation of the deviation values are calculated. Specifically, the length of the sliding statistical window is determined based on the production line paper feed speed and camera frame rate. The length of the sliding statistical window should cover the deviation values of at least 10 consecutive sampling frames to ensure the stability of the statistics. For example, if the camera frame rate is 200 frames per second and the paper feed speed is 120 meters per minute, the length of the sliding statistical window can be set to 20 frames. The sliding statistical window slides frame by frame along the time sampling index direction with a step size of 1. At each sliding statistical window position, the arithmetic mean of all deviation values within the window is calculated as the moving mean. The square root of the sum of the squares of the differences between all deviation values within the window and the moving mean, divided by the window length minus 1, is taken as the moving standard deviation. Perform the above sliding window statistics on the time series of deviation values at each benchmark index and each deviation type index position in the multidimensional deviation description tensor to obtain the corresponding moving mean series and moving standard deviation series.
[0037] S22: Perform trend separation on the time series of deviation values for each deviation type of each benchmark.
[0038] Further, step S22 includes: S221: Apply second-order polynomial least squares fitting to the deviation numerical time series to extract the low-frequency gradual variation component and obtain the deviation trend component. Specifically, the implementation process of the second-order polynomial least squares fitting is as follows: For the deviation numerical time series of the j-th deviation type with the i-th reference label in the multidimensional deviation description tensor, using the time sampling index as the independent variable and the deviation value as the dependent variable, fit the form as follows: The second-order polynomial function, where This is the index for the time sampling sequence number. , , These are the fitting coefficients. The fitting coefficients are obtained using the least squares method. , , This minimizes the sum of squared residuals between the fitted function and the time series of deviation values. The function values of the fitted second-order polynomial function at each time sampling index are used as the deviation trend components. The second-order polynomial can characterize two trend modes of deviation over time: linear drift and accelerated drift. The coefficient corresponding to linear drift is... Non-zero When the value is zero, the acceleration drift coefficient corresponds to... The case of non-zero values.
[0039] S222: Subtract the deviation trend component from the deviation value time series to obtain the deviation random component. Specifically, for the deviation value of the j-th deviation type of the i-th reference mark in the multidimensional deviation description tensor, subtract the value of the deviation trend component obtained in step S221 at the corresponding time sampling index position from the deviation value at each time sampling index position. The difference is the value of the deviation random component at that time sampling index position. The deviation trend component reflects the systematic drift caused by the deformation of the face paper and the mechanical transmission gap, while the deviation random component reflects the random disturbance caused by the high-speed paper feeding offset. At the physical level, the moisture absorption expansion or drying shrinkage of the face paper due to temperature and humidity changes during processing is a slow change process, and its influence is manifested as a low-frequency trend component in the deviation time series, which is captured by the deviation trend component; while the random jump in the face paper position caused by airflow disturbance, instantaneous slippage between the paper and the guide roller during high-speed paper feeding is manifested as a high-frequency fluctuation component in the deviation time series, which is captured by the deviation random component. The deviation value is separated into two orthogonal components: the deviation trend component and the deviation random component, so that the subsequent step S23 can establish different analysis strategies for systematic drift and random disturbance respectively.
[0040] S23: Construct a weighted directed acyclic deviation propagation graph based on the statistical properties of the deviation trend component and the deviation random component. See also Figure 5This is a schematic diagram of a weighted directed acyclic deviation propagation graph provided in an embodiment of this application. As shown in the figure, the graph contains four deviation nodes, corresponding to the longitudinal deviation of the front-end reference marker, the longitudinal deviation of the back-end reference marker, the rotational deviation of the back-end reference marker, and the lateral deviation of the back-end reference marker, respectively. Each deviation node carries three attributes: deviation trend component value, moving standard deviation value, and moving mean value. Deviation nodes are connected by directed edges, the direction of which is determined by the time delay sign of the cross-correlation coefficient of the deviation trend components, i.e., from the temporally leading deviation node to the temporally lagging deviation node, reflecting the causal temporal relationship of deviation propagation. Each directed edge is labeled with two attributes: propagation weight and time delay value. For example, the propagation weight of the longitudinal deviation of the front-end reference marker pointing to the longitudinal deviation of the back-end reference marker is 0.85, and the time delay value is 2, indicating that there is a strong correlation in deviation propagation between the two and a time delay of 2 frames. The bottom temporal causal propagation direction axis indicates the causal order of the deviation nodes from left to right, and the entire graph structure strictly maintains the acyclic property. In the high-speed cardboard box linerboard processing, the positioning deviations at different positions and in different dimensions of the linerboard are not independent of each other, but rather are causally transmitted through the rigid motion of the linerboard and the mechanical transmission chain. The weighted directed acyclic deviation propagation graph explicitly models the propagation paths, propagation intensities, and temporal relationships between these multidimensional deviations as a graph topology. This allows subsequent multidimensional error compensation models to utilize the causal prior knowledge of deviation propagation for reasoning, rather than simply mapping based on isolated deviation values, thereby improving the accuracy and consistency of compensation parameters.
[0041] Further, step S23 includes: S231: For each reference marker in the multidimensional deviation description tensor, the deviation trend component and the deviation random component for each deviation type are used as node attributes. A deviation node is created for each deviation type of each reference marker. Each deviation node carries three attributes: the deviation trend component value, the moving standard deviation value of the deviation random component, and the moving mean value. Specifically, the total number of deviation nodes equals the product of the number of reference markers and the number of deviation types. The deviation trend component value is taken from the latest time sampling index position in the deviation trend component time series, reflecting the systematic drift of the deviation at the current moment. The moving standard deviation value of the deviation random component is taken from the latest time sampling index position in the moving standard deviation sequence calculated in step S21, reflecting the random fluctuation amplitude of the deviation at the current moment. The moving mean value is taken from the latest time sampling index position in the moving mean sequence calculated in step S21, reflecting the short-term mean level of the deviation at the current moment. For example, if there are 4 reference markers on the paper and 3 deviation types, the total number of deviation nodes is 12.
[0042] S232: Calculate the cross-correlation coefficient of the deviation trend components between any two deviation nodes. Establish a directed edge between two deviation nodes whose absolute cross-correlation coefficient is greater than a preset propagation correlation threshold. The direction of the directed edge is determined by the time delay sign of the cross-correlation coefficient, i.e., from the time-advancing deviation node to the time-lag deviation node. Specifically, the calculation process of the cross-correlation coefficient is as follows: For the time series of deviation trend components corresponding to any two deviation nodes, calculate the cross-correlation function values of the two deviation trend component time series at different time delays. Take the cross-correlation function value corresponding to the time delay position with the largest absolute value among the cross-correlation function values as the cross-correlation coefficient, and record the time delay value as the time delay value. The cross-correlation function is calculated by shifting one deviation trend component time series relative to the other deviation trend component time series by a different time delay, and calculating the normalized covariance of the overlapping part of the two series at each time delay position. The propagation correlation threshold is determined based on the total number of deviation nodes and the desired graph sparsity. For example, the propagation correlation threshold can be set to 0.6, meaning that a directed edge is established only when the absolute value of the cross-correlation coefficient between the deviation trend components of two deviation nodes is greater than 0.6. If the time delay value corresponding to the cross-correlation coefficient is positive, that is, the time series of the deviation trend component of the first deviation node is ahead of the time series of the deviation trend component of the second deviation node, then the direction of the directed edge is from the first deviation node to the second deviation node; if the time delay value is negative, then the direction of the directed edge is reversed.
[0043] S233: Calculate the propagation weight for each directed edge, perform topological sorting verification on the constructed directed graph, and eliminate loops to form a weighted directed acyclic bias propagation graph. Specifically, the formula for calculating the propagation weight is: in To start from the deviation node Pointing to the deviation node The propagation weight of the directed edge, Deviation node With deviation node The cross-correlation coefficient between the trend components of the deviation. Deviation node The moving standard deviation of the random component of the deviation. Deviation node The moving standard deviation of the random component of the deviation. To prevent extremely small positive numbers with a denominator of zero, for example, The value can be set to 0.0001. The physical meaning of the propagation weight is as follows: the absolute value of the cross-correlation coefficient reflects the linear correlation strength of the deviation trend components between two deviation nodes, and the ratio of the sliding standard deviations of the deviation random components reflects the amplification or attenuation of random disturbances when the deviation propagates from the source node to the target node. When the random fluctuation amplitude of the source node is greater than that of the target node, the propagation weight increases, indicating that the signal-to-noise ratio of the deviation signal on the propagation path is high and the reliability of the propagation relationship is strong. The constructed directed graph is topologically sorted for verification. If a loop exists, the directed edge with the smallest propagation weight in the loop is deleted to eliminate the loop, ensuring that a weighted directed acyclic deviation propagation graph is finally formed. Each deviation node in the weighted directed acyclic deviation propagation graph stores three attribute values: the deviation trend component value, the sliding standard deviation value of the deviation random component, and the sliding mean value. Each directed edge stores the propagation weight value and the time delay value.
[0044] The weighted directed acyclic deviation propagation graph is a directed acyclic graph data structure used to describe the propagation relationship and influence path of multi-dimensional positioning deviations of the carton faceplate between different reference mark positions and different deviation dimensions. In traditional positioning error compensation methods, each deviation component is usually treated as an independent variable and compensated separately, ignoring the physical coupling relationship between deviations at different positions and in different dimensions. For example, the longitudinal deviation of the front reference mark of the faceplate may be transmitted to the longitudinal and rotational deviations of the rear reference mark through the rigid body motion of the faceplate. This transmission relationship has a temporal order and intensity difference. The weighted directed acyclic deviation propagation graph explicitly models this deviation propagation relationship through the topological structure of deviation nodes and directed edges. The direction of the directed edges encodes the causal time sequence of deviation propagation, and the propagation weight encodes the intensity and reliability of deviation propagation. In step S2, the multi-dimensional deviation description tensor is transformed into a weighted directed acyclic deviation propagation graph, which essentially compresses and maps the deviation information in the high-dimensional tensor space into structured relationship information in the graph topological space. The advantage of this transformation is that the weighted directed acyclic deviation propagation graph not only retains the statistical characteristics of each deviation node, but also explicitly characterizes the causal propagation path and propagation strength between deviation nodes. This allows the compensation model in step S3 to use the causal structure of deviation propagation for inference, rather than mapping based solely on isolated deviation values. Step S2 relies on the multidimensional deviation description tensor output from step S1 as its sole input. Without the accumulation of continuous frame data in the time sampling index dimension of the multidimensional deviation description tensor, the sliding window statistics in step S21 will not obtain sufficient sample size, the trend separation in step S22 will not accurately fit the deviation trend components, and the cross-correlation coefficient calculation in step S23 will lack statistical reliability.
[0045] S3: Based on the attribute values of each deviation node and the propagation weight values of the directed edges in the weighted directed acyclic deviation propagation graph, the servo control compensation parameter set is generated by inference calculation through a pre-trained multi-dimensional error compensation model. Further, step S3 includes: S31: Perform topological sorting on the weighted directed acyclic deviation propagation graph to obtain the topological execution sequence of deviation nodes; according to the order of the topological execution sequence, extract the deviation trend component value, moving standard deviation value, and moving mean value from each deviation node, and extract the propagation weight value and time delay value from each directed edge. Flatten and concatenate all extracted values into a one-dimensional feature vector according to the order of the topological execution sequence, denoted as the deviation propagation feature vector. Specifically, the execution process of the topological sorting is as follows: select a deviation node with an in-degree of zero from the weighted directed acyclic deviation propagation graph as the starting node, add it to the topological execution sequence, then delete the deviation node and all its outgoing edges from the weighted directed acyclic deviation propagation graph, and repeat the operation of selecting a deviation node with an in-degree of zero and adding it to the topological execution sequence until all deviation nodes in the weighted directed acyclic deviation propagation graph have been added to the topological execution sequence. The specific process of flattening and splicing is as follows: Following the order of the deviation nodes in the topology execution sequence, extract the three attribute values of each deviation node and arrange them sequentially. Then, following the order of the directed edges in the topology execution sequence, extract the propagation weight value and time delay value of each directed edge and arrange them sequentially. Concatenate the node attribute value portion and the edge attribute value portion end-to-end to form the deviation propagation feature vector. The dimension of the deviation propagation feature vector is equal to the number of deviation nodes multiplied by 3 plus the number of directed edges multiplied by 2.
[0046] S32: Collect real-time operating parameters of the equipment, normalize these parameters, and concatenate them with the deviation propagation feature vector to form a joint input vector. See also Figure 6Figure 1 is a block diagram of the input feature combination of the multi-dimensional error compensation model provided in this application embodiment. As shown in the figure, the input of the model is composed of two information sources. The upper left is the deviation propagation feature vector, which contains deviation node attributes (deviation trend component, sliding standard deviation, sliding mean) and directed edge attributes (propagation weight, time delay). The vector dimension is equal to the number of nodes multiplied by 3 plus the number of directed edges multiplied by 2. This vector is obtained by performing topological sorting and flattening on the weighted directed acyclic deviation propagation graph. The upper right is the real-time operating parameters of the equipment, which include three parameters: current paper feed speed, servo motor encoder feedback position, and processing station pressure value. After linear normalization, these parameters are converted into a normalized equipment operating parameter vector. The two vectors are joined end to end to form a joint input vector. This joint input vector is used as the input of the pre-trained multi-dimensional error compensation model (multi-layer fully connected neural network) for end-to-end inference calculation, and finally outputs a set of servo control compensation parameters, including lateral compensation, longitudinal compensation, and rotational compensation. In paperboard faceplate positioning error compensation, the accurate calculation of the compensation amount depends not only on the magnitude and propagation characteristics of the deviation itself, but also on the current operating conditions of the equipment. For example, at higher paper feed speeds, the response time window of the servo actuator is shorter, and the pressure value at the processing station affects the deformation during the faceplate pressing process. By integrating the deviation propagation structure information with the equipment operating status information as input, the model can comprehensively consider the multi-dimensional coupling effect of the deviation and the influence of equipment operating conditions, generating more accurate and coordinated compensation parameters.
[0047] S33: Input the joint input vector into the pre-trained multi-dimensional error compensation model for inference calculation, and output the servo control compensation parameter set.
[0048] Further, step S33 includes: S331: The multi-dimensional error compensation model is a multi-layer fully connected neural network. Its input layer dimension is consistent with the dimension of the joint input vector, and the output layer dimension corresponds to the number of servo axes requiring compensation multiplied by the number of degrees of freedom for each servo axis. Specifically, the multi-layer fully connected neural network includes one input layer, three hidden layers, and one output layer. The number of neurons in the three hidden layers decreases sequentially. For example, the first hidden layer can have 256 neurons, the second hidden layer can have 128 neurons, and the third hidden layer can have 64 neurons. Each hidden layer uses a modified linear unit as the activation function, and the output layer has no activation function, directly outputting continuous values. The multi-dimensional error compensation model is obtained through offline supervised training using the joint input vector from historical production data and the corresponding manually labeled optimal compensation parameters. The manually labeled optimal compensation parameters refer to the compensation parameter values recorded by experienced technicians who manually adjusted the servo actuator based on deviation measurement results and product quality feedback during historical production processes. These compensation parameter values ensured that the finished product processing accuracy met the qualified standard under the equipment operating conditions at that time. The training process uses mean squared error as the loss function and an adaptive learning rate gradient descent algorithm to update the network parameters. Training stops when the loss function no longer decreases for 50 consecutive training epochs on the validation set.
[0049] S332: The joint input vector is fed into the input layer of the multi-dimensional error compensation model. After nonlinear transformations in each hidden layer, the original compensation numerical sequence is generated in the output layer. Specifically, the joint input vector first undergoes a linear transformation and modified linear unit activation in the first hidden layer, outputting a first hidden layer feature vector; the first hidden layer feature vector undergoes a linear transformation and modified linear unit activation in the second hidden layer, outputting a second hidden layer feature vector; the second hidden layer feature vector undergoes a linear transformation and modified linear unit activation in the third hidden layer, outputting a third hidden layer feature vector; the third hidden layer feature vector undergoes a linear transformation in the output layer to generate the original compensation numerical sequence. The original compensation numerical sequence is a one-dimensional numerical vector with a length equal to the dimension of the output layer.
[0050] S333: The original compensation value sequence is structurally analyzed according to the servo axis number and compensation degree of freedom number. The lateral compensation amount, longitudinal compensation amount, and rotational compensation amount are assigned to the corresponding servo axis, and encapsulated to form a servo control compensation parameter group. Specifically, the structural analysis process is as follows: the original compensation value sequence is divided into several groups according to a preset arrangement rule. Each group contains three values, corresponding to the lateral compensation amount, longitudinal compensation amount, and rotational compensation amount of one servo axis, respectively. The physical meaning of the lateral compensation amount is the displacement that the servo actuator needs to adjust in the lateral direction of paper feeding, in millimeters; the physical meaning of the longitudinal compensation amount is the displacement that the servo actuator needs to adjust in the longitudinal direction of paper feeding, in millimeters; the physical meaning of the rotational compensation amount is the rotation angle that the servo actuator needs to adjust, in degrees. The three compensation components of each servo axis are subjected to amplitude limiting processing, truncating compensation amounts exceeding the preset physical safety range to the safety range boundary value. The physical safety range is determined based on the maximum stroke and maximum rotation angle of the servo actuator. For example, the physical safety range for lateral and longitudinal compensation amounts can be set to ±5 mm, and the physical safety range for rotational compensation amounts can be set to ±2 degrees. Simultaneously, an execution priority flag is assigned to each compensation component of each servo axis. The execution priority flag is determined as follows: rotational compensation has the highest execution priority, followed by longitudinal compensation, and then lateral compensation has the lowest. The physical basis for this priority setting is that rotational deviation will produce differentiated lateral and longitudinal projection deviations at different positions on the face paper. If lateral or longitudinal deviations are compensated first, followed by rotational deviation, the rotational compensation action will destroy the already completed lateral and longitudinal compensation effects. Therefore, rotational deviation should be eliminated first to reduce the cross-coupling effect between compensation actions. The amplitude-limited lateral, longitudinal, and rotational compensation amounts of each servo axis, along with their execution priority flags, are encapsulated to form a servo control compensation parameter group.
[0051] Specifically, step S3 flattens the structured information in the weighted directed acyclic deviation propagation graph into a deviation propagation feature vector and fuses it with the real-time operating parameters of the equipment. It then uses a pre-trained multi-dimensional error compensation model for nonlinear mapping, achieving end-to-end inference from the deviation feature space to the compensation parameter space. This method has advantages over traditional proportional-integral-derivative (PID) control strategies: traditional PID control can only perform feedback control based on the real-time deviation value and historical deviation accumulation of a single deviation channel, failing to utilize the propagation relationships between different deviation channels and the comprehensive information of the equipment's operating status. Step S3, however, uses the multi-channel deviation causal relationships encoded in the deviation propagation feature vector and the real-time operating parameters of the equipment as inference inputs. This allows the multi-dimensional error compensation model to fully consider the multi-dimensional coupling effect of the deviation and the influence of the equipment's operating conditions when predicting the compensation amount, thereby generating a more accurate and coordinated set of servo control compensation parameters. The execution of step S3 depends strictly on the weighted directed acyclic deviation propagation graph output by step S2. If the structured information of the deviation propagation relationship in the weighted directed acyclic deviation propagation graph is missing, step S31 will be unable to construct the deviation propagation feature vector. The input information of the multi-dimensional error compensation model will degenerate into isolated deviation values, lose the prior knowledge of deviation causal propagation, and cause the model inference accuracy to decrease.
[0052] S4: According to the execution priority flag, each compensation component in the servo control compensation parameter group is sent to the corresponding servo actuator in real time to perform closed-loop position compensation and dynamic convergence verification, and complete the fully automatic real-time compensation of paper box face paper positioning error. Further, step S4 includes: S41: The distribution order is determined according to the execution priority marker of each compensation component in the servo control compensation parameter group. The rotational compensation amount is distributed to the rotary servo axis actuator first, followed by the longitudinal compensation amount to the longitudinal servo axis actuator and the transverse compensation amount to the transverse servo axis actuator in sequence. After receiving the corresponding compensation component, each servo actuator drives the servo motor to perform position fine-tuning using pulse commands. Specifically, the distribution process is implemented through an industrial real-time Ethernet communication bus with a communication cycle of no more than 1 millisecond to meet the timeliness requirements of compensation under high-speed paper feeding conditions. The rotary servo axis actuator is installed on the paper positioning platform of the processing station, and the rotating platform drives the paper to perform angle fine-tuning around the center of the positioning platform. The longitudinal servo axis actuator is installed on the adjusting roller group in the paper feeding direction, and the longitudinal displacement of the adjusting roller group drives the paper to perform position fine-tuning in the paper feeding direction. The transverse servo axis actuator is installed on the lateral guide mechanism in the paper feeding direction, and the lateral displacement of the lateral guide mechanism drives the paper to perform position fine-tuning perpendicular to the paper feeding direction. After receiving the compensation component, each servo actuator converts it into the number of pulse commands for the corresponding servo motor. The number of pulse commands is calculated by dividing the displacement of the compensation component by the equivalent single-pulse displacement of the servo motor, where the equivalent single-pulse displacement is determined by the encoder resolution and mechanical transmission ratio of the servo motor. Pulse commands are sent sequentially according to the execution priority order of rotational compensation, longitudinal compensation, and lateral compensation, and the next compensation component's pulse command is sent only after the corresponding servo motor has completed its position fine-tuning. The criterion for determining whether each servo motor has completed its position fine-tuning is that the absolute value of the difference between the encoder feedback position and the target position is less than the equivalent single-pulse displacement. (See also...) Figure 7This is a schematic diagram illustrating the priority sequence of servo compensation provided in this application embodiment. As shown in the figure, the horizontal time axis is arranged with three compensation execution stages from left to right. The first stage is the rotation compensation stage, marked with the highest priority. The rotation servo actuator receives a rotation compensation amount of 0.08 degrees and performs angle fine-tuning. After confirming the completion of the rotation fine-tuning, the second stage, the longitudinal compensation stage, marked with the second highest priority, is entered. The longitudinal servo actuator receives a longitudinal compensation amount of 0.15 mm and performs longitudinal position fine-tuning. After confirming the completion of the longitudinal fine-tuning, the third stage, the lateral compensation stage, marked with the lowest priority, is entered. The lateral servo actuator receives a lateral compensation amount of 0.12 mm and performs lateral position fine-tuning. The stages are connected by a dashed feedback path, marking the signal transmission relationship confirming the completion of fine-tuning, ensuring that the execution of the next stage is triggered only after the compensation action of the previous stage is completed. The physical basis of this sequential execution strategy is that rotational deviation will produce differentiated lateral and longitudinal projection deviations at different positions on the paper. If the lateral or longitudinal deviation is compensated first and then the rotational deviation is compensated, the rotation compensation action will destroy the completed lateral and longitudinal compensation effects, causing cross-coupling interference between compensation actions. By prioritizing the elimination of rotational deviations, followed by longitudinal and lateral deviations, the mutual influence between multi-dimensional compensation actions is effectively avoided, improving the effectiveness of a single compensation iteration and reducing the number of iterations required to achieve convergence.
[0053] S42: After each servo actuator completes its position fine-tuning, the industrial camera is triggered to re-acquire the paper image at the compensated station. Following the processing flow of steps S11 to S14 in step S1, the compensated multidimensional deviation description tensor is recalculated, and the compensated lateral deviation component, longitudinal deviation component, and rotational deviation component are extracted. Specifically, the timing for triggering the industrial camera to re-acquire the paper image is as follows: after the confirmation signal indicating that the lateral servo axis actuator has completed its position fine-tuning arrives, an acquisition trigger signal is sent to the industrial camera via the industrial real-time Ethernet communication bus. Upon receiving the acquisition trigger signal, the industrial camera immediately acquires one frame of the paper image. The image of the frame paper is processed as follows: distortion correction in step S111, distortion removal in step S112, inverse perspective transformation in step S12, edge detection in step S131, connected component analysis and geometric feature filtering in step S132, subpixel localization using the gray-scale centroid method in step S133, standard positioning coordinate template reading in step S141, deviation component calculation in step S142, and tensor assembly in step S143, to obtain a compensated multidimensional deviation description tensor. The lateral deviation component, longitudinal deviation component, and rotational deviation component of each reference marker at the latest time sampling index position are extracted from the compensated multidimensional deviation description tensor and denoted as the compensated lateral deviation component, compensated longitudinal deviation component, and compensated rotational deviation component, respectively.
[0054] S43: Calculate the absolute value of the residual deviation for the compensated lateral deviation component, the compensated longitudinal deviation component, and the compensated rotational deviation component, and compare each absolute value of the residual deviation with the corresponding preset convergence threshold.
[0055] Further, step S43 includes: S431: Calculate the maximum value among the absolute values of the compensated lateral deviation components of all reference marks, as the absolute value of the lateral residual deviation; calculate the maximum value among the absolute values of the compensated longitudinal deviation components of all reference marks, as the absolute value of the longitudinal residual deviation; calculate the maximum value among the absolute values of the compensated rotational deviation components of all reference mark pairs, as the absolute value of the rotational residual deviation. The preset convergence threshold includes three components: lateral convergence threshold, longitudinal convergence threshold, and rotational convergence threshold, which are used to determine whether the compensation in the lateral, longitudinal, and rotational directions has converged. The preset convergence threshold is determined according to the processing accuracy standard of the finished paperboard. For example, the lateral convergence threshold and longitudinal convergence threshold can be set to 0.1 mm, and the rotational convergence threshold can be set to 0.05 degrees. If the absolute value of the lateral residual deviation is less than the lateral convergence threshold, the absolute value of the longitudinal residual deviation is less than the longitudinal convergence threshold, and the absolute value of the rotational residual deviation is less than the rotational convergence threshold, that is, all the absolute values of the residual deviations are less than the corresponding preset convergence thresholds, then the compensation is determined to be converged, the current position of the servo actuator is maintained, and the process restarts from step S1 after the next sheet of paper enters the processing station.
[0056] S432: If the absolute value of the lateral residual deviation is greater than or equal to the lateral convergence threshold, or the absolute value of the longitudinal residual deviation is greater than or equal to the longitudinal convergence threshold, or the absolute value of the rotational residual deviation is greater than or equal to the rotational convergence threshold, that is, if the absolute value of any residual deviation is greater than or equal to the corresponding preset convergence threshold, then it is determined that the compensation has not converged. The compensated multidimensional deviation description tensor is re-sent to step S2 to update the weighted directed acyclic deviation propagation graph, and steps S3 and S4 are executed in sequence to perform iterative compensation. Specifically, the execution process of the iterative compensation is as follows: The original multidimensional deviation description tensor in step S2 is replaced with the compensated multidimensional deviation description tensor as input. Steps S21 (sliding window statistics), S22 (trend separation), and S23 (weighted directed acyclic deviation propagation graph construction) are re-executed to obtain an updated weighted directed acyclic deviation propagation graph. The updated weighted directed acyclic deviation propagation graph is then fed into step S3 for inference calculation to obtain a new set of servo control compensation parameters. The new set of servo control compensation parameters is then sent to step S41 for execution, verified in step S42, and convergence is determined in step S43. In each iterative compensation process, the deviation values in the compensated multidimensional deviation description tensor theoretically show a decreasing trend until the absolute values of all residual deviations are less than the corresponding preset convergence threshold.
[0057] S433: Set the maximum number of iterations for compensation. If convergence is not achieved after reaching the maximum number of iterations, an anomaly alarm is triggered, and the multidimensional deviation description tensor and servo control compensation parameter set of the current paper are recorded in the anomaly log for offline analysis and retraining of the multidimensional error compensation model. The maximum number of iterations for compensation is determined based on the production line cycle time and the time required for a single compensation iteration. It should ensure that the entire iterative compensation process is completed before the paper leaves the processing station. For example, the maximum number of iterations for compensation can be set to 3. The information recorded in the anomaly log includes: the number of the current paper, the multidimensional deviation description tensor at each iteration of compensation, the servo control compensation parameter set generated at each iteration of compensation, the absolute value of the residual deviation after each iteration of compensation, and the real-time operating parameters of the equipment at the time of the anomaly. The anomaly log is used to analyze the reasons for non-convergence of compensation in offline mode. Possible reasons include the paper deformation exceeding the generalization range of the compensation model, servo actuator response lag, or positioning dead zone of the servo motor. Technicians can use data samples accumulated in the anomaly logs to incrementally train or retrain the multi-dimensional error compensation model, thereby expanding its adaptability to abnormal operating conditions. See also... Figure 8 This is a flowchart of the closed-loop compensation iterative convergence verification provided in the embodiments of this application.
[0058] Specifically, step S4, through a closed-loop position compensation and dynamic convergence verification mechanism, transforms the servo control compensation parameter set output in step S3 into actual servo motor execution actions. It then verifies the compensation effect by re-acquiring the paper image and calculating the compensated multidimensional deviation description tensor, forming a complete closed-loop control loop from visual detection to servo execution and then to visual verification. This closed-loop compensation mechanism has a fundamental advantage over the open-loop compensation method: open-loop compensation directly generates and executes compensation commands based solely on the detected deviation value, without verifying the execution results. It cannot detect deviations between the actual compensation amount and the commanded compensation amount caused by factors such as servo motor response errors, mechanical transmission backlash, and reverse backlash, nor can it handle new paper position disturbances caused by the compensation action itself. In contrast, the closed-loop mechanism in step S4, by re-executing the visual detection process of step S1 after each compensation action, can obtain the real deviation state after compensation in real time. If the compensation effect does not reach the preset convergence threshold, it re-enters steps S2 and S3 for iterative optimization based on the compensated deviation information until the deviation converges or the maximum number of iterations is reached. In the iterative compensation process, the input multidimensional deviation description tensor for each iteration is the latest post-compensation deviation state, ensuring that the weighted directed acyclic deviation propagation graph and deviation propagation feature vector can reflect the residual deviation distribution and propagation relationship after compensation. This allows the servo control compensation parameter set generated by the multidimensional error compensation model in each iteration to have progressive correction characteristics. By setting a maximum number of iterations and an abnormal log recording mechanism, abnormal working conditions are captured and the multidimensional error compensation model is continuously optimized while ensuring production efficiency. This enables the entire vision-based automatic paper box face positioning error compensation system to continuously improve compensation accuracy and robustness during long-term operation. In step S4, a priority-marked sequential compensation strategy is executed. By prioritizing the elimination of rotational deviation, and then sequentially eliminating longitudinal and lateral deviations, the cross-coupling interference between multidimensional compensation actions is effectively avoided, improving the effectiveness of a single compensation iteration. This reduces the number of iterations required to reach convergence, shortens the total compensation time, and allows the closed-loop compensation process to be completed within a limited time window under high-speed paper feeding conditions.
[0059] For example, a paperboard faceplate processing production line operating at 80 meters per minute is used as a workflow example. The industrial camera is a 5-megapixel industrial area scan camera, with a frame rate set to 200 frames per second, mounted approximately 400 mm above the processing station. The camera's optical axis has an approximately 12-degree tilt angle with the faceplate plane. Four circular reference marks, each 3 mm in diameter, are printed with high-contrast black ink on the white area of the faceplate surface. The production line is equipped with three servo axes: a horizontal servo axis, a vertical servo axis, and a rotary servo axis. The single-pulse displacement equivalents of each servo axis are 0.01 mm, 0.01 mm, and 0.005 degrees, respectively. During the calibration phase, the Zhang Zhengyou calibration method is used to acquire a sequence of calibration images at 20 different orientations, and the camera's intrinsic and extrinsic parameter matrices are obtained, with a reprojection error of 0.18 pixels. During production operation, the industrial camera continuously acquires faceplate images at a rate of 200 frames per second. For the acquired raw images of the tissue paper, radial and tangential distortion corrections are first performed based on the distortion coefficients in the camera's intrinsic parameter matrix to obtain a distortion-free image. Then, the homography matrix is calculated based on the extrinsic parameter matrix, and an inverse perspective transformation is performed on the distortion-free image to eliminate trapezoidal distortion caused by a 12-degree tilt angle, resulting in an orthorectified image. Next, adaptive Gaussian filtering and Canny edge detection are performed on the orthorectified image to obtain a binary edge image. Four effective reference marker regions are located through connected component analysis and geometric feature filtering. The sub-pixel-level centroid coordinates of each effective reference marker region are calculated using the gray-scale centroid method to form an actual reference coordinate set. Finally, the actual reference coordinate set is registered with a standard positioning coordinate template, and the lateral, longitudinal, and rotational deviation components of each reference marker are calculated, assembling to generate a 4x3x50 multidimensional deviation description tensor. After the system continuously runs and accumulates 50 frames of data, sliding window statistics and trend separation are performed on the multidimensional deviation description tensor along the time sampling index direction to obtain the deviation trend component and deviation random component for each reference marker at each deviation type. A weighted directed acyclic deviation propagation graph containing 12 deviation nodes is constructed based on the deviation trend component and the deviation random component. The weighted directed acyclic deviation propagation graph is topologically sorted, flattened, and stitched together to generate a deviation propagation feature vector. This feature vector is then stitched together with the normalized real-time operating parameters of the equipment to form a joint input vector, which is fed into a pre-trained multi-dimensional error compensation model for inference, outputting a set of servo control compensation parameters. According to the execution priority marking, a rotational compensation of 0.08 degrees is first issued to the rotary servo axis actuator for rotational fine-tuning. After confirming the rotational fine-tuning is complete, a longitudinal compensation of 0.15 mm is issued to the longitudinal servo axis actuator for longitudinal fine-tuning. After confirming the longitudinal fine-tuning is complete, a lateral compensation of 0.12 mm is issued to the lateral servo axis actuator for lateral fine-tuning. After all servo axes have completed position fine-tuning, the industrial camera is triggered to re-acquire the paper image, and the compensated multi-dimensional deviation description tensor is calculated according to the process in step S1.Extract the compensated lateral deviation component, compensated longitudinal deviation component, and compensated rotational deviation component of each reference mark from the compensated multidimensional deviation description tensor. Calculate the absolute value of the lateral residual deviation: if it is 0.03 mm, which is less than the lateral convergence threshold of 0.1 mm; the absolute value of the longitudinal residual deviation: if it is 0.05 mm, which is less than the longitudinal convergence threshold of 0.1 mm; and the absolute value of the rotational residual deviation: if it is 0.02 degrees, which is less than the rotational convergence threshold of 0.05 degrees, then the compensation is considered to have converged. Maintain the current position of the servo actuator and wait for the next sheet of paper to enter the processing station.
[0060] Example 2: This embodiment, based on Embodiment 1, provides an automatic compensation system for paper box face paper positioning errors based on vision recognition, such as... Figure 9 As shown, it includes: Multidimensional deviation description tensor generation module: It is used to acquire images of cardboard box face paper in real time through a calibrated industrial camera, perform distortion correction and inverse perspective transformation on the acquired original face paper images to obtain orthorectified images, extract sub-pixel coordinates of face paper reference marks based on orthorectified images, and perform multidimensional registration calculation with preset standard positioning coordinate templates to generate multidimensional deviation description tensors. The weighted directed acyclic deviation propagation graph construction module is used to perform sliding window statistical and trend separation on the multidimensional deviation description tensor along the time sampling index direction to obtain the deviation trend component and the deviation random component, and to construct a weighted directed acyclic deviation propagation graph based on the deviation trend component and the deviation random component. Servo control compensation parameter set generation module: Based on the attribute values of each deviation node and the propagation weight values of the directed edges in the weighted directed acyclic deviation propagation graph, the module performs inference calculations through a pre-trained multi-dimensional error compensation model to generate the servo control compensation parameter set. Closed-loop position compensation and convergence verification module: It is used to send each compensation component in the servo control compensation parameter group to the corresponding servo actuator in real time according to the execution priority mark, perform closed-loop position compensation and dynamic convergence verification, and complete the fully automatic real-time compensation of paper box face paper positioning error.
Claims
1. A method for automatic compensation of paper box face paper positioning error based on visual recognition, characterized in that, include: S1: Real-time acquisition of cardboard box face paper images using a calibrated industrial camera; distortion correction and inverse perspective transformation are performed on the acquired original face paper images to obtain orthorectified images; sub-pixel coordinates of face paper reference marks are extracted based on orthorectified images; multi-dimensional registration calculation is performed with preset standard positioning coordinate templates to generate multi-dimensional deviation description tensors. S2: Perform sliding window statistics and trend separation on the multidimensional deviation description tensor along the time sampling index direction to obtain the deviation trend component and the deviation random component, and construct a weighted directed acyclic deviation propagation graph based on the deviation trend component and the deviation random component. S3, based on the attribute values of each deviation node and the propagation weight values of the directed edges in the weighted directed acyclic deviation propagation graph, performs inference calculations through a pre-trained multi-dimensional error compensation model to generate a set of servo control compensation parameters. S4 sends each compensation component in the servo control compensation parameter group to the corresponding servo actuator in real time according to the execution priority mark, performs closed-loop position compensation and dynamic convergence verification, and completes fully automatic real-time compensation for paper box surface positioning error.
2. The method according to claim 1, characterized in that, The distortion correction and inverse perspective transformation include: Perform intrinsic and extrinsic parameter calibration on the industrial camera to obtain the camera's intrinsic and extrinsic parameter matrices; Radial and tangential distortion corrections are performed on the original image of the paper sheet based on the distortion coefficients in the camera intrinsic parameter matrix to obtain a distortion-free image. The homography matrix between the paper plane and the imaging plane is calculated based on the extrinsic parameter matrix. Based on the homography matrix, an inverse perspective transformation is performed on the distorted image to eliminate trapezoidal distortion caused by camera mounting tilt, thereby obtaining an orthorectified image.
3. The method according to claim 2, characterized in that, The radial distortion correction and tangential distortion correction include: for any distorted pixel coordinate in the original image of the paper, the ideal undistorted pixel coordinate corresponding to the distorted pixel coordinate is calculated according to the radial distortion parameter and tangential distortion parameter in the distortion coefficient, and the corrected gray value of the pixel position is obtained by weighted averaging of the gray values of the four nearest neighbor integer pixels around the ideal undistorted pixel coordinate using bilinear interpolation. The distortion-free image is generated one by one for all pixel coordinates.
4. The method according to claim 2, characterized in that, The perspective inverse transformation includes: removing the column vectors corresponding to the normal vector of the face paper plane from the rotation matrix in the extrinsic parameter matrix, and then constructing a homography matrix in conjunction with the translation vector and the camera intrinsic parameter matrix; for each pixel coordinate in the distorted image, calculating the corresponding physical coordinates of the pixel coordinates in the face paper plane coordinate system using the inverse matrix of the homography matrix, mapping them back to the pixel grid of the orthorectified image according to a preset spatial resolution, and reconstructing the grayscale values using a bilinear interpolation method to generate an orthorectified image.
5. The method according to claim 1, characterized in that, The extraction of subpixel coordinates of the paper reference marks includes: performing adaptive Gaussian filtering on the orthorectified image to suppress printing ink noise, and then performing Canny edge detection to obtain a binary edge image; locating candidate reference mark regions in the binary edge image through connected component analysis, extracting the area, roundness, and aspect ratio of each candidate reference mark region, and selecting candidate reference mark regions whose three geometric features all fall within the preset geometric feature range as valid reference mark regions; calculating subpixel-level centroid coordinates for each valid reference mark region using the gray-scale centroid method, and compiling them to form an actual reference coordinate set.
6. The method according to claim 1, characterized in that, The generation of the multidimensional deviation description tensor includes: pairing each sub-pixel-level centroid coordinate in the actual reference coordinate set with the corresponding nominal position coordinate in the standard positioning coordinate template point by point, calculating the lateral deviation component and the longitudinal deviation component between each pair of paired points, and simultaneously calculating the rotational deviation component between the direction of the line connecting the reference markers and the nominal azimuth angle; assembling the lateral deviation component, the longitudinal deviation component, and the rotational deviation component into a third-order tensor structure according to the spatial topological order of the reference markers, wherein the first-order dimension corresponds to the reference marker number index, the second-order dimension corresponds to the deviation type index, and the third-order dimension corresponds to the time sampling sequence number index.
7. The method according to claim 1, characterized in that, The trend separation includes: applying second-order polynomial least squares fitting to the time series of deviation values for each type of deviation for each benchmark mark, extracting low-frequency gradient components to obtain deviation trend components; subtracting the deviation trend components from the deviation value time series to obtain deviation random components; the deviation trend components reflect the systematic drift caused by paper deformation and mechanical transmission gap, and the deviation random components reflect the random disturbances caused by high-speed paper feed offset.
8. The method according to claim 1, characterized in that, The construction of the weighted directed acyclic deviation propagation graph includes: creating a deviation node for each deviation type of each benchmark label, with each deviation node carrying a deviation trend component value, a moving standard deviation value, and a moving mean value; calculating the cross-correlation coefficient of the deviation trend components between any two deviation nodes, establishing a directed edge between two deviation nodes whose absolute value of the cross-correlation coefficient is greater than the propagation association threshold, with the direction of the directed edge determined by the time delay sign of the cross-correlation coefficient; determining the propagation weight of each directed edge based on the cross-correlation coefficient of the deviation trend components and the moving standard deviation value of the deviation random components, and performing topological sorting verification and loop elimination to form a weighted directed acyclic deviation propagation graph.
9. The method according to claim 8, characterized in that, The propagation weight is used to characterize the linear correlation strength of the deviation trend component between two deviation nodes and the amplification or attenuation degree of random disturbance when the deviation propagates from the source node to the target node. The loop elimination includes: when there is a loop in the constructed directed graph, deleting the directed edge with the smallest propagation weight in the loop to ensure that the formed graph structure is a directed acyclic graph.
10. The method according to claim 1, characterized in that, The generation of the servo control compensation parameter set includes: performing topological sorting on the weighted directed acyclic deviation propagation graph to obtain a topological execution sequence; extracting attribute values from each deviation node, propagation weight values from each directed edge, and time delay values from the topological execution sequence; flattening and splicing them into a deviation propagation feature vector; collecting real-time operating parameters of the device, normalizing them, and splicing them with the deviation propagation feature vector to form a joint input vector; inputting the joint input vector into a pre-trained multilayer fully connected neural network for inference, outputting the original compensation value sequence, and encapsulating it into a servo control compensation parameter set after structured analysis and amplitude limiting processing.
11. The method according to claim 1, characterized in that, The closed-loop position compensation includes: prioritizing the distribution of rotational compensation amounts to the rotary servo axis actuators according to the execution priority marker; after confirming that the rotational fine-tuning is completed, sequentially distributing longitudinal compensation amounts to the longitudinal servo axis actuators and lateral compensation amounts to the lateral servo axis actuators; after each servo actuator completes the position fine-tuning, triggering the industrial camera to re-acquire the paper image, and recalculating the compensated multidimensional deviation description tensor according to the method of generating multidimensional deviation description tensor as described in claim 1, and extracting each deviation component after compensation.
12. A visual recognition-based automatic compensation system for paper box faceplate positioning error, used to implement the visual recognition-based automatic compensation method for paper box faceplate positioning error as described in any one of claims 1-11, characterized in that, The system includes: Multidimensional deviation description tensor generation module: It is used to acquire images of cardboard box face paper in real time through a calibrated industrial camera, perform distortion correction and inverse perspective transformation on the acquired original face paper images to obtain orthorectified images, extract sub-pixel coordinates of face paper reference marks based on orthorectified images, and perform multidimensional registration calculation with preset standard positioning coordinate templates to generate multidimensional deviation description tensors. The weighted directed acyclic deviation propagation graph construction module is used to perform sliding window statistical and trend separation on the multidimensional deviation description tensor along the time sampling index direction to obtain the deviation trend component and the deviation random component, and to construct a weighted directed acyclic deviation propagation graph based on the deviation trend component and the deviation random component. Servo control compensation parameter set generation module: Based on the attribute values of each deviation node and the propagation weight values of the directed edges in the weighted directed acyclic deviation propagation graph, the module performs inference calculations through a pre-trained multi-dimensional error compensation model to generate the servo control compensation parameter set. Closed-loop position compensation and convergence verification module: It is used to send each compensation component in the servo control compensation parameter group to the corresponding servo actuator in real time according to the execution priority mark, perform closed-loop position compensation and dynamic convergence verification, and complete the fully automatic real-time compensation of paper box face paper positioning error.