【发布时间】:2011-09-10 23:58:45
【问题描述】:
我正在尝试将我的 Visual C++ 配置为使用 openCV 库。我已按照 OpenCV 网站 http://opencv.willowgarage.com/wiki/VisualC%2B%2B...
上的说明进行操作// OpenCV_Helloworld.cpp : Defines the entry point for the console application.
// Created for build/install tutorial, Microsoft Visual Studio and OpenCV 2.2.0
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
// Open the file.
IplImage *img = cvLoadImage("photo.jpg");
if (!img) {
printf("Error: Couldn't open the image file.\n");
return 1;
}
// Display the image.
cvNamedWindow("Image:", CV_WINDOW_AUTOSIZE);
cvShowImage("Image:", img);
// Wait for the user to press a key in the GUI window.
cvWaitKey(0);
// Free the resources.
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
我已更改属性页内 VC++ 目录中的 include 和 library 目录,并添加了其他依赖项。但是,当我尝试使用与示例代码相同的头文件加载图像时,它说 cvLoadImage 未定义,cvNamedWindow 也是如此
IplImage *img = cvLoadImage("JellyFish.jpg");
关于我可能遇到问题的任何建议?
【问题讨论】:
标签: c++ visual-studio visual-studio-2010 visual-c++ opencv