Example for using Convolution Filter
- Author
- fkellner, 11/2008
#include <iostream>
#include "Filter/Convolution.hh"
#include <Base/Common/BIASpragma.hh>
using namespace BIAS;
using namespace std;
int main(int argc, char *argv[])
{
for(int x=0;x<100;x++)
{
srcdata[x]=0;
dstdata[x]=0;
}
srcdata[10*5+5]=100;
srcdata[0]=100;
kern[0][0]=1;
kern[0][1]=2;
kern[0][2]=1;
kern[1][0]=2;
kern[1][1]=4;
kern[1][2]=2;
kern[2][0]=1;
kern[2][1]=2;
kern[2][2]=1;
khor[0]=1;
khor[1]=2;
khor[2]=1;
kver[0]=1;
kver[1]=2;
kver[2]=1;
cout <<"dst matrix:\n";
for(int y=0;y<10;y++)
{
for(int x=0;x<10;x++)
cout <<(int)dstdata[y*10+x]<<" ";
cout <<endl;
}
cout <<"dst sep:\n";
for(int y=0;y<10;y++)
{
for(int x=0;x<10;x++)
cout <<(int)dstdata[y*10+x]<<" ";
cout <<endl;
}
cout <<"dst matrix float:\n";
for(int y=0;y<10;y++)
{
for(int x=0;x<10;x++)
cout <<(int)dstdata[y*10+x]<<" ";
cout <<endl;
}
cout <<"dst sep float:\n";
for(int y=0;y<10;y++)
{
for(int x=0;x<10;x++)
cout <<(int)dstdata[y*10+x]<<" ";
cout <<endl;
}
return 0;
}