一連の 64x128 画像で歩行者を認識するように SVM 分類器をトレーニングしようとしています。HOG 機能を使用して既にそれを行っていますが、今度は SIFT と ORB を使用して同じことを実装する必要があります。HOG 機能の場合、常に同じ数の機能 (3780) を使用していたため、トレインの行列は image_number by 3780 でした。ここで、SIFT エクストラクタを使用して、さまざまなサイズのキーポイントを取得します。これらの異なるサイズのキーポイントを使用して、分類子のマトリックスを作成するにはどうすればよいですか?
助けてくれて本当にありがとうございます!
記述子の問題をすべて同じ行に配置して解決しました。しかし、ほとんどの記述子は 0 の値を持っているため、分類器がうまく機能しないことがわかりました。どうすればこの問題を解決できるか知っていますか?
これはコードの一部です:
DenseFeatureDetector detector;
SiftDescriptorExtractor descriptor;
vector<KeyPoint> keypoints;
//for every image I compute te SIFT
detector.detect(image, keypoints);
Mat desc;
descriptor.compute(image,keypoints, desc);
Mat v(1,30976,CV_32FC1);
for (int j = 0; j<desc.rows; j++){
for(int k = 0; k<desc.cols; k++){
v.at<float>(0,128*j+k) = desc.at<float>(j,k);
}
} //now in vector v there are all the descriptors (the problem is that most of them have 0 value)
descriptormat.push_back(v); //descriptormat is the cv::Mat that I use to train the SVM