Image recognition-based gilding uv printing defect intelligent detection method and system

By employing an image recognition-based intelligent detection method for UV hot stamping printing defects, and utilizing material distribution heat maps and multimodal image acquisition technology, the problem of distortion interference in curved areas in traditional detection methods is solved, achieving high-precision detection of UV hot stamping printing defects and real-time quality monitoring on mobile terminals.

CN123046090APending Publication Date: 2026-11-06SHENZHEN YONGSHUN PAPER PACKAGE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611227686.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Traditional visual inspection methods cannot effectively identify the multi-dimensional features of hot stamping UV printing products, resulting in high false detection rates and low efficiency, and failing to meet the needs of high-precision online quality inspection.

Method used

An intelligent defect detection method for hot stamping UV printing based on image recognition is adopted. The method generates a material distribution heat map through low-resolution pre-scanning, dynamically routes and collects multimodal images, and combines a lightweight classification network and a dual-path detector to perform defect detection in different regions, thereby achieving distortion filtering and defect identification in curved areas.

Benefits of technology

It enables accurate and reliable defect identification of hot stamping UV printed products, improves the accuracy and comprehensiveness of defect detection under complex working conditions, and supports real-time quality alarms on mobile terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123046090A_ABST
    Figure CN123046090A_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent detection method and system for UV printing defects in hot stamping based on image recognition, belonging to the field of visual inspection technology. The method includes: performing a low-resolution pre-scan on the target printing area, generating a material distribution heatmap through a lightweight classification network; driving an imaging device to acquire data in multiple modes based on the material distribution heatmap, and obtaining a target detection map by stitching the data with a spatial coordinate system and pixel level; inputting the data into a dual-path detector to divide the flat area and curved area, and performing defect detection and integration, filtering out curvature background distortion to obtain a defect distribution map, and visualizing and providing quality alarms on a mobile terminal interface. This invention solves the technical problem that the large differences in the reflective properties of printed surfaces and the curvature interference of curved areas make it difficult to comprehensively and effectively obtain defect information using a single imaging mode. It achieves regional adaptive imaging and distortion filtering for mixed materials and curved printed surfaces, improving the accuracy and comprehensiveness of defect detection under complex working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection technology, and in particular to an intelligent detection method and system for defects in hot stamping and UV printing based on image recognition. Background Technology

[0002] Hot stamping and UV lamination printing are widely used in packaging products. Printing defects directly affect product quality, and defect identification based on visual inspection is a core means of quality control. Existing visual inspection methods mostly use fixed-mode imaging and unified detection algorithms, which are suitable for flat printed parts of a single material. However, hot stamping and UV products have both highly reflective hot stamping areas and diffuse reflective UV coatings, and also include flat and curved composite structures, making traditional solutions poorly adaptable.

[0003] Traditional visual inspection does not distinguish between pixel material characteristics when acquiring images, and cannot simultaneously obtain multi-dimensional features of the surface, three-dimensional, and interlayer layers; curvature distortion of curved surfaces is prone to false detection, and high-resolution scanning of the entire area is inefficient, making it difficult to accurately and efficiently identify defects such as bubbles, delamination, and scratches. The data accuracy is insufficient and cannot meet the high-precision online quality inspection requirements of hot stamping and UV printing production lines. Summary of the Invention

[0004] This application provides an intelligent detection method and system for UV printing defects based on image recognition, which solves the technical problem that a single imaging mode is difficult to comprehensively and effectively obtain defect information due to the large differences in the reflective properties of the printed surface and the curvature interference of the curved area.

[0005] The first aspect of this application provides an intelligent detection method for UV hot stamping printing defects based on image recognition. The method includes: performing a low-resolution pre-scan on the target printing area, performing pixel material category probability analysis through a lightweight classification network to generate a material distribution heatmap; driving an imaging device to perform dynamic routing acquisition based on the material distribution heatmap, and stitching the data with a spatial coordinate system to obtain a target detection map, wherein the acquisition channels of phase deflection imaging mode, cross-polarization illumination mode, and near-infrared mode are triggered in parallel for highly reflective material areas, and the acquisition channel of photometric stereoscopic imaging mode is triggered for diffuse reflective material areas; inputting the material distribution heatmap and the target detection map into a dual-path detector, performing dual-path directional defect detection and integration by dividing the flat area and the curved area to obtain a defect distribution map, wherein the curved area uses phase deflection reconstruction and standard surface differential filtering to remove curvature background distortion; and visualizing the defect distribution map and providing quality alarms on a mobile terminal interface.

[0006] The second aspect of this application provides an intelligent detection system for UV hot stamping printing defects based on image recognition. The system includes: a material distribution heatmap generation module, used to perform low-resolution pre-scanning of the target printing area, and generate a material distribution heatmap by performing pixel material category probability analysis via a lightweight classification network; a target detection map acquisition module, used to drive an imaging device to perform dynamic routing acquisition based on the material distribution heatmap, and obtain a target detection map by pixel-level stitching using a spatial coordinate system, wherein high-reflectivity material areas trigger acquisition channels for phase-deflection imaging mode, cross-polarization illumination mode, and near-infrared mode in parallel, and diffuse-reflection material areas trigger acquisition channels for photometric stereoscopic imaging mode; a defect distribution map acquisition module, used to input the material distribution heatmap and target detection map into a dual-channel detector, and perform dual-channel directional defect detection and integration by dividing the flat area and curved area to obtain a defect distribution map, wherein the curved area uses phase-deflection reconstruction and standard surface differential filtering to remove curvature background distortion; and a visualization and alarm execution module, used to visualize the defect distribution map and issue quality alarms on a mobile terminal interface.

[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages: This application acquires multimodal images by partitioning based on the predicted material distribution, obtains printing defect-related data through 3D reconstruction and cross-modal feature fusion processing, calculates the defect location, size, and type information, and performs differential correction on the defect identification results by combining the division of straight and curved surfaces. This accurately identifies various types of defects on composite printed workpieces, making the detection results of hot stamping and UV printing defects more accurate and reliable. It achieves regional adaptation imaging and distortion filtering on the surface of mixed materials and curved printed products, improving the accuracy and comprehensiveness of defect detection under complex working conditions. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0009] Figure 1 This is a flowchart illustrating the intelligent detection method for UV hot stamping defects based on image recognition provided in this application embodiment.

[0010] Figure 2 This is a schematic diagram of the intelligent detection system for UV printing defects based on image recognition provided in the embodiments of this application.

[0011] Figure labeling: Material distribution heat map generation module 1, target detection map acquisition module 2, defect distribution map acquisition module 3, visualization and alarm execution module 4. Detailed Implementation

[0012] This application provides an intelligent detection method and system for UV printing defects based on image recognition, which solves the technical problem that a single imaging mode is difficult to comprehensively and effectively obtain defect information due to the large differences in the reflective properties of the printed surface and the curvature interference of the curved area.

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0014] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules not explicitly listed or inherent to such processes, methods, products, or devices.

[0015] Example 1, as Figure 1 As shown, an intelligent detection method for defects in UV hot stamping printing based on image recognition is provided, wherein the method includes: A low-resolution pre-scan is performed on the target printing area, and a pixel material category probability analysis is performed using a lightweight classification network to generate a material distribution heatmap.

[0016] In this embodiment, the printed area is a specific surface area of ​​the product surface where graphic patterns are formed through hot stamping and UV printing processes. The lightweight classification network is a lightweight deep learning classification model with few parameters and fast inference speed, used for quickly determining defect categories. The material distribution heatmap is a region mask image that divides regions according to material properties and marks different material types and their spatial coordinate ranges.

[0017] Specifically, a low-resolution pre-scanning method is used to acquire the target printing area to obtain a pre-scanned image. The pre-scanned image is then processed by a lightweight classification network to determine the material category probability distribution of each pixel based on pixel reflectance characteristics and texture features. Finally, a material distribution heatmap with different codes to identify material types is generated based on the material category probability distribution. The specific implementation process of this step will be described in detail later.

