Package org.bytedeco.tesseract
Class ResultIterator
- java.lang.Object
-
- org.bytedeco.javacpp.Pointer
-
- org.bytedeco.tesseract.PageIterator
-
- org.bytedeco.tesseract.LTRResultIterator
-
- org.bytedeco.tesseract.ResultIterator
-
- All Implemented Interfaces:
AutoCloseable
@Namespace("tesseract") @NoOffset @Properties(inherit=tesseract.class) public class ResultIterator extends LTRResultIterator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bytedeco.javacpp.Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
-
-
Constructor Summary
Constructors Constructor Description ResultIterator(Pointer p)Pointer cast constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidBegin()Moves the iterator to point to the start of the page to begin an iteration.intBlanksBeforeWord()static voidCalculateTextlineOrder(boolean paragraph_is_ltr, int[] word_dirs, int[] reading_order)static voidCalculateTextlineOrder(boolean paragraph_is_ltr, IntBuffer word_dirs, IntBuffer reading_order)static voidCalculateTextlineOrder(boolean paragraph_is_ltr, IntPointer word_dirs, IntPointer reading_order)Yields the reading order as a sequence of indices and (optional) meta-marks for a set of words (given left-to-right).StringFloatPairVectorVectorGetBestLSTMSymbolChoices()StringFloatPairVectorVectorGetRawLSTMTimesteps()Returns the LSTM choices for every LSTM timestep for the current word.BytePointerGetUTF8Text(int level)Returns the null terminated UTF-8 encoded text string for the current object at the given level.booleanIsAtBeginningOf(int level)IsAtBeginningOf() returns whether we're at the logical beginning of the given level.booleanIsAtFinalElement(int level, int element)Implement PageIterator's IsAtFinalElement correctly in a BiDi context.booleanNext(int level)Moves to the start of the next object at the given level in the page hierarchy in the appropriate reading order and returns false if the end of the page was reached.booleanParagraphIsLtr()Return whether the current paragraph's dominant reading direction is left-to-right (as opposed to right-to-left).static ResultIteratorStartOfParagraph(LTRResultIterator resit)-
Methods inherited from class org.bytedeco.tesseract.LTRResultIterator
Confidence, EquivalentToTruth, EquivalentToTruth, GetBlamerDebug, GetBlamerMisadaptionDebug, GetParamsTrainingBundle, HasBlamerInfo, HasTruthString, SetLineSeparator, SetLineSeparator, SetParagraphSeparator, SetParagraphSeparator, SymbolIsDropcap, SymbolIsSubscript, SymbolIsSuperscript, WordDirection, WordFontAttributes, WordFontAttributes, WordFontAttributes, WordFontAttributes, WordFontAttributes, WordFontAttributes, WordIsFromDictionary, WordIsNumeric, WordLattice, WordLattice, WordLattice, WordNormedUTF8Text, WordRecognitionLanguage, WordTruthUTF8Text
-
Methods inherited from class org.bytedeco.tesseract.PageIterator
Baseline, Baseline, Baseline, BlockPolygon, BlockType, BoundingBox, BoundingBox, BoundingBox, BoundingBox, BoundingBox, BoundingBox, BoundingBoxInternal, BoundingBoxInternal, BoundingBoxInternal, Cmp, Empty, GetBinaryImage, GetImage, GetImage, GetImage, IsWithinFirstTextlineOfParagraph, Orientation, Orientation, Orientation, ParagraphInfo, ParagraphInfo, ParagraphInfo, ParagraphInfo, ParagraphInfo, ParagraphInfo, PositionedAtSameWord, put, RestartParagraph, RestartRow, RowAttributes, RowAttributes, RowAttributes, SetBoundingBoxComponents, SetWordBlamerBundle
-
Methods inherited from class org.bytedeco.javacpp.Pointer
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, trimMemory, withDeallocator, zero
-
-
-
-
Constructor Detail
-
ResultIterator
public ResultIterator(Pointer p)
Pointer cast constructor. InvokesPointer(Pointer).
-
-
Method Detail
-
StartOfParagraph
public static ResultIterator StartOfParagraph(@Const @ByRef LTRResultIterator resit)
-
Begin
public void Begin()
Moves the iterator to point to the start of the page to begin an iteration.- Overrides:
Beginin classPageIterator
-
Next
@Cast("bool") public boolean Next(@Cast("tesseract::PageIteratorLevel") int level)
Moves to the start of the next object at the given level in the page hierarchy in the appropriate reading order and returns false if the end of the page was reached. NOTE that RIL_SYMBOL will skip non-text blocks, but all other PageIteratorLevel level values will visit each non-text block once. Think of non text blocks as containing a single para, with a single line, with a single imaginary word. Calls to Next with different levels may be freely intermixed. This function iterates words in right-to-left scripts correctly, if the appropriate language has been loaded into Tesseract.- Overrides:
Nextin classPageIterator
-
IsAtBeginningOf
@Cast("bool") public boolean IsAtBeginningOf(@Cast("tesseract::PageIteratorLevel") int level)
IsAtBeginningOf() returns whether we're at the logical beginning of the given level. (as opposed to ResultIterator's left-to-right top-to-bottom order). Otherwise, this acts the same as PageIterator::IsAtBeginningOf(). For a full description, see pageiterator.h- Overrides:
IsAtBeginningOfin classPageIterator
-
IsAtFinalElement
@Cast("bool") public boolean IsAtFinalElement(@Cast("tesseract::PageIteratorLevel") int level, @Cast("tesseract::PageIteratorLevel") int element)
Implement PageIterator's IsAtFinalElement correctly in a BiDi context. For instance, IsAtFinalElement(RIL_PARA, RIL_WORD) returns whether we point at the last word in a paragraph. See PageIterator for full comment.- Overrides:
IsAtFinalElementin classPageIterator
-
BlanksBeforeWord
public int BlanksBeforeWord()
- Overrides:
BlanksBeforeWordin classLTRResultIterator
-
GetUTF8Text
@Cast("char*") public BytePointer GetUTF8Text(@Cast("tesseract::PageIteratorLevel") int level)
Returns the null terminated UTF-8 encoded text string for the current object at the given level. Use delete [] to free after use.- Overrides:
GetUTF8Textin classLTRResultIterator
-
GetRawLSTMTimesteps
@StdVector public StringFloatPairVectorVector GetRawLSTMTimesteps()
Returns the LSTM choices for every LSTM timestep for the current word.
-
GetBestLSTMSymbolChoices
public StringFloatPairVectorVector GetBestLSTMSymbolChoices()
-
ParagraphIsLtr
@Cast("bool") public boolean ParagraphIsLtr()
Return whether the current paragraph's dominant reading direction is left-to-right (as opposed to right-to-left).
-
CalculateTextlineOrder
public static void CalculateTextlineOrder(@Cast("bool") boolean paragraph_is_ltr, @Cast("tesseract::StrongScriptDirection*") @StdVector IntPointer word_dirs, @StdVector IntPointer reading_order)
Yields the reading order as a sequence of indices and (optional) meta-marks for a set of words (given left-to-right). The meta marks are passed as negative values: kMinorRunStart Start of minor direction text. kMinorRunEnd End of minor direction text. kComplexWord The next indexed word contains both left-to-right and right-to-left characters and was treated as neutral. For example, suppose we have five words in a text line, indexed [0,1,2,3,4] from the leftmost side of the text line. The following are all believable reading_orders: Left-to-Right (in ltr paragraph): { 0, 1, 2, 3, 4 } Left-to-Right (in rtl paragraph): { kMinorRunStart, 0, 1, 2, 3, 4, kMinorRunEnd } Right-to-Left (in rtl paragraph): { 4, 3, 2, 1, 0 } Left-to-Right except for an RTL phrase in words 2, 3 in an ltr paragraph: { 0, 1, kMinorRunStart, 3, 2, kMinorRunEnd, 4 }
-
CalculateTextlineOrder
public static void CalculateTextlineOrder(@Cast("bool") boolean paragraph_is_ltr, @Cast("tesseract::StrongScriptDirection*") @StdVector IntBuffer word_dirs, @StdVector IntBuffer reading_order)
-
CalculateTextlineOrder
public static void CalculateTextlineOrder(@Cast("bool") boolean paragraph_is_ltr, @Cast("tesseract::StrongScriptDirection*") @StdVector int[] word_dirs, @StdVector int[] reading_order)
-
-