MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / image_sequence

Method image_sequence

example/util/image_util.cc:30–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#include <stdexcept>
29
30image_sequence::image_sequence(const std::string &img_dir_path, const double fps)
31 : fps_(fps)
32{
33 DIR *dir;
34 if ((dir = opendir(img_dir_path.c_str())) == nullptr)
35 {
36 throw std::runtime_error("directory " + img_dir_path + " does not exist");
37 }
38 dirent *dp;
39 for (dp = readdir(dir); dp != nullptr; dp = readdir(dir))
40 {
41 const std::string img_file_name = dp->d_name;
42 if (img_file_name == "." || img_file_name == "..")
43 {
44 continue;
45 }
46 img_file_paths_.push_back(img_dir_path + "/" + img_file_name);
47 }
48 closedir(dir);
49
50 std::sort(img_file_paths_.begin(), img_file_paths_.end());
51}
52
53std::vector<image_sequence::frame> image_sequence::get_frames() const
54{

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected