CN111797965A - Paper quantity detection method, system, terminal and storage medium thereof - Google Patents

Paper quantity detection method, system, terminal and storage medium thereof Download PDF

Info

Publication number
CN111797965A
CN111797965A CN202010487250.8A CN202010487250A CN111797965A CN 111797965 A CN111797965 A CN 111797965A CN 202010487250 A CN202010487250 A CN 202010487250A CN 111797965 A CN111797965 A CN 111797965A
Authority
CN
China
Prior art keywords
data
actual sampling
fitting
sampling data
deviation amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010487250.8A
Other languages
Chinese (zh)
Other versions
CN111797965B (en
Inventor
陈炜
吴振谦
王海谆
黄宇东
李琪康
汪海涵
赵俊杰
陈孝建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
College of Science and Technology of Ningbo University
Original Assignee
College of Science and Technology of Ningbo University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by College of Science and Technology of Ningbo University filed Critical College of Science and Technology of Ningbo University
Priority to CN202010487250.8A priority Critical patent/CN111797965B/en
Publication of CN111797965A publication Critical patent/CN111797965A/en
Application granted granted Critical
Publication of CN111797965B publication Critical patent/CN111797965B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06MCOUNTING MECHANISMS; COUNTING OF OBJECTS NOT OTHERWISE PROVIDED FOR
    • G06M7/00Counting of objects carried by a conveyor
    • G06M7/02Counting of objects carried by a conveyor wherein objects ahead of the sensing element are separated to produce a distinct gap between successive objects
    • G06M7/06Counting of flat articles, e.g. of sheets of paper
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations

Abstract

The invention relates to a paper quantity detection method, a system, a terminal and a storage medium thereof, which solve the problems of low detection precision, easy damage to paper and the like of the existing paper measurement method and comprise the steps of acquiring actual sampling data; substituting actual sampling data into a fitting function to obtain unknown fitting parameters to form a calibration fitting function; acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to a fitting curve corresponding to a calibration fitting function to form deviation amount data, sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and performing weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data; and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity. The invention can rapidly acquire the number of the paper sheets, has higher detection precision and is not easy to damage the paper sheets.

Description

Paper quantity detection method, system, terminal and storage medium thereof
Technical Field
The present invention relates to the technical field of paper quantity detection, and in particular, to a method, a system, a terminal and a storage medium for detecting paper quantity.
Background
The quality of the notebook is kept in mind when the notebook and the notebook are used for production, manufacturing and learning, the raw materials are counted before production, and the quality of the notebook is detected after production, so that unqualified products with few pages are prevented from entering the market, the image of an enterprise is greatly reduced, the sale of the product is influenced particularly for brand enterprises, and the development of the industry is hindered. The paper counting device in the market generally adopts a weighing method to realize the speed measurement of paper, the measurement error of the method is large, the method converts the number of the paper to be measured into weight to calculate and measure, and the whole method has very large error; the method for measuring the number of the paper also has the advantage that the number of the paper is determined by scanning the lines at the edge of the paper in a visual scanning mode by using a camera.
A method, an apparatus, a computer-readable storage medium and a terminal for calculating the number of sheets disclosed in publication No. CN108090925A include acquiring at least one sheet edge image; smoothing the stripes in each paper edge image; removing redundant stripes in the edge image of each piece of paper after the smoothing treatment; counting the number of the stripes in each image with the redundant stripes removed; and taking the number of the stripes as the number of the calculated paper pages. With the method, calculations are performed within the edge image of the paper.
In general, a method of performing visual scanning through a camera needs to press paper, so that the edge of the paper is tilted to facilitate scanning, image files need to be processed by the method, and the speed of a processor needs to be very high, so that a corresponding paper counting device is relatively high in cost and low in stability; therefore, the method has certain improvement space.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a paper quantity detection method which can quickly acquire the quantity of paper without damaging the paper and has higher detection precision.
The above object of the present invention is achieved by the following technical solutions:
a paper quantity detection method comprising:
acquiring a plurality of actual sampling data, and defining the actual sampling data as an actual sampling data sequence;
according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters, the actual sampling data sequence is brought into the fitting function to obtain a numerical value corresponding to the unknown fitting parameters, and a calibration fitting function is formed;
according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to the fitting curve corresponding to the calibration fitting function to form deviation amount data, defining a plurality of deviation amount data as deviation amount data sequences, wherein the actual sampling data sequences correspond to the deviation amount data sequences one to one;
sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and carrying out weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data;
and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
By adopting the technical scheme, after actual sampling data is obtained, a fitting function is determined according to the actually sampled data, deviation is judged based on a fitting value of the fitting function and an actual value of the actually sampled data, the deviation is weighted and averaged to form corresponding weighted average data, and the corresponding paper number is obtained according to a mapping relation obtained by training before, so that the processing is more comprehensive, and the proportion of each value in the corresponding data is fully utilized; the data are expanded during fitting, all points are distributed around a fitting curve, so that the result obtained through weight distribution is very stable, the characteristics of each value are fully utilized to obtain the result instead of simply averaging or obtaining the median of the data, the whole judgment process is simple, image analysis is not needed, and the requirement of a processor is reduced.
The present invention in a preferred example may be further configured to: and (3) subjecting the actual sampling data sequence to a preprocessing process of eliminating interference values.
The present invention in a preferred example may be further configured to: the method for preprocessing the actual sampling data sequence is as follows:
sequencing actual sampling data in the actual sampling data sequence from small to large in sequence to form a sequenced sampling data sequence; and removing a plurality of actual sampling data with larger deviation according to the sequencing sampling data sequence, and updating the actual sampling data sequence.
By adopting the technical scheme, the preprocessing of removing the interference value is carried out on the actual sampling data in the actual sampling data sequence, so that the acquired data can be ensured to be more reasonable, and the interference caused by overlarge data deviation is avoided; firstly, a sorted sampling data sequence from small to large is formed in a sorting mode, namely, the largest part and the smallest part are directly removed according to the sorted sampling data sequence, so that the interference generated by overlarge data deviation can be reduced as much as possible.
The present invention in a preferred example may be further configured to: the method for obtaining the calibration fitting function is as follows:
the actual measurement value in the actual sampled data sequence is represented as (x)i,yi) N, · i ═ 1, 2; wherein x isiIs a sequence number, y, in the actual sampled data sequenceiFor actual sampling corresponding to sequence numbersSample data;
the formula of the preset fitting function with unknown fitting parameters is specifically as follows:
f(x)=a0+a1x+a2x2(ii) a Wherein x is a corresponding sequence label; f (x) is the fit value at sequence index x; a is0、a1、a2Is an unknown fitting parameter;
obtaining a deviation value according to the measured values in the actual sampling data sequence and the fitting values corresponding to the fitting function, wherein the specific formula is as follows:
Figure BDA0002518894290000031
wherein, L is the deviation value between the corresponding measured value and the fitting value;
obtaining the mean square value of the deviation value, wherein the specific formula is as follows:
Figure BDA0002518894290000032
the above formula is expanded and then partial derivatives are calculated, and after simplification, the matrix form is obtained as follows:
Figure BDA0002518894290000033
a is calculated by the undetermined coefficient method0、a1、a2A will be calculated as0、a1、a2Are respectively defined as A0、A1、A2
The formula of the specific calibration fitting function is specifically as follows:
f(x)=A0+A1x+A2x2
through adopting above-mentioned technical scheme, acquire actual sampling data every time, can all carry out the fitting once, thereby form the demarcation fitting function with current actual sampling data one-to-one, guarantee the accuracy of the paper quantity that finally obtains, adopt the quadratic polynomial simultaneously in the fitting process, according to many times of experimentation, can definitely obtain adopting the quadratic polynomial and can reach required accuracy, and although the higher order polynomial can make the fitting curve that the fitting function corresponds more level and smooth, but the fitting process is more troublesome complicated, so only adopt the quadratic polynomial can guarantee that the fitting process is not complicated, also can guarantee the required precision simultaneously.
The present invention in a preferred example may be further configured to: the method for forming the deviation amount data is as follows:
according to the fitting curve corresponding to the calibration fitting function, the coordinate of the point P on the fitting curve is defined to be expressed as (x, A)0+A1x+A2x2) (ii) a Defining the coordinate expression of the point A in the actual sampling data sequence as (m, n);
the formula for the distance AP from point a to the fitted curve is specifically as follows:
Figure BDA0002518894290000034
and sequentially selecting coordinates on the fitting curve to obtain a distance AP between the point A and the fitting curve, and taking the minimum value in the distance AP as deviation amount data of the point A.
The present invention in a preferred example may be further configured to: sequentially acquiring fitting values on a fitting curve within a preset interval range of m-3< x < m +3 with the step length of 0.1; sequentially substituting the coordinates of corresponding points on the fitting curve into a formula to obtain the distance AP between the point A and the fitting curve;
the minimum value of the obtained distances AP is selected as deviation amount data of the point a to the fitted curve.
By adopting the technical scheme, the deviation data is the minimum value of the distance AP, and in order to accurately acquire the data, the fitting values in the interval are sequentially acquired through the set step length, the data processing amount can be reduced as much as possible, only the fitting values in the relatively close area are acquired, the minimum value is selected as the deviation data after the corresponding fitting values are acquired, the operation amount of the whole data is reduced, and meanwhile, the accuracy is higher.
The present invention in a preferred example may be further configured to: regarding the mapping relationship between the weight and the deviation amount data, the following is specific:
if the interval range of the deviation amount data is (0, 3), the corresponding weight is 1;
if the interval range of the deviation amount data is (3, 6), the corresponding weight is 0.8;
if the interval range of the deviation amount data is (6, 9), the corresponding weight is 0.6;
if the interval range of the deviation amount data is (9, 12), the corresponding weight is 0.4;
if the interval range of the deviation amount data is (12, 15), the corresponding weight is 0.2;
if the range of the offset data interval is (15, ∞), the corresponding weight is 0.
By adopting the technical scheme, the mapping relation is obtained through a large amount of experimental data, the weight of the interval range corresponding to each deviation amount data can be accurately defined, the characteristics of each value are fully utilized to obtain a result, and the detection accuracy is further improved.
The invention also aims to provide a paper quantity detection system which can rapidly acquire the quantity of paper without damaging the paper and has higher detection precision.
The second aim of the invention is realized by the following technical scheme:
a paper quantity detection system includes a paper quantity detection unit,
the data sampling module is used for acquiring a plurality of actual sampling data and defining the actual sampling data as an actual sampling data sequence; the function fitting module is used for substituting the actual sampling data sequence into the fitting function according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters to obtain a numerical value corresponding to the unknown fitting parameters to form a calibration fitting function;
a data processing module: according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to the fitting curve corresponding to the calibration fitting function to form deviation amount data, defining a plurality of deviation amount data as deviation amount data sequences, wherein the actual sampling data sequences correspond to the deviation amount data sequences one to one; sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and carrying out weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data;
a paper quantity judging module: and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
The third purpose of the invention is to provide a computer readable storage medium, which can store corresponding programs, is convenient for realizing rapid acquisition of the number of paper sheets under the condition of not damaging the paper sheets and has higher detection precision.
The third object of the invention is realized by the following technical scheme:
a computer-readable storage medium comprising a program which, when loaded and executed by a processor, implements the paper quantity detection method as described above.
The invention aims to provide the intelligent terminal which can rapidly acquire the number of the paper sheets under the condition of not damaging the paper sheets and has higher detection precision.
The fourth object of the invention is realized by the following technical scheme:
an intelligent terminal comprises a memory, a processor and a program which is stored on the memory and can run on the processor, wherein the program can be loaded and executed by the processor to realize the paper quantity detection method.
In summary, the invention has the following beneficial technical effects: the number of the paper sheets can be rapidly acquired, the detection precision is higher, and the paper sheets are not easy to damage.
Drawings
Fig. 1 is a schematic flow chart of a sheet number detection method.
Fig. 2 is a schematic flow chart of a preprocessing process for subjecting an actual sampled data sequence to interference value elimination.
Fig. 3 is a schematic configuration diagram of the sheet number detection system.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
The present embodiment is only for explaining the present invention, and it is not limited to the present invention, and those skilled in the art can make modifications of the present embodiment without inventive contribution as needed after reading the present specification, but all of them are protected by patent law within the scope of the claims of the present invention.
The embodiment of the invention provides a paper quantity detection method, which comprises the following steps: acquiring a plurality of actual sampling data, and defining the actual sampling data as an actual sampling data sequence; according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters, the actual sampling data sequence is brought into the fitting function to obtain a numerical value corresponding to the unknown fitting parameters, and a calibration fitting function is formed; according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to the fitting curve corresponding to the calibration fitting function to form deviation amount data, defining a plurality of deviation amount data as deviation amount data sequences, wherein the actual sampling data sequences correspond to the deviation amount data sequences one to one; sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and carrying out weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data; and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
In the embodiment of the invention, after actual sampling data is obtained, a fitting function is determined according to the actually sampled data, deviation is judged based on a fitting value of the fitting function and an actual value of the actually sampled data, the deviation is weighted and averaged to form corresponding weighted average data, and the corresponding paper number is obtained according to a mapping relation obtained by training before, so that the processing is more comprehensive, and the proportion of each value in the corresponding data is fully utilized; the data are expanded during fitting, all points are distributed around a fitting curve, so that the result obtained through weight distribution is very stable, and the characteristics of each value are fully utilized to obtain the result instead of simply averaging or obtaining the median of the data.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship, unless otherwise specified.
The embodiments of the present invention will be described in further detail with reference to the drawings attached hereto.
The embodiment of the invention provides a paper quantity detection method, and the main flow of the method is described as follows.
As shown in fig. 1:
step 1000: acquiring a plurality of actual sampling data, and defining the actual sampling data as an actual sampling data sequence.
The actual sampling data can be acquired by a mechanical key triggering mode or a virtual key triggering mode; the mechanical key triggering mode can be automatically obtained after starting up by pressing a start-up key, or can be used for obtaining actual sampling data by pressing a corresponding trigger key again after starting up; virtualizationThe key triggering mode can be achieved by pressing a relevant virtual triggering key in an interface of corresponding software. The 1000 values obtained after triggering the key are used as actual sampling data sequences, respectively U0、U1、U2、U3、……、U999. Storing the actual sampling data sequence into corresponding ROM, and sharing U0To U9991000 values, each value having a corresponding S0To S999The position coordinates of (a).
In the actual operation process, a plurality of acquired actual sampling data can be directly used as data required by the subsequent steps; or preprocessing a plurality of acquired actual sampling data to eliminate the influence of the interference value. Specifically, the preprocessing process for removing the interference value from the actual sampled data sequence is as follows:
step 1100: and sequentially sequencing the actual sampling data in the actual sampling data sequence from small to large to form a sequenced sampling data sequence.
The sorting is realized by comparing actual sampling data pairwise; the method comprises the following specific steps:
the first round of comparison includes:
comparison 1: compare the 1 st number U0And 2 nd number U1I.e. position coordinates of S0And S1The number with the smaller value is placed in the front, and the number with the larger value is placed in the back.
Comparison at the 2 nd time: compare the 2 nd number U1And the 3 rd number U2I.e. position coordinates of S2And S3The number with the smaller value is placed in the front, and the number with the larger value is placed in the back.
999 th comparison: compare the 998 th number U988And 999 th number U999I.e. position coordinates of S998And S999The number with the smaller value is placed in the front, and the number with the larger value is placed in the back.
The maximum value is already at the end of the entire actual sampled data sequence, S, for a total of 999 comparisons999The bits of (a).
The second round of comparison includes:
comparison 1: compare the 1 st number U0And 2 nd number U1I.e. position coordinates of S0And S1The number with the smaller value is placed in the front, and the number with the larger value is placed in the back.
998 th comparison: compare the 997 th number U987And 998 th number U998I.e. position coordinates of S997And S998The number with the smaller value is placed in the front, and the number with the larger value is placed in the back.
Since the largest number has been at the end of the array through the first round of comparison, and no comparison is needed, the largest of the remaining 999 numbers has been at the penultimate position of the entire array, S, through a total of 998 comparisons in the second round998The bits of (a).
Because there are a total of 1000 values, 1000-1 to 999 cycles of comparison are required, and the total number of comparisons is mathematically related:
Figure BDA0002518894290000071
finally, an array which is ordered from small to big is obtained, namely bubbling ordering is realized; and defining a sequence corresponding to the sorted actual sampling data as a sorted sampling data sequence.
Step 1200: and removing a plurality of actual sampling data with larger deviation according to the sequencing sampling data sequence, and updating the actual sampling data sequence.
As can be seen from the sorted sample data sequence, the actual sample data with large deviation is the data arranged at the forefront and the data arranged at the rearmost, preferably, 100 data arranged at the forefront and 100 data arranged at the forefront are removed, the middle 800 actual sample data are left, and the actual sample data sequence is updated.
Step 2000: and according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters, substituting the actual sampling data sequence into the fitting function to obtain a numerical value corresponding to the unknown fitting parameters, and forming a calibration fitting function.
The method for obtaining the calibration fitting function comprises the following steps:
the actual measurement value in the actual sampled data sequence is represented as (x)i,yi) N, · i ═ 1, 2; wherein x isiIs a sequence number, y, in the actual sampled data sequenceiThe actual sample data corresponding to the sequence number.
The formula of the preset fitting function with unknown fitting parameters is specifically as follows:
f(x)=a0+a1x+a2x2(ii) a Wherein x is a corresponding sequence label; f (x) is the fit value at sequence index x; a is0、a1、a2Are unknown fitting parameters. The quadratic polynomial is adopted in the fitting process, the required accuracy can be achieved by adopting the quadratic polynomial definitely according to multiple times of experimental processes, and although the fitting curve corresponding to the fitting function can be smoother by the high-order polynomial, the fitting process is more troublesome and complicated, so that the fitting process can be ensured to be not complicated by only adopting the quadratic polynomial, and meanwhile, the accuracy requirement can also be ensured.
Obtaining a deviation value according to the measured values in the actual sampling data sequence and the fitting values corresponding to the fitting function, wherein the specific formula is as follows:
Figure BDA0002518894290000081
wherein, L is a deviation value between the corresponding measured value and the fitting value.
Obtaining the mean square value of the deviation value, wherein the specific formula is as follows:
Figure BDA0002518894290000082
the above formula is expanded and then partial derivatives are calculated, and after simplification, the matrix form is obtained as follows:
Figure BDA0002518894290000083
a is calculated by the undetermined coefficient method0、a1、a2A will be calculated as0、a1、a2Are respectively defined as A0、A1、A2
The formula of the specific calibration fitting function is specifically as follows:
f(x)=A0+A1x+A2x2
and fitting once is carried out every time the actual sampling data is acquired, so that a calibration fitting function corresponding to the current actual sampling data one by one is formed, and the accuracy of the finally obtained paper quantity is ensured.
Step 3000: according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, the minimum distance between each actual sampling data in the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function is obtained to form deviation amount data, a plurality of deviation amount data are defined as deviation amount data sequences, and the actual sampling data sequences correspond to the deviation amount data sequences one to one.
Among these, the method for forming the deviation amount data is as follows:
according to the fitting curve corresponding to the calibration fitting function, the coordinate of the point P on the fitting curve is defined to be expressed as (x, A)0+A1x+A2x2) (ii) a Defining the coordinate expression of the point A in the actual sampling data sequence as (m, n);
the formula for the distance AP from point a to the fitted curve is specifically as follows:
Figure BDA0002518894290000091
and sequentially selecting coordinates on the fitting curve to obtain a distance AP between the point A and the fitting curve, and taking the minimum value in the distance AP as deviation amount data of the point A.
The deviation data is the minimum value of the distance AP, so that the data can be accurately acquired, the fitting values in the interval are sequentially acquired through the set step length, the data processing amount can be reduced as much as possible, only the fitting values in the relatively close area are acquired, the minimum value is selected to be the deviation data after the corresponding fitting values are acquired, the operation amount of the whole data is reduced, and meanwhile, the accuracy is higher; preferably, the fitting values on the fitting curve within the preset interval range m-3< x < m +3 are sequentially obtained with the step length of 0.1; sequentially substituting the coordinates of corresponding points on the fitting curve into a formula to obtain the distance AP between the point A and the fitting curve; the minimum value of the obtained distances AP is selected as deviation amount data of the point a to the fitted curve.
Step 4000: and sequentially acquiring the weight corresponding to each actual sampling data according to the preset mapping relation between the weight and the deviation data, and carrying out weighted average processing on the actual sampling data and the corresponding weight to form weighted average data.
The mapping relationship between the weight and the deviation amount data is specifically as follows:
if the interval range of the deviation amount data is (0, 3), the corresponding weight is 1; if the interval range of the deviation amount data is (3, 6), the corresponding weight is 0.8; if the interval range of the deviation amount data is (6, 9), the corresponding weight is 0.6; if the interval range of the deviation amount data is (9, 12), the corresponding weight is 0.4; if the interval range of the deviation amount data is (12, 15), the corresponding weight is 0.2; if the range of the offset data interval is (15, ∞), the corresponding weight is 0. The mapping relation is obtained through a large amount of experimental data, the weight of the interval range corresponding to each deviation amount data can be accurately defined, the characteristics of each value are fully utilized to obtain a result, and the detection accuracy is further improved.
Step 5000: and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
The mapping relation between the weighted average data and the number of the paper sheets is obtained through experimental tests, and the specific steps are as follows:
Figure BDA0002518894290000092
Figure BDA0002518894290000101
based on the method of converting the capacitance value change of the capacitance between the clamping plates into the change of the voltage signal amplitude value, the conversion sequence of the hardware scheme of the application is sequentially the number of the tested paper → the change of the capacitance value between the pole plates → the change of the voltage output amplitude value; and finally, the output voltage is collected and transmitted to the MCU through the AD. The whole set of signal processing method in the aspect of software method sequentially comprises the processes of data acquisition → sorting and removing overlarge deviation → data polynomial fitting → distributing each point weight → mapping model determining the number of paper and the like, so that the signals transmitted by a hardware circuit tend to be stable to the maximum extent.
According to the method, 5 sheets of paper are added to the clamp plate capacitor, and data acquisition and comparison are performed according to the obtained quadratic polynomial. Because the acquired data are fitted under the condition of fixing the number of the paper sheets, and the data tend to be stable through the processing of removing a large deviation value, sequencing and the like, the test results are shown in the following table:
data order Data location coordinate xi Data value yi Fitting the corresponding value fy Amount of deviation | AP- Error rate A%
1 1 2201 2169 32 1.45%
2 20 2203 2171 32 1.45%
3 40 2203 2173 30 1.36%
4 60 2204 2175 29 1.31%
5 80 2206 2179 27 1.22%
6 100 2207 2183 24 1.09%
7 120 2209 2189 20 0.91%
8 140 2213 2236 23 1.04%
... ... ... ... ... ...
39 780 2271 2271 12 1.02%
40 800 2275 2275 24 1.07%
The MCU adopts 12-bit AD, and can only read the voltage change of 0-3.3 v, so the precision can reach
Figure BDA0002518894290000102
It can be seen from the above table that the average deviation of AD is more than 20, so that the voltage stability is achieved
Figure BDA0002518894290000103
Embodiments of the present invention provide a computer-readable storage medium including instructions that, when loaded and executed by a processor, implement the method described in fig. 1-2. The individual steps described in the flow.
The computer-readable storage medium includes, for example: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal, which includes a memory, a processor, and a program stored in the memory and executable on the processor, where the program is capable of being loaded and executed by the processor to implement fig. 1-2. The method for detecting the number of paper sheets in the flow.
Based on the same inventive concept, an embodiment of the present invention provides a paper quantity detection system, which includes a memory, a processor, and a program stored in the memory and executable on the processor, and the program can be loaded and executed by the processor to implement the method shown in fig. 1-2. The method for detecting the number of paper sheets in the flow.
Wherein, the treater includes:
the data sampling module is used for acquiring a plurality of actual sampling data and defining the actual sampling data as an actual sampling data sequence; the function fitting module is used for substituting the actual sampling data sequence into the fitting function according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters to obtain a numerical value corresponding to the unknown fitting parameters to form a calibration fitting function;
a data processing module: according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to the fitting curve corresponding to the calibration fitting function to form deviation amount data, defining a plurality of deviation amount data as deviation amount data sequences, wherein the actual sampling data sequences correspond to the deviation amount data sequences one to one; sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and carrying out weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data;
a paper quantity judging module: and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: u disk, removable hard disk, read only memory, random access memory, magnetic or optical disk, etc. for storing program codes.
The above embodiments are only used to describe the technical solutions of the present application in detail, but the above embodiments are only used to help understanding the method and the core idea of the present invention, and should not be construed as limiting the present invention. Those skilled in the art should also appreciate that they can easily conceive of various changes and substitutions within the technical scope of the present disclosure.

Claims (10)

1. A method for detecting the number of sheets is characterized by comprising the following steps:
acquiring a plurality of actual sampling data, and defining the actual sampling data as an actual sampling data sequence;
according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters, the actual sampling data sequence is brought into the fitting function to obtain a numerical value corresponding to the unknown fitting parameters, and a calibration fitting function is formed;
according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to the fitting curve corresponding to the calibration fitting function to form deviation amount data, defining a plurality of deviation amount data as deviation amount data sequences, wherein the actual sampling data sequences correspond to the deviation amount data sequences one to one;
sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and carrying out weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data;
and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
2. The method of detecting the number of sheets of paper as set forth in claim 1, wherein the sequence of actual sampled data is subjected to a preprocessing for eliminating the interference value.
3. The method of detecting the number of sheets of paper as set forth in claim 2, wherein the method of preprocessing the actual sample data sequence is as follows:
sequencing actual sampling data in the actual sampling data sequence from small to large in sequence to form a sequenced sampling data sequence; and removing a plurality of actual sampling data with larger deviation according to the sequencing sampling data sequence, and updating the actual sampling data sequence.
4. The method for detecting the number of sheets according to claim 1,2 or 3, wherein the method for obtaining the calibration fitting function is as follows:
the actual measurement value in the actual sampled data sequence is represented as (x)i,yi) N, · i ═ 1, 2; wherein x isiIs a sequence number, y, in the actual sampled data sequenceiActual sampling data corresponding to the sequence labels;
the formula of the preset fitting function with unknown fitting parameters is specifically as follows:
f(x)=a0+a1x+a2x2(ii) a Wherein x is a corresponding sequence label; f (x) is the fit value at sequence index x; a is0、a1、a2Is an unknown fitting parameter;
obtaining a deviation value according to the measured values in the actual sampling data sequence and the fitting values corresponding to the fitting function, wherein the specific formula is as follows:
Figure FDA0002518894280000011
wherein, L is the deviation value between the corresponding measured value and the fitting value;
obtaining the mean square value of the deviation value, wherein the specific formula is as follows:
Figure FDA0002518894280000012
the above formula is expanded and then partial derivatives are calculated, and after simplification, the matrix form is obtained as follows:
Figure FDA0002518894280000021
a is calculated by the undetermined coefficient method0、a1、a2A will be calculated as0、a1、a2Are respectively defined as A0、A1、A2
The formula of the specific calibration fitting function is specifically as follows:
f(x)=A0+A1x+A2x2
5. the method of detecting the number of sheets of paper as set forth in claim 4, wherein: the method for forming the deviation amount data is as follows: according to the fitting curve corresponding to the calibration fitting function, the coordinate of the point P on the fitting curve is defined to be expressed as (x, A)0+A1x+A2x2) (ii) a Defining the coordinate expression of the point A in the actual sampling data sequence as (m, n);
the formula for the distance AP from point a to the fitted curve is specifically as follows:
Figure FDA0002518894280000022
and sequentially selecting coordinates on the fitting curve to obtain a distance AP between the point A and the fitting curve, and taking the minimum value in the distance AP as deviation amount data of the point A.
6. The method for detecting the number of sheets according to claim 5, wherein fitting values on a fitting curve within a preset interval range of m-3< x < m +3 are sequentially obtained with a step size of 0.1; sequentially substituting the coordinates of corresponding points on the fitting curve into a formula to obtain the distance AP between the point A and the fitting curve;
the minimum value of the obtained distances AP is selected as deviation amount data of the point a to the fitted curve.
7. The method of detecting the number of sheets of paper as set forth in claim 1, wherein: regarding the mapping relationship between the weight and the deviation amount data, the following is specific:
if the interval range of the deviation amount data is (0, 3), the corresponding weight is 1;
if the interval range of the deviation amount data is (3, 6), the corresponding weight is 0.8;
if the interval range of the deviation amount data is (6, 9), the corresponding weight is 0.6;
if the interval range of the deviation amount data is (9, 12), the corresponding weight is 0.4;
if the interval range of the deviation amount data is (12, 15), the corresponding weight is 0.2;
if the range of the offset data interval is (15, ∞), the corresponding weight is 0.
8. A paper quantity detection system is characterized by comprising,
the data sampling module is used for acquiring a plurality of actual sampling data and defining the actual sampling data as an actual sampling data sequence; the function fitting module is used for substituting the actual sampling data sequence into the fitting function according to the actual sampling data sequence and a preset fitting function with unknown fitting parameters to obtain a numerical value corresponding to the unknown fitting parameters to form a calibration fitting function;
a data processing module: according to the actual sampling data sequence and the fitting curve corresponding to the calibration fitting function, acquiring the minimum distance from each actual sampling data in the actual sampling data sequence to the fitting curve corresponding to the calibration fitting function to form deviation amount data, defining a plurality of deviation amount data as deviation amount data sequences, wherein the actual sampling data sequences correspond to the deviation amount data sequences one to one; sequentially acquiring the weight corresponding to each actual sampling data according to the mapping relation between the preset weight and the deviation amount data, and carrying out weighted average processing on a plurality of actual sampling data and the corresponding weights to form weighted average data;
a paper quantity judging module: and calling paper quantity data corresponding to the weighted average data according to the mapping relation between the trained weighted average data and the paper quantity.
9. A computer-readable storage medium storing a program which when loaded and executed by a processor implements the paper quantity detection method according to any one of claims 1 to 7.
10. An intelligent terminal, comprising a memory, a processor and a program stored in the memory and executable on the processor, wherein the program is capable of being loaded and executed by the processor to implement the method of detecting the number of sheets according to any one of claims 1 to 7.
CN202010487250.8A 2020-06-01 2020-06-01 Paper quantity detection method, system, terminal and storage medium thereof Active CN111797965B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010487250.8A CN111797965B (en) 2020-06-01 2020-06-01 Paper quantity detection method, system, terminal and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010487250.8A CN111797965B (en) 2020-06-01 2020-06-01 Paper quantity detection method, system, terminal and storage medium thereof

