Guest User

Untitled

a guest
Jul 10th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1.     cv::Mat webcam_img;
  2.     cv::Mat grey_webcam_img;
  3.     // schedule taking webcam image on the opencv pool
  4.     hpx::future<cv::Mat> f_image =
  5.             webcam_closed.then([&](hpx::future<int>&& wc){
  6.                 hpx::cout << "Webcam closed\n";
  7.                 return hpx::async(opencv_executor, &take_webcam_image);
  8.             });
  9.  
  10.     // schedule transforming webcam image to grey-scale on opencv pool
  11.     hpx::future<cv::Mat> f_grey_image =
  12.             f_image.then([&](hpx::future<cv::Mat>&& fi){
  13.                 hpx::cout << "Image taken\n";
  14.                 webcam_img = fi.get();
  15.                 return hpx::async(opencv_executor, &transform_to_grey,
  16.                                   webcam_img);
  17.             });
  18.  
  19.     f_grey_image.then([&](hpx::future<cv::Mat>&& fgi){
  20.             hpx::cout << "Image transformed to grey\n";
  21.             grey_webcam_img = fgi.get();
  22.             return hpx::async(opencv_executor, &save_image, grey_webcam_img, "");
  23.         });
Advertisement
Add Comment
Please, Sign In to add comment