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,210
  • 2
  • 29
  • 61
gartenriese
  • 4,131
  • 6
  • 36
  • 60

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
  • 39,159
  • 9
  • 91
  • 89