cv::Mat takePhoto() {
cv::VideoCapture camera(0);
cv::Mat capturedImage;
const std::string cameraWindowTitle = "Press 'SPACE' to take a photo";
const std::string agreementWinTitle = "Do you like this image? yes('y')/no('another')";
int agreeKey = 0;
do {
cv::namedWindow(cameraWindowTitle,
cv::WindowFlags::WINDOW_AUTOSIZE | cv::WindowFlags::WINDOW_KEEPRATIO);
int takingPicKey = 0;
while (takingPicKey != ' ') {
camera >> capturedImage;
cv::imshow(cameraWindowTitle, capturedImage);
takingPicKey = cv::waitKey(1);
}
cv::destroyWindow(cameraWindowTitle);
cv::imshow(agreementWinTitle, capturedImage);
agreeKey = cv::waitKey(0);
cv::destroyWindow(agreementWinTitle);
} while (agreeKey != 'y');
camera.release();
return capturedImage;
}
Po wejściu w camera.relase(); wyskakuje [ WARN:0] terminating async
Co ta asynchronizacja znaczy?
Czytałem już to(link) i chcę się upewnić tutaj, że to nie moja wina.
cv::destroyAllWindows()