Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MedianFilter.cpp
- Revision:
- 3:ec86928ff12d
- Parent:
- 2:269c66e647f8
--- a/MedianFilter.cpp Mon Sep 26 20:55:13 2016 +0200
+++ b/MedianFilter.cpp Mon Sep 26 19:37:05 2016 +0000
@@ -2,10 +2,9 @@
MedianFilter::MedianFilter(int size)
{
- _size = size;
- _n = 0;
+ _size = size;
- for( float i = 0; i < _n; i++)
+ for( float i = 0; i < _size; i++)
_window.push_back(i);
}
@@ -16,7 +15,7 @@
deque<float> _temp(_window);
- sort(_temp.begin(), temp.end());
+ sort(_temp.begin(), _temp.end());
- return _temp[n/2];
+ return _temp[_size/2];
}