Sunday, 13 February 2022

How to get list of files or images in a folder using OpenCV?

vector<cv::String> fn;
glob("/home/images/*.png", fn, false);

vector<Mat> images;
size_t count = fn.size(); //number of png files in images folder
for (size_t i=0; i<count; i++)
    images.push_back(imread(fn[i]));

 

No comments:

Post a Comment