fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. #include <boost/filesystem>
  5. #include <cv/core.hpp>
  6. #include <cv/highgui.hpp>
  7.  
  8. std::vector<cv::Mat> read_images_from_dir(std::string dir_name) {
  9.  
  10. std::vector<cv::Mat> image_vec;
  11.  
  12. boost::filesystem::path p(dir_name);
  13.  
  14. std::vector<boost::filesystem::path> tmp_vec;
  15.  
  16. std::copy(boost::filesystem::directory_iterator(p),
  17. boost::filesystem::directory_iterator(),
  18. back_inserter(tmp_vec));
  19.  
  20. std::vector<boost::filesystem::path>::const_iterator it = tmp_vec.begin();
  21.  
  22. for (; it != tmp_vec.end(); ++it) {
  23.  
  24. if (is_regular_file(*it)) {
  25. //std::cout << it->string() << std::endl;
  26. image_vec.push_back(read_image(it->string()));
  27. }
  28. }
  29.  
  30. return image_vec;
  31. }
  32.  
  33. std::vector<cv::Mat> compute(std::vector<cv::Mat>& image_vec) {
  34.  
  35. std::vector<cv::Mat> output_images(image_vec.size());
  36.  
  37. std::vector<cv::Mat> tmp_images(124);
  38.  
  39. processed_images = 0;
  40. while (processed_images < image_vec.size()) {
  41. // make computations and update the output_images
  42. // for the images that are currently in processed
  43.  
  44. // remove the images that finished from the tmp_images
  45. // and update the processed_images variable
  46.  
  47. // import new images to tmp_images unless there
  48. // are no more in the input vector
  49. }
  50.  
  51. return output_images;
  52. }
  53.  
  54. void main(int argc, char* argv[]) {
  55.  
  56. std::vector<cv::Mat> input_images = read_images_from_dir(file_or_dir);
  57.  
  58. std::vector<cv::Mat> output_images = compute(input_images);
  59.  
  60. // save the output_images
  61. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:10: fatal error: 'boost/filesystem' file not found
#include <boost/filesystem>
         ^
1 error generated.
stdout
Standard output is empty