OpenCV错误:错误标志
OpenCV Error: Bad flag
我正在opencv中研究一些方法,但不断收到以下错误:
OpenCV Error: Bad flag(parameter or structure field) (unrecognized or unsupported array)
这是代码:
void RafiTextLineExtractor::eraseMargins(){
Mat img = _image.clone();
threshold(img, img, 100, 200, CV_THRESH_BINARY_INV);
BinaryComponentExtractor bn;
bn.setImage(&DImage(img));
vector<ConnectedComponent*> components;
bn.extract(components);
namedWindow("components",CV_WINDOW_NORMAL);
imshow("components", img);
}
void BinaryComponentExtractor::extract(vector<ConnectedComponent*>& components){
vector<vector<Point>> contours;
vector<Vec4i> hierarchy;
Mat mat = _image->getMat().clone();
cv::findContours(mat, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_NONE, Point(0, 0) );
collectComponents(contours, hierarchy, components);
}
void setImage(DImage* img) { _image = img; }
此外,当我调试项目时,它似乎没有传递图像(在bn.setImage()
..中)。任何想法为什么会发生这种情况?
问候。
您的函数返回None。所以你想展示"无"。
相关文章:
- 有关使用标志位设置内部错误标志的说明
- Clang:覆盖之前在命令行上指定的所有警告和错误警告标志
- std::function, Clang 6.0 & MSVC (10.0017134.12) - 可能的 ABI 错误或必需的编译器标志
- 为什么在编译过程中尽管有 -I(破折号大写 i)标志,但仍会出现未定义的引用错误?
- 为什么我必须将错误状态标志设置为 goodbit 才能使其工作
- C - iStream错误标志
- 链接QT5库会自动将额外的FPIC标志传递给NVCC编译器,并通过cmake Cause错误
- 安装XLNT后,具有-lxnt标志的G 错误
- 用错误的标志顺序编译后,是否删除*.cpp文件
- 可以清除流的单个错误状态标志
- std::ostringstream将标志放在错误的位置
- 为什么std::istringstream在没有引发故障位标志的情况下生成错误的结果
- 优化标志会导致计算错误
- 使用 ios::Nocreate 标志会导致"undeclared identifier"错误
- 标志 ios_base::app 的错误行为
- GCC 错误错误的 ELF 类:ELFCLASS64,尽管有 -m64 标志
- 异常是否应具有标志/消息,或者每个错误应具有异常类型
- OpenCV错误:错误标志
- 有没有办法将 WinAPI 错误标志作为字符串获取
- 读取文件时避免错误标志