Rolling median algorithm in C

前端 未结 13 1638
臣服心动
臣服心动 2020-11-27 09:24

I am currently working on an algorithm to implement a rolling median filter (analogous to a rolling mean filter) in C. From my search of the literature, there appear to be t

相关标签:
13条回答
  • 2020-11-27 10:11

    I've done a C implementation here. A few more details are in this question: Rolling median in C - Turlach implementation.

    Sample usage:

    int main(int argc, char* argv[])
    {
       int i,v;
       Mediator* m = MediatorNew(15);
    
       for (i=0;i<30;i++)
       {
          v = rand()&127;
          printf("Inserting %3d \n",v);
          MediatorInsert(m,v);
          v=MediatorMedian(m);
          printf("Median = %3d.\n\n",v);
          ShowTree(m);
       }
    }
    
    0 讨论(0)
提交回复
热议问题