1 | initial version |
with the help of glob it is pretty easy:
cv::String path("lfw3d_9000/*.jpg"); //select only jpg
vector<cv::String> fn;
vector<cv::Mat> data;
cv::glob(path,fn,true); // recurse
for (size_t k=0; k<fn.size(); ++k)
{
cv::Mat im = cv::imread(fn[k], 0);
data.push_back(im);
}
2 | No.2 Revision |
with the help of glob it is pretty easy:
cv::String path("lfw3d_9000/*.jpg"); //select only jpg
vector<cv::String> fn;
vector<cv::Mat> data;
cv::glob(path,fn,true); // recurse
for (size_t k=0; k<fn.size(); ++k)
{
cv::Mat im = cv::imread(fn[k], 0);
// you probably want to do some preprocessing
data.push_back(im);
}
3 | No.3 Revision |
with the help of glob it is pretty easy:
cv::String path("lfw3d_9000/*.jpg"); //select only jpg
vector<cv::String> fn;
vector<cv::Mat> data;
cv::glob(path,fn,true); // recurse
for (size_t k=0; k<fn.size(); ++k)
{
cv::Mat im = cv::imread(fn[k], 0);
cv::imread(fn[k]);
// you probably want to do some preprocessing
data.push_back(im);
}
4 | No.4 Revision |
with the help of glob it is pretty easy:
cv::String path("lfw3d_9000/*.jpg"); //select only jpg
vector<cv::String> fn;
vector<cv::Mat> data;
cv::glob(path,fn,true); // recurse
for (size_t k=0; k<fn.size(); ++k)
{
cv::Mat im = cv::imread(fn[k]);
if (im.empty()) continue; //img might still be corrupt
// you probably want to do some preprocessing
data.push_back(im);
}
5 | No.5 Revision |
with the help of glob it is pretty easy:
cv::String path("lfw3d_9000/*.jpg"); //select only jpg
vector<cv::String> fn;
vector<cv::Mat> data;
cv::glob(path,fn,true); // recurse
for (size_t k=0; k<fn.size(); ++k)
{
cv::Mat im = cv::imread(fn[k]);
if (im.empty()) continue; //img might still be corrupt
//only proceed if sucsessful
// you probably want to do some preprocessing
data.push_back(im);
}