GdPicture.NET.14
GdPicture14 Namespace / GdPictureOCR Class / ResetParameters Method
Example





In This Topic
ResetParameters Method (GdPictureOCR)
In This Topic
Resets all parameters of the current GdPictureOCR object to their default values, including added languages, custom dictionaries and internal engine variables. This does not apply to OCR results used in the current object.
Syntax
'Declaration
 
Public Function ResetParameters() As GdPictureStatus
public GdPictureStatus ResetParameters()
public function ResetParameters(): GdPictureStatus; 
public function ResetParameters() : GdPictureStatus;
public: GdPictureStatus ResetParameters(); 
public:
GdPictureStatus ResetParameters(); 

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.

Remarks
Please note, that not only all GdPictureOCR internal variables are reset to their default values, but also all internal variables of the Tesseract engine are reset to their default values as well.

Also be aware, that used OCR results in the current GdPictureOCR object are not released using this method.

Example
How to reset all internal variables.
Using gdpictureOCR As GdPictureOCR = New GdPictureOCR()
    'Set some GdPictureOCR variables.
    gdpictureOCR.Context = OCRContext.OCRContextRawLine
    gdpictureOCR.CharacterSet = ",./<>?"
    gdpictureOCR.Timeout = 1000
 
    'Some some Tesseract variables.
    gdpictureOCR.SetVariable("chop_enable", "T")
    gdpictureOCR.SetVariable("use_new_state_cost", "F")
    gdpictureOCR.SetVariable("enable_new_segsearch", "0")
    gdpictureOCR.SetVariable("edges_max_children_per_outline", "40")
 
    'Reset all internal variables to their default values.
    gdpictureOCR.ResetParameters()
End Using
using (GdPictureOCR gdpictureOCR = new GdPictureOCR())
{
    //Set some GdPictureOCR variables.
    gdpictureOCR.Context = OCRContext.OCRContextRawLine;
    gdpictureOCR.CharacterSet = ",./<>?";
    gdpictureOCR.Timeout = 1000;
 
    //Set some Tesseract variables.
    gdpictureOCR.SetVariable("chop_enable", "T");
    gdpictureOCR.SetVariable("use_new_state_cost", "F");
    gdpictureOCR.SetVariable("enable_new_segsearch", "0");
    gdpictureOCR.SetVariable("textord_force_make_prop_words", "F");
    gdpictureOCR.SetVariable("edges_max_children_per_outline", "40");
 
    //Reset all internal variables to their default values.
    gdpictureOCR.ResetParameters();
}
See Also