#include <JScript.h>
Public Member Functions | |
void | read_script_data (char *language_list_path, language_profile **language_array, int *language_count, int scaled_height, int scaled_width) |
int | jarGetScriptNo (char *script) |
JScript (char *script_data_file_path) | |
~JScript () | |
void | changeBorders (int top, int left, int bottom, int right) |
void | clearDistribution () |
void | disableScript (int script_no) |
void | enableScript (int script_no) |
void | enableAllScripts () |
void | setDirections (int newdirections[4]) |
void | setSymbol_count (int symbol_limit) |
void | setOrientThreshold (int thresh) |
char * | getScript (DLImage &testImageP) |
int * | getDirections () |
float * | getDistribution () |
char * | getFirst () |
char * | getSecond () |
int | getOrientation () |
char * | getOrient_char () |
int * | getProb () |
int | getScriptCount () |
int | getSymbol_count () |
int | getSymbolsUsed () |
int | getOrientThreshold () |
Static Public Member Functions | |
static void | ReadScriptData (char *language_list_path, language_profile **language_array, int *language_count, int scaled_height, int scaled_width, float *threshold, int **gray_values) |
static string | dlGetVersionInfo () |
The JScript class contains all the methods needed to customize the JARGON script identification algorithm and to run the algorithm
Definition at line 127 of file JScript.h.
JScript::JScript | ( | char * | script_data_file_path | ) |
constructor
script_data_file_path | path to the pre-trained script files |
JScript::~JScript | ( | ) |
Destructor
void JScript::read_script_data | ( | char * | language_list_path, | |
language_profile ** | language_array, | |||
int * | language_count, | |||
int | scaled_height, | |||
int | scaled_width | |||
) |
read_script_data() function populates a lanugate profile data structure from trained language scripts.
language_list_path | text file contains a list of trained languages | |
language_array | a pointer to an empty language_profile pointer. read_script_data will populate this data structure from the language file. | |
language_count | the number of languages in the language_list_path file. This will be populated. | |
scaled_height | desire height for components | |
scaled_width | desire width for components |
static void JScript::ReadScriptData | ( | char * | language_list_path, | |
language_profile ** | language_array, | |||
int * | language_count, | |||
int | scaled_height, | |||
int | scaled_width, | |||
float * | threshold, | |||
int ** | gray_values | |||
) | [static] |
read_script_data() function populates a lanugate profile data structure from trained language scripts.
language_list_path | text file contains a list of trained languages | |
language_array | a pointer to an empty language_profile pointer. read_script_data will populate this data structure from the language file. | |
language_count | the number of languages in the language_list_path file. This will be populated. | |
scaled_height | desire height for components | |
scaled_width | desire width for components | |
threshold | ||
gray_values |
int JScript::jarGetScriptNo | ( | char * | script | ) |
jarGetScriptNo returns the predefined ID for each of the scripts
script | name of the script |
0 amharic 1 arabic 2 armenian 3 burmese 4 chinese 5 cyrillic 6 devanagari 7 greek 8 hebrew 9 japanese 10 korean 11 latin 12 thai 13 nodata 14 others
void JScript::changeBorders | ( | int | top, | |
int | left, | |||
int | bottom, | |||
int | right | |||
) |
Assign a new border size for documents. Connected components within the border will not be used in classifying the script.
top | top margin | |
left | left of margin | |
bottom | bottom margin | |
right | right margin |
void JScript::clearDistribution | ( | ) |
clearDistribution sets the scores for all scripts to zero
void JScript::disableScript | ( | int | script_no | ) |
disableScript allows for selected scripts to be turned off. This option should be used judiciously. Disabling too many scripts will result in the performance of script identification to degrade. This function is most useful to turn off one of two similar scripts. For example if Japanese and Chinese are both part of the scripts JARGON is trained on turning of one may improve accuracy.
void JScript::enableScript | ( | int | script_no | ) |
Allows for enabling of a script that was previously disabled using the disableScript method.
void JScript::enableAllScripts | ( | ) |
Enables all the scripts
void JScript::setDirections | ( | int | newdirections[4] | ) |
Allows for specification of the page orientaions JARGON will consider. the newdirections array contains a 0/1 flag indicating if the directions (0,90,180,27) are enabled.
void JScript::setSymbol_count | ( | int | symbol_limit | ) |
Specifies the number of symbols to be used for script identification
void JScript::setOrientThreshold | ( | int | thresh | ) |
Allows for modification of the threshold used in determining if a non- upright orientation is selected
char* JScript::getScript | ( | DLImage & | testImageP | ) |
GetScript ID will determine the type of script in a giving image.
testImageP | an image printer to the image to be identified. The input image must be a binary(Black/White) image. DOCLIB will throw an exception when image is in grayscale or color. |
int* JScript::getDirections | ( | ) | [inline] |
float* JScript::getDistribution | ( | ) | [inline] |
char* JScript::getFirst | ( | ) | [inline] |
char* JScript::getSecond | ( | ) | [inline] |
int JScript::getOrientation | ( | ) | [inline] |
int JScript::getScriptCount | ( | ) | [inline] |
int JScript::getSymbol_count | ( | ) | [inline] |
int JScript::getSymbolsUsed | ( | ) | [inline] |
int JScript::getOrientThreshold | ( | ) | [inline] |
static string JScript::dlGetVersionInfo | ( | ) | [static] |