[0018] Based on the material distribution heat map, the driving imaging device performs dynamic routing acquisition, and after being stitched together with the spatial coordinate system at the pixel level, a target detection map is obtained. In this map, the acquisition channels of phase deflection imaging mode, cross polarization illumination mode and near-infrared mode are triggered in parallel in the high reflective material area, and the acquisition channel of photometric stereo imaging mode is triggered in the diffuse reflective material area.

[0019] In this embodiment, the imaging device is a hardware device integrating an industrial camera, a projection module, a multi-band light source, and a motion mechanism, used to acquire images and topographic data of the printed surface. The target detection image is a set of images of the printed area to be detected, spatially registered and integrating multimodal data on topographic height, surface texture, and interface state. High-reflectivity material areas are printed areas whose surfaces are covered with highly reflective materials such as hot stamping layers, easily producing specular reflection. Diffuse reflection material areas are printed areas whose surfaces are made of ordinary ink, primarily using diffuse reflection imaging, and without strong specular reflection.

[0020] Optionally, the imaging device is driven to perform dynamic routing acquisition by generating control commands based on the material distribution heat map to obtain a multi-mode imaging atlas. The imaging atlas is then unified to the same spatial coordinate system through a pre-calibrated coordinate transformation matrix involving the inside and outside of the imaging device. Pixel-level stitching and fusion are performed along the regional boundaries of the material distribution heat map. Weighted average fusion is used at the stitching boundaries to achieve a smooth transition, generating a target detection map covering the target printing area. The specific implementation process of this step will be described in detail later.

[0021] Furthermore, by identifying the coded identifier, multiple imaging channels are triggered to perform parallel acquisition of height information, surface texture, and interface state information for highly reflective material areas to obtain the first image set. For diffuse reflective material areas, a photometric stereoscopic imaging mode is triggered to sequentially illuminate multiple directional light sources and acquire surface images under illumination from each direction to obtain the second 2.5D height map. The acquisition sequence is controlled by the regional boundary coordinates of the material distribution heatmap, and asynchronous parallel acquisition of multiple imaging modes is performed. The specific implementation process of this step will also be described in detail later.

[0022] The material distribution heat map and the target detection map are input into the dual-path detector. By dividing the flat area and the curved area, dual-path directional defect detection and integration are performed to obtain the defect distribution map. In the curved area, phase deflection reconstruction and standard surface differential filtering are used to remove curvature background distortion.

[0023] In this embodiment, the dual-path detector is a visual detection processing module equipped with two independent detection algorithm paths, capable of parallel identification of defects in planar and curved areas. The flat area refers to the printed graphic area of ​​the hot-stamping UV-printed product with extremely low surface curvature and an overall flat state. The curved area refers to the printed graphic area of ​​the hot-stamping UV-printed product with continuous curvature changes and an arc-shaped shape. The defect distribution map is a detection result map that fully marks the location, size, and category information of all defects on the surface of the printed product.

[0024] In one embodiment of this application, a material distribution heat map and a target detection map are input into a dual-path detector. Based on the material distribution heat map, the surface area and the curved area are divided. The target detection map of the surface area is input into the first detection path, and the target detection map of the curved area is input into the second detection path to perform defect detection in parallel, thereby obtaining curved defects and surface defects. These are then merged to generate a defect distribution map of the entire product's target printing area. The specific implementation process of this step will also be described in detail later.

[0025] The defect distribution map is visualized and quality alarms are displayed on the mobile terminal interface.

[0026] Specifically, after the detection unit completes defect detection and generates a defect distribution map, it packages the structured data of the defect distribution map and basic product information and sends it to the mobile terminal via wireless LAN. The data packet includes the center coordinates, area, defect category, severity level, and corresponding original image index for each defect. After receiving the data packet, the mobile terminal performs data parsing and verification, extracts the attribute parameters of all defects, and loads the standard outline of the corresponding product model as a visualization base map. The coordinate system of the base map is consistent with the spatial coordinate system of the defect data.

[0027] The mobile terminal interface uses the system's native canvas component to visualize and render the defect distribution map. Based on the product's standard outline, defect areas are marked at corresponding locations according to their spatial coordinates and dimensions. Different types of defects are distinguished by differentiated visual styles: defects attached to the interface are marked with a solid red border, surface morphology defects with a dashed orange border, and geometric depressions and protrusions with semi-transparent blue and purple fills, respectively. All markers are pixel-level aligned with the base map. The interface supports two-finger zoom and single-finger panning, allowing for magnified viewing of specific defect areas.

[0028] The mobile terminal pre-stores product quality judgment standard parameters, including the upper limit of the number of defects per product, the maximum area threshold of a single defect, and a list of serious defect categories. After completing defect data parsing, the terminal automatically calculates the total number of defects, the maximum defect area, and the number of serious defects for the current product, and compares the statistical results with the preset acceptable thresholds one by one. If any indicator exceeds the acceptable threshold, a quality alarm is immediately triggered, a red alarm bar pops up at the top of the interface displaying the information of the exceeding item, and the terminal simultaneously outputs vibration and an alarm sound to alert the operator. The current product is automatically marked as unqualified.

[0029] Clicking on any defect marker on the interface will bring up a pop-up window displaying details such as the defect's category, area, depth of indentation or protrusion, and location number. It also supports retrieving and viewing thumbnails of the original images acquired at the corresponding location, facilitating on-site verification by operators. All inspection results are automatically stored in the terminal's local database, supporting historical record queries and data export by product batch and inspection time.

[0030] By visualizing and rendering defect distribution maps and providing graded quality alarms on mobile terminals, the system enables portable viewing of printing defect detection results and real-time quality warnings, effectively improving the flexibility and efficiency of on-site quality inspection.

[0031] Furthermore, the method provided in this application embodiment includes: A low-resolution pre-scanning method is used to acquire the target printing area to obtain a pre-scanned image. The pre-scanned image is then processed by a lightweight classification network, which uses pixel reflectivity and texture features as classification criteria to determine the material category probability distribution of each pixel. A material distribution heatmap is then determined based on the material category probability distribution, wherein the material distribution heatmap uses different codes to identify the material type.

[0032] Specifically, firstly, a low-resolution pre-scan is used to acquire images of the target printing area. The acquisition process uses an area-array industrial camera paired with a uniform white diffused light source. For example, the pre-scan acquisition resolution is set to 640×480 pixels, while the subsequent formal inspection acquisition resolution is set to 5120×3840 pixels. The camera completes single-frame image acquisition along the contour range of the target printing area. After acquisition, the original image is converted to grayscale. A weighted average grayscale conversion method is used to calculate the grayscale value of each pixel. Then, a 3×3 template median filter is used to remove random noise introduced during image acquisition and correct grayscale deviations caused by uneven illumination, resulting in a pre-scan image covering the entire target printing area.

[0033] The lightweight classification network employs a lightweight convolutional neural network architecture. The network input is a pre-processed, pre-scanned image with a uniform size of 640×480 pixels and one input channel. The main body of the network uses a combined encoder and decoder structure. Specifically, the encoder consists of four depthwise separable convolutional units connected sequentially. Each depthwise separable convolutional unit contains a depthwise convolutional layer, a pointwise convolutional layer, a batch normalization layer, and a linear rectified activation function layer. The kernel size is uniformly set to 3×3, and the stride is set to 2. The output channels of the four depthwise separable convolutional units are 16, 32, 64, and 128 respectively, downsampling layer by layer to extract pixel reflectance characteristics and texture features from the image.

