You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TessBaseAPI currently has SetVariable function for setting parameters. This is a useful thing and, for example, my application has the ability to set these parameters through the settings menu. But if the user first sets some parameter, and then removes it, then it is necessary to reset this value to the default. At the moment there is no such possibility without reinitializing the API itself. If you pass nullptr, then the application segfaults, if you pass an empty string, then PrintVariables return false indicating failure. Also, simply calling the Init function will not reset the variables unless End is called before it.
Suggestions
It would be nice to have a more convenient API to control such variables without full reinitialization. Something like ClearVariables would be enough.
Also it would also be convenient to reset the value to default when passing nullptr to SetVariable or have a separate function to reset a single variable.
The text was updated successfully, but these errors were encountered:
Issue description
TessBaseAPI currently has SetVariable function for setting parameters. This is a useful thing and, for example, my application has the ability to set these parameters through the settings menu. But if the user first sets some parameter, and then removes it, then it is necessary to reset this value to the default. At the moment there is no such possibility without reinitializing the API itself. If you pass
nullptr
, then the application segfaults, if you pass an empty string, then PrintVariables returnfalse
indicating failure. Also, simply calling the Init function will not reset the variables unless End is called before it.Suggestions
It would be nice to have a more convenient API to control such variables without full reinitialization. Something like
ClearVariables
would be enough.Also it would also be convenient to reset the value to default when passing
nullptr
to SetVariable or have a separate function to reset a single variable.The text was updated successfully, but these errors were encountered: