[問題] 用thread 跑opencv 的function

看板C_and_CPP作者 (老師說要愛數學)時間8年前 (2017/10/11 20:18), 8年前編輯推噓1(100)
留言1則, 1人參與, 8年前最新討論串1/1
開發平台(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); 就可以過了 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.113.25.64 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1507724321.A.86A.html ※ 編輯: PhysiAndMath (140.113.25.62), 10/11/2017 20:28:56

10/12 23:58, 8年前 , 1F
從沒想過直接用thread跑不是自己寫的function,漲見識了!
10/12 23:58, 1F
文章代碼(AID): #1PtWmXXg (C_and_CPP)