#include "cv.h"#include#include "highgui.h"#include "iostream"using namespace std;//载入一副图像并进行平滑处理void image_handel(IplImage *image){//create two window to show some images of inputing or outputingcvNamedWindow("example-in",CV_WINDOW_AUTOSIZE);cvNamedWindow("example-out", CV_WINDOW_AUTOSIZE);cvShowImage("example-in", image);//display the inputing image//create an image to hold the smoothed outputIplImage *out cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3);//pram1 get the size of image//pram2 说明每个通道的像素点的类型 pram3 说明了通道的总数 当前的图像为3通道 每个通道为8位 图像大小同image//do the smoothingcvSmooth(image, out, CV_GAUSSIAN, 3, 3);//show the smoothed image in the output windowcvShowImage("example-out", out);//be tidy (清理内存)cvWaitKey(0);cvDestroyAllWindows();}//使用cvPyrDown函数创建一副宽度和高度为输入图像一半的图像IplImage *doPyrDown(IplImage *in, int filter CV_GAUSSIAN_5x5){//设置断言 确定图像的大小可以整数减半assert(in->width % 2 0 0);IplImage *out cvCreateImage(cvSize(in->width/2, in->height/2),in->depth,in->nChannels);cout 1.原图 2.灰度化 3.边缘检测