35 std::filesystem::path BpFileHandling::StereoSetsPath()
const
37 std::filesystem::path current_path = std::filesystem::current_path();
48 std::filesystem::begin(std::filesystem::directory_iterator(current_path)),
49 std::filesystem::end(std::filesystem::directory_iterator(current_path)),
52 it == std::filesystem::end(std::filesystem::directory_iterator(current_path)))
55 if (current_path == current_path.parent_path()) {
56 throw std::filesystem::filesystem_error(
57 "Belief prop directory not found", std::error_code());
59 current_path = current_path.parent_path();
62 if (
const std::filesystem::path stereo_set_path =
64 std::filesystem::is_directory(stereo_set_path))
66 return stereo_set_path;
69 throw std::filesystem::filesystem_error(
70 "Stereo set directory not found in belief prop directory",
88 if (std::filesystem::exists(
91 std::string(extension))))) {
93 "." + std::string(extension));
97 throw std::filesystem::filesystem_error(
98 "Reference image not found",
113 if (std::filesystem::exists(
116 std::string(extension))))) {
118 "." + std::string(extension));
122 throw std::filesystem::filesystem_error(
123 "Test image not found",
Declares class to retrieve path of stereo set files for reading and for output.
std::filesystem::path RefImagePath() const
Return path to reference image with valid extension if found, otherwise throw filesystem error.
std::filesystem::path TestImagePath() const
Return path to test image with valid extension if found, otherwise throw filesystem error.
constexpr std::string_view kRefImageName
constexpr std::string_view kInImagePossExtensions[]
constexpr std::string_view kStereoSetsDirectoryName
constexpr std::string_view kTestImageName
constexpr std::string_view kBeliefPropDirectoryName