A method and apparatus for counting paper stacks

By identifying the tilt angle of the paper stack and environmental interference, and utilizing laser ranging and anomaly handling technology, the paper quantity calculation is optimized, solving the problem of inaccurate counting in the paper stack counting method and improving the stability and accuracy of the paper stack counting device in complex environments.

CN120524973BActive Publication Date: 2025-11-14BEIJING HONGHAO QIANRUI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511013212.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-11-14
Estimated Expiration
2045-07-23

AI Technical Summary

Technical Problem

Traditional paper stack counting methods are difficult to ensure the accuracy of the measurement area and the consistency of the counting results when the paper stack is tilted or there is environmental interference. In particular, miscounting or omissions are prone to occur in high-precision and high-speed operating environments.

Method used

By collecting paper stack graphic data, the tilt angle of the paper stack is obtained and compared with the set tilt angle threshold to identify the measurement area; two sets of laser ranging modules are used to generate data streams and process abnormal data, and paper edges are identified by combining rising edge and falling edge detection. A three-level anomaly handling mechanism is adopted to optimize the paper quantity, and finally the accurate quantity is obtained by cross-validation of absolute value calculation and error threshold.

Benefits of technology

This improved adaptability to changes in the paper stack's posture, ensured the rationality of the laser scanning path and the accuracy of data acquisition, and significantly enhanced the robustness and counting stability of the device under complex working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524973B_ABST
    Figure CN120524973B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for counting paper stacks, relating to the field of electronic sensing technology. The method includes: optimizing the initial paper count based on first and second laser ranging measurements using a three-level anomaly handling mechanism to generate optimized paper count results from the first and second laser ranging measurements; calculating the absolute value of the optimized paper count results from the first and second laser ranging measurements to generate a paper count difference, and cross-validating this difference with an error threshold to obtain the final paper count; acquiring and preprocessing paper stack graphic data; obtaining the paper stack tilt angle using Hough transform; and comparing this tilt angle with a set threshold range to achieve accurate identification of the measurement area, ensuring the rationality of the subsequent laser scanning path and the accuracy of data acquisition, thus improving the apparatus's adaptability to changes in paper stack posture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic sensing technology, and in particular to a method and apparatus for counting paper stacks. Background Technology

[0002] In the field of industrial automation and intelligent inspection, paper stack counting technology is widely used in industries such as printing, packaging, and logistics to achieve non-contact, rapid identification of the number of stacked papers. Traditional paper stack counting methods mainly rely on unidirectional laser ranging or image recognition technology. This involves scanning the surface of the paper stack to obtain distance data and combining it with edge detection algorithms to identify the boundary information of each layer of paper, thereby completing the counting task. Such methods typically include basic processes such as data acquisition, filtering, edge recognition, and pulse analysis, which can meet basic counting requirements under normal operating conditions.

[0003] However, in practical applications, traditional paper stack counting methods still have two key limitations: first, they lack an effective mechanism for recognizing and adapting to the tilted state of the paper stack, making it difficult to ensure the accuracy of the measurement area selection; second, they lack dynamic compensation methods for distance measurement errors caused by environmental interference factors (such as dust and paper edge wrinkles), affecting the consistency and reliability of the final counting results. These shortcomings limit the widespread application of existing technologies in complex industrial scenarios, especially in high-precision, high-speed operating environments, where they are prone to miscounting or undercounting. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a paper stack counting method to solve the counting deviation problem caused by unstable paper stack posture and environmental interference.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for counting paper stacks, comprising,

[0008] Collect and preprocess the paper stack graphic data to obtain the paper stack tilt angle, and compare it with the set paper stack tilt angle threshold to identify the measurement area;

[0009] Based on the measurement area, two sets of laser ranging modules scan the paper stack, generating a first laser ranging data stream and a second laser ranging data stream, and processing abnormal data;

[0010] For the first laser ranging and the second laser ranging data stream, the set of paper edge positions is identified by rising edge detection and falling edge detection, and the preliminary number of papers measured by the first laser ranging and the second laser ranging is obtained by counting.

[0011] Based on the initial paper quantity obtained from the first and second laser ranging measurements, an optimization mechanism is used to generate optimized paper quantity results for the first and second laser ranging measurements.

[0012] The absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging is calculated to generate the paper difference, and cross-validated with the range of the error threshold to obtain the final paper quantity.