[0034] The decoder section consists of four bilinear upsampling layers, progressively restoring the feature map size to the input image size. It also incorporates four skip connection structures to concatenate and fuse the shallow feature maps from the encoder's corresponding layers with the upsampled feature maps of the same size from the decoder along the channel dimension, ensuring the integrity of feature details. The final output layer uses the Sigmoid function for numerical mapping, with two output channels corresponding to highly reflective and diffuse materials. The output is a pixel-level probability matrix of the same size as the input image, where each value represents the probability of a pixel belonging to the corresponding material category, thus determining the material category probability distribution for each pixel. It should be noted that this embodiment uses the distinction between highly reflective and diffuse materials as an example. When the target printing area involves more material types, those skilled in the art can expand the number of output channels accordingly and adjust the labeled categories of the training samples based on this embodiment.

[0035] The lightweight classification network was trained using a supervised training method. Two thousand low-resolution images of different styles of UV-printed hot foil stamping samples were pre-collected, and pixel-level annotations were performed on the highly reflective and diffuse reflective material regions in the images to construct a sample dataset. The training set comprised 80% of the sample dataset, and the validation set comprised 20%. All sample images were uniformly scaled to 640×480 pixels. During training, data augmentation was performed on the training set images, randomly selecting images for horizontal and vertical flipping and brightness adjustment. The brightness adjustment ranged from 0.8 to 1.2 times the original image's grayscale value to improve the network's generalization ability. Cross-entropy loss was used as the loss calculation standard, and an adaptive moment estimation optimizer was employed for weight updates. The initial learning rate was set to 0.001, and the training batch size was set to 16. During training, the network's classification performance is validated using a validation set after every 10 rounds of training. The classification accuracy is calculated using pixel-level intersection-union ratio (IU). When the IU of the validation set improves by less than 0.1% for 5 consecutive rounds, the network training is considered to have converged. The current network weight parameters are then saved, and the lightweight classification network is completed.

[0036] Finally, the pre-scanned image is input into the trained lightweight classification network. The network performs layer-by-layer feature extraction and calculation on the input image, outputting the probability value of each pixel corresponding to two material types, forming a complete pixel material category probability distribution. Based on the pixel material category probability distribution, the material category with the highest probability value for each pixel is selected as the final classification result. Different grayscale encoding values ​​are used to correspond to different material types, with a grayscale encoding value of 255 corresponding to highly reflective material areas and a grayscale encoding value of 0 corresponding to diffuse reflective material areas. The boundary transition areas between the two material types are linearly interpolated and encoded according to the probability values. After encoding and assigning values ​​to all pixels in the entire image, a material distribution heatmap that completely corresponds to the spatial coordinates of the pre-scanned image is generated. The material distribution heatmap identifies various material regions within the target printing area using different codes.

[0037] By combining low-resolution pre-scanning with pixel-level lightweight classification networks, rapid and accurate segmentation of different material areas within the target printing area is achieved, providing accurate regional control basis for subsequent partitioned imaging and directional defect detection.

[0038] Furthermore, the method provided in this application embodiment includes: The material distribution heatmap is used to generate control commands to drive the imaging device to perform dynamic routing and obtain an imaging atlas acquired in multiple modes. The imaging atlas is unified to the same spatial coordinate system by a pre-calibrated internal and external coordinate transformation matrix of the imaging device. Pixel-level stitching and fusion are performed along the regional boundary of the material distribution heatmap to generate a target detection map covering the target printing area. Weighted average fusion is used at the stitching boundary to perform a smooth transition.

[0039] Optionally, the material coding information in the material distribution heatmap is first read, and the pixel coordinate range and boundary contour of the high-reflectivity material region and the diffuse-reflectivity material region are obtained. Based on the pre-calibrated world coordinate system of the target printing area, a mapping relationship between the image pixel coordinates and the physical coordinates of the imaging device's motion platform is established, and the pixel coordinates of each material region are converted into a physical coordinate range that the imaging device can recognize.

[0040] Next, the movement path of the imaging device is planned according to a left-to-right, top-to-bottom traversal order, sequentially covering all material areas. Correspondingly, imaging mode trigger commands and device movement path commands are generated for different material areas, combining to form a complete dynamic routing control command. The dynamic routing control command is sent to the motion control unit of the imaging device, driving the imaging device to move along the planned path. When the imaging device moves to the coordinate range of the corresponding material area, the corresponding imaging mode is automatically triggered to execute image acquisition. After sequentially completing image acquisition for all material areas, an imaging atlas containing multiple imaging modes is obtained. The imaging atlas is stored according to imaging modality, and each image is accompanied by corresponding acquisition position coordinate information.

[0041] The camera system of the imaging device is pre-calibrated using a checkerboard calibration method. Specifically, checkerboard images are acquired at different angles. Through corner point extraction and parameter calculation, the internal and external parameters of each camera are obtained. The internal parameters include focal length, principal point coordinates, and distortion coefficients, while the external parameters include the rotation matrix and translation vector between cameras. Simultaneously, the coordinate transformation matrix between the camera coordinate system and the world coordinate system of the target printing area is calibrated. This coordinate transformation matrix serves as the unified transformation benchmark for mapping pixel coordinates to physical coordinates during the dynamic routing stage. For each image in the imaging atlas, distortion correction is first performed by substituting the corresponding camera's internal parameters to eliminate image distortion caused by lens distortion. Then, coordinate mapping is performed using the external parameters and the coordinate transformation matrix to uniformly transform the pixel coordinates of all images to the same world coordinate system, ensuring that images acquired from different acquisition channels and shooting positions have a unified spatial coordinate benchmark.

[0042] After coordinate unification, image stitching is performed separately for each imaging modality. Using the region boundaries of the material distribution heatmap as a reference, the overlapping stitching area between two adjacent images of the same modality is determined. The overlapping area is distributed along the region boundary, with a width of 20 pixels. For regular regions with straight-line boundaries, the distance from any pixel within the overlapping area to the left image boundary and the distance to the right image boundary are calculated using the Euclidean distance from the pixel to the boundary in the horizontal or vertical direction. For irregular regions with curved boundaries, adjacent images distributed along the boundary in the material distribution heatmap are aligned according to the spatial grid coordinates at the time of actual acquisition. Pixels within the overlapping area are assigned a distance weight to the left or right image based on their spatial grid coordinate position, with the distance calculated along the spatial coordinate axis.

[0043] Finally, based on the defined distance values, a weighted average fusion algorithm is used to smooth the transition of the overlapping areas. The specific calculation process is as follows: For any pixel within the overlapping area, the distance from that pixel to the left image boundary and the distance to the right image boundary are calculated respectively. These distance values ​​are normalized and used as weight coefficients for both images, with the sum of the weight coefficients being 1. The grayscale value of the pixel at that location in both images is multiplied by the corresponding weight coefficient and then summed to obtain the fused pixel grayscale value. This process is repeated for all pixels in the overlapping area. After performing the weighted average fusion processing on the stitching boundaries of all adjacent areas, each imaging modality generates a corresponding image covering the entire target printing area. The full-frame images from all modalities together constitute the target detection map.

[0044] By driving the imaging device to perform dynamic routing acquisition through material distribution heatmap, and combining it with multimodal pixel-level weighted average stitching and fusion processing under a unified coordinate system, differentiated on-demand imaging of different material regions is achieved, ensuring the spatial coordinate consistency of the target detection map and the smooth transition effect of image boundaries.

[0045] Furthermore, the method provided in this application embodiment includes: By identifying the coded identifier, multiple imaging channels are triggered for highly reflective material areas, and the acquisition of height information, surface texture, and interface state information is performed in parallel to obtain the first image set. For diffuse reflective material areas, a photometric stereoscopic imaging mode is triggered to obtain the second 2.5D height map. This is achieved by sequentially illuminating multiple directional light sources and acquiring surface images under illumination from each direction. The acquisition timing is controlled by the regional boundary coordinates of the material distribution heatmap, and asynchronous parallel acquisition of multiple imaging modes is performed.

