Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Android
Public Member Functions | |
TextRecognitionSettings () | |
TextRecognitionSettings (Pattern regex) | |
void | setProperty (String key, Object value) |
TextRecognitionSettings (JSONObject json) throws JSONParseException | |
JSONObject | toJson () throws JSONException |
TextRecognitionSettings | clone () |
Public Attributes | |
RectF | areaPortrait |
RectF | areaLandscape |
Pattern | regex |
CharacterSet | characterWhitelist |
Detailed Description
Holds settings related to text recognition.
Constructor & Destructor Documentation
◆ TextRecognitionSettings() [1/3]
Construct new default text recognition settings.
The recognition settings object has the regular expression set to null. You must explicitly initialize it in order for text recognition to work.
◆ TextRecognitionSettings() [2/3]
TextRecognitionSettings | ( | Pattern | regex | ) |
Construct new default text recognition settings.
- Parameters
-
regex The regular expression to use
◆ TextRecognitionSettings() [3/3]
TextRecognitionSettings | ( | JSONObject | json | ) | throws JSONParseException |
Parse the text recognition settings from a JSON object.
- Parameters
-
json The json object
- Exceptions
-
JSONParseException in case the JSON object is invalid.
Member Function Documentation
◆ setProperty()
void setProperty | ( | String | key, |
Object | value | ||
) |
Sets a property.
This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.
- Parameters
-
key The property's name. value The property's value.
◆ toJson()
JSONObject toJson | ( | ) | throws JSONException |
- Returns
- the settings as a json dictionary
There is no guarantee that the JSON dictionary is stable, keys might disappear, be added or renamed without notice.
- Since
- 5.6.0
◆ clone()
TextRecognitionSettings clone | ( | ) |
- Returns
- A deep copy of the text recognition settings.
Member Data Documentation
◆ areaPortrait
RectF areaPortrait |
The area (in relative coordinates) in which text is to be recognized.
While it's possible to set this area to the whole image, it is not recommended to do so for speed reasons. For best performance, set this to the smallest possible area. By default, the recognition area is set to 1/4 of the image height.
This value is only used when scanning in portrait orientation. areaLandscape is used when scanning in landscape orientation.
- Since
- 5.1
◆ areaLandscape
RectF areaLandscape |
The area (in relative coordinates) in which text is to be recognized.
While it's possible to set this area to the whole image, it is not recommended to do so for speed reasons. For best performance, set this to the smallest possible area. By default, the recognition area is set to 1/4 of the image height.
This value is only used when scanning in landscape orientation. areaPortrait is used when scanning in portrait orientation.
- Since
- 5.1
◆ regex
Pattern regex |
Regular expression for filtering the recognized characters.
Text that does not match the regular expression is ignored.
By default, the regex is set to null. You must explicitly initialize the regex in order for text recognition to work.
- Since
- 5.1
◆ characterWhitelist
CharacterSet characterWhitelist |
White list of recognizable characters.
If the white list is non-null, a recognition result will never contain characters that are not contained in it.
By default the white list is null and all characters will be recognized.
- Since
- 5.2.0
The documentation for this class was generated from the following file:
- TextRecognitionSettings.java