本文整理汇总了C++中FileList::getFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ FileList::getFilename方法的具体用法?C++ FileList::getFilename怎么用?C++ FileList::getFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileList
的用法示例。
在下文中一共展示了FileList::getFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
if(argc != 9) {
usages();
exit(1);
}
FileList files;
files.setRootDir(argv[2]);
files.load(argv[4]);
Vocabularys_t vocabulary;
read(argv[6], vocabulary, boost::bind(&print, _1, _2, "read vocabulary"));
//QuantizerHard
Quantizer_fn quantizer = QuantizerHard<Vec_f32_t, L2norm_squared<Vec_f32_t> >();
PropertyTree_t params;
boost::shared_ptr<Galif> galif = boost::make_shared<Galif>(params);
ofstream fout(argv[8]);
fout << files.size() <<endl;
fout << vocabulary.size() <<endl;
//Vocabularys_t samples;
//samples.resize(vecFeatures.size());
for(Index_t i = 0; i < files.size(); i++) {
//Vec_f32_t vf;
Vec_f32_t sample;
cv::Mat image = cv::imread(files.getFilename(i));
KeyPoints_t keypoints;
Features_t features;
galif->compute(image, keypoints, features);
quantize(features, vocabulary, sample, quantizer);
for(Index_t j = 0; j < sample.size(); j++) {
fout << sample[j] << " ";
}
fout << endl;
//quantize(vecFeatures[i], vocabulary, samples[i], quantizer);
cout << "quantize " << i+1 << "/" << files.size() <<"\r"<<flush;
}
cout << "quantize " << files.size() << "/" << files.size() <<"."<<endl;
//write(samples, argv[6], boost::bind(&print, _1, _2, "save representation"));
fout.close();
return 0;
}