当前位置:网站首页>[opencv450 samples] create image list yaml
[opencv450 samples] create image list yaml
2022-06-25 23:25:00 【Ten year dream Lab】
/*this creates a yaml or xml list of files from the command line args
*/
#include "opencv2/core.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include <string>
#include <iostream>
using std::string;
using std::cout;
using std::endl;
using namespace cv;
static void help(char** av)
{
cout << "\nThis creates a yaml or xml list of files from the command line args\n"
" This will be from the command line args Create a yaml or xml File list \n"
"usage:\n./" << av[0] << " imagelist.yaml *.png\n"
<< "Try using different extensions.(e.g. yaml yml xml xml.gz etc...)\n"
<< "This will serialize this list of images or whatever with opencv's FileStorage framework" << endl;
}
int main(int ac, char** av)
{
cv::CommandLineParser parser(ac, av, "{help h||}{@output||}");
if (parser.has("help"))
{
help(av);
return 0;
}
string outputname = parser.get<string>("@output");// Output file name
if (outputname.empty())
{
help(av);
return 1;
}
Mat m = imread(outputname); // Check whether the output is an image - To prevent from covering ! check if the output is an image - prevent overwrites!
if (!m.empty()) {// Failure ! Please specify an output file , Don't overwrite your image
std::cerr << "fail! Please specify an output file, don't want to overwrite you images!" << endl;
help(av);
return 1;
}
FileStorage fs(outputname, FileStorage::WRITE);// File store write
fs << "images" << "[";
for (int i = 2; i < ac; i++) {// Traverse all image names
fs << string(av[i]);
}
fs << "]";
return 0;
}边栏推荐
猜你喜欢

小程序绘制一个简单的饼图

使用EAST ocr遇到的坑解决方法(编译lanms)

Fegin client entry test

Idea FAQ collection

Paper notes: multi tag learning MSWl

UE4_UE5结合offline voice recognition插件做语音识别功能
[email protected]@COLLATION_CONNECTION */"/>.sql数据库导入错误:/*!40101 SET @[email protected]@COLLATION_CONNECTION */

Idea shortcut
![[modulebuilder] GP service realizes the intersection selection of two layers in SDE](/img/4a/899a3c2a0505d2ec2eaae97a3948c9.png)
[modulebuilder] GP service realizes the intersection selection of two layers in SDE

ES6 learning -- let
随机推荐
汇编语言核心要点
Idea common plug-ins
The wisdom of questioning? How to ask questions?
电路模块分析练习5(电源)
Technology blog site collection
ES6-Const常量与数组解构
异或运算符简单逻辑运算 a^=b
万亿热钱砸向太空经济,真的是一门好生意?
C language and the creation and use of database
UE4_ Ue5 combines the offline voice recognition plug-in for speech recognition
Unity technical manual - particle foundation main module attributes - upper
Oracle - 基本入门
【opencv450-samples】inpaint 使用区域邻域恢复图像中的选定区域
2、一个向量乘它的转置,其几何意义是什么?
等价类,边界值,场景法的使用方法和运用场景
Baidu: in 2022, the top ten hot spots will rise and the profession will be released. There is no suspense about the first place!
元宇宙标准论坛成立
UE4_UE5结合offline voice recognition插件做语音识别功能
百度:2022年十大热度攀升专业出炉,第一名无悬念!
Pit resolution encountered using East OCR (compile LAMS)