[0046] Specifically, firstly, for the highly reflective material area, the phase deflection imaging mode, cross-polarization illumination mode, and near-infrared mode are executed in parallel to obtain the first 2.5D height map, the texture detail map dominated by diffuse reflection, and the interface feature map reflecting the adhesion state of the hot stamping layer and the UV varnish interface, respectively. After being fused by spatial phase mapping and cross-modal attention mechanism, the first atlas is obtained. The specific implementation process of this step will be described in detail later.

[0047] Subsequently, the coded identifiers in the material distribution heatmap are read to locate the spatial coordinate range of the diffuse reflective material area, triggering the photometric stereo imaging channel. The photometric stereo imaging channel consists of a grayscale industrial camera array and four sets of white LED light sources. The four sets of light sources are positioned directly above, to the right, below, and to the left of the camera's field of view, with the illumination elevation angle uniformly set to 45 degrees. The incident direction vector of each light source is pre-calibrated using a standard spherical calibration method. During calibration, a standard matte sphere of known radius is placed at the center of the acquisition station. Single-set light sources are sequentially illuminated to acquire corresponding spherical images. The coordinates of the highlight points on the spherical surface are extracted. Combined with the pre-determined coordinates of the sphere's center and radius parameters, the incident direction vector of the corresponding light source is calculated through spatial geometric relationships, and the direction vector parameters corresponding to each of the four light sources are stored. The acquisition timing is controlled by the regional boundary coordinates of the material distribution heat map. Acquisition station nodes are divided according to the regional boundaries. Multi-channel acquisition of highly reflective material areas and photometric stereoscopic acquisition of diffuse reflective material areas are assigned to different station nodes and uniformly scheduled by the motion control system of the imaging device to execute asynchronous parallel acquisition of multiple imaging modes, so as to avoid interference between the optical paths of different imaging modes.

[0048] When the imaging device moves to the corresponding station in the diffuse reflection material area, the relative position of the camera and the diffuse reflection material area is kept fixed, and the photometric stereoscopic acquisition process is initiated. White LED light sources in four directions are lit sequentially in a clockwise order: top, right, bottom, and left. While each set of light sources is lit, the other three sets remain off. After each set of light sources is lit, the area array grayscale industrial camera simultaneously acquires a frame of surface image of the diffuse reflection material area under the corresponding lighting conditions. After the lighting and image acquisition of all four sets of light sources are completed, four surface images under different lighting directions are obtained. Throughout the acquisition process, the output brightness of the light sources is kept stable, and the camera exposure parameters are fixed to ensure that the lighting reference of each image is consistent.

[0049] Next, the four acquired surface images were preprocessed, performing grayscale correction and median filtering to eliminate the effects of acquisition noise and illumination drift. Based on the Lambertian reflection model and combined with four pre-calibrated light source direction vectors, the least squares method was used to solve for the grayscale value of each pixel, calculating the surface normal vector corresponding to each pixel and generating a complete surface normal vector map.

[0050] Finally, the Poisson integral method is used to calculate the depth of the surface normal map. The calculation process uses the zero depth value of the pixels at the four boundaries of the image as a boundary constraint. The relative depth data of the diffuse material region is obtained by solving the Poisson equation. Then, the pixels of the flat areas near the four corners of the image are selected as reference points. The least squares method is used to fit the depth data of the reference points to the plane to obtain the reference plane equation. The depth reference plane is corrected by subtracting the depth value of the corresponding position of the reference plane from the depth data of the whole image. The relative depth data is converted into height data under a unified reference to generate the second 2.5D height map.

[0051] By combining partitioned asynchronous parallel multi-mode acquisition scheduling with photometric stereo imaging calculation, surface morphology height data of diffuse reflective material regions can be efficiently acquired. At the same time, the acquisition independence and data accuracy of different imaging modes are ensured, providing complete morphology data support for subsequent full-domain defect detection.

[0052] Furthermore, the method provided in this application embodiment includes: A phase-deflection imaging mode is used to obtain a first 2.5D height map, which is obtained by projecting a sinusoidal fringe pattern and acquiring deformed fringe images. A cross-polarized illumination mode is used to obtain a texture detail map dominated by diffuse reflection by eliminating specular reflection interference. A near-infrared mode is used to extract the adhesion state features and interface defect features of the hot stamping layer and UV varnish interface based on the penetration characteristics of near-infrared light through the UV coating, resulting in an interface feature map. Spatial phase mapping is performed on the first 2.5D height map, texture detail map, and interface feature map to obtain the first image set, wherein the first image set is enhanced by feature fusion using a cross-modal attention mechanism.

[0053] Specifically, the system first reads the coded identifiers from the material distribution heatmap to locate the spatial coordinates of the highly reflective material area, simultaneously triggering three acquisition channels: the phase-deflection imaging channel, the cross-polarization illumination channel, and the near-infrared imaging channel. These three channels share the same motion mounting base, and the coaxial calibration of each channel's optical axis and imaging field of view is pre-completed to ensure that the acquisition range of each channel matches the coordinate range of the highly reflective material area. When the imaging device moves to the corresponding position in the highly reflective material area, the three channels simultaneously initiate the acquisition process, completing the parallel acquisition of three types of images at the same workstation, with the acquisition timing consistent with the dynamic routing's area movement rhythm.

[0054] The phase-deflection imaging mode is achieved using a digital light processing projection device in conjunction with an industrial area array camera. The projection device projects a vertical sinusoidal fringe pattern onto a highly reflective material area. For example, the fringe period is set to 16 pixels, and four sinusoidal fringe images with a phase difference of 90 degrees are projected sequentially using a four-step phase-shifting method. The industrial camera simultaneously acquires deformed fringe images modulated by the surface topography of the highly reflective material. The four deformed fringe images are substituted into the phase-shifting calculation formula to obtain a wrapped phase map. Then, a quality map-guided phase unwrapping algorithm is used to unwrap the wrapped phase map to obtain a continuous absolute phase map. The phase-to-height mapping relationship is pre-calibrated using a standard step calibration method. Phase data of standard step blocks with known height values ​​are collected, and the mapping coefficient between the phase value and the actual height value is obtained through linear fitting. The absolute phase map is substituted into the calibrated phase-to-height mapping relationship to convert it into depth and height data for the corresponding area, generating the first 2.5D height map.

[0055] Cross-polarized illumination mode is achieved using a white polarized light source and an industrial camera with polarizers. A linear polarizer with a polarization direction of 0 degrees is installed at the light-emitting end of the light source, and a linear polarizer with a polarization direction of 90 degrees is installed at the camera lens end. The polarization directions of the two sets of polarizers are orthogonal to each other. The white polarized light source illuminates the highly reflective material area at a diffuse angle. The specular reflection light from the surface of the highly reflective material is filtered out because its polarization direction is orthogonal to the polarizer at the camera end, while the diffuse reflection light from the surface of the material can partially pass through the polarizers and enter the camera. The camera acquires the image after filtering out specular reflections, performs grayscale normalization and contrast enhancement processing on the image, and obtains a texture detail map mainly based on diffuse reflection information.

[0056] The near-infrared mode is achieved using an exemplary 850 nm wavelength near-infrared LED light source in conjunction with a near-infrared industrial camera. The UV coating has high light transmittance in the near-infrared band, while the hot stamping layer has strong reflective properties for near-infrared light. The near-infrared LED light source illuminates the highly reflective material area at a 45-degree angle. The near-infrared light penetrates the surface UV coating and reaches the hot stamping layer interface. Differences in the hot stamping adhesion, blurred lettering, or smudged printing at the interface will cause variations in the intensity of reflected light. The near-infrared industrial camera captures images of the near-infrared light reflected from the interface, performs histogram equalization on the images, extracts the adhesion characteristics and interface defect characteristics of the hot stamping layer and UV varnish interface, and generates an interface feature map.

