在用多线程传opencv的Mat时,报错:
QObject::connect: Cannot queue arguments of type 'Mat'
(Make sure 'Mat' is registered using qRegisterMetaType().)
修改Connect,加一个属性Qt::directConnection.
connect(thread1, SIGNAL(freshImg(const cv::Mat &)), this, SLOT(show_img(const cv::Mat &)),Qt::DirectConnection);
参考博客:https://blog.youkuaiyun.com/sinat_24206709/article/details/55209780
本文介绍了一种解决多线程环境中传递OpenCV的Mat类型时出现的QObject::connect错误的方法。通过设置Qt::DirectConnection属性,可以避免无法排队Mat类型参数的问题。
1793

被折叠的 条评论
为什么被折叠?