[0013] As a preferred embodiment of the paper stack counting method of the present invention, the paper stack graphic collection includes the shape, size, tilt angle, surface features and boundary information of the paper stack;

[0014] The preprocessing includes denoising, correcting, and extracting features from the collected paper stack graphic data;

[0015] Based on the preprocessed paper stack graphic data, the paper stack tilt angle is obtained by detecting straight lines and reference planes through Hough transform;

[0016] The paper stack tilt angle is compared with the set paper stack tilt angle threshold range to determine whether the paper stack is within the paper stack tilt angle threshold range and to identify the measurement area.

[0017] In a preferred embodiment of the paper stack counting method of the present invention, the following steps are taken: Two sets of laser ranging modules scan the paper stack according to the measurement area, generating a first laser ranging data stream and a second laser ranging data stream, and processing abnormal data.

[0018] According to the measurement area, two sets of laser ranging modules synchronously scan the paper stack along a predetermined path to obtain a set of distance data points.

[0019] The distance data point set is smoothed and continuously completed to generate the first laser ranging data stream and the second laser ranging data stream;

[0020] The first and second laser ranging data streams are replaced with the median of the neighborhood using a sliding window method, and outlier data is processed.

[0021] In a preferred embodiment of the paper stack counting method of the present invention, the step of identifying the paper edge position set by detecting rising edge and falling edge of the first and second laser ranging data streams is as follows:

[0022] Based on the paper thickness, the detection thresholds for rising and falling edges are set. The rising edge detection method is used to traverse the data streams of the first and second laser ranging, and the difference between adjacent data points is compared point by point.

[0023] The rising edge detection threshold is compared with the difference between adjacent data points to identify the set of starting edge positions of the paper;

[0024] By traversing the first and second laser ranging data streams using the falling edge detection method, comparing the difference between the current data point and the previous data point point by point, and comparing it with the rising edge detection threshold, the set of end edge positions of the paper is identified.

[0025] In a preferred embodiment of the paper stack counting method of the present invention, the specific steps for obtaining the preliminary paper quantity by the first laser ranging and the second laser ranging are as follows:

[0026] Based on the starting and ending edge positions of the paper, the paper pulse set is obtained using the pulse width modulation analysis method.

[0027] The pulse width range is set based on paper thickness and scanning resolution, and the effectiveness of the paper pulse is determined by matching analysis with the paper pulse width.

[0028] When the paper pulse is valid, the valid pulses of the first and second laser ranging are counted to generate a preliminary paper count. When the paper pulse is invalid, the abnormal handling process is initiated.

[0029] In a preferred embodiment of the paper stack counting method of the present invention, the following steps are taken: Based on the preliminary paper count obtained from the first and second laser ranging measurements, optimization is performed using a three-level anomaly handling mechanism to generate optimized paper count results from the first and second laser ranging measurements.

[0030] Based on the preliminary paper counts from the first and second laser ranging measurements, a first-level anomaly detection is performed to identify abnormal situations. The error of the laser ranging caused by paper edge wrinkles is adjusted by the dynamic correction method of edge detection threshold, and the first paper count optimization result is generated.

[0031] Based on the first paper quantity optimization result, a second-level anomaly detection is performed to correct the error of dust on laser ranging and generate a second paper quantity optimization result.

[0032] Based on the optimization results of the second paper quantity, a third-level anomaly detection is performed to identify the error distribution pattern, and influencing factors are obtained through correlation analysis.

[0033] By using a linear regression model to handle anomalies in influencing factors and adjusting for deviations in the calculated paper quantity, optimized paper quantity results for both first and second laser ranging methods are generated.

[0034] As a preferred embodiment of the paper stack counting method of the present invention, the following steps are taken: The absolute value of the paper quantity optimization results from the first laser ranging and the second laser ranging is calculated to generate a paper difference, which is then cross-validated with the range of the error threshold to obtain the final paper quantity.

[0035] Based on the measurement accuracy requirements and the standard deviation of paper thickness, the range of error threshold values ​​is set. Based on the final paper quantity optimization results, the absolute value is calculated to generate the paper difference.

[0036] The paper difference is compared and analyzed with the range of error threshold values ​​to verify the validity of the paper quantity and generate the final paper quantity.

[0037] Secondly, the present invention provides a paper stack counting device, comprising,

[0038] The data acquisition module is used to collect and preprocess the paper stack graphic data, obtain the paper stack tilt angle, compare it with the set paper stack tilt angle threshold, and identify the measurement area.