[0057] After completing the acquisition of the above three types of images, the next step is to perform spatial phase mapping processing, the specific steps of which are as follows: Using the phase coordinates and spatial pixel coordinates of the first 2.5D height map as a reference, pixel registration is performed on the texture detail map and interface feature map using a pre-calibrated homography matrix, ensuring that corresponding pixels in the three images are perfectly aligned in spatial coordinates. After registration, a cross-modal attention mechanism is used for feature enhancement. Shallow feature maps of the three types of images are extracted through three convolutional units, each with a 3×3 kernel size and a stride of 1. The number of output channels for the three convolutional units are 16, 32, and 64, respectively. After feature extraction, a channel attention module is connected. First, global average pooling is performed on the feature maps of each modality to obtain global feature vectors in the channel dimension. Then, weight mapping is performed through two fully connected layers. Finally, the weight coefficients for each feature channel are generated by the Sigmoid function, with higher weights assigned to feature channels related to defects. The weighted multimodal features are stitched together along the channel dimension to obtain the enhanced multichannel feature data. The first set of images consists of the registered and aligned original images and the corresponding enhanced features. All data maintain a unified spatial coordinate reference and are used in the subsequent defect detection process.

[0058] By using multi-channel parallel acquisition and cross-modal attention feature fusion processing in high-reflectivity material areas, multi-dimensional defect information of three-dimensional morphology, surface texture and interface state is obtained simultaneously, which effectively improves the integrity and recognition accuracy of defect features in high-reflectivity composite printing areas.

[0059] Furthermore, the method provided in this application embodiment includes: The material distribution heat map and the target detection map are input into a dual-path detector. Based on the material distribution heat map, the surface area and the curved area are divided. The target detection map of the surface area is input into the first detection path, and the target detection map of the curved area is input into the second detection path. Defect detection is performed in parallel to obtain curved defects and surface defects. The two are then merged to generate a defect distribution map of the entire product's target printing area.

[0060] Specifically, firstly, the material distribution heatmap and the target detection map are simultaneously input into the dual-path detector. Using each material region in the heatmap as the basic dividing unit, the 2.5D height data corresponding to each material region in the target detection map is extracted. The neighborhood quadratic surface fitting method is used to calculate the surface curvature value of each pixel within each material region. The calculation window is set to 5×5 pixels. The height data within the window is fitted with a quadratic surface equation using the least squares method to obtain the average curvature value of the center pixel, with the curvature value measured in millimeters. The arithmetic mean of the curvature values ​​of all pixels within the region is taken to obtain the overall curvature feature of the corresponding material region. A curvature judgment threshold of 0.02 millimeters is preset. Material regions with an average absolute curvature value less than 0.02 millimeters are defined as planar regions, and material regions with an average absolute curvature value greater than or equal to 0.02 millimeters are defined as curved regions. Planar region masks and curved region masks are generated respectively. Both types of masks maintain the same size and spatial coordinate reference as the target detection map and are used for subsequent path segmentation of region data.

[0061] The dual-path detector has two independent detection paths, a first detection path and a second detection path, which operate in parallel. Based on the generated planar region mask, multimodal image data of the corresponding planar region is extracted from the target detection image and input into the first detection path for defect detection. Based on the generated curved region mask, multimodal image data of the corresponding curved region is extracted from the target detection image and input into the second detection path for defect detection. Before formal defect detection, the second detection path first performs curvature background distortion filtering on the height data of the curved region. Phase deflection reconstruction and standard surface difference are used to remove background height deviations caused by the curvature of the surface itself. After background correction, a multi-feature threshold method is used for defect feature extraction and determination. The specific implementation steps of curvature background distortion filtering are described in detail in the corresponding embodiments.

[0062] The first detection path employs a multi-feature thresholding method to detect defects in the facet region, extracting both the grayscale and height features of the texture details. For the texture detail map, a Gaussian weighted local adaptive thresholding algorithm is used with an 11×11 pixel neighborhood window to extract abnormal candidate regions whose grayscale values ​​deviate from the neighborhood baseline. For the height map, a fixed height difference thresholding algorithm is used with a height difference threshold set to 5 micrometers to extract abnormal candidate regions with convex or concave shapes. Spatial coordinate matching is performed on the two types of candidate regions, extracting four feature parameters for each matched candidate region: area, aspect ratio, grayscale contrast, and height difference. Pre-set defect judgment thresholds: area threshold of 0.05 square millimeters, aspect ratio threshold ranging from 0.2 to 5, grayscale contrast threshold of 15, and height difference threshold of 5 micrometers. Candidate regions whose four feature parameters all meet the judgment criteria are marked as facet defects, and the location coordinates and category information of all facet defects are output.

[0063] After the second detection path completes the curvature background distortion filtering, defect detection is performed on the corrected surface region height data and texture data. For the texture detail map, a Gaussian weighted local adaptive threshold segmentation algorithm is used, with a neighborhood window set to 11×11 pixels, to extract grayscale anomaly candidate regions. For the corrected height map, a fixed height difference threshold segmentation algorithm is used, with a height difference threshold set to 3 micrometers, to extract shape anomaly candidate regions. After spatial coordinate matching of the two types of candidate regions, four feature parameters are extracted for the corresponding candidate regions: area, aspect ratio, grayscale contrast, and height difference. Defect judgment thresholds adapted to the surface region are used for judgment, where the area threshold is set to 0.03 square millimeters, the aspect ratio threshold range is set to 0.15 to 6, the grayscale contrast threshold is set to 12, and the height difference threshold is set to 3 micrometers. Regions meeting the conditions are marked as surface defects, and the position coordinates and category information of all surface defects are output.

[0064] Finally, the surface defect detection results and curved surface defect detection results are aligned in spatial coordinates. Using the unified world coordinate system corresponding to the target detection map as a reference, the labeling information of the two types of defects is mapped to the same full-area image canvas. For spatially overlapping defect labels, deduplication and merging are performed. The intersection-union ratio (IUR) of the two defect regions is calculated. When the IUR is greater than 0.5, it is determined to be a duplicate label of the same defect. The defect confidence is calculated by weighting the gray-level contrast and height difference of the candidate regions, with each weighting 0.5. For duplicate labels, the label with higher confidence is retained. After deduplication of all overlapping defects, a defect distribution map covering the entire target printing area is finally generated. The defect distribution map contains the location, size, and category information of all defects.

[0065] By dividing the flat area into flat and curved areas and performing dual-path directional parallel defect detection and result integration, the adaptability and efficiency of defect detection in different morphological areas are improved, ensuring the integrity and accuracy of defect detection results for the entire target printing area.

[0066] Furthermore, the method provided in this application embodiment includes: The standard curved surface geometric framework of the target printing area of ​​the product is input into the second detection path. Surface phase deflection reconstruction is performed on the target detection map of the curved surface area. After phase unwrapping and phase-height mapping processing, a measured three-dimensional point cloud of the curved surface is reconstructed. The measured three-dimensional point cloud of the curved surface is registered to the standard curved surface geometric framework, and the height difference is calculated for each grid node to generate a surface differential height map. Normal deformation components caused by continuous curvature changes in the surface differential height map are marked as background distortion components and filtered out to obtain a defect candidate height difference dataset. In the defect candidate height difference dataset, connected regions with absolute height differences exceeding a preset detection threshold are selected. The maximum depression depth, protrusion height, area, and center coordinates are extracted as surface defect regions and feature recognition is performed to obtain the surface defect.

