最近调试人脸问题的总结--命令行+抽取第二级子目录的名称
2017-12-17 16:15
246 查看
最近调试人脸识别程序的总结
1. 人脸检测
人脸检测的阈值是0.7 在外部不允许更改
2. 命令行的程序
有时候出现点击批处理闪退的情况 比较建议的方式是重写一个bat 文件
目前没有找到根本原因
bat 文件里面的路径的方式:
facedetect.exe E:\data\guoche_gallay\guoche_gallay E:\data\guoche_gallay
需要注意的点:路径不是双斜杠
3.命令行文件的复制问题:
char* sFile1 = argv[1];
char* sFile2 = argv[2];
如果需要转换成int 使用atoi 函数
与matlab 中是不同的
5. 写特征到文件
FILE *f = fopen(feature_path, "rb");
if (f)
{
fread(pFeature2, EF_Size(), 1, f);
//fread(pFeature2, 1, EF_Size(), f); // 这两个用法那个对 需要确认
fclose(f);
}
7. 写数据到文件
static ofstream file2("first_part_score1.txt");
file2 << tline.c_str() << " " << label_txt_img.c_str() << " " << score << endl;
8. 读文件
ifstream infile("first_thread.txt", ios::binary | ios::in);
while (!infile.eof())
{ // 从磁盘文件输入
infile >> tline >> label_txt >> label_txt_img;
}
1. 人脸检测
人脸检测的阈值是0.7 在外部不允许更改
2. 命令行的程序
有时候出现点击批处理闪退的情况 比较建议的方式是重写一个bat 文件
目前没有找到根本原因
bat 文件里面的路径的方式:
facedetect.exe E:\data\guoche_gallay\guoche_gallay E:\data\guoche_gallay
需要注意的点:路径不是双斜杠
3.命令行文件的复制问题:
char* sFile1 = argv[1];
char* sFile2 = argv[2];
如果需要转换成int 使用atoi 函数
char *str = "12345.67"; n = atoi(str); printf("n=%d\n",n);
http://blog.csdn.net/li6727975/article/details/428756414. 抽取倒数第二级如何做到:
for (int j = 0; j < files_gallary.size(); ++j) { img_gallary = imread(files_gallary[j].c_str()); if (img_gallary.empty()) continue; string szMarkupFilePath = files_gallary[j].c_str(); int last = szMarkupFilePath.find_last_of("."); int begin1 = szMarkupFilePath.find_last_of("\\"); int begin2 = szMarkupFilePath.find_last_of("/"); int begin3 = szMarkupFilePath.find_last_not_of("\\"); int begin = max(begin1, begin2); string name = szMarkupFilePath.substr(begin + 1, last - begin - 1 + 4); string subname_full = szMarkupFilePath.substr(0, begin); cout << "subname_full " << subname_full << endl; int last1 = begin; int begin2_1 = subname_full.find_last_of("\\"); int begin2_2 = subname_full.find_last_of("/"); int begin2_3 = subname_full.find_last_not_of("\\"); int begin22 = max(begin2_1, begin2_2); string name2 = subname_full.substr(begin22 + 1, last1 - begin22 - 1 + 4); cout << "name2 " << name2 << endl; }需要说明的是subname_full.substr这个函数的第一个为需要抽取的厨师地址,后面是长度
与matlab 中是不同的
5. 写特征到文件
FILE *f = fopen(feature_path, "wb"); if (f){ fwrite(pFeature1, EF_Size(), 1, f); fclose(f); } FILE *f1 = fopen(feature_path_beifen, "wb"); if (f1) { fwrite(pFeature1, EF_Size(), 1, f); fclose(f1); }6. 从文件读取特征
FILE *f = fopen(feature_path, "rb");
if (f)
{
fread(pFeature2, EF_Size(), 1, f);
//fread(pFeature2, 1, EF_Size(), f); // 这两个用法那个对 需要确认
fclose(f);
}
7. 写数据到文件
static ofstream file2("first_part_score1.txt");
file2 << tline.c_str() << " " << label_txt_img.c_str() << " " << score << endl;
8. 读文件
ifstream infile("first_thread.txt", ios::binary | ios::in);
while (!infile.eof())
{ // 从磁盘文件输入
infile >> tline >> label_txt >> label_txt_img;
}
相关文章推荐
- Android开发项目名称文件夹报错,但是根目录不报错问题解决方案总结
- 最近遇到一个问题SQLSERVER2005 目录名称无效(批处理过程出错,不能查询)
- 总结最近游戏中活动出现被刷问题。
- 用eclipse实现NDK调试常见问题总结
- 最近在DEMO中使用Teechart出现的问题及解决方案总结
- Linux环境下段错误的产生原因及调试方法小结 最近在Linux环境下做C语言项目,由于是在一个原有项目基础之上进行二次开发,而且项目工程庞大复杂,出现了不少问题,其中遇到最多、花费时间最长的问题就是
- c++开发中,调试排查问题总结
- Mac电脑修改账户名称和个人目录后丢失管理员权限问题
- 简要总结最近遇到的5个问题
- Android基础问题总结-1-如何在编译时向Android任一目录添加文件
- 最近在SPARK上定位的几个内存泄露问题总结
- Mac电脑修改账户名称和个人目录后丢失管理员权限问题
- camera 驱动调试常见问题总结
- WEB-INF 有关的目录路径问题总结
- 最近遇到的jsfl开发问题总结
- 最近配置IBM设备遇到的问题总结
- 总结一下最近整合spring4和hibernate4遇到的问题
- windows ICE 调试问题总结
- 监控 Linux 性能的 18 个命令行工具 对于Linux系统的管理员而言,每天监控和调试Linux系统的性能问题是一项繁重的工作。本文中分享了18个命令行工具,这些工具将有助于每个Linux/Un
- MFC调用CFileDialog之后目录居然会改变,调试了好久终于发现是这个问题