当前位置:网站首页>【opencv450 samples】创建图像列表yaml
【opencv450 samples】创建图像列表yaml
2022-06-25 21:59:00 【十年一梦实验室】
/*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"
"这会从命令行 args 创建一个 yaml 或 xml 文件列表\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");//输出文件名
if (outputname.empty())
{
help(av);
return 1;
}
Mat m = imread(outputname); //检查输出是否为图像 - 防止覆盖! check if the output is an image - prevent overwrites!
if (!m.empty()) {//失败! 请指定一个输出文件,不要覆盖你的图像
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);//文件存储写入
fs << "images" << "[";
for (int i = 2; i < ac; i++) {//遍历所有图像名
fs << string(av[i]);
}
fs << "]";
return 0;
}边栏推荐
- NLP pre training model-2018:bert dictionary
- How do I project points on a 3D plane- How to project a point onto a plane in 3D?
- zabbix_server配置文件详解
- 论文笔记: 多标签学习 MSWL
- Unity technical manual - getKey and getaxis and getbutton
- 为什么OpenCV计算的帧率是错误的?
- 一位博士在华为的22年
- Why can't the mobile phone be used and the computer be connected
- ES6 const constants and array deconstruction
- What aspects should we start with in the feasibility analysis of dry goods?
猜你喜欢

ES6 const constants and array deconstruction
![Intimacy - [comfortable exit] - final communication to reduce injury](/img/ab/c02d3b4213e1706e379d26073cbf07.jpg)
Intimacy - [comfortable exit] - final communication to reduce injury

Paper notes: multi tag learning MSWl

问题记录与思考

字符串变形(字符串大小写切换和变现)

Meta universe standard forum established

Trillions of hot money smashed into the space economy. Is it really a good business?

实战:typora里面如何快捷改变字体颜色(博客分享-完美)-2022.6.25(已解决)

LM小型可编程控制器软件(基于CoDeSys)笔记十七:pto脉冲功能块

Oracle - 基本入门
随机推荐
ADB common commands
LM small programmable controller software (based on CoDeSys) note XVII: PTO pulse function block
Why can't the mobile phone be used and the computer be connected
STM32开发板+机智云AIoT+家庭监测控制系统
Some points to pay attention to when closing mongodb services (as well as related commands when opening)
Jupiter notebook common shortcut keys
GStreamer initialization and plugin registry procedures
Unity technical manual - color in life cycle coloroverlifetime-- speed color colorbyspeed
New network security competition of the secondary vocational group in 2022
CDN加速是什么
Intimacy - [comfortable exit] - final communication to reduce injury
Global and Chinese oleic acid operation mode and market supply and demand forecast report 2022 ~ 2028
Unity技术手册 - 生命周期内颜色ColorOverLifetime--速度颜色ColorBySpeed
As a programmer, how can we learn, grow and progress happily? (personal perception has nothing to do with technology)
Ue4 Ue5 combine le plug - in de reconnaissance vocale de bureau pour la reconnaissance vocale
What is 5g? What can 5g do? What will 5g bring in the future?
C language and the creation and use of database
Fastjson deserialization randomness failed
Circuit module analysis exercise 5 (power supply)
APP测试要点