[0039] The data stream generation module is used to scan the paper stack with two sets of laser ranging modules according to the measurement area, generate the first laser ranging data stream and the second laser ranging data stream, and process abnormal data.

[0040] The preliminary quantity counting module is used to identify the set of paper edge positions by detecting rising and falling edges of the first and second laser ranging data streams, and to count the preliminary paper quantity of the first and second laser ranging.

[0041] The optimization processing module is used to optimize the paper quantity based on the initial paper quantity obtained from the first laser ranging and the second laser ranging through a three-level anomaly handling mechanism, and generate optimized paper quantity results for the first laser ranging and the second laser ranging.

[0042] The final quantity module is used to calculate the absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging, generate the paper difference, and cross-validate it with the range of the error threshold to obtain the final paper quantity.

[0043] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein the computer program, when executed by the processor, implements any step of the paper stack counting method as described in the first aspect of the present invention.

[0044] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the paper stack counting method as described in the first aspect of the present invention.

[0045] The beneficial effects of this invention are as follows: By collecting and preprocessing the paper stack graphic data, combining it with Hough transform to obtain the paper stack tilt angle, and comparing it with the set paper stack tilt angle threshold range, accurate identification of the measurement area is achieved, ensuring the rationality of the subsequent laser scanning path and the accuracy of data acquisition, and improving the device's adaptability to changes in paper stack posture; through a three-level anomaly handling mechanism, which sequentially adopts dynamic correction of edge detection threshold, laser reflection intensity compensation, and linear regression model adjustment of deviation, multi-level fine correction of the paper quantity optimization results is achieved, significantly enhancing the robustness and counting stability of the device under complex working conditions. Attached Figure Description

[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart of the paper stack counting method.

[0048] Figure 2 This is a schematic diagram of a paper stack counting structure device.

[0049] Figure 3 The flowchart for generating the data flow module.

[0050] Figure 4 The flowchart is designed to optimize the processing module. Detailed Implementation

[0051] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0052] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0053] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0054] Reference Figures 1-4As one embodiment of the present invention, this embodiment provides a method for counting paper stacks, including the following steps:

[0055] S1. Collect and preprocess the paper stack graphic data, obtain the paper stack tilt angle, and compare it with the set paper stack tilt angle threshold to identify the measurement area;

[0056] The collected paper stack graphics include the shape, size, tilt angle, surface features, and boundary information of the paper stack;

[0057] Preprocessing includes denoising, correction, and feature extraction of the collected paper stack graphic data;

[0058] In the preprocessing stage, median filtering is applied to the acquired paper stack images to eliminate environmental noise, perspective transformation is used to correct geometric distortion caused by the shooting angle, and histogram equalization is used to enhance contrast. In the feature extraction stage, edge detection algorithms (such as the Canny operator) are used to locate the paper stack outline, and morphological processing is combined to eliminate minor interference. Hough transform or contour analysis is used to extract feature parameters such as the number of layers, edge straightness, and stacking offset of the paper stack.

[0059] Based on the preprocessed paper stack graphic data, the paper stack tilt angle is obtained by detecting straight lines and reference planes through Hough transform;

[0060] It should be noted that an edge detection algorithm is performed on the preprocessed paper stack graphic data to obtain a clear edge image, which is used as the input of the Hough transform. Then, the Hough transform algorithm is applied to convert the points in the edge image into lines in the parameter space, and a set of detected line parameters is output. The principal line representing the paper stack boundary is selected from the set of line parameters, and its angle value in the two-dimensional image coordinate system is determined, and the angle value of the principal line of the paper stack boundary is output. Based on the obtained angle value of the principal line of the paper stack boundary, the actual tilt angle relative to the reference plane is calculated, and the final tilt angle of the paper stack is output.

[0061] The paper stack tilt angle is compared with the set paper stack tilt angle threshold range to determine whether the paper stack is within the paper stack tilt angle threshold range and to identify the measurement area;

[0062] It should be noted that, firstly, a threshold range for the paper stack tilt angle is set according to the accuracy requirements and application scenario. This threshold range defines the allowable tilt angle range of the paper stack. Next, the tilt angle of the paper stack is compared and analyzed with the threshold range to determine whether the tilt angle is completely within the threshold range. If the tilt angle is within the threshold range, a Boolean value indicating a true measurement area is output, indicating that the paper stack is within an acceptable tilt range and the identified measurement area is valid. Conversely, if the tilt angle exceeds the threshold range, a false measurement area is output, indicating that the tilt of the paper stack exceeds the allowable range and the laser needs to be adjusted for rescanning.

[0063] The paper stack tilt angle threshold range is set based on the laser measurement accuracy requirements and the allowable deviation of the paper stack angle in the application scenario. It is used to determine whether the paper stack is within an acceptable tilt range to ensure the effectiveness and accuracy of the measurement area. For example, using a line perpendicular to the ground as a reference plane, the included angle between the two sides should not exceed 5°.

[0064] S2. Based on the measurement area, the two sets of laser ranging modules scan the paper stack, generate the first laser ranging data stream and the second laser ranging data stream, and process abnormal data.

[0065] According to the measurement area, two sets of laser ranging modules synchronously scan the paper stack along a predetermined path to obtain a set of distance data points.

[0066] It should be noted that, firstly, based on the measurement area, the starting and ending scanning positions of the laser ranging module are determined, and a predetermined scanning path suitable for the measurement area is planned; then, the first and second laser ranging modules are activated, so that they move synchronously along their respective predetermined scanning paths at the same scanning speed and sampling frequency, to perform non-contact distance measurement on the surface of the paper stack, generating a series of discrete distance measurement values, namely the first laser ranging original distance data point set and the second laser ranging original distance data point set.

[0067] The distance data point set is smoothed and continuously completed to generate the first laser ranging data stream and the second laser ranging data stream;

[0068] Furthermore, each set of original laser ranging data points is first segmented according to its corresponding scanning path order to construct a data input set for interpolation calculation; then, an interpolation fitting method is used to mathematically fit each set of data inputs to generate a sequence of fitted distance values ​​with continuous distribution characteristics; next, the fitted distance value sequence is arranged in time or space order to form a continuous and smooth first laser ranging data stream and second laser ranging data stream.

[0069] The first and second laser ranging data streams are replaced with the median of the neighborhood using a sliding window method, and outlier data is processed.

[0070] Furthermore, the window length and sliding step size of the sliding window are first set, and the sliding window slides sequentially over the first and second laser ranging data streams. For each subset of data covered by the sliding window, the median in the neighborhood is calculated, and the median is used as the replacement value for the current window center position to generate the first and second median replacement data streams after preliminary smoothing. Subsequently, a further median filtering algorithm is performed on the first and second median replacement data streams to remove any remaining isolated outliers or abrupt noise, ultimately generating optimized first and second laser ranging data streams with higher stability and consistency.

[0071] In the sliding window method, the neighborhood refers to the set of data points covered by the sliding window.

[0072] Abnormal data refers to isolated outliers or sudden noise.

[0073] S3. For the first laser ranging and the second laser ranging data stream, identify the set of paper edge positions by rising edge detection and falling edge detection, and obtain the preliminary number of papers for the first laser ranging and the second laser ranging.

[0074] Based on the paper thickness, the detection thresholds for rising and falling edges are set. The rising edge detection method is used to traverse the data streams of the first and second laser ranging, and the difference between adjacent data points is compared point by point.

[0075] It should be noted that, firstly, the height change reference value for edge recognition is calculated based on the paper thickness; then, rising edge detection threshold and falling edge detection threshold are set according to the height change reference value, and output as rising edge detection threshold and falling edge detection threshold respectively; subsequently, the rising edge detection method is used to traverse the first laser ranging data stream and the second laser ranging data stream point by point, and the difference between the current data point and the previous data point is compared in turn to output the adjacent point difference sequence.

[0076] The rising edge detection threshold is compared with the difference between adjacent data points to identify the set of starting edge positions of the paper;

[0077] The detection threshold range for rising and falling edges is set according to the paper thickness and laser measurement accuracy. For example, with an average paper thickness of 0.1 mm and a measurement accuracy of ±0.02 mm, the detection threshold range for rising and falling edges can be set between 0.08 mm and 0.12 mm to ensure accurate identification of paper edge changes and avoid noise interference.

[0078] Furthermore, each difference element in the adjacent point difference sequence is compared with the rising edge detection threshold in turn; when a difference element is greater than or equal to the rising edge detection threshold, the data point corresponding to that position is determined to be a potential paper starting edge point; then, according to the preset edge positioning rules, the physical position information of the starting edge point in the original laser ranging data stream is determined, and the paper starting edge position set is output.

[0079] The preset process for edge localization rules is as follows: set the rising edge detection threshold and falling edge detection threshold according to the paper thickness, and output the rising edge detection threshold and falling edge detection threshold; determine the sliding window size according to the laser ranging data sampling frequency and the paper stacking height resolution, and output the sliding window size; obtain the neighborhood comparison logic by combining the predetermined scanning path and data arrangement order, and output the neighborhood comparison logic; combine the rising edge detection threshold, falling edge detection threshold, sliding window size and logic to form a complete edge localization rule.

[0080] By traversing the first and second laser ranging data streams using the falling edge detection method, comparing the difference between the current data point and the previous data point point by point, and comparing it with the rising edge detection threshold, the set of paper end edge positions is identified.

[0081] It should be noted that, firstly, the first and second laser ranging optimized data streams are traversed point by point using the falling edge detection method, and the difference between the current data point and the previous data point is compared in turn to output the adjacent point difference sequence. Then, the adjacent point difference sequence is compared with the preset rising edge detection threshold. When the difference between adjacent points is less than the negative rising edge detection threshold, it is determined to be a falling edge trigger point. Based on the position information of the falling edge trigger point in the original data stream, combined with the preset edge positioning rules, the specific position of the paper end edge is determined, and the paper end edge position set is output.

[0082] Based on the starting and ending edge positions of the paper, the paper pulse set is obtained using the pulse width modulation analysis method.

[0083] It should be noted that, firstly, using each pair of start and end edge positions as boundaries, laser ranging data segments within the corresponding intervals are extracted to form the ranging waveform segments corresponding to the paper; then, the height change amplitude and duration features of each ranging waveform segment are extracted to output a set of paper pulse feature parameters; finally, the paper pulse feature parameter set is analyzed based on pulse recognition logic to identify each valid paper pulse and output a set of paper pulses.

[0084] The pulse width range is set based on paper thickness and scanning resolution, and the effectiveness of the paper pulse is determined by matching analysis with the paper pulse width.

[0085] The pulse width range is set according to the paper thickness and scanning resolution. For example, when the average paper thickness is 0.1 mm and the scanning resolution is ±0.02 mm, the pulse width range can be set to 0.08 mm to 0.12 mm to ensure accurate identification of valid paper pulses and exclusion of invalid pulses.

[0086] It should be noted that, firstly, the pulse width range corresponding to a single sheet of paper is set according to the paper thickness and the scanning resolution of the laser; then, the width of each pulse in the paper pulse set is compared with the pulse width range, and each pulse width is analyzed to see if it falls within the pulse width range; if the width of the paper pulse is within the pulse width range, the pulse is determined to be a valid pulse and is marked as a valid paper pulse; otherwise, it is marked as an invalid pulse and excluded.

[0087] When the paper pulse is valid, the valid pulses of the first and second laser ranging are counted to generate a preliminary paper count. When the paper pulse is invalid, the abnormal handling process is initiated.

[0088] Furthermore, the effective pulses in the corresponding directions of the first laser ranging and the second laser ranging are counted separately, and the number of effective pulses in the first direction and the number of effective pulses in the second direction are output. A preliminary number of paper is generated and recorded as the preliminary number of paper for the first laser ranging and the preliminary number of paper for the second laser ranging, respectively. When a paper pulse is not included in the set of effective paper pulses, it is determined to be an invalid pulse. The pulse information and the corresponding ranging data are marked as abnormal data, the abnormal pulse information set is output, and the abnormal processing procedure is triggered to rescan and measure.

[0089] S4. Based on the preliminary paper quantity obtained from the first laser ranging and the second laser ranging, optimize the paper quantity obtained from the first laser ranging and the second laser ranging through a three-level anomaly handling mechanism to generate optimized paper quantity results for the first laser ranging and the second laser ranging.

[0090] Based on the preliminary paper counts from the first and second laser ranging measurements, a first-level anomaly detection is performed to identify abnormal situations. The error of the laser ranging caused by paper edge wrinkles is adjusted by the dynamic correction method of edge detection threshold, and the first paper count optimization result is generated.

[0091] It should be noted that, firstly, the absolute difference between the first preliminary paper quantity and the second preliminary paper quantity is calculated, and the paper quantity difference is output; then, the paper quantity difference is compared with a preset first-level anomaly judgment threshold. If the paper quantity difference is greater than the first-level anomaly judgment threshold, a first-level anomaly is determined to exist, and a first-level anomaly status signal of true is output; in the case of an anomaly, the edge detection threshold dynamic correction method is called to dynamically adjust the edge detection threshold in the first laser ranging optimization data stream and the second laser ranging optimization data stream, correcting the laser ranging error caused by paper edge wrinkles, and the first paper quantity optimization result is output.

[0092] The process of setting the threshold for first-level anomaly detection involves first statistically analyzing the distribution of paper quantity differences under different working conditions based on historical data, and then selecting a value that can both reflect normal measurement fluctuations and effectively identify abnormal states as the threshold benchmark, taking into account the requirements of the application scenario for counting accuracy.

[0093] The range of values ​​for the first-level anomaly detection threshold, such as the laser ranging accuracy (e.g., ±0.1mm) and the average paper thickness (e.g., 0.1mm), can be set to 0~0.1mm.

[0094] Based on the first paper quantity optimization result, a second-level anomaly detection is performed to correct the error of dust on laser ranging and generate a second paper quantity optimization result.

[0095] Furthermore, firstly, the laser reflection intensity data in the first laser ranging optimization data stream corresponding to the first paper quantity optimization result is obtained through data analysis, and the laser reflection intensity data sequence is output. Then, based on the compensation method between reflection intensity and ranging error, the laser reflection intensity data sequence is converted into the corresponding ranging error compensation value, and the ranging error compensation value sequence is output. Next, the ranging error compensation value sequence is used to correct the original laser ranging data, generating a corrected laser ranging data stream, and edge detection and pulse validity discrimination are re-executed. Finally, the number of valid pulses is counted, and the second paper quantity optimization result is output.

[0096] Based on the optimization results of the second paper quantity, a third-level anomaly detection is performed to identify the error distribution pattern, and influencing factors are obtained through correlation analysis.

[0097] It should be noted that, firstly, based on the optimized second paper quantity results and the corresponding actual paper quantity within multiple measurement cycles, the ranging error value for each cycle is calculated, and a ranging error sample set is output. Then, a clustering algorithm is used to group and analyze the ranging error sample set, identifying error distribution patterns with similar characteristics, and an error clustering result set is output. Next, each clustering result is matched item by item with the environmental parameters, operating conditions, and equipment status information synchronously recorded within the measurement cycle, such as variables like temperature, humidity, laser emission intensity, and scanning speed as candidate factors. Subsequently, a correlation analysis is performed between each type of error distribution pattern and the candidate factors, and the degree of correlation between each variable and the error value is calculated using the Pearson correlation coefficient or Spearman rank correlation method, outputting the key influencing factors.

[0098] By using a linear regression model to handle anomalies in influencing factors and adjusting for deviations in the calculated paper quantity, the paper quantity optimization results of the first and second laser ranging methods are generated.

[0099] Furthermore, firstly, a linear regression model is constructed based on historical measurement data and variables in the list of influencing factors, and the parameter set of the linear regression model is output. Then, the values ​​of influencing factors within the measurement period are input into the parameter set of the linear regression model to predict the corresponding paper quantity deviation value, and the predicted paper quantity deviation value is output. Next, the predicted paper quantity deviation value is used to compensate and correct the calculated paper quantity values ​​of the first laser ranging and the second laser ranging, generating the final optimized paper quantity result in the first laser ranging direction and the final optimized paper quantity result in the second laser ranging direction.

[0100] The training process of the linear regression model involves analyzing historical measurement data (the historical measurement dataset contains the calculated number of laser rangefinder paper sheets in multiple measurement periods, the corresponding actual number of sheets, and key influencing factors associated with each period), and estimating the parameters of the linear regression model using the least squares method or gradient descent method to generate the regression coefficients with the smallest sum of squared prediction errors, thus completing the training process of the linear regression model.

[0101] S5. Calculate the absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging to generate the paper difference, and cross-validate it with the range of the error threshold to obtain the final paper quantity.

[0102] Based on the measurement accuracy requirements and the standard deviation of paper thickness, the range of error threshold values ​​is set. Based on the final paper quantity optimization results, the absolute value is calculated to generate the paper difference.

[0103] It should be noted that, firstly, based on the laser measurement accuracy requirements and historical statistical data of paper thickness, the standard deviation of paper thickness is calculated and output; then, combining the height variation corresponding to a single sheet of paper with the maximum allowable measurement deviation, the range of error threshold values ​​for consistency determination is set and output; subsequently, based on the final optimized paper quantity results of the first laser ranging and the second laser ranging, the absolute difference between the two is calculated using the absolute difference calculation method, and the paper difference value is output.

