您的位置:首页 > 其它

双边滤波

2010-07-14 17:19 197 查看
// 5_5.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>

#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")

int main(int argc, char* argv[])
{
//载入图像
IplImage *pSourceImage = cvLoadImage(argv[1]);
assert(pSourceImage != NULL);

IplImage *pDestionImage = cvCloneImage(pSourceImage);
assert(pDestionImage != NULL);

//简单无缩放模糊,不支持 in place
cvSmooth(pSourceImage,pDestionImage,CV_BILATERAL);

//显示图像
cvNamedWindow("Show_Source");
cvNamedWindow("Show_Destion");
cvShowImage("Show_Source",pSourceImage);
cvShowImage("Show_Destion",pDestionImage);

cvWaitKey();

//释放资源
cvReleaseImage(&pSourceImage);
cvReleaseImage(&pDestionImage);
cvDestroyWindow("Show_Source");
cvDestroyWindow("Show_Destion");

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: