View Source Evision.DNN.TextDetectionModelDB (Evision v0.1.38)

Summary

Types

t()

Type that represents an DNN.TextDetectionModelDB struct.

Functions

getBinaryThreshold

getMaxCandidates

getPolygonThreshold

getUnclipRatio

Given the @p input frame, create input blob, run net and return the output @p blobs.

Given the @p input frame, create input blob, run net and return the output @p blobs.

Set flag crop for frame.

Set mean value for frame.

Set preprocessing parameters for frame.

Set preprocessing parameters for frame.

Set scalefactor value for frame.

Set input size for frame.

Set flag swapRB for frame.

Variant 1:

Create text detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Create text detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Types

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

Type that represents an DNN.TextDetectionModelDB struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec detect(t(), Evision.Mat.maybe_mat_in()) ::
  [[{number(), number()}]] | {:error, String.t()}

detect

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • frame: Evision.Mat.t()
Return
  • detections: [[Point]]

Has overloading in C++

Python prototype (for reference only):

detect(frame) -> detections
Link to this function

detectTextRectangles(self, frame)

View Source
@spec detectTextRectangles(t(), Evision.Mat.maybe_mat_in()) ::
  {[Evision.RotatedRect.t()], [number()]} | {:error, String.t()}

Performs detection

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • frame: Evision.Mat.t().

    the input image

Return
  • detections: [{centre={x, y}, size={s1, s2}, angle}].

    array with detections' RotationRect results

  • confidences: [float].

    array with detection confidences

Given the input @p frame, prepare network input, run network inference, post-process network output and return result detections. Each result is rotated rectangle. Note: Result may be inaccurate in case of strong perspective transformations.

Python prototype (for reference only):

detectTextRectangles(frame) -> detections, confidences
Link to this function

enableWinograd(self, useWinograd)

View Source
@spec enableWinograd(t(), boolean()) :: Evision.DNN.Model.t() | {:error, String.t()}

enableWinograd

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • useWinograd: bool
Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

enableWinograd(useWinograd) -> retval
Link to this function

getBinaryThreshold(self)

View Source
@spec getBinaryThreshold(t()) :: number() | {:error, String.t()}

getBinaryThreshold

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
Return
  • retval: float

Python prototype (for reference only):

getBinaryThreshold() -> retval
@spec getMaxCandidates(t()) :: integer() | {:error, String.t()}

getMaxCandidates

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
Return
  • retval: int

Python prototype (for reference only):

getMaxCandidates() -> retval
Link to this function

getPolygonThreshold(self)

View Source
@spec getPolygonThreshold(t()) :: number() | {:error, String.t()}

getPolygonThreshold

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
Return
  • retval: float

Python prototype (for reference only):

getPolygonThreshold() -> retval
@spec getUnclipRatio(t()) :: number() | {:error, String.t()}

getUnclipRatio

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
Return
  • retval: double

Python prototype (for reference only):

getUnclipRatio() -> retval
@spec predict(t(), Evision.Mat.maybe_mat_in()) ::
  [Evision.Mat.t()] | {:error, String.t()}

Given the @p input frame, create input blob, run net and return the output @p blobs.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • frame: Evision.Mat.t()
Return
  • outs: [Evision.Mat].

    Allocated output blobs, which will store results of the computation.

Python prototype (for reference only):

predict(frame[, outs]) -> outs
Link to this function

predict(self, frame, opts)

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

Given the @p input frame, create input blob, run net and return the output @p blobs.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • frame: Evision.Mat.t()
Return
  • outs: [Evision.Mat].

    Allocated output blobs, which will store results of the computation.

Python prototype (for reference only):

predict(frame[, outs]) -> outs
Link to this function

setBinaryThreshold(self, binaryThreshold)

View Source
@spec setBinaryThreshold(t(), number()) :: t() | {:error, String.t()}

setBinaryThreshold

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • binaryThreshold: float
Return
  • retval: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

setBinaryThreshold(binaryThreshold) -> retval
Link to this function

setInputCrop(self, crop)

View Source
@spec setInputCrop(t(), boolean()) :: Evision.DNN.Model.t() | {:error, String.t()}

Set flag crop for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • crop: bool.

    Flag which indicates whether image will be cropped after resize or not.

Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

setInputCrop(crop) -> retval
Link to this function

setInputMean(self, mean)

View Source
@spec setInputMean(
  t(),
  {number()}
  | {number(), number()}
  | {number(), number(), number()}
  | {number(), number(), number(), number()}
) :: Evision.DNN.Model.t() | {:error, String.t()}

Set mean value for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • mean: Scalar.

    Scalar with mean values which are subtracted from channels.

Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

setInputMean(mean) -> retval
@spec setInputParams(t()) :: t() | {:error, String.t()}

Set preprocessing parameters for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
Keyword Arguments
  • scale: double.

    Multiplier for frame values.

  • size: Size.

    New input size.

  • mean: Scalar.

    Scalar with mean values which are subtracted from channels.

  • swapRB: bool.

    Flag which indicates that swap first and last channels.

  • crop: bool.

    Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )

