Read all jpg images from a folder with glob except 2 images [closed]

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

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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-11-08 04:18:35.354094

Comments

1

test if fn[i] contains image1

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