Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个非常简单的问题,但我在 Google 或 OpenCV 文档中找不到答案。如何在 a 的底部插入带有向量或默认数字的行cv::Mat?我试过:
cv::Mat
std::vector<double> v = {0, 0, 1}; m.push_back(v);
可以编译,但它总是给我一个断言错误。正确的方法是什么?
添加的元素必须是Mat与容器矩阵具有相同列数的 a:
Mat
cv::Mat m = cv::Mat::ones(4, 3, CV_64F); // 3 cols, 4 rows cv::Mat row = cv::Mat::ones(1, 3, CV_64F); // 3 cols, 1 row m.push_back(row); // 3 cols, 5 rows