OpenCV 格式字符串
opencv format string
请帮助我有这段代码,我想添加到这个 x 和 y 位置
cv::Rect r = some thing;
std::cout << cv::format("%d, %s (%dx%d)n", i+1, outfile.c_str(), r.width, r.height);
如何像这样添加 x 和 y我试试这个,但它没有用
std::cout << cv::format("%d, %s (%dx%d)n", i+1, outfile.c_str(), r.width, r.height, r.x, r.y);
我试过它不起作用
但是当我添加 r.x 和 r.y 并替换为 r,高度和 r.width 时,它的工作,但我想要高度和宽度以及 x 和 y
std::cout << cv::format("%d, %s (%dx%d)n", i+1, outfile.c_str(), r.x, r.y);
添加更多格式说明符(每个项目一个(:
std::cout << cv::format("%d, %s (%dx%d)(%d %d)n", i+1, outfile.c_str(), r.width, r.height, r.x, r.y);
相关文章:
- 字符串::格式有什么用. 我也没有在互联网上得到它
- 如何检查字符串格式在读取C++文本文件时是否有效?
- 十进制到八进制递归C++.以标准::字符串格式输出
- 如何从字符串格式中提取 3 个整数"v%d.%d.%d"?
- 查找可变参数列表的字符串格式指定符
- 字符串格式替换为 snprintf 中字符中的值
- 使用堆栈将字符串格式的十进制转换为双精度
- 使用字符串格式限制十六进制数字的数量
- 视觉C++:字符串格式
- C++字符串格式实现错误
- 如何在Xcode中将长双精度转换为字符串格式?或如何解决错误"use of undeclared identifier 'to_string' "
- C++以字符串格式 YYYYMMDD 减去天数
- 如何在windows和linux中使用相同的宽字符串格式
- 如何将标准::字符串格式的 JSON 解码为 Boost 属性树
- C++格式的字符串格式
- 使用C++将任何形式的日期-时间字符串格式更改为美国日期-时间格式
- 使用C/C++设置字符串格式
- 如何创建以字符串格式使用给定变量文本的宏(或其他工具)
- 如何转换?toString() 的 C 字符串格式
- 用字符串格式运算符替换C++字符串