View Source Evision.Samples (Evision v0.1.38)

Summary

Types

t()

Type that represents an Samples struct.

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

Types

@type t() :: %Evision.Samples{ref: reference()}

Type that represents an Samples struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

Link to this function

addSamplesDataSearchPath(path)

View Source
@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
Link to this function

addSamplesDataSearchSubDirectory(subdir)

View Source
@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(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

Search directories:

  1. Directories passed via addSamplesDataSearchPath()
  2. OPENCV_SAMPLES_DATA_PATH_HINT environment variable
  3. OPENCV_SAMPLES_DATA_PATH environment variable If parameter value is not empty and nothing is found then stop searching.
  4. 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)
  5. Scan <source>/{,data,samples/data} directories if build directory is detected or the current directory is in source tree.
  6. 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
Link to this function

findFile(relative_path, opts)

View Source
@spec findFile(binary(), [{atom(), 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

Search directories:

  1. Directories passed via addSamplesDataSearchPath()
  2. OPENCV_SAMPLES_DATA_PATH_HINT environment variable
  3. OPENCV_SAMPLES_DATA_PATH environment variable If parameter value is not empty and nothing is found then stop searching.
  4. 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)
  5. Scan <source>/{,data,samples/data} directories if build directory is detected or the current directory is in source tree.
  6. 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
Link to this function

findFileOrKeep(relative_path)

View Source
@spec findFileOrKeep(binary()) :: binary() | {:error, String.t()}

findFileOrKeep

Positional Arguments
Keyword Arguments
  • silentMode: bool.
Return

Python prototype (for reference only):

findFileOrKeep(relative_path[, silentMode]) -> retval
Link to this function

findFileOrKeep(relative_path, opts)

View Source
@spec findFileOrKeep(binary(), [{atom(), term()}, ...] | nil) ::
  binary() | {:error, String.t()}

findFileOrKeep

Positional Arguments
Keyword Arguments
  • silentMode: bool.
Return

Python prototype (for reference only):

findFileOrKeep(relative_path[, silentMode]) -> retval