ディテクタ ORB を使用して画像内のキーポイントを取得しようとしていますが、常に例外が発生してクラッシュします。私のコードは次のコードです。
vector < KeyPoint > kp;
int nfeatures = 500;
float scaleFactor = 1.2f;
int nlevels = 8;
int edgeThreshold = 15;
int firstLevel = 0;
int WTA_K = 2;
int scoreType = ORB::HARRIS_SCORE;
int patchSize = 31;
int fastThreshold = 20;
Ptr < ORB > detector = ORB::create(
nfeatures,
scaleFactor,
nlevels,
edgeThreshold,
firstLevel,
WTA_K,
scoreType,
patchSize,
fastThreshold );
detector->detect(img, kp);
cout << "Found " << kp.size() << " Keypoints " << std::endl;
Mat out;
drawKeypoints(img, kp, out, Scalar::all(255));
imshow("Kpts", out);
img は早期に宣言されますが、問題は dodetector->detect(img, kp); の場合です。何が問題なのかわかりません。他の形式で実行しようとしていますが、detect() の呼び出しですべてクラッシュします。
私はBRISKでやろうとしていますが、問題はクラッシュ検出の呼び出しでも同じです。活発に私は簡単にするために次のものをやった:
Ptr < BRISK > detector = BRISK::create();
vector <KeyPoint> kp;
detector->detect(img,kp);
これは腹立たしいことです。
Windows 10のVisual Studio 2015でopencv 3を使用しています。
私の英語で申し訳ありませんが、答えてくれてありがとう。