Paper stack counting method and device

By identifying the inclination angle of the stack, laser ranging data processing and three-level abnormal correction, the counting deviation caused by attitude instability and environmental interference in the stack point count method is solved, and the accurate identification and stable counting of the stack point count are achieved.

CN120524973AActive Publication Date: 2025-08-22BEIJING HONGHAO QIANRUI TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The traditional paper stack point counting method lacks effective identification of counting inaccuracy caused by environmental interference factors in the face of the inclined state of the paper stack, especially in high-precision and high-speed operating environments.

Method used

By collecting paper stack graphic data, the inclination angle of the paper stack is obtained and compared with the set inclination threshold, and the measurement area is identified; two sets of laser ranging modules are used to scan and process abnormal data, and the paper edge is identified by combining rising and falling edge detection. The three-level abnormality processing mechanism is used to optimize the paper quantity, and finally the accurate quantity is obtained through cross-verification of absolute value calculation and error threshold.

Benefits of technology

The adaptive identification and data acquisition accuracy of paper stack attitude changes is achieved, the robustness and stability of counting are improved, and the counting accuracy is significantly enhanced under complex working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524973A_ABST
    Figure CN120524973A_ABST
Patent Text Reader

Abstract

The invention discloses a paper stack counting method and device, and relates to the technical field of electronic sensing, and the method comprises the steps: carrying out the optimization through a three-stage exception handling mechanism according to the initial paper number of first laser ranging and second laser ranging, and generating the optimization result of the paper number of the first laser ranging and second laser ranging; and performing absolute value calculation on the paper quantity optimization results of the first laser ranging and the second laser ranging to generate a paper difference value, and performing cross validation on the paper difference value and an error threshold to obtain the final paper quantity. Paper stack graph data are collected and preprocessed, a paper stack inclination angle is obtained by combining Hough transform, and the paper stack inclination angle is compared with a set paper stack inclination angle threshold interval, so that accurate identification of a measurement area is realized, the rationality of a subsequent laser scanning path and the accuracy of data collection are ensured, and the adaptability of the device to the posture change of the paper stack is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic sensor technology, in particular to a method and device for counting paper piles. Background Art

[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 quickly and contactlessly identify the number of stacked sheets. Traditional paper stack counting methods rely primarily on unidirectional laser ranging or image recognition technology. These methods scan the surface of the stack to obtain distance data and combine it with edge detection algorithms to identify the boundaries of each layer of paper to complete the counting task. These methods typically include basic processes such as data acquisition, filtering, edge recognition, and pulse analysis, and can meet basic counting requirements under normal working conditions.

[0003] However, in practical applications, traditional paper stack counting methods still have two key limitations: first, they lack effective recognition and adaptation mechanisms for stack tilt, making it difficult to accurately select the measurement area; second, they lack dynamic compensation for ranging errors caused by environmental interference factors (such as dust and wrinkled paper edges), affecting the consistency and reliability of the final counting results. These shortcomings restrict 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 missing counts. Summary of the Invention

[0004] In view of the above 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] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, the present invention provides a paper stack counting method, which comprises: Collect and pre-process the paper stack graphic data to obtain the paper stack inclination angle, compare it with the set paper stack inclination angle threshold, and identify the measurement area; According to the measurement area, two groups 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; For the first laser ranging data stream and the second laser ranging data stream, the paper edge position set is identified by rising edge detection and falling edge detection, and the preliminary paper quantity obtained by the first laser ranging data stream and the second laser ranging data stream is obtained by counting. Based on the preliminary paper quantity measured by the first laser ranging and the second laser ranging, optimization is performed through a three-level exception handling mechanism to generate optimized results of the paper quantity measured by the first laser ranging and the second laser ranging; The absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging is calculated to generate a paper difference, which is cross-validated with the value range of the error threshold to obtain the final paper quantity.

[0007] As a preferred embodiment of the paper stack counting method of the present invention, the collected paper stack graphics include the shape, size, inclination, surface features and boundary information of the paper stack; The pre-processing includes denoising, correction and paper stack feature extraction of the collected paper stack graphic data; According to the pre-processed paper stack graphic data, the straight line and reference plane are detected through Hough transform to obtain the inclination angle of the paper stack; The paper stack inclination angle is compared with the set paper stack inclination angle threshold range to determine whether the paper stack is within the paper stack inclination angle threshold range and identify the measurement area.

