#include <opencv2opencv.hpp> #include <iostream> #include <string> using namespace cv; using namespace std; int main() { Mat M(7,7,CV_32FC2,Scalar(1,3)); IplImage* img=cvLoadImage("opencv.jpg"); cvNamedWindow("Window1",CV_WINDOW_AUTOSIZE); //cvRectangle(img,cvPoint(10,10),cvPoint(250,250),cvScalar(0,255,0),5); cvShowImage("Window1",img); cvNamedWindow("滤波后图像"); IplImage* img0=cvCreateImage( cvGetSize(img),IPL_DEPTH_8U, 3); cvSmooth(img,img0,CV_GAUSSIAN,7,7); cvShowImage("滤波后图像",img0); cvWaitKey(0); cvReleaseImage(&img); cvReleaseImage(&img0);
cvDestroyWindow("读取一张照片"); cvDestroyWindow("滤波后图像"); return 0; }