Aluminum foil cigarette pack attaching control system and method based on machine vision
By using a machine vision-based aluminum foil cigarette label bonding control system, which combines grayscale and edge feature matching with a motion control model, high-precision and robust bonding of aluminum foil workpieces is achieved, solving the bonding problem of aluminum foil cigarette labels under non-rigid deformation and complex specular reflection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG ESQUEL CIGARETTE PRINTING CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies struggle to achieve high-precision bonding of aluminum foil workpieces, especially when faced with non-rigid deformation and complex mirror reflection interference. Deep learning-based methods are costly and struggle to achieve sub-pixel-level positioning accuracy, while rigid template matching methods are ill-suited to adapt to deformation, resulting in poor bonding efficiency and consistency of aluminum foil cigarette labels.
Images of aluminum foil cigarette labels are acquired using an industrial camera. Gray-scale features are matched and edge features are precisely located using a pre-built deformation feature template library. Motion compensation commands are generated by combining the motion control model to drive the bonding actuator to achieve precise bonding.
It achieves high-precision and robust bonding of aluminum foil workpieces, and can dynamically compensate for deformation and reflection interference, ensuring stable and reliable bonding of aluminum foil cigarette labels, and adapting to the needs of high-speed production.
Smart Images

Figure CN121962085A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine vision technology, and more specifically, to a machine vision-based aluminum foil cigarette label bonding control system and method. Background Technology
[0002] With the continuous improvement of industrial automation, machine vision technology, with its advantages of non-contact, high precision, and high speed, has become a key enabling technology in the field of high-precision assembly and bonding of industrial products. In precision manufacturing industries such as cigarette packaging, accurately and smoothly bonding aluminum foil to cigarette labels is a crucial process, and its quality directly affects the product's appearance and anti-counterfeiting performance. In traditional processes, this process relies heavily on the experience of skilled workers or the positioning of precision mechanical fixtures. However, given that aluminum foil is prone to wrinkles, stretching, and other non-rigid deformations, as well as its highly reflective surface, traditional methods face severe challenges in terms of efficiency, consistency, and adaptability. Therefore, intelligent and high-precision automatic bonding of aluminum foil cigarette labels has become a clear direction for technological upgrading in the industry.
[0003] Currently, in the field of industrial visual positioning, the main implementation solutions can be divided into methods based on rigid template matching and methods based on deep learning target detection. Rigid template matching (such as normalized cross-correlation or shape-based matching) has good positioning effect on undeformed rigid workpieces, but its template is fixed and it is difficult to adapt to the complex deformation generated by aluminum foil during transportation and cutting, which can easily lead to missed detection or positioning deviation. Deep learning-based methods (such as the YOLO series) have a certain tolerance for deformation, but their model training depends on a large amount of labeled data. In application scenarios such as aluminum foil, where new products and patterns are rapidly iterated, the cost of data acquisition and model update is high, and it is difficult to achieve sub-pixel-level positioning accuracy, which cannot meet the requirements of ultra-high precision bonding. In addition, whether it is single gray-scale feature matching or single edge feature matching, its robustness and accuracy have inherent limitations when facing the high reflectivity interference and local deformation of aluminum foil. Therefore, how to achieve visual positioning dynamic compensation bonding based on small sample self-learning and multi-feature fusion for aluminum foil workpieces with non-rigid deformation fields and complex specular reflection interference has become a challenge for the industry. Summary of the Invention
[0004] This application provides a machine vision-based aluminum foil cigarette label bonding control system and method, which can realize visual positioning dynamic compensation bonding of aluminum foil workpieces with non-rigid deformation fields and complex specular reflection interference based on small sample self-learning and multi-feature fusion.
[0005] In a first aspect, this application provides a machine vision-based method for controlling the bonding of aluminum foil cigarette labels, comprising: An image of the aluminum foil cigarette label to be bonded is acquired using an industrial camera, and a target image containing the aluminum foil workpiece and the bonding reference area is cropped from the aluminum foil cigarette label image. The target image is matched with grayscale features based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then a set of candidate locations for the deformation region of the aluminum foil cigarette label is obtained by coarse localization based on the matching results. In the candidate position set, edge feature fine localization based on edge gradient direction vector field is performed in the neighborhood of each candidate position to obtain the feature matching degree of each candidate position. Then, the pose deviation of the precise candidate position in the candidate position set is determined according to all feature matching degrees. The pose deviation is converted into motion compensation commands for the bonding actuator by a motion control model, and then the bonding actuator is driven to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
[0006] In some embodiments, cropping a target image containing the aluminum foil workpiece and the bonding reference area from the aluminum foil cigarette label image specifically includes: The geometric center of the aluminum foil workpiece outline and the bonding reference area is located in the aluminum foil cigarette label image according to the pre-calibrated visual coordinate mapping parameters. Using the geometric center as the origin and expanding the safety boundary outward based on the contour range of the aluminum foil workpiece, a rectangular cutout frame is generated that completely encompasses the aluminum foil workpiece and the bonding reference area. The aluminum foil cigarette label image is cropped based on the pixel coordinates of the rectangular cropping frame, and a target image containing the aluminum foil workpiece and the bonding reference area is output.
[0007] In some embodiments, grayscale feature matching of the target image is performed based on multiple class-mean grayscale templates in a pre-built deformation feature template library, and then a set of candidate locations for the deformation region of the aluminum foil cigarette label is coarsely located based on the matching results. Specifically, this includes: Construct a template library of deformation features for aluminum foil deformation; At the top of the image pyramid, the mean grayscale templates of each class in the deformation feature template library are matched with the target image using a sliding window to obtain the cross-correlation score mapping map between the mean grayscale templates of each class and the target image. Inter-class nonmaximum suppression is applied to all cross-correlation score maps to filter out cross-template matching candidate regions; At the bottom layer of the image pyramid, a fine-grained matching is performed based on the neighborhood of all matching candidate regions to obtain the grayscale matching score of each matching candidate region. Based on all grayscale matching scores, a set of candidate locations for the deformed area of the aluminum foil cigarette label is obtained.
[0008] In some embodiments, constructing a deformation feature template library for aluminum foil deformation specifically includes: Images of aluminum foil workpieces under different mechanical stresses and bonding states are collected to construct an initial deformation image set; Extract the pixel registration pose of each image in the initial deformed image set relative to the standard pose, and then generate a registered deformed sample image set; Clustering based on cosine distance is performed on the deformed sample image set to generate class mean grayscale templates representing the deformation features of each class; A deformation feature template library for aluminum foil deformation is constructed based on all class mean grayscale templates.
[0009] In some embodiments, performing fine-tuning of edge features based on the edge gradient direction vector field within the neighborhood of each candidate location in the candidate location set to obtain the feature fit of each candidate location specifically includes: For each candidate location in the candidate location set, the gradient direction of the edge pixels of the image is extracted in the pixel neighborhood of the candidate location to construct a gradient direction vector field; The gradient direction vector field is subjected to a point-by-point inner product operation with the gradient direction of the predefined shape template to obtain the shape matching score. The shape matching score and the grayscale matching score of the candidate position are weighted by two-dimensional Gaussian conditional density fusion to generate the feature matching degree of the candidate position, and then the feature matching degree of each candidate position in the candidate position set is obtained.
[0010] In some embodiments, determining the pose deviation of the precise candidate position in the candidate position set based on all feature similarities specifically includes: The deformation confidence level of each candidate location in the candidate location set is determined based on the matching degree of all features; Based on all deformation confidence scores, determine the precise candidate locations of deformations in the target image; The translation and rotation of the precise candidate position relative to the preset reference marker point are calculated, and the pose deviation of the precise candidate position is output.
[0011] In some embodiments, converting the pose deviation into motion compensation commands that conform to the actuator through a motion control model specifically includes: The multi-axis motion parameters for performing the fitting compensation motion are calculated based on the pose deviation using the inverse kinematics model of the fitting actuator. Based on the multi-axis motion parameters, motion compensation commands are generated to fit the actuator.
[0012] Secondly, this application provides a machine vision-based aluminum foil cigarette label bonding control system, comprising: The acquisition module is used to acquire images of the aluminum foil cigarette labels to be bonded using an industrial camera, and to crop a target image containing the aluminum foil workpiece and the bonding reference area from the aluminum foil cigarette label images. The processing module is used to perform grayscale feature matching on the target image based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then coarsely locate the candidate location set of the aluminum foil cigarette label deformation area based on the matching results. The processing module is used to perform edge feature fine localization based on edge gradient direction vector field in the neighborhood of each candidate position in the candidate position set, to obtain the feature matching degree of each candidate position, and then determine the pose deviation of the precise candidate position in the candidate position set based on all feature matching degrees. The execution module is used to convert the pose deviation into motion compensation commands for the bonding actuator through a motion control model, and then drive the bonding actuator to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
[0013] Thirdly, this application provides a computer device, the computer device including a memory and a processor, the memory storing code, the processor being configured to acquire the code and execute the above-described machine vision-based aluminum foil cigarette label bonding control method.
[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described machine vision-based aluminum foil cigarette label bonding control method.
[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: In the machine vision-based aluminum foil cigarette label bonding control system and method provided in this application, the image of the aluminum foil cigarette label to be bonded is first acquired by an industrial camera, and a target image containing the aluminum foil workpiece and the bonding reference area is cropped from the aluminum foil cigarette label image. The target image is matched with grayscale features based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then a set of candidate locations for the deformation region of the aluminum foil cigarette label is obtained by coarse localization based on the matching results. In the candidate position set, edge feature fine localization based on edge gradient direction vector field is performed in the neighborhood of each candidate position to obtain the feature matching degree of each candidate position. Then, the pose deviation of the precise candidate position in the candidate position set is determined according to all feature matching degrees. The pose deviation is converted into motion compensation commands for the bonding actuator by a motion control model, and then the bonding actuator is driven to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
[0016] Therefore, this application uses the motion compensation command to drive the bonding actuator to achieve precise bonding of aluminum foil cigarette labels. First, determining the target image yields a sub-image containing the aluminum foil workpiece and the bonding reference area within the aluminum foil cigarette label image. Determining the target image effectively eliminates irrelevant backgrounds and interference areas in the original image, thus ensuring that all subsequent computationally intensive feature matching and localization algorithms strictly focus on the smallest effective image area simultaneously containing the deformation area of the aluminum foil workpiece and the cigarette label reference point. This significantly improves the computational efficiency and real-time performance of subsequent image processing, ensuring the system meets high-speed production cycles. Furthermore, by providing a spatially clear... Standardized input images with concentrated features and clean backgrounds provide a stable and reliable perceptual foundation for subsequent deformation localization algorithms based on grayscale-edge dual feature fusion. This fundamentally overcomes the interference of complex background noise and the global reflectivity of aluminum foil on feature extraction, making it a crucial preprocessing step to ensure the system achieves high-precision and robust fitting. Secondly, determining the candidate location set yields a spatial set of candidate regions in the target image that may exhibit deformation. This determination effectively addresses the problem of poor robustness of single-feature matching caused by the easy deformation and high reflectivity of aluminum foil in existing technologies. It utilizes a class average that covers typical deformation patterns. Preliminary screening using templates can efficiently and robustly locate all potential target regions in the global image, effectively avoiding missed detections caused by severe local deformation or reflection. Furthermore, it transforms the massive full-image search problem into a refined calculation of a few high-quality candidate regions, significantly improving the processing speed and resource utilization in the subsequent edge localization stage, thus ensuring the system's real-time performance in high-frequency production. Then, determining the pose deviation yields the spatial offset of the most reliable deformation matching position in the target image relative to a preset reference in the translation and rotation dimensions. The pose deviation is determined by fusing grayscale and edge features and applying a two-dimensional Gaussian conditional density function. After making a decision, the problem of matching fuzzy and easily disturbed deformation features in the image space was successfully transformed into a three-dimensional translation and rotation parameter with clear physical meaning in the base coordinate system of the robot or motion platform. This makes the output of the vision system no longer a simple image coordinate or classification signal, but a direct input required to drive high-precision actuators to perform real-time, closed-loop, and dynamic compensation. It has built a precise bridge connecting highly robust visual perception and highly deterministic motion execution, directly solving the fundamental problem that visual detection results are difficult to use for real-time precision motion control in existing technologies. It is the cornerstone for realizing adaptive, high-precision bonding closed-loop aluminum foil cigarette labels.Finally, the motion compensation command is determined to be the real-time control signal that directly drives the servo driver of the bonding actuator for compensation bonding. The determination of the motion compensation command achieves a qualitative leap from observing errors to automatically and accurately offsetting them. This ensures that the microscopic deformations and pose shifts identified by the vision system can be converted into compensating motion of the end effector in three-dimensional space in milliseconds and without hysteresis. This dynamically overcomes the deformation, vibration, and conveying errors of aluminum foil on high-speed production lines, ultimately achieving a stable, reliable, and highly repeatable bonding effect. In summary, based on the above scheme, dynamic compensation bonding based on small-sample self-learning and multi-feature fusion can be achieved for aluminum foil workpieces with non-rigid deformation fields and complex specular reflection interference, using visual positioning. Attached Figure Description
[0017] Figure 1 This is an exemplary flowchart of a machine vision-based aluminum foil cigarette label bonding control method according to some embodiments of this application; Figure 2 This is a flowchart illustrating the operation of determining the deformation feature template library according to some embodiments of this application; Figure 3 This is an exemplary flowchart illustrating the determination of feature matching degree according to some embodiments of this application; Figure 4 This is a schematic diagram of the structure of a machine vision-based aluminum foil cigarette label bonding control system according to some embodiments of this application; Figure 5 This is an internal structural diagram of a computer device that implements a machine vision-based aluminum foil cigarette label bonding control method according to some embodiments of this application. Detailed Implementation
[0018] To better understand the technical solution of this application, the technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] refer to Figure 1 The figure is an exemplary flowchart of a machine vision-based aluminum foil cigarette label bonding control method according to some embodiments of this application. The machine vision-based aluminum foil cigarette label bonding control method mainly includes the following steps: In step 101, an image of the aluminum foil cigarette label to be bonded is acquired using an industrial camera, and a target image containing the aluminum foil workpiece and the bonding reference area is cropped from the aluminum foil cigarette label image.
[0020] It should be noted that, in this application, the aluminum foil cigarette label image is a digital image that can simultaneously and clearly present the complete deformed area of the aluminum foil workpiece to be bonded and the preset reference features on the cigarette label. This provides a spatially clear, feature-reliable, and interference-resistant input source for subsequent visual matching and positioning algorithms, fundamentally ensuring the feasibility of high-precision pose calculation and closed-loop motion control. Specifically, acquiring the image of the aluminum foil cigarette label to be bonded using an industrial camera can be achieved in the following way: image acquisition can be performed through a pre-integrated and parameter-calibrated machine vision hardware system. This hardware system mainly consists of an industrial camera, a fixed-focal-length lens with a suitable working distance and field of view, and a diffuse coaxial light source specially designed to suppress specular reflection on the aluminum foil surface. In the initialization stage, the spatial relationship between the industrial camera coordinate system and the basic coordinate system of the bonding actuator is mapped using hand-eye calibration technology. This yields visual coordinate mapping parameters containing rotation matrices and translation vectors, establishing a unified visual measurement benchmark. Then, within each production cycle, a diffuse coaxial light source is triggered to emit uniform wavelength light to illuminate the bonding station. Simultaneously, the industrial camera is triggered to simultaneously expose and capture images of the aluminum foil workpiece and the cigarette label carrier plate under this illumination condition, acquiring an initial image containing original spectral information. The initial image is then subjected to dead pixel correction, optical distortion correction, and coordinate normalization based on calibration parameters to eliminate systematic errors introduced by the hardware itself and imaging geometry. The processed digital image is then used as the aluminum foil cigarette label image.
[0021] In some embodiments, cropping a target image containing the aluminum foil workpiece and the bonding reference area from the aluminum foil cigarette label image can be achieved by the following steps: The geometric center of the aluminum foil workpiece outline and the bonding reference area is located in the aluminum foil cigarette label image according to the pre-calibrated visual coordinate mapping parameters. Using the geometric center as the origin and expanding the safety boundary outward based on the contour range of the aluminum foil workpiece, a rectangular cutout frame is generated that completely encompasses the aluminum foil workpiece and the bonding reference area. The aluminum foil cigarette label image is cropped based on the pixel coordinates of the rectangular cropping frame, and a target image containing the aluminum foil workpiece and the bonding reference area is output.
[0022] It should be noted that in this application, the visual coordinate mapping parameters are pre-calibrated parameters used to establish a precise mathematical transformation relationship between the image pixel coordinates and the coordinate system of the fitting actuator. They constitute the spatial perception basis of the entire visual guidance system and can ensure that the position information calculated from the image can be accurately converted into the actual motion commands of the fitting actuator.
[0023] In specific implementation, the geometric center of the aluminum foil workpiece contour range and the bonding reference area in the aluminum foil cigarette label image can be located according to the pre-calibrated visual coordinate mapping parameters in the following manner: First, the aluminum foil cigarette label image can be converted from red-green-blue color space to grayscale image and binarized to separate the foreground target and background, resulting in a binarized image; Second, the edge candidate point set of the aluminum foil workpiece is extracted from the binarized image using the Canny edge detection operator, and the true contour points are screened using the random sampling consensus algorithm. Then, the boundary lines describing the approximate range of the aluminum foil workpiece are obtained by fitting all the contour points using the least squares method. The contour range of the aluminum foil workpiece is obtained by intersecting the fitted boundary lines, and the contour center is estimated; Then, the region extraction is performed in the binarized image using a morphological method to obtain the bonding reference area of the aluminum foil cigarette label, and subpixel-level edge detection is performed on the bonding reference area. The detected subpixel edge points are then substituted into a weighted least squares ellipse fitting algorithm. By setting ellipse constraints (e.g., the eccentricity of the ellipse), the physical rationality of the solution is ensured, thereby calculating the regional center of the fitting reference area. Finally, the coordinate vector formed by combining the contour center of the aluminum foil workpiece and the regional center of the reference area is used as the geometric center of the aluminum foil workpiece contour range and the fitting reference area. The contour range of the aluminum foil workpiece represents the spatial information of the location and size boundary of the area occupied by the aluminum foil workpiece in the image. It can provide the primary spatial reference benchmark for subsequent image cropping and feature matching, thereby ensuring that the processing can focus on the effective area and improve the overall system processing efficiency and positioning accuracy. The geometric center represents two core reference points representing the spatial position of the aluminum foil workpiece contour and the cigarette label reference area. It can provide a stable and unified coordinate benchmark for subsequent image cropping and feature matching, thereby eliminating the initial position interference caused by the randomness of workpiece placement.
[0024] In specific implementation, the rectangular frame that completely encompasses the aluminum foil workpiece and the bonding reference area can be generated by taking the geometric center as the origin and expanding the safety boundary based on the outline range of the aluminum foil workpiece. This can be achieved as follows: the outline center of the aluminum foil workpiece in the geometric center and the center of the bonding reference area can be used as the initial origin for constructing the rectangular frame. Based on the maximum circumscribed range of the fitted aluminum foil workpiece outline in the image coordinate system, a preset pixel distance is extended outwards as a safety boundary. This pixel distance can be set according to the statistical extreme value of the nonlinear deformation amplitude of the aluminum foil and the small drift of the positioning system to ensure that the deformed workpiece features are still completely contained. For example, it can be set to 20 pixels. Then, taking the initial origin as the center, and based on the outer... The total length and width of the expanded safety boundary are calculated in the image coordinate space to form a rectangular cropping box with its axis parallel to the image coordinate axis. The boundary safety verification function is then called to verify and correct the coordinates of this rectangular cropping box. If the box exceeds the boundary, translation adjustment is used first, followed by proportional scaling centered on the origin to ensure that none of its four vertices exceed the pixel boundaries of the original image of the aluminum foil cigarette label. This generates a rectangular cropping box that completely encompasses the aluminum foil workpiece and the bonding reference area. The rectangular cropping box is a dynamically calculated image processing area boundary with reference to the geometric center. This allows the algorithm's computational resources to focus on the most relevant image area, thereby significantly improving the efficiency and speed of subsequent image processing steps and eliminating interference from irrelevant backgrounds.
[0025] It should be noted that in this application, the target image is a sub-image of the aluminum foil cigarette label image containing the aluminum foil workpiece and the bonding reference area. It can provide high-quality input with uniform size and content for downstream feature matching and localization algorithms, which is a key prerequisite for ensuring high-precision and high-robustness visual localization. In specific implementation, the target image containing the aluminum foil workpiece and the bonding reference area can be output by cropping the aluminum foil cigarette label image according to the pixel coordinates of the rectangular cropping box. This can be achieved in the following way: the coordinate values of the four vertices of the rectangular cropping box in the original image coordinate system can be obtained through coordinate reading operation. The pixel range covered by the rectangular cropping box can be calculated through the coordinate values of the four vertices. Based on the calculated pixel range, the original aluminum foil cigarette label image can be sliced to extract all pixel information within the rectangular cropping box, thereby obtaining the target image containing the aluminum foil workpiece and the bonding reference area.
[0026] In step 102, grayscale feature matching is performed on the target image based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then a set of candidate locations for the deformation region of the aluminum foil cigarette label is obtained by coarse localization based on the matching results.
[0027] In some embodiments, the grayscale feature matching of the target image based on multiple class-mean grayscale templates in a pre-built deformation feature template library, and the coarse localization of the candidate location set of the aluminum foil cigarette label deformation region based on the matching results, can be achieved by the following steps: Construct a template library of deformation features for aluminum foil deformation; At the top of the image pyramid, the mean grayscale templates of each class in the deformation feature template library are matched with the target image using a sliding window to obtain the cross-correlation score mapping map between the mean grayscale templates of each class and the target image. Inter-class nonmaximum suppression is applied to all cross-correlation score maps to filter out cross-template matching candidate regions; At the bottom layer of the image pyramid, a fine-grained matching is performed based on the neighborhood of all matching candidate regions to obtain the grayscale matching score of each matching candidate region. Based on all grayscale matching scores, a set of candidate locations for the deformed area of the aluminum foil cigarette label is obtained.
[0028] It should be noted that in this application, the deformation feature template library is a structured database that integrates the mean grayscale templates of all classes of aluminum foil deformation and their multi-scale pyramid representations. It can serve as a complete reference benchmark in the online matching stage, supports fast retrieval and high-precision matching, and is a key knowledge base for realizing real-time and robust deformation positioning.
[0029] Preferably, in some embodiments, reference is made to Figure 2 The figure is a flowchart illustrating the operation of the deformation feature template library according to some embodiments of this application. The deformation feature template library for aluminum foil deformation in this application can be constructed by the following steps: Images of aluminum foil workpieces under different mechanical stresses and bonding states are collected to construct an initial deformation image set; Extract the pixel registration pose of each image in the initial deformed image set relative to the standard pose, and then generate a registered deformed sample image set; Clustering based on cosine distance is performed on the deformed sample image set to generate class mean grayscale templates representing the deformation features of each class; A deformation feature template library for aluminum foil deformation is constructed based on all class mean grayscale templates.
[0030] In practice, acquiring images of aluminum foil workpieces under different mechanical stresses and bonding states to construct an initial deformation image set can be achieved in the following way: First, during the process debugging stage of the production line, an industrial camera can be triggered to simultaneously acquire images of various mechanical stress states (such as tension, bending, and wrinkling) generated during typical processes such as unwinding, traction, cutting, and pre-bonding of the aluminum foil roll under various preset lighting modes, obtaining image sequences reflecting different deformation modes; then, for each recorded mechanical stress state, the aluminum foil workpiece can be made to undergo a series of regular small-amplitude translational and rotational movements by controlling the actuator, and during this process... Images of the aluminum foil in multiple different spatial poses are acquired to cover the range of pose changes that may occur under this deformation mode. Finally, all the acquired images are organized and classified using semi-automatic annotation technology. Each image is associated with its corresponding specific stress type and pose parameter label, and the set of all images with specific stress type and pose parameter labels is used as the initial deformation image set. The initial deformation image set is a set of original images that characterize the actual deformation state of the aluminum foil under various forces and poses before bonding. It can provide a comprehensive and diverse sample basis for template construction, ensuring the system's coverage and adaptability to complex deformation conditions in actual production.
[0031] In specific implementation, extracting the pixel registration pose of each image in the initial deformation image set relative to the standard pose, and then generating the registered deformation sample image set, can be achieved in the following way: First, an image with the flattest aluminum foil shape and the most upright pose can be selected from the initial deformation image set as the standard pose reference image through an evaluation algorithm based on image sharpness and flatness; then, for each other image in the initial deformation image set, the aluminum foil features (e.g., printing marks and physical corner points) in the image can be associated with the corresponding features in the standard reference image through feature point detection and matching technology, and the least squares method can be used to calculate the corresponding features based on multiple pairs of matching points. The geometric transformation matrix is used as the pixel registration pose of the image. Then, the pixel registration pose is used to perform reverse mapping and pixel resampling on the image for geometric correction, so that the aluminum foil body in the image is completely aligned with the standard pose reference image in pixel coordinates. This eliminates the rigid body transformation differences caused by different acquisition viewpoints and poses, resulting in a calibrated image. Finally, the set of all calibrated images is used as the registered deformation sample image set. The deformation sample image set is a set of images that retains pure deformation features. It can eliminate the interference of pose differences on grayscale features, so that subsequent analysis can focus on the deformation itself, significantly improving the accuracy and consistency of feature clustering and template representation.
[0032] In specific implementation, clustering the deformation sample image set based on cosine distance to generate class mean grayscale templates representing the deformation features of each class can be achieved in the following way: First, each image in the deformation sample image set can be converted to grayscale and its pixel sequence expanded using image vectorization processing technology to obtain a uniform grayscale pixel vector for each image. Then, the cosine similarity between all grayscale pixel vectors can be calculated using hierarchical clustering technology based on cosine distance, and bottom-up iterative merging can be performed. Grayscale pixel vectors with a value higher than a preset threshold (e.g., 0.85) are grouped into the same deformation mode category. The system obtains clustering results from multiple samples with high internal similarity and significant inter-class differences. Then, it calculates the arithmetic mean of all gray-level pixel vectors within each cluster category using pixel-by-pixel gray-level averaging technology, generating a synthetic image as the class mean gray-level template for the corresponding cluster category. This generates class mean gray-level templates representing the deformation characteristics of each category. The class mean gray-level template is a synthetic image characterizing the average gray-level features of a certain deformation mode of an aluminum foil workpiece. It can effectively discretize and purify the continuous deformation space, replacing a large number of samples with a few representative templates, providing core feature basis for subsequent efficient and robust matching.
[0033] In specific implementation, the deformation feature template library for aluminum foil deformation based on all class-mean grayscale templates can be constructed in the following way: all class-mean grayscale templates can be archived as core template elements, and a multi-scale pyramid can be constructed for each class-mean grayscale template: that is, a multi-layer pyramid image corresponding to the template, from the high-resolution original layer to the bottom low-resolution layer, is generated by Gaussian filtering and downsampling technology, and necessary metadata is associated with each template and its pyramid layer, such as: the deformation category identifier it represents, the original pixel size under standard posture, and the calibration parameters from the template coordinate system to the fit actuator coordinate system. Then, all the processed template data, pyramid images and metadata are structured and stored and managed to form a complete deformation feature template library that can be used for efficient online matching of aluminum foil deformation.
[0034] In specific implementation, at the top layer of the image pyramid, the mean grayscale templates of each class in the deformation feature template library are matched with the target image using a sliding window to obtain the cross-correlation score mapping map between each mean grayscale template and the target image. This can be achieved in the following way: First, a multi-scale pyramid can be constructed on the target image using Gaussian filtering and downsampling techniques to obtain the top-level low-resolution image of the target image; then, for each mean grayscale template in the deformation feature template library, the top-level low-resolution image corresponding to the mean grayscale template can be called from the deformation feature template library as the matching template, and a sliding window search technique is used to traverse the top-level low-resolution image of the target image pixel by pixel. The similarity between the image patch and the matching template within each window position is calculated using a normalized cross-correlation algorithm, resulting in a matching score for each window position. This yields a two-dimensional score matrix with the same top-level size as the target image, serving as a cross-correlation score mapping between the class-mean grayscale template and the target image. Through these steps, the cross-correlation score mapping between each class-mean grayscale template in the deformation feature template library and the target image can be obtained. This cross-correlation score mapping is a two-dimensional distribution of the similarity score between the class-mean grayscale template and the target image at each pixel position. It can visually reveal all possible regions where the deformed target may exist, providing a comprehensive data foundation for subsequent screening.
[0035] In specific implementation, inter-class non-maximum suppression (NMS) is applied to all cross-correlation score maps to filter out cross-template matching candidate regions. This can be achieved as follows: First, all cross-correlation score maps can be overlaid using data integration techniques to form a two-dimensional matrix with multiple channels, each channel representing a class mean grayscale template. Then, pixel-wise maximum value filtering techniques are used to compare the score values of all channels at each spatial pixel location, retaining only the highest score value at that location and its corresponding channel number, while setting the scores of other channels to zero, thus completing inter-class NMS across template categories and obtaining a global score map. Then, through local neighbor... Domain peak detection technology scans the global score map after suppression processing, and identifies the pixel whose score value is the maximum within its preset local spatial neighborhood (e.g., a 5x5 pixel window centered on that point) as a valid local response peak point. Then, through coordinate and information recording technology, the image coordinates, peak scores, and associated template category information of all local response peak points are organized and output to form a cross-template matching candidate region. The matching candidate region refers to an image spatial location with a high grayscale matching score and associated template category information, which can significantly reduce the range requiring fine calculation, improve the efficiency of the overall localization process, and optimize the use of computational resources.
[0036] In practice, fine-grained matching is performed at the bottom layer of the image pyramid based on the neighborhood of all matching candidate regions. The gray-scale matching score of each matching candidate region can be obtained in the following way: For each matching candidate region, the coordinates of the top layer of the pyramid can be mapped back to the bottom layer of the target image pyramid of the original resolution according to the scale ratio between the layers using coordinate back projection technology. Then, a local neighborhood range for fine-grained search is determined in the bottom image with the mapped point as the center according to the preset expansion rules. For example, the expansion range is 10 to 20 pixels outside the bottom pixel area corresponding to the top candidate point coordinates, so as to cover the details that may be lost due to downsampling and the small deformation of the aluminum foil. Then, the deformation feature template library is used to... The process involves calling the underlying high-resolution image of the class-mean grayscale template associated with the candidate region, performing a sliding window traversal within the local neighborhood using a local dense search technique, and calculating the similarity between the sub-image patch within each window and the corresponding sub-image patch in the underlying high-resolution image using a normalized cross-correlation algorithm. Finally, a global extreme value screening technique is used to select the highest similarity among all similarities as the grayscale matching score of the matching candidate region. Through the above steps, the grayscale matching score of each matching candidate region can be obtained. The grayscale matching score is a quantitative value that characterizes the degree of similarity between the location of the matching candidate region and the deformed target, and it can provide an accurate and unified evaluation standard for objectively comparing and ranking the matching quality of different candidate regions.
[0037] It should be noted that in this application, the candidate location set is a set of spatial locations composed of candidate regions in the target image that may be deformed. As the final output of the coarse localization stage, it can provide a high-quality and highly reliable list of targets to be processed for the subsequent precise localization steps. In specific implementation, the candidate location set of the deformed region of the aluminum foil cigarette label can be obtained based on all gray-scale matching scores in the following way: all gray-scale matching scores can be screened according to an adaptive threshold using threshold filtering technology, weak response candidate regions with gray-scale matching scores lower than the adaptive threshold are eliminated, and the candidate region set with gray-scale matching scores is retained. Then, non-maximum suppression in spatial distance is applied to the candidate region set, and duplicate candidate regions that are too close in physical pixel distance are merged or eliminated. Finally, the retained candidate regions are used as the candidate locations of the deformed region of the aluminum foil cigarette label, and the set of retained candidate regions is used as the candidate location set of the deformed region of the aluminum foil cigarette label.
[0038] In step 103, edge feature fine localization based on edge gradient direction vector field is performed in the neighborhood of each candidate position in the candidate position set to obtain the feature matching degree of each candidate position, and then the pose deviation of the precise candidate position in the candidate position set is determined according to all feature matching degrees.
[0039] In some embodiments, reference Figure 3 The figure is an exemplary flowchart illustrating the determination of feature fit according to some embodiments of this application. In this application, the edge feature fine localization based on the edge gradient direction vector field is performed in the neighborhood of each candidate position in the candidate position set to obtain the feature fit of each candidate position. This can be achieved by the following steps: In step 1031, for each candidate position in the candidate position set, the gradient direction of the edge pixels of the image is extracted in the pixel neighborhood of the candidate position to construct a gradient direction vector field. In step 1032, the gradient direction vector field is subjected to a point-by-point inner product operation with the gradient direction of the predefined shape template to obtain the shape matching score. In step 1033, the shape matching score and the grayscale matching score of the candidate position are weighted by two-dimensional Gaussian conditional density fusion to generate the feature matching degree of the candidate position, thereby obtaining the feature matching degree of each candidate position in the candidate position set.
[0040] In specific implementation, extracting the gradient directions of edge pixels in the pixel neighborhood of the candidate location to construct a gradient direction vector field can be achieved as follows: Gaussian filtering can be used to convolve the image within the pixel neighborhood of the candidate location (e.g., a square region with a side length 1.5 times the estimated width of the candidate region) to smooth noise, obtaining a denoised local image. Then, an edge detection operator is used to perform a two-dimensional convolution operation on the local image, calculating the gradient intensity components in the horizontal and vertical directions for each pixel. The arctangent function is then used to calculate the gradient direction angle based on the gradient intensity components in the horizontal and vertical directions, obtaining the gradient direction angle for each pixel. Finally, the gradient intensity components in the horizontal and vertical directions are calculated. The square root of the sum of squares yields the gradient magnitude for each pixel. A significant edge filtering technique is used to filter all pixels based on a preset gradient magnitude threshold (e.g., the top 20% quantile values in the gradient magnitude statistics of the entire neighborhood). Pixels with significant gradient changes are retained as edge points. Then, a direction discretization technique is used to quantize the continuous gradient direction angles of all edge points into several predefined discrete direction intervals (e.g., uniformly dividing 0-360 degrees into 8 or 16 directions), thus forming a gradient direction vector field. This gradient direction vector field is a data structure representing the geometric direction distribution of each edge point in a local region of the image, providing a robust feature representation for shape matching that is insensitive to changes in illumination.
[0041] It should be noted that in this application, the predefined shape template is a set of gradient direction vectors that characterize the ideal edge geometry of the target aluminum foil workpiece. It can be extracted and quantized from a standard defect-free aluminum foil workpiece image. It can provide a stable and accurate benchmark for the matching process, ensuring the consistency and repeatability of the positioning.
[0042] In specific implementation, the shape matching score is obtained by performing a point-by-point inner product operation between the gradient direction vector field and the gradient direction of the predefined shape template. This can be achieved in the following way: First, the gradient direction vector field and the direction vector at the corresponding position in the predefined shape template can be performed point-by-point inner product operation using vector consistency measurement technology to obtain a set of scalar values representing local direction consistency. Second, all scalar values are summed and divided by the total number of valid points in the template using global similarity fusion technology to obtain the initial global shape similarity. Then, the global shape similarity is truncated using inverse gradient suppression technology, i.e., all negative contributions generated in the inner product operation are set to zero, thereby eliminating the negative impact of gradient direction reversal caused by local background interference or sudden changes in illumination on the overall evaluation. The truncated global shape similarity is linearly scaled using scoring standardization technology to map it to a shape matching score ranging from zero to one. The shape matching score is a quantitative indicator that measures the geometric similarity between the candidate position of the target image and the predefined standard shape template. It can provide a core decision basis for objectively selecting the real target position that is closest to the ideal shape from many candidate positions.
[0043] In specific implementation, the shape matching score and the gray-level matching score of the candidate position are fused and weighted using a two-dimensional Gaussian conditional density to generate the feature fit of the candidate position. This can be achieved in the following way: First, a feature fusion model can be established based on the two-dimensional Gaussian conditional density function using probabilistic model construction technology. The covariance matrix of this feature fusion model is learned by offline analysis of the distribution relationship between the shape matching score and the gray-level matching score in a large number of historical correct matching samples, which is used to quantify the statistical correlation and uncertainty between the two features under deformation. Then, the shape matching score and gray-level matching score of the candidate position are used as observations and input into the feature fusion model using likelihood calculation technology to calculate their corresponding conditional probability density values, and these conditional probability density values are used as the feature fit of the candidate position. The feature fit is a quantification index of the probability that the candidate position is a deformation target matching point by fusing shape features and gray-level features. It can effectively overcome the limitations of a single feature in dealing with complex interference through multi-feature decision fusion, thereby significantly improving the accuracy of the final pose decision and the overall robustness of the system.
[0044] In some embodiments, determining the pose deviation of the precise candidate position in the candidate position set based on all feature fits can be achieved using the following steps: The deformation confidence level of each candidate location in the candidate location set is determined based on the matching degree of all features; Based on all deformation confidence scores, determine the precise candidate locations of deformations in the target image; The translation and rotation of the precise candidate position relative to the preset reference marker point are calculated, and the pose deviation of the precise candidate position is output.
[0045] In specific implementation, the deformation confidence of each candidate position in the candidate position set can be determined based on all feature matching degrees in the following way: all feature matching degrees can be normalized using a normalization mapping technique based on statistical regression. The output value of each feature matching degree, normalized to a continuous interval between zero and one, is used as the deformation confidence of the candidate position corresponding to each feature matching degree. Thus, the deformation confidence of each candidate position in the candidate position set is obtained. The deformation confidence is a reliability indicator that quantifies whether a candidate position is a real deformation target and whether its deformation degree exceeds an acceptable range. It can provide an objective and comparable numerical basis for making a unique and optimal decision from multiple similar candidates, effectively avoiding misjudgment.
[0046] In specific implementation, determining the precise candidate location of deformation in the target image based on all deformation confidence scores can be achieved in the following way: A comparison sorting algorithm can be used to sort all candidate locations in descending order according to deformation confidence scores, forming an ordered sequence. Then, a minimum confidence threshold is set. This minimum confidence threshold can be determined by offline analysis of the confidence distribution of a large number of successful fitting samples and taking the lower quintile of its statistical distribution, usually set between 0.6 and 0.8. Check whether the deformation confidence score of the first candidate location in the ordered sequence is greater than or equal to the minimum confidence threshold. If the condition is met, the first candidate location is directly determined as the precise candidate location. If the condition is not met, it means that all candidate locations are unreliable, the system triggers a no-effective-location signal and enters the anomaly handling process. Here, the precise candidate location is the single location among all candidate locations that is determined to be the most reliable deformation match. It can converge the fuzzy multi-target possibilities into a definite processing object, providing a unique and stable input for subsequent accurate calculations, which is the key to ensuring the determinism of the system output.
[0047] In specific implementation, calculating the translation and rotation of the precise candidate position relative to the preset reference marker point, and then outputting the pose deviation of the precise candidate position, can be achieved in the following way: First, the coordinates of the center point of the precise candidate position in the image pixel coordinate system can be extracted using coordinate acquisition technology, while the coordinates of the preset reference marker point, which was precisely calibrated during the initialization phase, in the same pixel coordinate system can be retrieved from the system storage; Second, using multi-stage coordinate transformation technology, the pixel coordinates of the center point of the precise candidate position and the preset reference marker point are uniformly transformed to a coordinate system consistent with the coordinates of the fitted actuator by utilizing the mathematical relationship between the pre-calibrated camera intrinsic parameter matrix and the hand-eye transformation matrix. In the same world coordinate system, the three-dimensional spatial vector difference between the center point of the precise candidate position and the reference marker point is calculated in this world coordinate system using spatial geometric calculation techniques. The linear translation deviation in the three orthogonal directions of X, Y, and Z is calculated. At the same time, the in-plane rotation deviation of the precise candidate position relative to the ideal orientation state of the reference marker point is calculated based on the predefined orientation angle in the grayscale template corresponding to the precise candidate position. Finally, the calculated three-axis linear translation deviation and in-plane rotation deviation are combined into a four-dimensional pose deviation vector, and this four-dimensional pose deviation vector is used as the pose deviation of the precise candidate position.
[0048] It should be noted that, in this application, the pose deviation is the spatial offset of the most reliable deformation matching position in the target image relative to the preset reference in the translation and rotation dimensions. It can transform the pixel-level image differences identified by vision into control parameters with clear physical meaning required to drive the actuator to perform precise compensation motion. It is the core bridge connecting visual perception and physical execution.
[0049] In step 104, the pose deviation is converted into motion compensation commands for the bonding actuator through a motion control model, and then the bonding actuator is driven to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
[0050] In some embodiments, converting the pose deviation into motion compensation commands that conform to the actuator through a motion control model can be achieved using the following steps: The multi-axis motion parameters for performing the fitting compensation motion are calculated based on the pose deviation using the inverse kinematics model of the fitting actuator. Based on the multi-axis motion parameters, motion compensation commands are generated to fit the actuator.
[0051] In specific implementation, the multi-axis motion parameters for performing the fitting compensation motion can be calculated based on the pose deviation using the inverse kinematics model of the fitting actuator. This can be achieved in the following way: First, the preset inverse kinematics mathematical model can be invoked according to the mechanical configuration of the fitting actuator. Then, the pose deviation is superimposed with the real-time feedback pose at the end of the actuator using target pose synthesis technology to calculate the desired target pose. This target pose is then used as input to the inverse kinematics mathematical model, and a preset mathematical mapping relationship is used to solve for one or more sets of candidate solutions for joint space parameters that meet the target pose requirements. Finally, the optimal solution screening technology is used based on joint motion smoothness, avoidance physical limits, and... Multiple constraints, including minimum motion amount, select a set of optimal joint space parameters from all candidate solutions of joint space parameters, and use this set of optimal joint space parameters as the multi-axis motion parameters for the fitting actuator to perform fitting compensation motion. Among them, the inverse kinematic mathematical model describes the mathematical mapping relationship from the pose of the end effector of the fitting actuator in the world coordinate system to the parameters of each independent motion joint. The multi-axis motion parameters are the specific angle or displacement target values of each motion joint calculated for the fitting actuator to perform fitting compensation during the aluminum foil cigarette label bonding process. They can transform the abstract spatial pose error into specific motion targets that can be directly executed by each axis servo drive, and are the core joint-level commands to achieve high-precision, coordinated motion compensation.
[0052] In specific implementation, the motion compensation command for the fitting actuator based on the multi-axis motion parameters can be achieved in the following way: First, by using motion trajectory planning technology, based on the target position of each axis in the multi-axis motion parameters and the maximum motion speed, acceleration, and acceleration limit value of the fitting actuator, an online trajectory calculation can be performed in the joint space to plan a time-position curve that smoothly transitions from the real-time feedback position of each axis to the target position. This time-position curve is then discretized into a sequence of instantaneous position, speed, and acceleration reference values that each axis should reach within each control cycle. Then, by using instruction encapsulation technology, the instantaneous position, speed, and acceleration reference values that each axis should reach within each control cycle are... The sequence of position, velocity, and acceleration reference values is converted into a digital instruction packet containing fields such as control mode words, target position commands, and velocity feedforward parameters, based on the fieldbus communication protocol and data frame format used by the servo driver of the bonding actuator. This digital instruction packet can be directly recognized and executed by the driver and is used as the motion compensation command for the bonding actuator. The motion compensation command is a real-time control signal that can directly drive the servo driver of the bonding actuator to perform compensation bonding. It can transform the planned motion target into safe, smooth, and synchronous physical motion, ultimately ensuring that the end effector of the bonding actuator can accurately and stably complete the compensation action for visual deviation.
[0053] In specific implementation, the precise bonding of the aluminum foil cigarette label to the bonding actuator based on the motion compensation command can be achieved in the following way: the motion compensation command can be synchronously sent to the servo drivers of each motion axis of the bonding actuator through Ethernet bus technology. Based on the received command, each servo driver drives the servo motor to drive each mechanical axis to move in coordination through high-precision multi-axis linkage closed-loop control technology, so that the end effector moves precisely from the current position to the target pose after visual compensation. After the end effector reaches the target pose, the contact process between the end effector and the cigarette label surface is controlled through dynamic force-position hybrid control technology. While maintaining the precise pose, a preset and uniform bonding pressure is applied. After the pressing action is completed, the relative position of the aluminum foil and the cigarette label is stabilized in the critical early stage of adhesive curing through short-term pressure holding and position maintenance technology.
[0054] In another aspect, in some embodiments, this application provides a machine vision-based aluminum foil cigarette label bonding control system, referencing... Figure 4 The figure is a schematic diagram of a machine vision-based aluminum foil cigarette label bonding control system according to some embodiments of this application. The machine vision-based aluminum foil cigarette label bonding control system 400 includes: a data acquisition module 401, a processing module 402, and an execution module 403, which are described below: The acquisition module 401 in this application is mainly used to acquire images of the aluminum foil cigarette label to be bonded using an industrial camera, and to extract a target image containing the aluminum foil workpiece and the bonding reference area from the aluminum foil cigarette label image. Processing module 402, in this application, is mainly used to perform grayscale feature matching on the target image based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then coarsely locate the candidate position set of the aluminum foil cigarette label deformation area according to the matching result. It should be noted that the processing module 402 in this application is also used to perform edge feature fine localization based on edge gradient direction vector field in the neighborhood of each candidate position in the candidate position set, to obtain the feature matching degree of each candidate position, and then determine the pose deviation of the precise candidate position in the candidate position set based on all feature matching degrees. The execution module 403 in this application is mainly used to convert the pose deviation into motion compensation commands for the bonding actuator through the motion control model, and then drive the bonding actuator to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
[0055] The modules in the aforementioned machine vision-based aluminum foil cigarette label bonding control system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0056] In another embodiment, this application provides a computer device, which may be a server, and its internal structure diagram may be as follows. Figure 5 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data for a machine vision-based aluminum foil cigarette label bonding control method. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a machine vision-based aluminum foil cigarette label bonding control method.
[0057] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0058] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described embodiment of the machine vision-based aluminum foil cigarette label bonding control method.
[0059] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps described in the embodiment of the machine vision-based aluminum foil cigarette label bonding control method.
[0060] In one embodiment, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps described in the embodiment of the machine vision-based aluminum foil cigarette label bonding control method.
[0061] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0062] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0063] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A machine vision-based method for controlling the bonding of aluminum foil cigarette labels, characterized in that, Includes the following steps: An image of the aluminum foil cigarette label to be bonded is acquired using an industrial camera, and a target image containing the aluminum foil workpiece and the bonding reference area is cropped from the aluminum foil cigarette label image. The target image is matched with grayscale features based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then a set of candidate locations for the deformation region of the aluminum foil cigarette label is obtained by coarse localization based on the matching results. In the candidate position set, edge feature fine localization based on edge gradient direction vector field is performed in the neighborhood of each candidate position to obtain the feature matching degree of each candidate position. Then, the pose deviation of the precise candidate position in the candidate position set is determined according to all feature matching degrees. The pose deviation is converted into motion compensation commands for the bonding actuator by a motion control model, and then the bonding actuator is driven to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
2. The method as described in claim 1, characterized in that, Extracting a target image containing the aluminum foil workpiece and the bonding reference area from the aluminum foil cigarette label image specifically includes: The geometric center of the aluminum foil workpiece outline and the bonding reference area is located in the aluminum foil cigarette label image according to the pre-calibrated visual coordinate mapping parameters. Using the geometric center as the origin and expanding the safety boundary outward based on the contour range of the aluminum foil workpiece, a rectangular cutout frame is generated that completely encompasses the aluminum foil workpiece and the bonding reference area. The aluminum foil cigarette label image is cropped based on the pixel coordinates of the rectangular cropping frame, and a target image containing the aluminum foil workpiece and the bonding reference area is output.
3. The method as described in claim 1, characterized in that, Based on multiple class-mean grayscale templates in a pre-built deformation feature template library, grayscale feature matching is performed on the target image, and then the candidate location set of the aluminum foil cigarette label deformation area is coarsely located according to the matching results. Specifically, it includes: Construct a template library of deformation features for aluminum foil deformation; At the top of the image pyramid, the mean grayscale templates of each class in the deformation feature template library are matched with the target image using a sliding window to obtain the cross-correlation score mapping map between the mean grayscale templates of each class and the target image. Inter-class nonmaximum suppression is applied to all cross-correlation score maps to filter out cross-template matching candidate regions; At the bottom layer of the image pyramid, a fine-grained matching is performed based on the neighborhood of all matching candidate regions to obtain the grayscale matching score of each matching candidate region. Based on all grayscale matching scores, a set of candidate locations for the deformed area of the aluminum foil cigarette label is obtained.
4. The method as described in claim 3, characterized in that, The specific components of constructing the deformation feature template library for aluminum foil deformation include: Images of aluminum foil workpieces under different mechanical stresses and bonding states are collected to construct an initial deformation image set; Extract the pixel registration pose of each image in the initial deformed image set relative to the standard pose, and then generate a registered deformed sample image set; Clustering based on cosine distance is performed on the deformed sample image set to generate class mean grayscale templates representing the deformation features of each class; A deformation feature template library for aluminum foil deformation is constructed based on all class mean grayscale templates.
5. The method as described in claim 1, characterized in that, In the candidate location set, fine-tuning of edge features based on the edge gradient direction vector field is performed in the neighborhood of each candidate location to obtain the feature fit of each candidate location. Specifically, this includes: For each candidate location in the candidate location set, the gradient direction of the edge pixels of the image is extracted in the pixel neighborhood of the candidate location to construct a gradient direction vector field; The gradient direction vector field is subjected to a point-by-point inner product operation with the gradient direction of the predefined shape template to obtain the shape matching score. The shape matching score and the grayscale matching score of the candidate position are weighted by two-dimensional Gaussian conditional density fusion to generate the feature matching degree of the candidate position, and then the feature matching degree of each candidate position in the candidate position set is obtained.
6. The method as described in claim 1, characterized in that, Determining the pose deviation of the precise candidate positions in the candidate position set based on all feature similarities specifically includes: The deformation confidence level of each candidate location in the candidate location set is determined based on the matching degree of all features; Based on all deformation confidence scores, determine the precise candidate locations of deformations in the target image; The translation and rotation of the precise candidate position relative to the preset reference marker point are calculated, and the pose deviation of the precise candidate position is output.
7. The method as described in claim 1, characterized in that, The conversion of the pose deviation into motion compensation commands that fit the actuator through the motion control model specifically includes: The multi-axis motion parameters for performing the fitting compensation motion are calculated based on the pose deviation using the inverse kinematics model of the fitting actuator. Based on the multi-axis motion parameters, motion compensation commands are generated to fit the actuator.
8. A machine vision-based aluminum foil cigarette label bonding control system, characterized in that, include: The acquisition module is used to acquire images of the aluminum foil cigarette labels to be bonded using an industrial camera, and to crop a target image containing the aluminum foil workpiece and the bonding reference area from the aluminum foil cigarette label images. The processing module is used to perform grayscale feature matching on the target image based on multiple class mean grayscale templates in a pre-built deformation feature template library, and then coarsely locate the candidate location set of the aluminum foil cigarette label deformation area based on the matching results. The processing module is used to perform edge feature fine localization based on edge gradient direction vector field in the neighborhood of each candidate position in the candidate position set, to obtain the feature matching degree of each candidate position, and then determine the pose deviation of the precise candidate position in the candidate position set based on all feature matching degrees. The execution module is used to convert the pose deviation into motion compensation commands for the bonding actuator through a motion control model, and then drive the bonding actuator to complete the precise bonding of the aluminum foil cigarette label based on the motion compensation commands.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the machine vision-based aluminum foil cigarette label bonding control method as described in any one of claims 1 to 7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the machine vision-based aluminum foil cigarette label bonding control method as described in any one of claims 1 to 7.