A method and system for full-process inspection of printing based on high-precision visual recognition
By establishing a unified physical coordinate system for the paper path through high-precision visual recognition, the deviation of the printer's detection station is decoupled and controlled in a closed loop. This solves the problems of difficulty in tracing the source of deviation and accuracy drift in existing technologies, and achieves efficient maintenance of printing accuracy.
Patent Information
- Application Number
- CN202611137950.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, the paper feed gap detection, black mark positioning detection, and printed product quality detection of barcode printers are all independent and lack a unified benchmark. This makes it difficult to trace the source of deviations, causes serious mutual interference, and results in the inability to automatically correct accuracy drift due to the open-loop operation of the system.
A high-precision visual recognition method is adopted to establish a unified physical coordinate system for the paper path, calibrate the mapping relationship of each detection station, decouple the deviation source through the deviation superposition model, construct a closed-loop control system, and realize self-calibration.
It achieves quantitative decoupling and precise traceability of multi-source deviations, eliminates mutual interference between detection links, and ensures the long-term accuracy stability and automatic calibration capability of the system.
Smart Images

Figure CN123104261A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual printing inspection, and in particular to a method and system for full-process printing inspection based on high-precision visual recognition. Background Technology
[0002] In the production, manufacturing, operation, and maintenance of barcode printers and thermal printers, paper feed gap detection, black mark positioning detection, and finished product quality inspection are the three core aspects to ensure printing accuracy. Existing technologies typically achieve this through the following methods.
[0003] For gap detection, reflective or transmissive photoelectric sensors are typically used. The presence of paper is determined by detecting the difference in light reflection or transmission between the paper and the gap, and a switching signal is output for paper counting and positioning. For black mark detection, a single-point photoelectric sensor is also used. The difference in light reflection sensitivity between the black mark area and the background paper surface is utilized; the position of the black mark is determined by the change in the photoresistor voltage, triggering printing or cutting. For printed product quality inspection, operators typically visually inspect the printed samples to determine for abnormalities such as broken lines, blurriness, or unreadable barcodes. These three detection stages operate independently, using their respective sensors or manual methods to complete the inspection tasks. Data is not shared between them, and there is no unified standard.
[0004] In practical applications, the aforementioned solutions in the existing technology are completely fragmented in terms of physical benchmarks and data, lacking a unified spatiotemporal measurement framework. When geometric deviations occur in the printed product, it is impossible to trace the source of the deviation—whether it is mechanical disturbance of the paper feeding mechanism, deviation of the black mark printing position, or trigger delay or installation misalignment of the print head itself. These three types of deviations are mixed together and cannot be distinguished, and fault diagnosis can only rely on experience to troubleshoot one by one, which is inefficient. In addition, when using a transmissive light source for gap detection, the black mark or pattern printed on the paper is also opaque, which will affect the gap detection. Interference can occur during testing, causing the sensor to misinterpret the black mark area as a gap. Existing solutions can only mitigate this by increasing the physical distance between the two detection stations, but this cannot fundamentally eliminate the mutual interference problem. Finally, black mark detection is only used for single-time feedforward compensation, that is, adjusting the printing or cutting position once based on the black mark position. The results of finished product quality inspection cannot be used to verify and correct the upstream positioning benchmark and paper feeding model. The entire system is in an open-loop operation state. After long-term operation, the accuracy drift caused by factors such as mechanical wear and loose installation cannot be automatically corrected and requires manual periodic calibration and maintenance. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a printing process detection method and system based on high-precision visual recognition to solve the aforementioned problems.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a printing full-process inspection method and system based on high-precision visual recognition, comprising: S1. System calibration: Establish a unified paper path physical coordinate system, calibrate the paper path phase mapping relationship between the gap detection station, black mark detection station, and finished product detection station arranged along the paper path direction, as well as the spatial mapping relationship between the camera coordinate system of each station and the paper path physical coordinate system; S2. Gap Detection: During the paper feeding process, the feature points of the paper gap edge are obtained through the gap detection station as the first observation data, and the deviation of the gap relative to the theoretical coordinate system of the paper path is output. S3. Black Mark Detection: Obtain the geometric feature points of the black mark through the black mark detection station as the second observation data, and output its deviation relative to the paper path theoretical coordinate system; S4. Finished Product Inspection: After printing is completed, the preset feature points of the printed pattern are obtained through the finished product inspection station as the third observation data, and the deviation of the pattern relative to the theoretical coordinate system of the paper path is output. S5. Deviation Decoupling: Substitute the first, second, and third observation data into the deviation superposition model, solve them simultaneously, and obtain the paper feed disturbance component, the black mark static error component, and the printing dynamic error component; S6. Closed-loop control: The printing position is corrected by generating compensation based on the decoupling result, and the phase interpolation coefficients and / or the compensation reference table of the black mark static error are updated by using the residual feedback of the third observation data to achieve self-calibration; S7. Output Results: Based on the decoupling results, determine the pass / fail status and diagnose the fault.
[0007] Preferably, step S2 includes the following sub-steps: S21. Before acquiring the gap edge feature points, a dynamic mask is generated based on the current paper feed phase and the theoretical position of the pre-stored dark printing area. The original gap image after binarization is ANDed with the dynamic mask to eliminate the interference of black marks or printing patterns on gap recognition. S22. A state machine is used to monitor the transition between the paper area and the gap area. The real gap, hole or stain is identified by judging whether the white edge outline runs through the entire effective detection width. The sub-pixel tangent point of the through edge and the theoretical center line of the paper path is extracted as the gap edge feature point. S23. Calculate the physical width of the identified gap. If the gap width exceeds the preset normal range, it is determined to be a paper breakage abnormality and a shutdown alarm is triggered.
[0008] Preferably, obtaining the second observation data in step S3 includes the following steps: First, the images collected at the black mark detection station are binarized, and all black pixel regions are found through connected component search. Then, the area of each region is calculated, and regions whose area falls within the preset range are selected as black mark candidates to eliminate the interference of noise and stains; Next, sub-pixel precision edge extraction is performed on the outer contour of the candidate region to obtain a high-precision edge point set; Then, the least squares method is used to fit a rectangle to all sub-pixel edge points to obtain an optimal bounding rectangle. The four vertices of this rectangle represent the theoretical design position of the black mark. Finally, the average coordinates of the four vertices are taken as the geometric feature points of the black mark.
[0009] Preferably, step S4 includes the following two detection branches executed in parallel: First detection branch: Perform subpixel edge extraction and geometric fitting on the finished image to obtain color block corner points or barcode positioning points in the preset test pattern as the preset feature points; The second detection branch: Perform at least one quality detection task from text character recognition and verification, barcode quality level assessment, and print grayscale density analysis.
[0010] Preferably, the deviation superposition model and simultaneous equations in step S5 are as follows: Define the total deviation vector E(x) at the paper feed phase x, and express it as a linear superposition of the paper feed disturbance component vector Ev(x), the black mark static error component vector Es(x), and the printing dynamic error component vector Ed(x): E(x) = Ev(x) + Es(x) + Ed(x); The deviation vector includes two dimensions: lateral offset and deflection angle. The deflection angle is converted into an equivalent lateral offset through a preset normalized feature length and then participates in the linear superposition operation and modulus calculation of the vector. Let the paper feed phases corresponding to the first, second, and third observation data be xG, xM, and xP, respectively, and their deviation vectors be denoted as EG, EM, and EP, respectively; Under steady-state paper feeding conditions, the paper feeding disturbance components change continuously and smoothly, satisfying Ev(xM)≈k1·Ev(xG) and Ev(xP)≈k2·Ev(xG), where k1 and k2 are the phase interpolation coefficients obtained during the system calibration stage. The static error of the black mark is a step-type fixed deviation, caused by black mark printing offset or local deformation of the substrate. The value is constant at the black mark detection station and the finished product detection station, and is uniformly denoted as Es. Therefore, a ternary simultaneous equation is established: EG = Ev(xG) EM = k1·Ev(xG) + Es EP = k2·Ev(xG) + Es + Ed By solving this set of equations, we can obtain the paper feed disturbance component Ev(xG), the black mark static error component Es, and the printing dynamic error component Ed.
[0011] Preferably, the simultaneous equations are solved using the following explicit expression: Ev(xG)=EG Es=EM-k1·EG Ed = EP - EM - (k2 - k1) · EG.
[0012] Preferably, the closed-loop control in step S6 includes two stages: feedforward compensation and feedback calibration. In the feedforward compensation stage, the paper feed disturbance component and black mark static error component obtained by decoupling are converted into the lateral displacement compensation amount of the print head and / or the trigger timing compensation amount, so as to correct the printing position of subsequent labels in real time. In the feedback calibration process, the deviation residual of the third observation data is fed back to the compensation reference table of the phase interpolation coefficients and / or the black mark static error, and the system parameters are self-calibrated through iterative updates.
[0013] Preferably, step S7 further includes the following processing: In terms of fault diagnosis, at least one type of quality detection data, including text recognition results, barcode quality level, and grayscale density uniformity, is used to locate faults such as abnormal printhead heating, consumable quality problems, or deviations in printing parameter settings. In terms of data traceability, the paper feed disturbance component, black mark static error component, printing dynamic error component and diagnostic results are bound and stored with the product's unique identifier to form a complete quality traceability record; In terms of predictive maintenance, based on the statistical trend of deviation components over multiple detection cycles, when a certain deviation component continues to increase or its periodic fluctuations exceed a preset threshold, a predictive maintenance prompt for the equipment is generated.
[0014] Preferably, step S7 further includes the following processing: In terms of fault diagnosis, at least one type of quality detection data, including text recognition results, barcode quality level, and grayscale density uniformity, is used to locate faults such as abnormal printhead heating, consumable quality problems, or deviations in printing parameter settings. In terms of data traceability, the paper feed disturbance component, black mark static error component, printing dynamic error component and diagnostic results are bound and stored with the product's unique identifier to form a complete quality traceability record; In terms of predictive maintenance, based on the statistical trend of deviation components over multiple detection cycles, when a certain deviation component continues to increase or its periodic fluctuations exceed a preset threshold, a predictive maintenance prompt for the equipment is generated.
[0015] Preferably, it includes a perception layer, a core computing layer, and an execution layer, wherein: The sensing layer includes a gap detection unit, a black mark detection unit, and a finished product detection unit arranged sequentially along the paper feed direction, which are used to acquire the first, second, and third observation data, respectively. The core computing layer is used to store and run the deviation superposition model, and to perform spatiotemporal alignment, deviation decoupling, dynamic mask generation and self-calibration operations. The execution layer is used to perform print compensation, product rejection, or alarm actions based on the output of the core computing layer.
[0016] The technical effects and advantages of this invention are as follows: Firstly, this method achieves quantitative decoupling and precise source tracing of multi-source deviations. By unifying the observation data of the three workstations into the same paper path physical coordinate system and constructing a deviation superposition model and a ternary simultaneous equation system, the total deviation of the printed product is decomposed into three independent deviation sources: paper feed disturbance component, black mark static error component, and printing dynamic error component. Fault location is upgraded from relying on manual experience to troubleshooting one by one to quantitative identification based on the proportion of deviation components, which solves the problems of inconsistent benchmarks and indistinguishable deviations in the existing technology.
[0017] Secondly, this method eliminates mutual interference between detection stages and achieves true integrated collaboration. It uses a unified computing center to generate a dynamic mask based on the current paper feed phase and pre-stored position. During gap detection, it automatically shields the interference areas of black marks or printed patterns. It eliminates the mutual interference problem between transmission gap detection and dark printing areas without additional hardware. At the same time, the three detection stations serve as necessary observation ports for the same deviation model. If any port is missing, the simultaneous equations will be underdetermined and the decoupling function will fail. This ensures the indivisibility of the three stages from the algorithm level.
[0018] Third, this method constructs a fully closed-loop self-calibration system to ensure long-term accuracy stability. The deviation residual of the finished product detection is fed back to the compensation benchmark table of phase interpolation coefficients and black mark static error. The system parameters are self-calibrated through iterative updates. This solves the problem in the existing technology that black mark detection is only used for single-forward compensation and the open-loop operation of the system causes the accuracy to drift over time. During continuous operation, it can automatically offset the error accumulation caused by mechanical wear and loose installation. Attached Figure Description
[0019] 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.
[0020] Figure 1 This is the overall flowchart of the present invention; Figure 2 This is a system architecture diagram of the present invention; Figure 3 This is a flowchart of the gap detection sub-process of the present invention; Figure 4 This is a flowchart of the deviation decoupling solution of the present invention; Figure 5 This is a flowchart of the closed-loop control sub-process of the present invention; Figure 6 This is a flowchart for determining the pass / fail status of this invention. Detailed Implementation
[0021] 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.
[0022] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0023] This invention discloses a printing process detection method and system based on high-precision visual recognition, according to the appendix. Figure 1 As shown, it includes: S1. System calibration: Establish a unified paper path physical coordinate system, calibrate the paper path phase mapping relationship between the gap detection station, black mark detection station, and finished product detection station arranged along the paper path direction, as well as the spatial mapping relationship between the camera coordinate system of each station and the paper path physical coordinate system; S2. Gap Detection: During the paper feeding process, the feature points of the paper gap edge are obtained through the gap detection station as the first observation data, and the deviation of the gap relative to the theoretical coordinate system of the paper path is output. S3. Black Mark Detection: Obtain the geometric feature points of the black mark through the black mark detection station as the second observation data, and output its deviation relative to the paper path theoretical coordinate system; S4. Finished Product Inspection: After printing is completed, the preset feature points of the printed pattern are obtained through the finished product inspection station as the third observation data, and the deviation of the pattern relative to the theoretical coordinate system of the paper path is output. S5. Deviation Decoupling: Substitute the first, second, and third observation data into the deviation superposition model, solve them simultaneously, and obtain the paper feed disturbance component, the black mark static error component, and the printing dynamic error component; S6. Closed-loop control: The printing position is corrected by generating compensation based on the decoupling result, and the phase interpolation coefficients and / or the compensation reference table of the black mark static error are updated by using the residual feedback of the third observation data to achieve self-calibration; S7. Output Results: Based on the decoupling results, determine the pass / fail status and diagnose the fault.
[0024] In this embodiment, the paper feed phase mapping relationship refers to the encoder pulse count relationship corresponding to the paper feed distance between each station, calibrated using the rotary encoder pulse as a unified clock reference; the spatial mapping relationship refers to the coordinate transformation matrix between the camera pixel coordinate system and the paper path physical coordinate system of each station, which is obtained through calibration using a standard calibration board.
[0025] According to the appendix Figures 1 to 2 As shown, step S2 further includes the following sub-steps: S21. Before acquiring the gap edge feature points, a dynamic mask is generated based on the current paper feed phase and the theoretical position of the pre-stored dark printing area. The original gap image after binarization is ANDed with the dynamic mask to eliminate the interference of black marks or printed patterns on gap recognition. S22. A state machine is used to monitor the transition between the paper area and the gap area. The real gap is distinguished from the hole or stain by judging whether the white edge outline runs through the entire effective detection width. The sub-pixel tangent point of the through edge and the theoretical center line of the paper path is extracted as the gap edge feature point. S23. Calculate the physical width of the identified gap. If the gap width exceeds the preset normal range, it is determined to be a paper breakage abnormality and a shutdown alarm is triggered.
[0026] In this embodiment, the state machine switches states based on the proportion of black and white pixels within an image frame: when the proportion of black pixels is higher than a first threshold, it maintains the paper-containing state; when the proportion of white pixels is higher than a second threshold, it determines to enter the gap state; when the proportion of black and white pixels is between the two, it is determined to be a transition state. Only when a complete sequence of paper-containing state, transition state, gap state, transition state, and paper-containing state is detected is it confirmed as a valid gap event, thereby filtering out instantaneous state jumps caused by paper jitter and local holes. The dynamic mask is generated in real time by the core computing layer based on the current encoder phase and the theoretical position of the pre-calibrated black mark or printed pattern in the paper path coordinate system. The mask's corresponding area is set to 0, and the other areas are set to 1. The original gap image is binarized and then bitwise ANDed with the dynamic mask, and then a penetration judgment is performed on the operation result. The effective detection width refers to the detection area corresponding to the nominal width of the paper in the camera's field of view.
[0027] According to the appendix Figure 1 As shown, further, obtaining the second observation data in step S3 includes the following steps: First, the images collected at the black mark detection station are binarized, and all black pixel regions are found through connected component search. Then, the area of each region is calculated, and regions whose area falls within the preset range are selected as black mark candidates to eliminate the interference of noise and stains; Next, sub-pixel precision edge extraction is performed on the outer contour of the candidate region to obtain a high-precision edge point set; Then, the least squares method is used to fit a rectangle to all sub-pixel edge points to obtain an optimal bounding rectangle. The four vertices of this rectangle represent the theoretical design position of the black mark. Finally, the average coordinates of the four vertices are taken as the geometric feature points of the black mark.
[0028] According to the appendix Figure 1 As shown, further, step S4 includes the following two detection branches executed in parallel: First detection branch: Perform subpixel edge extraction and geometric fitting on the finished image to obtain color block corner points or barcode positioning points in the preset test pattern as preset feature points; The second detection branch: Perform at least one quality detection task from text character recognition and verification, barcode quality level assessment, and print grayscale density analysis.
[0029] According to the appendix Figures 1 to 4 As shown, the deviation superposition model and simultaneous equations in step S5 are disclosed in particular as follows: Define the total deviation vector E(x) at the paper feed phase x, and express it as a linear superposition of the paper feed disturbance component vector Ev(x), the black mark static error component vector Es(x), and the printing dynamic error component vector Ed(x): E(x) = Ev(x) + Es(x) + Ed(x); The deviation vector contains two dimensions: lateral offset and deflection angle. The deflection angle is converted into an equivalent lateral offset through a preset normalized feature length and then participates in the linear superposition operation and magnitude calculation of the vector. Let the paper feed phases corresponding to the first, second, and third observation data be xG, xM, and xP, respectively, and their deviation vectors be denoted as EG, EM, and EP, respectively; Under steady-state paper feeding conditions, the paper feeding disturbance components change continuously and smoothly, satisfying Ev(xM)≈k1·Ev(xG) and Ev(xP)≈k2·Ev(xG), where k1 and k2 are the phase interpolation coefficients obtained during the system calibration stage. The static error of the black mark is a step-type fixed deviation, caused by black mark printing offset or local deformation of the substrate. The value is constant at the black mark inspection station and the finished product inspection station, and is uniformly denoted as Es. Therefore, a ternary simultaneous equation is established: EG = Ev(xG) EM = k1·Ev(xG) + Es EP = k2·Ev(xG) + Es + Ed By solving this set of equations, we can obtain the paper feed disturbance component Ev(xG), the black mark static error component Es, and the printing dynamic error component Ed.
[0030] In this embodiment, the static error of the black mark is a step-type fixed deviation, caused by the black mark printing offset or local deformation of the substrate, and its value is constant at the black mark station and the finished product station. The calibration process of the phase interpolation coefficients k1 and k2 is as follows: During the system initialization phase, standard blank paper without printing defects is used to feed continuously at the rated speed, and the edge deviation data of the gap, black mark, and finished product stations are collected synchronously for multiple consecutive cycles. Based on the gap station data, the deviations of the black mark station and the finished product station are linearly fitted, and the average slope is taken as k1 and k2. The calibration results are stored in the parameter library and updated periodically according to the residual feedback during the subsequent self-calibration process. For non-steady-state paper feeding conditions, when the paper feeding acceleration is detected to exceed the preset threshold, it is determined that the steady-state assumption is not met, the single-cycle independent decoupling is paused, and the moving average decoupling result of the most recent multiple steady-state cycles is used as the current output, and the unstable state of the condition is marked. After the paper feeding recovers to a steady state, it automatically switches back to the normal decoupling mode. The window size of the moving average is exemplarily taken as 3 to 5 steady-state cycles.
[0031] According to the appendix Figures 1 to 4 As shown, the solution to the simultaneous equations is specifically disclosed using the following explicit expression: Ev(xG)=EG Es=EM-k1·EG Ed = EP - EM - (k2 - k1) · EG.
[0032] In this embodiment, the solution expression is directly derived from the simultaneous equations of weight 5 under the steady-state assumption: First, the paper feed disturbance component is directly obtained from the first equation; the paper feed disturbance component is substituted into the second equation, and the black mark static error component is obtained by subtraction; the paper feed disturbance component and the black mark static error component are substituted into the third equation, and the printing dynamic error component is obtained by subtraction. This solution sequence corresponds to the physical process of the three types of deviation components being superimposed sequentially along the paper feed process: the gap singularity contains only the paper feed disturbance, the black mark singularity contains the superposition of the paper feed disturbance and the black mark static error, and the finished product singularity contains the superposition of all three types of components. The solution process is the process of peeling off each component layer by layer from the superposition result. In the expression, all three observation values EG, EM, and EP are involved in the calculation. If any observation value is missing, the three deviation components cannot be completely solved. This reflects the indivisibility of the three detection stations in the deviation decoupling function from a mathematical perspective.
[0033] According to the appendix Figure 1 and Figure 5 As shown, specifically disclosed, step S6 closed-loop control includes two stages: feedforward compensation and feedback calibration. In the feedforward compensation stage, the paper feed disturbance component and black mark static error component obtained by decoupling are converted into the lateral displacement compensation amount of the print head and / or the trigger timing compensation amount, so as to correct the printing position of subsequent labels in real time. In the feedback calibration process, the deviation residuals of the third observation data are fed back to the compensation reference table of the phase interpolation coefficients and / or the static error of the black mark, and the self-calibration of the system parameters is achieved through iterative updates.
[0034] According to the appendix Figure 1 and Figure 6 As shown, it is particularly important to emphasize that step S7 also includes the following processing: In terms of fault diagnosis, at least one type of quality detection data, including text recognition results, barcode quality level, and grayscale density uniformity, is used to locate faults such as abnormal printhead heating, consumable quality problems, or deviations in printing parameter settings. In terms of data traceability, the paper feed disturbance component, black mark static error component, printing dynamic error component and diagnostic results are bound and stored with the product's unique identifier to form a complete quality traceability record; In terms of predictive maintenance, based on the statistical trend of deviation components over multiple detection cycles, when a certain deviation component continues to increase or its periodic fluctuations exceed a preset threshold, a predictive maintenance prompt for the equipment is generated.
[0035] In this embodiment, the synchronization degree S is used to quantify the collaborative accuracy of the entire process of paper feeding, positioning, and printing. The higher the value, the smaller the deviation and the better the synchronization. The deviation component modulus |Ev|, |Es|, and |Ed| are calculated by combining the lateral offset value in each component with the angle offset value after normalization. The normalization coefficient is taken as the label width or the black label side length as the feature length. The angle deviation is multiplied by the feature length to convert it into an equivalent lateral offset before participating in the modulus calculation.
[0036] According to the appendix Figure 1 As shown, it is particularly important to emphasize that step S7 also includes the following processing: In terms of fault diagnosis, at least one type of quality detection data, including text recognition results, barcode quality level, and grayscale density uniformity, is used to locate faults such as abnormal printhead heating, consumable quality problems, or deviations in printing parameter settings. In terms of data traceability, the paper feed disturbance component, black mark static error component, printing dynamic error component and diagnostic results are bound and stored with the product's unique identifier to form a complete quality traceability record; In terms of predictive maintenance, based on the statistical trend of deviation components over multiple detection cycles, when a certain deviation component continues to increase or its periodic fluctuations exceed a preset threshold, a predictive maintenance prompt for the equipment is generated.
[0037] According to the appendix Figure 2 As shown, the layers that need special emphasis include the perception layer, the core computing layer, and the execution layer, among which: The sensing layer includes a gap detection unit, a black mark detection unit, and a finished product detection unit arranged sequentially along the paper feed direction, which are used to acquire the first, second, and third observation data, respectively. The core computation layer is used to store and run the deviation stacking model, and to perform spatiotemporal alignment, deviation decoupling, dynamic mask generation, and self-calibration operations. The execution layer is used to perform actions such as print compensation, product rejection, or alarm based on the output of the core computing layer.
[0038] In this embodiment, the gap detection unit of the sensing layer includes a linear array imaging module, a backlight module, and an encoder synchronization module for continuously acquiring paper outline information; the black mark detection unit includes an area array imaging module, a telecentric optics module, and a backlight module for acquiring high-precision images of the black mark area; the finished product detection unit includes a high-resolution area array imaging module and a shadowless illumination module for acquiring complete images of the printed finished product; the core computing layer internally includes a spatiotemporal alignment module, a deviation decoupling module, a mask generation module, a self-calibration module, and a diagnostic output module; the execution layer includes a printhead compensation mechanism, a defective product rejection mechanism, and an audible and visual alarm mechanism.
[0039] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A printing process detection method based on high-precision visual recognition, characterized in that, include: S1. System calibration: Establish a unified paper path physical coordinate system, calibrate the paper path phase mapping relationship between the gap detection station, black mark detection station, and finished product detection station arranged along the paper path direction, as well as the spatial mapping relationship between the camera coordinate system of each station and the paper path physical coordinate system; S2. Gap Detection: During the paper feeding process, the feature points of the paper gap edge are obtained through the gap detection station as the first observation data, and the deviation of the gap relative to the theoretical coordinate system of the paper path is output. S3. Black Mark Detection: Obtain the geometric feature points of the black mark through the black mark detection station as the second observation data, and output its deviation relative to the paper path theoretical coordinate system; S4. Finished Product Inspection: After printing is completed, the preset feature points of the printed pattern are obtained through the finished product inspection station as the third observation data, and the deviation of the pattern relative to the theoretical coordinate system of the paper path is output. S5. Deviation Decoupling: Substitute the first, second, and third observation data into the deviation superposition model, solve them simultaneously, and obtain the paper feed disturbance component, the black mark static error component, and the printing dynamic error component; S6. Closed-loop control: The printing position is corrected by generating compensation based on the decoupling result, and the phase interpolation coefficients and / or the compensation reference table of the black mark static error are updated by using the residual feedback of the third observation data to achieve self-calibration; S7. Output Results: Based on the decoupling results, determine the pass / fail status and diagnose the fault.
2. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, Step S2 includes the following sub-steps: S21. Before acquiring the gap edge feature points, a dynamic mask is generated based on the current paper feed phase and the theoretical position of the pre-stored dark printing area. The original gap image after binarization is ANDed with the dynamic mask to eliminate the interference of black marks or printing patterns on gap recognition. S22. A state machine is used to monitor the transition between the paper area and the gap area. The real gap is identified by judging whether the white edge outline runs through the entire effective detection width. The sub-pixel tangent point of the through edge and the theoretical center line of the paper path is extracted as the gap edge feature point. S23. Calculate the physical width of the identified gap. If the gap width exceeds the preset normal range, it is determined to be a paper breakage abnormality and a shutdown alarm is triggered.
3. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, The process of obtaining the second observation data in step S3 includes the following steps: First, the images collected at the black mark detection station are binarized, and all black pixel regions are found through connected component search. Then, the area of each region is calculated, and regions whose area falls within the preset range are selected as black mark candidates to eliminate the interference of noise and stains; Next, sub-pixel precision edge extraction is performed on the outer contour of the candidate region to obtain a high-precision edge point set; Then, the least squares method is used to fit a rectangle to all sub-pixel edge points to obtain an optimal bounding rectangle. The four vertices of this rectangle represent the theoretical design position of the black mark. Finally, the average coordinates of the four vertices are taken as the geometric feature points of the black mark.
4. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, Step S4 includes the following two detection branches executed in parallel: First detection branch: Perform subpixel edge extraction and geometric fitting on the finished image to obtain color block corner points or barcode positioning points in the preset test pattern as the preset feature points; The second detection branch: Perform at least one quality detection task from text character recognition and verification, barcode quality level assessment, and print grayscale density analysis.
5. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, The deviation superposition model and simultaneous equations in step S5 are as follows: Define the total deviation vector E(x) at the paper feed phase x, and express it as a linear superposition of the paper feed disturbance component vector Ev(x), the black mark static error component vector Es(x), and the printing dynamic error component vector Ed(x): E(x) = Ev(x) + Es(x) + Ed(x); The deviation vector includes two dimensions: lateral offset and deflection angle. The deflection angle is converted into an equivalent lateral offset through a preset normalized feature length and then participates in the linear superposition operation and modulus calculation of the vector. Let the paper feed phases corresponding to the first, second, and third observation data be xG, xM, and xP, respectively, and their deviation vectors be denoted as EG, EM, and EP, respectively; Under steady-state paper feeding conditions, the paper feeding disturbance components change continuously and smoothly, satisfying Ev(xM)≈k1·Ev(xG) and Ev(xP)≈k2·Ev(xG), where k1 and k2 are the phase interpolation coefficients obtained during the system calibration stage. The static error of the black mark is a step-type fixed deviation, caused by black mark printing offset or local deformation of the substrate. The value is constant at the black mark detection station and the finished product detection station, and is uniformly denoted as Es. Therefore, a ternary simultaneous equation is established: EG = Ev(xG) EM = k1·Ev(xG) + Es EP = k2·Ev(xG) + Es + Ed By solving this set of equations, we can obtain the paper feed disturbance component Ev(xG), the black mark static error component Es, and the printing dynamic error component Ed.
6. The printing process detection method based on high-precision visual recognition according to claim 5, characterized in that, The simultaneous equations are solved using the following explicit expression: Ev(xG)=EG Es=EM-k1·EG Ed = EP - EM - (k2 - k1) · EG.
7. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, The closed-loop control in step S6 includes two stages: feedforward compensation and feedback calibration. In the feedforward compensation stage, the paper feed disturbance component and black mark static error component obtained by decoupling are converted into the lateral displacement compensation amount of the print head and / or the trigger timing compensation amount, so as to correct the printing position of subsequent labels in real time. In the feedback calibration process, the deviation residual of the third observation data is fed back to the compensation reference table of the phase interpolation coefficients and / or the black mark static error, and the system parameters are self-calibrated through iterative updates.
8. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, Step S7 further includes the following processing: In terms of fault diagnosis, at least one type of quality detection data, including text recognition results, barcode quality level, and grayscale density uniformity, is used to locate faults such as abnormal printhead heating, consumable quality problems, or deviations in printing parameter settings. In terms of data traceability, the paper feed disturbance component, black mark static error component, printing dynamic error component and diagnostic results are bound and stored with the product's unique identifier to form a complete quality traceability record; In terms of predictive maintenance, based on the statistical trend of deviation components over multiple detection cycles, when a certain deviation component continues to increase or its periodic fluctuations exceed a preset threshold, a predictive maintenance prompt for the equipment is generated.
9. The printing process detection method based on high-precision visual recognition according to claim 1, characterized in that, Step S7 further includes the following processing: In terms of fault diagnosis, at least one type of quality detection data, including text recognition results, barcode quality level, and grayscale density uniformity, is used to locate faults such as abnormal printhead heating, consumable quality problems, or deviations in printing parameter settings. In terms of data traceability, the paper feed disturbance component, black mark static error component, printing dynamic error component and diagnostic results are bound and stored with the product's unique identifier to form a complete quality traceability record; In terms of predictive maintenance, based on the statistical trend of deviation components over multiple detection cycles, when a certain deviation component continues to increase or its periodic fluctuations exceed a preset threshold, a predictive maintenance prompt for the equipment is generated.
10. A printing process detection system based on high-precision visual recognition, used to control the printing process detection method based on high-precision visual recognition according to any one of claims 1-9, characterized in that, It includes a perception layer, a core computing layer, and an execution layer, among which: The sensing layer includes a gap detection unit, a black mark detection unit, and a finished product detection unit arranged sequentially along the paper feed direction, which are used to acquire the first, second, and third observation data, respectively. The core computing layer is used to store and run the deviation superposition model, and to perform spatiotemporal alignment, deviation decoupling, dynamic mask generation and self-calibration operations. The execution layer is used to perform print compensation, product rejection, or alarm actions based on the output of the core computing layer.
