Update feature.cpp (with HOGFeatures)

增加 HOGFeatures 特征,改善了recall 和 Fscore。
v1.6alpha
lbyfind 8 years ago committed by GitHub
parent 61ad3329a1
commit caeff9d8f7

@ -49,8 +49,23 @@ void getSIFTFeatures(const Mat& image, Mat& features) {
}
//HOG Features
void getHOGFeatures(const Mat& image, Mat& features) {
//HOG descripter
HOGDescriptor * hog = new HOGDescriptor(cvSize(128, 64), cvSize(16, 16), cvSize(8, 8), cvSize(8, 8), 3); //these parameters work well
std::vector<float> descriptor;
// resize input image to (128,64) for compute
Size dsize = Size(128,64);
Mat trainImg = Mat(dsize, CV_32S);
resize(image, trainImg, dsize);
//compute descripter
hog->compute(trainImg, descriptor, Size(8, 8));
//copy the result
Mat mat_featrue(descriptor);
mat_featrue.copyTo(features);
}

Loading…
Cancel
Save