Verwenden von STD :: Async mit einer Methode, die ein cv :: outputArray empfängt, um sie zuzuweisen, funktioniert nichtC++

Programme in C++. Entwicklerforum
Guest
 Verwenden von STD :: Async mit einer Methode, die ein cv :: outputArray empfängt, um sie zuzuweisen, funktioniert nicht

Post by Guest »

Ich habe die folgende Funktion: < /p>

Code: Select all

void MyClass::myFunc(cv::OutputArray dst) const {
cv::Mat result;
...
dst.assign(result);
}
< /code>
Wenn ich es so ausführecv::Mat result;
myFunc(result);
otherFunc(result);
Es funktioniert einwandfrei und andere Func erhält Ergebnis durch myfunc .
, aber wenn ich STD verwende :: async wie folgt:

Code: Select all

cv::Mat result;
auto resultFuture = std::async(&MyClass::myFunc, this, result);
resultFuture.wait();
otherFunc(result);
< /code>
otherFunc
empfängt leeres Ergebnis . Was mache ich falsch?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post