A tobacco material box complex profile adaptive strapping automatic detection method
By applying the random sampling consensus algorithm and the improved PELT algorithm in tobacco material box detection, combined with the Savitzky-Golay filter, the problems of unstable feature extraction and insufficient position accuracy in cable tie detection are solved, achieving high-precision identification of cable tie positions and efficient automated cable tie cutting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI UNIV OF TECH
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-23
Smart Images

Figure CN122265145A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of automatic detection technology of packaging box cable ties, specifically relating to an automatic detection method for cable ties that adapts to the complex contours of tobacco material boxes. Background Technology
[0002] Material boxes and cable ties are widely used in the warehousing, logistics, and production of tobacco raw materials and products. Cutting and unpacking material boxes is a crucial process connecting tobacco logistics and production; accurate and efficient detection of the cable ties on the surface of the material boxes directly affects the success rate of automated unpacking and material feeding efficiency. In actual working conditions, tobacco material boxes often suffer irregular deformation, surface wear, and localized damage due to compression, collisions, and frequent handling. Simultaneously, cable ties often exhibit uneven tension, unknown binding positions, and varied shapes due to material box deformation, resulting in diverse forms such as tilting, loosening, and overlapping.
[0003] The aforementioned complex operating conditions present multiple challenges to cable tie inspection: Firstly, the irregular surface texture, wear, scratches, and damage of the material boxes, along with the variable lighting conditions in the production environment, blur the characteristic boundaries between the cable ties and the material box background, leading to misdetection or missed detection of cable tie edge features. Secondly, the unknown and variable nature of the cable ties' bundling position, material, color, and width, coupled with their non-standard shapes such as tilting, loosening, deformation, and overlapping during use, results in a lack of unified feature benchmarks for the inspection targets, increasing the difficulty of target identification. These multiple factors collectively lead to insufficient recognition efficiency and accuracy in automated cable tie inspection, consequently affecting the automated cable tie cutting and unpacking cycle time and success rate, making it difficult to guarantee the efficiency of material delivery in downstream processes.
[0004] To address the aforementioned challenges in cable tie detection, existing technology—laser detection—offers a novel technical approach for cable tie identification in complex backgrounds. Based on the principle of triangulation, laser detection scans horizontally along the surface of the material box to accurately acquire its surface height information. Its single-point measurement accuracy can reach or even exceed 30μm, and it is unaffected by changes in ambient lighting or surface texture.
[0005] However, existing conventional laser detection technologies still have the following technical problems when applied to targets with weak geometric features, such as cable ties:
[0006] (1) The extracted features are unstable.
[0007] (2) Insufficient position detection accuracy.
[0008] (3) Under non-ideal working conditions and complex interferences such as irregular deformation of the material box and varied morphology of the cable tie, the point cloud data is prone to baseline drift and feature confusion, which makes it impossible to effectively distinguish the edge of the cable tie from the background of the material box, making it difficult to guarantee the reliability and efficiency of the detection results.
[0009] Therefore, a new method is urgently needed to stably and accurately identify cable tie features from laser point clouds and output their position coordinates, so as to ensure the efficient and reliable operation of the automated cable tie cutting and unpacking process, and to ensure the downstream feeding cycle and overall production efficiency. Summary of the Invention
[0010] To address the aforementioned technical problems in the existing technology, the purpose of this invention is to stably and accurately identify cable tie features from laser point clouds and output their position coordinates, ensuring the efficient and reliable operation of the automated cable tie cutting and unpacking process. The technical solution is as follows:
[0011] An automatic detection method for cable ties that adapts to the complex contours of tobacco material boxes includes the following steps:
[0012] Step 1: Scan the material box, collect the outline information of the material box, and perform analog-to-digital conversion to obtain the initial height sequence of the material box outline;
[0013] Step 2: Fit the initial height sequence based on the robust regression algorithm of random sampling consistency, eliminate cable tie outliers, generate the initial baseline of the material box outline, and correct the initial baseline to obtain the material box outline baseline sequence;
[0014] Step 3: Subtract the initial height sequence from the baseline sequence point by point to obtain the material box contour height deviation sequence. Extract the edge point features of the cable ties by using the improved PELT algorithm for cable tie edge abrupt change point detection technology.
[0015] Step 4: Based on the pseudo-variable filtering algorithm of local gradient screening and mean-variance test, the pseudo-variable points generated by the material box are filtered out. The morphological features of the cable ties are quantitatively defined and calculated and extracted. The cable tie morphology classification index is constructed, the cable tie morphology type classification is defined, and the corresponding classification rules are formulated. The cable ties are morphologically classified by the morphology classification rules and the morphology classification index, and the cable tie position and height information are output.
[0016] Furthermore, in step 1, the scanning of the material box is performed using a high-precision laser displacement sensor.
[0017] Furthermore, the specific process of step 2 is as follows:
[0018] Step 2.1: The initial height sequence is robustly estimated using a random sampling consensus algorithm. Through iterative random sampling and model fitting, abnormal points of the cable ties (i.e., outer points) are identified and eliminated. The baseline model parameters are estimated using the background points of the material box (i.e., inner points) to generate the initial baseline of the material box outline.
[0019] Step 2.2: Correct and optimize the initial baseline of the material box outline using a filter to obtain the material box outline baseline sequence.
[0020] Furthermore, in step 2.1, the number of iterations... The initial baseline generation steps for the material box outline are dynamically determined using a probabilistic model and are as follows:
[0021] Step 2.1.1: Calculate the proportion of interior points in the dataset. The calculation expression is as follows:
[0022]
[0023] in, Let be the number of interior points. Number of external points;
[0024] Step 2.1.2: Calculate the probability of the correct model by sampling the correct n points. Its calculation expression is:
[0025]
[0026] in, For the number of iterations, for The probability that all points are interior points. for The probability that at least one of the points is an exterior point;
[0027] Step 2.1.3: Based on the stated probability Calculate the number of iterations Its expression is:
[0028]
[0029] Step 2.1.4: After the next iteration, select the proportion of interior points. The highest-performing model is used as the best estimate to generate the initial baseline.
[0030] Furthermore, in step 2.2, the filter is a Savitzky-Golay filter.
[0031] Furthermore, in step 2.2, the step of correcting and optimizing the initial baseline using a filter specifically includes the following steps:
[0032] Step 2.2.1: Construction A polynomial of order 1 is obtained, and the polynomial is fitted to obtain a fitting function. Its expression is:
[0033]
[0034] in, The relative position of the data point within the window. These are the fitting functions. The coefficients of the fitted data points;
[0035] Step 2.2.2: Perform least squares fitting to obtain the residuals. Its calculation expression is:
[0036]
[0037] in, Let be the function value corresponding to the location of the data point, and let the width of the sliding window be . , Half the window width, The value is ;
[0038] Step 2.2.3: The residual Derivatives of each coefficient If each is set to 0, then The expression is:
[0039]
[0040] Will The expression is simplified, and the simplified expression is:
[0041]
[0042] in, ;
[0043] Step 2.2.4: Set the window to be fitted Substituting the simplified expression from step 2.2.3, we obtain the list of polynomial coefficients. Substitute the x-coordinate of the midpoint in the baseline data of the material box into the fitting function in step 2.2.1. In this process, the best fit of the midpoint to each of the j points before and after it is obtained.
[0044] Furthermore, the specific process of step 3 is as follows:
[0045] Step 3.1: Obtain the initial altitude sequence, and subtract the initial altitude sequence from the baseline sequence point by point to obtain the deviation sequence fluctuating around zero, expressed as:
[0046]
[0047] in, For the initial height sequence at time The observed values, ; For a moment Estimated baseline value; For a moment Corrected height value;
[0048] Step 3.2: Perform optimal change point detection and optimal segmentation model for the multi-change point detection sequence on the deviation sequence, specifically including:
[0049] Step 3.2.1: Let the deviation sequence be... Include The number of sub-intervals and the changing point positions are: , where the default For an ordered arrangement, if and only if When, satisfy ;Will Set to 0, Set as The change point divides the sequence into There are sub-intervals, of which the ... The data for each sub-interval is ;
[0050] Based on statistical discrimination criteria, the solution sequence will be... The optimal change point detection is transformed into a constrained optimization problem, namely, minimizing the objective function of the split point. The objective function of the split point is expressed as:
[0051]
[0052] in, For the first Cost function for data in each sub-interval; The number of variable points, which is an integer greater than or equal to 1; To prevent overfitting, the number of variable points is controlled. This is the penalty coefficient; For the penalty function;
[0053] Step 3.2.2: Solve for the optimal segmentation model of the multivariable point detection sequence recursively:
[0054] set up Let the objective function at the segmentation point be the minimum value, then:
[0055]
[0056] set up If the last variable point is located, then the... The expression is:
[0057]
[0058] The recursive method described above is repeated for the second-to-last and third-to-last variable points to construct the complete optimal segmentation model. The expression is rewritten as:
[0059] ;
[0060] Step 3.2.3: Based on the optimal segmentation model, perform pruning operations on the candidate change point set:
[0061] At the beginning of each iteration, delete the variable point τ that does not currently meet the variable point condition but met the variable point condition in previous iterations and was added to the variable point position set;
[0062] Randomly select a location from the sample. ,but:
[0063]
[0064] set up To meet Another location point, if it satisfies the following condition:
[0065]
[0066] Then, each sample point is detected sequentially. When the t-th sample point is detected, if s does not meet the condition of minimizing the total cost before t, it is removed from the variable point set.
[0067] Step 3.3: Quantify the inherent volatility of the data based on the local standard deviation, and construct an adaptive dynamic penalty term. The expression for the penalty term is:
[0068]
[0069] The penalty coefficient is selected based on the Bayesian information criterion. .
[0070] Furthermore, the specific process of step 4 is as follows:
[0071] Step 4.1: Perform local gradient mutation significance screening:
[0072] For each candidate variable point The initial screening is performed by analyzing the gradient change pattern of the data points and their adjacent data points, and then the candidate change points are selected. Take k points before and after, and calculate the difference sequence between adjacent points. The expression is:
[0073]
[0074] in, ;
[0075] Evaluate the candidate change points The degree of change of the gradient is expressed as:
[0076]
[0077] Where k is the candidate variable point The points before and after, with the default value of k being 5. For gradient differences;
[0078] Obtain gradient difference values The preset gradient threshold is The preset gradient threshold Difference from the gradient If a comparison is made, If so, retain the variable point and proceed to the next stage. If so, then the variable point will be filtered out;
[0079] Step 4.2: Obtain the initial set of variable points for purification, and further filter out pseudo-variable points by using a refined screening mechanism based on mean-variance analysis.
[0080] For each candidate variable point Construct a distribution characteristic test factor, the expression of which is:
[0081]
[0082] in, Candidate variable points Previous segment interval The mean, Candidate variable points Previous segment interval The variance;
[0083] Define a mean-variance test factor for the characteristic of "large mean difference and small variance", and obtain the test factor value. The preset characteristic threshold is Test factor values With preset characteristic threshold If a comparison is made, If so, mark the point as a pseudo-change point and filter it out; if If the point is not a spurious change point, it is marked as such and retained to obtain a candidate change point with high confidence.
[0084] Step 4.3: Perform directional analysis on the candidate change points retained in Step 4.2, and analyze the direction of each retained candidate change point. Based on the pre- and post-baseline correction test windows, the retained candidate change point direction index is defined.
[0085] Let the front window be... The back window is recorded as The expression for the retained candidate change point direction index is:
[0086]
[0087] in, For the front window The mean, For the back window The mean;
[0088] Get ,when When this occurs, it is marked as a positive change point, and the data shows a sudden upward trend, corresponding to a jump in height from the cable tie surface to the material box surface; when When this occurs, it is marked as a negative change point, and the data shows a sudden downward trend, corresponding to a jump in height from the surface of the material box to the surface of the cable tie.
[0089] Based on the physical characteristics of the cable tie, morphological constraint verification is performed, and it is defined that an effective cable tie signal unit must satisfy a continuous variable point pair structure of first falling and then rising.
[0090] For a pair of consecutive variable points that satisfy the morphological constraints, calculate the distance between the pairs of consecutive variable points. Its calculation expression is:
[0091]
[0092] Set a merging threshold based on the cable tie width characteristic, the threshold being defined as follows: Double the standard cable tie width When the consecutive variable point pairs meet the following two conditions, they are determined to be local undulations on the same cable tie and are matched:
[0093] (1)
[0094] in, Indicates consecutive pairs of changing points;
[0095] (2)
[0096] in, To determine the weight, Standard cable tie width, default. .
[0097] Step 4.4: Perform quantitative analysis on the detected cable ties, calculate and extract key morphological features, construct cable tie morphology classification and discrimination index, define cable tie morphology type classification, formulate corresponding classification and discrimination rules, classify the cable ties by morphology using the classification and discrimination rules and morphology classification and discrimination index, and output the cable tie position and height information.
[0098] Furthermore, in step 4.3, the judgment weight... The range of values is .
[0099] Furthermore, the cable tie morphology classification and discrimination index includes:
[0100] (1) Width characteristics: Calculate the detection width of the cable tie and compare it with the preset standard cable tie width. By comparison, the width deviation index is obtained, and the expression for calculating the detection width of the cable tie is:
[0101] ;
[0102] (2) Height characteristics: Calculate the detection height difference between the cable tie and the surface of the material box, and compare it with the preset standard cable tie thickness. For comparison, the default is... The height deviation index is obtained, and the calculation expression for the detected height is:
[0103] ;
[0104] (3) Symmetry characteristics: Calculate the symmetry ratio of the steepness of the two sides of the edge. The calculation expression is as follows:
[0105]
[0106] Ideally, the symmetry ratio Approaching 1;
[0107] (4) Internal flatness characteristics: The flatness of the internal area of the cable tie is calculated by uniform standard deviation. The calculation expression is:
[0108] ;
[0109] The cable tie morphology types and classification rules include:
[0110] (1) For the determination of a tight-fitting cable tie, the following conditions must be met simultaneously:
[0111] Width requirements: ;
[0112] Altitude requirements: ;
[0113] Symmetry condition: ;
[0114] Internal flatness requirements: , ;
[0115] (2) For loose cable ties to be judged, the following conditions must be met simultaneously:
[0116] Width requirements: ;
[0117] Altitude requirements: ;
[0118] Symmetry condition: ;
[0119] Internal flatness requirements: ;
[0120] (3) For the determination of overlapping cable ties, the following conditions must be met simultaneously:
[0121] Width requirements: ;
[0122] Altitude requirements: ;
[0123] Symmetry condition: ;
[0124] Internal flatness requirements: ;
[0125] (4) For the determination of inclined cable ties, the following conditions must be met simultaneously:
[0126] Width requirements: ;
[0127] Altitude requirements: ;
[0128] Symmetry condition: ;
[0129] Wherein, when the tilt angle of the cable tie exceeds the critical value, causing the width of the cable tie's projection on the surface of the material box to be too small, the internal flatness feature is not used as a judgment condition.
[0130] (5) The following conditions must be met for a damaged cable tie to be considered:
[0131] Internal flatness requirements: ;
[0132] Among them, the determination of damaged cable ties does not rely on width characteristic value, height characteristic value, and symmetry characteristic value, but only on internal flatness.
[0133] Beneficial effects: (1) Robust separation of cable ties from the background of the material box is achieved by using a robust regression algorithm based on random sampling consistency and a baseline adaptive generation and correction algorithm based on a high-precision conformal Savitzky-Golay filter, reducing false detections and missed detections caused by uncertain concave and convex deformation of the material box. (2) A cable tie edge mutation point detection method based on the improved PELT algorithm is used, and an adaptive penalty term is constructed using the standard deviation of the local deviation sequence to dynamically adjust the detection sensitivity and improve the recognition accuracy of the position coordinates of the edge points of different shaped cable ties. (3) A data change point elimination strategy based on local gradient screening and mean variance is adopted, and accurate discrimination is made according to the different physical morphological characteristics of the cable ties, reducing false detections caused by damage to the material box. (4) The recognition success rate and robustness of cable tie detection are improved. Attached Figure Description
[0134] Figure 1 This is a flowchart of the automatic cable tie detection method for complex contours of tobacco material boxes according to the present invention.
[0135] Figure 2 This is a framework diagram of the automatic cable tie detection method for complex contours of tobacco material boxes according to the present invention.
[0136] Figure 3 This is a schematic diagram illustrating the classification of cable tie morphologies according to the present invention;
[0137] Figure 4 This is a real-world illustration of the tobacco material box cable ties of the present invention;
[0138] Figure 5 The diagram shows the effect of the automatic detection method for cable ties that adapts to the complex contour of the tobacco material box according to the present invention. Detailed Implementation
[0139] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0140] like Figure 1 and Figure 2 As shown, the automatic detection method for cable ties with adaptive complex contours of tobacco material boxes according to the present invention includes the following steps:
[0141] S1. A laser displacement sensor driven by a horizontal moving module scans along the surface of the material box, collects the contour information of the material box surface in real time, and transmits it to the host computer for high-precision analog-to-digital conversion to obtain the initial height sequence of the digitized material box contour.
[0142] S2. The initial height sequence is fitted using a robust regression algorithm based on random sampling consistency to eliminate interference from cable tie anomalies, generating an initial baseline for the material box outline. This initial baseline is then corrected using a high-precision conformal Savitzky-Golay filter to obtain the material box outline baseline sequence. Specifically, this includes the following steps:
[0143] S21. A random sampling consensus algorithm is used to robustly estimate the initial height sequence of the material box. Through iterative random sampling and model fitting, the interference of abnormal points (outer points) of the cable ties is identified and eliminated. The background points (inner points) of the material box are used to estimate the baseline model parameters and generate the initial baseline of the material box outline.
[0144] The number of iterations k is dynamically determined by a probability model to ensure that at least one pure inner point subset is sampled from the data with a success probability p not lower than the preset probability p.
[0145] The specific process for generating the initial baseline of the material box outline is as follows:
[0146] (1) Calculate the proportion of interior points in the dataset. The calculation expression is as follows:
[0147]
[0148] in, Let be the number of interior points. The number of exterior points;
[0149] (2) Calculate the probability of the correct model by sampling the correct n points. Its calculation expression is:
[0150]
[0151] in, For the number of iterations, for The probability that all points are interior points. for The probability that at least one of the points is an exterior point. express No random sample consists entirely of interior points;
[0152] (3) The probability of passing the correct model Calculate the number of iterations Its expression is:
[0153]
[0154] The larger the number of iterations k, the greater the probability p of obtaining the best baseline fitting model;
[0155] (4) After the next iteration, select the proportion of interior points. The highest-performing model is used as the best estimate to generate the initial baseline.
[0156] S22. The initial baseline is corrected and optimized using a high-fidelity Savitzky-Golay filter. Based on polynomial least-squares fitting within a sliding window, the actual geometric contour curve of the material box surface is further approximated with high fidelity, effectively separating abnormal signals caused by overly tight cable ties and avoiding missed detection of cable ties due to baseline distortion. The specific process is as follows:
[0157] (1) Construct a A polynomial of order 1 is obtained, and the polynomial is fitted to obtain a fitting function. Its expression is:
[0158]
[0159] in, The relative position of the data point within the window. These are the fitting functions. The coefficients of the fitted data points;
[0160] (2) Perform least squares fitting to obtain the residuals. Its calculation expression is:
[0161]
[0162] in, Let be the function value corresponding to the location of the data point, and let the width of the sliding window be . , Half the window width, ; The value is ;
[0163] (3) The residual Derivatives of each coefficient If each is set to 0, then The expression is:
[0164]
[0165] Will The expression is simplified, and the simplified expression is:
[0166]
[0167] in, ;
[0168] (4) When the sliding window size and smoothing order are fixed, the window to be fitted is... Substituting the above The simplified expression yields a list of polynomial coefficients. Substitute the x-coordinate of the midpoint in the initial baseline data into the fitting function. In this process, the best fit of the midpoint to each of the j points before and after it is obtained.
[0169] S3. Subtract the initial height sequence from the generated and corrected material box contour baseline sequence point by point according to the horizontal scanning sequence to obtain the material box contour height deviation sequence fluctuating around zero. This sequence serves as the initial data for cable tie detection on the material box surface. Based on the improved PELT algorithm, an adaptive penalty term is constructed using the standard deviation of the local deviation sequence. The detection sensitivity is dynamically adjusted according to changes in data characteristics to accurately capture the edge point features of cable ties of different shapes. The specific process is as follows:
[0170] S31. The material box outline height is corrected by the baseline sequence to eliminate the influence of deformation drift, systematic error and noise interference in the initial height sequence; the processed deviation sequence is used as the input signal of the PELT algorithm to achieve efficient and accurate detection of cable tie edge points under the dynamic programming framework.
[0171] Initial height sequence With the generated baseline sequence By subtracting point by point, we obtain the deviation sequence that fluctuates around the zero value. Its expression is:
[0172]
[0173] in, For the initial height sequence at time The observed values, ; For a moment Estimated baseline value; For a moment Corrected height value;
[0174] S32. An optimal segmentation model for the deviation sequence, including optimal change point detection and multi-change point detection sequences, specifically includes:
[0175] (1) Let the deviation sequence be Include The number of sub-intervals and the changing point positions are: , where the default For an ordered arrangement, if and only if When, satisfy ;Will Set to 0, Set as The change point divides the sequence into There are sub-intervals, of which the ... The data for each sub-interval is ;
[0176] Based on statistical discrimination criteria, the solution sequence will be... The optimal change point detection is transformed into a constrained optimization problem, namely, minimizing the objective function of the split point. The objective function of the split point is expressed as:
[0177]
[0178] in, For the first Cost function for data in each sub-interval; The number of variable points, which is an integer greater than or equal to 1; To prevent overfitting, the number of variable points is controlled. This is the penalty coefficient; For the penalty function;
[0179] (2) Solve the optimal segmentation model of the multi-variable point detection sequence by recursion. Under the condition that the position of the last variable point is known, calculate the optimal segmentation to reach the point. Traverse each data point in the sequence and regard it as a possible endpoint in turn. Evaluate the overall cost of the corresponding segmentation scheme and select the segmentation scheme with the minimum overall cost as the optimal variable point set.
[0180] set up Let the objective function at the segmentation point be the minimum value, then:
[0181]
[0182] set up If the last variable point is located, then the... The expression is:
[0183]
[0184] The recursive method described above is repeated for the second-to-last and third-to-last variable points to construct the complete optimal segmentation model. The expression is rewritten as:
[0185]
[0186] As mentioned above, the optimal split obtained on a subset of samples also applies to the entire sample. The recursive form of this model is given below, i.e., first determine... The optimal segmentation was then generalized to... The optimal segmentation is achieved by traversing the entire sequence data sample and extracting the data. The optimal splitting position of the sample, i.e. the variable point, is placed in the set and recorded and stored completely.
[0187] (3) Based on the optimal segmentation model, perform pruning operations on the candidate change point set:
[0188] At the beginning of each iteration, delete the variable point τ that does not currently meet the variable point condition but met the variable point condition in previous iterations and was added to the variable point position set;
[0189] Randomly select a location from the sample. ,but:
[0190]
[0191] set up To meet Another location point, if it satisfies the following condition:
[0192]
[0193] Then, each sample point is detected sequentially. When the t-th sample point is detected, if s does not meet the condition of minimizing the total cost before t, it is removed from the variable point set.
[0194] S33. The local standard deviation of the data sequence within the sliding window reflects the reliability and background noise level of the local region. Based on the local standard deviation, the inherent fluctuations of the data are quantified, and an adaptive dynamic penalty term is constructed to prevent false detections of edge points caused by over-segmentation. The expression for the penalty term is:
[0195]
[0196] The penalty coefficient is selected based on the Bayesian information criterion. .
[0197] S4. Based on local gradient screening and mean-variance test, pseudo-variable points caused by factors such as material box damage and dents are filtered out. The morphological characteristics of the cable ties are quantitatively defined. Based on the morphological characteristics, the cable ties are classified according to their morphological type and discrimination rules, and the position and height information of the cable ties are output. The specific steps are as follows:
[0198] S41. Perform local gradient mutation significance screening:
[0199] For each candidate variable point The initial screening is performed by analyzing the gradient change pattern of the data points and their adjacent data points, and then the candidate change points are selected. Take from both the front and back One point, default ; Calculate the sequence of differences between adjacent points, its expression is:
[0200]
[0201] in, ;
[0202] Evaluate the candidate change points The degree of change of the gradient is expressed as:
[0203]
[0204] Where k is the candidate variable point The points before and after, with the default value of k being 5. For gradient differences;
[0205] Because the gradient magnitude changes of real cable tie edge points are strong and concentrated, there is a significant peak step change in the magnitude distribution along the edge normal direction, and the peak has a certain height. By setting the average or minimum threshold of the gradient magnitude, points below the threshold are considered "weak edge" pseudo-change points and are filtered out.
[0206] Obtain gradient difference values The preset gradient threshold is The preset gradient threshold Difference from the gradient If a comparison is made, If so, retain the variable point and proceed to the next stage. If so, then the variable point will be filtered out;
[0207] S42. Obtain the set of variable points for preliminary purification, and further filter out pseudo-variable points by using a refined screening mechanism based on mean-variance analysis.
[0208] For each candidate variable point Construct a distribution characteristic test factor, the expression of which is:
[0209]
[0210] in, Candidate variable points Previous segment interval The mean, Candidate variable points Previous segment interval The variance;
[0211] Because the height distribution on both sides of the cable tie edge exhibits a significant and uniform jump, the internal variance of the two sides is small, while the mean difference between the two sides is large. By examining the local mean difference and variance characteristics on both sides of the edge point, a mean-variance test factor for the characteristic of "large mean difference and small variance" is set, and the test factor value is obtained. The preset characteristic threshold is Test factor values With preset characteristic threshold If a comparison is made, If so, mark the point as a pseudo-change point and filter it out; if If the point is not a spurious change point, it is marked as such and retained to obtain a candidate change point with high confidence.
[0212] S43. Perform directional analysis on the candidate change points retained in S42, and analyze each of the retained candidate change points. Based on the pre- and post-baseline correction test windows, the retained candidate change point direction index is defined.
[0213] Let the front window be... The back window is recorded as The expression for the retained candidate change point direction index is:
[0214]
[0215] in, For the front window The mean, For the back window The mean;
[0216] Get ,when When this occurs, it is marked as a positive change point, and the data shows a sudden upward trend, corresponding to a jump in height from the cable tie surface to the material box surface; when When this occurs, it is marked as a negative change point, and the data shows a sudden downward trend, corresponding to a jump in height from the surface of the material box to the surface of the cable tie.
[0217] Based on the physical characteristics of the cable tie, morphological constraint verification is performed, and it is defined that an effective cable tie signal unit must satisfy a continuous variable point pair structure of first falling and then rising.
[0218] For a pair of consecutive variable points that satisfy the morphological constraints, calculate the distance between the pairs of consecutive variable points. Its calculation expression is:
[0219]
[0220] Set a merging threshold based on the cable tie width characteristic, the threshold being defined as follows: Double the standard cable tie width When the consecutive variable point pairs meet the following two conditions, they are determined to be local undulations on the same cable tie and are matched:
[0221] (1)
[0222] in, Indicates consecutive pairs of changing points;
[0223] (2)
[0224] in, To determine the weight, Standard cable tie width, default. .
[0225] S44. A cable tie morphology classification method based on multi-feature fusion analyzes the geometric features and statistical characteristics of cable ties to achieve automated morphology classification, providing a precise basis for strategy adaptation and operation parameter adjustment for the unpacking system.
[0226] The detected cable ties are quantitatively defined and their morphological features are calculated. A morphological classification and discrimination index for cable ties is constructed. Based on the morphological classification and discrimination index, the cable ties are classified according to the discrimination rules, and the position and height information of the cable ties are output.
[0227] The classification criteria for cable tie morphology include:
[0228] (1) Width characteristics: Calculate the detection width of the cable tie and compare it with the preset standard cable tie width. By comparison, the width deviation index is obtained, and the expression for calculating the detection width of the cable tie is:
[0229] ;
[0230] (2) Height characteristics: Calculate the detection height difference between the cable tie and the surface of the material box, and compare it with the preset standard cable tie thickness. For comparison, the default is... The height deviation index is obtained, and the calculation expression for the detected height is:
[0231] ;
[0232] (3) Symmetry characteristics: Calculate the symmetry ratio of the steepness of the two sides of the edge. The calculation expression is as follows:
[0233]
[0234] Ideally, the symmetry ratio Approaching 1;
[0235] (4) Internal flatness characteristics: The flatness of the internal area of the cable tie is calculated by the uniform standard deviation, which reflects the uniformity of the cable tie surface. The calculation expression is as follows:
[0236] ;
[0237] Based on the above-mentioned diverse quantitative characteristics, we define a classification of cable tie morphology types and formulate corresponding classification rules, such as... Figure 3 As shown in Table 1, its class discrimination rules include:
[0238] (1) For the determination of a tight-fitting cable tie, the following conditions must be met simultaneously:
[0239] Width requirements: Altitude requirements: Symmetry condition: Internal flatness requirements: .
[0240] (2) For loose cable ties to be judged, the following conditions must be met simultaneously:
[0241] Width requirements: Altitude requirements: Symmetry condition: Internal flatness requirements: .
[0242] (3) For the determination of overlapping cable ties, the following conditions must be met simultaneously:
[0243] Width requirements: Altitude requirements: Symmetry condition: Internal flatness requirements: .
[0244] (4) For the determination of inclined cable ties, the following conditions must be met simultaneously:
[0245] Width requirements: Altitude requirements: Symmetry condition: Wherein, when the tilt angle of the cable tie exceeds the critical value, causing the width of the cable tie's projection on the surface of the material box to be too small, the internal flatness feature is not used as a judgment condition.
[0246] (5) The following conditions must be met for a damaged cable tie to be considered:
[0247] Internal flatness requirements: Among them, the determination of damaged cable ties does not rely on width characteristic value, height characteristic value, and symmetry characteristic value, but only on internal flatness.
[0248] Table 1. Criteria for Classification and Differentiation of Cable Tie Morphology
[0249]
[0250] The actual working condition diagram and test results of the tobacco material box of the present invention are as follows: Figure 4 and Figure 5 As shown, Figure 5 In the original PELT algorithm, the original signal is the height data of the box surface scanned by the laser sensor. The real change points are the actual left and right edge positions of the cable ties. The falling change points and rising change points are the detected left and right edge position data of the cable ties, respectively. The original PELT algorithm has a large number of missed cable ties due to the lack of handling of interference conditions such as box deformation and tilting and surface damage. Three cable ties were not accurately identified. After adding the baseline correction technology, the baseline drift caused by box deformation and tilting was suppressed, and the recall rate of cable ties was improved. However, three cable ties were misidentified due to local damage or sudden interference of the box. After adding the pseudo change point filtering technology, pseudo change points caused by box surface defects were effectively removed, and the number of misidentified cable ties was reduced from three to one. However, the position recognition accuracy of the cable tie edge points was slightly worse. The method in this embodiment adds local dynamic adaptive detection technology. The cost function and penalty parameters are dynamically adjusted according to the fluctuation characteristics of the deviation sequence within the sliding window interval. The PELT algorithm is improved to achieve optimal performance and accurately identify the positions of all six cable ties.
[0251] This invention employs three techniques—baseline fitting, cable tie edge point detection, and spurious change point filtering—to effectively address complex working conditions such as irregular deformation of the box and variable cable tie shapes, achieving high-precision and robust detection of cable tie positions in tobacco material boxes. By eliminating spurious changes caused by irregular box deformation and positional differences, the success rate of cable tie identification is improved. Furthermore, by automatically classifying and identifying cable ties of different shapes, the physical morphology labels of the cable ties are matched with the cable cutting mechanism, providing reliable technical support for automated box unpacking systems.
[0252] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A tobacco material box complex profile adaptive strapping automatic detection method, characterized in that, Includes the following steps: Step 1: Scan the material box, collect the outline information of the material box, and perform analog-to-digital conversion to obtain the initial height sequence of the material box outline; Step 2: Fit the initial height sequence based on the robust regression algorithm of random sampling consistency, eliminate cable tie outliers, generate the initial baseline of the material box outline, and correct the initial baseline to obtain the material box outline baseline sequence; Step 3: Subtract the initial height sequence from the baseline sequence point by point to obtain the material box contour height deviation sequence. Extract the edge point features of the cable ties by using the improved PELT algorithm for cable tie edge abrupt change point detection technology. Step 4: Based on the pseudo-variable filtering algorithm of local gradient screening and mean-variance test, the pseudo-variable points generated by the material box are filtered out. The morphological features of the cable ties are quantitatively defined and calculated and extracted. The cable tie morphology classification index is constructed, the cable tie morphology type classification is defined, and the corresponding classification rules are formulated. The cable ties are morphologically classified by the morphology classification rules and the morphology classification index, and the cable tie position and height information are output.
2. The method of claim 1, wherein the method is a method of automatically detecting a complex profile of a tobacco material box using a tape, and the method comprises: In step 1, the material box is scanned using a high-precision laser displacement sensor. 3. The method of claim 1, wherein the method is a method of automatically detecting a complex profile of a tobacco material box using a tape, and the method comprises: The specific process of step 2 is as follows: Step 2.1: The initial height sequence is robustly estimated using a random sampling consensus algorithm. Through iterative random sampling and model fitting, abnormal points of the cable ties (i.e., outer points) are identified and eliminated. The baseline model parameters are estimated using the background points of the material box (i.e., inner points) to generate the initial baseline of the material box outline. Step 2.2: Correct and optimize the initial baseline of the material box outline using a filter to obtain the material box outline baseline sequence.
4. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 3, characterized in that, In step 2.1, the number of iterations The initial baseline generation steps for the material box outline are dynamically determined using a probabilistic model and are as follows: Step 2.1.1: Calculate the proportion of interior points in the dataset. The calculation expression is as follows: in, Let be the number of interior points. Number of external points; Step 2.1.2: Calculate the probability of the correct model by sampling the correct n points. Its calculation expression is: in, For the number of iterations, for The probability that all points are interior points. for The probability that at least one of the points is an exterior point; Step 2.1.3: Based on the stated probability Calculate the number of iterations Its expression is: Step 2.1.4: After the next iteration, select the proportion of interior points. The highest-performing model is used as the best estimate to generate the initial baseline.
5. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 3, characterized in that, In step 2.2, the filter is a Savitzky-Golay filter.
6. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 3, characterized in that, In step 2.2, the step of correcting and optimizing the initial baseline using a filter specifically includes the following steps: Step 2.2.1: Construction A polynomial of order 1 is obtained, and the polynomial is fitted to obtain a fitting function. Its expression is: in, The relative position of the data point within the window. These are the fitting functions. The coefficients of the fitted data points; Step 2.2.2: Perform least squares fitting to obtain the residuals. Its calculation expression is: in, Let be the function value corresponding to the location of the data point, and let the width of the sliding window be . , Half the window width, The value is ; Step 2.2.3: The residual Derivatives of each coefficient If each is set to 0, then The expression is: Will The expression is simplified, and the simplified expression is: in, ; Step 2.2.4: Set the window to be fitted Substituting the simplified expression from step 2.2.3, we obtain the list of polynomial coefficients. Substitute the x-coordinate of the midpoint in the baseline data of the material box into the fitting function in step 2.2.
1. In this process, the best fit of the midpoint to each of the j points before and after it is obtained.
7. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 1, characterized in that, The specific process of step 3 is as follows: Step 3.1: Obtain the initial altitude sequence, and subtract the initial altitude sequence from the baseline sequence point by point to obtain the deviation sequence fluctuating around zero, expressed as: in, For the initial height sequence at time The observed values, ; For a moment Estimated baseline value; For a moment Corrected height value; Step 3.2: Perform optimal change point detection and optimal segmentation model for the multi-change point detection sequence on the deviation sequence, specifically including: Step 3.2.1: Let the deviation sequence be... Include The number of sub-intervals and the changing point positions are: , where the default For an ordered arrangement, if and only if When, satisfy ;Will Set to 0, Set as The change point divides the sequence into There are sub-intervals, of which the ... The data for each sub-interval is ; Based on statistical discrimination criteria, the solution sequence will be... The optimal change point detection is transformed into a constrained optimization problem, namely, minimizing the objective function of the split point. The objective function of the split point is expressed as: in, For the first Cost function for data in each sub-interval; The number of variable points, which is an integer greater than or equal to 1; To prevent overfitting, the number of variable points is controlled. This is the penalty coefficient; For the penalty function; Step 3.2.2: Solve for the optimal segmentation model of the multivariable point detection sequence recursively: set up Let the objective function at the segmentation point be the minimum value, then: set up If the last variable point is located, then the... The expression is: The recursive method described above is repeated for the second-to-last and third-to-last variable points to construct the complete optimal segmentation model. The expression is rewritten as: ; Step 3.2.3: Based on the optimal segmentation model, perform pruning operations on the candidate change point set: At the beginning of each iteration, delete the variable point τ that does not currently meet the variable point condition but met the variable point condition in previous iterations and was added to the variable point position set; Randomly select a location from the sample. ,but: set up To meet Another location point, if it satisfies the following condition: Then, each sample point is detected sequentially. When the t-th sample point is detected, if s does not meet the condition of minimizing the total cost before t, it is removed from the variable point set. Step 3.3: Quantify the inherent volatility of the data based on the local standard deviation, and construct an adaptive dynamic penalty term. The expression for the penalty term is: The penalty coefficient is selected based on the Bayesian information criterion. .
8. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 1, characterized in that, The specific process of step 4 is as follows: Step 4.1: Perform local gradient mutation significance screening: For each candidate variable point The initial screening is performed by analyzing the gradient change pattern of the data points and their adjacent data points, and then the candidate change points are selected. Take k points before and after, and calculate the difference sequence between adjacent points. The expression is: in, ; Evaluate the candidate change points The degree of change of the gradient is expressed as: Where k is the candidate variable point The points before and after, with the default value of k being 5. For gradient differences; Obtain gradient difference values The preset gradient threshold is The preset gradient threshold Difference from the gradient If a comparison is made, If so, retain the variable point and proceed to the next stage. If so, then the variable point will be filtered out; Step 4.2: Obtain the initial set of variable points for purification, and further filter out pseudo-variable points by using a refined screening mechanism based on mean-variance analysis. For each candidate variable point Construct a distribution characteristic test factor, the expression of which is: in, Candidate variable points Previous segment interval The mean, Candidate variable points Previous segment interval The variance; Set a mean-variance test factor for the characteristic of "large mean difference and small variance", and obtain the test factor value. The preset characteristic threshold is Test factor values With preset characteristic threshold If a comparison is made, If so, mark the point as a pseudo-change point and filter it out; if If the point is not a spurious change point, it is marked as such and retained to obtain a candidate change point with high confidence. Step 4.3: Perform directional analysis on the candidate change points retained in Step 4.2, and analyze the direction of each retained candidate change point. Based on the pre- and post-baseline correction test windows, the retained candidate change point direction index is defined. Let the front window be... The back window is recorded as The expression for the retained candidate change point direction index is: in, For the front window The mean, For the back window The mean; Get ,when When this occurs, it is marked as a positive change point, and the data shows a sudden upward trend, corresponding to a jump in height from the cable tie surface to the material box surface; when When this occurs, it is marked as a negative change point, and the data shows a sudden downward trend, corresponding to a jump in height from the surface of the material box to the surface of the cable tie. Based on the physical characteristics of the cable tie, morphological constraint verification is performed, and it is defined that an effective cable tie signal unit must satisfy a continuous variable point pair structure of first falling and then rising. For a pair of consecutive variable points that satisfy the morphological constraints, calculate the distance between the pairs of consecutive variable points. Its calculation expression is: Set a merging threshold based on the cable tie width characteristic, the threshold being defined as follows: Double the standard cable tie width When the consecutive variable point pairs meet the following two conditions, they are determined to be local undulations on the same cable tie and are matched: (1) in, Indicates consecutive point pairs; (2) in, To determine the weight, Standard cable tie width, default. . Step 4.4: Perform quantitative analysis on the detected cable ties, calculate and extract key morphological features, construct cable tie morphology classification and discrimination index, define cable tie morphology type classification, formulate corresponding classification and discrimination rules, classify the cable ties by morphology using the classification and discrimination rules and morphology classification and discrimination index, and output the cable tie position and height information.
9. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 8, characterized in that, In step 4.3, the judgment weight The range of values is .
10. The automatic detection method for cable ties with adaptive design for complex contours of tobacco material boxes according to claim 8, characterized in that, The cable tie morphology classification criteria include: (1) Width characteristics: Calculate the detection width of the cable tie and compare it with the preset standard cable tie width. By comparison, the width deviation index is obtained, and the expression for calculating the detection width of the cable tie is: ; (2) Height characteristics: Calculate the detection height difference between the cable tie and the surface of the material box, and compare it with the preset standard cable tie thickness. For comparison, the default is... The height deviation index is obtained, and the calculation expression for the detected height is: ; (3) Symmetry characteristics: Calculate the symmetry ratio of the steepness of the two sides of the edge. The calculation expression is as follows: Ideally, the symmetry ratio Approaching 1; (4) Internal flatness characteristics: The flatness of the internal area of the cable tie is calculated by uniform standard deviation. The calculation expression is: ; The cable tie morphology types and classification rules include: (1) For the determination of a tight-fitting cable tie, the following conditions must be met simultaneously: Width requirements: ; Altitude requirements: ; Symmetry condition: ; Internal flatness requirements: , ; (2) For loose cable ties to be judged, the following conditions must be met simultaneously: Width requirements: ; Altitude requirements: ; Symmetry condition: ; Internal flatness requirements: ; (3) For the determination of overlapping cable ties, the following conditions must be met simultaneously: Width requirements: ; Altitude requirements: ; Symmetry condition: ; Internal flatness requirements: ; (4) For the determination of inclined cable ties, the following conditions must be met simultaneously: Width requirements: ; Altitude requirements: ; Symmetry condition: ; Wherein, when the tilt angle of the cable tie exceeds the critical value, causing the width of the cable tie's projection on the surface of the material box to be too small, the internal flatness feature is not used as a judgment condition. (5) The following conditions must be met for a damaged cable tie to be considered: Internal flatness requirements: ; Among them, the determination of damaged cable ties does not rely on width characteristic value, height characteristic value, and symmetry characteristic value, but only on internal flatness.