如何解决使用opencv时的fopen错误

时间:2017-08-04 04:18:03

标签: c++ opencv

我有一个简单的代码,但有一天它让我很困惑

#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");
}

它始终提供错误信息,如下图

image description

  1. 我能知道哪个句子叫" logger.h"文件和结果 错误?
  2. 如何避免此类错误?

0 个答案:

没有答案