View Source Evision.Text.OCRHMMDecoder (Evision v0.1.28)

Link to this section Summary

Types

t()

Type that represents an Text.OCRHMMDecoder struct.

Functions

Variant 1:

Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path

Variant 1:

Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path

Recognize text using HMM.

Link to this section Types

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

Type that represents an Text.OCRHMMDecoder struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

Link to this function

create(filename, vocabulary, transition_probabilities_table, emission_probabilities_table)

View Source
@spec create(
  binary(),
  binary(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in()
) ::
  t() | {:error, String.t()}
@spec create(
  Evision.Text.OCRHMMDecoder.ClassifierCallback.t(),
  binary(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in()
) :: t() | {:error, String.t()}

Variant 1:

Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path

Positional Arguments
  • filename: String
  • vocabulary: String
  • transition_probabilities_table: Evision.Mat.t()
  • emission_probabilities_table: Evision.Mat.t()
Keyword Arguments
  • mode: int.
  • classifier: int.
Return
  • retval: OCRHMMDecoder

Has overloading in C++

Python prototype (for reference only):

create(filename, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode[, classifier]]) -> retval

Variant 2:

Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.

Positional Arguments
  • classifier: Evision.Text.OCRHMMDecoder.ClassifierCallback.t().

    The character classifier with built in feature extractor.

  • vocabulary: String.

    The language vocabulary (chars when ascii english text). vocabulary.size() must be equal to the number of classes of the classifier.

  • transition_probabilities_table: Evision.Mat.t().

    Table with transition probabilities between character pairs. cols == rows == vocabulary.size().

  • emission_probabilities_table: Evision.Mat.t().

    Table with observation emission probabilities. cols == rows == vocabulary.size().

Keyword Arguments
Return
  • retval: OCRHMMDecoder

Python prototype (for reference only):

create(classifier, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode]) -> retval
Link to this function

create(filename, vocabulary, transition_probabilities_table, emission_probabilities_table, opts)

View Source
@spec create(
  binary(),
  binary(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in(),
  [{atom(), term()}, ...] | nil
) :: t() | {:error, String.t()}
@spec create(
  Evision.Text.OCRHMMDecoder.ClassifierCallback.t(),
  binary(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in(),
  [{atom(), term()}, ...] | nil
) :: t() | {:error, String.t()}

Variant 1:

Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path

Positional Arguments
  • filename: String
  • vocabulary: String
  • transition_probabilities_table: Evision.Mat.t()
  • emission_probabilities_table: Evision.Mat.t()
Keyword Arguments
  • mode: int.
  • classifier: int.
Return
  • retval: OCRHMMDecoder

Has overloading in C++

Python prototype (for reference only):

create(filename, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode[, classifier]]) -> retval

Variant 2:

Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.

Positional Arguments
  • classifier: Evision.Text.OCRHMMDecoder.ClassifierCallback.t().

    The character classifier with built in feature extractor.

  • vocabulary: String.

    The language vocabulary (chars when ascii english text). vocabulary.size() must be equal to the number of classes of the classifier.

  • transition_probabilities_table: Evision.Mat.t().

    Table with transition probabilities between character pairs. cols == rows == vocabulary.size().

  • emission_probabilities_table: Evision.Mat.t().

    Table with observation emission probabilities. cols == rows == vocabulary.size().

Keyword Arguments
Return
  • retval: OCRHMMDecoder

Python prototype (for reference only):

create(classifier, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode]) -> retval
Link to this function

run(self, image, min_confidence)

View Source
@spec run(t(), Evision.Mat.maybe_mat_in(), integer()) ::
  binary() | {:error, String.t()}

Recognize text using HMM.

Positional Arguments
  • self: Evision.Text.OCRHMMDecoder.t()

  • image: Evision.Mat.t().

    Input image CV_8UC1 or CV_8UC3 with a single text line (or word).

  • min_confidence: int

Keyword Arguments
  • component_level: int.

    Only OCR_LEVEL_WORD is supported.

Return

Takes an image and a mask (where each connected component corresponds to a segmented character) on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found (e.g. words), and the list of those text elements with their confidence values.

Python prototype (for reference only):

run(image, min_confidence[, component_level]) -> retval
Link to this function

run(self, image, min_confidence, opts)

View Source
@spec run(t(), Evision.Mat.maybe_mat_in(), integer(), [{atom(), term()}, ...] | nil) ::
  binary() | {:error, String.t()}
@spec run(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), integer()) ::
  binary() | {:error, String.t()}

Variant 1:

run

Positional Arguments
  • self: Evision.Text.OCRHMMDecoder.t()
  • image: Evision.Mat.t()
  • mask: Evision.Mat.t()
  • min_confidence: int
Keyword Arguments
  • component_level: int.
Return

Python prototype (for reference only):

run(image, mask, min_confidence[, component_level]) -> retval

Variant 2:

Recognize text using HMM.

Positional Arguments
  • self: Evision.Text.OCRHMMDecoder.t()

  • image: Evision.Mat.t().

    Input image CV_8UC1 or CV_8UC3 with a single text line (or word).

  • min_confidence: int

Keyword Arguments
  • component_level: int.

    Only OCR_LEVEL_WORD is supported.

Return

Takes an image and a mask (where each connected component corresponds to a segmented character) on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found (e.g. words), and the list of those text elements with their confidence values.

Python prototype (for reference only):

run(image, min_confidence[, component_level]) -> retval
Link to this function

run(self, image, mask, min_confidence, opts)

View Source
@spec run(
  t(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in(),
  integer(),
  [{atom(), term()}, ...] | nil
) :: binary() | {:error, String.t()}

run

Positional Arguments
  • self: Evision.Text.OCRHMMDecoder.t()
  • image: Evision.Mat.t()
  • mask: Evision.Mat.t()
  • min_confidence: int
Keyword Arguments
  • component_level: int.
Return

Python prototype (for reference only):

run(image, mask, min_confidence[, component_level]) -> retval