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

Last change on this file since 2639 was 2615, checked in by cmv, 21 years ago

using namespace sophya enleve de machdefs.h, nouveau sopnamsp.h cmv 10/09/2004

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