首页 > 代码库 > smooth
smooth
核心函数:cvSmooth
程序:
代码:
#include "cv.h" #include "cxcore.h" #include "highgui.h" #include <iostream> int smooth(int argc,char** argv) { IplImage* src=http://www.mamicode.com/cvLoadImage("e:\\picture\\123.bmp",0); cvNamedWindow("src"); cvShowImage("src",src); IplImage* dst1=cvCreateImage(cvGetSize(src),src->depth,src->nChannels); IplImage* dst2=cvCreateImage(cvGetSize(src),src->depth,src->nChannels); IplImage* dst3=cvCreateImage(cvGetSize(src),src->depth,src->nChannels); IplImage* dst4=cvCreateImage(cvGetSize(src),src->depth,src->nChannels); IplImage* dst5=cvCreateImage(cvGetSize(src),src->depth,src->nChannels); cvSmooth(src,dst1,CV_BLUR,3,3); //简单模糊 cvSmooth(src,dst2,CV_BLUR_NO_SCALE,3,3); //简单无缩放变换的模糊 cvSmooth(src,dst3,CV_MEDIAN,3,3); //中值模糊,可以避免孤立点的影响 cvSmooth(src,dst4,CV_GAUSSIAN,3,3); //高斯模糊,可以在保留信号的条件下减少噪声,但是接近边缘无效 cvSmooth(src,dst5,CV_BILATERAL,3,3); //双边滤波,不会将边缘平滑掉 cvNamedWindow("CV_BLUR"); cvNamedWindow("CV_BLUR_NO_SCALE"); cvNamedWindow("CV_MEDIAN"); cvNamedWindow("CV_GAUSSIAN"); cvNamedWindow("CV_BILATERAL"); cvShowImage("CV_BLUR",dst1); cvShowImage("CV_BLUR_NO_SCALE",dst2); cvShowImage("CV_MEDIAN",dst3); cvShowImage("CV_GAUSSIAN",dst4); cvShowImage("CV_BILATERAL",dst5); cvWaitKey(0); return 0; }
本文出自 “flyclc” 博客,请务必保留此出处http://flyclc.blog.51cto.com/1385758/1539932
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。