Butterworth filter
来源:互联网 发布:毛体 知乎 编辑:程序博客网 时间:2024/06/05 12:06
Butterworth filter
// Butterworth filter//fc = cut frequency
//n filter order
//type: if tipo <0, low pass, if >=0 high pass
//the image shoul be square
IplImage *cinza = cvCreateImage(cvSize(img->width,img->height),
IPL_DEPTH_8U, 1);
IplImage *re64 = cvCreateImage(cvSize(img->width,img->height),
IPL_DEPTH_64F, 1);
IplImage *im64 = cvCreateImage(cvSize(img->width,img->height),
IPL_DEPTH_64F, 1);
CvMat *mask = cvCreateMat( img->height,img->width, CV_64FC1 );
int Xmin = -img->width/2;
int Ymin = -img->height/2;
int i, j;
// function transferece filter matrix
for(i=0; iwidth; i++)
for(j=0; jheight; j++)
{
double dxy = sqrt(pow(Xmin+i,2)+pow(Ymin+j,2));
double H;
if(tipo < 0)
{ H = (1/(1 + pow(dxy/fc,2*n)));} //low pass
if(tipo >= 0)
{
if(dxy==0){ H=0;}
else
H = (1/(1 + pow(fc/dxy,2*n))); //high pass
}
cvSetReal2D(mask, j, i, H);
}
cvCvtColor(img, cinza, CV_BGR2GRAY);
cvCvtScale(cinza, re64,1./255);
cvSetZero(im64);
cvFftw(re64,im64,true); //fft
cvMul(re64, mask, re64, 1);
cvMul(im64, mask, im64, 1);
cvFftw(re64,im64,false); //ifft
cvCvtScale(re64,dst ,255.);
cvReleaseImage(&re64);
cvReleaseImage(&im64);
cvReleaseImage(&cinza);
- Butterworth filter
- ButterWorth滤波
- Matlab实现Butterworth滤波器
- butterWorth低通滤波器
- butterworth chebyshev bezier滤波器区别
- 经典滤波器之一:Butterworth滤波器
- 高通滤波,低通滤波,butterworth
- [DSP] Butterworth (巴特沃斯)数字滤波器设计参考
- 利用matlab编写的Butterworth低通滤波程序
- Filter
- Filter
- Filter
- filter
- filter
- Filter
- filter
- Filter
- filter
- 面向对象的 Javascript 语言特性:闭包
- PCB走线规则
- VB基础教程(二)
- PCB焊盘和过孔问题分析
- 向左走,向右走(2) 为了未来
- Butterworth filter
- dwr错误处理
- jsp文件上传
- vs2005和vs2008有什么区别?
- struts+spring+hibernate集成实例
- Microsoft windows internals 学习笔记(1)
- 如何搭建SVN服务器
- 老是弄糊涂,火了
- 软件性能测试的基本概念