Publications (2)

Publication Number Publication Date
CN111797965A true CN111797965A (en) 2020-10-20
CN111797965B CN111797965B (en) 2022-06-07

Family

ID=72806059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010487250.8A Active CN111797965B (en) 2020-06-01 2020-06-01 Paper quantity detection method, system, terminal and storage medium thereof

Country Status (1)

Country Link
CN (1) CN111797965B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0743616A2 (en) * 1995-05-15 1996-11-20 Eastman Kodak Company Apparatus and method for counting sheets
US20180267521A1 (en) * 2014-12-05 2018-09-20 Safran Aircraft Engines Method for manufacturing parts based on analysis of weighted statistical indicators
CN110231108A (en) * 2018-03-05 2019-09-13 联合汽车电子有限公司 The caliberating device and scaling method of temperature sensor
CN110598829A (en) * 2019-09-16 2019-12-20 西安科技大学 Paper quantity detection method and device
CN111145163A (en) * 2019-12-30 2020-05-12 深圳市中钞科信金融科技有限公司 Paper wrinkle defect detection method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0743616A2 (en) * 1995-05-15 1996-11-20 Eastman Kodak Company Apparatus and method for counting sheets
US20180267521A1 (en) * 2014-12-05 2018-09-20 Safran Aircraft Engines Method for manufacturing parts based on analysis of weighted statistical indicators
CN110231108A (en) * 2018-03-05 2019-09-13 联合汽车电子有限公司 The caliberating device and scaling method of temperature sensor
CN110598829A (en) * 2019-09-16 2019-12-20 西安科技大学 Paper quantity detection method and device
CN111145163A (en) * 2019-12-30 2020-05-12 深圳市中钞科信金融科技有限公司 Paper wrinkle defect detection method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
翟文盛,邵明杰,王天宇: "一种基于FDC2214的纸张测量系统设计", 《物联网技术》, 20 May 2020 (2020-05-20) *

