opencvを用いてSURFの処理を行うプログラムを作成したのですが、行き詰まってしまいました。
初歩的な問題なのかもしれませんが、あらゆる可能性を試したつもりです。(パスの指定や、ソースの変更、修正等。ビルドは正常に終了できました。作業ディレクトリはデフォルト通りで、ライブラリ・インクルードファイル・コマンド引数の設定も問題なく行えています。また画像ファイルもソースファイルと同じディレクトリに置いてあります。)
以下の点で困っています。
VC++ 2010 の利用に於いて、SURF処理を施された"Alldrinkbottle.bmp"が表示されず、黒いウィンドウのままになる。
ウィンドウ自体は、フリーズすることもなく動かせますし、終了もできます。ただ、"Alldrinkbottle.bmp"がどうしても表示されません。
コードは下記の通りです。
#include <iostream>
#include <string>
#include <C:\opencv\opencv\include\opencv\cv.h>
#include <C:\opencv\opencv\build\include\opencv\highgui.h>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
// (1)load Color Image
const char *imagename = argc > 1 ? argv[1] : "Alldrinkbottle.bmp";
Mat colorImage = imread(imagename,1);
if(colorImage.empty())
return -1;
// (2)convert Color Image to Grayscale for Feature Extraction
Mat grayImage;
cvtColor(colorImage, grayImage, CV_BGR2GRAY);
// (3)initialize SURF class
SURF calc_surf = SURF(500,4,2,true);
// (4)extract SURF
vector<KeyPoint> kp_vec;
vector<float> desc_vec;
calc_surf(grayImage, Mat(), kp_vec, desc_vec);
// (5)draw keypoints
cout << "Image Keypoints: " << kp_vec.size() << endl;
#if 1
vector<KeyPoint>::iterator it = kp_vec.begin(), it_end = kp_vec.end();
for(; it!=it_end; ++it) {
circle(colorImage, Point(it->pt.x, it->pt.y),
saturate_cast<int>(it->size*0.25), Scalar(255,255,0));
}
#else
for(int i = 0; i < kp_vec.size(); i++) {
KeyPoint* point = &(kp_vec[i]);
Point center; // Key Point's Center
int radius; // Radius of Key Point
center.x = cvRound(point->pt.x);
center.y = cvRound(point->pt.y);
radius = cvRound(point->size*0.25);
circle(colorImage, center, radius, Scalar(255,255,0), 1, 8, 0);
}
#endif
namedWindow("SURF",CV_WINDOW_AUTOSIZE);
imshow("SURF", colorImage);
waitKey(0);
return 0;
}
'nakazawa_lab.exe': 'C:\Users\Owner\Documents\Visual Studio 2010\Projects\nakazawa_lab\Debug\nakazawa_lab.exe' を読み込みました。シンボルが読み込まれました。
'nakazawa_lab.exe': 'C:\Windows\System32\ntdll.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\kernel32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\KernelBase.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\opencv\opencv\build\x86\vc10\bin\opencv_core243.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msvcp100.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msvcr100.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\opencv\opencv\build\x86\vc10\bin\opencv_features2d243.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\opencv\opencv\build\x86\vc10\bin\opencv_imgproc243.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\opencv\opencv\build\x86\vc10\bin\opencv_flann243.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\opencv\opencv\build\x86\vc10\bin\opencv_highgui243.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\user32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\gdi32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\lpk.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\usp10.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msvcrt.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\ole32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\rpcrt4.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\oleaut32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\advapi32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\sechost.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\avifil32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\winmm.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msacm32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msvfw32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\shell32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\shlwapi.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\avicap32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\version.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\opencv\opencv\build\x86\vc10\bin\opencv_nonfree243.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msvcp100d.dll' を読み込みました。シンボルが読み込まれました。
'nakazawa_lab.exe': 'C:\Windows\System32\msvcr100d.dll' を読み込みました。シンボルが読み込まれました。
'nakazawa_lab.exe': 'C:\Windows\System32\imm32.dll' を読み込みました。Cannot find or open the PDB file
'nakazawa_lab.exe': 'C:\Windows\System32\msctf.dll' を読み込みました。Cannot find or open the PDB file
プログラム '[8560] nakazawa_lab.exe: ネイティブ' はコード -1 (0xffffffff) で終了しました。
もしよろしければご教授願えないでしょうか。
宜しくお願い致します。