JScript Class Reference

Class used to customize and run script identification. More...

#include <JScript.h>

List of all members.

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 ()


Detailed Description

Class used to customize and run script identification.

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.


Constructor & Destructor Documentation

JScript::JScript ( char *  script_data_file_path  ) 

constructor

Parameters:
script_data_file_path path to the pre-trained script files

JScript::~JScript (  ) 

Destructor


Member Function Documentation

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.

Parameters:
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.

Parameters:
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

Parameters:
script name of the script
Returns:
int
    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.

Parameters:
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.

Parameters:
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.
Returns:
a string of the script identified

int* JScript::getDirections (  )  [inline]

return the directions array

Returns:
pointer to directions[]

Definition at line 247 of file JScript.h.

float* JScript::getDistribution (  )  [inline]

returns the symbol distribution (float) containing the scores for the scripts

Definition at line 251 of file JScript.h.

char* JScript::getFirst (  )  [inline]

Returns the highest scoring script. Note, this may or may not be the JARGON classification for the page. If another script scored high as well JARGON may classify the image as unknown

Definition at line 257 of file JScript.h.

char* JScript::getSecond (  )  [inline]

Returns the second highest scoring script.

Definition at line 260 of file JScript.h.

int JScript::getOrientation (  )  [inline]

Returns JARGON's orientation classification

Definition at line 263 of file JScript.h.

char* JScript::getOrient_char (  )  [inline]

Definition at line 264 of file JScript.h.

int* JScript::getProb (  )  [inline]

Definition at line 265 of file JScript.h.

int JScript::getScriptCount (  )  [inline]

Returns the number of scripts that JARGON is trained on

Definition at line 268 of file JScript.h.

int JScript::getSymbol_count (  )  [inline]

Returns the number of symbols that were used to perform script identification

Definition at line 273 of file JScript.h.

int JScript::getSymbolsUsed (  )  [inline]

Returns the number of symbols that were used to perform script identification

Definition at line 278 of file JScript.h.

int JScript::getOrientThreshold (  )  [inline]

Returns the threshold used in determining if a non-upright orienation is presentw

Definition at line 282 of file JScript.h.

static string JScript::dlGetVersionInfo (  )  [static]


The documentation for this class was generated from the following file:
Generated on Fri Feb 23 15:32:33 2007 for Jargon by  doxygen 1.5.1