#include #include #define nr 300 #define nc 300 typedef unsigned char BYTE; //------------------------------------------------------- // f12.cpp // Convolution filtering using Median fiter // MIAT Lab, Kaohsiung, Taiwan // CHEN Ching-Han, 2001.10.09 //------------------------------------------------------- void Median(int WinSize, BYTE **InIm, BYTE **OutIm); BYTE ** array2D(int nnr,int nnc); void main() { ifstream in1("01.raw",ios::binary); ofstream out1("test.raw",ios::binary); BYTE **ima1,**ima2; ima1=array2D(nr,nc); ima2=array2D(nr,nc); for(int i=0;i>ima1[i][j]; Median(5, ima1, ima2); for(int i=0;i> 1; Area = (2*n+1) * (2*n+1); Lst = new BYTE[Area]; for (r=0; r Lst[j]) { Buf = Lst[j-1]; Lst[j-1] = Lst[j]; Lst[j] = Buf; } OutIm [r][c] = Lst [Area/2]; // get madian value } } } BYTE ** array2D(int nnr,int nnc) { BYTE **m; m=new BYTE*[nnr]; for(int i=0;i