View Source Evision.Text.OCRTesseract (Evision v0.1.28)
Link to this section Summary
Functions
Creates an instance of the OCRTesseract class. Initializes Tesseract.
Creates an instance of the OCRTesseract class. Initializes Tesseract.
Recognize text using the tesseract-ocr API.
Variant 1:
run
setWhiteList
Link to this section Types
@type t() :: %Evision.Text.OCRTesseract{ref: reference()}
Type that represents an Text.OCRTesseract
struct.
ref.
reference()
The underlying erlang resource variable.
Link to this section Functions
Creates an instance of the OCRTesseract class. Initializes Tesseract.
Keyword Arguments
datapath:
c_string
.the name of the parent directory of tessdata ended with "/", or NULL to use the system's default directory.
language:
c_string
.an ISO 639-3 code or NULL will default to "eng".
char_whitelist:
c_string
.specifies the list of characters used for recognition. NULL defaults to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".
oem:
int
.tesseract-ocr offers different OCR Engine Modes (OEM), by default tesseract::OEM_DEFAULT is used. See the tesseract-ocr API documentation for other possible values.
psmode:
int
.tesseract-ocr offers different Page Segmentation Modes (PSM) tesseract::PSM_AUTO (fully automatic layout analysis) is used. See the tesseract-ocr API documentation for other possible values.
Return
- retval:
OCRTesseract
Python prototype (for reference only):
create([, datapath[, language[, char_whitelist[, oem[, psmode]]]]]) -> retval
Creates an instance of the OCRTesseract class. Initializes Tesseract.
Keyword Arguments
datapath:
c_string
.the name of the parent directory of tessdata ended with "/", or NULL to use the system's default directory.
language:
c_string
.an ISO 639-3 code or NULL will default to "eng".
char_whitelist:
c_string
.specifies the list of characters used for recognition. NULL defaults to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".
oem:
int
.tesseract-ocr offers different OCR Engine Modes (OEM), by default tesseract::OEM_DEFAULT is used. See the tesseract-ocr API documentation for other possible values.
psmode:
int
.tesseract-ocr offers different Page Segmentation Modes (PSM) tesseract::PSM_AUTO (fully automatic layout analysis) is used. See the tesseract-ocr API documentation for other possible values.
Return
- retval:
OCRTesseract
Python prototype (for reference only):
create([, datapath[, language[, char_whitelist[, oem[, psmode]]]]]) -> retval
@spec run(t(), Evision.Mat.maybe_mat_in(), integer()) :: binary() | {:error, String.t()}
Recognize text using the tesseract-ocr API.
Positional Arguments
self:
Evision.Text.OCRTesseract.t()
image:
Evision.Mat.t()
.Input image CV_8UC1 or CV_8UC3
min_confidence:
int
Keyword Arguments
component_level:
int
.OCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXTLINE.
Return
- retval:
String
Takes image 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
@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.OCRTesseract.t()
- image:
Evision.Mat.t()
- mask:
Evision.Mat.t()
- min_confidence:
int
Keyword Arguments
- component_level:
int
.
Return
- retval:
String
Python prototype (for reference only):
run(image, mask, min_confidence[, component_level]) -> retval
Variant 2:
Recognize text using the tesseract-ocr API.
Positional Arguments
self:
Evision.Text.OCRTesseract.t()
image:
Evision.Mat.t()
.Input image CV_8UC1 or CV_8UC3
min_confidence:
int
Keyword Arguments
component_level:
int
.OCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXTLINE.
Return
- retval:
String
Takes image 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
@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.OCRTesseract.t()
- image:
Evision.Mat.t()
- mask:
Evision.Mat.t()
- min_confidence:
int
Keyword Arguments
- component_level:
int
.
Return
- retval:
String
Python prototype (for reference only):
run(image, mask, min_confidence[, component_level]) -> retval
setWhiteList
Positional Arguments
- self:
Evision.Text.OCRTesseract.t()
- char_whitelist:
String
Python prototype (for reference only):
setWhiteList(char_whitelist) -> None