GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureOCR Class / SetVariable Method
The name of the parameter. You can find a wide range of possible variables listed in Tesseract-OCR parameters.
The value for the specified parameter.
Example





In This Topic
SetVariable Method (GdPictureOCR)
In This Topic
Sets up a specified value for an internal parameter of the OCR engine. The Tesseract engine has a large number of control parameters to modify its behavior.
Syntax
'Declaration
 
Public Function SetVariable( _
   ByVal Name As String, _
   ByVal Value As String _
) As GdPictureStatus
public GdPictureStatus SetVariable( 
   string Name,
   string Value
)
public function SetVariable( 
    Name: String;
    Value: String
): GdPictureStatus; 
public function SetVariable( 
   Name : String,
   Value : String
) : GdPictureStatus;
public: GdPictureStatus SetVariable( 
   string* Name,
   string* Value
) 
public:
GdPictureStatus SetVariable( 
   String^ Name,
   String^ Value
) 

Parameters

Name
The name of the parameter. You can find a wide range of possible variables listed in Tesseract-OCR parameters.
Value
The value for the specified parameter.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK

We strongly recommend always checking this status first.

Example
How to set the required variables of the Tesseract engine.
Using gdpictureOCR As GdPictureOCR = New GdPictureOCR()
    'Some examples of Tesseract variables:
    gdpictureOCR.SetVariable("chop_enable", "T")
    gdpictureOCR.SetVariable("use_new_state_cost", "F")
    gdpictureOCR.SetVariable("segment_segcost_rating", "F")
    gdpictureOCR.SetVariable("enable_new_segsearch", "0")
    gdpictureOCR.SetVariable("language_model_ngram_on", "0")
    gdpictureOCR.SetVariable("textord_force_make_prop_words", "F")
    gdpictureOCR.SetVariable("edges_max_children_per_outline", "40")
    'You can find more variables here:
    'http://www.sk-spell.sk.cx/tesseract-ocr-parameters-in-302-version
End Using
using (GdPictureOCR gdpictureOCR = new GdPictureOCR())
{
    //Some examples of Tesseract variables:
    gdpictureOCR.SetVariable("chop_enable", "T");
    gdpictureOCR.SetVariable("use_new_state_cost", "F");
    gdpictureOCR.SetVariable("segment_segcost_rating", "F");
    gdpictureOCR.SetVariable("enable_new_segsearch", "0");
    gdpictureOCR.SetVariable("language_model_ngram_on", "0");
    gdpictureOCR.SetVariable("textord_force_make_prop_words", "F");
    gdpictureOCR.SetVariable("edges_max_children_per_outline", "40");
 
    //You can find more variables here:
    //http://www.sk-spell.sk.cx/tesseract-ocr-parameters-in-302-version
}
See Also