[0067] In one embodiment, a standard curved surface geometric framework is pre-constructed based on the design parameters of the target printed product. Those skilled in the art use professional 3D modeling software to generate a standard mesh model consistent with the product's curved surface shape. The model uses a uniform quadrilateral mesh with a mesh node spacing of 0.1 mm. Each mesh node stores the corresponding standard height coordinates and spatial position information. The standard curved surface geometric framework is pre-stored in the storage unit of the second detection path. The second detection path extracts the phase deflection deformation fringe image corresponding to the curved surface region. A four-step phase shift method is used to calculate the four deformation fringe images with a 90-degree phase difference, obtaining the wrapping phase map. Then, a quality map-guided phase unfolding algorithm is used to obtain a continuous absolute phase map. Combining the pre-calibrated phase and height mapping relationship, the absolute phase map is converted into spatial height data corresponding to each pixel. Three-dimensional coordinate mapping is performed on the pixels within the effective area to generate a measured 3D point cloud of the curved surface containing all effective sampling points of the curved surface region.

[0068] Next, the measured 3D point cloud of the surface is registered with the standard surface geometric frame. Specifically, the measured 3D point cloud is first subjected to voxel downsampling, with the voxel size set to 0.1 mm to reduce the amount of point cloud data and improve computational efficiency. Since the measured 3D point cloud and the standard surface geometric frame share the pre-calibrated world coordinate system of the target printing area, the initial transformation matrix for the registration calculation is the identity matrix, which serves as the initial pose for iterative calculation. Using the set of mesh nodes of the standard surface geometric frame as the reference point set, the iterative nearest-point algorithm is used for rigid body registration calculation. During the iteration, the optimization objective is to minimize the sum of squared distances between point pairs. The rotation matrix and translation vector are updated in each iteration. Registration is considered converged when the change in registration error between two consecutive iterations is less than 0.001 mm. The registered measured 3D point cloud of the surface is then mapped to each mesh node of the standard surface geometric frame using a bilinear interpolation algorithm to obtain the measured height value corresponding to each mesh node. The difference between the measured height value and the standard height value is calculated for each grid node, and the difference is stored in the corresponding node position to generate a surface differential height map with the same size as the standard surface grid.

[0069] Subsequently, background distortion component filtering was performed on the surface differential height map, and normal deformation components were extracted using an iterative weighted quadratic polynomial surface fitting method. During the initial fitting, all valid grid node data in the surface differential height map were selected, with the planar coordinates of the nodes as the independent variable and the height difference as the dependent variable. The least squares method was used to fit the quadratic polynomial surface equation. After the initial fitting, the residual between the height difference of each grid node and the fitted value was calculated, and the standard deviation of all residuals was calculated. Outlier nodes with an absolute residual value greater than 3 times the standard deviation were removed. A second least squares fitting was performed using the remaining valid nodes to obtain the final fitted surface. The height distribution corresponding to this fitted surface represents the normal deformation component caused by the continuous change in curvature, and is labeled as the background distortion component. The original height difference of each grid node in the surface differential height map was subtracted from the height value of the fitted surface at the corresponding location to eliminate the background height deviation caused by the overall curvature of the surface, resulting in a defect candidate height difference dataset that retains only local abnormal height changes.

[0070] A height difference detection threshold of 3 micrometers and a minimum defect area threshold of 0.02 square millimeters are pre-set. Threshold segmentation is then performed on the candidate height difference dataset, marking all grid nodes with an absolute height difference greater than 3 micrometers as anomalous nodes. An eight-connected-domain labeling algorithm is used to divide all anomalous nodes into connected regions, resulting in several independent anomalous connected regions. Noise filtering is then performed, calculating the area of ​​each anomalous connected region, and discarding regions with areas smaller than the minimum defect area threshold as noise. Feature parameters are extracted from each remaining anomalous connected region. The maximum positive height difference within the region is calculated as the convex height, the absolute value of the minimum negative height difference is calculated as the maximum concave depth, the number of grid nodes within the region is counted, and the region area is calculated by combining this with the physical area corresponding to a single grid node. The average coordinates of all nodes in the region are then calculated to obtain the center coordinates. Anomalous connected regions with extracted complete feature parameters are marked as surface defect regions, and the feature data and location information of all surface defects are output.

[0071] Finally, the geometric defects in the surface defect region are identified, the texture detail map and interface feature map of the surface defect region are cropped, and the gray-scale statistical features and local binary pattern texture features are extracted to determine the state defects. The geometric defects and state defects are spatially phase integrated to obtain the surface defects. The specific implementation process of this step will be described in detail in the subsequent embodiments.

[0072] By employing surface phase deflection reconstruction, standard surface geometric frame registration difference, and iterative fitting background distortion filtering, the interference of the continuous curvature of the surface itself on defect detection is effectively eliminated, enabling accurate identification and quantitative characterization of morphological defects in the printed area of ​​the surface.

[0073] Furthermore, the method provided in this application embodiment includes: Identify geometric defects in the surface defect region; cut out the texture detail map and interface feature map of the surface defect region, extract grayscale statistical features and local binary pattern texture features respectively, and determine the state defect; perform spatial phase integration on the geometric defect and the state defect to obtain the surface defect.

[0074] Optionally, the location coordinates and geometric shape data of the marked surface defect area are obtained, and the geometric defects of the corresponding area are identified from the defect candidate height difference dataset. The geometric defects include concave defects and convex defects. They are classified and labeled according to the positive and negative attributes of the height difference value, and the geometric parameters such as the maximum concave depth, convex height, and area of ​​each geometric defect are recorded simultaneously.

[0075] Next, based on the spatial coordinate range of each surface defect region, the texture detail map and interface feature map of the defect region are cropped from the spatially registered target detection map. The cropped area is extended outward by 5 pixels to ensure complete coverage of the defect region and its surrounding reference area. The cropped image maintains the same spatial coordinate reference as the original image, and this reference is consistent with the registration result calibrated by the homography matrix in the spatial phase mapping stage.

[0076] Then, feature extraction is performed on the cropped texture detail map and interface feature map respectively. For grayscale statistical features, the mean, variance, and information entropy of grayscale values ​​of all pixels within the region are calculated for each image to obtain the grayscale distribution statistical parameters of the corresponding region. For texture features, the unified local binary pattern operator of equivalent patterns is used to extract local texture features. The neighborhood sampling points are set to 8, and the sampling radius is set to 1 pixel. The original 256 local binary patterns are mapped to 59 equivalent patterns. While retaining the core texture information, the feature dimension is reduced, and a local binary pattern texture feature histogram of the corresponding region is generated. The specific steps for determining state defects are described in detail in subsequent embodiments.

[0077] Finally, spatial phase integration processing is performed. Using the unified spatial phase coordinates of the surface defect region as a reference, which comes from the spatial registration results of the multimodal image in advance, the position information and geometric parameters of the geometric defects are aligned with the gray-scale statistical features and texture features of the corresponding region in spatial coordinates. The geometric attribute information and state attribute information at the same position are associated and matched one by one to obtain complete surface defect data. Each surface defect data contains both geometric feature information and state feature information.

[0078] By extracting multi-dimensional features and integrating spatial phases in the surface defect region, we can achieve accurate correlation and matching between geometric shape information and surface state information, providing complete multi-dimensional feature data support for subsequent defect classification and judgment.

[0079] Furthermore, the method provided in this application embodiment includes: The state defects include interface adhesion defects and surface morphology defects; by comparing the grayscale difference between the defective area and the adjacent normal area, if the grayscale difference exceeds a preset threshold, it is determined to be an interface adhesion defect; otherwise, it is determined to be a surface morphology defect.

[0080] In one embodiment, the surface defects corresponding to the surface defects include two categories: interface adhesion defects and surface morphology defects. The classification and determination of these two types of defects are completed using a regional grayscale difference comparison method. The determination process is based on the interface feature map generated in near-infrared mode, and the grayscale difference determination threshold is adapted to the grayscale dynamic range setting of the interface feature map. The grayscale difference determination threshold is pre-determined through a sample statistical calibration method. The calibration process selects multiple target printed samples with known interface states as calibration samples. The samples include qualified samples with normal interface adhesion states, and unqualified samples with typical interface adhesion defects such as poor hot stamping, blurred text, and smearing.

