-
-
Notifications
You must be signed in to change notification settings - Fork 0
Reconstructor
Restores original data from smoothed data with 100% accuracy when the smoothing algorithm along with its parameters is perfectly known.
A mathematically perfect "anti-hardware-smoothing."
No official release yet so download it from here and use OTD dev build
Then copy zip contents to:
| Platform | Path |
|---|---|
| Windows | %localappdata%\OpenTabletDriver\Plugins |
| Linux | ~/.config/OpenTabletDriver/Plugins |
| MacOS | $HOME/Library/Application Support/OpenTabletDriver/Plugins |
Most of the explanation for the configurations are available as a tooltip. More information about moving averages can be found here. Scroll down to the end for steps to achieving optimal configuration.
Below are the in-depth explanation and proofs to how and why Reconstructor works, explained through showing the derivation for the reconstruction of original data from smoothed data.
Tablets with smoothing employ some form of noise reduction to improve drawing experience at the cost of some latency. Reconstructor works by assuming that the smoothing algorithm done by the tablet's hardware is some form of moving average.
As a sidenote, hawku's smoothing is a form of exponential moving average.
For the following equations, we will have to define several variables as the following:
is the smoothed data
is the original data
is the amount of samples to consider, or alternatively, the window of the moving average
is the weight applied by exponential moving average (EMA)
Moving average (MA) is defined as:
And the following is the derivation process to get back:
private static Vector2 ReverseMAFunc(IEnumerable<Vector2> trueHistory, Vector2 input, int window)
{
Vector2 sum = new Vector2();
foreach (var item in trueHistory)
sum += item;
return (input * window) - sum;
}Exponential Moving Average (EMA) is recursively defined as:
And the following is the derivation to get back:
private static Vector2 ReverseEMAFunc(Vector2 currentEMA, Vector2 lastEMA, float weight)
{
return ((currentEMA - lastEMA) / weight) + lastEMA;
}A good starting point is Reverse EMA 0.5.
Right now the best you can do when finding EMA weight is try and find a minimal value that doesn't overshoot. You can test overshoot by placing some object with an angle on the tablet, holding it firmly and ramming the corner with your pen at a high speed, preferably in a way that makes pen tip stop suddenly. If the cursor on screen bounces back when stopping, it overshoots.

Big thanks to InfinityGhost for the initial idea about reversing the hardware smoothing itself instead of compensating for it through predictions.