[−][src]Function opencv::core::find_file
pub fn find_file(
relative_path: &str,
required: bool,
silent_mode: bool
) -> Result<String>
Try to find requested data file
Search directories:
- Directories passed via
addSamplesDataSearchPath()
- OPENCV_SAMPLES_DATA_PATH_HINT environment variable
- OPENCV_SAMPLES_DATA_PATH environment variable If parameter value is not empty and nothing is found then stop searching.
- Detects build/install path based on: a. current working directory (CWD) b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage)
- Scan
<source>/{,data,samples/data}
directories if build directory is detected or the current directory is in source tree. - Scan
<install>/share/OpenCV
directory if install directory is detected.
See also
cv::utils::findDataFile
Parameters
- relative_path: Relative path to data file
- required: Specify "file not found" handling. If true, function prints information message and raises cv::Exception. If false, function returns empty result
- silentMode: Disables messages
Returns
Returns path (absolute or relative to the current directory) or empty string if file is not found
C++ default parameters
- required: true
- silent_mode: false