A machine vision guided label die cutting control method
The machine vision-guided label die-cutting control method uses industrial-grade cameras and intelligent algorithms to adjust image acquisition and die-cutting machine control in real time, solving the problems of insufficient precision and poor adaptability in the label die-cutting process, and achieving efficient and accurate label die-cutting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN JIANSHENG PRINTING CO LTD
- Filing Date
- 2025-11-04
- Publication Date
- 2026-06-19
AI Technical Summary
Existing label die-cutting technologies struggle to achieve high precision and efficiency when faced with label material deformation, conveyor belt vibration, and environmental changes. They also lack adaptability, resulting in high scrap rates and poor production flexibility.
A machine vision-guided label die-cutting control method is adopted. Images are acquired in real time through an industrial-grade camera, and key feature points are extracted by combining Harris corner detection and Canny edge detection. A proportional-integral-derivative control algorithm is used to generate control signals for the die-cutting machine, so as to achieve precise compensation and adjustment of the label position.
It achieves high precision and efficiency in the label die-cutting process, reduces scrap rate, improves the flexibility and automation of the production line, and can adapt to changes in label shape and fluctuations in ambient light.
Smart Images

Figure CN122231995A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated production technology, and in particular to a machine vision-guided label die-cutting control method. Background Technology
[0002] In the label manufacturing industry, label die-cutting is a crucial production step, aiming to precisely cut label materials into predetermined shapes and sizes using a die-cutting machine. Current label die-cutting control methods primarily rely on mechanical positioning systems or simple photoelectric sensors for position detection and adjustment. Mechanical positioning systems typically use clamps and guide devices to hold the label material, controlling the movement of the die-cutting die through a preset mechanical motion trajectory. While this method can achieve a certain level of accuracy under ideal conditions, in actual production, factors such as label material deformation, conveyor belt vibration, and ambient temperature changes can cause slight offsets in label position, resulting in inaccurate die-cutting and defective products. Furthermore, simple photoelectric sensors can only detect the edge position of the label and cannot identify complex shapes and internal features. Therefore, when labels have irregular patterns or porous structures, photoelectric sensors are prone to misjudgment, further reducing die-cutting accuracy.
[0003] Another existing technology uses a basic machine vision system for position compensation. For example, it captures label images using a camera, compares them with a preset template, calculates the positional deviation, and adjusts the position of the die-cutting machine. However, this existing machine vision method has several limitations. First, the image acquisition process is easily affected by changes in ambient lighting, label material reflection, or background interference, leading to unstable image quality and affecting the accuracy of position calculation. Second, existing methods typically use fixed image processing algorithms, such as simple edge detection or template matching. These algorithms often cannot adapt to changes in label shape or material deformation in real time when processing label images in high-speed motion, causing processing delays and decreased accuracy. Furthermore, the control signal generation process in existing technologies is often based on a linear compensation model, which cannot effectively handle nonlinear offset problems. For example, when the label material is stretched or twisted during transport, the linear compensation model leads to accumulated errors, ultimately affecting the die-cutting quality.
[0004] In practical applications, label die-cutting processes typically require high speed and high precision. For example, in the production of medical labels or electronic component labels, die-cutting position errors need to be controlled within millimeter or even micrometer levels. Existing technologies struggle to meet these requirements, leading to low production efficiency, high scrap rates, and increased production costs. Furthermore, existing methods lack adaptability, failing to dynamically adjust control parameters based on the characteristics of different label materials (such as elasticity and thickness) or changes in the production environment. This necessitates frequent manual intervention when changing label types, reducing flexibility and automation. Therefore, there is an urgent need for a method that can guide label die-cutting control in real-time, accurately, and adaptively to address the problems of insufficient precision, low efficiency, and poor adaptability in existing technologies. Summary of the Invention
[0005] To achieve the above objectives, the present invention provides a machine vision-guided label die-cutting control method, comprising the following steps:
[0006] Step 1: Use an industrial-grade camera to capture images of the labels at a fixed position above the conveyor belt of the die-cutting machine. The acquisition parameters of the industrial-grade camera are dynamically adjusted according to the ambient light conditions, including exposure time and gain value. The image acquisition frequency is synchronized with the movement speed of the die-cutting machine. The position signal of the conveyor belt is output in real time through the encoder of the die-cutting machine to trigger image acquisition.
[0007] Step 2: Preprocess the image acquired in Step 1. The preprocessing includes grayscale conversion, filtering and denoising, and contrast enhancement. Grayscale conversion is achieved by calculating the weighted sum of the red, green, and blue channel values of each pixel to obtain the grayscale value. Median filtering algorithm is used for filtering and denoising. Contrast enhancement is achieved through histogram equalization.
[0008] Step 3: Extract key feature points of the label from the image after preprocessing in Step 2. Key feature points include corner points, edge points, and center points. Feature extraction uses the Harris corner detection algorithm combined with the Canny edge detection algorithm.
[0009] Step 4: Based on the key feature points extracted in Step 3, calculate the offset between the actual position and the ideal position of the label. The offset calculation includes coordinate transformation and offset calculation. The coordinate transformation is achieved through camera calibration. The offset includes translation offset and rotation offset.
[0010] Step 5: Based on the offset calculated in Step 4, generate the control signal for the die-cutting machine. The control signal generation is based on the proportional-integral-derivative control algorithm.
[0011] Step 6: Based on the control signal generated in Step 5, drive the actuator of the die-cutting machine to adjust the position of the die-cutting die, and synchronize the die-cutting process with the movement of the conveyor belt.
[0012] Preferably, the dynamic adjustment process of the acquisition parameters of the industrial-grade camera in step 1 includes:
[0013] The exposure time is adjusted based on the real-time monitoring of the lighting intensity data by the ambient light sensor. The ambient light sensor is installed near the industrial-grade camera. The lighting intensity data is transmitted to the control unit of the industrial-grade camera through a digital interface. The control unit calculates the exposure time based on the lighting intensity data. The calculation process is as follows: if the lighting intensity is lower than the preset lower threshold, the exposure time is increased; if the lighting intensity is higher than the preset upper threshold, the exposure time is decreased.
[0014] The gain value is adjusted based on the average gray value of the image. The control unit calculates the average gray value of the image. If the average gray value is lower than the lower limit of the target gray range, the gain value is increased. If the average gray value is higher than the upper limit of the target gray range, the gain value is decreased.
[0015] Image acquisition is triggered by the encoder of the die-cutting machine. The encoder outputs the position signal of the conveyor belt in real time. When the position signal reaches the preset acquisition point, the industrial-grade camera triggers image acquisition. The preset acquisition point is set according to the ideal position of the label on the conveyor belt. Each pulse of the encoder corresponds to a fixed distance of conveyor belt movement. The pulse count is monitored by the controller of the die-cutting machine.
[0016] Preferably, the image preprocessing process in step 2 includes:
[0017] In the weighted sum calculation of grayscale conversion, the weights are preset based on the color characteristics of the label material. The weight values are determined experimentally. For label materials with high reflectivity, the weight of the blue channel value is increased, and for label materials with high absorptivity, the weight of the red channel value is increased.
[0018] The median filtering algorithm is used for filtering and denoising. The window size of the median filter is dynamically determined according to the image resolution. The window size is proportional to the image resolution. The window size is adjusted by analyzing the noise level of the image. The noise level is calculated based on the standard deviation of the image gray values. If the standard deviation is higher than the noise threshold, the window size is increased.
[0019] Contrast enhancement is achieved through histogram equalization. The parameters of histogram equalization are automatically calculated based on the gray-level distribution of the image. The calculation process includes constructing a gray-level histogram, calculating the cumulative distribution function, and mapping gray-level values to expand the dynamic range. The mapping function is adaptively adjusted according to the overall brightness and contrast of the image.
[0020] Preferably, the feature extraction process in step 3 includes:
[0021] The parameters of the Harris corner detection algorithm include a corner response threshold, which is automatically adjusted based on the gradient magnitude of the image. The gradient magnitude is obtained by calculating the derivatives of the image in the horizontal and vertical directions using the Sobel operator. The corner response threshold is proportional to the average gradient magnitude, and the scaling factor is calibrated experimentally.
[0022] The parameters of the Canny edge detection algorithm include a high threshold and a low threshold. The high threshold and low threshold are dynamically calculated based on the gradient histogram of the image. The high threshold is taken as the 70th percentile value of the gradient histogram, and the low threshold is taken as the 30th percentile value of the gradient histogram. The gradient histogram is obtained by statistically analyzing the gradient magnitude of all pixels in the image.
[0023] After feature extraction, key feature points are filtered. The filtering process is based on the confidence level of the feature points, which is calculated by the gradient consistency around the feature point. If the confidence level is lower than a preset threshold, the feature point is removed.
[0024] Preferably, the position calculation process in step 4 includes:
[0025] The coordinate transformation uses the transformation matrix obtained from camera calibration to transform the coordinates of feature points in the image coordinate system to the mechanical coordinate system of the die-cutting machine. The camera calibration process is performed during system initialization. Multiple sets of images and mechanical coordinate data are collected using a calibration board. The calibration board has a grid pattern of known size. The mapping relationship between image coordinates and mechanical coordinates is fitted using the least squares method. The transformation matrix is a 3x3 matrix.
[0026] The translation offset is obtained by calculating the difference between the actual feature point center and the ideal feature point center. The actual feature point center is calculated by taking the average of the coordinates of all actual feature points, and the ideal feature point center is read from the preset label template database.
[0027] The rotation offset is obtained by calculating the angle difference between the polygon formed by the actual feature points and the polygon formed by the ideal feature points. The angle difference is calculated by using principal component analysis to calculate the principal axis directions of the actual feature point set and the ideal feature point set, and then the direction difference is obtained.
[0028] Preferably, the control signal generation process in step 5 includes:
[0029] The parameters of the proportional-integral-derivative control algorithm include proportional coefficient, integral coefficient, and derivative coefficient. The proportional coefficient, integral coefficient, and derivative coefficient are pre-calibrated according to the characteristics of the label material and the dynamic response characteristics of the die-cutting machine. The calibration process is carried out through experiments, testing the response of the die-cutting machine at different offsets, and optimizing the control parameters based on the response data.
[0030] The control signals include the adjustment amount of the die-cutting machine on the X-axis, Y-axis and rotary axis. The adjustment amount is calculated by the proportional-integral-derivative control algorithm. The calculation formula is that the adjustment amount is equal to the proportional coefficient multiplied by the offset, plus the integral coefficient multiplied by the offset, plus the derivative coefficient multiplied by the offset. The integral and derivative calculations are based on historical offset data.
[0031] The control signal is output to the actuator of the die-cutting machine in the form of digital pulses. The width and frequency of the digital pulses are dynamically adjusted according to the magnitude of the adjustment to ensure precise control.
[0032] Preferably, the die-cutting process in step 6 includes:
[0033] The actuator includes a servo motor and a ball screw. The servo motor rotates according to the adjustment amount in the control signal, and the ball screw converts the rotational motion into linear motion, thereby moving the die-cutting die.
[0034] The die-cutting process is synchronized with the movement of the conveyor belt. The controller of the die-cutting machine monitors the speed of the conveyor belt in real time. The speed data is read from the encoder, and the response time of the servo motor is adjusted according to the speed. The response time is determined by a lookup table, which stores the response time values corresponding to different speeds.
[0035] After die-cutting is completed, the system returns to step 1 to process the next label. If the offset of multiple consecutive labels exceeds the tolerance threshold, an alarm is triggered and the die-cutting process is paused. The tolerance threshold is set according to the size and accuracy requirements of the label.
[0036] Preferably, it also includes a system initialization step:
[0037] The system initialization steps are performed before the die-cutting control method is started, including camera calibration and parameter settings;
[0038] Camera calibration uses a standard calibration board with a grid pattern of known size. An industrial-grade camera captures images of multiple positions on the calibration board. The image processing unit extracts the grid corner points and compares them with the actual coordinates in the machine coordinate system. The transformation matrix from image coordinates to machine coordinates is calculated using the least squares method.
[0039] The parameter settings include importing a preset label template, which is generated by offline acquisition of ideal label images and extraction of key feature points, and stored in the database. At the same time, the initial parameters of the proportional-integral-derivative control algorithm are set. The initial parameters are determined experimentally based on the model of the die-cutting machine and the common types of label materials.
[0040] Preferably, it further includes an adaptive parameter adjustment step:
[0041] The adaptive parameter adjustment step is executed in real time during the die-cutting process, dynamically adjusting the feature extraction and control signal generation parameters according to the deformation of the label material and environmental changes.
[0042] The self-adjustment of feature extraction parameters includes dynamically updating the thresholds for Harris corner detection and Canny edge detection based on image quality. Image quality is evaluated based on the image's contrast and noise level. If the contrast is below the threshold, the intensity of histogram equalization is increased.
[0043] The self-adjustment of the control signal generation parameters includes optimizing the coefficients of the proportional-integral-derivative control algorithm based on historical offset data. If the offset shows a trend change, the integral coefficient is increased to reduce the steady-state error. The optimization process uses the recursive least squares method to update the parameters online.
[0044] Preferably, it also includes a quality monitoring step:
[0045] The quality monitoring step is performed after die-cutting, and the die-cutting quality is checked through secondary image acquisition and analysis;
[0046] Secondary image acquisition uses an auxiliary industrial-grade camera to capture images of the die-cut labels downstream of the die-cutting machine. The parameters of the auxiliary industrial-grade camera are the same as those of the main industrial-grade camera.
[0047] The analysis process includes extracting the feature points of the die-cut labels and comparing them with the ideal feature points, calculating the die-cutting error, and adjusting the control signal generation parameters in step 5 if the die-cutting error exceeds the quality threshold. The quality threshold is set according to production requirements.
[0048] Quality monitoring data is recorded in a database for statistical process control and predictive maintenance. Statistical process control includes calculating the average and standard deviation of die-cutting errors and triggering maintenance alarms if the standard deviation continues to increase.
[0049] The beneficial effects of this invention are:
[0050] 1. This invention employs advanced real-time image recognition technology. Through multi-point position detection and dynamic adjustment, it can accurately identify the real-time position of the label, automatically compensate for deviations caused by label deformation or conveyor belt vibration, ensure the accuracy of the die-cutting position, and effectively reduce the scrap rate.
[0051] 2. This invention utilizes a high-performance machine vision system that can comprehensively scan the entire pattern of the label, automatically recognizing its complex shape and internal features. Even if the label has irregular patterns or a porous structure, the system can still accurately identify and adjust the position of the die-cutting machine, significantly improving die-cutting accuracy.
[0052] 3. This invention employs adaptive image acquisition technology, which can adjust the image acquisition parameters in real time, automatically compensate for changes in ambient light and reflection, ensure stable image quality, and provide reliable data for subsequent accurate location calculations.
[0053] 4. This invention introduces an intelligent dynamic algorithm that can adapt in real time to the deformation or material change of the label during high-speed movement, eliminating the processing delay caused by shape changes and ensuring the real-time performance and accuracy of image processing and die-cutting adjustment.
[0054] 5. This invention employs a nonlinear compensation algorithm, which can accurately calculate and adjust the nonlinear offset of the label, ensuring that the die-cutting position remains accurate even when the label material deforms, thus reducing quality problems caused by accumulated errors.
[0055] 6. This invention employs a self-learning and adaptive adjustment mechanism, which can automatically adjust control parameters according to the characteristics of different labels and changes in the production environment, reducing the need for manual intervention and significantly improving the flexibility and automation of the production line. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0057] Figure 1 This is a flowchart of the steps of the method of the present invention;
[0058] Figure 2 This is a flowchart illustrating the steps of dynamically adjusting the acquisition parameters of an industrial-grade camera in the method of this invention.
[0059] Figure 3 This is a flowchart of the image preprocessing process in step 2 of the method of the present invention. Detailed Implementation
[0060] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. It should also be noted that, to make the embodiments more comprehensive, the following embodiments are the best and preferred embodiments, and those skilled in the art can use other alternative methods to implement some well-known technologies; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0061] Please see Figures 1-3This invention provides a machine vision-guided label die-cutting control method. In step 1, an industrial-grade camera is fixedly installed above the conveyor belt of the die-cutting machine to capture real-time images of labels passing through the conveyor belt. The camera's acquisition parameters (such as exposure time and gain value) are dynamically adjusted according to ambient light conditions to ensure clear images are obtained under different lighting conditions. The image acquisition frequency is synchronized with the movement speed of the die-cutting machine. By connecting to the encoder of the die-cutting machine, the camera acquires images during each conveyor belt movement cycle, ensuring accurate capture of the label's position. This method can reduce image quality problems caused by changes in lighting or environmental conditions, thereby improving the accuracy of die-cutting positioning.
[0062] In step 2, after image acquisition, a grayscale conversion is first performed, transforming the color image into a grayscale image. This is done by calculating the weighted sum of the red, green, and blue channel values of each pixel in the image. This process simplifies subsequent processing and removes interference from color information. Next, a median filtering algorithm is used for noise reduction, removing noise from the image and ensuring its smoothness and accuracy. Finally, histogram equalization enhances the image contrast and improves the clarity of label edges. These processing steps help improve image quality, making subsequent feature extraction more accurate and avoiding positioning errors caused by noise or insufficient contrast.
[0063] In step 3, the preprocessed image is used to extract key feature points for the labels, including corner points, edge points, and center points. During feature extraction, a combination of the Harris corner detection algorithm and the Canny edge detection algorithm is used. The Harris algorithm efficiently detects corner points in the image, while the Canny algorithm accurately identifies edges, making it particularly suitable for processing label edges and corners. These key feature points provide high-precision localization data for subsequent label position calculations.
[0064] In step 4, the label offset is calculated by comparing the actual label position extracted in step 3 with the preset ideal position. The offset calculation includes translational offset and rotational offset. Camera calibration technology accurately converts the image coordinate system to the die-cutting machine coordinate system, thus obtaining a precise offset. This process effectively eliminates errors caused by factors such as label position changes, deformation, or conveyor belt vibration, ensuring the operational accuracy of the die-cutting machine.
[0065] In step 5, based on the offset calculated in step 4, a proportional-integral-derivative (PID) control algorithm is used to generate the control signal for the die-cutting machine. The PID algorithm dynamically adjusts the movement trajectory of the die-cutting die according to the actual positional deviation of the label by adjusting the control parameters of the die-cutting machine in real time, quickly and accurately correcting the die-cutting position and ensuring that the die-cutting accuracy matches the label deformation and positional changes.
[0066] In step 6, finally, based on the control signal generated in step 5, the actuator of the die-cutting machine is driven to adjust the position of the die-cutting die. The die-cutting process is synchronized with the movement of the conveyor belt, ensuring that the die-cutting die is always precisely aligned with the actual position of the label during the rapid movement of the label, avoiding die-cutting errors caused by positional offset.
[0067] The die-cutting accuracy has been improved. Through high-precision image acquisition and intelligent algorithm compensation, positional shifts caused by label deformation and environmental factors are avoided, significantly reducing the scrap rate. The system's adaptability has been enhanced. Whether the label shape changes or the ambient lighting fluctuates, the system can adjust in real time to ensure the stability of image acquisition and processing.
[0068] In one possible implementation, the exposure time of an industrial-grade camera needs to be dynamically adjusted based on ambient lighting conditions during operation. To this end, an ambient light sensor is installed near the camera to monitor the surrounding lighting intensity in real time. The ambient light sensor transmits real-time lighting intensity data to the camera's control unit via a digital interface. The control unit calculates the appropriate exposure time based on this data. If the ambient light intensity is below a set lower threshold, the control unit increases the exposure time to ensure the camera captures sufficient light for a clear image; conversely, when the ambient light intensity is above a set upper threshold, the control unit reduces the exposure time to prevent overexposure and maintain image quality. In this way, the camera can consistently capture appropriately exposed images under different lighting conditions, improving image quality and the accuracy of subsequent processing.
[0069] Gain adjustment is performed by monitoring the average grayscale value of the image. The control unit calculates the average grayscale value of the acquired image and compares it with the target grayscale range. If the average grayscale value is lower than the preset lower limit of the grayscale range, it indicates that the image is too dark, and the control unit automatically increases the gain value to enhance the image brightness. If the average grayscale value is higher than the upper limit of the target range, it indicates that the image may be too bright, and the control unit decreases the gain value to prevent overexposure. This dynamic adjustment of the gain value ensures that the image remains within the optimal grayscale range under different lighting conditions, thereby ensuring the clarity of the label features and improving the accuracy of subsequent feature extraction and localization.
[0070] Image acquisition is timed using the encoder of the die-cutting machine. The encoder monitors the conveyor belt's movement in real time and outputs a position signal corresponding to the belt's current position. When the position signal reaches a preset acquisition point, the industrial-grade camera triggers image acquisition. The preset acquisition point is set based on the ideal position of the label on the conveyor belt, ensuring that the label is in the predetermined ideal position each time an image is acquired. Each encoder pulse corresponds to a fixed distance the conveyor belt moves, and the pulse count is monitored by the die-cutting machine's controller, ensuring the synchronization and accuracy of image acquisition. This synchronization mechanism allows for precise image acquisition when the label passes a specific position, avoiding acquisition errors caused by inaccurate timing or incorrect label positioning.
[0071] By dynamically adjusting ambient light intensity, image grayscale value, and die-cutting machine position signal, the performance of the machine vision system is optimized, and the accuracy and adaptability of the die-cutting process are enhanced, which has significant practical application value.
[0072] In one possible implementation, grayscale conversion is performed first during image preprocessing. To ensure that the converted grayscale image better reflects the color characteristics of the label, a weighted sum method is used for grayscale conversion. The weights are predetermined based on the color characteristics of the label material. These weight values are derived experimentally to improve image accuracy. Specifically, for label materials with high reflectivity, such as metallic or glossy materials, a larger weight is usually assigned to the blue channel because blue light is more easily reflected by these materials; while for label materials with high absorptivity, such as dark or matte materials, the weight of the red channel is increased because these materials absorb red light more easily. In this way, the converted grayscale image more closely matches the actual reflection and absorption characteristics of the label, improving the accuracy of subsequent processing.
[0073] Noise in images often affects image quality and reduces die-cutting accuracy. Therefore, median filtering is used to remove noise from images. Median filtering is a non-linear filtering method that can effectively remove salt-and-pepper noise without losing edge information. The window size during the filtering process is dynamically determined based on the image resolution. The window size is proportional to the image resolution to ensure consistent filtering performance across different resolutions. Furthermore, the window size is adjusted according to the noise level of the image. The noise level is measured by calculating the standard deviation of the image's grayscale values. When the standard deviation exceeds a preset noise threshold, the window size is automatically increased, thus removing noise more effectively.
[0074] Contrast enhancement is achieved through histogram equalization. Histogram equalization is a commonly used image enhancement technique aimed at improving image contrast and making details clearer. The process first constructs a grayscale histogram of the image, calculates the cumulative distribution function, and expands the dynamic range of the image by mapping grayscale values. The mapping function is adaptively adjusted based on the overall brightness and contrast of the image. For areas in the image where grayscale values are concentrated or contrast is low, histogram equalization can effectively stretch the grayscale range, enhance image contrast, and make the edges and details of the labels more prominent, thereby improving image clarity and providing a better foundation for subsequent label positioning and die-cutting.
[0075] In one possible implementation, the core of the Harris corner detection algorithm is to detect feature points in an image by calculating the response values of corner points. To optimize corner detection performance, this method dynamically adjusts the corner response threshold. This threshold is automatically calculated based on the gradient magnitude of the image, which is obtained by calculating the derivatives of the image in the horizontal and vertical directions. The Sobel operator is used to calculate the image gradient, ensuring accurate capture of image changes in different directions. The corner response threshold is proportional to the average gradient magnitude of the image, and the scaling factor is determined experimentally. This dynamic adjustment ensures adaptability to different image types; the gradient information of different images affects the sensitivity of corner detection, allowing the method to be optimized for different image characteristics, thereby improving the accuracy of corner detection.
[0076] The Canny edge detection algorithm is a classic edge detection method, but its effectiveness is affected by high and low thresholds. To adapt to different levels of noise and detail in images, this paper proposes a method that dynamically calculates high and low thresholds based on the image's gradient histogram. The high threshold is set to the 70th percentile value in the gradient histogram, and the low threshold is set to the 30th percentile value. This dynamic calculation method based on the gradient histogram effectively adjusts the edge detection sensitivity according to the actual image conditions, avoiding the problems of inaccurate or oversensitive edge detection that may result from fixed threshold settings. This is especially beneficial when processing images with complex backgrounds or high noise levels, enabling the extraction of accurate edge information.
[0077] In the feature extraction stage, the obtained key feature points need further filtering to ensure their high reliability and representativeness. The filtering process is based on the confidence level of the feature points. Confidence is assessed by calculating the gradient consistency around the feature point. If the gradient information of a feature point is inconsistent in its surrounding area, it indicates that the point may not possess high stability and reliability. If the confidence level is below a preset threshold, the feature point is discarded. This process effectively eliminates possible spurious or noisy feature points in the image, thereby improving the accuracy of subsequent feature matching and localization.
[0078] By dynamically adjusting the response threshold of the Harris corner detection algorithm and the high and low thresholds of the Canny edge detection algorithm, the detection parameters can be adaptively adjusted according to the characteristics of the image, thereby improving the accuracy and robustness of feature point detection, especially in complex and noisy images.
[0079] In one possible implementation, coordinate transformation converts feature points in the image coordinate system to their corresponding points in the die-cutting machine's mechanical coordinate system. To achieve this, camera calibration is first required, typically performed during system initialization. Camera calibration involves acquiring multiple images and their corresponding mechanical coordinate data using a calibration board with a known-sized grid pattern. The core objective of calibration is to establish a mapping between image coordinates and mechanical coordinates. A 3x3 transformation matrix can be calculated from multiple images and their corresponding mechanical coordinate data using a least-squares fitting algorithm. This transformation matrix accurately converts the feature point coordinates in the image coordinate system to those in the die-cutting machine's mechanical coordinate system, ensuring precise alignment between the feature points in the image and the mechanical coordinate system.
[0080] The translation offset is obtained by calculating the difference between the actual feature point center and the ideal feature point center. First, the actual feature point center is determined by averaging the coordinates of all actual feature points, thus obtaining a center representing the overall position of the actual feature points. The ideal feature point center is retrieved from a pre-defined label template database, representing the ideal, desired feature point position. By comparing the difference between the actual and ideal feature point centers, the translation offset can be calculated, thereby correcting actual position deviations caused by equipment errors or other reasons.
[0081] The rotation offset is calculated by comparing the angular difference between the actual feature point set and the ideal feature point set. Specifically, Principal Component Analysis (PCA) is first used to calculate the principal axis directions of the actual and ideal feature point sets. PCA extracts the main directional information by analyzing the distribution and correlation of the feature point sets. These principal axis directions represent the dominant trend of the feature point sets. Then, the angular difference between the principal axis directions of the actual and ideal feature point sets is calculated to obtain the rotation offset, thereby achieving rotational correction of the actual feature points and ensuring the docking accuracy between the label and the die-cutting machine.
[0082] In one possible implementation, the three key parameters of the PID control algorithm are the proportional gain, integral gain, and derivative gain, which directly affect the die-cutting machine's response speed and accuracy to offsets. These coefficients are not fixed but are pre-calibrated based on the characteristics of the label material and the dynamic response characteristics of the die-cutting machine. Specifically, this calibration process needs to be completed experimentally. In the experiment, the die-cutting machine's response is tested under different offset conditions, and the corresponding response data is collected. By analyzing this data, the proportional gain, integral gain, and derivative gain can be optimized, enabling the die-cutting machine to respond more accurately and quickly to label positioning errors.
[0083] During control signal generation, the adjustment amount is calculated using a PID control algorithm. Specifically, the algorithm calculates the corresponding adjustment amounts based on the positional offsets of the die-cutting machine along the X, Y, and rotation axes. The core idea of the PID algorithm is to comprehensively control the system's response by combining proportional, integral, and derivative terms. The proportional term adjusts based on the current offset, the integral term considers the cumulative effect of historical offsets, and the derivative term predicts the trend of offset changes. This combination effectively ensures the die-cutting machine quickly corrects the label position during actual operation, reducing the possibility of oscillations and over-adjustment.
[0084] After calculating the adjustment amount, the control signal is transmitted to the die-cutting machine's actuator in the form of digital pulses. Each digital pulse corresponds to one action of the die-cutting machine's actuator, and the pulse width and frequency of the control signal are dynamically adjusted according to the magnitude of the adjustment. In this way, the die-cutting machine can make precise adjustments in a very short time, ensuring the efficiency and accuracy of the die-cutting process. For example, if the adjustment amount is large, the pulse width and frequency will increase accordingly, and vice versa. This digital pulse control method ensures that the die-cutting machine's actuator accurately compensates for errors, avoiding over- or under-correction.
[0085] In one possible implementation, the die-cutting actuator consists of a servo motor and a ball screw. The servo motor rotates according to the adjustment amount in the control signal, and the ball screw converts the rotational motion into linear motion, thereby precisely moving the die-cutting die to complete the die-cutting operation on the label. The response accuracy of the servo motor and the adjustment of the control signal directly affect the movement trajectory of the die-cutting die, therefore, precise adjustments are required based on previous steps (such as PID control algorithms) to achieve optimal die-cutting accuracy.
[0086] The die-cutting process must be synchronized with the movement of the conveyor belt to ensure that the label remains in the correct position throughout its movement. To this end, the die-cutting machine's controller monitors the conveyor belt speed in real time and reads the real-time speed data from the conveyor belt using an encoder. Based on this speed data, the controller can determine the current die-cutting timing and the required servo motor response time.
[0087] To ensure the die-cutting machine can accurately adjust to different conveyor belt speeds, the controller uses a lookup table to determine the servo motor's response time. The basic principle of this lookup table method is to pre-store the corresponding servo motor response time values for different conveyor belt speeds. During actual production, the controller can quickly retrieve the corresponding response time from the table based on the current conveyor belt speed and adjust the servo motor's actions accordingly.
[0088] After die-cutting is complete, the system returns to step 1 to process the next label. This process ensures the continuity and efficiency of the entire label die-cutting operation. However, to avoid quality problems caused by excessive offset, the system sets a tolerance threshold. If the offset of multiple consecutive labels exceeds the set tolerance threshold, the system will automatically trigger an alarm and pause the die-cutting process. This tolerance threshold is set according to the size and precision requirements of the labels, effectively preventing label defects caused by excessive positional deviations.
[0089] In one possible implementation, camera calibration aims to achieve a precise correspondence between image coordinates and machine coordinates, enabling the vision system to accurately detect the label's position. This process uses a standard calibration board as a reference tool, featuring a grid pattern of known dimensions designed for precise measurement using these known reference features. An industrial-grade camera is used to capture images of the calibration board at different locations, and an image processing unit processes these images to extract the corner points of the grid pattern.
[0090] By extracting the grid corner points, the system can compare image coordinates with machine coordinates. Then, the least squares method is used to calculate the transformation matrix from image coordinates to machine coordinates. This transformation matrix provides the system with a standard coordinate system transformation relationship, ensuring that the label positions extracted from the image can be accurately converted to their actual positions in the machine coordinate system, thereby ensuring precise alignment of the labels during die-cutting.
[0091] Another important step in system initialization is parameter setting, which includes two aspects:
[0092] Label Template Import: The label template is generated by acquiring ideal label images offline and extracting key feature points from them. By extracting feature points from the ideal label images, a label template can be generated and stored in the database. This template not only contains the basic geometric information of the label but also covers various offsets and error data that may be needed during the die-cutting process, thus providing a standardized reference for the actual operation of the system.
[0093] PID Control Algorithm Parameter Settings: During system initialization, the initial parameters of the Proportional-Integral-Derivative (PID) control algorithm also need to be set. These parameters are determined experimentally based on the die-cutting machine model and common label material types. For example, different label materials may have different requirements for the response speed and accuracy of the die-cutting machine. Therefore, during initialization, the system needs to reasonably set the control parameters according to the label type and the dynamic characteristics of the die-cutting machine to ensure that the control algorithm can accurately adjust the action of the die-cutting machine.
[0094] In one possible implementation, during the die-cutting process, the image quality of the label may be affected by various factors, such as contrast and noise. These variations may lead to inaccurate feature point detection in the image, thereby affecting the label's positioning accuracy. To address this issue, the system adaptively adjusts the feature extraction parameters, specifically including the following aspects:
[0095] Dynamic Threshold Updates for Harris Corner Detection and Canny Edge Detection: These two algorithms are fundamental for extracting image features. When image quality is poor, existing fixed thresholds may fail to accurately extract feature points. Therefore, the system adjusts these thresholds based on the quality of the real-time image (such as contrast and noise levels). For example, when the image contrast is below a set threshold, the system increases the intensity of histogram equalization to improve image contrast, allowing image features to be detected more clearly. Through this dynamic adjustment, the system can maintain high image processing accuracy under different production conditions.
[0096] Control signal generation is a crucial step in the die-cutting process, involving the application of a proportional-integral-derivative (PID) control algorithm. The coefficients of this algorithm determine the die-cutting machine's response speed and steady-state error, directly affecting die-cutting accuracy. To optimize the control process, the system adaptively adjusts the control signal generation parameters, specifically through the following methods:
[0097] The system optimizes the coefficients of the PID control algorithm based on historical offset data. If the historical data indicates a trend in the offset (e.g., the offset gradually increases or decreases), the integral coefficient is increased to reduce steady-state error. The integral term corrects for the accumulation of deviation, thereby ensuring that the system maintains minimal error in steady state.
[0098] The optimization process uses recursive least squares to update the PID control parameters in real time. This method adjusts the control coefficients based on real-time offset data, ensuring the control algorithm remains in optimal condition and preventing performance degradation due to environmental changes or different materials.
[0099] Through this adaptive parameter adjustment step, the entire label die-cutting process becomes more intelligent and efficient, thereby maintaining high precision and stability in complex industrial production environments and improving the automation level of the production line and product quality.
[0100] In one possible implementation, the quality monitoring process first acquires images of the die-cut labels through secondary image acquisition. To ensure the comparability and consistency of image quality, the auxiliary industrial-grade camera used for secondary acquisition has parameters completely identical to the main industrial-grade camera. This is to ensure that the acquired images are consistent with the real-time images during the die-cutting process in terms of quality, resolution, and contrast, avoiding image quality inconsistencies caused by equipment differences. The auxiliary camera is located downstream of the die-cutting machine and is specifically used to acquire images of the already die-cut labels for subsequent quality analysis.
[0101] After processing the acquired secondary images, the system extracts feature points from the images and compares them with ideal label feature points. These ideal feature points are obtained using a preset template or standard sample images. During the comparison, if the system detects a deviation between the die-cut label feature points and the ideal feature points, it calculates the die-cutting error. The magnitude of the die-cutting error directly affects the quality and accuracy of the labels; therefore, this analysis process is crucial.
[0102] If the calculated die-cutting error exceeds the set quality threshold, meaning the error exceeds the predetermined allowable range, the system will initiate an adjustment of the control signal generation parameters. At this point, the system will return to the previous steps, optimizing the control algorithm to adjust the control signals during the die-cutting process to reduce errors and ensure that the accuracy of subsequent labels meets requirements. The quality threshold is set based on specific production requirements and label specifications, typically taking into account factors such as label size, shape tolerances, and production efficiency.
[0103] All quality monitoring data is recorded in the database and used for subsequent statistical process control and predictive maintenance. By accumulating and analyzing historical data, the system can monitor quality fluctuation trends in the die-cutting process in real time, providing a basis for production optimization. Specifically, the system calculates the average and standard deviation of die-cutting errors; these statistics help assess the stability and accuracy of the current production line.
[0104] If the standard deviation of the error continues to increase, it indicates that a systemic problem may have occurred during the die-cutting process. The system will trigger a maintenance alarm based on preset standards, prompting operators to perform timely maintenance and repairs. This monitoring mechanism not only prevents problems from accumulating and causing production line shutdowns, but also extends the lifespan of production equipment and reduces failure rates and downtime.
[0105] The embodiments of the present invention effectively ensure the accuracy and consistency of the label die-cutting process guided by machine vision, and continuously optimize the production process through data-driven methods, thereby improving the automation level and product quality of label production.
[0106] Example:
[0107] The application scenario is medical label manufacturing, where the label material is flexible medical tape. The die-cutting position error must be controlled within 0.1 mm to meet the high-precision medical device marking requirements. The hardware used in the implementation includes an industrial-grade camera, an ambient light sensor, a die-cutting machine (with a servo motor and ball screw), an encoder, and an embedded controller. The software uses the OpenCV library to implement image processing and control algorithms.
[0108] System initialization steps;
[0109] Before initiating the die-cutting control method, system initialization is performed. Initialization includes camera calibration and parameter settings. Camera calibration uses a standard calibration board (such as a Chessboard calibration board with a grid size of 10 mm × 10 mm). An industrial-grade camera acquires images of the calibration board at multiple locations (at least 10 different angles and distances). The image processing unit extracts the grid corner points (using OpenCV's findChessboardCorners function) and compares them with the actual coordinates in the machine coordinate system (measured by a laser tracker). The mapping relationship between the image coordinates and the machine coordinates is fitted using the least squares method to obtain the transformation matrix. The transformation matrix is a 3 × 3 matrix, in the form of:
[0110]
[0111] The matrix elements are calculated using least-squares optimization, and the objective function is to minimize the sum of squared errors between the actual and predicted coordinates. Parameter settings include importing preset label templates: ideal label images are acquired offline (using the same industrial-grade camera under standard lighting), key feature points (corner points, edge points, and center points) are extracted, and stored in an SQLite database. The initial parameters of the proportional-integral-derivative (PID) control algorithm are experimentally calibrated based on the die-cutting machine model (e.g., servo motor response time constant) and label material properties (e.g., elastic modulus): the die-cutting machine's response is tested at different offsets (0.1 mm, 0.2 mm, 0.5 mm), the adjustment time and overshoot are recorded, and the proportional, integral, and derivative coefficients are initially determined using the Ziegler-Nichols method. Then, the gradient descent method is used for fine-tuning to minimize the steady-state error.
[0112] Image acquisition steps;
[0113] An industrial-grade camera is mounted 1 meter above the conveyor belt of the die-cutting machine, covering the area where the labels pass (label size: 50 mm × 30 mm). An ambient light sensor is mounted next to the camera to monitor the lighting intensity (unit: lux) in real time. The lighting intensity data is transmitted to the camera's control unit (based on an STM32 microcontroller) via an I2C interface. The control unit calculates the exposure time based on the lighting intensity data: a preset lower threshold of 100 lux and an upper threshold of 500 lux. If the lighting intensity is below 100 lux, the exposure time is increased (the increase is calculated using linear interpolation, e.g., exposure time = base exposure time × (1 + (100 - current lighting intensity) / 100)); if the lighting intensity is above 500 lux, the exposure time is decreased (the decrease = base exposure time × (current lighting intensity - 500) / 500). The base exposure time was determined experimentally and set to 10 milliseconds under standard lighting of 200 lux. Gain adjustment is based on the average grayscale value of the image (calculated as the arithmetic mean of the grayscale values of the entire image): the target grayscale range has a lower limit of 50 and an upper limit of 200. If the average grayscale value is below 50, the gain value increases (increase = base gain × (50 - average grayscale value) / 50); if the average grayscale value is above 200, the gain value decreases (decrease = base gain × (average grayscale value - 200) / 200). The base gain is experimentally set to 1.5. Image acquisition is triggered by the encoder of the die-cutting machine: each encoder pulse corresponds to a 0.01 mm movement of the conveyor belt, and the preset acquisition point is set according to the ideal position of the label (for example, when the encoder count reaches 1000 pulses, the label enters the camera's field of view). The encoder position signal triggers camera acquisition via a GPIO interrupt, and the image is output in BMP format with a resolution set to 1024×768.
[0114] Image preprocessing steps;
[0115] The BMP image output from the image acquisition step is received and preprocessed. Grayscale conversion is performed by calculating the weighted sum of the red, green, and blue channel values for each pixel to obtain the grayscale value: the weights are pre-set based on the color characteristics of the label material. For medical labels, a white background is commonly used due to high reflectivity; therefore, the weights are set as follows: blue channel value 0.4, red channel value 0.3, and green channel value 0.3 (the optimal combination is selected by comparing contrast under different weights experimentally). Median filtering is used for denoising: the window size for median filtering is dynamically determined based on the image resolution. The initial window size is 3×3, and the noise level is calculated based on the standard deviation of the image grayscale values. If the standard deviation is higher than the noise threshold (the noise threshold is set to 20, determined by analyzing the standard deviation of multiple images under noise-free conditions), the window size is increased to 5×5. Contrast enhancement is achieved through histogram equalization: the parameters for histogram equalization are automatically calculated based on the image's grayscale distribution. First, a grayscale histogram (256 levels) is constructed, then the cumulative distribution function is calculated, and the mapping function is:
[0116]
[0117] Among them, s k It outputs grayscale values, r k It is the input grayscale value, n j is the number of pixels at grayscale level j, and N is the total number of pixels. After mapping, the grayscale values are stretched to the range of 0-255 to enhance the distinction between the label edges and the background.
[0118] Feature extraction steps;
[0119] Key feature points for the labels are extracted from the preprocessed image. The Harris corner detection algorithm first calculates the gradient of the image: the Sobel operator is used to calculate the derivatives in the horizontal and vertical directions (with a 3×3 kernel). The gradient magnitude is calculated as follows:
[0120]
[0121] Among them, G x and G yThe horizontal and vertical derivatives are used. The corner response threshold is automatically adjusted based on the average gradient magnitude: Corner response threshold = 0.01 × average gradient magnitude (the scaling factor of 0.01 is experimentally calibrated to balance the detection rate and false detection rate in test images). The Canny edge detection algorithm parameters include high and low thresholds: dynamically calculated based on the image's gradient histogram. The high threshold is the 70th percentile of the gradient histogram (i.e., the gradient value is greater than the gradient values of 70% of pixels), and the low threshold is the 30th percentile. The gradient histogram is obtained by statistically analyzing the gradient magnitudes of all pixels in the image (using a 256-level histogram). After feature extraction, key feature points are filtered: confidence is calculated based on the gradient consistency around the feature point (calculating the variance of the gradient within the 8-neighborhood of the feature point). If the variance is lower than a preset threshold (the threshold is set to 0.1, determined experimentally), the feature point is discarded.
[0122] Location calculation steps;
[0123] Based on the extracted key feature points, the offset between the actual and ideal positions of the label is calculated. Coordinate transformation uses a transformation matrix obtained from camera calibration to transform the feature point coordinates in the image coordinate system to the machine coordinate system of the die-cutting machine. The transformation matrix is applied as follows:
[0124]
[0125] Among them, (X) i ,Y i (X) represents the image coordinates. m Y m ( ) represents the mechanical coordinates. The translation offset is obtained by calculating the difference between the actual feature point center and the ideal feature point center: The ideal feature point centers are read from the template database. The rotation offset is obtained by calculating the angular difference between the polygon formed by the actual feature points and the polygon formed by the ideal feature points: the principal axis directions of the actual and ideal feature point sets are calculated using principal component analysis (obtained through the eigenvectors of the covariance matrix). Where v1 and v2 are the first principal component vectors of the actual and ideal feature point sets, respectively.
[0126] Control signal generation steps;
[0127] Based on the offset, control signals for the die-cutting machine are generated. The parameters of the proportional-integral-derivative (PID) control algorithm include proportional, integral, and derivative coefficients: the initial value for the proportional coefficient is 0.8, the initial value for the integral coefficient is 0.2, and the initial value for the derivative coefficient is 0.1 (calibrated using the Ziegler-Nichols method). The control signals include adjustments to the die-cutting machine on the X, Y, and rotary axes, calculated using the following formulas:
[0128]
[0129] Where e(t) is the current offset, Δt is the sampling time (set to 0.01 seconds), and historical offset data is stored in a circular buffer. The control signal is output in the form of digital pulses: pulse width modulation (PWM) is based on the adjustment amount, pulse width = base width × adjustment amount (the base width is experimentally set to 1 millisecond), and the frequency is set to 1 kHz.
[0130] Die-cutting execution steps;
[0131] The die-cutting machine's actuator is driven by control signals. The actuator includes a servo motor (such as the Panasonic MINASA6 series) and a ball screw (5 mm lead). The servo motor rotates according to the adjustment amount in the control signal, and the rotation angle is mapped via PID output (e.g., 1 mm adjustment corresponds to 72 degrees of motor rotation). The ball screw converts the rotational motion into linear motion. Die-cutting is synchronized with the conveyor belt movement: the die-cutting machine's controller monitors the conveyor belt speed in real time (read from the encoder, speed range 0.1-1 m / s) and adjusts the servo motor's response time accordingly. The response time is determined using a lookup table: the table stores response time values corresponding to different speeds (e.g., a speed of 0.5 m / s corresponds to a response time of 50 ms), calibrated experimentally. After die-cutting is complete, the system returns to the image acquisition step. If the offset of multiple consecutive tags (with a consecutive number threshold set to 5) exceeds the tolerance threshold (with a tolerance threshold set to 0.1 mm), an alarm is triggered and the die-cutting process is paused.
[0132] Adaptive parameter adjustment steps;
[0133] Adaptive parameter adjustments are performed in real time during the die-cutting process. Feature extraction parameters are self-adjusted by dynamically updating the thresholds for Harris corner detection and Canny edge detection based on image quality. Image quality is assessed based on image contrast (grayscale range) and noise level (grayscale standard deviation). If the contrast is below the threshold (set to 50), the intensity of histogram equalization is increased (by adjusting the slope of the mapping function). Control signal generation parameters are also self-adjusted by optimizing the coefficients of the proportional-integral-derivative control algorithm based on historical offset data. If the offset exhibits a trend (analyzed by linear regression, with an absolute slope greater than 0.01), the integral coefficient is increased (increase = 0.1 × slope). The optimization process uses recursive least squares to update parameters online, with the objective function being to minimize the sum of squared offsets.
[0134] Quality control steps;
[0135] Quality monitoring is performed after die-cutting. Secondary image acquisition uses an auxiliary industrial-grade camera (the same model as the main camera) to capture images of the die-cut labels 0.5 meters downstream of the die-cutting machine. The analysis process includes extracting feature points from the die-cut labels (using the same method as the feature extraction steps) and comparing them with ideal feature points to calculate the die-cutting error (Euclidean distance). If the die-cutting error exceeds a quality threshold (set to 0.15 mm), the control signal generation parameters are adjusted (e.g., increasing the scaling factor by 0.05). Quality monitoring data is recorded in a database for statistical process control: the mean and standard deviation of the die-cutting error are calculated (once every 100 labels). If the standard deviation continues to increase (the increment of the standard deviation is greater than 0.01 for three consecutive calculations), a maintenance alarm is triggered.
[0136] Taking the die-cutting of a medical label (50 mm × 30 mm, made of polyethylene) as an example. After system initialization, the camera acquires images triggered by the encoder. The ambient light sensor detects an illumination intensity of 150 lux, the control unit calculates an exposure time of 12 milliseconds, and a gain of 1.2. In image preprocessing, grayscale conversion uses weights (0.3, 0.3, 0.4), the median filter window is 3 × 3 (standard deviation of 15), and histogram equalization enhances contrast. Feature extraction detects 10 corner points and 20 edge points, after filtering, 8 corner points and 15 edge points are retained. Position calculation yields translational offsets of 0.05 mm on the X-axis and 0.03 mm on the Y-axis, and a rotational offset of 0.5 degrees. The control signal generates a PID output adjustment of 0.06 mm on the X-axis, 0.04 mm on the Y-axis, and 0.6 degrees on the rotation axis. During die-cutting, the servo motor adjusts the position within 50 milliseconds, and die-cutting is completed. Quality monitoring shows an error of 0.08 mm, below the threshold, and the system continues to run. The adaptive adjustment detects the offset trend and updates the integral coefficient to 0.22.
[0137] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0138] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A machine vision-guided label die-cutting control method, characterized in that, Includes the following steps: Step 1: Use an industrial-grade camera to capture images of the labels at a fixed position above the conveyor belt of the die-cutting machine. The acquisition parameters of the industrial-grade camera are dynamically adjusted according to the ambient light conditions, including exposure time and gain value. The image acquisition frequency is synchronized with the movement speed of the die-cutting machine. The position signal of the conveyor belt is output in real time through the encoder of the die-cutting machine to trigger image acquisition. Step 2: Preprocess the image acquired in Step 1. The preprocessing includes grayscale conversion, filtering and denoising, and contrast enhancement. Grayscale conversion is achieved by calculating the weighted sum of the red, green, and blue channel values of each pixel to obtain the grayscale value. Median filtering algorithm is used for filtering and denoising. Contrast enhancement is achieved through histogram equalization. Step 3: Extract key feature points of the label from the image after preprocessing in Step 2. Key feature points include corner points, edge points, and center points. Feature extraction uses the Harris corner detection algorithm combined with the Canny edge detection algorithm. Step 4: Based on the key feature points extracted in Step 3, calculate the offset between the actual position and the ideal position of the label. The offset calculation includes coordinate transformation and offset calculation. The coordinate transformation is achieved through camera calibration. The offset includes translation offset and rotation offset. Step 5: Based on the offset calculated in Step 4, generate the control signal for the die-cutting machine. The control signal generation is based on the proportional-integral-derivative control algorithm. Step 6: Based on the control signal generated in Step 5, drive the actuator of the die-cutting machine to adjust the position of the die-cutting die, and synchronize the die-cutting process with the movement of the conveyor belt.
2. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, Step 1, the dynamic adjustment process of the industrial-grade camera's acquisition parameters, includes: The exposure time is adjusted based on the real-time monitoring of the lighting intensity data by the ambient light sensor. The ambient light sensor is installed near the industrial-grade camera. The lighting intensity data is transmitted to the control unit of the industrial-grade camera through a digital interface. The control unit calculates the exposure time based on the lighting intensity data. The calculation process is as follows: if the lighting intensity is lower than the preset lower threshold, the exposure time is increased; if the lighting intensity is higher than the preset upper threshold, the exposure time is decreased. The gain value is adjusted based on the average gray value of the image. The control unit calculates the average gray value of the image. If the average gray value is lower than the lower limit of the target gray range, the gain value is increased. If the average gray value is higher than the upper limit of the target gray range, the gain value is decreased. Image acquisition is triggered by the encoder of the die-cutting machine. The encoder outputs the position signal of the conveyor belt in real time. When the position signal reaches the preset acquisition point, the industrial-grade camera triggers image acquisition. The preset acquisition point is set according to the ideal position of the label on the conveyor belt. Each pulse of the encoder corresponds to a fixed distance of conveyor belt movement. The pulse count is monitored by the controller of the die-cutting machine.
3. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, Step 2, the image preprocessing process includes: In the weighted sum calculation of grayscale conversion, the weights are preset based on the color characteristics of the label material. The weight values are determined experimentally. For label materials with high reflectivity, the weight of the blue channel value is increased, and for label materials with high absorptivity, the weight of the red channel value is increased. The median filtering algorithm is used for filtering and denoising. The window size of the median filter is dynamically determined according to the image resolution. The window size is proportional to the image resolution. The window size is adjusted by analyzing the noise level of the image. The noise level is calculated based on the standard deviation of the image gray values. If the standard deviation is higher than the noise threshold, the window size is increased. Contrast enhancement is achieved through histogram equalization. The parameters of histogram equalization are automatically calculated based on the gray-level distribution of the image. The calculation process includes constructing a gray-level histogram, calculating the cumulative distribution function, and mapping gray-level values to expand the dynamic range. The mapping function is adaptively adjusted according to the overall brightness and contrast of the image.
4. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, The feature extraction process in step 3 includes: The parameters of the Harris corner detection algorithm include a corner response threshold, which is automatically adjusted based on the gradient magnitude of the image. The gradient magnitude is obtained by calculating the derivatives of the image in the horizontal and vertical directions using the Sobel operator. The corner response threshold is proportional to the average gradient magnitude, and the scaling factor is calibrated experimentally. The parameters of the Canny edge detection algorithm include a high threshold and a low threshold. The high threshold and low threshold are dynamically calculated based on the gradient histogram of the image. The high threshold is taken as the 70th percentile value of the gradient histogram, and the low threshold is taken as the 30th percentile value of the gradient histogram. The gradient histogram is obtained by statistically analyzing the gradient magnitude of all pixels in the image. After feature extraction, key feature points are filtered. The filtering process is based on the confidence level of the feature points, which is calculated by the gradient consistency around the feature point. If the confidence level is lower than a preset threshold, the feature point is removed.
5. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, The position calculation process in step 4 includes: The coordinate transformation uses the transformation matrix obtained from camera calibration to transform the coordinates of feature points in the image coordinate system to the mechanical coordinate system of the die-cutting machine. The camera calibration process is performed during system initialization. Multiple sets of images and mechanical coordinate data are collected using a calibration board. The calibration board has a grid pattern of known size. The mapping relationship between image coordinates and mechanical coordinates is fitted using the least squares method. The transformation matrix is a 3x3 matrix. The translation offset is obtained by calculating the difference between the actual feature point center and the ideal feature point center. The actual feature point center is calculated by taking the average of the coordinates of all actual feature points, and the ideal feature point center is read from the preset label template database. The rotation offset is obtained by calculating the angle difference between the polygon formed by the actual feature points and the polygon formed by the ideal feature points. The angle difference is calculated by using principal component analysis to calculate the principal axis directions of the actual feature point set and the ideal feature point set, and then the direction difference is obtained.
6. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, Step 5, the control signal generation process, includes: The parameters of the proportional-integral-derivative control algorithm include proportional coefficient, integral coefficient, and derivative coefficient. The proportional coefficient, integral coefficient, and derivative coefficient are pre-calibrated according to the characteristics of the label material and the dynamic response characteristics of the die-cutting machine. The calibration process is carried out through experiments, testing the response of the die-cutting machine at different offsets, and optimizing the control parameters based on the response data. The control signals include the adjustment amount of the die-cutting machine on the X-axis, Y-axis and rotary axis. The adjustment amount is calculated by the proportional-integral-derivative control algorithm. The calculation formula is that the adjustment amount is equal to the proportional coefficient multiplied by the offset, plus the integral coefficient multiplied by the offset, plus the derivative coefficient multiplied by the offset. The integral and derivative calculations are based on historical offset data. The control signal is output to the actuator of the die-cutting machine in the form of digital pulses. The width and frequency of the digital pulses are dynamically adjusted according to the magnitude of the adjustment to ensure precise control.
7. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, Step 6, the die-cutting process includes: The actuator includes a servo motor and a ball screw. The servo motor rotates according to the adjustment amount in the control signal, and the ball screw converts the rotational motion into linear motion, thereby moving the die-cutting die. The die-cutting process is synchronized with the movement of the conveyor belt. The controller of the die-cutting machine monitors the speed of the conveyor belt in real time. The speed data is read from the encoder, and the response time of the servo motor is adjusted according to the speed. The response time is determined by a lookup table, which stores the response time values corresponding to different speeds. After die-cutting is completed, the system returns to step 1 to process the next label. If the offset of multiple consecutive labels exceeds the tolerance threshold, an alarm is triggered and the die-cutting process is paused. The tolerance threshold is set according to the size and accuracy requirements of the label.
8. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, It also includes system initialization steps: The system initialization steps are performed before the die-cutting control method is started, including camera calibration and parameter settings; Camera calibration uses a standard calibration board with a grid pattern of known size. An industrial-grade camera captures images of multiple positions on the calibration board. The image processing unit extracts the grid corner points and compares them with the actual coordinates in the machine coordinate system. The transformation matrix from image coordinates to machine coordinates is calculated using the least squares method. The parameter settings include importing a preset label template, which is generated by offline acquisition of ideal label images and extraction of key feature points, and stored in the database. At the same time, the initial parameters of the proportional-integral-derivative control algorithm are set. The initial parameters are determined experimentally based on the model of the die-cutting machine and the common types of label materials.
9. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, It also includes an adaptive parameter tuning step: The adaptive parameter adjustment step is executed in real time during the die-cutting process, dynamically adjusting the feature extraction and control signal generation parameters according to the deformation of the label material and environmental changes. The self-adjustment of feature extraction parameters includes dynamically updating the thresholds for Harris corner detection and Canny edge detection based on image quality. Image quality is evaluated based on the image's contrast and noise level. If the contrast is below the threshold, the intensity of histogram equalization is increased. The self-adjustment of the control signal generation parameters includes optimizing the coefficients of the proportional-integral-derivative control algorithm based on historical offset data. If the offset shows a trend change, the integral coefficient is increased to reduce the steady-state error. The optimization process uses the recursive least squares method to update the parameters online.
10. The machine vision-guided label die-cutting control method as described in claim 1, characterized in that, It also includes quality control steps: The quality monitoring step is performed after die-cutting, and the die-cutting quality is checked through secondary image acquisition and analysis; Secondary image acquisition uses an auxiliary industrial-grade camera to capture images of the die-cut labels downstream of the die-cutting machine. The parameters of the auxiliary industrial-grade camera are the same as those of the main industrial-grade camera. The analysis process includes extracting the feature points of the die-cut labels and comparing them with the ideal feature points, calculating the die-cutting error, and adjusting the control signal generation parameters in step 5 if the die-cutting error exceeds the quality threshold. The quality threshold is set according to production requirements. Quality monitoring data is recorded in a database for statistical process control and predictive maintenance. Statistical process control includes calculating the average and standard deviation of die-cutting errors and triggering maintenance alarms if the standard deviation continues to increase.