| RMVL 2.4.0 Robotic Manipulation and Vision Library

载入中...
搜索中...
未找到
samples/tutorial_code/io/sample_write_corners.cpp

角点数据写入例程

#include <iostream>
#include <rmvl/rmvl.hpp>
int main()
{
for (uint32_t n = 0; n < 5; ++n)
{
// data prepare
std::vector<std::vector<cv::Point2f>> corners;
corners.resize(3);
for (std::size_t i = 0; i < 3; ++i)
{
corners[i].resize(n + 1);
for (std::size_t j = 0; j < n + 1; ++j)
corners[i][j] = {i + j, n + j};
}
// write data
RMVL_Assert(rm::writeCorners("ts.yml", n, corners));
}
return 0;
}
RMVL_Assert
#define RMVL_Assert(expr)
在运行时检查条件，如果失败则抛出异常
定义 util.hpp:222
rm::writeCorners
void writeCorners(std::ostream &out, const std::vector< std::vector< std::array< float, 2 > > > &corners)
导出角点数据