View Source Evision.Samples (Evision v0.2.9)
Summary
Functions
Override search data path by adding new search location
Append samples search data sub directory
Try to find requested data file
Try to find requested data file
findFileOrKeep
findFileOrKeep
Types
@type t() :: %Evision.Samples{ref: reference()}
Type that represents an Samples
struct.
ref.
reference()
The underlying erlang resource variable.
Functions
@spec addSamplesDataSearchPath(Keyword.t()) :: any() | {:error, String.t()}
@spec addSamplesDataSearchPath(binary()) :: :ok | {:error, String.t()}
Override search data path by adding new search location
Positional Arguments
path:
String
.Path to used samples data
Use this only to override default behavior Passed paths are used in LIFO order.
Python prototype (for reference only):
addSamplesDataSearchPath(path) -> None
@spec addSamplesDataSearchSubDirectory(Keyword.t()) :: any() | {:error, String.t()}
@spec addSamplesDataSearchSubDirectory(binary()) :: :ok | {:error, String.t()}
Append samples search data sub directory
Positional Arguments
subdir:
String
.samples data sub directory
General usage is to add OpenCV modules name (<opencv_contrib>/modules/<name>/samples/data
-> <name>/samples/data
+ modules/<name>/samples/data
).
Passed subdirectories are used in LIFO order.
Python prototype (for reference only):
addSamplesDataSearchSubDirectory(subdir) -> None
@spec findFile(Keyword.t()) :: any() | {:error, String.t()}
@spec findFile(binary()) :: binary() | {:error, String.t()}
Try to find requested data file
Positional Arguments
relative_path:
String
.Relative path to data file
Keyword Arguments
required:
bool
.Specify "file not found" handling. If true, function prints information message and raises cv::Exception. If false, function returns empty result
silentMode:
bool
.Disables messages
Return
- retval:
String
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 cv::utils::findDataFile @return Returns path (absolute or relative to the current directory) or empty string if file is not found
Python prototype (for reference only):
findFile(relative_path[, required[, silentMode]]) -> retval
@spec findFile(binary(), [required: term(), silentMode: term()] | nil) :: binary() | {:error, String.t()}
Try to find requested data file
Positional Arguments
relative_path:
String
.Relative path to data file
Keyword Arguments
required:
bool
.Specify "file not found" handling. If true, function prints information message and raises cv::Exception. If false, function returns empty result
silentMode:
bool
.Disables messages
Return
- retval:
String
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 cv::utils::findDataFile @return Returns path (absolute or relative to the current directory) or empty string if file is not found
Python prototype (for reference only):
findFile(relative_path[, required[, silentMode]]) -> retval
@spec findFileOrKeep(Keyword.t()) :: any() | {:error, String.t()}
@spec findFileOrKeep(binary()) :: binary() | {:error, String.t()}
findFileOrKeep
Positional Arguments
- relative_path:
String
Keyword Arguments
- silentMode:
bool
.
Return
- retval:
String
Python prototype (for reference only):
findFileOrKeep(relative_path[, silentMode]) -> retval
findFileOrKeep
Positional Arguments
- relative_path:
String
Keyword Arguments
- silentMode:
bool
.
Return
- retval:
String
Python prototype (for reference only):
findFileOrKeep(relative_path[, silentMode]) -> retval