使用 OpenCV /C++ 应用精明边缘检测器后出现"Unhandled exception"错误
getting "Unhandled exception" error after applying canny edge detector using opencv /c++
当我试图将Canny边缘检测器应用到我的图像中时,我得到了"未处理的异常"错误。
int width;
int height;
cv::Mat dis = Mat(width, height, CV_32FC1,Dis);
cv::Mat cannyEdge(dis.rows, dis.cols, CV_32FC1);
GaussianBlur( dis, dis, Size(3, 3), 2, 2 );
Canny( dis, cannyEdge , 100 , 100 * 3, 3);
imshow("canny_edge",cannyEdge);
}
似乎一切都是正确的,但我在Canny函数调用行中出错。。。
提前谢谢。。
根据OpenCV文档,Canny()函数的参数
源图像–单通道8位
需求——与来源尺寸和类型相同。
您使用的是32位浮点图像。
尝试
cv::Mat dis = Mat(width, height, CV_8UC1,Dis);
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 代码在main()中运行,但在函数中出现错误
- 释放错误后堆使用
- (C++)分析树以计算返回错误值的简单算术表达式
- Project Euler问题4的错误解决方案
- 我的字符计数代码计算错误.为什么
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 在某些循环内使用vector.push_back时出现分段错误
- 双向链表"unhandled exception"错误
- 使用 OpenCV /C++ 应用精明边缘检测器后出现"Unhandled exception"错误
- 我收到此错误"Unhandled exception at 0x009437bd in Hash functions.exe: 0xC0000005: Access violation reading
- strcat 错误"Unhandled exception.."