[問題] 用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