首页 > 学院 > 开发设计 > 正文

图像处理平滑处理--高斯滤波,简单模糊,中值模糊,双边滤波,简单无放缩变换

2019-11-08 01:24:11
字体:
来源:转载
供稿:网友
#include<iostream> #include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp> #include <opencv2/opencv.hpp>using namespace cv;  int main(int argc, char* argv[]){iplImage *img=cvLoadImage("D://123//2.jpg",1);    IplImage *result=cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,3);   // cvSmooth(img,result,CV_BLUR,3,3,3,3);                // 简单模糊//cvSmooth(img,result,CV_GAUSSIAN,3,3,3,3);          // 高斯模糊//cvSmooth(img,result,CV_BLUR_NO_SCALE,3,3,3,3);     //简单无放缩变换   // cvSmooth(img,result,CV_MEDIAN,3,3,3,3);            //中值模糊    cvSmooth(img,result,CV_BILATERAL,3,3,0,0);         //双边滤波     cvNamedWindow( "img", CV_WINDOW_AUTOSIZE );        cvShowImage( "img", img );      cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );        cvShowImage( "result", result);        cvWaitKey(0);         cvReleaseImage( &img );    cvDestroyWindow("img");    cvReleaseImage( &img );    cvDestroyWindow("result");        return 0;}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表