@Namespace(value="cv::text") @Properties(inherit=opencv_text.class) public class OCRTesseract extends BaseOCR
Notice that it is compiled only when tesseract-ocr is correctly installed.
\note
- (C++) An example of OCRTesseract recognition combined with scene text detection can be found
at the end_to_end_recognition demo:
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
OCRTesseract(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
static OCRTesseract |
create() |
static OCRTesseract |
create(BytePointer datapath,
BytePointer language,
BytePointer char_whitelist,
int oem,
int psmode)
\brief Creates an instance of the OCRTesseract class.
|
static OCRTesseract |
create(String datapath,
String language,
String char_whitelist,
int oem,
int psmode) |
BytePointer |
run(GpuMat image,
GpuMat mask,
int min_confidence) |
BytePointer |
run(GpuMat image,
GpuMat mask,
int min_confidence,
int component_level) |
BytePointer |
run(GpuMat image,
int min_confidence) |
BytePointer |
run(GpuMat image,
int min_confidence,
int component_level) |
void |
run(Mat image,
BytePointer output_text) |
void |
run(Mat image,
BytePointer output_text,
RectVector component_rects,
StringVector component_texts,
FloatVector component_confidences,
int component_level)
\brief Recognize text using the tesseract-ocr API.
|
BytePointer |
run(Mat image,
int min_confidence) |
BytePointer |
run(Mat image,
int min_confidence,
int component_level) |
void |
run(Mat image,
Mat mask,
BytePointer output_text) |
void |
run(Mat image,
Mat mask,
BytePointer output_text,
RectVector component_rects,
StringVector component_texts,
FloatVector component_confidences,
int component_level) |
BytePointer |
run(Mat image,
Mat mask,
int min_confidence) |
BytePointer |
run(Mat image,
Mat mask,
int min_confidence,
int component_level) |
String |
run(UMat image,
int min_confidence) |
String |
run(UMat image,
int min_confidence,
int component_level) |
String |
run(UMat image,
UMat mask,
int min_confidence) |
String |
run(UMat image,
UMat mask,
int min_confidence,
int component_level) |
void |
setWhiteList(BytePointer char_whitelist) |
void |
setWhiteList(String char_whitelist) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public OCRTesseract(Pointer p)
Pointer.Pointer(Pointer)
.public void run(@ByRef Mat image, @StdString @ByRef BytePointer output_text, RectVector component_rects, StringVector component_texts, FloatVector component_confidences, int component_level)
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.
run
in class BaseOCR
image
- Input image CV_8UC1 or CV_8UC3output_text
- Output text of the tesseract-ocr.component_rects
- If provided the method will output a list of Rects for the individual
text elements found (e.g. words or text lines).component_texts
- If provided the method will output a list of text strings for the
recognition of individual text elements found (e.g. words or text lines).component_confidences
- If provided the method will output a list of confidence values
for the recognition of individual text elements found (e.g. words or text lines).component_level
- OCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXTLINE.public void run(@ByRef Mat image, @StdString @ByRef BytePointer output_text)
public void run(@ByRef Mat image, @ByRef Mat mask, @StdString @ByRef BytePointer output_text, RectVector component_rects, StringVector component_texts, FloatVector component_confidences, int component_level)
public void run(@ByRef Mat image, @ByRef Mat mask, @StdString @ByRef BytePointer output_text)
@opencv_core.Str public BytePointer run(@ByVal Mat image, int min_confidence, int component_level)
@opencv_core.Str public BytePointer run(@ByVal Mat image, int min_confidence)
@opencv_core.Str public String run(@ByVal UMat image, int min_confidence, int component_level)
@opencv_core.Str public String run(@ByVal UMat image, int min_confidence)
@opencv_core.Str public BytePointer run(@ByVal GpuMat image, int min_confidence, int component_level)
@opencv_core.Str public BytePointer run(@ByVal GpuMat image, int min_confidence)
@opencv_core.Str public BytePointer run(@ByVal Mat image, @ByVal Mat mask, int min_confidence, int component_level)
@opencv_core.Str public BytePointer run(@ByVal Mat image, @ByVal Mat mask, int min_confidence)
@opencv_core.Str public String run(@ByVal UMat image, @ByVal UMat mask, int min_confidence, int component_level)
@opencv_core.Str public BytePointer run(@ByVal GpuMat image, @ByVal GpuMat mask, int min_confidence, int component_level)
@opencv_core.Str public BytePointer run(@ByVal GpuMat image, @ByVal GpuMat mask, int min_confidence)
public void setWhiteList(@opencv_core.Str BytePointer char_whitelist)
public void setWhiteList(@opencv_core.Str String char_whitelist)
@opencv_core.Ptr public static OCRTesseract create(@Cast(value="const char*") BytePointer datapath, @Cast(value="const char*") BytePointer language, @Cast(value="const char*") BytePointer char_whitelist, int oem, int psmode)
datapath
- the name of the parent directory of tessdata ended with "/", or NULL to use the
system's default directory.language
- an ISO 639-3 code or NULL will default to "eng".char_whitelist
- specifies the list of characters used for recognition. NULL defaults to
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".oem
- 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
- 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.@opencv_core.Ptr public static OCRTesseract create()
@opencv_core.Ptr public static OCRTesseract create(String datapath, String language, String char_whitelist, int oem, int psmode)
Copyright © 2020. All rights reserved.