------------------------------------------------------------------------ */ Returns a OpenCV file storage in a safely manner, warning about potential exceptions thrown.
| 1050 | // Returns a OpenCV file storage in a safely manner, warning about potential |
| 1051 | // exceptions thrown. |
| 1052 | void 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 |
nothing calls this directly
no outgoing calls
no test coverage detected