std::vector<cv::String> img_paths;
std::string tmp_(imgs_path);
cv::glob((tmp_ + "/*.jpg"), img_paths, false);
for(auto i:img_paths){
int length = i.size();
std::string txt_name = "****"+i.substr(11, length-15) + ".txt";
// 重复写入
ofstream OutFile(txt_name, ios::app);
c++使用glob查找文件下的图片,并追加目标检测结果写入到txt文件中
于 2022-09-02 09:41:00 首次发布