Dynamic paper offset compensation method and system based on machine vision
By using machine vision and Kalman filtering technology to obtain paper offset and rotation angle in real time, the problem of the inability to compensate for dynamic paper offset in real time is solved, improving printing accuracy and stability and reducing resource waste.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-10
AI Technical Summary
In existing printing technologies, the dynamic offset of paper during the printing process cannot be obtained in real time, cannot be dynamically predicted and compensated, has insufficient compensation accuracy, and lacks closed-loop feedback control, resulting in unstable print quality.
A machine vision-based dynamic paper offset compensation method is adopted. The paper edge is scanned in real time by a line scan CCD camera to obtain physical coordinates. Kalman filtering is used to predict the paper posture to achieve dynamic compensation control.
It enables precise perception of the actual operating status of the paper, improves the timeliness and accuracy of compensation, reduces the risk of edge ink overflow and image offset, and improves print quality and resource utilization efficiency.
Smart Images

Figure CN121821973A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of equipment anomaly detection technology, and in particular to a dynamic paper offset compensation method and system based on machine vision. Background Technology
[0002] In today's inkjet printing, photo printing, and commercial printing equipment, borderless printing has been widely adopted to enhance image quality and user experience. In borderless printing, the printer needs to arrange high-density ink dots at the edges of the paper to achieve a visually "full-page" output. However, in actual printing, the paper's movement in the paper feed path is often not ideal. Affected by factors such as the precision of the paper feed mechanism, changes in friction, differences in paper rigidity, and uneven roller pressure, the paper commonly exhibits dynamic motion characteristics such as lateral shift, slight rotation, and periodic jitter during printing. These shifts typically change on the order of milliseconds, are random and unpredictable, and cause continuous relative errors between the actual position of the paper and the image ejection position.
[0003] Clearly, in relevant printing technologies, mainstream solutions generally employ pre-compensation methods based on a fixed offset assumption to address potential paper misalignment. For example, existing borderless printing technologies often uniformly enlarge the image by 3-5mm during the RIP stage to create redundant printing areas at the paper edges, attempting to cover potential misalignment errors. However, the fundamental premise of such pre-compensation methods is that the paper's offset throughout the entire printing cycle is preset and fixed. This approach essentially relies on the paper feed sensor detecting the initial position of the paper and assumes that the paper follows an ideal trajectory in subsequent movement; therefore, "compensation" can be achieved simply by expanding the image edge once. In practice, the print controller controls the nozzles based on the pre-expanded image data, using redundant ink dots to cover potential geometric errors.
[0004] However, this type of pre-compensation technology based on the fixed offset assumption has inherent technical bottlenecks. For example, its compensation strategy is based on the static offset assumption and cannot be adaptively adjusted according to the paper posture to obtain the paper's rotation angle. Therefore, it has obvious shortcomings in terms of accuracy, reliability and resource utilization. Summary of the Invention
[0005] (a) Technical problems to be solved
[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a dynamic paper offset compensation method and system based on machine vision, which solves the technical problems in the prior art that cannot obtain the actual running posture of the paper in real time, cannot dynamically predict and compensate for paper offset, have insufficient compensation accuracy, and lack closed-loop feedback control in the compensation process.
[0007] (II) Technical Solution
[0008] To achieve the above objectives, the main technical solutions adopted in this application include:
[0009] In a first aspect, embodiments of this application provide a dynamic paper offset compensation method based on machine vision, the method comprising:
[0010] During the printing process, the paper edge is scanned according to a preset sampling period to obtain the physical coordinates of the paper edge in each sampling period.
[0011] Based on the physical coordinates of the paper edge in the first sampling period, the paper offset and rotation angle are obtained, and based on the paper offset and rotation angle, the paper state vector is obtained.
[0012] Based on the pre-constructed state transition matrix F and observation matrix H, the state vector is filtered and updated using Kalman filtering to obtain the filtered and corrected state vector. Based on the filtered and corrected state vector and the state transition matrix F, the paper posture for the next N sampling periods is predicted, where N is an integer greater than 1.
[0013] Based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling period, and the paper posture in the next N sampling periods, the printer is controlled to achieve dynamic compensation for paper printing within the compensation period.
[0014] Preferably, in some embodiments of this application, the process of obtaining the physical coordinates of the paper edge for each sampling period includes:
[0015] During the printing process, a line-scanning CCD camera is used to capture edge images of the paper according to a preset sampling period, and edge detection is performed on the captured edge images to obtain the pixel coordinates of the paper edge.
[0016] The pixel coordinates of the paper edge are converted into corresponding physical coordinates using a pre-obtained coordinate transformation matrix T used to convert pixel coordinates into physical coordinates, thereby obtaining the physical coordinates of the paper edge corresponding to this sampling period.
[0017] The coordinate transformation matrix T is determined during the calibration of the line scan CCD camera based on the mapping relationship between its pixel coordinates and the printer's physical coordinates.
[0018] Preferably, in some embodiments of this application, the process of obtaining the paper offset and rotation angle includes:
[0019] Based on the physical coordinates of the paper edge obtained in the first sampling period, where:
[0020] The average value of the horizontal physical coordinates of the left and right edges of the paper within the sampling period is taken as the physical position of the paper's geometric center in the X direction, and the difference between this physical position and the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is taken as the paper's offset in the X direction.
[0021] The physical position of the paper's geometric center in the Y direction is calculated using the longitudinal physical coordinates of the paper's leading edge and the paper's length parameters within the sampling period. The difference between this physical position and the reference position of the paper's reference geometric center in the Y direction in the reference paper edge model is taken as the paper's offset in the Y direction.
[0022] By fitting a straight line to the physical coordinates of the paper's leading edge during the sampling period, the rotation angle of the paper relative to the paper's reference leading edge line in the reference paper edge model is obtained.
[0023] The angular velocity of the paper is obtained based on the rotation angle of the first sampling period and the rotation angle of the previous sampling period.
[0024] in, , The rotation angle for the first sampling period; This represents the rotation angle of the previous sampling period in the first sampling period; The sampling period; The angular velocity of the paper;
[0025] The reference paper edge model includes the reference left edge position, the reference right edge position, and the reference front straight line;
[0026] The reference paper edge model is constructed by acquiring paper edge images under normal printer operating conditions, and determining the reference left edge position, reference right edge position, and reference leading edge line of the paper based on the acquired paper edge images.
[0027] Preferably, in some embodiments of this application, the state vector is:
[0028] X={x pos y pos ,θ,v x v y , };
[0029] X is the state vector; x pos y represents the physical position of the geometric center of the paper in the X direction; pos θ represents the physical position of the paper's geometric center in the Y direction; θ is the paper's rotation angle; v x v is the velocity of the paper in the X direction. yThe preset speed of the paper in the Y direction;
[0030] In this context, the paper's speed in the X direction is 0, and the paper's speed in the Y direction is the paper's transport speed in the printer.
[0031] Preferably, in some embodiments of this application, predicting the paper orientation process over the next N sampling periods includes:
[0032] Based on the pre-constructed state transition matrix F, process noise matrix Q, observation noise matrix R, and observation matrix H according to the uniform motion characteristics of paper, Kalman filtering is used to predict and filter the paper state vector to obtain the filtered and corrected state vector.
[0033] Based on the filtered and corrected state vector, the state transition matrix F is applied N times consecutively to predict the state vector of the paper for the next N sampling periods. Based on the state vector of the paper for the next N sampling periods, the paper posture for the next N sampling periods is determined.
[0034] The paper posture includes the physical position of the paper's geometric center in the X direction, the physical position of the paper's geometric center in the Y direction, and the paper's rotation angle.
[0035] Preferably, in some embodiments of this application, controlling the printer includes:
[0036] Based on the paper posture of the next N sampling periods, obtain the paper offset in the X direction, the paper offset in the Y direction, and the paper rotation angle for the next N sampling periods.
[0037] Based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling period, and the paper offset in the X direction, the paper offset in the Y direction, and the paper rotation angle in the next N sampling periods, the average value of the paper offset in the X direction, the average value of the paper offset in the Y direction, and the average value of the paper rotation angle in all sampling periods within the compensation period are obtained.
[0038] The compensation period includes M sampling periods, where M = N + 1;
[0039] Based on the average value of the paper offset in the X direction, the average value of the paper offset in the Y direction, and the average value of the paper rotation angle in all sampling cycles within the compensation cycle, and the preset ranges of the X-direction offset, Y-direction offset, and rotation angle, the printer is controlled to achieve dynamic compensation for paper printing within the compensation cycle.
[0040] Preferably, in some embodiments of this application, the process of obtaining the paper's offset in the X direction and the paper's offset in the Y direction for the next N sampling periods includes:
[0041] For each of the next N sampling periods, the average value of the horizontal physical coordinates of the left and right edges of the paper within that sampling period is taken as the physical position of the paper's geometric center in the X direction, and the difference between this physical position and the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is taken as the paper's offset in the X direction corresponding to that sampling period.
[0042] For each of the next N sampling periods, the physical position of the paper's geometric center in the Y direction is calculated by combining the longitudinal physical coordinates of the paper's leading edge with the paper length parameter within that sampling period. The difference between this physical position and the reference position of the paper's geometric center in the Y direction corresponding to the position of that sampling period, obtained in advance based on the printer's stable operating state, is taken as the offset of the paper in the Y direction corresponding to that sampling period.
[0043] Preferably, in some embodiments of this application, controlling the printer specifically includes:
[0044] If the average offset of all sampled paper in the X direction within the compensation period falls within a preset range of X-direction offset, the starting position of the printer nozzle is shifted to the left or right based on the average offset of all sampled paper in the X direction within the compensation period.
[0045] If the average value of the offset in the Y direction of all sampled period papers within the compensation period is within a preset Y direction offset range, the printhead fine-tuning mechanism is moved forward or backward in the longitudinal direction according to the average value of the offset in the Y direction of all sampled period papers within the compensation period.
[0046] If the average rotation angle of all sampled paper within the compensation period is within the preset rotation angle range, the nozzle triggering sequence for each print line is determined based on the average rotation angle of all sampled paper within the compensation period, which can advance or delay the nozzles to the corresponding pixel R.
[0047] ;
[0048] The vertical position of the current row relative to the baseline of the print area; P is the paper print resolution.
[0049] An alarm signal is issued if the average value of the paper's offset in the X direction exceeds the preset X-direction offset range, or the average value of the paper's offset in the Y direction exceeds the preset Y-direction offset range, or the average value of the paper's rotation angle exceeds the rotation angle range during the compensation period.
[0050] Preferably, in some embodiments of this application, after completing the dynamic compensation of paper printing within the compensation cycle, the offset and rotation angle of the paper corresponding to the sampling cycle are obtained by using the physical coordinates of the paper edge obtained in the first sampling cycle of the next compensation cycle.
[0051] If the paper offset and / or rotation angle corresponding to the first sampling period in the next compensation period is greater than or equal to the offset and / or rotation angle corresponding to the first sampling period in the current compensation period, the matrix component corresponding to the paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter is updated to α times its original matrix component; α>1.
[0052] If the paper offset and / or rotation angle corresponding to the first sampling period in the next compensation period is less than the offset and / or rotation angle corresponding to the first sampling period in the current compensation period, the matrix component corresponding to the paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter is updated to β times its original matrix component; β∈(0,1).
[0053] On the other hand, embodiments of this application also provide a machine vision-based dynamic paper offset compensation system, including:
[0054] A line scan CCD camera is used to scan the paper edge during the printing process according to a preset sampling period to obtain the physical coordinates of the paper edge in each sampling period.
[0055] LED linear light source is used to provide stable illumination to ensure sharp imaging of paper edges;
[0056] A high-speed image processing unit, connected to the line scan CCD camera, is used to obtain the paper's offset and rotation angle based on the physical coordinates of the paper's edge in the first sampling period, and to obtain the paper's state vector based on the paper's offset and rotation angle.
[0057] Based on the pre-constructed state transition matrix F and observation matrix H, the state vector is filtered and updated using Kalman filtering to obtain the filtered and corrected state vector. Based on the filtered and corrected state vector and the state transition matrix F, the paper posture for the next N sampling periods is predicted, where N is an integer greater than 1.
[0058] The dynamic compensation controller, connected to the high-speed image processing unit, printhead fine-tuning mechanism, and nozzle trigger control module, controls the printer based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling cycle, and the paper posture in the next N sampling cycles, to achieve dynamic compensation for paper printing within the compensation cycle.
[0059] (III) Beneficial Effects
[0060] The machine vision-based dynamic paper offset compensation method provided in this application continuously acquires the physical coordinates of the paper during the printing process by scanning the paper edge in real time according to a preset sampling period. This enables precise perception of the actual operating state of the paper, freeing printing control from reliance on single-shot positioning by mechanical sensors and avoiding compensation errors caused by insufficient accuracy in traditional detection methods. By calculating the paper offset and rotation angle based on the physical coordinates of the paper edge in the first sampling period and constructing the paper's state vector, the paper's translational and rotational attitudes can be uniformly expressed, providing a highly consistent data foundation for subsequent dynamic estimation and prediction.
[0061] Furthermore, this application utilizes a filtered and corrected state vector combined with the state transition matrix F to predict the paper posture over the next N sampling periods, transforming print control from passive compensation to active predictive adjustment. This allows for early detection of dynamic paper changes, avoiding issues such as missing edges and image misalignment caused by accumulated offset, thus significantly improving the timeliness and accuracy of compensation. Finally, by controlling the printer based on the paper's real-time physical coordinates, offset, rotation angle, and predicted posture over the next N sampling periods, this application achieves closed-loop dynamic compensation within the compensation period. This enables the nozzle's ejection position to adjust in real-time according to changes in paper posture, effectively reducing the risks of edge ink overflow, white edges, and image misalignment, improving the accuracy and stability of borderless printing, while also reducing ink waste caused by excessive redundant compensation, ultimately improving overall print quality and resource utilization efficiency. Attached Figure Description
[0062] Figure 1 This is a flowchart illustrating a machine vision-based dynamic paper offset compensation method according to an embodiment of this application.
[0063] Figure 2 This is a schematic diagram of a machine vision-based dynamic paper offset compensation system according to an embodiment of this application. Detailed Implementation
[0064] To better explain and facilitate understanding of this application, the following detailed description of the application is provided in conjunction with the accompanying drawings and specific embodiments.
[0065] In related technologies, compensation methods for paper misalignment during printing can be mainly categorized into three types:
[0066] The first type is a pre-compensation scheme based on the assumption of a fixed offset. This scheme typically reserves redundant inkjet areas by uniformly magnifying the image during the RIP stage to cover potential paper offsets. However, this type of scheme relies on the assumption that the paper offset is constant throughout the printing process and cannot identify the dynamic offsets and slight rotations that the paper exhibits during actual transport. Once the actual offset exceeds the preset magnification amount, problems such as missing edges in the image or inkjet misalignment will still occur. At the same time, uniform magnification increases unnecessary ink consumption, resulting in significant resource waste.
[0067] The second type is a real-time compensation scheme based on single-point detection. This type of scheme relies on a mechanical paper feed sensor or a single photoelectric detection module to obtain the instantaneous position of the paper, and then performs inkjet compensation based on this position. However, mechanical sensors are usually limited in accuracy to about ±1mm, which cannot meet the ±0.1mm level control accuracy requirements of borderless printing; moreover, the limited number of detection points makes it difficult to reflect the paper's rotation angle, instantaneous posture, and dynamic trends, resulting in insufficient compensation capability.
[0068] The third type is rule-based compensation schemes based on empirical models. These schemes use a pre-set, fixed compensation algorithm to simply fit the paper trajectory, allowing the print controller to automatically correct the nozzle output according to the rules. However, because the paper's posture changes during actual transport are affected by factors such as friction, roller pressure, and paper rigidity, its motion is highly nonlinear and random. Empirical rule models cannot accurately depict the dynamic behavior of the paper, resulting in delayed or insufficient compensation.
[0069] In view of this, the machine vision-based dynamic paper offset compensation method provided in this application scans the paper edge according to a preset sampling period during the printing process, achieving high-frequency and continuous acquisition of the physical coordinates of the paper edge. This allows for the real-time capture of paper's translational, rotational, and other posture changes, overcoming the shortcomings of insufficient detection dimensions in traditional mechanical sensors. Furthermore, this application obtains the paper offset and rotation angle based on the physical coordinates of the paper edge in the first sampling period and constructs a paper state vector. This allows the paper posture information to be uniformly expressed in a vectorized manner, avoiding information loss caused by single-point measurements and providing a complete state basis for subsequent dynamic estimation. By employing a pre-constructed state transition matrix F and observation matrix H, and combining Kalman filtering to update the state vector, this application effectively suppresses interference from sampling noise and paper edge texture fluctuations, ensuring that posture estimation remains stable and accurate even under high-speed printing conditions. Then, this application predicts the paper's posture for the next N sampling periods based on the filtered and corrected state vector and the state transition matrix F. This allows the printer to proactively predict the paper's future movement trend instead of relying on a fixed offset assumption. The compensation logic is upgraded from traditional passive correction to feedforward predictive control, fundamentally improving the timeliness and accuracy of compensation. Finally, by controlling the printer based on the paper's real-time physical coordinates, offset, rotation angle, and the predicted posture for the next N sampling periods, this application can achieve closed-loop dynamic compensation within the compensation period. This allows the nozzle ejection position to adjust according to changes in the paper's posture, effectively avoiding image edge defects, white edges, or offsets, significantly improving print quality and borderless printing accuracy, while reducing redundant ink consumption and improving resource utilization efficiency. It has advantages such as strong compensation capability, good adaptability, and high control precision.
[0070] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.
[0071] Figure 1 This is a flowchart illustrating a machine vision-based dynamic paper offset compensation method according to an embodiment of this application. Figure 1 As shown, the machine vision-based dynamic paper offset compensation method includes:
[0072] During the printing process, the paper edge is scanned according to a preset sampling period to obtain the physical coordinates of the paper edge in each sampling period.
[0073] The process of obtaining the physical coordinates of the paper edge in each sampling period includes: during the printing process, using a line-scanning CCD camera to acquire edge images of the paper according to a preset sampling period, and performing edge detection on the acquired edge images to obtain the pixel coordinates of the paper edge; using a pre-acquired coordinate transformation matrix T for converting pixel coordinates to physical coordinates to convert the pixel coordinates of the paper edge into the corresponding physical coordinates, thereby obtaining the physical coordinates of the paper edge corresponding to that sampling period; wherein, the coordinate transformation matrix T is determined during the calibration of the line-scanning CCD camera based on the mapping relationship between its pixel coordinates and the printer's physical coordinates.
[0074] For example, in acquiring the physical coordinates of the paper edge in each sampling period, the line-scan CCD camera acquires the edge image of the paper according to a preset sampling period and extracts the pixel coordinates of the paper edge in the image using an edge detection algorithm. For instance, in the image from the line-scan CCD camera, the left edge of the paper might appear at the 320th pixel position, but in the next sampling period it might become the 323rd pixel position due to slight paper movement, and in the third sampling period it might become the 318th pixel position. These changes in pixel coordinates reflect the dynamic changes in the actual position of the paper, but pixel coordinates cannot be directly used for print compensation; therefore, they need to be converted to physical coordinates. To achieve accurate conversion from pixel coordinates to physical coordinates, this embodiment uses a pre-acquired coordinate transformation matrix T to convert the pixel coordinates acquired by the line-scan CCD camera into the corresponding physical coordinates of the paper edge. For example, by calibrating the line-scan CCD camera, a mapping relationship between pixel coordinates and the printer coordinate system can be established; for example, a pixel offset of 1 pixel is equivalent to a paper offset of 0.015 mm in physical space. When the "320th pixel" position is detected, it can be converted to the physical coordinates "4.80mm" using matrix T; when the "323rd pixel" is detected, it can be converted to "4.845mm". In this way, accurate and continuous physical position information of the paper edge can be obtained in each sampling cycle, thus obtaining the physical coordinates of the paper edge corresponding to that sampling cycle. The coordinate transformation matrix T is determined during the calibration of the line-scan CCD camera based on the mapping relationship between its pixel coordinates and the printer's physical coordinates. The calibration process can use a calibration board or calibration strips of known size to correspond the pixel output of the line-scan CCD camera to known physical dimensions, thereby ensuring that matrix T accurately reflects actual parameters such as camera imaging size, focal length, installation angle, and distance from the camera to the paper, making the conversion from pixel coordinates to physical coordinates accurate and reliable. This embodiment employs a line-scan CCD camera for continuous scanning, utilizes edge detection to obtain pixel coordinates, and converts them into physical coordinates using a coordinate transformation matrix T. This application not only enables real-time and accurate acquisition of paper edge position changes during high-speed printing, but also significantly improves the stability and accuracy of offset detection. This provides strong foundational support for subsequent dynamic paper posture prediction and compensation control, resulting in more stable printing compensation effects, higher compensation accuracy, and a significant improvement in overall printing quality.
[0075] Based on the physical coordinates of the paper edge in the first sampling period, the paper offset and rotation angle are obtained, and based on the paper offset and rotation angle, the paper state vector is obtained.
[0076] In this embodiment, the process of obtaining the paper's offset and rotation angle includes: based on the physical coordinates of the paper's edge obtained in the first sampling period, the average value of the horizontal physical coordinates of the left and right edges of the paper within the sampling period is used as the physical position of the paper's geometric center in the X direction, and the difference between this physical position and the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is used as the paper's offset in the X direction.
[0077] The physical position of the paper's geometric center in the Y direction is calculated using the longitudinal physical coordinates of the paper's leading edge and the paper's length parameters within the sampling period. The difference between this physical position and the reference position of the paper's reference geometric center in the Y direction in the reference paper edge model is taken as the paper's offset in the Y direction.
[0078] By fitting a straight line to the physical coordinates of the paper's leading edge during the sampling period, the rotation angle of the paper relative to the paper's reference leading edge line in the reference paper edge model is obtained.
[0079] The angular velocity of the paper is obtained based on the rotation angle of the first sampling period and the rotation angle of the previous sampling period.
[0080] in, , The rotation angle for the first sampling period; This represents the rotation angle of the previous sampling period in the first sampling period; The sampling period; The angular velocity of the paper;
[0081] The reference paper edge model includes the reference left edge position, the reference right edge position, and the reference front straight line;
[0082] The reference paper edge model is constructed by acquiring paper edge images under normal printer operating conditions, and determining the reference left edge position, reference right edge position, and reference leading edge line of the paper based on the acquired paper edge images.
[0083] Specifically, in obtaining the paper offset, the average of the lateral physical coordinates of the left and right edges of the paper within the sampling period is used as the physical position of the paper's geometric center in the X direction. The difference between this physical position and the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is used as the paper's offset in the X direction. For example, in this sampling period, the physical coordinates of the left edge of the paper are 4.80 mm and the physical coordinates of the right edge are 214.90 mm, then the average lateral position is (4.80 + 214.90) / 2 = 109.85 mm. If the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is 110.00 mm, then the paper's X-direction offset in this sampling period is -0.15 mm, indicating that the paper as a whole has shifted 0.15 mm to the left relative to the reference position. Similarly, in obtaining the paper's offset in the Y direction, the physical position of the paper's geometric center in the Y direction is first calculated based on the longitudinal physical coordinates of the paper's leading edge and the paper length parameter within the sampling period. For example, if the detected leading edge position of the paper is 18.0 mm and the paper length is 297 mm, then the longitudinal position of the paper's geometric center can be calculated as 18.0 + 297 / 2 = 166.5 mm. If the reference geometric center of the paper in the reference paper edge model is 167.0 mm in the Y direction, then the offset of the paper in the Y direction is -0.5 mm. This method can accurately reflect the forward and backward offset of the paper in the conveying direction.
[0084] Furthermore, to obtain the paper's rotation angle, this embodiment performs linear fitting on multiple physical coordinate points of the paper's leading edge detected in the sampling period, and compares the slope of the fitted line with the slope of the reference leading edge line in the reference paper edge model to obtain the paper's rotation angle relative to the reference leading edge. For example, in this sampling period, if the fitted leading edge line forms an angle of +0.32° with the horizontal line, while the angle of the reference leading edge line in the reference paper edge model is 0°, then the paper's rotation angle is +0.32°. This angle reflects the slight tilting trend of the paper during actual transport. In addition, when determining the paper's angular velocity, the rotation angle is calculated based on the rotation angle of the first sampling period and the rotation angle of the previous sampling period, according to the sampling period. For example, if the rotation angle of the previous sampling period is 0.10°, and the rotation angle of this sampling period is 0.32°, and the sampling period is assumed to be 5ms, then the paper's angular velocity is (0.32° - 0.10°) / 0.005 = 44° / s. This angular velocity is used to reflect the dynamic trend of the paper's posture change.
[0085] The reference paper edge model includes the reference left edge position, the reference right edge position, and the reference leading edge line. This reference paper edge model is constructed by acquiring multiple sets of paper edge images under normal printer operating conditions, and determining the reference left edge position, reference right edge position, and reference leading edge line based on these images. The reference paper edge model obtained in this way accurately reflects the internal paper path structure of the printer and the normal paper transport direction, thus providing a reliable reference for offset and rotation angle calculations. By constructing a paper state vector based on the paper's X-direction offset, Y-direction offset, rotation angle, and angular velocity, this embodiment can fully characterize the paper's position and attitude changes in a two-dimensional plane. Based on this state vector, subsequent Kalman filter prediction and print compensation can achieve higher stability and accuracy.
[0086] Specifically, the state vector is: X = {x pos y pos ,θ,v x v y , };
[0087] X is the state vector; x pos y represents the physical position of the geometric center of the paper in the X direction; pos θ represents the physical position of the paper's geometric center in the Y direction; θ is the paper's rotation angle; v x v is the velocity of the paper in the X direction. y The paper speed in the Y direction is preset; where the paper speed in the X direction is 0, and the paper speed in the Y direction is the paper transport speed in the printer.
[0088] This embodiment incorporates the physical positions of the paper's geometric center in the X direction (xpos), the physical positions of the paper's geometric center in the Y direction (ypos), and the paper's rotation angle (θ) into the state vector simultaneously. This allows for simultaneous consideration of three key paper attitude information: lateral offset, longitudinal offset, and rotational tilt. This enables subsequent Kalman filter updates and predictions to be based on more complete information, avoiding estimation errors caused by single variables. Secondly, by setting the paper's velocity in the X direction to 0, the state model better reflects the actual force on the paper in the paper path, avoiding noise accumulation caused by introducing meaningless lateral velocity components during filtering, thus making lateral position prediction more stable and reliable. Thirdly, by setting the paper's velocity in the Y direction to the printer's actual transmission speed, Y-direction position fluctuations caused by measurement errors or short-term sampling jitter can be effectively avoided, making longitudinal position prediction smoother and more continuous. Furthermore, angular velocity... Incorporating state vectors accurately reflects paper rotation trends, enabling early prediction of paper posture changes and more timely adjustments in compensation control, thereby effectively preventing image skew or edge distortion. In summary, this structured, physically consistent state vector structure makes paper posture prediction more accurate and compensation control more timely and effective, ultimately significantly improving print quality and stability.
[0089] Based on the pre-constructed state transition matrix F and observation matrix H, the state vector is filtered and updated using Kalman filtering to obtain the filtered and corrected state vector. Based on the filtered and corrected state vector and the state transition matrix F, the paper posture for the next N sampling periods is predicted, where N is an integer greater than 1.
[0090] Specifically, predicting the paper's posture process over the next N sampling periods includes:
[0091] Based on the pre-constructed state transition matrix F, process noise matrix Q, observation noise matrix R, and observation matrix H according to the uniform motion characteristics of paper, Kalman filtering is used to predict and filter the paper state vector to obtain the filtered and corrected state vector.
[0092] Based on the filtered and corrected state vector, the state transition matrix F is applied N times consecutively to predict the state vector of the paper for the next N sampling periods. Based on the state vector of the paper for the next N sampling periods, the paper posture for the next N sampling periods is determined.
[0093] The paper posture includes the physical position of the paper's geometric center in the X direction, the physical position of the paper's geometric center in the Y direction, and the paper's rotation angle.
[0094] Specifically, in predicting the paper's attitude for the next N sampling periods, this embodiment first constructs a state transition matrix F based on the paper's uniform motion characteristics. This matrix, combined with the process noise matrix Q, observation noise matrix R, and observation matrix H, is used to predict and filter the paper's state vector, resulting in a filtered and corrected state vector. Subsequently, based on this filtered and corrected state vector, the state transition matrix F is applied N times consecutively to predict the paper's state vector for the next N sampling periods. Furthermore, the paper's attitude for the next N sampling periods is determined based on these state vectors. The paper's attitude includes the physical position of its geometric center in the X-direction, the physical position of its geometric center in the Y-direction, and the paper's rotation angle. In detail, the state transition matrix F describes the state change law of the paper under uniform linear motion and uniform angular velocity rotation conditions. It maps the current state vector to the state vector of the next sampling period through the linear relationship between the paper's X-direction and Y-direction positions, rotation angle, velocity, and angular velocity. The phrase "continuously applying matrix F N times" refers to using the current filtered and corrected state vector as the initial state, and progressively predicting future states using matrix F: the state vector for the first future sampling period is X1 = F·X0; X0 is the current filtered and corrected state vector; the state vector for the second future sampling period is X2 = F·X1; and so on, with the state vector for the Nth sampling period being X... N =FN·X N-1 This yields a sequence of paper states for N consecutive sampling periods. Through this method, this embodiment can accurately obtain the predicted physical positions of the paper's geometric center in the X direction, the paper's geometric center in the Y direction, and the paper's rotation angle for the next N sampling periods, thus providing a reliable basis for subsequent dynamic compensation.
[0095] Based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling period, and the paper posture in the next N sampling periods, the printer is controlled to achieve dynamic compensation for paper printing within the compensation period.
[0096] In this embodiment, controlling the printer includes:
[0097] Based on the paper posture of the next N sampling periods, obtain the paper offset in the X direction, the paper offset in the Y direction, and the paper rotation angle for the next N sampling periods.
[0098] The process of obtaining the paper's offset in the X direction and the paper's offset in the Y direction for the next N sampling periods includes:
[0099] For each of the next N sampling periods, the average value of the horizontal physical coordinates of the left and right edges of the paper within that sampling period is taken as the physical position of the paper's geometric center in the X direction, and the difference between this physical position and the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is taken as the paper's offset in the X direction corresponding to that sampling period.
[0100] For each of the next N sampling periods, the physical position of the paper's geometric center in the Y direction is calculated by combining the longitudinal physical coordinates of the paper's leading edge with the paper length parameter within that sampling period. The difference between this physical position and the reference position of the paper's geometric center in the Y direction corresponding to the position of that sampling period, obtained in advance based on the printer's stable operating state, is taken as the offset of the paper in the Y direction corresponding to that sampling period.
[0101] Based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling period, and the paper offset in the X direction, the paper offset in the Y direction, and the paper rotation angle in the next N sampling periods, the average value of the paper offset in the X direction, the average value of the paper offset in the Y direction, and the average value of the paper rotation angle in all sampling periods within the compensation period are obtained.
[0102] The compensation period includes M sampling periods, where M = N + 1;
[0103] Based on the average value of the paper offset in the X direction, the average value of the paper offset in the Y direction, and the average value of the paper rotation angle in all sampling cycles within the compensation cycle, and the preset ranges of the X-direction offset, Y-direction offset, and rotation angle, the printer is controlled to achieve dynamic compensation for paper printing within the compensation cycle.
[0104] For example, assuming the predicted physical positions of the paper's geometric center in the X direction for the next three sampling periods are 109.85mm, 109.90mm, and 109.88mm, respectively, and the corresponding reference geometric center position in the X direction is 110.00mm, then the X-direction offsets for the three sampling periods are -0.15mm, -0.10mm, and -0.12mm, respectively. In the Y direction, the predicted paper geometric center positions are 166.50mm, 166.55mm, and 166.60mm, respectively, and the corresponding reference geometric center position is 167.00mm, then the Y-direction offsets are -0.50mm, -0.45mm, and -0.40mm, respectively; and the predicted rotation angles are 0.32°, 0.34°, and 0.35°, respectively. In this way, the sequence of paper offsets and rotation angles for each sampling period can be obtained. Subsequently, based on the physical coordinates, offset, and rotation angle of the paper edge in the first sampling period, and the paper offset in the X direction, Y direction, and rotation angle in the next N sampling periods, the average values of the paper's X-direction offset, Y-direction offset, and rotation angle in all sampling periods within the compensation period are calculated. Assuming the compensation period includes M sampling periods, and M=N+1, the average value calculation can incorporate the data from the first sampling period along with the data from the next N sampling periods to obtain a smoother and more stable compensation value. For example, if the average X-direction offset is -0.12mm, the average Y-direction offset is -0.45mm, and the average rotation angle is 0.34°, then according to the preset ranges for X-direction offset, Y-direction offset, and rotation angle, the printer can be controlled accordingly to achieve dynamic compensation of the paper within the compensation period. Through this method, this embodiment can consider the current offset state and future movement trend of the paper in real time during the printing process, enabling proactive control of the printer.
[0105] This embodiment achieves smoothness and continuity of compensation control by combining the predicted paper posture of the first sampling period and the next N sampling periods, avoiding printing offset or image skew caused by single-period fluctuations. On the other hand, by using the averaging method to comprehensively process the offset and rotation angle of multiple sampling periods, the influence of measurement noise and short-term disturbances can be effectively reduced, making the compensation control more stable and more accurate, thereby significantly improving print quality and print reliability.
[0106] Controlling the printer specifically includes:
[0107] If the average offset of all sampled paper in the X direction within the compensation period falls within a preset range of X-direction offset, the starting position of the printer nozzle is shifted to the left or right based on the average offset of all sampled paper in the X direction within the compensation period.
[0108] For example, assuming the average paper offset in the X direction measured over multiple sampling cycles within the compensation period is −0.12mm, and the preset allowable range for X-direction offset is ±0.20mm, the nozzle's starting position will be shifted 0.12mm to the left based on this −0.12mm offset, ensuring the nozzle's ink ejection position accurately aligns with the actual paper position. This effectively eliminates the impact of lateral paper offset on the edges of the printed image, ensuring precise lateral positioning of the printed content, thereby improving edge alignment accuracy and overall visual quality.
[0109] If the average value of the offset in the Y direction of all sampled period papers within the compensation period is within a preset Y direction offset range, the printhead fine-tuning mechanism is moved forward or backward in the longitudinal direction according to the average value of the offset in the Y direction of all sampled period papers within the compensation period.
[0110] For example, if the average offset in the Y direction is -0.45mm, and the allowable deviation range is ±0.50mm, the print head moves forward 0.45mm in the longitudinal direction to ensure that the printed ink dots are aligned with the actual position of the paper in the longitudinal direction. This method can compensate for the slight forward and backward offset of the paper in the transport direction in real time, avoiding image stretching or compression caused by longitudinal deviation, thereby ensuring the accuracy of the printed content in the longitudinal direction.
[0111] If the average rotation angle of all sampled paper within the compensation period is within the preset rotation angle range, the nozzle triggering sequence for each print line is determined based on the average rotation angle of all sampled paper within the compensation period, which can advance or delay the nozzles to the corresponding pixel R.
[0112] ;
[0113] The vertical position of the current row relative to the baseline of the print area; P is the paper print resolution.
[0114] For example, when the average rotation angle of the paper across all sampling periods within the compensation period falls within a pre-set rotation angle range, the printer can adjust the triggering timing of the nozzles corresponding to each print line based on the average rotation angle, causing the nozzles to advance or delay ink ejection from the corresponding pixel R. For instance, if the average rotation angle is 0.34° and the paper print resolution is 600 dpi, the number of pixels the nozzles should advance or delay ink ejection from, based on the current line's vertical position Y and the rotation angle, is calculated to compensate for the slight tilt caused by the paper rotation. This dynamic adjustment of the nozzle triggering timing significantly reduces the occurrence of tilted or diagonal lines in the printed image, resulting in a more regular and clearer printed image, improving printing accuracy and visual consistency.
[0115] An alarm signal is issued if the average value of the paper's offset in the X direction exceeds the preset X-direction offset range, or the average value of the paper's offset in the Y direction exceeds the preset Y-direction offset range, or the average value of the paper's rotation angle exceeds the rotation angle range during the compensation period.
[0116] For example, if the average offset in the X direction is +0.35mm, while the preset allowable range is ±0.20mm, it indicates that the paper has significantly shifted laterally, exceeding the nozzle's compensation range. In this case, an alarm will immediately alert the operator to check for malfunctions in the paper feed guide, drive rollers, or paper positioning device. This method allows for timely detection of lateral feed abnormalities, preventing significant image shifts or edge misalignments, thus improving printing accuracy and safety. If the average offset in the Y direction is -1.2mm, while the allowable range is ±0.50mm, it indicates an abnormality in the longitudinal paper feed, such as excessively rapid forward / backward shifts or uneven transport speed. An alarm will be issued to the operator to check the paper conveyor belt, rollers, or paper feeding mechanism, and to take corrective measures promptly to prevent image stretching, compression, or longitudinal misalignment during printing. This function ensures longitudinal position compensation remains effective, maintaining the integrity of the printed image. If the average rotation angle is +0.75°, while the allowable range is ±0.50°, it indicates significant paper tilting during transport, possibly due to an abnormal paper feed angle or wear on the feed mechanism. The alarm prompts operators to check the paper positioning pins, guide rails, or drive wheels, and to adjust or maintain the equipment promptly. Real-time monitoring and alarms for abnormal rotation angles effectively prevent significant tilting or diagonal lines in printed images, thus ensuring print quality and equipment safety.
[0117] In the practical application of this application, after completing the dynamic compensation of paper printing within the compensation cycle, the paper offset and rotation angle corresponding to the sampling cycle are obtained by using the physical coordinates of the paper edge obtained in the first sampling cycle of the next compensation cycle.
[0118] If the paper offset and / or rotation angle corresponding to the first sampling period in the next compensation period is greater than or equal to the offset and / or rotation angle corresponding to the first sampling period in the current compensation period, the matrix component corresponding to the paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter is updated to α times its original matrix component; α>1.
[0119] For example, suppose dynamic compensation is performed on the paper printing during the current compensation cycle. Kalman filtering prediction and control are used to keep the paper stable throughout the entire compensation cycle. After completing this compensation cycle, when entering the next compensation cycle, the physical coordinates of the paper edge are acquired in the first sampling cycle of the current compensation cycle, and the X-direction offset, Y-direction offset, and rotation angle of the paper are calculated based on these coordinates. For instance, suppose the X-direction offset of the paper is measured to be -0.12mm, the Y-direction offset to be -0.45mm, and the rotation angle to be 0.34° in the first sampling cycle of the current compensation cycle; while in the first sampling cycle of the next compensation cycle, the X-direction offset is measured to be -0.20mm, the Y-direction offset to be -0.50mm, and the rotation angle to be 0.40°. It can be seen that the offset and rotation angle in the first sampling cycle of the next compensation cycle are both greater than or equal to the corresponding values in the current compensation cycle. To address this issue, this embodiment updates the matrix components corresponding to paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter to a multiple of α (e.g., α = 1.2). This update makes the Kalman filter more sensitive to changes in offset and rotation angle during prediction and filtering updates, enabling a faster response to escalating paper offset trends. For example, if the X-direction offset increases from -0.12mm to -0.20mm, by amplifying the noise matrix components, the Kalman filter can adjust its prediction state in a timely manner, allowing subsequent compensation control to react earlier and reducing the impact of lateral offset on print quality.
[0120] If the paper offset and / or rotation angle corresponding to the first sampling period in the next compensation period is less than the offset and / or rotation angle corresponding to the first sampling period in the current compensation period, the matrix component corresponding to the paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter is updated to β times its original matrix component; β∈(0,1).
[0121] In the practical application of this application, it is assumed that dynamic compensation is performed on the paper printing within the current compensation cycle. Kalman filtering prediction and control are used to keep the paper stable throughout the entire compensation cycle. After completing this compensation cycle, when entering the next compensation cycle, the physical coordinates of the paper edge are acquired in the first sampling cycle of the current compensation cycle, and the X-direction offset, Y-direction offset, and rotation angle of the paper are calculated based on these coordinates. For example, suppose that in the first sampling cycle of the current compensation cycle, the X-direction offset of the paper is measured to be 0.30mm, the Y-direction offset to be -0.25mm, and the rotation angle to be 0.50°; while in the first sampling cycle of the next compensation cycle, the X-direction offset is measured to be 0.20mm, the Y-direction offset to be -0.15mm, and the rotation angle to be 0.30°. It can be seen that the offset and rotation angle in the first sampling cycle of the next compensation cycle are both smaller than the corresponding values in the current compensation cycle. To address this issue, embodiments of this application update the matrix components corresponding to paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter to be β times their original matrix components, for example, β=0.7. This update reduces the sensitivity of the Kalman filter to changes in offset and rotation angle during prediction and filter updates, thereby reducing over-response to slight offsets. For example, if the X-direction offset decreases from 0.30mm to 0.20mm, by reducing the noise matrix components, the filter's response to offset changes weakens, maintaining stability.
[0122] See Figure 2 This application also provides a machine vision-based dynamic paper offset compensation system, including:
[0123] A line scan CCD camera is used to scan the paper edge during the printing process according to a preset sampling period to obtain the physical coordinates of the paper edge in each sampling period.
[0124] LED linear light source is used to provide stable illumination to ensure sharp imaging of paper edges;
[0125] In this embodiment, the LED line light source is positioned in the paper scanning area to provide stable illumination for the line-scanning CCD camera, ensuring clear physical coordinates of the paper edges during printing. In the system, the LED line light source is controlled to turn on and off by a dynamic compensation controller, but it is not directly connected to the high-speed image processing unit.
[0126] A high-speed image processing unit, connected to the line-scan CCD camera, is used to obtain the paper's offset and rotation angle based on the physical coordinates of the paper's edge in the first sampling period, and to obtain the paper's state vector based on the paper's offset and rotation angle; and to filter and update the state vector using Kalman filtering according to the pre-constructed state transition matrix F and observation matrix H, to obtain a filtered and corrected state vector; and to predict the paper's posture for the next N sampling periods based on the filtered and corrected state vector and the state transition matrix F, where N is an integer greater than 1.
[0127] The dynamic compensation controller, connected to the high-speed image processing unit, printhead fine-tuning mechanism, and nozzle trigger control module, controls the printer based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling cycle, and the paper posture in the next N sampling cycles, to achieve dynamic compensation for paper printing within the compensation cycle.
[0128] The machine vision-based dynamic paper offset compensation system provided in this application embodiment uses a line-scanning CCD camera and an LED line light source to sample the paper edge at high speed. It can acquire the precise physical coordinates of the paper edge within each preset sampling period, thereby obtaining the paper offset and rotation angle in real time. A high-speed image processing unit constructs a state vector based on the acquired paper offset and rotation angle, and uses a pre-constructed state transition matrix and observation matrix to filter and update the state vector through Kalman filtering, effectively suppressing the influence of measurement noise and system disturbances, while predicting the paper posture within several future sampling periods. The dynamic compensation controller, based on the filtered and corrected state vector and the prediction results, combined with the printhead fine-tuning mechanism and nozzle trigger control module, performs real-time control of the printer to achieve dynamic compensation during the paper printing process. This system can significantly improve the accuracy and real-time performance of paper posture detection, effectively reduce printing errors, improve the alignment accuracy and consistency of printed patterns, and reduce mechanical wear and energy consumption caused by frequent adjustments, thereby improving print quality, equipment reliability, and production efficiency.
[0129] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0130] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0131] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that they are in indirect contact through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0132] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0133] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A dynamic paper offset compensation method based on machine vision, characterized in that, The method includes: During the printing process, the paper edge is scanned according to a preset sampling period to obtain the physical coordinates of the paper edge in each sampling period. Based on the physical coordinates of the paper edge in the first sampling period, the paper offset and rotation angle are obtained, and based on the paper offset and rotation angle, the paper state vector is obtained. Based on the pre-constructed state transition matrix F and observation matrix H, the state vector is filtered and updated using Kalman filtering to obtain the filtered and corrected state vector. Based on the filtered and corrected state vector and the state transition matrix F, the paper posture for the next N sampling periods is predicted, where N is an integer greater than 1. Based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling period, and the paper posture in the next N sampling periods, the printer is controlled to achieve dynamic compensation for paper printing within the compensation period.
2. The machine vision-based dynamic paper offset compensation method according to claim 1, characterized in that, The process of obtaining the physical coordinates of the paper edge for each sampling period includes: During the printing process, a line-scanning CCD camera is used to capture edge images of the paper according to a preset sampling period, and edge detection is performed on the captured edge images to obtain the pixel coordinates of the paper edge. The pixel coordinates of the paper edge are converted into corresponding physical coordinates using a pre-obtained coordinate transformation matrix T used to convert pixel coordinates into physical coordinates, thereby obtaining the physical coordinates of the paper edge corresponding to this sampling period. The coordinate transformation matrix T is determined during the calibration of the line scan CCD camera based on the mapping relationship between its pixel coordinates and the printer's physical coordinates.
3. The machine vision-based dynamic paper offset compensation method according to claim 2, characterized in that, The process of obtaining the paper's offset and rotation angle includes: Based on the physical coordinates of the paper edge obtained in the first sampling period, the average value of the horizontal physical coordinates of the left and right edges of the paper in the sampling period is taken as the physical position of the paper geometric center in the X direction, and the difference between this physical position and the reference position of the paper reference geometric center in the X direction in the reference paper edge model is taken as the paper offset in the X direction. The physical position of the paper's geometric center in the Y direction is calculated using the longitudinal physical coordinates of the paper's leading edge and the paper's length parameters within the sampling period. The difference between this physical position and the reference position of the paper's reference geometric center in the Y direction in the reference paper edge model is taken as the paper's offset in the Y direction. By fitting a straight line to the physical coordinates of the paper's leading edge during the sampling period, the rotation angle of the paper relative to the paper's reference leading edge line in the reference paper edge model is obtained. The angular velocity of the paper is obtained based on the rotation angle of the first sampling period and the rotation angle of the previous sampling period. in, , The rotation angle for the first sampling period; This represents the rotation angle of the previous sampling period in the first sampling period; The sampling period; The angular velocity of the paper; The reference paper edge model includes the reference left edge position, the reference right edge position, and the reference front straight line; The reference paper edge model is constructed by acquiring paper edge images under normal printer operating conditions, and determining the reference left edge position, reference right edge position, and reference leading edge line of the paper based on the acquired paper edge images.
4. The machine vision-based dynamic paper offset compensation method according to claim 3, characterized in that, The state vector is: X={x pos 、y pos 、θ、v x 、v y 、 }; X is the state vector; x pos y represents the physical position of the geometric center of the paper in the X direction; pos θ represents the physical position of the paper's geometric center in the Y direction; θ is the paper's rotation angle; v x v is the velocity of the paper in the X direction. y The preset speed of the paper in the Y direction; In this context, the paper's speed in the X direction is 0, and the paper's speed in the Y direction is the paper's transport speed in the printer.
5. The machine vision-based dynamic paper offset compensation method according to claim 4, characterized in that, Predicting the paper's orientation process over the next N sampling periods includes: Based on the pre-constructed state transition matrix F, process noise matrix Q, observation noise matrix R, and observation matrix H according to the uniform motion characteristics of paper, Kalman filtering is used to predict and filter the paper state vector to obtain the filtered and corrected state vector. Based on the filtered and corrected state vector, the state transition matrix F is applied N times consecutively to predict the state vector of the paper for the next N sampling periods. Based on the state vector of the paper for the next N sampling periods, the paper posture for the next N sampling periods is determined. The paper posture includes the physical position of the paper's geometric center in the X direction, the physical position of the paper's geometric center in the Y direction, and the paper's rotation angle.
6. The machine vision-based dynamic paper offset compensation method according to claim 5, characterized in that, Controlling the printer includes: Based on the paper posture of the next N sampling periods, obtain the paper offset in the X direction, the paper offset in the Y direction, and the paper rotation angle for the next N sampling periods. Based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling period, and the paper offset in the X direction, the paper offset in the Y direction, and the paper rotation angle in the next N sampling periods, the average value of the paper offset in the X direction, the average value of the paper offset in the Y direction, and the average value of the paper rotation angle in all sampling periods within the compensation period are obtained. The compensation period includes M sampling periods, where M = N + 1; Based on the average value of the paper offset in the X direction, the average value of the paper offset in the Y direction, and the average value of the paper rotation angle in all sampling cycles within the compensation cycle, and the preset ranges of the X-direction offset, Y-direction offset, and rotation angle, the printer is controlled to achieve dynamic compensation for paper printing within the compensation cycle.
7. The machine vision-based dynamic paper offset compensation method according to claim 6, characterized in that, The process of obtaining the paper's offset in the X direction and the paper's offset in the Y direction for the next N sampling periods includes: For each of the next N sampling periods, the average value of the horizontal physical coordinates of the left and right edges of the paper within that sampling period is taken as the physical position of the paper's geometric center in the X direction, and the difference between this physical position and the reference position of the paper's reference geometric center in the X direction in the reference paper edge model is taken as the paper's offset in the X direction corresponding to that sampling period. For each of the next N sampling periods, the physical position of the paper's geometric center in the Y direction is calculated by combining the longitudinal physical coordinates of the paper's leading edge with the paper length parameter within that sampling period. The difference between this physical position and the reference position of the paper's geometric center in the Y direction corresponding to the position of that sampling period, obtained in advance based on the printer's stable operating state, is taken as the offset of the paper in the Y direction corresponding to that sampling period.
8. The machine vision-based dynamic paper offset compensation method according to claim 7, characterized in that, Controlling the printer specifically includes: If the average offset of all sampled paper in the X direction within the compensation period falls within a preset X-direction offset range, the printer nozzle starting position is shifted to the left or right based on the average offset of all sampled paper in the X direction within the compensation period. If the average value of the offset in the Y direction of all sampled period papers within the compensation period is within a preset Y direction offset range, the printhead fine-tuning mechanism is moved forward or backward in the longitudinal direction according to the average value of the offset in the Y direction of all sampled period papers within the compensation period. If the average rotation angle of all sampled paper within the compensation period falls within a preset rotation angle range, the nozzle triggering sequence for each print line is determined based on the average rotation angle of all sampled paper within the compensation period, which can advance or delay the nozzles to the corresponding pixel R. ; The vertical position of the current row relative to the baseline of the print area; P is the paper print resolution. An alarm signal is issued if the average value of the paper's offset in the X direction exceeds the preset X-direction offset range, or the average value of the paper's offset in the Y direction exceeds the preset Y-direction offset range, or the average value of the paper's rotation angle exceeds the rotation angle range during the compensation period.
9. The machine vision-based dynamic paper offset compensation method according to claim 8, characterized in that, After completing the dynamic compensation of paper printing within the compensation cycle, the paper offset and rotation angle corresponding to the sampling cycle are obtained by using the physical coordinates of the paper edge obtained in the first sampling cycle of the next compensation cycle. If the paper offset and / or rotation angle corresponding to the first sampling period in the next compensation period is greater than or equal to the offset and / or rotation angle corresponding to the first sampling period in the current compensation period, the matrix component corresponding to the paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter is updated to α times its original matrix component; α>1. If the paper offset and / or rotation angle corresponding to the first sampling period in the next compensation period is less than the offset and / or rotation angle corresponding to the first sampling period in the current compensation period, the matrix component corresponding to the paper offset and / or rotation angle in the process noise matrix Q or observation noise matrix R used in the Kalman filter is updated to β times its original matrix component; β∈(0,1).
10. A dynamic paper offset compensation system based on machine vision, characterized in that, include: A line scan CCD camera is used to scan the paper edge during the printing process according to a preset sampling period to obtain the physical coordinates of the paper edge in each sampling period. LED linear light source is used to provide stable illumination to ensure sharp imaging of paper edges; A high-speed image processing unit, connected to the line scan CCD camera, is used to obtain the paper's offset and rotation angle based on the physical coordinates of the paper's edge in the first sampling period, and to obtain the paper's state vector based on the paper's offset and rotation angle. Based on the pre-constructed state transition matrix F and observation matrix H, the state vector is filtered and updated using Kalman filtering to obtain the filtered and corrected state vector. Based on the filtered and corrected state vector and the state transition matrix F, the paper posture for the next N sampling periods is predicted, where N is an integer greater than 1. The dynamic compensation controller, connected to the high-speed image processing unit, printhead fine-tuning mechanism, and nozzle trigger control module, controls the printer based on the physical coordinates of the paper edge, the paper offset and rotation angle in the first sampling cycle, and the paper posture in the next N sampling cycles, to achieve dynamic compensation for paper printing within the compensation cycle.