1

I have a folder full of images. I want to use them to compute the optical flow with OpenCV. What is a good cross-platform way to read in all the images without having to know the exact file names?

I could rename the images to 1.png, 2.png, and so on, if that helps.

guneykayim
  • 5,170
  • 2
  • 28
  • 58
gartenriese
  • 3,759
  • 3
  • 33
  • 58

1 Answers1

1

there's a hidden gem in core/utility.hpp:

void glob(String pattern, std::vector<String>& result, bool recursive = false);

(takes a dir or similar, returns a vector of filenames)

berak
  • 37,825
  • 9
  • 89
  • 86