source: Sophya/trunk/SophyaLib/NTools/median.cc@ 926

Last change on this file since 926 was 220, checked in by ansari, 26 years ago

Creation module DPC/NTools Reza 09/04/99

File size: 439 bytes
Line 
1#if 0
2#include "median.h"
3#include <algorithm>
4
5float MedianFilter(float tab[], int n)
6{
7 sort(tab, tab+n);
8 return (n%2 ? tab[n/2] : (tab[n/2]+tab[n/2-1])/2);
9}
10
11double MedianFilter(double tab[], int n)
12{
13 sort(tab, tab+n);
14 return (n%2 ? tab[n/2] : (tab[n/2]+tab[n/2-1])/2);
15}
16
17void MedianFilterWindowIdx(float const data[], int ndata, int width,
18 int index[])
19{
20 float* tab = new float[witdh];
21
22
23 delete[] tab;
24}
25#endif
Note: See TracBrowser for help on using the repository browser.