1 | initial version |
if your images are numbered, you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img)) break; // end of sequence
// ... process img
}
then, if your images can be sorted lexically (aaa.png, aab.png), you can use:
vector<string> files; cv::glob( "/path/to/files/*.png", files); for (size_t i=0; i<files.size(); i++)="" {="" mat="" img="imread(files[i]);" }<="" p="">
2 | No.2 Revision |
if your images are numbered, numbered (001.png, 002.png,..), you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img)) break; // end of sequence
// ... process img
}
then, if your images can be sorted lexically (aaa.png, aab.png), aab.png,..), you can also use:
vector<string>
vector<String>
files;
cv::glob( "/path/to/files/*.png", files);
for (size_t i=0; i<files.size(); 3 | No.3 Revision |
if your images are numbered (001.png, 002.png,..), you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img)) break; // end of sequence
// ... process img
cv::imahow("img", img);
if (cv::waitKey() > 0)
break;
}
if your images can be sorted lexically (aaa.png, aab.png,..), you can also use:
vector<String> files;
cv::glob( "/path/to/files/*.png", files);
for (size_t i=0; i<files.size(); i++) {
Mat img = imread(files[i]);
}
4 | No.4 Revision |
if your images are numbered (001.png, 002.png,..), you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img)) break; // end of sequence
cv::imahow("img", img);
if (cv::waitKey() (cv::waitKey(1000) > 0)
0 //1000 millis == 2 second
break;
}
if your images can be sorted lexically (aaa.png, aab.png,..), you can also use:
vector<String> files;
cv::glob( "/path/to/files/*.png", files);
for (size_t i=0; i<files.size(); i++) {
Mat img = imread(files[i]);
}
5 | No.5 Revision |
if your images are numbered (001.png, 002.png,..), you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img)) break; // end of sequence
cv::imahow("img", img);
if (cv::waitKey(1000) > 0 //1000 // 1000 millis == 2 1 second
break;
}
if your images can be sorted lexically (aaa.png, aab.png,..), you can also use:
vector<String> files;
cv::glob( "/path/to/files/*.png", files);
for (size_t i=0; i<files.size(); i++) {
Mat img = imread(files[i]);
}
6 | No.6 Revision |
if your images are numbered (001.png, 002.png,..), you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img)) break; // end of sequence
cv::imahow("img", img);
if (cv::waitKey(1000) > 0 0) // 1000 millis == 1 second
break;
}
if your images can be sorted lexically (aaa.png, aab.png,..), you can also use:
vector<String> files;
cv::glob( "/path/to/files/*.png", files);
for (size_t i=0; i<files.size(); i++) {
Mat img = imread(files[i]);
}
7 | No.7 Revision |
if your images are numbered (001.png, 002.png,..), you can use
cv::VideoCapture cap("/path/to/files/%d.png");
while(cap.isOpened()) {
Mat img;
if (! cap.read(img))
break; // end of sequence
cv::imahow("img", cv::imshow("img", img);
if (cv::waitKey(1000) > 0) // 1000 millis == 1 second
break;
}
if your images can be sorted lexically (aaa.png, aab.png,..), you can also use:
vector<String> files;
cv::glob( "/path/to/files/*.png", files);
for (size_t i=0; i<files.size(); i++) {
Mat img = imread(files[i]);
}