Ask Your Question

Revision history [back]

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

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]));