[0104] Set the range of error threshold values. For example, assuming the average thickness of a single sheet of paper is 0.1mm, the laser measurement accuracy is ±0.1mm, the standard deviation of paper thickness is 0.02mm, and the safety factor of 3 is used to calculate that the maximum allowable fluctuation is 0.16mm, which corresponds to an error of approximately ±1.6 sheets of paper. Therefore, the range of error threshold values ​​is set to [-1.6, +1.6].

[0105] The paper difference is compared and analyzed with the range of error threshold values ​​to verify the validity of the paper quantity and generate the final paper quantity.

[0106] When the paper quantity optimization results of the first laser ranging and the second laser ranging are consistent, then it is the final paper quantity.

[0107] When the difference between the paper quantity optimization results of the first laser ranging and the second laser ranging is within the range of the error threshold, the average value is taken as the paper quantity.

[0108] When the difference in the number of papers between the first and second laser ranging measurements is not within the range of the error threshold, the measurement area is adjusted and rescanned using the edge feature matching analysis method.

[0109] Furthermore, the paper difference is first compared with the range of the error threshold to determine whether it is less than or equal to the range of the error threshold. If the paper difference is less than or equal to the range of the error threshold, the final paper quantity optimization results of the first laser ranging and the second laser ranging are determined to be consistent, the validity status signal is output as true, and the average of the two is taken to obtain the final paper quantity. If the paper difference is greater than the range of the error threshold, the results are determined to be inconsistent, the validity status signal is output as false, and the feedback correction mechanism is triggered to adjust the relevant parameters.

[0110] This embodiment also provides a paper stack counting device, including:

[0111] The data acquisition module is used to collect and preprocess the paper stack graphic data, obtain the paper stack tilt angle, compare it with the set paper stack tilt angle threshold, and identify the measurement area.

[0112] The data stream generation module is used to scan the paper stack with two sets of laser ranging modules according to the measurement area, generate the first laser ranging data stream and the second laser ranging data stream, and process abnormal data.

[0113] The preliminary quantity counting module is used to identify the set of paper edge positions by detecting rising and falling edges of the first and second laser ranging data streams, and to count the preliminary paper quantity of the first and second laser ranging.

[0114] The optimization processing module is used to optimize the paper quantity based on the initial paper quantity obtained from the first laser ranging and the second laser ranging through a three-level anomaly handling mechanism, and generate optimized paper quantity results for the first laser ranging and the second laser ranging.

[0115] The final quantity module is used to calculate the absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging, generate the paper difference, and cross-validate it with the range of the error threshold to obtain the final paper quantity.

[0116] This embodiment also provides a computer device applicable to the paper stack counting method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the paper stack counting method proposed in the above embodiment.

[0117] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a device bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores operating devices and computer programs. The internal memory provides an environment for the operation of the operating devices and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0118] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the paper stack counting method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0119] In summary, this invention achieves accurate identification of the measurement area by: acquiring and preprocessing paper stack graphic data; obtaining the paper stack tilt angle using Hough transform; and comparing it with a set paper stack tilt angle threshold range. This ensures the rationality of the subsequent laser scanning path and the accuracy of data acquisition, improving the device's adaptability to changes in paper stack posture. Furthermore, through a three-level anomaly handling mechanism—employing dynamic correction of edge detection thresholds, laser reflection intensity compensation, and linear regression model adjustment of deviations—multi-level fine-grained correction of the paper quantity optimization results is achieved, significantly enhancing the device's robustness and counting stability under complex operating conditions.

