图片平滑处理

#include<opencv2\opencv.hpp>
#include<cv.h>

using namespace cv;


void dealImage(IplImage *img) {
cvNamedWindow("image_in");
cvNamedWindow("image_out");

cvShowImage("image_in", img);


IplImage * out_img = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 3);
cvSmooth(img, out_img, CV_GAUSSIAN, 3, 3);
cvShowImage("image_out", out_img);

cvReleaseImage(&out_img);


cvWaitKey(0);
cvDestroyWindow("image_in");
cvDestroyWindow("image_out");

}


int main() {

IplImage *image = cvLoadImage("D:\\ͼƬ\\3.jpg");
if (!image)
return 1;
dealImage(image);
return 0;

}

运行结果:

图片平滑处理_第1张图片

你可能感兴趣的:(图片平滑处理)