私はOpenCVのスターターです。私のプログラミング環境は VC++ Express 2010 + OpenCV 2.4.2 + Win 7 64 ビットです。
VC++ とパスで純粋に 32 ビット構成を使用しています。
次のコードを入力します。
#include "opencv2\highgui\highgui.hpp"
#include "opencv2\core\core.hpp"
using namespace cv;
int main(int argc, char** argv) {
char* imgPath = "logo.png";
Mat img = imread(imgPath);
namedWindow( "Example1", WINDOW_AUTOSIZE);
imshow("Example1", img);
waitKey(0);
return 0;
}
次に、コンパイルして実行します。ウィンドウが表示されますが(画像はありません)、これが表示されました(実行時エラーですか?)
Unhandled exception at 0x770515de in Helloworld2.exe: Microsoft C++ exception: cv::Exception at memory location 0x001ef038..
次に、imread を cvLoadImage に変更すると、エラーなく動作します。
誰かが何が悪いのか教えてもらえますか?