我正在尝试使用C ++和OpenCV并行执行两个函数。这两个功能几乎相同。我只报告其中一个。
我使用std::async
但收到此错误:
error: reference to non-static member function must be called
auto Match = async(launch::async, **_find_mouth**, ref(image), ref(mouth));
这是代码:
using namespace std;
double _find_mouth(Mat img, Rect_<int> & finalMouth) //this is my function
{
//some operations on image
return bestMatch;
}
...
int main(){
auto Match = async(launch::async, _find_mouth, ref(image), ref(mouth)); //here is where I call it
}
问题出在哪里?怎么了? 提前谢谢。