我有一个简单的代码,但有一天它让我很困惑
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
void example2_4(IplImage* image)
{
cvNamedWindow("Example2_4-in", CV_WINDOW_AUTOSIZE);
cvNamedWindow("Example2_4-out", CV_WINDOW_AUTOSIZE);
cvShowImage("Example2_4-in", image);
IplImage* out = cvCreateImage(
cvGetSize(image),
IPL_DEPTH_8U,
3
);
cvSmooth(image, out, CV_GAUSSIAN, 5, 5);
cvSmooth(out, out, CV_GAUSSIAN, 5, 5);
cvShowImage("Example2_4-out", out);
cvReleaseImage(&out);
cvWaitKey(0);
cvDestroyWindow("Example2_4-in");
cvDestroyWindow("Example2_4-out");
}
int main()
{
IplImage* img = cvLoadImage("lena.png");//This is my current image,you can use yourself's to test
cvNamedWindow("Example1", CV_WINDOW_AUTOSIZE);
cvShowImage("Example1", img);
example2_4(img);
cvReleaseImage(&img);
cvDestroyWindow("Example1");
}
它始终提供错误信息,如下图