Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/core/core.hpp>
- #include <opencv2/highgui/highgui.hpp>
- #include <opencv2\imgproc\imgproc.hpp>
- #include <fstream>
- #include <filesystem>
- #include <string>
- int main()
- {
- Mat image;
- std::ofstream data("Bad.dat");
- data.clear();
- for (auto& p : std::experimental::filesystem::directory_iterator("Bad")) //in c++17 std::filesystem::directory_iterator
- {
- std::string path(p.path().string());
- image = imread(path, IMREAD_COLOR);
- //Good:
- // data << p << " 1 0 0 " << image.cols << ' ' << image.rows<<std::endl;
- //Bad:
- data << p << std::endl;
- }
- data.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement