Page 1 of 1

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

Posted: 14 Feb 2025, 04:36
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?