View Source Evision.DNN.TextRecognitionModel (Evision v0.1.20)
Link to this section Summary
Types
Type that represents an Evision.DNN.TextRecognitionModel
struct.
Functions
Get the decoding method
Get the vocabulary for recognition.
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.
Given the @p input frame, create input blob, run net and return recognition result
Given the @p input frame, create input blob, run net and return recognition result
Set the decoding method options for "CTC-prefix-beam-search"
decode usage
Set the decoding method options for "CTC-prefix-beam-search"
decode usage
Set the decoding method of translating the network output into string
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.
setInputSize
Set flag swapRB for frame.
setPreferableBackend
setPreferableTarget
Set the vocabulary for recognition.
Variant 1:
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Link to this section Types
@type t() :: %Evision.DNN.TextRecognitionModel{ref: reference()}
Type that represents an Evision.DNN.TextRecognitionModel
struct.
ref.
reference()
The underlying erlang resource variable.
Link to this section Functions
Get the decoding method
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.t()
Return
- retval:
String
@return the decoding method
Python prototype (for reference only):
getDecodeType() -> retval
Get the vocabulary for recognition.
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.t()
Return
- retval:
std::vector<std::string>
@return vocabulary the associated vocabulary
Python prototype (for reference only):
getVocabulary() -> 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.TextRecognitionModel.t()
- frame:
Evision.Mat
Return
outs:
[Evision.Mat]
.Allocated output blobs, which will store results of the computation.
Python prototype (for reference only):
predict(frame[, outs]) -> outs
@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.TextRecognitionModel.t()
- frame:
Evision.Mat
Return
outs:
[Evision.Mat]
.Allocated output blobs, which will store results of the computation.
Python prototype (for reference only):
predict(frame[, outs]) -> outs
@spec recognize(t(), Evision.Mat.maybe_mat_in()) :: binary() | {:error, String.t()}
Given the @p input frame, create input blob, run net and return recognition result
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
frame:
Evision.Mat
.The input image
Return
- retval:
String
@return The text recognition result
Python prototype (for reference only):
recognize(frame) -> retval
@spec recognize(t(), Evision.Mat.maybe_mat_in(), [Evision.Mat.maybe_mat_in()]) :: [binary()] | {:error, String.t()}
Given the @p input frame, create input blob, run net and return recognition result
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
frame:
Evision.Mat
.The input image
roiRects:
[Evision.Mat]
.List of text detection regions of interest (cv::Rect, CV_32SC4). ROIs is be cropped as the network inputs
Return
results:
[string]
.A set of text recognition results.
Python prototype (for reference only):
recognize(frame, roiRects) -> results
Set the decoding method options for "CTC-prefix-beam-search"
decode usage
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
beamSize:
int
.Beam size for search
Keyword Arguments
vocPruneSize:
int
.Parameter to optimize big vocabulary search, only take top @p vocPruneSize tokens in each search step, @p vocPruneSize <= 0 stands for disable this prune.
Return
- retval:
Evision.DNN.TextRecognitionModel
Python prototype (for reference only):
setDecodeOptsCTCPrefixBeamSearch(beamSize[, vocPruneSize]) -> retval
@spec setDecodeOptsCTCPrefixBeamSearch(t(), integer(), [{atom(), term()}, ...] | nil) :: t() | {:error, String.t()}
Set the decoding method options for "CTC-prefix-beam-search"
decode usage
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
beamSize:
int
.Beam size for search
Keyword Arguments
vocPruneSize:
int
.Parameter to optimize big vocabulary search, only take top @p vocPruneSize tokens in each search step, @p vocPruneSize <= 0 stands for disable this prune.
Return
- retval:
Evision.DNN.TextRecognitionModel
Python prototype (for reference only):
setDecodeOptsCTCPrefixBeamSearch(beamSize[, vocPruneSize]) -> retval
Set the decoding method of translating the network output into string
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.t()
- decodeType:
string
.The decoding method of translating the network output into string, currently supported type:"CTC-greedy"
greedy decoding for the output of CTC-based methods"CTC-prefix-beam-search"
Prefix beam search decoding for the output of CTC-based methods
Return
- retval:
Evision.DNN.TextRecognitionModel
Python prototype (for reference only):
setDecodeType(decodeType) -> retval
@spec setInputCrop(t(), boolean()) :: Evision.DNN.Model.t() | {:error, String.t()}
Set flag crop for frame.
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
crop:
bool
.Flag which indicates whether image will be cropped after resize or not.
Return
- retval:
Evision.DNN.Model
Python prototype (for reference only):
setInputCrop(crop) -> retval
@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.TextRecognitionModel.t()
mean:
Scalar
.Scalar with mean values which are subtracted from channels.
Return
- retval:
Evision.DNN.Model
Python prototype (for reference only):
setInputMean(mean) -> retval
Set preprocessing parameters for frame.
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.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
Set preprocessing parameters for frame.
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.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
@spec setInputScale(t(), number()) :: Evision.DNN.Model.t() | {:error, String.t()}
Set scalefactor value for frame.
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
scale:
double
.Multiplier for frame values.
Return
- retval:
Evision.DNN.Model
Python prototype (for reference only):
setInputScale(scale) -> retval
@spec setInputSize( t(), {number(), number()} ) :: Evision.DNN.Model.t() | {:error, String.t()}
Set input size for frame.
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
size:
Size
.New input size.
Return
- retval:
Evision.DNN.Model
Note: If shape of the new blob less than 0, then frame size not change.
Python prototype (for reference only):
setInputSize(size) -> retval
@spec setInputSize(t(), integer(), integer()) :: Evision.DNN.Model.t() | {:error, String.t()}
setInputSize
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
width:
int
.New input width.
height:
int
.New input height.
Return
- retval:
Evision.DNN.Model
Has overloading in C++
Python prototype (for reference only):
setInputSize(width, height) -> retval
@spec setInputSwapRB(t(), boolean()) :: Evision.DNN.Model.t() | {:error, String.t()}
Set flag swapRB for frame.
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
swapRB:
bool
.Flag which indicates that swap first and last channels.
Return
- retval:
Evision.DNN.Model
Python prototype (for reference only):
setInputSwapRB(swapRB) -> retval
@spec setPreferableBackend(t(), integer()) :: Evision.DNN.Model.t() | {:error, String.t()}
setPreferableBackend
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.t()
- backendId:
dnn_Backend
Return
- retval:
Evision.DNN.Model
Python prototype (for reference only):
setPreferableBackend(backendId) -> retval
@spec setPreferableTarget(t(), integer()) :: Evision.DNN.Model.t() | {:error, String.t()}
setPreferableTarget
Positional Arguments
- self:
Evision.DNN.TextRecognitionModel.t()
- targetId:
dnn_Target
Return
- retval:
Evision.DNN.Model
Python prototype (for reference only):
setPreferableTarget(targetId) -> retval
Set the vocabulary for recognition.
Positional Arguments
self:
Evision.DNN.TextRecognitionModel.t()
vocabulary:
[string]
.the associated vocabulary of the network.
Return
- retval:
Evision.DNN.TextRecognitionModel
Python prototype (for reference only):
setVocabulary(vocabulary) -> retval
@spec textRecognitionModel(binary()) :: t() | {:error, String.t()}
@spec textRecognitionModel(Evision.DNN.Net.t()) :: t() | {:error, String.t()}
Variant 1:
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Positional Arguments
model:
string
.Binary file contains trained weights
Keyword Arguments
config:
string
.Text file contains network configuration
Return
Python prototype (for reference only):
TextRecognitionModel(model[, config]) -> <dnn_TextRecognitionModel object>
Variant 2:
Create Text Recognition model from deep learning network Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Positional Arguments
network:
Evision.DNN.Net
.Net object
Return
Python prototype (for reference only):
TextRecognitionModel(network) -> <dnn_TextRecognitionModel object>
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
Positional Arguments
model:
string
.Binary file contains trained weights
Keyword Arguments
config:
string
.Text file contains network configuration
Return
Python prototype (for reference only):
TextRecognitionModel(model[, config]) -> <dnn_TextRecognitionModel object>