[0081] Next, near-infrared mode acquisition with uniform parameters was performed on all calibrated samples to obtain corresponding interface feature maps. Following the same region selection and calculation rules as in actual detection, the grayscale difference between the defective region and the adjacent normal region in each sample was calculated, and the grayscale difference data distribution between normal and defective samples was statistically obtained. Then, the median value of the boundary interval between the two data distributions was selected as the initial threshold. The threshold value was adjusted through validation sample testing to achieve an optimal balance between the accuracy and false detection rate of interface adhesion defects, ultimately determining the grayscale difference judgment threshold.

[0082] For each surface defect area, an adjacent normal area is selected as a reference area around the defect area. The reference area is a ring-shaped region extending 15 pixels outward from the defect area by default, but can be flexibly adjusted within the range of 10 to 20 pixels depending on the size of the defect area to ensure that the area of ​​the reference area is comparable to the area of ​​the defect area. During the selection process, pixels containing other defects within the ring-shaped region are removed to ensure that the reference area is a defect-free normal surface area.

[0083] Then, the mean grayscale values ​​of the surface defect area and the corresponding adjacent normal area in the interface feature map are calculated separately. The absolute value of the difference between the two mean grayscale values ​​is obtained to obtain the grayscale difference value between the two areas. The calculated grayscale difference value is then compared with the preset judgment threshold one by one.

[0084] If the grayscale difference value is greater than or equal to the preset judgment threshold, it indicates a significant difference in the interface reflection characteristics between the defective area and the normal area, and an abnormal adhesion state exists at the corresponding interface. The surface defect is thus classified as an interface adhesion defect. If the grayscale difference value is less than the preset judgment threshold, it indicates no significant abnormality in the interface state, and the defect is mainly caused by variations in surface morphology. The surface defect is thus classified as a surface morphology defect. After completing the state classification judgment for all surface defects, the judgment results are updated in the attribute information of the corresponding surface defect.

[0085] By determining the judgment threshold through sample calibration and comparing the interface grayscale difference between the defective area and the adjacent normal area, the interface adhesion defects and surface morphology defects can be quickly and accurately classified, effectively improving the accuracy and distinguishability of defect type identification in curved composite printing.

[0086] In summary, the image recognition-based intelligent detection method for UV hot stamping printing defects provided in this application has the following technical effects: This application acquires multi-dimensional imaging data from different channels for highly reflective and diffuse reflective material areas. After surface phase reconstruction and standard surface differential filtering to remove curvature background distortion, combined with parallel detection of straight and curved surfaces and multi-feature judgment, it accurately identifies geometric and state-related defects in hot stamping UV printing. This makes the printing defect detection results more comprehensive and reliable, achieving regional adaptation imaging and distortion filtering for mixed materials and curved printed surfaces, and improving the accuracy and comprehensiveness of defect detection under complex working conditions.

[0087] Example 2, as Figure 2 As shown, based on the same inventive concept as in Embodiment 1 above, this application provides an intelligent detection system for UV hot stamping defects based on image recognition, the system comprising: Material distribution heatmap generation module 1 is used to perform low-resolution pre-scanning on the target printing area, perform pixel material category probability analysis through a lightweight classification network, and generate a material distribution heatmap.

[0088] The target detection map acquisition module 2 is used to drive the imaging device to perform dynamic routing acquisition based on the material distribution heat map, and obtain the target detection map by splicing it with the spatial coordinate system and the pixel level. In the high reflective material area, the acquisition channels of phase deflection imaging mode, cross polarization illumination mode and near infrared mode are triggered in parallel, and the acquisition channel of photometric stereo imaging mode is triggered in the diffuse reflective material area.

[0089] The defect distribution map acquisition module 3 is used to input the material distribution heat map and the target detection map into the dual-path detector. By dividing the straight area and the curved area, dual-path directional defect detection and integration are performed to obtain the defect distribution map. In the curved area, phase deflection reconstruction and standard curved surface differential filtering are used to remove curvature background distortion.

[0090] The visualization and alarm execution module 4 is used to visualize the defect distribution map and issue quality alarms on the mobile terminal interface.

[0091] Furthermore, the material distribution heatmap generation module 1 is used to perform the following steps: A low-resolution pre-scanning method is used to acquire the target printing area to obtain a pre-scanned image. The pre-scanned image is then processed by a lightweight classification network, which uses pixel reflectivity and texture features as classification criteria to determine the material category probability distribution of each pixel. A material distribution heatmap is then determined based on the material category probability distribution, wherein the material distribution heatmap uses different codes to identify the material type.

[0092] Furthermore, the target detection map acquisition module 2 is used to perform the following steps: The material distribution heatmap is used to generate control commands to drive the imaging device to perform dynamic routing and obtain an imaging atlas acquired in multiple modes. The imaging atlas is unified to the same spatial coordinate system by a pre-calibrated internal and external coordinate transformation matrix of the imaging device. Pixel-level stitching and fusion are performed along the regional boundary of the material distribution heatmap to generate a target detection map covering the target printing area. Weighted average fusion is used at the stitching boundary to perform a smooth transition.

[0093] Furthermore, the target detection map acquisition module 2 is used to perform the following steps: By identifying the coded identifier, multiple imaging channels are triggered for highly reflective material areas, and the acquisition of height information, surface texture, and interface state information is performed in parallel to obtain the first image set. For diffuse reflective material areas, a photometric stereoscopic imaging mode is triggered to obtain the second 2.5D height map. This is achieved by sequentially illuminating multiple directional light sources and acquiring surface images under illumination from each direction. The acquisition timing is controlled by the regional boundary coordinates of the material distribution heatmap, and asynchronous parallel acquisition of multiple imaging modes is performed.

[0094] Furthermore, the target detection map acquisition module 2 is used to perform the following steps: A phase-deflection imaging mode is used to obtain a first 2.5D height map, which is obtained by projecting a sinusoidal fringe pattern and acquiring deformed fringe images. A cross-polarized illumination mode is used to obtain a texture detail map dominated by diffuse reflection by eliminating specular reflection interference. A near-infrared mode is used to extract the adhesion state features and interface defect features of the hot stamping layer and UV varnish interface based on the penetration characteristics of near-infrared light through the UV coating, resulting in an interface feature map. Spatial phase mapping is performed on the first 2.5D height map, texture detail map, and interface feature map to obtain the first image set, wherein the first image set is enhanced by feature fusion using a cross-modal attention mechanism.

[0095] Furthermore, the defect distribution map acquisition module 3 is used to perform the following steps: The material distribution heat map and the target detection map are input into a dual-path detector. Based on the material distribution heat map, the surface area and the curved area are divided. The target detection map of the surface area is input into the first detection path, and the target detection map of the curved area is input into the second detection path. Defect detection is performed in parallel to obtain curved defects and surface defects. The two are then merged to generate a defect distribution map of the entire product's target printing area.

[0096] Furthermore, the defect distribution map acquisition module 3 is used to perform the following steps: The standard curved surface geometric framework of the target printing area of ​​the product is input into the second detection path. Surface phase deflection reconstruction is performed on the target detection map of the curved surface area. After phase unwrapping and phase-height mapping processing, a measured three-dimensional point cloud of the curved surface is reconstructed. The measured three-dimensional point cloud of the curved surface is registered to the standard curved surface geometric framework, and the height difference is calculated for each grid node to generate a surface differential height map. Normal deformation components caused by continuous curvature changes in the surface differential height map are marked as background distortion components and filtered out to obtain a defect candidate height difference dataset. In the defect candidate height difference dataset, connected regions with absolute height differences exceeding a preset detection threshold are selected. The maximum depression depth, protrusion height, area, and center coordinates are extracted as surface defect regions and feature recognition is performed to obtain the surface defect.

