Patent Publication Number: US-8983195-B2

Title: Smoothing method and apparatus for time data sequences

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
     The present application is based on, and claims priority from, Taiwan Patent Application No. 101136015, filed Sep. 28, 2012, the disclosure of which is hereby incorporated by reference herein in its entirety. 
     TECHNICAL FIELD 
     The present disclosure relates generally to a smoothing method and apparatus for time data sequences. 
     BACKGROUND 
     Moving objects in tracked images often cause unstable object positioning due to change of color characteristics or shape of objects, for example, the distress caused by non-easy aligning with the target in applications of semi mouse&#39;s movement functions. In the past, smoothing technology of data points often uses complex smoothing algorithms and iterative techniques, for example, uses curve fitting and regression error analysis to modify the jitter curve, to immediately response the user&#39;s operation trajectory, and depict on the screen. This kind technique of smoothing data points need to solve simultaneous equations, thus computation amount and memory requirements are greater. This technique may achieve a good smoothing effect, but also induce the time delay. 
       FIG. 1  shows a schematic for a generation technique of computerized curve. As shown in the operation flow of  FIG. 1 , this technique performs an up-sampling (step  110 ) for the inputted data, and filters a sequence of samples after the up-sampling (step  120 ), and then performs a recursive curve interpolation to the filtered samples (step  130 ) to obtain a best curve. Some techniques of smoothing data points collect an amount of data for a period of time, then perform a data smoothing correction including such as performing noise reduction, smoothing the points of segment, and then curve fitting the points of segment to obtain a best curve. 
     The mouse cursor smoothing techniques such as one technology uses headset notations and controls the mouse cursor with a head facing direction. When the mouse cursor enters into a support position mode, this technology determines a new mouse cursor position based on a detection position and the average of the positions of a last point. Some tracking technologies for a mouse cursor controls the mouse cursor with the fingertips, and predicts a next cursor position according to the position and the speed of a current cursor, and performs an interpolation action at a low sampling frequency to maintain ease and smoothness of the cursor control. Some mouse cursor smoothing techniques use predicting cursor methods to alleviate timing jitter impact of network transmission for remote cursor control, and predict the next cursor position in accordance with the last cursor&#39;s position and speed, and the cursor&#39;s average acceleration. 
     Another technique of tracking a moving object improves the search strategy when tracking a moving target. As shown in  FIG. 2 , before detecting an object, this technology determines a search range based on the object&#39;s previous trajectory, such as the four data of the previous trajectory of a real object  202 , and uses the direction of a least-square trend line  210  to predict the possible position  212  of this object at a next time point. 
     In the above mentioned curve smoothing technologies, some technologies achieve good smoothing effects, but do not immediately smooth data, which is unable to match the user expectation for the applications such as emphasizing real-time perception of gesture-like mouse trajectory. Some mouse cursor smoothing technology may be unable to overcome the problem of jitter due to more serious jitter of the data points, or to smoothly correct the trajectory when there is a gap between the cursor&#39;s true position and the predicted position. Some mouse cursor tracking technologies only predict the next cursor position with the current speed direction, and may cause a large error at a turning point. Some moving target tracking technologies predict an object target with a trend line, which may also cause a large error at a turning point. General curve generation technologies use the regression analysis to obtain only an orientation prediction, and may not directly provide the calculation of an absolute position. 
     Therefore, it is an important issue on how to design a trajectory smoothing mechanism with a balance between the global and the local trajectory trends, effective controlling the time delay within a small number of sampling points, and using simple trajectory smoothing techniques by simple algebra operations to achieve the effect of reducing the computation amount. 
     SUMMARY 
     The exemplary embodiments of the disclosure may provide a smoothing method and apparatus for time data sequences. 
     One exemplary embodiment relates to a smoothing method for time data sequences. The method is executed by a hardware processor to perform: smoothing a plurality of original data points of a time data sequence, then from a plurality of smoothed data points, determining a plurality of reference points for a current global-trajectory trend and a current local-trajectory trend; calculating a global trajectory direction and a local trajectory direction of the time data sequence; according to the plurality of reference points; and adaptively calculating at least one new data point by integrating the global trajectory direction and the local trajectory direction. 
     Another exemplary embodiment relates to an apparatus for time data sequences. The smoothing apparatus comprises a hardware-implemented smoothing unit and a hardware-implemented prediction unit. The smoothing unit is configured to smooth a plurality of original data points of a time data sequence, and determine a plurality of reference points for a current global-trajectory trend and a current local-trajectory trend, from a plurality of smoothed data points. The prediction unit is configured to calculate a global trajectory direction and a local trajectory direction of the time data sequence according to the plurality of reference points; and adaptively calculates at least one new data point by integrating the global trajectory direction and the local trajectory direction. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  shows a schematic for a generation technique of computerized curve. 
         FIG. 2  shows a schematic view of a technology of tracking a moving object for improving the search strategy. 
         FIG. 3  shows a smoothing method for a time data sequence, according to an exemplary embodiment. 
         FIG. 4A  and  FIG. 4B  show a schematic view for smoothing the original data sequence in  FIG. 3 , according to an exemplary embodiment. 
         FIG. 5A  and  FIG. 5B  shows a schematic view illustrating the determination of the reference points by using the trajectory trend, according to an exemplary embodiment. 
         FIG. 6  shows a schematic view of calculating the trajectory direction and predicting a distance by referring to the reference points, according to an exemplary embodiment. 
         FIG. 7  shows a schematic view illustrating the effectiveness of using the projection when turning at an original data point, according to an exemplary embodiment. 
         FIG. 8  shows a schematic view illustrating the estimation of the time delay, according to an exemplary embodiment. 
         FIG. 9A  to  FIG. 91  show a schematic views illustrating the inputted original trajectory incrementing with time and the outputted smoothed trajectory, according to an exemplary embodiment. 
         FIG. 10  shows a smoothing apparatus for time data sequences, according to an exemplary embodiment. 
     
    
    
     DETAILED DESCRIPTION OF DISCLOSED EMBODIMENTS 
     Below, exemplary embodiments will be described in detail with reference to accompanying drawings so as to be easily realized by a person having ordinary knowledge in the art. The inventive concept may be embodied in various forms without being limited to the exemplary embodiments set forth herein. Descriptions of well-known parts are omitted for clarity, and like reference numerals refer to like elements throughout. 
     The exemplary embodiments in the disclosure provide a smoothing technique for a time data sequence. This technique uses a curve fitting method to smooth historical original data points of a time data sequence, then performs local sampling from the smoothed data points and determines reference points with a global trajectory trend and a local trajectory trend in the smoothed data points. This technique further calculates a proceed direction for global data and a proceed direction for a current data according to the reference points with obtained trends, and adaptively calculate new data point(s). 
     In other words, the disclosed exemplary embodiment of a smoothing method for a time data sequence is shown as in  FIG. 3 . The smoothing method smoothes a plurality of original data points of a time data sequence, then from a plurality of smoothed data points, determines a plurality of reference points for a current global-trajectory trend and a current local-trajectory trend (step  310 ), and then according to the plurality of reference points, calculates a global trajectory direction and a local trajectory direction of the time data sequence (step  320 ). The smoothing method further adaptively calculates new data point(s) by integrating the global trajectory direction and the local trajectory direction (step  330 ). The smoothing method performs steps  310  to  330  by using a hardware processor. This hardware processor may be, but not limited to, such as a hardware circuit having a computing capability, or a computer system equipped with at least one central processing unit and at least one memory. The smoothing method may also outputs an original trajectory incrementing with time, smoothed trajectory, fitting curve, and so on. The trajectory formed by the new data sequence has smoothness and immediate perceptual characteristics, and the detailed will be described in the following. 
       FIG. 4A  and  FIG. 4B  show a schematic view for smoothing the original data sequence in  FIG. 3 , according to an exemplary embodiment.  FIG. 4A  shows a schematic view illustrating the use of a curve-fitting technique, such as the B-spline curve fitting method. In  FIG. 4A , an smoothing operation is performed on a plurality of original data points of a time data sequence  402 , then a plurality of smoothed data points are selected from these smoothed data points. The plurality of original data points for smoothing, for example, are 7 historical original data points, respectively, i.e. original data points at time t−6, t−5, t−4, t−3, t−2, t−1 and t represents the current time. For example, curve  410  uses the B-Spline curve fitting technique to smooth 7 historical original data points, and selects 7 smoothed data points from therein. These 7 smoothed data points are respectively, B−6, B−5, B−4, B−3, B−2, B−1, and B, wherein the smoothed data point B−6 is the original data point at time t−6, the data point B is the original data point at time t. It may be seen from  FIG. 4A , smoothed data points B−6, B−5, B−4, B−3, B−2, B−1 and B are with the same number as 7 original history data points before treatment, so spacing of the 7 smoothed data points is similar to the spacing of the 7 original history data points. However, the curvature of the curve  410  formed by smoothed data points is much lower (that is, smoother), and the data at the front and the end of the curve are not changed. The disclosed exemplary embodiments of the smoothing method for time data sequences may use any method such as an interpolation, or a regression, or a curve fitting, wherein data storage structure may use such as a queue with a data structure of first-in first-out to maintain unchanged number of sampling points. In other words, in the disclosed exemplary embodiments of the smoothing method, the number of the plurality of original data points maintaining for smoothing operation is equal to the number of the plurality of smoothed data points. The plurality of original data points are the historical original data points by tracking back the time data sequence  402  from a current time. 
     Following the  FIG. 4A ,  FIG. 4B  shows a schematic view illustrating the situation of inputting original data points at next time t+1. As may be seen from the  FIG. 4B , the curve  420  formed by smoothed data point changes with the inputted original data point, and may sufficiently represent the original trajectory condition. The number of sampling points only increases the calculation amount, and its effect is the same for the needs of the subsequent processing. Therefore, it may take the number of the sampling points with a lowest calculation amount. 
     Following the  FIG. 4A  and  FIG. 4B ,  FIG. 5A  and  FIG. 5B  shows a schematic view illustrating the determination of the reference points by using the trajectory trend, according to an exemplary embodiment. The curve trend may be obtained by performing a linear regression analysis on local sampling data points, such as the dotted line  506  shown in  FIG. 5A . The obtained dotted line  506  describes a possible trajectory trend under the situation that the original data points are tracked from the current time t back to the time t−6, wherein the original data points are local sampled and a linear regression analyzed is performed for the local sampled data points. Dotted line  516  in  FIG. 5B  describes a possible trajectory trend under the situation that an original data point at the next time t+1 is inputted, wherein the original data points are also local sampled and a linear regression analyzed is performed for the local sampled data points. The exemplary embodiments using the curve fitting to obtain absolutely smoothed data points may also provide a directional prediction effects as performing a regression analysis, and the detailed will be described in the following. 
     It may be from  FIG. 5A  and  FIG. 5B , for smoothed data points on B-Spline, the connection direction between two consecutive back-tracked smoothed data points from a current smoothed data point is similar to the results of the regression analysis. For example, the connection direction between the back-tracked second and third data points i.e. the connection of P2 and P3 in  FIG. 5B , from the current smoothed data point P1, is similar to the results of regression analysis. In other words, the back-tracked second and third data points of the smoothed data points on the curve  410  in  FIG. 5A , denoted by the representative reference section  512 , is similar to the curve trend of the dotted line  506  obtained by the regression analysis; while the connection direction of the back-tracked second and third data points of the smoothed data points on the curve  420  in  FIG. 5B , denoted by the representative reference section  522 , is similar to the curve trend of the dotted line  516  obtained by the regression analysis. In other words, directly using the direction of the representative reference section such as reference section  512  or  522  may approximate the results of the regression analysis. Therefore, the regression analysis step may be omitted to reduce the calculation amount. The disclosed exemplary embodiments of the smoothing technique also take the tracked-back first data point as a reference point of a current data trend to ensure immediate reaction of the current data trend. In the exemplar, the smoothing method may select, but not be limited to, three reference points for the current trend, which are the tracked-back first, second, and third data points, i.e., P1, P2, and P3, from the current data point. 
     In other words, according to the exemplary embodiment, in the plurality of reference points of the trajectory trend, there are a first reference point, and a second and a third reference points. The first reference point is the tracked-back first smoothed data point from a current time, which may ensure immediate reaction of local movements, while the connection direction of the second and the third reference points is a representative direction for the current global-trajectory trend. The number of the reference points of aforementioned trajectory trends may not be limited to a fixed number. 
     After having obtained the plurality of reference points such as P1, P2 and P3, the smoothing technique may calculate such as the global trajectory direction and the local trajectory direction of the time data sequence  402 , and may further adaptively calculate at least one new data point. The adaptive calculation for the at least one new data point may include such as defining the global trajectory direction and the local trajectory direction according to the plurality of reference points, and calculating a predicted length and determining a reference direction vector and a displacement point.  FIG. 6  shows a schematic view of calculating the trajectory direction and predicting a distance (length) by referring to the reference points such as P1, P2, and P3, according to an exemplary embodiment. 
     In  FIG. 6 , the smoothing technique takes the connection direction of the reference points P2, and P3 as the global trajectory direction denoted by a vector {right arrow over (A)}, and takes the connection direction of reference points P1 and P2 as the local trajectory direction denoted by a vector {right arrow over (B)}. And the new data point(s) may be calculated by using the following formula: 
                 New   ⁢           ⁢   data   ⁢           ⁢   point     =       unit   ⁢           ⁢   reference   ⁢           ⁢   direction   ⁢           ⁢   vector   ⁢           ⁢     V   ⇀     ×   extimated   ⁢           ⁢   length   ⁢           ⁢   L     +     displacement   ⁢           ⁢   point   ⁢           ⁢     r   ⇀           ,     
     ⁢       The   ⁢           ⁢   estimated   ⁢           ⁢   length   ⁢           ⁢   L     =       B   ⇀     ·       A   ⇀            A   ⇀                              The   ⁢           ⁢   unit   ⁢           ⁢   reference   ⁢           ⁢   direction   ⁢           ⁢   vector   ⁢           ⁢     V   ⇀       =       A   ⇀            A   ⇀                  
