Carton printing defect detection system based on industrial vision
Patent Information
- Application Number
- CN202611158730.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]对于输送过程中存在姿态偏差或纸板表面存在翘曲的纸箱,现有技术通常在全局位置校正基础上增加局部特征匹配或弹性配准处理,通过在文字边缘、色块边界和图案纹理中提取局部特征点,建立待测图像与标准图像的多组局部对应关系,并利用插值方式生成非刚性位移场,使不同区域分别向标准位置靠拢,为减小纸板底色、墨色深浅及照明不均造成的差分响应,部分方案还会对局部区域执行归一化处理,或者将灰度差、边缘差和纹理差输入分类模型进行复核,当差分区域的面积、形状或置信度满足预设条件时输出缺陷结果,局部弹性配准能够补偿全局变换无法处理的非均匀形变,但其优化目标通常仍以对应区域的像素相似度或特征距离最小为主,配准过程缺少对文字笔画连接关系、闭合图形结构及真实异常区域的专门约束
1.通过对待测印刷图像和标准印刷图像分别生成印刷拓扑骨架与连续灰度相位表征,利用文字笔画交汇关系、闭合轮廓和色块边界中的稳定对应关系建立初始配准基础,并在局部形变场估计过程中限制端点合并、交汇次序改变、闭合环破裂和相邻边界交叉,同时将已形成的候选缺陷区域写入屏蔽范围,禁止后续配准继续利用相应区域建立控制对应,由此使局部形变场主要承担纸箱倾斜、透视压缩和表面翘曲引起的连续空间位移补偿,而不能通过改变印刷内容拓扑关系消除断线、缺笔、边界缺失或套印错位,候选缺陷区域又随残差结果反向约束下一轮形变估计,使形变补偿和缺陷保留形成闭环更新,缓解高自由度配准吸收真实缺陷与低自由度配准保留伪异常之间的冲突,使最终残差区域对应于印刷内容本身的异常变化。
Smart Images

