#include<opencv2\opencv.hpp>
#include<highgui.h>
#include <string.h>
#include <iostream>
#include "cv.h"
using namespace cv;
using namespace std;
/*
@brief:载入一副图像并进行平滑处理
*/
void smoothImage(IplImage *image)
{
//create some windows ro show the input and output
cvNamedWindow("test_in");
cvNamedWindow("test_out");
//create a window to show our input image
cvShowImage("test_in", image);
//create an image to hold the smooth output
IplImage *out = cvCreateImage(
cvGetSize(image),
IPL_DEPTH_8U,
3
);
//do the smoothing
cvSmooth(image, out, CV_GAUSSIAN, 3, 3);
//show thw smoothed image in the output window
//
cvShowImage("test_out", out);
//Be tidy
cvReleaseImage(&out);
//wait for the user to hit a key ,then clean up the windows
cvvWaitKey(0);
cvDestroyWindow("test_in");
cvDestroyWindow("test_out");
}
int main(int argc, char** argv)
{
IplImage *img = cvLoadImage("test.jpg");
smoothImage(img
}