[0008] As a preferred solution of the paper stack counting method of the present invention, wherein: according to the measurement area, two groups of laser ranging modules scan the paper stack, generate a first laser ranging data stream and a second laser ranging data stream, and process abnormal data, the specific steps are as follows: Based on 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; Smoothing and continuously completing the distance data point set to generate a first laser ranging data stream and a second laser ranging data stream; The first laser ranging data stream and the second laser ranging data stream are replaced by the median value in the neighborhood through the sliding window method, and abnormal data are processed.

[0009] As a preferred solution of the paper stack counting method of the present invention, wherein: the first laser ranging data stream and the second laser ranging data stream are used to identify the paper edge position set by rising edge detection and falling edge detection, and the specific steps are as follows: According to the paper thickness, the detection thresholds of rising and falling edges are set, and the first laser ranging data stream and the second laser ranging data stream are traversed by the rising edge detection method, and the difference between adjacent data points is compared point by point; Compare the rising edge detection threshold with the difference between adjacent data points to identify the starting edge position set of the paper; The first laser ranging data stream and the second laser ranging data stream are traversed by the falling edge detection method, the difference between the current data point and the previous data point is compared point by point, and compared with the rising edge detection threshold to identify the end edge position set of the paper.

[0010] As a preferred solution of the paper stack counting method of the present invention, the statistical method of obtaining the preliminary number of paper sheets by the first laser ranging and the second laser ranging is as follows: According to the starting edge position and the ending edge position of the paper, a paper pulse set is obtained by a pulse width modulation analysis method; The pulse width interval is set based on the paper thickness and scanning resolution, and the validity of the paper pulse is determined by matching and analyzing the paper pulse width. When the paper pulse is valid, the valid pulses of the first laser ranging and the second laser ranging are counted to generate a preliminary paper quantity. When the paper pulse is invalid, the exception handling process is entered.

[0011] As a preferred embodiment of the paper stack counting method of the present invention, the preliminary paper counts obtained by the first laser ranging and the second laser ranging are optimized by a three-level exception handling mechanism to generate optimized results of the paper counts obtained by the first laser ranging and the second laser ranging. The specific steps are as follows: Based on the preliminary paper quantity measured by the first laser ranging and the second laser ranging, a first-level anomaly detection is performed to identify abnormal situations, and the error caused by the paper edge wrinkles to the laser ranging is adjusted by the edge detection threshold dynamic correction method to generate the first paper quantity optimization result; Based on the first paper quantity optimization result, a second level of anomaly detection is performed to correct the error of dust on laser ranging and generate a second paper quantity optimization result; Based on the second paper quantity optimization result, three-level anomaly detection is performed to identify the error distribution pattern and obtain the influencing factors through correlation analysis method; The linear regression model is used to handle the abnormality of the influencing factors and adjust the deviation of the calculated value of the paper quantity to generate the optimized results of the paper quantity of the first laser ranging and the second laser ranging.

[0012] As a preferred solution of the paper stack counting method of the present invention, wherein: the absolute value calculation of the optimized results of the first laser ranging and the second laser ranging paper quantity is performed to generate a paper difference, and cross-validated with the value range of the error threshold to obtain the final paper quantity. The specific steps are as follows: The error threshold value range is set based on the measurement accuracy requirements and the standard deviation of paper thickness. Based on the final paper quantity optimization result, the absolute value calculation is performed to generate the paper difference value. The paper difference is compared with the value range of the error threshold to verify the validity of the paper quantity and generate the final paper quantity.

[0013] In a second aspect, the present invention provides a paper stack counting device, comprising: The data acquisition module is used to collect and pre-process the paper stack graphic data, obtain the paper stack inclination angle, and compare it with the set paper stack inclination angle threshold to identify the measurement area; A data stream generation module is used to scan the paper stack with two sets of laser ranging modules according to the measurement area, generate a first laser ranging data stream and a second laser ranging data stream, and process abnormal data; A preliminary number counting module is used to identify the paper edge position set by detecting the rising edge and the falling edge of the first laser ranging data stream and the second laser ranging data stream, and obtain the preliminary number of paper sheets by counting the first laser ranging and the second laser ranging data stream; An optimization processing module is used to optimize the preliminary paper quantity obtained by the first laser ranging and the second laser ranging through a three-level exception handling mechanism to generate an optimization result of the paper quantity obtained by 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 a paper difference, and cross-validate it with the value range of the error threshold to obtain the final paper quantity.

[0014] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the paper stack counting method described in the first aspect of the present invention is implemented.

[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the paper stack counting method described in the first aspect of the present invention is implemented.

[0016] The beneficial effects of the present invention are as follows: by collecting and preprocessing the graphic data of the paper stack, combining the Hough transform to obtain the inclination angle of the paper stack, and comparing it with the set threshold range of the paper stack inclination angle, 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 adaptability of the device to changes in the posture of the paper stack; through the three-level exception handling mechanism, dynamic correction of the edge detection threshold, laser reflection intensity compensation and linear regression model adjustment deviation are adopted in turn, to achieve multi-level fine correction of the optimization result of the paper quantity, significantly enhancing the robustness and counting stability of the device under complex working conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 Flowchart of the paper pile counting method.

[0019] Figure 2 Schematic diagram of the paper stack counting structure device.

[0020] Figure 3 Generate a flowchart for the data flow module.

[0021] Figure 4 Flowchart of the optimization processing module. DETAILED DESCRIPTION

[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0024] Secondly, the term "one embodiment" or "embodiment" 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 various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.

[0025] Reference Figures 1 to 4 , is an embodiment of the present invention, which provides a paper stack counting method, comprising the following steps: S1. Collect and pre-process paper stack graphic data to obtain the paper stack inclination angle, compare it with the set paper stack inclination angle threshold, and identify the measurement area; Collecting paper stack graphics including the shape, size, inclination, surface features and boundary information of the paper stack; Preprocessing includes denoising, correction and stack feature extraction of the collected paper stack graphic data; During preprocessing, median filtering is performed on the collected paper stack images to eliminate ambient noise. Perspective transformation is used to correct geometric distortion caused by the shooting angle, and histogram equalization is used to enhance contrast. During the feature extraction stage, edge detection algorithms (such as the Canny operator) are used to locate the outline of the paper stack. Morphological processing is combined to eliminate minor interference. Hough transforms or contour analysis are used to extract characteristic parameters such as the number of layers, edge straightness, and stacking offset.

[0026] According to the pre-processed paper stack graphic data, the straight line and reference plane are detected through Hough transform to obtain the inclination angle of the paper stack; It should be noted that an edge detection algorithm is performed on the preprocessed paper stack graphic data to obtain a clear edge image 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 series of detected straight line parameter sets are output; the main straight line representing the paper stack boundary is screened out from the straight line parameter set, and its angle value in the two-dimensional image coordinate system is determined, and the angle value of the main straight line of the paper stack boundary is output; based on the obtained angle value of the main straight line of the paper stack boundary, the actual inclination angle relative to the reference plane is calculated, and the final paper stack inclination angle is output.

[0027] Compare the paper stack inclination angle with the set paper stack inclination angle threshold range to determine whether the paper stack is within the paper stack inclination angle threshold range and identify the measurement area; It should be noted that first, the stack inclination angle threshold interval is set according to the accuracy requirements and application scenarios. The stack inclination angle threshold interval defines the allowable stack inclination angle range; then the stack inclination angle is compared and analyzed with the stack inclination angle threshold interval to determine whether the stack inclination angle is completely within the stack inclination angle threshold interval; if the stack inclination angle is within the stack inclination angle threshold interval, a Boolean value measurement area status is output as true (True), indicating that the stack is within the acceptable inclination range and the identified measurement area is valid; conversely, if the stack inclination angle exceeds the stack inclination angle threshold interval, the measurement area status is output as false (False), indicating that the stack inclination exceeds the allowable range and the laser needs to be adjusted for rescanning.

[0028] The stack tilt threshold range is set based on the laser measurement accuracy requirements and the application scenario's tolerance for paper stack angles. This threshold determines whether the stack is within an acceptable tilt range, ensuring the validity and accuracy of the measurement area. For example, using a line perpendicular to the ground as the reference plane, the angle between the two sides should not exceed 5°.

[0029] S2. Two groups of laser ranging modules scan the paper stack according to the measurement area, generate a first laser ranging data stream and a second laser ranging data stream, and process abnormal data; Based on 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; It should be noted that, first, the starting scanning position and the ending scanning position of the laser ranging module are determined according to the measurement area, and a predetermined scanning path suitable for the measurement area is planned; then, the first laser ranging module and the second laser ranging module are started, so that they move synchronously along their respective predetermined scanning paths at the same scanning speed and sampling frequency, and non-contact distance measurement is performed 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.

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

[0031] The first laser ranging data stream and the second laser ranging data stream are replaced by the median value in the neighborhood by a sliding window method, and abnormal data are processed; Furthermore, the window length and sliding step of the sliding window are first set, and the sliding window is slid sequentially on the first laser ranging data stream and the second laser ranging data stream; for each data subset covered by the sliding window, the median in the neighborhood is calculated, and the median is used as the replacement value of the current window center position to generate a first median replacement data stream and a second median replacement data stream that have undergone preliminary smoothing processing; then a further median filtering algorithm is performed on the first median replacement data stream and the second median replacement data stream to remove isolated abnormal points or mutation noise that still exist therein, and finally generate an optimized first laser ranging data stream and a second laser ranging data stream with higher stability and consistency.

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

[0033] Abnormal data refers to isolated abnormal points or sudden noise.

[0034] S3. Identify the paper edge position set by using rising edge detection and falling edge detection on the first laser ranging data stream and the second laser ranging data stream, and obtain the preliminary paper quantity by counting the first laser ranging data stream and the second laser ranging data stream. According to the paper thickness, the detection thresholds of rising and falling edges are set, and the first laser ranging data stream and the second laser ranging data stream are traversed by the rising edge detection method, and the difference between adjacent data points is compared point by point; It should be noted that first, according to the paper thickness, a height change reference value for edge recognition is calculated based on the paper thickness; a rising edge detection threshold and a falling edge detection threshold are set according to the height change reference value, and are output as a rising edge detection threshold and a falling edge detection threshold, respectively; then, the rising edge detection method is used to perform point-by-point traversal processing on the first laser ranging data stream and the second laser ranging data stream, and the difference between the current data point and the previous data point is compared in turn, and a sequence of adjacent point difference values ​​is output.

[0035] Compare the rising edge detection threshold with the difference between adjacent data points to identify the starting edge position set of the paper; The detection threshold range for rising and falling edges is set according to the paper thickness and laser measurement accuracy. For example, when the average paper thickness is 0.1mm and the measurement accuracy is ±0.02mm, the detection threshold range for rising and falling edges can be set between 0.08mm and 0.12mm to ensure accurate identification of paper edge changes and avoid noise interference.

[0036] Furthermore, each difference element in the adjacent point difference sequence is first numerically 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 the position is determined to be a potential paper starting edge point; then, according to the preset edge positioning rule, 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.

[0037] The preset process of the edge positioning rule is as follows: setting the rising edge detection threshold and the falling edge detection threshold according to the paper thickness, and outputting the rising edge detection threshold and the falling edge detection threshold; determining the sliding window size according to the laser ranging data sampling frequency and the paper stack height resolution, and outputting the sliding window size; and obtaining the neighborhood comparison logic by combining the predetermined scanning path and the data arrangement order, and outputting the neighborhood comparison logic; combining the rising edge detection threshold, the falling edge detection threshold and the sliding window size with the logic to form a complete edge positioning rule.

[0038] The first laser ranging data stream and the second laser ranging data stream are traversed by the falling edge detection method, the difference between the current data point and the previous data point is compared point by point, and the difference is compared with the rising edge detection threshold to identify the end edge position set of the paper; It should be explained that, first, the first laser ranging optimization data stream and the second laser ranging optimization data stream are traversed point by point through the falling edge detection method, and the difference between the current data point and the previous data point is compared in turn, and a sequence of adjacent point difference values ​​is output; then the sequence of adjacent point difference values ​​is compared with a preset rising edge detection threshold, and when the adjacent point difference value is less than the negative rising edge detection threshold, it is determined to be a falling edge trigger point; according to 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 end edge of the paper is determined, and the set of paper end edge positions is output.

[0039] According to the starting edge position and the ending edge position of the paper, a paper pulse set is obtained by a pulse width modulation analysis method; It should be noted that first, with each pair of starting edge positions and ending edge positions as the boundary, the laser ranging data segments in the corresponding interval are extracted to form the ranging waveform segments corresponding to the paper; then, the features of the height change amplitude and duration of each ranging waveform segment are extracted, and the paper pulse feature parameter set is output; finally, the paper pulse feature parameter set is analyzed based on the pulse recognition logic to identify each valid paper pulse and output the paper pulse set.

[0040] The pulse width interval is set based on the paper thickness and scanning resolution, and the validity of the paper pulse is determined by matching and analyzing the paper pulse width. The pulse width interval range is set according to the paper thickness and scanning resolution. For example, when the average paper thickness is 0.1mm and the scanning resolution is ±0.02mm, the pulse width interval can be set to 0.08mm to 0.12mm to ensure accurate identification of valid paper pulses and exclusion of invalid pulses.

[0041] It should be noted that first, the pulse width interval corresponding to a single sheet of paper is set according to the paper thickness and the scanning resolution of the laser; then, each pulse width in the paper pulse set is compared with the pulse width interval, and the width of each pulse is analyzed one by one to see whether it falls within the pulse width interval; if the width of the paper pulse is within the pulse width interval, 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.

[0042] When the paper pulse is valid, the valid pulses of the first laser ranging and the second laser ranging are counted to generate a preliminary paper quantity. When the paper pulse is invalid, the exception handling process is entered.

[0043] Furthermore, the valid pulses in the corresponding directions of the first laser ranging and the second laser ranging are counted separately, and the number of valid pulses in the first direction and the number of valid pulses in the second direction are output, and a preliminary paper number is generated, which are respectively recorded as the preliminary paper number of the first laser ranging and the preliminary paper number of the second laser ranging; when the paper pulse is not included in the valid paper pulse set, that is, 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 handling process is triggered to re-scan and measure.

[0044] S4. Based on the preliminary paper quantity measured by the first laser ranging and the second laser ranging, optimization is performed through a three-level exception handling mechanism to generate an optimized result of the paper quantity measured by the first laser ranging and the second laser ranging; Based on the preliminary paper quantity measured by the first laser ranging and the second laser ranging, a first-level anomaly detection is performed to identify abnormal situations, and the error caused by the paper edge wrinkles to the laser ranging is adjusted by the edge detection threshold dynamic correction method to generate the first paper quantity optimization result; It should be noted that the absolute difference between the first preliminary paper quantity and the second preliminary paper quantity is calculated first, and the paper quantity difference is output; then the paper quantity difference is compared with the preset first-level abnormality judgment threshold. If the paper quantity difference is greater than the first-level abnormality judgment threshold, it is determined that a first-level abnormality exists, and the first-level abnormality state signal is output as true; when it is determined that an abnormality exists, 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, correct the laser ranging error caused by the wrinkles on the paper edge, and output the first paper quantity optimization result.

[0045] The process of presetting the first-level abnormality judgment threshold is to first count the distribution of the difference in the number of sheets of paper under different working conditions based on historical data, and then combine the counting accuracy requirements of the application scenario to select a value that can reflect normal measurement fluctuations and effectively identify abnormal conditions as the threshold benchmark.

[0046] The value range of the first-level abnormality determination threshold is, for example, the laser ranging accuracy (such as ±0.1mm) and the average paper thickness (such as 0.1mm). The first-level abnormality determination threshold can be set to 0~0.1mm.

[0047] Based on the first paper quantity optimization result, a second level of anomaly detection is performed to correct the error of dust on laser ranging and generate a second paper quantity optimization result; Furthermore, first, the laser reflection intensity data in the first laser ranging optimization data stream corresponding to the first paper quantity optimization result is obtained through a data analysis method, and a laser reflection intensity data sequence is output; then, based on a compensation method between reflection intensity and ranging error, the laser reflection intensity data sequence is converted into a corresponding ranging error compensation value, and a ranging error compensation value sequence is output; then, the ranging error compensation value sequence is used to correct the original laser ranging data to generate a corrected laser ranging data stream, and edge detection and pulse validity judgment are re-executed; finally, the number of valid pulses is counted, and the second paper quantity optimization result is output.

[0048] Based on the second paper quantity optimization result, three-level anomaly detection is performed to identify the error distribution pattern and obtain the influencing factors through correlation analysis method; It should be noted that first, based on the optimization results of the second paper quantity in multiple measurement cycles and the corresponding actual paper quantity, the ranging error value of 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, identify error distribution patterns with similar characteristics, and output an error clustering result set; then, each clustering result is matched item by item with the environmental parameters, operating conditions and equipment status information recorded synchronously during the measurement cycle, such as temperature, humidity, laser emission intensity, scanning speed and other variables as candidate factors; then, a correlation analysis is performed between each type of error distribution pattern and the candidate factors, and the Pearson correlation coefficient or Spearman rank correlation method is used to calculate the degree of correlation between each variable and the error value, and the key influencing factors are output.

[0049] The linear regression model is used to handle abnormalities of influencing factors and adjust the deviation of the calculated value of the number of sheets of paper, thereby generating the optimized results of the number of sheets of paper for the first laser ranging and the second laser ranging; Furthermore, a linear regression model is first constructed based on the historical measurement data and the variables in the influencing factor list, and a linear regression model parameter set is output; then the influencing factor values ​​within the measurement period are input into the linear regression model parameter set, the corresponding paper quantity deviation values ​​are predicted, and the paper quantity deviation prediction values ​​are output; then the paper quantity deviation prediction values ​​are used to compensate and correct the paper quantity calculation values ​​of the first laser ranging and the second laser ranging, generating the final paper quantity optimization result in the first laser ranging direction and the final paper quantity optimization result in the second laser ranging direction.

[0050] The training process of the linear regression model is based on the analysis of historical measurement data (the historical measurement data set contains the calculated values ​​of the number of laser-measured papers in multiple measurement cycles, the corresponding actual number of papers, and the key influencing factor variables associated with each cycle). The linear regression model parameters are estimated using the least squares method or gradient descent method to generate the regression coefficient with the minimum sum of squared prediction errors, thus completing the linear regression model training process.

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

[0052] The error threshold value range is set based on the measurement accuracy requirements and the standard deviation of paper thickness. Based on the final paper quantity optimization result, the absolute value calculation is performed to generate the paper difference value. It should be noted that, first, based on the measurement accuracy requirements of the laser and the historical statistical data of paper thickness, the standard deviation of paper thickness is calculated and the standard deviation of paper thickness is output; combined with the height change corresponding to a single sheet of paper and the maximum allowable measurement deviation, the value range of the error threshold used for consistency judgment is set, and the value range of the error threshold is output; then, based on the final paper quantity optimization result of the first laser ranging and the final paper quantity optimization result of the second laser ranging, the absolute difference calculation method is used to obtain the absolute difference value between the two, and the paper difference is output.

[0053] Set the value range of the error threshold. For example, assuming the average thickness of a single sheet of paper is 0.1mm, the laser measurement accuracy is ±0.1mm, and the standard deviation of paper thickness is 0.02mm, combined with a safety factor of 3, the maximum allowable fluctuation is calculated to be 0.16mm, corresponding to an error of approximately ±1.6 sheets of paper. Therefore, the value range of the error threshold is set to [-1.6, +1.6].

[0054] The paper difference is compared with the value range of the error threshold to verify the validity of the paper quantity and generate the final paper quantity.

[0055] When the paper quantity optimization results of the first laser ranging and the second laser ranging are consistent, the final paper quantity is obtained; 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; When the paper quantity optimization result of the first laser ranging and the second laser ranging is not within the value range of the error threshold, the measurement area is adjusted and rescanned by the edge feature matching analysis method.

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

[0057] This embodiment also provides a paper stack counting device, comprising: The data acquisition module is used to collect and pre-process the paper stack graphic data, obtain the paper stack inclination angle, and compare it with the set paper stack inclination angle threshold to identify the measurement area; A data stream generation module is used to scan the paper stack with two sets of laser ranging modules according to the measurement area, generate a first laser ranging data stream and a second laser ranging data stream, and process abnormal data; A preliminary number counting module is used to identify the paper edge position set by detecting the rising edge and the falling edge of the first laser ranging data stream and the second laser ranging data stream, and obtain the preliminary number of paper sheets by counting the first laser ranging and the second laser ranging data stream; An optimization processing module is used to optimize the preliminary paper quantity obtained by the first laser ranging and the second laser ranging through a three-level exception handling mechanism to generate an optimization result of the paper quantity obtained by 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 a paper difference, and cross-validate it with the value range of the error threshold to obtain the final paper quantity.

[0058] This embodiment also provides a computer device suitable for 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 computer-executable instructions to implement the paper stack counting method proposed in the above embodiment.

[0059] The computer device may be a terminal, comprising a processor, memory, a communication interface, a display, and an input device connected via a device bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium 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 medium. The communication interface of the computer device is used to communicate with external terminals via wired or wireless communication. Wireless communication may be achieved via Wi-Fi, a carrier network, NFC (near-field communication), or other technologies. The display of the computer device may be a liquid crystal display or an electronic ink display. The input device of the computer device may be a touchscreen layer covering the display, buttons, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse.

[0060] This embodiment also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the paper stack counting method proposed in the above embodiment; 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 read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0061] In summary, the present invention achieves accurate identification of the measurement area by: collecting and preprocessing paper stack graphic data, combining Hough transform to obtain the paper stack inclination, and comparing it with the set paper stack inclination threshold range, ensuring the rationality of the subsequent laser scanning path and the accuracy of data acquisition, and improving the adaptability of the device to changes in the posture of the paper stack; through a three-level exception handling mechanism, dynamic correction of the edge detection threshold, laser reflection intensity compensation and linear regression model adjustment deviation are adopted in turn, thereby achieving multi-level refined correction of the paper quantity optimization result, significantly enhancing the robustness and counting stability of the device under complex working conditions.

[0062] 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 the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A paper stack counting method, characterized in that: include, Collect and pre-process the paper stack graphic data to obtain the paper stack inclination angle, compare it with the set paper stack inclination angle threshold, and identify the measurement area; According to the measurement area, two groups 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; For the first laser ranging data stream and the second laser ranging data stream, the paper edge position set is identified by rising edge detection and falling edge detection, and the preliminary paper quantity obtained by the first laser ranging data stream and the second laser ranging data stream is obtained by counting. Based on the preliminary paper quantity measured by the first laser ranging and the second laser ranging, optimization is performed through a three-level exception handling mechanism to generate optimized results of the paper quantity measured by the first laser ranging and the second laser ranging; The absolute value of the paper quantity optimization results of the first laser ranging and the second laser ranging is calculated to generate a paper difference, which is cross-validated with the value range of the error threshold to obtain the final paper quantity.

2. The paper stack counting method according to claim 1, wherein: The paper stack graphic data includes the shape, size, inclination, surface features and boundary information of the paper stack; The pre-processing includes denoising, correction and paper stack feature extraction of the collected paper stack graphic data; According to the pre-processed paper stack graphic data, the straight line and reference plane are detected through Hough transform to obtain the inclination angle of the paper stack; The paper stack inclination angle is compared with the set paper stack inclination angle threshold range to determine whether the paper stack is within the paper stack inclination angle threshold range and identify the measurement area.

