本文整理汇总了C++中Performance::computeGeneralDSCoreMap方法的典型用法代码示例。如果您正苦于以下问题:C++ Performance::computeGeneralDSCoreMap方法的具体用法?C++ Performance::computeGeneralDSCoreMap怎么用?C++ Performance::computeGeneralDSCoreMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Performance
的用法示例。
在下文中一共展示了Performance::computeGeneralDSCoreMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char** argv )
{
string reference;
string input_dir;
string ground_truth_dir;
static int verbose_flag;
int option_index = 0;
int c;
static struct option long_options[] = {
{"verbose", no_argument, &verbose_flag, 1},
{"brief", no_argument, &verbose_flag, 0},
{"img", required_argument, 0, 'i'},
{0, 0, 0, 0}
};
while ((c = getopt_long(argc, argv, "r:i:",
long_options, &option_index)) != -1) {
if (c == -1)
break;
switch (c) {
case 'i':
ground_truth_dir = optarg;
break;
case 'h':
case '?':
display_usage();
break;
default:
abort ();
}
}
// Read files from input directory
string output_dir ("dscore_map");
if ( !exists(path(output_dir)) )
create_directory(output_dir);
map<unsigned int, string> gt_files;
int gt_size = -1;
// Verify input name is a video file or sequences of jpg files
path path_to_ground_truth ( chomp(ground_truth_dir) );
//path path_to_ground_truth (ground_truth_dir.c_str());
if (is_directory(path_to_ground_truth)) {
// fills list gt_files with <number,file_number>
list_files(ground_truth_dir,gt_files);
gt_size = gt_files.size();
output_dir += "/" + path_to_ground_truth.filename().string();
// Create local directory to save xml maps.
if ( !exists(path(output_dir)) )
create_directory(output_dir);
}
else {
cout << "Invalid ground-truth directory ... "<< endl;
return 0;
}
map<unsigned int, string>::iterator gt_it;
Performance *measure = new Performance();
Mat Image;
Mat Map;
for (gt_it = gt_files.begin(); gt_it != gt_files.end(); ++gt_it) {
Image = Scalar::all(0);
Map = Scalar::all(0);
// open ground truth frame.
Image = imread(gt_it->second, CV_LOAD_IMAGE_GRAYSCALE);
// get general Map
measure->computeGeneralDSCoreMap(Image, Map);
string dirname = fileName(gt_it->second);
cout << dirname << endl;
stringstream mapfile;
mapfile << output_dir << "/" << gt_it->first << ".xml";
FileStorage fs(mapfile.str(), FileStorage::WRITE);
stringstream tagname;
tagname << "DSCORE" << gt_it->first;
fs << "DSCORE" << Map;
fs.release();
//.........这里部分代码省略.........