コード例 #1
0
        private static ISingleEyeGazeDataSmoothingFilter ResolveSmoothingFilter(INoiseReductionOptions options)
        {
            switch (options.NoiseReductionStrategy)
            {
            case NoiseReductionStrategy.Exponential:
                var exponentialOptions = options as IExponentialSmoothingOptions;
                return(exponentialOptions != null
                         ? new ExponentialSmoothingFilter(exponentialOptions.Alpha)
                         : new ExponentialSmoothingFilter());

            case NoiseReductionStrategy.MovingAverage:
                var movingAverageOptions = options as IMovingAverageSmoothingOptions;
                return(movingAverageOptions != null
                         ? new MovingAverageSmoothingFilter(movingAverageOptions.WindowSize)
                         : new MovingAverageSmoothingFilter());

            case NoiseReductionStrategy.Median:
            default:
                throw new NotImplementedException();
            }
        }
コード例 #2
0
 public static IObservable <SingleEyeGazeData> ReduceNoise(this IObservable <SingleEyeGazeData> gazeData, INoiseReductionOptions options)
 {
     return(ReduceNoise(gazeData, ResolveSmoothingFilter(options)));
 }