wherein the estimated length L is the projection amount of the vector {right arrow over (B)} on the vector {right arrow over (A)}, the estimated length L may be calculated by the inner product of the vector {right arrow over (B)} with the unit reference direction vector {right arrow over (V)}. The calculation formula for the new data point includes the implication of taking the projection amount of the local trajectory direction {right arrow over (B)} on the global trajectory direction {right arrow over (A)} as the predicted length increments (i.e., the estimated length L) of the new data point, and referring to the position of the displacement point {right arrow over (r)}. In the  FIG. 6 , the triangular mark referred by an arrow  610  is the new data point, and the displacement point is the reference point P2. The displacement point {right arrow over (r)} may be the i-th smoothed data points tracked-back from a current data point in the plurality of smoothed data points, and 1&lt;i&lt;the number of the plurality of smoothed data points. In the exemplar, the displacement point {right arrow over (r)} is, but not limited to, the second smoothed data points tracked-back from the current data point in the plurality of smoothed data points.
 
     In the above formula, the estimated length L is calculated by using the projection amount.  FIG. 7  shows a schematic view illustrating the effectiveness of using the projection when turning at an original data point, according to an exemplary embodiment. In  FIG. 7 , when an original data point  730  has a turning trend, the mechanism of using the projection amount to estimate the length has a rapid reaction in response to the turning situation, and this may prevent from an over prediction for the turning situation (an over prediction situation is similar to the situation of unstoppable car). It may be observed from  FIG. 7  that the local trajectory direction  720  not only reacts the current direction of the original data point  730 , but also provides an appropriate buffering when the curve of original data points makes a turn, thereby maintaining the smoothness of the subsequent smoothed data points. In other words, according to the exemplary embodiments of the disclosure, under the guideline of the local trajectory direction  720 , it may clearly responses to an estimated length trend  740  of the new data point  710 . For example, when the original data trajectory makes a turn, under the condition of unchanged direction of the global data sequence, the estimated length of the new data point(s) with adaptive computing may be automatically shortened to facilitate turning and maintaining the smooth characteristics of the subsequent smoothed data points. 
       FIG. 8  shows a schematic view illustrating the estimation of the time delay, according to an exemplary embodiment. In the exemplar of  FIG. 8 , the circle points connected to the thin solid line represents the trajectory of original data points, the square hollow point connected to the thick solid line represents the outputted trajectory of smoothed data points, the triangle represents the shortest distance point of the original data points to a smoothed trajectory, and the dotted line is its projection line. Assuming that corresponding smoothed data point of the original data point t1 is s1, the shortest distance point of the original data point t1 to the smoothed trajectory is p1, and so on. The time delay of each smoothed data points to the original data points is calculated as described below. It may be observed from the relative relationship between the triangles and black circles in  FIG. 8 . Take the delay calculation of the smoothed data point s30 as an example. The smoothed data point s30 is on the smoothed trajectory and locates between the points p29 and p28, therefore, the time delay d30 of the smoothed data point s30 to the original data point t30 meets the relationship (30−29=1)&lt;d30&lt;(30−28=2). Take another example of delay calculation of the smoothed data point s27. The smoothed data points s27 locates between p26 and p27, therefore, the time delay d27 of the smoothed data points s27 to the original data points t27 satisfies the relation 0&lt;d27&lt;1. Since the spacing distribution of sample points of the smoothed curve is similar to the spacing distribution of the original data points, the exemplary embodiments of the disclosure use curve fitting by taking the tracked-back second smoothed data point from the current data point as the projection location reference point (i.e., the displacement point {right arrow over (r)}), thus it may estimate an average time delay of approximate 0˜2 sampling points. 
       FIG. 9A  to  FIG. 9I  show a schematic views illustrating the inputted original trajectory incrementing with time and the outputted smoothed trajectory, according to an exemplary embodiment, wherein black dots represent the original data points, and the original trajectory is a trajectory formed by the segments connected to these the original data points. Square hollow points represent the smoothed data points, and the smoothed trajectory is a trajectory formed by the smoothed data points based on the disclosed exemplary embodiments of the smoothing technique. Assuming that  FIG. 9A  shows the original trajectory at a current time t and the outputted smoothed trajectory, then  FIG. 9B  shows the original trajectory at time t+1 and the outputted smoothed trajectory, and so on.  FIG. 9I  shows the original trajectory at time t+8 and he outputted smoothed trajectory. 
     Accordingly,  FIG. 10  shows a smoothing apparatus for time data sequences, according to an exemplary embodiment. Referring to  FIG. 10 , the smoothing apparatus  1000  comprises a hardware-implemented smoothing unit  1010  and a hardware-implemented prediction unit  1020 . The hardware-implemented smoothing unit  1010  is configured to smooth a plurality of original data points of a time data sequence  1012 , and determine a plurality of reference points  1016  for a global-trajectory trend and a local trajectory trend, from a plurality of smoothed data points  1014 . The hardware-implemented prediction unit  1020  is configured to calculate trajectory directions including a global trajectory direction  1022  and a local trajectory direction  1024  according to the plurality of reference points  1016 , and adaptively calculate at least one new data point  1030  by integrating the global trajectory direction  1022  and the local trajectory direction  1024 . The hardware-implemented prediction unit  1020  may further generate the original trajectory incrementing with time, the smoothed trajectory, the curve fitting, etc. The trajectory of new data may also maintain the properties of smoothness and real-time perception. 
     As previously described in the exemplary embodiments of the disclosure, the plurality of original data points are a plurality of historical original data points by tracking back the time data sequence  1012  from a current time. The hardware-implemented smoothing unit  1010  may use smoothing mechanism such as interpolation, or regression, or curve fitting to smooth the historical original data points. The hardware-implemented smoothing unit  1010  may also use such as the aforementioned exemplary embodiments, to determine the reference point of the global-trajectory trend and the local-trajectory trend, which is not repeated here. The hardware-implemented prediction unit  1020  may use the aforementioned adaptive adjustment mechanism to calculate the new data point(s) including such as calculating the estimated length, and deciding the reference direction vector and the displacement point, which is not repeated here. The hardware-implemented smoothing unit  1010  may use a queue with a data storage structure of first-in first-out to maintain the number of the plurality of original data points equal to the number of smoothed data points  1014 , which is not repeated here. When the original data points have a turning trend, under the unchanged global trajectory direction, this adaptive adjustment mechanism may shorten the estimated length of the at least one new data point  1030  to facilitate turning and maintaining the smoothing characteristics of the subsequent smoothed data points. 
     Following the above mentioned, the smoothing method and apparatus according to the disclosed exemplary embodiments is a prediction mechanism using the global and the local trajectory trends, and is a smoothing technology of using simple algebraic operations for time data sequences. This smoothing technology may apply to such as computer input devices, game consoles, home appliances manipulation, and interactive billboards. 
     In summary, the exemplary embodiments of the disclosure provide a smoothing method and apparatus for time data sequences. This technique uses prediction mechanism of global and local trajectory trends to effectively achieve the effect of real-time and smoothing trajectory trend, and uses representative specific sections of curve fitting to replace the existed steps of regress analysis for reducing the calculation amount. The technique uses only simple algebraic operations. Therefore, the required computation amount is low compared to the technology using simultaneous equation for solving and the technology using iterative optimization. In the exemplary embodiments of the smoothing method and apparatus, the time data sequence not only retains good smoothness, but also effectively controls time delay between each smoothed data point, and each original data point within 0 to 2 sampling points regardless the speed of the moving object. 
     It will be apparent to those skilled in the art that various modifications and variations can be made to the disclosed embodiments. It is intended that the specification and examples be considered as exemplary only, with a true scope of the disclosure being indicated by the following claims and their equivalents.