Package net.sourceforge.lept4j
Class L_Recoga
java.lang.Object
com.sun.jna.Structure
net.sourceforge.lept4j.L_Recoga
- Direct Known Subclasses:
L_Recoga.ByReference
,L_Recoga.ByValue
public class L_Recoga
extends com.sun.jna.Structure
recog.h
A simple utility for training and recognizing individual
machine-printed text characters. In an application, one can
envision using a number of these, one for each trained set.
In training mode, a set of labelled bitmaps is presented, either
one at a time, or in a directory, or in a pixa. If in a directory,
or a pixa, the labelling text string must be embedded in the
text field of the image file.
Any number of recognizers (L_Recog) can be trained and then used
together in an array (L_Recoga). All these trained structures
can be serialized to file and read back. The serialized version
holds all the bitmaps used for training, plus, for arbitrary
character sets, the UTF8 representation and the lookup table
mapping from the character representation to index.
There are three levels of "sets" here:
(1) Example set: the examples representing a character that
were printed in the same way, so that they can be combined
without scaling to form an "average" template for the character.
In the recognition phase, we use either this aligned average,
or the individual bitmaps. All examples in the set are given
the same character label. Example: the letter 'a' in the
predominant font in a book.
(2) Character set (represented by L_Recog, a single recognizer):
The set of different characters, each of which is described
by (1). Each element of the set has a different character
label. Example: the digits '0' through '9' that are used for
page numbering in a book.
(3) Recognizer set (represented by L_Recoga, an array of recogs):
A set of recognizers, each of which is described by (2).
In general, we do not want to combine the character sets
with the same labels within different recognizer sets,
because the bitmaps can differ in font type, style or size.
Example 1: the letter 'a' can be printed in two very different
ways (either with a large loop or with a smaller loop in
the lower half); both share the same label but need to be
distinguished so that they are not mixed when averaging.
Example 2: a recognizer trained for a book may be missing
some characters, so we need to supplement it with another
"generic" or "bootstrap" recognizer that has the additional
characters from a variety of sources. Bootstrap recognizers
must be run in a mode where all characters are scaled.
In the recognition process, for each component in an input image,
each recognizer (L_Recog) records the best match (highest
correlation score). If there is more than one recognizer, these
results are aggregated to find the best match for each character
for all the recognizers, and this is stored in L_Recoga.
native declaration : recog.h:53
This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java or JNA.
A simple utility for training and recognizing individual
machine-printed text characters. In an application, one can
envision using a number of these, one for each trained set.
In training mode, a set of labelled bitmaps is presented, either
one at a time, or in a directory, or in a pixa. If in a directory,
or a pixa, the labelling text string must be embedded in the
text field of the image file.
Any number of recognizers (L_Recog) can be trained and then used
together in an array (L_Recoga). All these trained structures
can be serialized to file and read back. The serialized version
holds all the bitmaps used for training, plus, for arbitrary
character sets, the UTF8 representation and the lookup table
mapping from the character representation to index.
There are three levels of "sets" here:
(1) Example set: the examples representing a character that
were printed in the same way, so that they can be combined
without scaling to form an "average" template for the character.
In the recognition phase, we use either this aligned average,
or the individual bitmaps. All examples in the set are given
the same character label. Example: the letter 'a' in the
predominant font in a book.
(2) Character set (represented by L_Recog, a single recognizer):
The set of different characters, each of which is described
by (1). Each element of the set has a different character
label. Example: the digits '0' through '9' that are used for
page numbering in a book.
(3) Recognizer set (represented by L_Recoga, an array of recogs):
A set of recognizers, each of which is described by (2).
In general, we do not want to combine the character sets
with the same labels within different recognizer sets,
because the bitmaps can differ in font type, style or size.
Example 1: the letter 'a' can be printed in two very different
ways (either with a large loop or with a smaller loop in
the lower half); both share the same label but need to be
distinguished so that they are not mixed when averaging.
Example 2: a recognizer trained for a book may be missing
some characters, so we need to supplement it with another
"generic" or "bootstrap" recognizer that has the additional
characters from a variety of sources. Bootstrap recognizers
must be run in a mode where all characters are scaled.
In the recognition process, for each component in an input image,
each recognizer (L_Recog) records the best match (highest
correlation score). If there is more than one recognizer, these
results are aggregated to find the best match for each character
for all the recognizers, and this is stored in L_Recoga.
native declaration : recog.h:53
This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java or JNA.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.jna.Structure
com.sun.jna.Structure.FieldOrder, com.sun.jna.Structure.StructField
-
Field Summary
Modifier and TypeFieldDescriptionint
number of recogs
C type : l_int32int
number of recog ptrs allocated
C type : l_int32stores the array of best chars
C type : L_Rcha*com.sun.jna.ptr.PointerByReference
recog ptr array
C type : L_Recog**Fields inherited from class com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE
-
Constructor Summary
ConstructorDescriptionL_Recoga()
L_Recoga(int n, int nalloc, com.sun.jna.ptr.PointerByReference recog, L_Rcha.ByReference rcha)
L_Recoga(com.sun.jna.Pointer peer)
-
Method Summary
Modifier and TypeMethodDescriptionGets this Structure's field names in their proper order.Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
Field Details
-
n
public int nnumber of recogs
C type : l_int32 -
nalloc
public int nallocnumber of recog ptrs allocated
C type : l_int32 -
recog
public com.sun.jna.ptr.PointerByReference recogrecog ptr array
C type : L_Recog** -
rcha
stores the array of best chars
C type : L_Rcha*
-
-
Constructor Details
-
L_Recoga
public L_Recoga() -
L_Recoga
public L_Recoga(int n, int nalloc, com.sun.jna.ptr.PointerByReference recog, L_Rcha.ByReference rcha)- Parameters:
n
- number of recogs
C type : l_int32nalloc
- number of recog ptrs allocated
C type : l_int32recog
- recog ptr array
C type : L_Recog**rcha
- stores the array of best chars
C type : L_Rcha*
-
L_Recoga
public L_Recoga(com.sun.jna.Pointer peer)
-
-
Method Details
-
getFieldOrder
Gets this Structure's field names in their proper order.- Overrides:
getFieldOrder
in classcom.sun.jna.Structure
- Returns:
- list of ordered field names
-