[0097] Furthermore, the defect distribution map acquisition module 3 is used to perform the following steps: Identify geometric defects in the surface defect region; cut out the texture detail map and interface feature map of the surface defect region, extract grayscale statistical features and local binary pattern texture features respectively, and determine the state defect; perform spatial phase integration on the geometric defect and the state defect to obtain the surface defect.

[0098] Furthermore, the defect distribution map acquisition module 3 is used to perform the following steps: The state defects include interface adhesion defects and surface morphology defects; by comparing the grayscale difference between the defective area and the adjacent normal area, if the grayscale difference exceeds a preset threshold, it is determined to be an interface adhesion defect; otherwise, it is determined to be a surface morphology defect.

[0099] The image recognition-based intelligent detection system for UV hot stamping printing defects provided in this invention can execute the image recognition-based intelligent detection method for UV hot stamping printing defects provided in any embodiment of this invention, and has the corresponding functional modules and beneficial effects of the method.

[0100] Although this application makes various references to certain modules in the system according to the embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy distinction between each other and are not used to limit the scope of protection of this invention.

[0101] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application. In some cases, the actions or steps described in this application can be performed in a different order than that shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. An intelligent detection method for defects in UV hot stamping printing based on image recognition, characterized in that, The method includes: A low-resolution pre-scan is performed on the target printing area, and a pixel material category probability analysis is performed through a lightweight classification network to generate a material distribution heatmap. Based on the material distribution heat map, the driving imaging device performs dynamic routing acquisition, and after being stitched together with the spatial coordinate system at the pixel level, a target detection map is obtained. In this map, the acquisition channels of phase deflection imaging mode, cross polarization illumination mode and near-infrared mode are triggered in parallel in the high reflective material area, and the acquisition channel of photometric stereo imaging mode is triggered in the diffuse reflective material area. The material distribution heat map and the target detection map are input into the dual-path detector. By dividing the flat area and the curved area, dual-path directional defect detection and integration are performed to obtain the defect distribution map. Among them, the curved area uses phase deflection reconstruction and standard surface differential filtering to remove curvature background distortion. The defect distribution map is visualized and quality alarms are displayed on the mobile terminal interface.

2. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 1, characterized in that, Generate a heatmap of material distribution, including: A low-resolution pre-scanning method is used to acquire images of the target printing area to obtain a pre-scanned image; The pre-scanned image is processed by a lightweight classification network, which uses pixel reflectivity and texture features as classification criteria to determine the probability distribution of material category for each pixel. A material distribution heatmap is determined based on the probability distribution of the material categories, wherein the material distribution heatmap identifies the material type with different codes.

3. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 2, characterized in that, The driving imaging device performs dynamic route acquisition, and after being stitched together with pixel-level data using a spatial coordinate system, a target detection map is obtained, including: The material distribution heat map is used to generate control commands, which drive the imaging device to perform dynamic routing and obtain an imaging atlas acquired in multiple modes. The imaging atlas is unified to the same spatial coordinate system by a pre-calibrated coordinate transformation matrix involving the inside and outside of the imaging device. Pixel-level stitching and fusion are performed along the regional boundaries of the material distribution heatmap to generate a target detection map covering the target printing area. Weighted average fusion is used at the stitching boundaries to perform a smooth transition.

4. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 3, characterized in that, By identifying the coded identifiers, multiple imaging channels are triggered for highly reflective material areas, and data acquisition is performed in parallel for height information, surface texture, and interface state to obtain the first image set. For the diffuse reflection material area, the photometric stereo imaging mode is triggered to obtain the second 2.5D height map, which is obtained by sequentially lighting multiple directional light sources and acquiring surface images under illumination from each direction. The acquisition timing is controlled by the regional boundary coordinates of the material distribution heatmap, and asynchronous parallel acquisition of multiple imaging modes is performed.

5. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 4, characterized in that, Parallel acquisition of information at the height, surface texture, and interface state levels yields the first atlas, including: A phase-deflection imaging mode was used to obtain a first 2.5D height map, which was obtained by projecting a sinusoidal fringe pattern and acquiring deformed fringe images. By employing a cross-polarized illumination mode, diffuse reflection-dominated texture detail maps are obtained by eliminating specular reflection interference. Using the near-infrared mode, based on the penetration characteristics of near-infrared light through the UV coating, the adhesion state characteristics and interface defect characteristics of the hot stamping layer and the UV varnish interface are extracted to obtain the interface feature map. Spatial phase mapping is performed on the first 2.5D height map, texture detail map and interface feature map to obtain the first map set, wherein the first map set is fused using a cross-modal attention mechanism for feature enhancement.

6. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 1, characterized in that, By dividing the flat and curved areas, dual-path directional defect detection and integration are performed to obtain a defect distribution map, including: The material distribution heat map and the target detection map are input into the dual-path detector, and the flat area and curved area are divided according to the material distribution heat map; The target detection map of the straight area is input into the first detection path, and the target detection map of the curved area is input into the second detection path. Defect detection is performed in parallel to obtain curved surface defects and straight surface defects, which are then merged to generate a defect distribution map of the entire product's target printing area.

7. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 6, characterized in that, After inputting the target detection map of the directly facing area into the first detection path, the following steps are included: The standard curved surface geometric framework of the target printing area of ​​the product is input into the second detection path. The curved surface phase deflection reconstruction is performed on the target detection map of the curved surface area. After phase unwrapping and phase-height mapping processing, the three-dimensional point cloud of the measured curved surface is reconstructed. After registering the measured three-dimensional point cloud of the surface to the standard surface geometry framework, the height difference is calculated for each grid node to generate a surface differential height map. The normal deformation components caused by the continuous change of curvature in the surface difference height map are marked as background distortion components and filtered out to obtain a defect candidate height difference dataset. In the defect candidate height difference dataset, connected regions whose absolute height difference exceeds a preset detection threshold are selected, and the maximum indentation depth, protrusion height, region area and center coordinates are extracted as surface defect regions and feature recognition is performed to obtain surface defects.

8. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 7, characterized in that, As a surface defect region, feature identification is performed, including: Identify geometric defects in the defect region of a curved surface; The texture detail map and interface feature map of the surface defect area are cropped out, and grayscale statistical features and local binary pattern texture features are extracted respectively to determine the state defect. The geometric defect and the state defect are spatially phase integrated to obtain the surface defect.

9. The intelligent detection method for defects in UV hot stamping printing based on image recognition as described in claim 8, characterized in that, The state defects include interface adhesion defects and surface morphology defects; By comparing the grayscale difference between the defective area and the adjacent normal area on the curved surface, if the grayscale difference exceeds a preset threshold, it is determined to be an interface adhesion defect. Otherwise, it is judged as a surface morphology defect.

10. An intelligent detection system for defects in UV hot stamping printing based on image recognition, characterized in that, The system is used to implement the image recognition-based intelligent detection method for UV hot stamping printing defects according to any one of claims 1-9, the system comprising: The material distribution heatmap generation module is used to perform low-resolution pre-scanning on the target printing area, and then perform pixel material category probability analysis through a lightweight classification network to generate a material distribution heatmap. The target detection map acquisition module is used to drive the imaging device to perform dynamic routing acquisition based on the material distribution heat map, and obtain the target detection map by splicing it with the spatial coordinate system and the pixel level. In this module, the acquisition channels of phase deflection imaging mode, cross polarization illumination mode and near-infrared mode are triggered in parallel in the high reflective material area, and the acquisition channel of photometric stereo imaging mode is triggered in the diffuse reflective material area. The defect distribution map acquisition module is used to input the material distribution heat map and the target detection map into the dual-path detector. By dividing the straight area and the curved area, dual-path directional defect detection and integration are performed to obtain the defect distribution map. Among them, the curved area adopts phase deflection reconstruction and standard curved surface differential filtering to remove curvature background distortion. The visualization and alarm execution module is used to visualize the defect distribution map and issue quality alarms on the mobile terminal interface.