3. The paper stack counting method according to claim 2, wherein: According to the measurement area, two groups 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. The specific steps are as follows: Based on 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; Smoothing and continuously completing the distance data point set to generate a first laser ranging data stream and a second laser ranging data stream; The first laser ranging data stream and the second laser ranging data stream are replaced by the median value in the neighborhood through the sliding window method, and abnormal data are processed.

4. The paper stack counting method according to claim 3, wherein: The first laser ranging data stream and the second laser ranging data stream are used to identify the paper edge position set by rising edge detection and falling edge detection. The specific steps are as follows: According to the paper thickness, the detection thresholds of rising and falling edges are set, and the first laser ranging data stream and the second laser ranging data stream are traversed by the rising edge detection method, and the difference between adjacent data points is compared point by point; Compare the rising edge detection threshold with the difference between adjacent data points to identify the starting edge position set of the paper; The first laser ranging data stream and the second laser ranging data stream are traversed by the falling edge detection method, the difference between the current data point and the previous data point is compared point by point, and compared with the rising edge detection threshold to identify the end edge position set of the paper.

5. The paper stack counting method according to claim 4, wherein: The specific steps of obtaining the preliminary number of papers by the first laser ranging and the second laser ranging are as follows: According to the starting edge position and the ending edge position of the paper, a paper pulse set is obtained by a pulse width modulation analysis method; The pulse width interval is set based on the paper thickness and scanning resolution, and the validity of the paper pulse is determined by matching and analyzing the paper pulse width. When the paper pulse is valid, the valid pulses of the first laser ranging and the second laser ranging are counted to generate a preliminary paper quantity. When the paper pulse is invalid, the exception handling process is entered.