Figure CN122989613A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial vision image processing and printing quality inspection technology, specifically a cardboard box printing defect detection system based on industrial vision. Background Technology
[0002] Defect detection in cardboard box printing typically employs industrial vision methods to acquire printed images of the cardboard box surface to be tested. These images are then compared to pre-saved standard printed images. The standard processing flow includes image grayscale or color space conversion, noise suppression, brightness equalization, edge extraction, position correction, differential calculation, binary segmentation, and connected component analysis. Position correction often establishes correspondences based on cardboard box edges, positioning marks, text corners, or pattern outlines. Translation, rotation, scaling, affine transformation, or perspective transformation are then used to map the printed image to standard coordinates. Subsequently, the grayscale difference, color difference, or edge difference of corresponding pixels is calculated. Abnormal regions are extracted using fixed or adaptive thresholds. Morphological denoising, region merging, and area filtering are then applied to these abnormal regions to identify printing defects such as missing prints, missing strokes, dirty printing plates, misregistration, or pattern defects. This approach is relatively straightforward, and the detection results primarily depend on the alignment between the tested image and the standard image, as well as the tolerance range of the differential threshold for normal fluctuations.
[0003] For cartons with posture deviations or warped cardboard surfaces during transport, existing technologies typically add local feature matching or elastic registration processing on top of global position correction. This involves extracting local feature points from text edges, color block boundaries, and pattern textures to establish multiple sets of local correspondences between the image under test and the standard image. Interpolation is then used to generate a non-rigid displacement field, causing different regions to move closer to the standard position. To reduce the differential response caused by uneven cardboard background color, ink density, and lighting, some solutions also perform normalization processing on local regions or input grayscale differences, edge differences, and texture differences into a classification model for verification. When the area, shape, or confidence level of the differential region meets preset conditions, the defect result is output. Local elastic registration can compensate for non-uniform deformations that global transformation cannot handle, but its optimization objective is usually still to minimize the pixel similarity or feature distance of the corresponding regions. The registration process lacks specific constraints on the connection relationship of text strokes, closed graphic structure, and real abnormal regions.
[0004] Normal spatial deformation caused by carton tilting, perspective compression, and local warping, along with printing anomalies caused by broken lines, missing strokes, missing pattern boundaries, and misregistration, can simultaneously manifest as positional or pixel inconsistencies between the test image and the standard image. Existing registration methods typically cannot distinguish between these two types of differences during deformation estimation. When the local deformation degrees of freedom are reduced, normal bending and posture changes of the cardboard cannot be adequately compensated, resulting in a large range of pseudo-anomalies remaining in the difference results. When the local deformation degrees of freedom are increased, the registration process may use defect areas to establish incorrect correspondences and pull broken strokes, missing boundaries, or misaligned color blocks back to the standard position through local displacement, causing the real defects to be absorbed by the deformation field. This creates a technical contradiction between normal deformation compensation and the retention of real defects, making it difficult to stably obtain residual areas that reflect printing anomalies when the carton's posture and surface condition change. Summary of the Invention
[0005] The purpose of this invention is to provide a cardboard box printing defect detection system based on industrial vision, which can solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A cardboard box printing defect detection system based on industrial vision includes an image representation chain, a constrained deformation registration chain, a residual judgment chain, and a mutually exclusive iteration chain. The image representation chain is used to generate a printing topology skeleton and continuous grayscale phase representation for the printed image of the carton to be tested and the standard printed image, respectively. The constrained deformation registration chain estimates the local deformation field based on the stable correspondence in the printed topology skeleton, and constrains the local deformation field with the topology connection relationship preservation condition and the candidate defect shielding region. The residual decision chain generates brightness residual, edge topology residual and local phase residual for the registered image, and forms candidate defect regions based on the spatial consistency relationship of at least two types of residuals; The mutually exclusive iteration chain writes the candidate defect region into the candidate defect shielding region, re-estimates the local deformation field and updates the candidate defect region until the carton printing defect detection result is obtained.
[0007] Preferably, the image representation chain extracts linear skeletons, closed skeletons, and partitioned skeletons according to text strokes, pattern outlines, and color block boundaries, and constructs a topological graph with connection order by skeleton endpoints, intersections, closed loops, and adjacent boundary segments. In the topology graph, nodes that simultaneously satisfy the conditions of stable adjacency, distinguishable local orientation, and recurrence across scales are selected as topology anchors, and an initial correspondence set between the print image to be tested and the standard print image is established based on the topology anchors. The continuous grayscale phase representation is composed of the local phase principal direction, phase consistency, and low-frequency displacement component, and shares a spatial index with the initial corresponding set.
[0008] Preferably, the constrained deformation registration chain generates a global projection transformation based on the topological anchor points, and constructs a local control mesh between the corresponding positions after the global projection transformation; For each control region of the local control grid, candidate displacements are calculated based on the continuous gray-scale phase characterization, and candidate displacements that cause skeleton endpoint merging, intersection order change, closed loop breakage or adjacent boundary intersection are marked as unusable displacements. The local deformation field is obtained from the remaining candidate displacements through spatial continuity constraints, and new control correspondences are prohibited within the candidate defect shielding region. Outside the candidate defect shielding region, the correspondence between the forward mapping and the reverse mapping is maintained.
[0009] Preferably, the residual determination chain divides the registered print image to be tested and the standard print image into local regions of the shared spatial index, and calculates the normalized ink color difference in the local regions to form a brightness residual, the skeleton connection relationship difference to form an edge topology residual, and the phase principal direction and phase consistency difference to form a local phase residual. For each local region, a residual evidence item consisting of residual type, residual direction, and residual connectivity range is established. Only local regions where at least two of the residual evidence items overlap in position and have compatible boundary extension directions are incorporated into the candidate defect region, and the evidence source identifier corresponding to each candidate defect region is retained.
[0010] Preferably, each skeleton edge in the topology graph records the node types at both ends, the curvature sequence along the line, the ink distribution order on both sides, and the identifiers of adjacent closed regions; The initial correspondence set is generated by a joint verification method of node correspondence and skeleton edge correspondence. When the local adjacency structure of two nodes is consistent but the curvature sequence or the ink distribution order on both sides of the connected skeleton edge is inconsistent, the corresponding node correspondence is deleted. When some nodes in the closed skeleton are occluded, candidate correspondences are recovered based on the in-loop order between unoccluded nodes and the identifiers of adjacent closed regions, and the recovered candidate correspondences are marked as low-confidence correspondences. The low-confidence correspondence does not participate in the global projection transformation, but only serves as a local control correspondence when its displacement direction is continuous with that of the adjacent topological anchor point.
[0011] Preferably, the local control grid is formed into coarse-resolution and fine-resolution levels according to the density of the printed content, and the local displacement transmission is limited by the parent-child relationship between adjacent level control points; The coarse resolution layer carries low-frequency displacements caused by carton bending and perspective compression, while the fine resolution layer carries local residual displacements that do not change the connection relationship of the topology. Control correspondences that are completed based on adjacency relationships due to partial occlusion are marked as low-confidence correspondences; For control regions where the forward mapping and the reverse mapping are inconsistent, freeze the fine-resolution hierarchical control points and revert to the parent control point to recalculate the displacement; The low-confidence correspondence participates in the fine-resolution hierarchical displacement calculation only when the displacement direction of adjacent control regions is continuous and no topological connection change occurs.
[0012] Preferably, the residual evidence items are oriented according to the normal direction of the character strokes, the tangent direction of the character strokes, the normal direction of the graphic boundary, and the direction inside the color block, and the connected regions of different residual types under the same directional coding are combined into a defect evidence map. Each candidate connected region in the defect evidence diagram records its corresponding contour, skeleton crossing relationship, and phase change position in the print image under test and the standard print image. When the brightness residual is located only inside the color block and is not accompanied by a phase abrupt change or skeleton connection change, the corresponding area is removed from the candidate defect area; When the edge topology residual and the local phase residual are continuously distributed along the same boundary direction, their corresponding candidate connected regions are merged.
[0013] Preferably, the mutual exclusion iteration chain generates a hierarchical masking mask based on the evidence source identifier of each candidate connected region, performs full masking on regions that simultaneously contain the edge topology residual and the local phase residual, and retains the outer boundary control correspondence and masks the inner control correspondence for regions that only contain the brightness residual; After each round of re-estimation of the local deformation field, the residuals that can be established from the updated local deformation field are deleted from the residual evidence item, and the defect evidence map is reconstructed based on the remaining residuals. When the boundary of the candidate connected region changes across rounds, the next round of hierarchical masking is updated with the continuously retained core regions, and the mapping record between the deleted region and the adjacent control grid is saved.
[0014] Preferably, after each round of local displacement update, the constrained deformation registration chain compares the topology graph with the transformed topology graph to identify events such as endpoint generation, endpoint disappearance, change of intersection order, closure loop cracking, and boundary crossing. For the control region adjacent to the low-confidence correspondent and where an event has occurred, trace upwards along the parent-child association to the resolution level where no topological event has occurred, and lock the corresponding parent control point; For control regions where no topological event occurs and the forward mapping and the reverse mapping are inconsistent, the next round of local control mesh is reconstructed based on the consistency of the curvature sequence of adjacent skeleton edges, selecting forward displacement, reverse displacement, or displacement components shared by both.
[0015] Preferably, the mutually exclusive iteration chain performs region correspondence on two consecutive rounds of defect evidence maps, inherits the evidence source identifier for candidate connected regions where the contour shrinks but the core region remains, establishes sub-region records for candidate connected regions where the contour splits based on the skeleton crossing relationship and the phase change position, and establishes a merge record for candidate connected regions where the contour merges only when the directional encoding of each sub-region is consistent. When the mutually exclusive iterative chain maintains a consistent correspondence between the forward and reverse mappings of the local deformation field outside the candidate connected region, and the core region and the evidence source identifier do not change for two consecutive rounds, it outputs a carton printing defect detection result composed of the core region, the corresponding residual type, and the topological position.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By generating printing topological skeletons and continuous grayscale phase representations for the printed image under test and the standard printed image respectively, an initial registration basis is established using the stable correspondences in the intersection of text strokes, closed contours, and color block boundaries. During the local deformation field estimation process, endpoint merging, changes in intersection order, closed loop breaking, and adjacent boundary crossing are restricted. At the same time, the formed candidate defect regions are written into the shielding range, prohibiting subsequent registration from using the corresponding regions to establish control correspondences. Thus, the local deformation field mainly undertakes the compensation of continuous spatial displacement caused by carton tilting, perspective compression, and surface warping, rather than eliminating broken lines, missing strokes, missing boundaries, or misregistration by changing the topological relationship of the printed content. The candidate defect regions also constrain the next round of deformation estimation in the reverse direction with the residual results, so that deformation compensation and defect retention form a closed loop update, alleviating the conflict between high-degree-of-freedom registration absorbing real defects and low-degree-of-freedom registration retaining pseudo-anomalies, so that the final residual region corresponds to the abnormal changes of the printed content itself.
[0017] 2. Brightness residuals, edge topology residuals, and local phase residuals are set as multiple types of evidence with shared spatial indexes. Candidate connected regions are formed based on positional overlap, boundary extension direction compatibility, and skeleton crossing relationships. Regions that only exhibit local ink color fluctuations without accompanying phase abrupt changes or topological changes can be removed from the candidate results. Topology residuals and phase residuals that are continuously distributed along the same boundary direction are merged. Multi-resolution control grids, parent-child control point associations, low-confidence correspondence restrictions, and consistency checks of forward and reverse mappings limit the propagation range and update level of local displacements. When endpoint generation, closed loop cracking, or boundary crossing occurs, the system regresses to the upper-level control point that has not generated a topological event. The hierarchical shielding mask adjusts the shielding range according to the source of residual evidence and inherits the core region, splits or merges corresponding records in continuous iterations. This keeps the regional boundaries, evidence sources, and topological positions of candidate defects continuous, reducing the interference of local brightness changes, erroneous feature correspondences, and single-round residual fluctuations on the detection results. Attached Figure Description
[0018] Figure 1 This is a flowchart of the overall processing flow of a cardboard box printing defect detection system based on industrial vision. Figure 2 A flowchart for constructing the printed topological skeleton, continuous gray-level phase representation, and initial corresponding set; Figure 3 A flowchart illustrating the generation and hierarchical rollback of local deformation fields constrained by topological connectivity. Figure 4 A flowchart for multi-type residual evidence fusion, hierarchical masking, and mutually exclusive iterative detection. Detailed Implementation
[0019] In one embodiment, please refer to Figure 1 The cardboard box printing defect detection system based on industrial vision includes an image representation chain, a constrained deformation registration chain, a residual decision chain, and a mutually exclusive iteration chain. The image representation chain generates a printing topology skeleton and continuous gray-scale phase representation for the cardboard box printing image to be tested and a standard printing image, respectively. The constrained deformation registration chain estimates the local deformation field based on the stable correspondence in the printing topology skeleton and constrains the local deformation field with the topological connectivity preservation condition and the candidate defect shielding region. The residual decision chain generates brightness residual, edge topology residual, and local phase residual for the registered image and forms candidate defect regions based on the spatial consistency relationship of at least two types of residuals. The mutually exclusive iteration chain writes the candidate defect regions into the candidate defect shielding region, re-estimates the local deformation field, and updates the candidate defect regions until the cardboard box printing defect detection result is obtained.
[0020] In this embodiment, the printed image to be tested comes from the surface image of the carton that has passed through the detection area continuously. The standard printed image is obtained from the qualified printed image of the corresponding page or the reference image formed by rasterization of the page design file. Before entering the image representation chain, both are uniformly converted to pixel representation containing luminance and color components. The luminance component is used to extract stroke edges and continuous phases, and the color component is used to distinguish adjacent color blocks and record the ink distribution order. The preprocessing only eliminates isolated noise and overall luminance bias, and does not perform closing operations or strong smoothing that would change the topological relationship on local contours. The standard printed image divides the reference area according to the reproducible text, patterns and color blocks in the page. The printed image to be tested is cropped to the same range through coarse positioning of the outer contour of the carton. Coarse positioning only eliminates overall translation and large-angle rotation. Local warping, perspective compression and printing content abnormalities are retained for subsequent registration and residual analysis processes.
[0021] The generation of the printing topology skeleton uses brightness gradient and color partition boundaries as input. For text strokes, centerline refinement is used; for closed patterns, double boundary representation of inner and outer contours is used; and for color blocks, common boundary representation of adjacent partitions is used. During centerline refinement, endpoints, intersections, and loops are retained. Short branches are not directly deleted, but instead, length, direction, and ink color difference attributes on both sides are added to short branches to distinguish weak branches formed by cardboard texture from real breaks formed by missing strokes. Continuous grayscale phase representation calculates the local phase principal direction and phase consistency through multi-scale even symmetry and odd symmetry responses, and extracts the continuous displacement trend caused by carton bending from the low-frequency part of phase change. The topology skeleton and phase representation use the same standard coordinate index, so that each skeleton node, skeleton edge, and phase sampling position can be mutually retrieved.
[0022] To select stable correspondences, the stability is calculated for the i-th topological node in the standard printed image. Its expression is: ; in, This indicates the degree to which the adjacency structure of nodes is preserved across adjacent scales. Indicates the distinguishability when combined with the direction of adjacent skeleton edges. This indicates the consistency of the ink color partitioning order on both sides of the node. This indicates the local phase consistency of a node between the printed image under test and the standard printed image. , , and They are respectively represented as , , and The corresponding non-negative weights sum to 1. For example, when the values are 0.30, 0.25, 0.25 and 0.20 respectively, the four quantities of a certain intersection point are 0.90, 0.80, 1.00 and 0.70 respectively, then the stability is 0.86, and the intersection point enters the initial corresponding set. If the adjacency structure preservation degree of a certain endpoint drops to 0.20 due to missing strokes and other quantities are the same, then the stability drops to 0.65, and the endpoint is not used as a global registration anchor point.
[0023] The constrained deformation registration chain first obtains the global projection transformation based on the coordinate correspondence of stable topological nodes. The process uses reprojection deviation and topological adjacency order as screening conditions. Any correspondence that causes the order of adjacent anchor points in the standard image to be flipped in the image to be tested is removed from the solution set. After obtaining the global projection transformation, the image to be tested is mapped to standard coordinates and a local control grid is established. The control grid nodes are not directly selected at equal intervals, but are allocated according to the density of printed content, the number of skeleton intersections, and the degree of phase change. Finer control areas are used in dense text areas and color block boundaries, while coarser control areas are used in blank areas and large uniform color blocks. Shared boundaries and parent-child indices are preserved between control areas to avoid discontinuous displacement at the boundaries after each area is transformed independently.
[0024] The candidate displacements of the local control region are jointly determined by the consistency of the principal phase direction, local grayscale sorting, and geometric correspondence of the skeleton edges, rather than directly using the minimum single pixel difference as the selection criterion. Let the candidate displacement of control region c be... Corresponding cost Calculate using the following formula: ; in, For local phase deviation, This is due to grayscale sorting deviation. This represents the deviation in the skeleton edge curvature sequence. Penalty for topological events, to They are respectively represented as , , and The corresponding non-negative weights and If the weights are greater than any of the other weights, for example, if the four values corresponding to candidate displacement A are 0.10, 0.12, 0.08, and 0, and the four values corresponding to candidate displacement B are 0.04, 0.05, 0.06, and 1, and the weights are 0.25, 0.20, 0.15, and 0.40 respectively, the cost of A is 0.081, and the cost of B is 0.428. The system selects A and rejects B, which would cause the closed loop to break.
[0025] Topological event penalties are obtained by comparing the local topological subgraphs before and after the transformation. The comparison includes the number of endpoints, the degree of intersection points, the order of adjacent edges, the number of closed loops, and the boundary crossing relationship. If a candidate displacement causes two originally separate endpoints to merge, the order of adjacent edges of an intersection point to change, the closed contour to break, or the boundary of adjacent color blocks to intersect, the corresponding candidate displacement is marked as an unusable displacement and will no longer participate in the local deformation field interpolation. Candidate displacements that do not trigger topological events are subject to continuity constraints according to the adjacent relationship of the control area. The continuity constraints allow for gradual displacements in adjacent control areas that correspond to the bending of the cardboard, but do not allow forcibly matching the standard contour at the defect edge through abrupt displacement. No new feature correspondences are added within the candidate defect shielding area; only the control displacements already confirmed outside the shielding boundary are used for restricted interpolation inside.
[0026] The residual decision chain generates luminance residuals, edge topology residuals, and local phase residuals in the same standard coordinate system. The luminance residuals use the ink color difference after local sorting and normalization to avoid the overall illumination change being directly regarded as a defect. The edge topology residuals are composed of the differences in the connection relationships of endpoints, intersections, closed loops, and skeleton edges. The local phase residuals are composed of the phase principal direction difference and the phase consistency difference. Each type of residual saves its spatial location, extension direction, connectivity range, and corresponding standard area identifier. The system does not directly output a defect based on a single type of residual exceeding a fixed value. Instead, it establishes residual evidence items and performs cross-validation under the shared spatial index to exclude local changes that only appear briefly in one representation.
[0027] Calculate the residual joint degree for pixel position p in standard coordinates. Its expression is: ; in, This is the normalized value of the brightness residual. The normalized value of the edge topological residual. This is the normalized value of the local phase residual. The degree of overlap in position and direction between different residual connected regions. to They are respectively represented as , , and The corresponding non-negative weights sum to 1. For example, if the four values of a certain position inside a color block are 0.80, 0.05, 0.10, and 0.10, the degree of cohesion is 0.235 when the values are 0.20, 0.30, 0.25, and 0.25, and the position is only recorded as ink color fluctuation. If the four values of a certain position of a broken stroke are 0.70, 0.90, 0.85, and 0.90, then the degree of cohesion is 0.8475, the position enters the candidate defect area, and the three types of evidence sources of brightness, topology, and phase are recorded.
[0028] After candidate defect regions are formed, the mutually exclusive iteration chain converts the corresponding regions into candidate defect shielding regions and sets hierarchical shielding according to the source of evidence. Regions containing edge topological residuals and local phase residuals are completely shielded. The registration chain must not establish any new correspondences inside the region. Regions containing only brightness residuals shield the internal control correspondences but retain the correspondences outside the boundary to verify whether local color differences can be explained by continuous deformation. After each round of local deformation field update, three types of residuals are regenerated. Residuals that can be explained by the updated deformation field and are not accompanied by topological changes are removed from the candidate set. The remaining residuals reconstruct the defect evidence map. The continuously retained central region is used as the core region for the next round of shielding. The boundary change part retains the mapping record with the adjacent control grid.
[0029] In a specific operation, the standard pattern of a cardboard box under test is shifted outward on the right side due to surface warping. At the same time, a horizontal stroke of a certain text has a local missing part. After the initial global projection transformation eliminates the overall tilt, the local control mesh forms a continuous gradient displacement on the right side of the pattern while maintaining the text intersection order. At the missing part of the horizontal stroke, the test skeleton has two endpoints due to the continuous edge of the standard skeleton. If the candidate displacement attempts to pull the two endpoints together in the middle, it will trigger endpoint merging and abnormal extension of the skeleton edge. Therefore, it is marked as an unusable displacement. The residual decision chain obtains the brightness residual, topological residual and phase residual at this position. The mutual exclusion iteration chain completely shields it. The subsequent deformation field only depends on the stable control correspondence on both sides of the missing position. Finally, the cardboard warping deviation is absorbed by the continuous displacement, and the missing part of the horizontal stroke remains the core candidate region.
[0030] Preferably, please refer to Figure 2 The image representation chain extracts linear skeletons, closed skeletons, and partitioned skeletons according to text strokes, pattern outlines, and color block boundaries, respectively. The skeleton endpoints, intersections, closed loops, and adjacent boundary segments are used to construct a topological graph with a connection order. Nodes that simultaneously meet the conditions of stable adjacency, distinguishable local directions, and cross-scale repetition are selected as topological anchors in the topological graph. An initial correspondence set between the printed image to be tested and the standard printed image is established based on the topological anchors. The continuous gray-scale phase representation is jointly composed of the local phase principal direction, phase consistency, and low-frequency displacement components, and shares a spatial index with the initial correspondence set. The linear skeleton is used to represent text strokes and thin line patterns, the closed skeleton is used to represent logos, borders, and closed graphics, and the partitioned skeleton is used to represent the common boundaries between adjacent color blocks.
[0031] Specifically, each node in the topology graph stores its node type, coordinates, number of adjacent edges, order of adjacent edge directions, text or pattern area it belongs to, and color partitioning identifiers on both sides. Each skeleton edge stores its start and end points, sampling point sequence, length, curvature variation, width variation, and ink distribution order on both sides. Closed loops store the node order within the loop, wrapping direction, and identifiers of adjacent closed areas. The condition for cross-scale recurrence is determined by repeatedly extracting skeletons at at least 3 adjacent scales and comparing the node adjacency structure. If the node coordinates move slightly after a scale change but the number of adjacent edges, order of directions, and closure affiliation remain consistent, the node is retained as a topology anchor point. If a node is formed solely by cardboard fiber texture at a single scale, it is not included in the initial corresponding set.
[0032] In a preferred embodiment, each skeleton edge in the topology graph records the node types at both ends, the curvature sequence along the line, the ink color distribution order on both sides, and the identifier of adjacent closed regions. The initial correspondence set is generated by a joint verification method of node correspondence and skeleton edge correspondence. When the local adjacency structure of two nodes is consistent but the curvature sequence or ink color distribution order on both sides of the connected skeleton edge is inconsistent, the corresponding node correspondence is deleted. When some nodes in the closed skeleton are occluded, candidate correspondences are restored according to the in-loop order between unoccluded nodes and the identifier of adjacent closed regions. The restored candidate correspondences are marked as low-confidence correspondences. Low-confidence correspondences do not participate in the global projection transformation and are only used as local control correspondences when the displacement direction is continuous with the adjacent topology anchor point.
[0033] The curvature sequence of the skeleton edge is obtained by sampling along the skeleton edge with equal arc length and calculating the included angle between adjacent tangents. To avoid incomparability caused by different sampling numbers, the curvature sequence is resampled to a uniform length and aligned from the start to the end. The ink color distribution order on both sides is recorded according to the left and right sides of the skeleton edge normal, respectively, and the color category and brightness are sorted. Adjacent closed area markers are used to indicate whether the skeleton edge belongs to the internal hole of the text, the outer contour of the pattern, or the dividing edge of the color block. Node correspondence is only retained when the node type matches, the number of adjacent edges is compatible, and the curvature sequence and ink color order of at least one connected skeleton edge are both corresponding. This avoids mismatching the intersection points that are similar in shape but located in different text positions.
[0034] When some nodes are obscured by blemishes or reflections, the system does not directly search for the grayscale most similar point within the obscured area. Instead, it establishes sequential constraints along the unobscured nodes of the closed loop. For example, if a standard closed loop contains 5 nodes arranged clockwise, and the image under test can only identify 4 of them, the system infers the edge segment where the missing node is located based on the in-loop order of the 4 nodes, the curvature of adjacent edges, and the identifiers of adjacent color blocks outside the loop. Candidate positions are then searched in the phase response of this edge segment. The recovered position is only used for the local control mesh and is accompanied by a low-confidence identifier. If the angle between the displacement directions of adjacent high-confidence anchor points exceeds the continuous range, the recovered position is not involved in the displacement calculation, thus avoiding the inferred position of the obscured area from affecting the overall projection relationship.
[0035] Preferably, please refer to Figure 3 The constrained deformation registration chain generates a global projection transformation based on the topological anchor points, and constructs a local control grid between the corresponding positions after the global projection transformation. For each control region of the local control grid, candidate displacements are calculated based on the continuous gray-scale phase characterization. Candidate displacements that cause skeleton endpoint merging, change of intersection order, closed loop breakage, or adjacent boundary intersection are marked as unusable displacements. The local deformation field is obtained from the remaining candidate displacements through spatial continuity constraints. New control correspondences are prohibited within the candidate defect shielding region, and the correspondence consistency between forward mapping and reverse mapping is maintained outside the candidate defect shielding region.
[0036] The consistency between forward and reverse mappings is evaluated using the round-trip deviation of control points. Let the control point in the standard coordinate system be q, the forward mapping be F, and the reverse mapping be B. The round-trip consistency is... Calculate using the following formula: ; in, Represents Euclidean distance. This represents the normalized scale determined by the size of the control area. The value is between 0 and 1. For example, when the round-trip deviation is 0.5 and the normalization scale is 2, the consistency is about 0.94, and the control point is retained. When the round-trip deviation is 3 and the normalization scale is still 2, the consistency is about 0.11, and the control point enters the frozen set. Subsequently, only its parent control point is allowed to provide displacement.
[0037] Furthermore, the local control grid is divided into coarse-resolution and fine-resolution levels according to the density of printed content. Local displacement transmission is limited by the parent-child relationship between control points of adjacent levels. The coarse-resolution level carries low-frequency displacements caused by carton bending and perspective compression, while the fine-resolution level carries local residual displacements that do not change the connection relationship of the topology graph. Control correspondences that are completed based on adjacency relationships due to local occlusion are marked as low-confidence correspondences. For control regions where the forward and reverse mappings are inconsistent, the fine-resolution level control points are frozen and the displacement is recalculated by reverting to the parent control point. Low-confidence correspondences only participate in the fine-resolution level displacement calculation when the displacement direction of adjacent control regions is continuous and no topological connection change occurs.
[0038] The parent-child relationship is established by the spatial inclusion relationship of the control area. Each fine-resolution control point corresponds to a coarse-resolution control unit. The fine-resolution displacement is obtained by adding the parent low-frequency displacement and the local residual displacement. The residual displacement is continuously interpolated at the shared boundary and is limited by the direction of the adjacent skeleton edge. If the fine-resolution control point triggers a topological event or the round-trip consistency is lower than the available range of the current area, the residual displacement is cleared to zero and the parent displacement is inherited. If multiple fine-resolution control points in the parent control unit trigger anomalies in the same direction, the parent anchor point correspondence and skeleton edge curvature sequence are re-checked. If the anomaly is confirmed to be from an incorrect correspondence, the parent correspondence is deleted. If the anomaly is confirmed to be from continuous cardboard deformation, the parent displacement is retained and the sub-control area is re-divided.
[0039] In another optional embodiment, after each round of local displacement update, the constrained deformation registration chain compares the topology graph with the transformed topology graph to identify events such as endpoint generation, endpoint disappearance, change of intersection order, closure loop cracking, and boundary crossing. For control regions adjacent to low-confidence correspondences and where events occur, the chain traces upwards along parent-child associations to the resolution level where no topological events occur and locks the corresponding parent control point. For control regions where no topological events occur but the forward and reverse mappings are inconsistent, the chain selects forward displacement, reverse displacement, or a common displacement component of both based on the consistency of the curvature sequence of adjacent skeleton edges to reconstruct the next round of local control mesh.
[0040] The selection of forward and reverse displacements is based on the curvature error of adjacent skeleton edges after transformation. If the difference in curvature sequence between the standard skeleton edge and the skeleton edge under test is less than the difference corresponding to the reverse displacement, the forward displacement is retained; otherwise, the reverse displacement is retained. If the projections of the two in the main direction of the control area are similar but the normal components are significantly different, the common main direction component of the two is extracted and the conflicting normal components are discarded. The common displacement component is written into the next round of control mesh only when it does not cause endpoint, intersection, or closed loop events. The locked parent control point will not move again before the current defect shielding range stabilizes, so as to block the propagation of low-confidence local correspondences to the upper-level control layer.
[0041] Preferably, please refer to Figure 4 The residual judgment chain divides the registered print image to be tested and the standard print image into local regions with a shared spatial index. It calculates the normalized ink color difference to form the brightness residual, the skeleton connection relationship difference to form the edge topology residual, and the phase principal direction and phase consistency difference to form the local phase residual in the local region. For each local region, a residual evidence item consisting of residual type, residual direction and residual connectivity range is established. Only local regions with at least two residual evidence items overlapping in position and compatible in boundary extension direction are included in the candidate defect region, and the evidence source identifier corresponding to each candidate defect region is retained.
[0042] Normalized ink color difference is obtained by comparing the pixel brightness ranking and color component ranking within a local area. It does not require the test image to have the exact same absolute brightness as the standard image. Skeleton connectivity difference is encoded separately according to node missing, node added, adjacent edge interruption, closed loop change and boundary misalignment. The phase principal direction difference is the minimum angle on the direction loop. The phase consistency difference is used to determine whether there is a structural change in the local texture. The residual connectivity range is formed by the growth of the residual type and direction encoding of adjacent pixels under the shared spatial index. During the growth process, it does not cross the boundaries of irrelevant color blocks in the standard image, avoiding merging adjacent anomalies belonging to different printing objects into one region.
[0043] Furthermore, the residual evidence items are oriented according to the normal direction of the character strokes, the tangent direction of the character strokes, the normal direction of the graphic boundary, and the direction inside the color block. Connected regions of different residual types under the same directional encoding are combined into a defect evidence map. Each candidate connected region in the defect evidence map records its corresponding contour, skeleton crossing relationship, and phase change position in the printed image under test and the standard printed image. When the brightness residual is only located inside the color block and is not accompanied by phase change or skeleton connection change, the corresponding region is removed from the candidate defect region. When the edge topology residual and the local phase residual are continuously distributed along the same boundary direction, their corresponding candidate connected regions are merged.
[0044] Directional encoding is based on the local structure in standard printed images. For text stroke areas, the skeleton tangent is calculated first, and then the direction perpendicular to the skeleton tangent is used as the stroke normal. For graphic outline areas, the boundary tangent and boundary normal are used. When there is no stable boundary inside the color block, the local phase principal direction is used as the internal direction. Ink dragging or misregistration forms a continuous residual along the boundary direction. Missing strokes or boundary defects cause topological interruptions and phase abrupt changes along the stroke normal. The brightness residual caused by the simple cardboard background texture is located inside the color block and does not cross the skeleton. The system establishes area records based on calculable structural relationships and does not use the pre-specified defect category as the area merging condition.
[0045] In this embodiment, the mutually exclusive iteration chain generates a hierarchical masking mask based on the evidence source identifier of each candidate connected region. Regions containing both edge topological residuals and local phase residuals are fully masked. Regions containing only brightness residuals retain the outer boundary control correspondence and mask the inner control correspondence. After re-estimating the local deformation field in each round, the residuals that can be established from the updated local deformation field are deleted from the residual evidence item, and the defect evidence map is reconstructed based on the remaining residuals. When the boundary of the candidate connected region changes across rounds, the hierarchical masking mask of the next round is updated with the continuously retained core region, and the mapping record between the deleted region and the adjacent control grid is saved.
[0046] To quantify the stable state of the iteration, let the core candidate region in the t-th round be... The deformation field is Define the iterative difference. for: ; in, Indicates symmetric difference. Indicates the number of pixels in the region. and Non-negative weights This represents the displacement vector of position p in round t. For example, when there are only a few boundary pixel changes in the core region between two adjacent rounds and the average displacement change outside the shielded region is 0.05, we take... , If a small difference is obtained, the system continues to verify the source of evidence. The iteration ends when the difference remains stable for two consecutive rounds and the core region no longer splits or merges.
[0047] In a preferred embodiment, the mutually exclusive iteration chain performs region mapping on two consecutive rounds of defect evidence maps. For candidate connected regions where the contour shrinks but the core region remains, the evidence source identifier is inherited. For candidate connected regions where the contour splits, sub-region records are established based on the skeleton crossing relationship and the phase change position. For candidate connected regions where the contour merges, a merge record is established only when the directional encoding of each sub-region is consistent. The mutually exclusive iteration chain maintains consistency between the forward mapping and the reverse mapping of the local deformation field outside the candidate connected regions, and when the core region and the evidence source identifier do not change for two consecutive rounds, the output is a carton printing defect detection result consisting of the core region, the corresponding residual type, and the topological position.
[0048] The region correspondence adopts a combination of conditions: core region overlap, standard layout affiliation, and skeleton crossing relationship. When the outline shrinks, if the retained part still crosses the same skeleton edge and is located in the same standard region, the original record is inherited. When the outline splits, if the two sub-regions correspond to different phase change positions or different skeleton endpoints, independent sub-records are established and enter the subsequent masking respectively. When the outline is merged, if the direction codes of each sub-region are different, multiple parallel records are maintained and physical merging is not performed. Only when the direction codes are consistent, the skeleton affiliation is continuous, and the middle region also retains the same residual evidence, a merged record is generated. This avoids independent defects on adjacent characters being identified as a single defect due to morphological connection.
[0049] The output cardboard printing defect detection results include the outline of the defect core area in the printed image under test, the topological position mapped to the standard printed image, the residual type involved in the judgment, the direction code, the skeleton node or skeleton edge identifier, and the corresponding records of the region in each round. The system classifies the results into text strokes, closed graphic boundaries or color block separators based on the topological position, without relying on absolute pixel coordinates to describe the defect position. When the cardboard box posture or local warping changes, the defect is still identified by the standard topological position, which is used for subsequent review image overlay display or production process statistics. The output process does not change the already stable local deformation field and core area.
[0050] In another embodiment, the standard printed image contains multi-colored text and adjacent color blocks. The test carton has an overprinting offset. The image representation chain extracts the common boundary of each color partition and the center line of the text. The constrained deformation registration chain allows low-frequency displacement caused by the overall bending of the carton, but identifies the intersection of adjacent color block boundaries and the change in the relative order of the text center line and the color boundary as topological events. The residual judgment chain obtains the brightness residual, edge topological residual and phase residual continuously distributed along the boundary normal at the overprinting offset position. The defect evidence map merges the regions in the same direction. The hierarchical shielding mask prohibits the re-establishment of the correspondence inside the offset boundary. Local elastic displacement cannot pull the misaligned color block back to the standard position.
[0051] In another embodiment, the closed logo of the carton under test has a local break and the cardboard fiber texture is present near the break. The closed skeleton forms two endpoints at the break position. The cardboard fibers form short branches only on a single scale. Cross-scale topological screening removes the short branches but retains the closed loop cracking event. The constrained deformation registration chain rejects candidate displacements that merge the two endpoints. The residual decision chain establishes candidate connected regions based on the closed loop change, the phase change at the break, and the local brightness difference. The mutually exclusive iteration chain completely shields the core region of the break and allows the low-frequency displacement outside the break to continue to compensate for the bending of the carton surface. The output results record the ring identifier corresponding to the closed logo and the skeleton edge identifier where the break is located.
[0052] In another embodiment, the test carton only has local variations in ink density while the text and pattern outlines are continuous. The luminance residual forms a connected region within the color block. The edge topology residual does not detect changes in endpoints, intersections, or closed loops. The local phase residual also does not form a continuous region in the same direction as the luminance residual. The residual evidence map marks the region as a single luminance evidence. The hierarchical shielding mask only shields the internal control correspondence and retains the outer boundary correspondence. The re-estimated local deformation field maintains boundary continuity. When the luminance residual still does not have topological and phase evidence, it is removed from the candidate defect region and no broken line, missing stroke, or boundary missing result is output.
[0053] In a preferred embodiment, the local deformation field is represented by a piecewise continuous two-dimensional displacement. Each control unit obtains its internal pixel displacement by interpolating the control displacement of a shared vertex. Before interpolation, it checks whether the skeleton edge corresponding to the unit boundary belongs to different topological objects. When they belong to the same continuous skeleton or the same color block boundary, a continuous displacement direction constraint is applied. When they belong to different text, different closed graphics, or defect shielding boundaries, smoothing is not performed across objects. The coarse resolution level and the fine resolution level respectively store low-frequency displacement and residual displacement. Before any residual displacement is written, a topological event check and a round-trip consistency check are performed. Only continuous low-frequency displacements derived from boundary control points are accepted inside the candidate defect region. New displacements generated by internal image similarity are not accepted.
[0054] In a preferred embodiment, the candidate defect shielding region is not a fixed, outwardly expanding rectangular region, but is generated based on the contour, direction encoding, and skeleton attribution of the defect evidence map. The text stroke breakage region covers the short neighborhoods on both sides of the breakage along the stroke tangent and is limited to the stroke width range along the normal. The color block boundary misalignment region covers the continuous residual segment along the boundary tangent and retains the external control zone on both sides of the boundary. The closed loop cracking region uses the local edge segment of the corresponding loop as the shielding center and does not shield stable link points far from the break. The hierarchical shielding range is updated as the core region shrinks or splits across rounds, avoiding insufficient local deformation information caused by expanding the shielding at once.
[0055] In a preferred embodiment, when there is partial occlusion between the standard printed image and the printed image under test, the occlusion detection is established based on brightness saturation, texture loss, and multiple color component synchronization anomalies. The occluded area is not directly classified as a printing defect, but is excluded from the topological anchor point and phase correspondence search range. When a closed shape is partially occluded, the low-confidence correspondence is recovered using the in-loop order of the unoccluded nodes. When a character stroke is partially occluded, only the high-confidence nodes on both sides of the occlusion are retained and the low-frequency displacement is transmitted through the parent control unit. The subsequent carton image after the occlusion is removed re-establishes the high-confidence correspondence, without inheriting the low-confidence positions in the occluded area, ensuring that the recovered correspondence only serves the local registration of the current image.
[0056] In a preferred embodiment, the system establishes a topological location code for the standard layout. The code consists of region category, parent closed region, skeleton edge number, adjacent node type, and edge-normalized position. After the candidate defect core region is mapped to the standard image, its topological affiliation is determined based on its distance from skeleton nodes, skeleton edges, and color block boundaries. When the core region spans multiple topological objects, it is split into multiple records based on the residual direction and skeleton crossing relationship. The topological location code is regenerated as the standard layout is updated. The node number of the historical layout is not used to directly match the new layout. After the layout is switched, the local control grid, defect evidence map, and hierarchical masking records of the old layout are cleared.
[0057] Specifically, the system's processing data includes at least the print image to be tested, standard print image, topology map, continuous grayscale phase representation, initial correspondence set, local control grid, local deformation field, residual evidence item, defect evidence map, hierarchical shielding mask, and region correspondence record. Each data object is associated with a standard coordinate index. Nodes and edges in the topology map have unique identifiers. The control grid records the high-confidence or low-confidence correspondences on which it depends. The residual evidence item records the source type and direction encoding. The region correspondence record saves the inheritance, splitting, and merging relationships in continuous iterations. When a correspondence or residual is deleted during processing, the reason for deletion is saved simultaneously, so that subsequent rounds can distinguish between residuals deleted due to deformation interpretation and residuals deleted due to insufficient evidence.
[0058] In this embodiment, each processing chain can be implemented by different data processing processes in the same image processing program, or by multiple program modules that call each other. After the image representation chain outputs the topology map and phase representation, the constrained deformation registration chain only reads the confirmed stable correspondence, low confidence marker and the current mask. The residual judgment chain only generates residual evidence after the current deformation field is completed. The mutually exclusive iteration chain updates the mask and triggers the next round of registration based on the residual evidence. No processing chain directly modifies the intermediate results of other processing chains without bypassing the shared space index. The iteration termination condition simultaneously checks the stable state of the candidate region, the stable state of the evidence source and the round-trip consistency outside the mask region, forming a closed processing sequence based on data dependencies.
[0059] Through the above implementation, the continuous spatial displacements corresponding to carton tilting, perspective compression, and local warping are jointly represented by global projection transformation, coarse resolution control layer, and fine resolution control layer constrained by topology. The structural changes corresponding to broken lines, missing strokes, closed boundary breakage, and overprinting misalignment are preserved in the edge topology residual and local phase residual. The candidate defect region inversely restricts the generation range corresponding to subsequent control. Multiple types of residuals form evidence source records under a shared spatial index. The detection results are output based on the stable state of the core region through continuous iteration. The processing covers the technical implementation of image representation, constrained registration, residual determination, hierarchical masking, hierarchical backtracking, topology event verification, and cross-cycle region corresponding to the region.
Claims
1. A cardboard box printing defect detection system based on industrial vision, characterized in that, This includes image representation chains, constrained deformation registration chains, residual decision chains, and mutually exclusive iteration chains; The image representation chain is used to generate a printing topology skeleton and continuous grayscale phase representation for the printed image of the carton to be tested and the standard printed image, respectively. The constrained deformation registration chain estimates the local deformation field based on the stable correspondence in the printed topology skeleton, and constrains the local deformation field with the topology connection relationship preservation condition and the candidate defect shielding region. The residual decision chain generates brightness residual, edge topology residual and local phase residual for the registered image, and forms candidate defect regions based on the spatial consistency relationship of at least two types of residuals; The mutually exclusive iteration chain writes the candidate defect region into the candidate defect shielding region, re-estimates the local deformation field and updates the candidate defect region until the carton printing defect detection result is obtained.
2. The cardboard box printing defect detection system based on industrial vision according to claim 1, characterized in that, The image representation chain extracts linear skeletons, closed skeletons, and partitioned skeletons according to text strokes, pattern outlines, and color block boundaries, respectively, and constructs a topological graph with connection order by skeleton endpoints, intersections, closed loops, and adjacent boundary segments. In the topology graph, nodes that simultaneously satisfy the conditions of stable adjacency, distinguishable local orientation, and recurrence across scales are selected as topology anchors, and an initial correspondence set between the print image to be tested and the standard print image is established based on the topology anchors. The continuous grayscale phase representation is composed of the local phase principal direction, phase consistency, and low-frequency displacement component, and shares a spatial index with the initial corresponding set.
3. The industrial vision-based cardboard box printing defect detection system according to claim 2, characterized in that, The constrained deformation registration chain generates a global projection transformation based on the topological anchor points, and constructs a local control mesh between the corresponding positions after the global projection transformation. For each control region of the local control grid, candidate displacements are calculated based on the continuous gray-scale phase characterization, and candidate displacements that cause skeleton endpoint merging, intersection order change, closed loop breakage or adjacent boundary intersection are marked as unusable displacements. The local deformation field is obtained from the remaining candidate displacements through spatial continuity constraints, and the addition of new control correspondences is prohibited within the candidate defect shielding region. Outside the candidate defect shielding region, the correspondence between the forward mapping and the reverse mapping is maintained.
4. The industrial vision-based cardboard box printing defect detection system according to claim 2, characterized in that, The residual judgment chain divides the registered print image to be tested and the standard print image into local regions of the shared spatial index, and calculates the normalized ink color difference in the local regions to form brightness residuals, the skeleton connection relationship difference to form edge topology residuals, and the phase principal direction and phase consistency difference to form local phase residuals. For each local region, a residual evidence item consisting of residual type, residual direction, and residual connectivity range is established. Only local regions where at least two of the residual evidence items overlap in position and have compatible boundary extension directions are incorporated into the candidate defect region, and the evidence source identifier corresponding to each candidate defect region is retained.
5. The industrial vision-based cardboard box printing defect detection system according to claim 3, characterized in that, Each skeleton edge in the topology graph records the node types at both ends, the curvature sequence along the line, the ink distribution order on both sides, and the identifiers of adjacent closed regions. The initial correspondence set is generated by a joint verification method of node correspondence and skeleton edge correspondence. When the local adjacency structure of two nodes is consistent but the curvature sequence or the ink distribution order on both sides of the connected skeleton edge is inconsistent, the corresponding node correspondence is deleted. When some nodes in the closed skeleton are occluded, candidate correspondences are recovered based on the in-loop order between unoccluded nodes and the identifiers of adjacent closed regions, and the recovered candidate correspondences are marked as low-confidence correspondences. The low-confidence correspondence does not participate in the global projection transformation, but only serves as a local control correspondence when its displacement direction is continuous with that of the adjacent topological anchor point.
6. The cardboard box printing defect detection system based on industrial vision according to claim 5, characterized in that, The local control grid is divided into coarse-resolution and fine-resolution layers according to the density of printed content, and the local displacement transmission is limited by the parent-child relationship between adjacent control points. The coarse resolution layer carries low-frequency displacements caused by carton bending and perspective compression, while the fine resolution layer carries local residual displacements that do not change the connection relationship of the topology. Control correspondences that are completed based on adjacency relationships due to partial occlusion are marked as low-confidence correspondences; For control regions where the forward mapping and the reverse mapping are inconsistent, freeze the fine-resolution hierarchical control points and revert to the parent control point to recalculate the displacement; The low-confidence correspondence participates in the fine-resolution hierarchical displacement calculation only when the displacement direction of adjacent control regions is continuous and no topological connection change occurs.
7. The industrial vision-based cardboard box printing defect detection system according to claim 4, characterized in that, The residual evidence items are oriented according to the normal direction of the character strokes, the tangent direction of the character strokes, the normal direction of the graphic boundary, and the direction inside the color block. The connected regions of different residual types under the same directional coding are combined into a defect evidence map. Each candidate connected region in the defect evidence diagram records its corresponding contour, skeleton crossing relationship, and phase change position in the print image under test and the standard print image. When the brightness residual is located only inside the color block and is not accompanied by a phase abrupt change or skeleton connection change, the corresponding area is removed from the candidate defect area; When the edge topology residual and the local phase residual are continuously distributed along the same boundary direction, their corresponding candidate connected regions are merged.
8. The cardboard box printing defect detection system based on industrial vision according to claim 7, characterized in that, The mutually exclusive iteration chain generates a hierarchical masking mask based on the evidence source identifier of each candidate connected region. It performs full masking on regions that simultaneously contain the edge topology residual and the local phase residual, and retains the outer boundary control correspondence and masks the inner control correspondence on regions that only contain the brightness residual. After each round of re-estimation of the local deformation field, the residuals that can be established from the updated local deformation field are deleted from the residual evidence item, and the defect evidence map is reconstructed based on the remaining residuals. When the boundary of the candidate connected region changes across rounds, the next round of hierarchical masking is updated with the continuously retained core regions, and the mapping record between the deleted region and the adjacent control grid is saved.
9. The industrial vision-based cardboard box printing defect detection system according to claim 6, characterized in that, After each round of local displacement update, the constrained deformation registration chain compares the topology graph with the transformed topology graph to identify events such as endpoint generation, endpoint disappearance, change of intersection order, closure loop cracking, and boundary crossing. For the control region adjacent to the low-confidence correspondent and where an event has occurred, trace upwards along the parent-child association to the resolution level where no topological event has occurred, and lock the corresponding parent control point; For control regions where no topological event occurs and the forward mapping and the reverse mapping are inconsistent, the next round of local control mesh is reconstructed based on the consistency of the curvature sequence of adjacent skeleton edges, selecting forward displacement, reverse displacement, or displacement components shared by both.
10. The cardboard box printing defect detection system based on industrial vision according to claim 8, characterized in that, The mutually exclusive iteration chain performs region correspondence on two consecutive rounds of defect evidence maps. For candidate connected regions where the contour shrinks but the core region remains, the evidence source identifier is inherited. For candidate connected regions where the contour splits, sub-region records are established according to the skeleton crossing relationship and the phase change position. For candidate connected regions where the contour merges, a merge record is established only when the direction encoding of each sub-region is consistent. When the mutually exclusive iterative chain maintains a consistent correspondence between the forward and reverse mappings of the local deformation field outside the candidate connected region, and the core region and the evidence source identifier do not change for two consecutive rounds, it outputs a carton printing defect detection result composed of the core region, the corresponding residual type, and the topological position.