利用opencv遍历目录下的所有文件

#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"
#include "opencv2/objdetect.hpp"

int main()
{
    std::vector<cv::String> filenames; // notice here that we are using the Opencv's embedded "String" class
    cv::String folder = "G:\\liu_projects\\Pytorch-UNet\\checkpoints"; // again we are using the Opencv's embedded "String" class

    cv::glob(folder, filenames); // new function that does the job ;-)

    for (size_t i = 0; i < filenames.size(); ++i)
    {
        std::cout << filenames[i] << std::endl;
    }
}

  

上一篇:tensorflow学习笔记——获取训练数据集和测试数据集


下一篇:Tesseract-OCR 4.1.0 安装及使用—windows及CentOS【附Java源码实现】