[问题] 用thread 跑opencv 的function

楼主: PhysiAndMath (老师说要爱数学)   2017-10-11 20:18:38
开发平台(Platform): (Ex: Win10, Linux, ...)
ubuntu
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
g++
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
opencv
问题(Question):
想要用thread跑opencv的函式
但不知道该如何正确使用
喂入的资料(Input):
预期的正确结果(Expected Output):
错误结果(Wrong Output):
编译不过
error: static assertion failed: Wrong number of arguments for function
static_assert(sizeof...(_BoundArgs) == sizeof...(_Args),
程式码(Code):(请善用置底文网页, 记得排版)
int main()
{
Mat colored(3,3,CV_8UC3),
gray;
thread t(cvtColor, colored, gray, COLOR_BGR2GRAY);
t.join();
}
补充说明(Supplement):
犯蠢了
改成
thread t(cvtColor, colored, gray, COLOR_BGR2GRAY,0);
就可以过了
作者: bdvstg (bdvstg)   2017-10-12 23:58:00
从没想过直接用thread跑不是自己写的function,涨见识了!

Links booklink

Contact Us: admin [ a t ] ucptt.com