Read all jpg images from a folder with glob except 2 images

asked 2020-01-28 10:57:06 -0500

Hello, I am using glob that exist in the file utility.hpp of Opencv this function read all the the jpg images in the file 'fn'. it's working but my goal is to read all the images except 2, and the name of the two images start with 'image1'. I can't find out how to do it with glob. also if it's not possible with glob i can't find how to do it.

I need your help, and thank you.

    vector<cv::String> fn;
    glob(DossierBD + "/*.jpg", fn, false);    
    vector<Mat> ALLimages;
    size_t count = fn.size(); //number of jpg files in images folder
    for (size_t i = 0; i < count; i++)
        ALLimages.push_back(imread(fn[i]));
edit retag flag offensive close merge delete

Comments

1

test if fn[i] contains image1

LBerger gravatar imageLBerger ( 2020-01-28 10:59:24 -0500 )edit