SetVariable Method (GdPictureOCR)
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.
'Declaration
Public Function SetVariable( _
ByVal As String, _
ByVal As String _
) As GdPictureStatus
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.
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
}