Also Published As

Publication number Publication date
CN111797965B (en) 2022-06-07

Similar Documents

Publication Publication Date Title
CN101871767B (en) System and method for detecting form and position tolerance of components
CN108182433A (en) A kind of meter reading recognition methods and system
CN102800096B (en) Robustness estimation algorithm of camera parameter
CN110599675B (en) Method and device for detecting number of paper money in money box, terminal equipment and storage medium
CN112965048B (en) Laser ranging error correction method, device, electronic equipment and storage medium
CN105953875A (en) Living animal weighing method and apparatus
CN113468034A (en) Data quality evaluation method and device, storage medium and electronic equipment
CN110991761B (en) Heat supply load prediction method and device
CN111797965B (en) Paper quantity detection method, system, terminal and storage medium thereof
CN110044485B (en) Image type fabric color measuring method
JP5719433B2 (en) Method, computer program and system for analyzing mass spectra
CN110955862B (en) Evaluation method and device for equipment model trend similarity
CN112202630A (en) Network quality abnormity detection method and device based on unsupervised model
CN111983339A (en) Method and system for determining volt-ampere characteristic of resistor disc of extra-high voltage metal oxide arrester
CN109815260B (en) Waveform display device, waveform parameter statistical method, terminal device and storage medium
CN108627788B (en) Hall current sensor hysteresis detection method and system
Havlíček et al. On the evaluation of chicken egg shape variability
CN106909497B (en) Test method and device
CN115183884A (en) Infrared temperature measurement compensation method and device of electric heating cooperative system
CN108829750A (en) A kind of quality of data determines system and method
CN115015131A (en) Infrared spectrum training set sample screening method
CN113504198A (en) Amaranth pigment concentration detection method and device and storage medium
CN113197116A (en) Live pig health monitoring and slaughter time evaluation method, terminal device and storage medium
CN202281650U (en) Plant leaf color detection device
CN115792340A (en) Method, device and equipment for calculating current distribution coefficient of multi-column parallel lightning arrester

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant