图像边界框的周长
Perimeter of bounding box of an image
我需要使用C++在OpenCV中找到图像边界框的周长。使用double perimeter = arcLength(rois[wp],true);
时,将生成以下错误:
Assertion failed (count >= 0 && (depth == CV_32F || depth == CV_32S)) in arcLength,
file /home/vidushi/Desktop/OpenCV/modules/imgproc/src/shapedescr.cpp,
line 285 terminate called after throwing an instance of 'cv::Exception'
what(): /home/vidushi/Desktop/OpenCV/modules/imgproc/src/shapedescr.cpp:285:
error: (-215) count >= 0 && (depth == CV_32F || depth == CV_32S) in function arcLength
有人可以解释一下可能是什么问题吗?
基本上,arcLength
函数不接受rois[wp]
的格式。它必须是 2D 的,并且具有CV_32S或CV_32F深度。类似于cv::Mat valid_roi(n, 2, CV_32F);
(适应您的问题(。
相关文章:
- std::当在256字节边界上写入整数时,流的奇怪行为
- 使用不变量来确定二分搜索中的边界条件
- 跨 DLL 边界访问虚拟方法是否安全/可能?
- 在 64 位边界上对齐C++结构数组?
- std::数组边界检查如何工作?
- CGAL:如何创建填充边界曲线的曲面网格?
- 在 c++ 中是否允许创建具有运行时边界的数组?
- 如何递归地解决USACO 2013-周长-银
- 是否可以跨 dll 边界返回常量引用/指向 std::vectors?
- C++11:16 字节原子<>变量是否在 16 字节边界上自动对齐,从而允许CMPXCHG16B指令?
- 转换引用对象的边界框?
- 将迭代器作为 3 个元素的滑动窗口,可以超调边界(可能使用 Boost)
- 算法设计:用边界数字表示 2D 网格的最佳方式,以C++?
- 查找矩形的边界集
- 在sfml中获取可转换的边界框
- SystemC sc_signal数组内存边界
- 如何处理libstdc++跨执行边界抛出的异常
- BoostSpirit.Qi-针对原始数据类型进行边界检查
- 在运行时为随机分布类成员设置最小和最大边界?
- 图像边界框的周长