6. The paper stack counting method according to claim 5, wherein: The three-level exception handling mechanism is used to optimize the preliminary paper quantity measured by the first laser ranging and the second laser ranging to generate the optimized paper quantity results of the first laser ranging and the second laser ranging. The specific steps are as follows: Based on the preliminary paper quantity measured by the first laser ranging and the second laser ranging, a first-level anomaly detection is performed to identify abnormal situations, and the error caused by the paper edge wrinkles to the laser ranging is adjusted by the edge detection threshold dynamic correction method to generate the first paper quantity optimization result; Based on the first paper quantity optimization result, a secondary anomaly detection is performed to correct the error of dust on the laser ranging and generate a second paper quantity optimization result; Based on the second paper quantity optimization result, three-level anomaly detection is performed to identify the error distribution pattern and obtain the influencing factors through correlation analysis method; The linear regression model is used to handle the abnormality of the influencing factors and adjust the deviation of the calculated value of the paper quantity to generate the optimized results of the paper quantity of the first laser ranging and the second laser ranging.

7. The paper stack counting method according to claim 6, wherein: The absolute value calculation of the paper quantity optimization results of the first laser ranging and the second laser ranging is performed to generate a paper difference, and cross-validated with the value range of the error threshold to obtain the final paper quantity. The specific steps are as follows: The error threshold value range is set based on the measurement accuracy requirements and the standard deviation of paper thickness. Based on the final paper quantity optimization result, the absolute value calculation is performed to generate the paper difference value. The paper difference is compared with the value range of the error threshold to verify the validity of the paper quantity and generate the final paper quantity.

