Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cv::Mat webcam_img;
- cv::Mat grey_webcam_img;
- // schedule taking webcam image on the opencv pool
- hpx::future<cv::Mat> f_image =
- webcam_closed.then([&](hpx::future<int>&& wc){
- hpx::cout << "Webcam closed\n";
- return hpx::async(opencv_executor, &take_webcam_image);
- });
- // schedule transforming webcam image to grey-scale on opencv pool
- hpx::future<cv::Mat> f_grey_image =
- f_image.then([&](hpx::future<cv::Mat>&& fi){
- hpx::cout << "Image taken\n";
- webcam_img = fi.get();
- return hpx::async(opencv_executor, &transform_to_grey,
- webcam_img);
- });
- f_grey_image.then([&](hpx::future<cv::Mat>&& fgi){
- hpx::cout << "Image transformed to grey\n";
- grey_webcam_img = fgi.get();
- return hpx::async(opencv_executor, &save_image, grey_webcam_img, "");
- });
Advertisement
Add Comment
Please, Sign In to add comment