如何在c++中调用openCV中的cvMorphologyEx?
我需要在我的图像处理项目中调用 cvMorphologyEx,我使用这条线来完成它。
cvMorphologyEx(src1,dest1,NULL,NULL,CV_MOP_OPEN);
它编译得很好,但是在运行时它给了我这个错误
OpenCV 错误:错误标志(参数或结构字段)(无法识别或不支持 ed 数组类型)在未知函数中,文件 ........\ocv\opencv\src\cxcore\cxarr ay.cpp,第 2476 行
我确定问题出在第三个和第四个参数中,但文档说它们是可选的。
如果您需要更多详细信息,请告诉我。
谢谢,
再见
i need to call cvMorphologyEx in my image processing project and i do it using this line.
cvMorphologyEx(src1,dest1,NULL,NULL,CV_MOP_OPEN);
It compiles fine but while running it gives me this error
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupport
ed array type) in unknown function, file ........\ocv\opencv\src\cxcore\cxarr
ay.cpp, line 2476
I am sure the problem is in the third and fourth arguments but the documentation says that they are optional.
If you need anymore details please tell me.
Thanks,
Bye
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须创建一个 IplConvKernel 并将其传递给函数,否则 cvMorphologyEx 不知道结构元素的大小和形状,因此它无法进行任何处理。
请注意,结构元素不是可选的!
You have to create an IplConvKernel and pass it to the function, otherwise cvMorphologyEx dose not know the size and the shape of the structuring element so it can no do any processing.
Take care the structuring element is not optional!