8. A paper stack counting device based on the paper stack counting method according to any one of claims 1 to 7, characterized in that: include, A data stream generation module is used to scan the paper stack with two sets of laser ranging modules according to the measurement area, generate a first laser ranging data stream and a second laser ranging data stream, and process abnormal data; A preliminary number counting module is used to identify the paper edge position set by detecting the rising edge and the falling edge of the first laser ranging data stream and the second laser ranging data stream, and obtain the preliminary number of paper sheets by counting the first laser ranging and the second laser ranging data stream; An optimization processing module is used to optimize the preliminary paper quantity obtained by the first laser ranging and the second laser ranging through a three-level exception handling mechanism to generate an optimization result of the paper quantity obtained by 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 a paper difference, and cross-validate it with the value range of the error threshold to obtain the final paper quantity.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the paper stack counting method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Patent Citations

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

    CN106096713A

  • Laser counting instrument and counting method thereof

    CN106203609A

  • Paper quantity detection method and system, terminal and storage medium thereof

    CN111797965A

  • Automatic counting system, automatic counting method, equipment, storage medium and chip

    CN117350321A

  • Method and system for counting paper through machine vision

    CN119476342A

Cited By

  • Tour inspection robot and electric bus traffic control method and system

    CN121341249A

  • A patrol robot and a traffic control method and system for electric buses

    CN121341249B