[0120] It should be noted that 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 preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for counting stacks of paper, characterized in that: include, Collect and preprocess the paper stack graphic data to obtain the paper stack tilt angle, and compare it with the set paper stack tilt angle threshold to identify the measurement area; Based on the measurement area, two sets of laser ranging modules scan the paper stack, generating a first laser ranging data stream and a second laser ranging data stream, and processing abnormal data; For the first laser ranging and the second laser ranging data stream, the set of paper edge positions is identified by rising edge detection and falling edge detection, and the preliminary number of papers measured by the first laser ranging and the second laser ranging is obtained by counting. Based on the preliminary paper counts from the first and second laser ranging measurements, a first-level anomaly detection is performed to identify abnormal situations. The error of the laser ranging caused by paper edge wrinkles is adjusted by the dynamic correction method of edge detection threshold, and the first paper count optimization result is generated. Based on the first paper quantity optimization result, a second-level anomaly detection is performed to correct the error of dust on laser ranging and generate a second paper quantity optimization result. Based on the optimization results of the second paper quantity, a third-level anomaly detection is performed to identify the error distribution pattern, and influencing factors are obtained through correlation analysis. By using a linear regression model to handle anomalies in influencing factors and adjusting for deviations in the calculated paper quantity, the paper quantity optimization results for the first and second laser ranging methods are generated. Based on the measurement accuracy requirements and the standard deviation of paper thickness, the range of error threshold values ​​is set. Based on the final paper quantity optimization results, the absolute value is calculated to generate the paper difference. The paper quantity is verified by comparing the paper difference with the range of the error threshold, and the final paper quantity is generated. The absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging is calculated to generate the paper difference, and cross-validated with the range of the error threshold to obtain the final paper quantity.

2. The paper stack counting method as described in claim 1, characterized in that: The paper stack graphic data includes the shape, size, tilt angle, surface features, and boundary information of the paper stack; The preprocessing includes denoising, correcting, and extracting features from the collected paper stack graphic data; Based on the preprocessed paper stack graphic data, the paper stack tilt angle is obtained by detecting straight lines and reference planes through Hough transform; The paper stack tilt angle is compared with the set paper stack tilt angle threshold range to determine whether the paper stack is within the paper stack tilt angle threshold range and to identify the measurement area.

3. The paper stack counting method as described in claim 2, characterized in that: According to the measurement area, two sets of laser ranging modules scan the paper stack, generating a first laser ranging data stream and a second laser ranging data stream, and processing abnormal data. The specific steps are as follows. According to the measurement area, two sets of laser ranging modules synchronously scan the paper stack along a predetermined path to obtain a set of distance data points. The distance data point set is smoothed and continuously completed to generate the first laser ranging data stream and the second laser ranging data stream; The first and second laser ranging data streams are replaced with the median of the neighborhood using a sliding window method, and outlier data is processed.

4. The paper stack counting method as described in claim 3, characterized in that: The process of identifying the paper edge position set by detecting rising and falling edges of the first and second laser ranging data streams is as follows: Based on the paper thickness, the detection thresholds for rising and falling edges are set. The rising edge detection method is used to traverse the data streams of the first and second laser ranging, and the difference between adjacent data points is compared point by point. The rising edge detection threshold is compared with the difference between adjacent data points to identify the set of starting edge positions of the paper; By traversing the first and second laser ranging data streams using the falling edge detection method, comparing the difference between the current data point and the previous data point point by point, and comparing it with the rising edge detection threshold, the set of end edge positions of the paper is identified.

5. The paper stack counting method as described in claim 4, characterized in that: The preliminary number of papers obtained from the first and second laser ranging measurements is determined through the following steps. Based on the starting and ending edge positions of the paper, the paper pulse set is obtained using the pulse width modulation analysis method. The pulse width range is set based on paper thickness and scanning resolution, and the effectiveness of the paper pulse is determined by matching analysis with the paper pulse width. When the paper pulse is valid, the valid pulses of the first and second laser ranging are counted to generate a preliminary paper count. When the paper pulse is invalid, the abnormal handling process is initiated.

6. A paper stack counting device, based on the paper stack counting method according to any one of claims 1 to 5, characterized in that: include, The data stream generation module is used to scan the paper stack with two sets of laser ranging modules according to the measurement area, generate the first laser ranging data stream and the second laser ranging data stream, and process abnormal data. The preliminary quantity counting module is used to identify the set of paper edge positions by detecting rising and falling edges of the first and second laser ranging data streams, and to count the preliminary paper quantity of the first and second laser ranging. The optimization processing module is used to optimize the paper quantity based on the initial paper quantity of the first laser ranging and the second laser ranging through a three-level anomaly handling mechanism, and generate the optimized paper quantity result of the first laser ranging and the second laser ranging. The final quantity module is used to calculate the absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging, generate the paper difference, and cross-validate it with the range of the error threshold to obtain the final paper quantity.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the paper stack counting method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the paper stack counting method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Coarse-fine two-stage paper counting method based on space and gray features

    CN106096713A

  • Paper sheet counting device and paper sheet counting method

    JP2011065378A