MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO / safeOpenCVFileStorage

Method safeOpenCVFileStorage

src/utils/UtilsOpenCV.cpp:1052–1067  ·  view source on GitHub ↗

------------------------------------------------------------------------ */ Returns a OpenCV file storage in a safely manner, warning about potential exceptions thrown.

Source from the content-addressed store, hash-verified

1050// Returns a OpenCV file storage in a safely manner, warning about potential
1051// exceptions thrown.
1052void UtilsOpenCV::safeOpenCVFileStorage(cv::FileStorage* fs,
1053 const std::string& file_path,
1054 const bool check_opened) {
1055 CHECK_NOTNULL(fs);
1056 try {
1057 *fs = cv::FileStorage(file_path, cv::FileStorage::READ);
1058 } catch (cv::Exception& e) {
1059 LOG(FATAL) << "Cannot open file: " << file_path << '\n'
1060 << "OpenCV error code: " << e.msg;
1061 }
1062
1063 if (check_opened) {
1064 CHECK(fs->isOpened()) << "Cannot open file: " << file_path << " (remember "
1065 << "that first line of yaml file must be: %YAML:1.0)";
1066 }
1067}
1068
1069} // namespace VIO

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected