Opencv Mat访问违规
Opencv Mat access violation
运行以下代码时:
for(int i = 0; i < result.size(); ++i) {
for(int j = 0; j < result[i].size(); ++j) {
if(anchor_map->at<float>(i, j) > 0) {
}
}
}
由于result.size()1200和result[i].size(。
问题是,每次在i=1197,j=1436时,它都会因访问违规而中断,而anchor_map在开始时被设置为零,在右像素处为锚点所在的像素。
是在windows 7上的Visual Studio 12中制作的64位
试试这个:
using namespace cv;
void main (void)
{
Mat anchor_map(1200,1600,CV_8UC1);
for(int i = 0; i < anchor_map.rows; ++i) {
for(int j = 0; j < anchor_map.cols; ++j) {
if(anchor_map.at<unsigned char>(i, j) > 0) {
}
}
}
getchar();
}
相关文章:
- C++中的openCV Mat访问冲突
- 在 OpenCV 中访问具有多个线程的 Mat 是否线程安全?
- OPENCV MAT内存访问错误
- 如何访问 3D CV::Mat 的索引
- 访问图像像素;MatIterator_<> 和 Mat::at 运算符的比较
- 访问 cv::Mat 数据的 OpenCV 错误
- 在本机中访问 MAT 像素
- 如何从OpenCV Mat访问浮点值(.at和.ptr除外)
- 访问OpenCV中的Mat二进制图像元素
- 来自 Mat 的 OpenCV 访问元素
- 访问Ximea相机并使用OpenCV设置预定义的分辨率时,由于相机默认分辨率的大小为Mat,因此显示混乱的输出
- opencv访问CV_32FC3 BGR CV::Mat的颜色元素
- Opencv Mat访问违规
- OpenCV Mat数据成员访问
- 在openCV中访问mat中的元素时获取垃圾值
- 使用 copyTo 命令后无法访问 mat 的数据
- OpenCV访问MAT对象中的RGB值
- 如何访问函数内部Mat类型参数的变量名
- 如何在OpenCV中访问多维Mat中的2D矩阵
- 如何在openCV中使用c++接口初始化和访问Mat标量矩阵中的条目