Suppose I have 7 numbers of ".jpg" files in a folder. All the names are numeric that is 0.jpg, 4.jpg, 1.jpg etc. How to read the files sequentially according to there name incrementally. That is first 0.jpg then 1.jpg then 4.jpg will be read.
1 | initial version |
Suppose I have 7 numbers of ".jpg" files in a folder. All the names are numeric that is 0.jpg, 4.jpg, 1.jpg etc. How to read the files sequentially according to there name incrementally. That is first 0.jpg then 1.jpg then 4.jpg will be read.
2 | No.2 Revision |
Suppose I have 7 numbers of ".jpg" files in a folder. All the names are numeric that is 0.jpg, 4.jpg, 1.jpg etc. How to read the files sequentially according to there name incrementally. That is first 0.jpg then 1.jpg then 4.jpg will be read.
I have tried with glob( ) function but image read is not sequentially..
#include <opencv2/opencv.hpp>
#include<iostream>
#include <dirent.h>
using namespace std;
using namespace cv;
int main()
{
String folder = "*.jpg";
vector<String> filenames;
glob(folder, filenames);
cout<<filenames.size90<<endl;//to read no of files
for(size_t i=0; i<filenames.size(),++i)
{
cout<<filenames[i]<<endl;
}
}
and the output is as follows 7 // no of files in the folder ./0.jpg ./11.jpg ./14.jpg ./2.jpg ./6.jpg ./8.jpg ./9.jpg
3 | No.3 Revision |
Suppose I have 7 numbers of ".jpg" files in a folder. All the names are numeric that is 0.jpg, 4.jpg, 1.jpg etc. How to read the files sequentially according to there name incrementally. That is first 0.jpg then 1.jpg then 4.jpg will be read.
I have tried with glob( ) function but image read is not sequentially..
#include <opencv2/opencv.hpp>
#include<iostream>
#include <dirent.h>
using namespace std;
using namespace cv;
int main()
{
String folder = "*.jpg";
vector<String> filenames;
glob(folder, filenames);
cout<<filenames.size90<<endl;//to cout<<filenames.size()<<endl;//to read no of files
for(size_t i=0; i<filenames.size(),++i)
{
cout<<filenames[i]<<endl;
}
}
and the output is as follows 7 // no of files in the folder ./0.jpg ./11.jpg ./14.jpg ./2.jpg ./6.jpg ./8.jpg ./9.jpg
4 | No.4 Revision |
Suppose I have 7 numbers of ".jpg" files in a folder. All the names are numeric that is 0.jpg, 4.jpg, 1.jpg etc. How to read the files sequentially according to there name incrementally. That is first 0.jpg then 1.jpg then 4.jpg will be read.
I have tried with glob( ) function but image read is not sequentially..
#include <opencv2/opencv.hpp>
#include<iostream>
#include <dirent.h>
using namespace std;
using namespace cv;
int main()
{
String folder = "*.jpg";
vector<String> filenames;
glob(folder, filenames);
cout<<filenames.size()<<endl;//to read display no of files
for(size_t i=0; i<filenames.size(),++i)
{
cout<<filenames[i]<<endl;
}
}
and the output is as follows 7 // no of files in the folder ./0.jpg ./11.jpg ./14.jpg ./2.jpg ./6.jpg ./8.jpg ./9.jpg