【发布时间】:2013-11-19 11:33:47
【问题描述】:
如何在 C++ 中将 Mat 转换为 2d 向量(向量的向量)? 我试过了,但 Mat.at 函数出错了。
vector<vector<double>> dctm(300, vector<double>(300,0));
for (int i = 0; i < 300; i++) {
for (int j = 0; j < 300; j++) {
dctm[i][j] = img.at<double>(i, j);
}
}
【问题讨论】:
-
XY.exe 中 0x7690c41f 处未处理的异常:Microsoft C++ 异常:cv::Exception at memory location 0x012aecb8..
-
/mat.hpp:537: error: (-215) dims ::channels) > ((DataType<_tp>::depth ) & ((1 ,std::allocator
>跨度> -
看看这里:stackoverflow.com/questions/14303073/…(考虑使用 Vec3f 而不是 double...)
-
你的 Mat 的实际 type() 是什么?我敢打赌它不是双重的
-
它是无符号字符,但我想将其转换为双倍
标签: c++ visual-studio-2010 opencv vector mat