Python prototype (for reference only):

setInputParams([, scale[, size[, mean[, swapRB[, crop]]]]]) -> None
Link to this function

setInputParams(self, opts)

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

Set preprocessing parameters for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
Keyword Arguments
  • scale: double.

    Multiplier for frame values.

  • size: Size.

    New input size.

  • mean: Scalar.

    Scalar with mean values which are subtracted from channels.

  • swapRB: bool.

    Flag which indicates that swap first and last channels.

  • crop: bool.

    Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )

Python prototype (for reference only):

setInputParams([, scale[, size[, mean[, swapRB[, crop]]]]]) -> None
Link to this function

setInputScale(self, scale)

View Source
@spec setInputScale(
  t(),
  {number()}
  | {number(), number()}
  | {number(), number(), number()}
  | {number(), number(), number(), number()}
) :: Evision.DNN.Model.t() | {:error, String.t()}

Set scalefactor value for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • scale: Scalar.

    Multiplier for frame values.

Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

setInputScale(scale) -> retval
Link to this function

setInputSize(self, size)

View Source
@spec setInputSize(
  t(),
  {number(), number()}
) :: Evision.DNN.Model.t() | {:error, String.t()}

Set input size for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • size: Size.

    New input size.

Return
  • retval: Evision.DNN.Model.t()

Note: If shape of the new blob less than 0, then frame size not change.

Python prototype (for reference only):

setInputSize(size) -> retval
Link to this function

setInputSize(self, width, height)

View Source
@spec setInputSize(t(), integer(), integer()) ::
  Evision.DNN.Model.t() | {:error, String.t()}

setInputSize

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • width: int.

    New input width.

  • height: int.

    New input height.

Return
  • retval: Evision.DNN.Model.t()

Has overloading in C++

Python prototype (for reference only):

setInputSize(width, height) -> retval
Link to this function

setInputSwapRB(self, swapRB)

View Source
@spec setInputSwapRB(t(), boolean()) :: Evision.DNN.Model.t() | {:error, String.t()}

Set flag swapRB for frame.

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()

  • swapRB: bool.

    Flag which indicates that swap first and last channels.

Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

setInputSwapRB(swapRB) -> retval
Link to this function

setMaxCandidates(self, maxCandidates)

View Source
@spec setMaxCandidates(t(), integer()) :: t() | {:error, String.t()}

setMaxCandidates

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • maxCandidates: int
Return
  • retval: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

setMaxCandidates(maxCandidates) -> retval
Link to this function

setPolygonThreshold(self, polygonThreshold)

View Source
@spec setPolygonThreshold(t(), number()) :: t() | {:error, String.t()}

setPolygonThreshold

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • polygonThreshold: float
Return
  • retval: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

setPolygonThreshold(polygonThreshold) -> retval
Link to this function

setPreferableBackend(self, backendId)

View Source
@spec setPreferableBackend(t(), integer()) ::
  Evision.DNN.Model.t() | {:error, String.t()}

setPreferableBackend

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • backendId: dnn_Backend
Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

setPreferableBackend(backendId) -> retval
Link to this function

setPreferableTarget(self, targetId)

View Source
@spec setPreferableTarget(t(), integer()) ::
  Evision.DNN.Model.t() | {:error, String.t()}

setPreferableTarget

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • targetId: dnn_Target
Return
  • retval: Evision.DNN.Model.t()

Python prototype (for reference only):

setPreferableTarget(targetId) -> retval
Link to this function

setUnclipRatio(self, unclipRatio)

View Source
@spec setUnclipRatio(t(), number()) :: t() | {:error, String.t()}

setUnclipRatio

Positional Arguments
  • self: Evision.DNN.TextDetectionModelDB.t()
  • unclipRatio: double
Return
  • retval: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

setUnclipRatio(unclipRatio) -> retval
Link to this function

textDetectionModelDB(model)

View Source
@spec textDetectionModelDB(binary()) :: t() | {:error, String.t()}
@spec textDetectionModelDB(Evision.DNN.Net.t()) :: t() | {:error, String.t()}

Variant 1:

Create text detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Positional Arguments
  • model: string.

    Binary file contains trained weights.

Keyword Arguments
  • config: string.

    Text file contains network configuration.

Return
  • self: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

TextDetectionModel_DB(model[, config]) -> <dnn_TextDetectionModel_DB object>

Variant 2:

Create text detection algorithm from deep learning network.

Positional Arguments
  • network: Evision.DNN.Net.t().

    Net object.

Return
  • self: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

TextDetectionModel_DB(network) -> <dnn_TextDetectionModel_DB object>
Link to this function

textDetectionModelDB(model, opts)

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

Create text detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Positional Arguments
  • model: string.

    Binary file contains trained weights.

Keyword Arguments
  • config: string.

    Text file contains network configuration.

Return
  • self: Evision.DNN.TextDetectionModelDB.t()

Python prototype (for reference only):

TextDetectionModel_DB(model[, config]) -> <dnn_TextDetectionModel_DB object>