Method for correcting and calibrating deviation of cutting indentation knife through indentation recognition and cutting machine
By using an indentation recognition method, the camera and motor system on the cutting machine are used to segment the indentation image into pixel blocks, calculate the gradient matrix and feature vector, construct a label matrix and grayscale mapping table, identify indentation deviations, and adjust the position of the indentation knife. This solves the problem of inaccurate cutting position of the indentation knife and achieves precise cutting and efficient deviation correction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SAGA COMPUTER NUMERICAL CONTROL CO LTD
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-12
AI Technical Summary
The varying surface gloss of different batches of packaging materials affects the clarity of the indentation images, resulting in unclear features and impacting the accuracy of the indentation cutter's position and the efficiency of correction.
By using an indentation recognition method, the camera and motor system on the cutting machine are used to segment the indentation image into pixel blocks, calculate the gradient matrix and feature vector, construct a label matrix and grayscale mapping table, identify indentation deviations, and adjust the position of the indentation knife to achieve precise cutting.
It improves the accuracy of the embossing knife's cutting position and the efficiency of correction, ensuring embossing precision and consistency, and enhancing cutting quality and efficiency.
Smart Images

Figure CN122008338A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to a method and cutting machine for correcting and calibrating a cutting crease knife through crease recognition. Background Technology
[0002] The creasing cutter, also known as a creasing line or die cutter, is one of the key components of the die-cutting die plate. It is not used for cutting, but rather uses the powerful stamping pressure on the die-cutting machine to press precise grooves or marks into materials such as cardboard, leather, or plastic. The core function of this creasing is to provide a pre-set, structural weak line for subsequent precise bending, thereby ensuring that products such as packaging boxes, greeting cards, and notebook covers can be folded into straight, flat, and sharp corners along the predetermined position, greatly improving the product's aesthetics and forming stability.
[0003] In the process of acquiring indentation images, the different surface gloss levels of packaging materials from different batches affect the clarity of the captured indentation images. Multiple indentations together make the features indistinct. For example, some high-gloss materials reflect light, causing reflective areas in the indentation images captured by the camera, obscuring some indentation details and affecting subsequent feature extraction. Consequently, the unclear image texture features lead to inaccurate cutting positions of the indentation knife, resulting in inaccurate extraction of indentation deviation values and low efficiency in correcting the indentation knife. Summary of the Invention
[0004] The purpose of this invention is to solve the problem of inaccurate correction of the cutting position of the crease knife due to insufficient ability to extract texture features of crease images, and to propose a cutting machine and a cutting machine for crease knife correction and calibration through crease recognition.
[0005] In a first aspect of this invention, a method for correcting and calibrating a cutting and creasing knife through indentation recognition is first proposed. The cutting machine includes a carriage, a blade control machine, and a rotating blade. The blade control machine includes a detection and adjustment motor and an x-axis motor, both of which are connected to the carriage. A camera is installed on the carriage. The detection and adjustment motor drives the carriage to move left and right. The blade control machine includes a lead screw, which is located at the same x-coordinate 0 point as the reference axis of the rotating blade. The x-axis motor is equipped with an indentation knife. The method is characterized by comprising: Step 1: Obtain the correction request command and control the creasing knife to start creasing on the paper; first, control the creasing knife on the x-axis motor to press out the first creasing on the x-axis of the paper. After the first creasing operation is completed, control the x-axis motor to move a preset distance radially along the first creasing and then rotate 180° to press out the second creasing in the opposite direction of the first creasing. Step 2: Preset the indentation interval in the database, define the first indentation and the second indentation along the x-axis as a group of indentations, control the detection and adjustment motor to drive the carriage to move left and right, and press out a preset number of groups of indentations on the x-axis of the paper according to the preset indentation interval, and label each group of indentations with positive and negative values. Step 3: Identify and compare multiple sets of indentations along the x-axis, and identify the indentation sequence with small spacing within the same group; the identification result includes the positive and negative value sequence between the first and second indentations in each set of indentation images of a preset number of groups; Step 4: Obtain the specific index value of the positive and negative values, and adjust the indentation tool to perform the indentation operation according to the specific index value.
[0006] Optionally, the equipment on the cutting machine is used for: The indentation tool is configured to perform indentation operations based on control signals. The x-axis motor is configured to drive the indentation tool to move along the x-axis direction to perform the indentation operation; The motor is tested and adjusted to adjust the position of the carriage according to the preset indentation interval, thereby adjusting the indentation interval of the indentation knife; The image recognition module is configured to process the indentation image and identify indentation deviations; The control system is configured to adjust the position of the indentation tool according to the indentation deviation parameter to achieve precise indentation.
[0007] Optionally, controlling the x-axis motor to perform indentation includes: The reverse pressing process of the first and second indentations is achieved by bidirectional drive of the same x-axis motor. After receiving the pulse signal, the motor control unit first rotates forward a set number of times to drive the indentation knife to complete the first indentation, and then rotates in the reverse direction for the same or different number of times to complete the second indentation.
[0008] Optionally, multiple sets of indentations along the x-axis are identified, including: Obtain the original image of the indentation, uniformly divide the original image into multiple non-overlapping pixel blocks, and calculate the gradient matrix for the target pixel block; the target pixel block is any one of the multiple pixel blocks. The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data. The feature vector of each pixel block is then input into the classification model to output the classification label of each pixel block. The classification label includes simple pixel blocks and non-simple pixel blocks. A label matrix is constructed based on the classification labels, and a grayscale mapping table is calculated using the label matrix and grayscale data; the grayscale mapping table includes a simple region grayscale mapping table and a non-simple region grayscale mapping table. The correction mapping table for each pixel block is calculated using the label matrix and the grayscale mapping table. The correction mapping table for each pixel block is then filled into the corresponding position of the pixel block in the initial matrix to obtain the mapping table matrix. The enhanced image is calculated based on the mapping table matrix and grayscale data.
[0009] Optionally, the feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data, including: The original image is uniformly divided into multiple non-overlapping pixel blocks of size M×N; The horizontal and vertical gradients of the target pixel block are obtained by applying horizontal and vertical operators to the target pixel block through convolution operations. The horizontal gradient and the vertical gradient are combined to obtain a gradient value, and the gradient values are arranged according to their coordinates in the pixel block to obtain a gradient matrix. The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data, including: The gradient average is obtained by averaging the gradient values in the gradient matrix of the target pixel block, and the gradient standard deviation is calculated based on the gradient average. The first grayscale mean is calculated based on the grayscale data, and the first grayscale standard deviation is calculated based on the first grayscale mean. The feature vector is obtained by performing feature normalization on the average gradient, the standard deviation of the gradient, and the standard deviation of the first gray level.
[0010] Optionally, before inputting the feature vector of each pixel block into the classification model to output the classification label of each pixel block, the training process of the classification model includes: Obtain a training dataset, input the training dataset into a preset model for training to obtain model update parameters, and update the model parameters in the preset model according to the model update parameters to obtain a classification model; Obtain the verification dataset, input the verification data into the classification model to obtain the verification labels, and calculate the similarity between the verification labels and the true labels to obtain the deviation value; If the deviation value is greater than the deviation threshold, the classification model is deemed unqualified and iterative training is re-executed until the preset conditions are met; otherwise, the classification model is deemed qualified. The verification dataset contains verification data and real labels, and the verification data corresponds one-to-one with the real labels.
[0011] Optionally, a grayscale mapping table is calculated based on the label matrix and the grayscale data, including: Construct a zero matrix, iterate through each pixel block, and if the pixel block is classified as a simple pixel block, set the corresponding element in the zero matrix to 1; if the label is a non-simple pixel block, keep it unchanged, and then obtain the label matrix. Traverse the label matrix. For each simple region label: scan all pixel blocks. If a pixel block is labeled as a simple region label and there is a pixel block labeled as a simple region label in its 8-neighborhood, then mark the pixel block as a non-simple region label to obtain a composite region containing labels L and -L. The simple region label is L, and the non-simple region label is -L. Extract the gray values of all pixel blocks within the composite region, calculate the second gray mean based on the gray values of all pixel blocks within the composite region, and calculate the second gray standard deviation based on the second gray mean. The upper and lower limits of grayscale are calculated based on the second grayscale mean and the second grayscale standard deviation, and the minimum and maximum grayscale values of the pixel blocks in the composite region are obtained. The grayscale range is adjusted based on the upper grayscale limit, lower grayscale limit, minimum grayscale value, and maximum grayscale value, and a grayscale mapping table is calculated based on the grayscale range.
[0012] Optionally, a corrected mapping table for each pixel block is calculated using the label matrix and the grayscale mapping table, including: A grayscale vector is constructed based on the bit width of the original image. A mapped grayscale value is calculated for each grayscale value in the grayscale vector according to the grayscale range. A simple region grayscale mapping table is obtained based on the mapped grayscale value. For each non-simple pixel block, count the occurrences of all its pixels at each gray level to obtain the histogram of the non-simple pixel block; The grayscale mapping function is calculated based on the preset mapping value and the original histogram. The grayscale mapping function is used as the average background brightness of the corresponding grayscale level to diagnose the JND threshold. The clipping threshold of the histogram for each grayscale level k is calculated based on the JND threshold. If the histogram of the non-simple pixel block is compared with the cropping threshold and the preset conditions are met, the histogram is used as the gray-level mapping table of the non-simple region. Traverse the label matrix, identify all pixel blocks with negative labels as transition pixel blocks, and record their positions in the label matrix; Extract the 3×3 neighborhood of each transition pixel block and collect the grayscale mapping table of all pixel blocks in the neighborhood; The correction mapping table for the transition pixel block is calculated based on the grayscale mapping table of all pixel blocks in the 3×3 neighborhood.
[0013] Optionally, the enhanced image is calculated based on the mapping table matrix and grayscale data, including: For the gray value of each pixel block in the original image, determine its four neighboring pixel blocks and obtain the gray value mapping table corresponding to these four pixel blocks in the mapping table matrix; The interpolated gray level of the pixel block is calculated based on the gray level mapping table corresponding to the four pixel blocks in the mapping table matrix. Perform a 3×3 mean filter on each pixel block in the original image to obtain the filtered gray value, and use this gray value as the gray value of the original image at that location; Based on the interpolated grayscale and the filtered grayscale values, the grayscale values of each pixel block are traversed and stitched together to obtain the enhanced image.
[0014] Optionally, adjusting the indentation tool to perform the indentation operation according to the specific index value includes: Based on the specific index value of the positive and negative values, calculate the deviation compensation value of the indentation tool in the x-axis direction; The deviation compensation value is converted into a pulse compensation value for the x-axis motor; the pulse compensation value is calculated by a PID control algorithm, and the input of the PID control algorithm is the difference between the specific index value and the preset target value; The x-axis motor is controlled to adjust the moving distance of the indentation tool according to the pulse compensation value, so as to achieve the correction and calibration of the indentation tool.
[0015] The beneficial effects of this invention are: This invention proposes a method for correcting and calibrating a crease cutter through crease recognition. The method involves segmenting the original crease image into pixel blocks, calculating the gradient matrix to highlight edge and texture features, identifying different feature regions through feature vector extraction and classification models, constructing a label matrix and generating a grayscale mapping table, optimizing image contrast and enhancing detail and texture features, and improving detail contrast and image naturalness while suppressing over-enhancement. The resulting enhanced image accurately identifies crease features. Based on multiple crease images, the method extracts the set of deviation parameters with the smallest deviation interval to correct the crease cutter, improving the system's crease cutter correction efficiency and making the calibrated crease cutter's cutting position more accurate. Attached Figure Description
[0016] The invention will now be further described with reference to the accompanying drawings.
[0017] Figure 1 A flowchart illustrating a method for correcting and calibrating a cutting and creasing knife through indentation recognition, provided in an embodiment of the present invention; Figure 2 This is a comparison image of the indentation pattern of a cutting indentation knife correction and calibration method based on indentation recognition, provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and B can represent: A alone, A and B simultaneously, and B alone. Furthermore, descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" can explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0019] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] This invention provides a method for calibrating and correcting a cutting crease knife through crease recognition. The cutting machine includes a carriage, a blade control unit, and a rotating blade. The blade control unit includes a detection and adjustment motor and an x-axis motor, both connected to the carriage. A camera is mounted on the carriage. The detection and adjustment motor drives the carriage to move left and right. The blade control unit includes a lead screw, which is located at the same x-coordinate 0 point as the reference axis of the rotating blade. The x-axis motor is equipped with the crease knife. See also... Figure 1 , Figure 1 This is a flowchart illustrating a method for correcting and calibrating a cutting and creasing knife through creasing recognition, provided in an embodiment of the present invention. The method includes the following steps: S101, Obtain the correction request command and control the creasing knife to start creasing on the paper; First, control the creasing knife on the x-axis motor to press out the first creasing on the x-axis of the paper. After the first creasing operation is completed, control the x-axis motor to move a preset distance radially along the first creasing and then rotate 180° to press out the second creasing in the opposite direction of the first creasing. S102, preset the indentation interval in the database, define the first and second indentations along the x-axis as a group of indentations, control the detection and adjustment motor to drive the carriage to move left and right, and press out a preset number of groups of indentations on the x-axis of the paper according to the preset indentation interval, and label each group of indentations with positive and negative values. S103, identify and compare multiple sets of indentations along the x-axis, and identify the identification results of the indentation sequence with small spacing in the same group; S104: Obtain the specific label value of the positive and negative values, and adjust the indentation tool to perform the indentation operation according to the specific label value.
[0021] The recognition results include the positive and negative value sequence between the first and second indentations in each group of indentation images of a preset number of groups.
[0022] This invention provides a method for correcting and calibrating a cutting and creasing knife through indentation recognition. This method achieves orderly indentation by precisely controlling a motor and generating indentation groups in batches at preset intervals. Through camera acquisition and algorithm recognition, the indentation deviation distance is accurately obtained. Using the minimum deviation as the control criterion, indentation accuracy and consistency can be significantly improved. By identification and comparison, the indentation sequence within the same group with smaller intervals is determined, reducing indentation errors. Simultaneously, relying on a database and real-time control, the method accurately corrects the indentation knife's deviation, improving indentation efficiency.
[0023] In one implementation, the original image is acquired using an industrial camera.
[0024] In one implementation, the correction principle includes: evenly distributing a set of offset + deviation trajectory data within a certain area according to horizontal and vertical placement. This set of offset + deviation trajectory data is as follows: Horizontal placement: X = 9 + 0.09; 8 + 0.08; 7 + 0.07; 6 + 0.06; 5 + 0.06; 4 + 0.04; 3 + 0.03; 2 + 0.02; 1 + 0.01; 0 - 0.00; -1 - 0.01; -2 - 0.02; -3 - 0.03; -4 - 0.04; -5 - 0.05; -6 - 0.06; -7 - 0.07; -8 - 0.08; -9 - 0.09; Another set of offset + no The deviation data are as follows: Horizontal placement X = 9 + 0.00; 8 + 0.00; 7 + 0.00; 6 + 0.00; 5 + 0.00; 4 + 0.00; 3 + 0.00; 2 + 0.00; 1 + 0.00; 0 - 0.00; -1 - 0.00; -2 - 0.00; -3 - 0.00; -4 - 0.00; -5 - 0.00; -6 - 0.00; -7 - 0.00; -8 - 0.00; -9 - 0.00; Vertical placement: Y = 9 + 0.09; 8 + 0.08; 7 + 0.07; 6 + 0.06; 5 + 0.05; 4 + 0.04; 3 + 0.03; 2 + 0.02; 1 + 0.01; 0 - 0.00; -1 - 0.01; -2 - 0.02; -3 - 0.03; -4 - 0.04; -5 - 0.05; -6 - 0.06; -7 - 0.07; -8 - 0.08; -9 - 0.09; Another set of offset + no The deviation data are as follows: for vertical placement, Y = 9 + 0.00; 8 + 0.00; 7 + 0.00; 6 + 0.00; 5 + 0.00; 4 + 0.00; 3 + 0.00; 2 + 0.00; 1 + 0.00; 0 - 0.00; -1 - 0.00; -2 - 0.00; -3 - 0.00; -4 - 0.00; -5 - 0.00; -6 - 0.00; -7 - 0.00; -8 - 0.00; -9 - 0.00.
[0025] In one implementation, see [link to implementation details]. Figure 2 , Figure 2 This invention provides an indentation comparison diagram of a method for correcting and calibrating a cutting indentation knife through indentation recognition, as provided in an embodiment of the invention. The left side shows the second indentation, and the right side shows the first indentation. When a tool has a deviation of +0.05, there must be a trajectory line that coincides (aligns) with the trajectory line without deviation. In practice, this should be the trajectory line of the offset + deviation data (5 - 0.05) and the offset + no deviation data (5 + 0.00). The comparison method is the same for horizontal and vertical placement. Then, based on the deviation data and direction, the correction parameter -0.05 is input to the corresponding position in the equipment's correction system. After confirmation, the equipment will complete the correction process for the tool with a deviation of +0.05, correcting the tool deviation to zero.
[0026] In one embodiment, the device on the cutting machine is used for: The indentation tool is configured to perform indentation operations based on control signals. The x-axis motor is configured to drive the indentation tool to move along the x-axis direction to perform the indentation operation; The motor is tested and adjusted to adjust the position of the carriage according to the preset indentation interval, thereby adjusting the indentation interval of the indentation knife; The image recognition module is configured to process the indentation image and identify indentation deviations; The control system is configured to adjust the position of the indentation tool according to the indentation deviation parameter to achieve precise indentation.
[0027] In one implementation, the system integrates an indentation knife, an X-axis motor, a detection and adjustment motor, a camera, an image recognition module, and a control system to work together to achieve precise indentation. The control system adjusts the position of the indentation knife in real time based on the deviation recognition results of the image recognition module to ensure accurate and consistent indentation, thereby improving cutting quality and efficiency.
[0028] In one embodiment, controlling the x-axis motor to perform indentation includes: The reverse pressing process of the first and second indentations is achieved by bidirectional drive of the same x-axis motor. After receiving the pulse signal, the motor control unit first rotates forward a set number of times to drive the indentation knife to complete the first indentation, and then rotates in the reverse direction for the same or different number of times to complete the second indentation.
[0029] In one implementation, the first and second indentations are applied in opposite directions by rotating the same x-axis motor in both directions. After receiving the pulse signal, the motor control unit precisely controls the number of rotations of the motor in both directions to ensure accurate and symmetrical indentation, thereby improving indentation efficiency and quality. The time interval between the two indentations is controlled within the range of 50-200 milliseconds to ensure the detectability and adjustability of the indentation position relationship.
[0030] In one embodiment, identifying multiple sets of indentations along the x-axis includes: Obtain the original image of the indentation, divide the original image into multiple non-overlapping pixel blocks, and calculate the gradient matrix for the target pixel block; the target pixel block is any one of the multiple pixel blocks. The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data. The feature vector of each pixel block is then input into the classification model to output the classification label of each pixel block. The classification label includes simple pixel blocks and non-simple pixel blocks. A label matrix is constructed based on the category labels, and a grayscale mapping table is calculated using the label matrix and grayscale data; the grayscale mapping table includes simple region grayscale mapping tables and non-simple region grayscale mapping tables; The correction mapping table for each pixel block is calculated using the label matrix and the grayscale mapping table. The correction mapping table for each pixel block is then filled into the corresponding position of the pixel block in the initial matrix to obtain the mapping table matrix. The enhanced image is calculated based on the mapping table matrix and grayscale data.
[0031] In one implementation, the original image is segmented into pixel blocks, the gradient matrix and feature vector are calculated, the labels are output by the classification model, a label matrix is constructed and a grayscale mapping table is generated, and finally the mapping table is filled and corrected to form an enhanced image, which improves image details and contrast, effectively improves the efficiency of indentation feature recognition, and facilitates the quick finding of the set of deviation parameters with the smallest deviation among multiple sets of indentations.
[0032] In one embodiment, the feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data, including: The original image is uniformly divided into multiple non-overlapping pixel blocks of size M×N; The horizontal and vertical gradients of the target pixel block are obtained by applying horizontal and vertical operators to the target pixel block through convolution operations. The horizontal and vertical gradients are combined to obtain the gradient value, and the gradient values are arranged according to their coordinates in the pixel block to obtain the gradient matrix. The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data, including: The gradient average is obtained by averaging the gradient values in the gradient matrix of the target pixel block, and the gradient standard deviation is calculated based on the gradient average. The first grayscale mean is calculated based on the grayscale data, and the first grayscale standard deviation is calculated based on the first grayscale mean. Feature vectors are obtained by performing feature normalization on the gradient mean, gradient standard deviation, and first gray standard deviation.
[0033] In one implementation, the horizontal and vertical gradients of the target pixel block are obtained through convolution operations. The calculation process is as follows: ; in, and These represent the horizontal gradient and the vertical gradient, respectively. and Let I represent the horizontal operator and the vertical operator, respectively, where I is the target pixel block and G is the gradient value.
[0034] In one implementation, the calculation process for the gradient mean, gradient standard deviation, and first grayscale standard deviation is as follows: ; in, This is the average value. For the gradient standard deviation, Let M be the first grayscale standard deviation, and M and N be the height and width of the target pixel block, respectively. This represents the gradient value of the target pixel block at position (i,j). This represents the grayscale value of the target pixel block at position (i,j).
[0035] In one implementation, the original image is divided into multiple pixel blocks of size M×N. Horizontal and vertical operators are applied to the target pixel blocks to perform convolution operations, obtaining horizontal and vertical gradients respectively. Then, these two gradients are merged into a gradient value and arranged according to the coordinates within the pixel block to form a gradient matrix, thereby highlighting the edge and texture features of the image.
[0036] In one implementation, the gradient matrix of the target pixel block is averaged and its standard deviation is calculated. The grayscale mean and standard deviation are then calculated by combining the grayscale data. Feature vectors are generated through feature normalization, which effectively characterizes the edge and texture features of the image and improves the efficiency of image analysis and processing.
[0037] In one embodiment, before inputting the feature vector of each pixel block into the classification model to output the classification label of each pixel block, the training process of the classification model includes: Obtain the training dataset, input the training dataset into the preset model to train and obtain the model update parameters, and update the model parameters in the preset model according to the model update parameters to obtain the classification model; Obtain the validation dataset, input the validation data into the classification model to obtain the validation labels, and calculate the similarity between the validation labels and the true labels to obtain the deviation value; If the deviation value is greater than the deviation threshold, the classification model is deemed unqualified and iterative training is re-executed until the preset conditions are met; otherwise, the classification model is deemed qualified. The validation dataset contains validation data and real labels, and the validation data corresponds one-to-one with the real labels.
[0038] In one implementation, the public dataset is divided into a training dataset (70%) and a validation dataset (30%). The default model is an SVM model. The core basis for model classification is obtained by updating the two parameters of the default model: the plane normal vector and the intercept, ensuring accurate classification of pixel blocks. The plane normal vector is the quantified weight of feature importance and corresponds to the key basis for pixel block classification. The intercept is the offset of the classification threshold, a compensation factor that balances the distribution of the two classes of samples and determines the final class assignment of the sample. The default condition is that the deviation value is not greater than the deviation threshold, which is set based on experimental data.
[0039] In one implementation, the model parameters are updated using the training dataset to obtain the classification model. Then, the deviation between the validation label and the true label is calculated using the validation dataset. If the deviation is greater than a threshold, the model is retrained to ensure the accuracy of the classification model output.
[0040] In one embodiment, a grayscale mapping table is calculated based on the label matrix and grayscale data, including: Construct a zero matrix, iterate through each pixel block, and if the pixel block is classified as a simple pixel block, set the corresponding element in the zero matrix to 1; if the label is a non-simple pixel block, keep it unchanged, and then obtain the label matrix. Traverse the label matrix. For each simple region label: scan all pixel blocks. If a pixel block is labeled as a simple region label and there is a pixel block labeled as a simple region label in its 8-neighborhood, then mark the pixel block as a non-simple region label to obtain a composite region containing labels L and -L; the simple region label is L, and the non-simple region label is -L. Extract the gray values of all pixel blocks within the composite region, calculate the second gray mean based on the gray values of all pixel blocks within the composite region, and calculate the second gray standard deviation based on the second gray mean. The upper and lower limits of grayscale are calculated based on the second grayscale mean and the second grayscale standard deviation, and the minimum and maximum grayscale values of the pixel blocks in the composite region are obtained. The grayscale range is adjusted based on the upper grayscale limit, lower grayscale limit, minimum grayscale value, and maximum grayscale value, and a grayscale mapping table is calculated based on the grayscale range.
[0041] In one implementation, by integrating scattered small smoothing units into large smoothing regions, over-enhancement is suppressed, efficiency is improved, block effects are avoided, and the effect of natural enhancement of smoothing regions and clear prominence of detail regions is achieved.
[0042] In one implementation, the second grayscale standard deviation is calculated using the second grayscale mean, including: ; in, The second grayscale mean. The second grayscale standard deviation, This is the upper limit of grayscale. S represents the lower limit of grayscale, and S represents the composite region. This represents the total number of pixels within the composite region. is the grayscale value at pixel block (i,j) within the composite region.
[0043] In one implementation, a composite region of simple and non-simple pixel blocks is identified by traversing the label matrix. By analyzing the gray values of pixel blocks within the composite region, the mean and standard deviation of the second gray level are calculated to determine the upper and lower limits of the gray level and generate a gray-level mapping table. This helps to optimize the gray-level adjustment of the image and improve image contrast and detail.
[0044] In one embodiment, the correction mapping table for each pixel block is calculated using the label matrix and the grayscale mapping table, including: A grayscale vector is constructed based on the bit width of the original image. A mapped grayscale value is calculated for each grayscale value in the grayscale vector according to the grayscale range. A simple region grayscale mapping table is obtained based on the mapped grayscale value. For each non-simple pixel block, count the occurrences of all its pixels at each gray level to obtain the histogram of the non-simple pixel block; The grayscale mapping function is calculated based on the preset mapping value and the original histogram. The grayscale mapping function is used as the average background brightness of the corresponding grayscale level to diagnose the JND threshold. The clipping threshold of the histogram for each grayscale level k is calculated based on the JND threshold. If the histogram of the non-simple pixel block is compared with the cropping threshold and the preset conditions are met, the histogram is used as the gray-level mapping table of the non-simple region. Traverse the label matrix, identify all pixel blocks with negative labels as transition pixel blocks, and record their positions in the label matrix; Extract the 3×3 neighborhood of each transition pixel block and collect the grayscale mapping table of all pixel blocks in the neighborhood; The correction mapping table for the transition pixel block is calculated based on the grayscale mapping table of all pixel blocks in the 3×3 neighborhood.
[0045] In one implementation, the calculation process for a simple region grayscale mapping table is as follows: ; in, For a simple region grayscale mapping table, and These are the maximum and minimum gray values, respectively, and I represents the gray vector; The clipping threshold of the histogram for each gray level k is calculated based on the JND threshold. The process is as follows: ; in, The cropping threshold, This is the grayscale mapping function. For histograms, The total number of pixels in the pixel block. The visibility threshold, representing the background grayscale value of 0, is determined based on experimental data. The slope of the grayscale mapping function when the background brightness is high; According to the histogram Recalculate the grayscale mapping function Until , at this time As a non-simple region grayscale mapping table .
[0046] In one implementation, a grayscale vector is constructed and a simple region grayscale mapping table is generated. Histograms are statistically analyzed for non-simple pixel blocks. A grayscale mapping function is calculated based on the mapping values and histograms. A cropping threshold is determined by combining the JND threshold, and a non-simple region grayscale mapping table is generated. This effectively optimizes the grayscale range and improves image contrast and detail.
[0047] In one implementation, the process of calculating the modified mapping table is as follows: ; in, This is a correction mapping table for the transition pixel block (i,j). For the field Number of inner pixel blocks This represents the grayscale mapping table of the pixel block at neighborhood coordinates (p, q).
[0048] In one implementation, to avoid the block effect caused by the drastic change in grayscale of transitional pixel blocks (pixel blocks between simple and non-simple regions) due to the direct use of a single mapping table, a smooth transition of grayscale between regions is achieved by fusing neighborhood mapping tables, thereby improving the naturalness of image enhancement.
[0049] In one embodiment, the enhanced image is calculated based on the mapping table matrix and grayscale data, including: For the gray value of each pixel block in the original image, determine its four neighboring pixel blocks and obtain the gray value mapping table corresponding to these four pixel blocks in the mapping table matrix; The interpolated gray level of the pixel block is calculated based on the gray level mapping table corresponding to the four pixel blocks in the mapping table matrix. Perform a 3×3 mean filter on each pixel block in the original image to obtain the filtered gray value, and use this gray value as the gray value of the original image at that location; The enhanced image is obtained by traversing and stitching together the gray values of each pixel block based on the interpolated gray values and the filtered gray values.
[0050] In one implementation, A, B, C, and D are four adjacent pixel blocks, with A being the top-left sub-block, B the top-right sub-block, C the bottom-left sub-block, and D the bottom-right sub-block. The enhanced grayscale value calculation process is as follows: ; in, This represents the interpolated gray level at (i,j). Let (i,j) represent the enhanced grayscale value at (i,j), and x and y represent the normalized horizontal and vertical distances from the pixel to pixel block A. and This is represented as a grayscale mapping table of 4 pixel blocks in a mapping table matrix. The enhancement factor was set based on experimental data. This represents the filtered gray value at (i,j).
[0051] In one implementation, an enhanced image is generated by determining the grayscale mapping table of each pixel block and its neighboring blocks, calculating the interpolated grayscale, performing a 3×3 mean filter on the original image, and combining the interpolated grayscale and the filtered grayscale value, thereby effectively improving image quality and feature recognition accuracy.
[0052] In one embodiment, controlling the indentation tool to perform the indentation operation according to a specific index value includes: Calculate the deviation compensation value of the indentation tool in the x-axis direction based on the specific label value of the positive and negative values; The deviation compensation value is converted into the pulse compensation value of the x-axis motor; the pulse compensation value is calculated by the PID control algorithm, and the input of the PID control algorithm is the difference between the specific index value and the preset target value; The x-axis motor is controlled to adjust the moving distance of the indentation tool according to the pulse compensation value, so as to achieve the correction and calibration of the indentation tool.
[0053] In one implementation, the control system uses an incremental PID algorithm, based on current and historical deviation values. and preset proportional coefficient Integral coefficient Differential coefficients Calculate the pulse compensation amount The calculation process is as follows: The updated total pulse compensation value is: in, This is the total pulse compensation value that needs to be output in the current cycle.
[0054] In one implementation, the indentation tool is adjusted according to the serial number value, the x-axis deviation compensation value is calculated and converted into a pulse compensation value, and the pulse output of the x-axis motor is precisely adjusted by a PID control algorithm to achieve precise correction of the indentation tool. This improves indentation accuracy and quality, ensuring production efficiency and product consistency.
[0055] The foregoing has described one embodiment of the present invention in detail, but this content is merely a preferred embodiment and should not be considered as limiting the scope of the present invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the scope of the claims of this invention.
Claims
1. A method for correcting and calibrating a cutting and creasing knife through indentation recognition, wherein the cutting machine includes a carriage, a blade control machine, and a rotating blade, the blade control machine includes a detection and adjustment motor and an x-axis motor, both of which are connected to the carriage, a camera is mounted on the carriage, the detection and adjustment motor drives the carriage to move left and right, the blade control machine includes a lead screw, the lead screw and the reference axis of the rotating blade are located at the same x-coordinate 0 point, and the x-axis motor is equipped with an indentation knife, characterized in that... The method includes: Step 1: Obtain the correction request command and control the creasing knife to start creasing on the paper; first, control the creasing knife on the x-axis motor to press out the first creasing on the x-axis of the paper. After the first creasing operation is completed, control the x-axis motor to move a preset distance radially along the first creasing and then rotate 180° to press out the second creasing in the opposite direction of the first creasing. Step 2: Preset the indentation interval in the database, define the first indentation and the second indentation along the x-axis as a group of indentations, control the detection and adjustment motor to drive the carriage to move left and right, and press out a preset number of groups of indentations on the x-axis of the paper according to the preset indentation interval, and label each group of indentations with positive and negative values. Step 3: Identify and compare multiple sets of indentations along the x-axis, and identify the indentation sequence with small spacing within the same group; the identification result includes the positive and negative value sequence between the first and second indentations in each set of indentation images of a preset number of groups; Step 4: Obtain the specific index value of the positive and negative values, and adjust the indentation tool to perform the indentation operation according to the specific index value.
2. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 1, characterized in that, The equipment on the cutting machine is used for: The indentation tool is configured to perform indentation operations based on control signals. The x-axis motor is configured to drive the indentation tool to move along the x-axis direction to perform the indentation operation; The motor is tested and adjusted to adjust the position of the carriage according to the preset indentation interval, thereby adjusting the indentation interval of the indentation knife; The image recognition module is configured to process the indentation image and identify indentation deviations; The control system is configured to adjust the position of the indentation tool according to the indentation deviation parameter to achieve precise indentation.
3. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 1, characterized in that, Controlling the x-axis motor to perform indentation includes: The reverse pressing process of the first and second indentations is achieved by bidirectional drive of the same x-axis motor. After receiving the pulse signal, the motor control unit first rotates forward a set number of times to drive the indentation knife to complete the first indentation, and then rotates in the reverse direction for the same or different number of times to complete the second indentation.
4. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 1, characterized in that, Identify multiple sets of indentations along the x-axis, including: Obtain the original image of the indentation, uniformly divide the original image into multiple non-overlapping pixel blocks, and calculate the gradient matrix for the target pixel block; the target pixel block is any one of the multiple pixel blocks. The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data. The feature vector of each pixel block is then input into the classification model to output the classification label of each pixel block. The classification label includes simple pixel blocks and non-simple pixel blocks. A label matrix is constructed based on the classification labels, and a grayscale mapping table is calculated using the label matrix and grayscale data; the grayscale mapping table includes a simple region grayscale mapping table and a non-simple region grayscale mapping table. The correction mapping table for each pixel block is calculated using the label matrix and the grayscale mapping table. The correction mapping table for each pixel block is then filled into the corresponding position of the pixel block in the initial matrix to obtain the mapping table matrix. The enhanced image is calculated based on the mapping table matrix and grayscale data.
5. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 4, characterized in that, The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data, including: The original image is uniformly divided into multiple non-overlapping pixel blocks of size M×N; The horizontal and vertical gradients of the target pixel block are obtained by applying horizontal and vertical operators to the target pixel block through convolution operations. The horizontal gradient and the vertical gradient are combined to obtain a gradient value, and the gradient values are arranged according to their coordinates in the pixel block to obtain a gradient matrix. The feature vector of the target pixel block is calculated based on the gradient matrix and grayscale data, including: The gradient average is obtained by averaging the gradient values in the gradient matrix of the target pixel block, and the gradient standard deviation is calculated based on the gradient average. The first grayscale mean is calculated based on the grayscale data, and the first grayscale standard deviation is calculated based on the first grayscale mean. The feature vector is obtained by performing feature normalization on the average gradient, the standard deviation of the gradient, and the standard deviation of the first gray level.
6. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 4, characterized in that, Before the feature vector of each pixel block is input into the classification model to output the classification label of each pixel block, the training process of the classification model includes: Obtain a training dataset, input the training dataset into a preset model for training to obtain model update parameters, and update the model parameters in the preset model according to the model update parameters to obtain a classification model; Obtain the verification dataset, input the verification data into the classification model to obtain the verification labels, and calculate the similarity between the verification labels and the true labels to obtain the deviation value; If the deviation value is greater than the deviation threshold, the classification model is deemed unqualified and iterative training is re-executed until the preset conditions are met; otherwise, the classification model is deemed qualified. The verification dataset contains verification data and real labels, and the verification data corresponds one-to-one with the real labels.
7. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 4, characterized in that, The grayscale mapping table is calculated based on the label matrix and grayscale data, including: Construct a zero matrix, iterate through each pixel block, and if the pixel block is classified as a simple pixel block, set the corresponding element in the zero matrix to 1; if the label is a non-simple pixel block, keep it unchanged, and then obtain the label matrix. Traverse the label matrix. For each simple region label: scan all pixel blocks. If a pixel block is labeled as a simple region label and there is a pixel block labeled as a simple region label in its 8-neighborhood, then mark the pixel block as a non-simple region label to obtain a composite region containing labels L and -L. The simple region label is L, and the non-simple region label is -L. Extract the gray values of all pixel blocks within the composite region, calculate the second gray mean based on the gray values of all pixel blocks within the composite region, and calculate the second gray standard deviation based on the second gray mean. The upper and lower limits of grayscale are calculated based on the second grayscale mean and the second grayscale standard deviation, and the minimum and maximum grayscale values of the pixel blocks in the composite region are obtained. The grayscale range is adjusted based on the upper grayscale limit, lower grayscale limit, minimum grayscale value, and maximum grayscale value, and a grayscale mapping table is calculated based on the grayscale range.
8. The method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 4, characterized in that, The corrected mapping table for each pixel block is calculated using the label matrix and the grayscale mapping table, including: A grayscale vector is constructed based on the bit width of the original image. A mapped grayscale value is calculated for each grayscale value in the grayscale vector according to the grayscale range. A simple region grayscale mapping table is obtained based on the mapped grayscale value. For each non-simple pixel block, count the occurrences of all its pixels at each gray level to obtain the histogram of the non-simple pixel block; The grayscale mapping function is calculated based on the preset mapping value and the original histogram. The grayscale mapping function is used as the average background brightness of the corresponding grayscale level to diagnose the JND threshold. The clipping threshold of the histogram for each grayscale level k is calculated based on the JND threshold. If the histogram of the non-simple pixel block is compared with the cropping threshold and the preset conditions are met, the histogram is used as the gray-level mapping table of the non-simple region. Traverse the label matrix, identify all pixel blocks with negative labels as transition pixel blocks, and record their positions in the label matrix; Extract the 3×3 neighborhood of each transition pixel block and collect the grayscale mapping table of all pixel blocks in the neighborhood; The correction mapping table for the transition pixel block is calculated based on the grayscale mapping table of all pixel blocks in the 3×3 neighborhood.
9. A method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 4, characterized in that, The enhanced image is calculated based on the mapping table matrix and grayscale data, including: For the gray value of each pixel block in the original image, determine its four neighboring pixel blocks and obtain the gray value mapping table corresponding to these four pixel blocks in the mapping table matrix; The interpolated gray level of the pixel block is calculated based on the gray level mapping table corresponding to the four pixel blocks in the mapping table matrix. Perform a 3×3 mean filter on each pixel block in the original image to obtain the filtered gray value, and use this gray value as the gray value of the original image at that location; Based on the interpolated grayscale and the filtered grayscale values, the grayscale values of each pixel block are traversed and stitched together to obtain the enhanced image.
10. A method for correcting and calibrating a cutting and creasing knife by means of indentation recognition according to claim 1, characterized in that, Adjusting the indentation tool to perform indentation operations according to the specific index value includes: Based on the specific index value of the positive and negative values, calculate the deviation compensation value of the indentation tool in the x-axis direction; The deviation compensation value is converted into a pulse compensation value for the x-axis motor; the pulse compensation value is calculated by a PID control algorithm, and the input of the PID control algorithm is the difference between the specific index value and the preset target value; The x-axis motor is controlled to adjust the moving distance of the indentation tool according to the pulse compensation value, so as to achieve the correction and calibration of the indentation tool.