dynamsoft-capture-vision-bundle 3.4.1000__cp314-cp314-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dynamsoft_capture_vision_bundle/ConfusableChars.data +0 -0
- dynamsoft_capture_vision_bundle/DynamicPdfx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftBarcodeReaderx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftCaptureVisionRouterx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftCodeParserDedicatorx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftCodeParserx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftCorex64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftDocumentNormalizerx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftIdentityUtilityx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftImageProcessingx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftLabelRecognizerx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftLicensex64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftNeuralNetworkx64.dll +0 -0
- dynamsoft_capture_vision_bundle/DynamsoftUtilityx64.dll +0 -0
- dynamsoft_capture_vision_bundle/Models/Code128Decoder.data +0 -0
- dynamsoft_capture_vision_bundle/Models/Code39ITFDecoder.data +0 -0
- dynamsoft_capture_vision_bundle/Models/DataMatrixQRCodeDeblur.data +0 -0
- dynamsoft_capture_vision_bundle/Models/DataMatrixQRCodeLocalization.data +0 -0
- dynamsoft_capture_vision_bundle/Models/EAN13Decoder.data +0 -0
- dynamsoft_capture_vision_bundle/Models/LetterCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/LowercaseCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/MRZCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/MRZLocalization.data +0 -0
- dynamsoft_capture_vision_bundle/Models/MRZTextLineRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/NumberCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/NumberLetterCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/NumberLowercaseCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/NumberUppercaseCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/OneDDeblur.data +0 -0
- dynamsoft_capture_vision_bundle/Models/OneDLocalization.data +0 -0
- dynamsoft_capture_vision_bundle/Models/PDF417Deblur.data +0 -0
- dynamsoft_capture_vision_bundle/Models/PDF417Localization.data +0 -0
- dynamsoft_capture_vision_bundle/Models/UppercaseCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/Models/VINCharRecognition.data +0 -0
- dynamsoft_capture_vision_bundle/OverlappingChars.data +1 -0
- dynamsoft_capture_vision_bundle/ParserResources/AADHAAR.data +0 -0
- dynamsoft_capture_vision_bundle/ParserResources/AAMVA_DL_ID.data +1 -0
- dynamsoft_capture_vision_bundle/ParserResources/GS1_AI.data +66 -0
- dynamsoft_capture_vision_bundle/ParserResources/MRTD.data +1 -0
- dynamsoft_capture_vision_bundle/ParserResources/SOUTH_AFRICA_DL.data +1 -0
- dynamsoft_capture_vision_bundle/ParserResources/VIN.data +0 -0
- dynamsoft_capture_vision_bundle/Templates/DBR-PresetTemplates.json +546 -0
- dynamsoft_capture_vision_bundle/Templates/DDN-PresetTemplates.json +316 -0
- dynamsoft_capture_vision_bundle/Templates/DLR-PresetTemplates.json +471 -0
- dynamsoft_capture_vision_bundle/Templates/DriverLicenseScanner.json +94 -0
- dynamsoft_capture_vision_bundle/Templates/MRZScanner.json +804 -0
- dynamsoft_capture_vision_bundle/Templates/VINScanner.json +299 -0
- dynamsoft_capture_vision_bundle/_DynamsoftBarcodeReader.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftCaptureVisionRouter.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftCodeParser.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftCodeParserDedicator.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftCore.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftDocumentNormalizer.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftIdentityUtility.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftImageProcessing.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftLabelRecognizer.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftLicense.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/_DynamsoftUtility.cp314-win_amd64.pyd +0 -0
- dynamsoft_capture_vision_bundle/__init__.py +13 -0
- dynamsoft_capture_vision_bundle/core.py +2785 -0
- dynamsoft_capture_vision_bundle/cvr.py +1347 -0
- dynamsoft_capture_vision_bundle/dbr.py +1223 -0
- dynamsoft_capture_vision_bundle/dcp.py +208 -0
- dynamsoft_capture_vision_bundle/dcpd.py +21 -0
- dynamsoft_capture_vision_bundle/ddn.py +985 -0
- dynamsoft_capture_vision_bundle/dip.py +24 -0
- dynamsoft_capture_vision_bundle/dlr.py +1136 -0
- dynamsoft_capture_vision_bundle/id_utility.py +98 -0
- dynamsoft_capture_vision_bundle/license.py +146 -0
- dynamsoft_capture_vision_bundle/utility.py +835 -0
- dynamsoft_capture_vision_bundle-3.4.1000.dist-info/METADATA +89 -0
- dynamsoft_capture_vision_bundle-3.4.1000.dist-info/RECORD +75 -0
- dynamsoft_capture_vision_bundle-3.4.1000.dist-info/WHEEL +5 -0
- dynamsoft_capture_vision_bundle-3.4.1000.dist-info/licenses/LICENSE.txt +1 -0
- dynamsoft_capture_vision_bundle-3.4.1000.dist-info/top_level.txt +12 -0
|
@@ -0,0 +1,1136 @@
|
|
|
1
|
+
__version__ = "4.0.30.7449"
|
|
2
|
+
|
|
3
|
+
if __package__ or "." in __name__:
|
|
4
|
+
from .core import *
|
|
5
|
+
else:
|
|
6
|
+
from core import *
|
|
7
|
+
|
|
8
|
+
if __package__ or "." in __name__:
|
|
9
|
+
from . import _DynamsoftLabelRecognizer
|
|
10
|
+
else:
|
|
11
|
+
import _DynamsoftLabelRecognizer
|
|
12
|
+
|
|
13
|
+
from typing import List,Tuple
|
|
14
|
+
|
|
15
|
+
from enum import IntEnum
|
|
16
|
+
|
|
17
|
+
class EnumRawTextLineStatus(IntEnum):
|
|
18
|
+
RTLS_LOCALIZED = _DynamsoftLabelRecognizer.RTLS_LOCALIZED
|
|
19
|
+
RTLS_RECOGNITION_FAILED = _DynamsoftLabelRecognizer.RTLS_RECOGNITION_FAILED
|
|
20
|
+
RTLS_RECOGNITION_SUCCEEDED = _DynamsoftLabelRecognizer.RTLS_RECOGNITION_SUCCEEDED
|
|
21
|
+
|
|
22
|
+
class SimplifiedLabelRecognizerSettings:
|
|
23
|
+
"""
|
|
24
|
+
The SimplifiedLabelRecognizerSettings class contains settings for label recognition.
|
|
25
|
+
It is a sub-parameter of SimplifiedCaptureVisionSettings.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
grayscale_transformation_modes(List[int]): Specifies how grayscale transformations should be applied, including whether to process inverted grayscale images and the specific transformation mode to use.
|
|
29
|
+
grayscale_enhancement_modes(List[int]): Specifies how to enhance the quality of the grayscale image.
|
|
30
|
+
character_model_name(str): Specifies a character model by its name.
|
|
31
|
+
line_string_regex_pattern(str): Specifies the RegEx pattern of the text line string to filter out the unqualified results.
|
|
32
|
+
max_threads_in_one_task(int): Specifies the maximum available threads count in one label recognition task.
|
|
33
|
+
scale_down_threshold(int): Specifies the threshold for the image shrinking.
|
|
34
|
+
"""
|
|
35
|
+
_thisown = property(
|
|
36
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def grayscale_transformation_modes(self) -> List[int]:
|
|
41
|
+
if not hasattr(self, "_grayscale_transformation_modes") or self._grayscale_transformation_modes is None:
|
|
42
|
+
self._grayscale_transformation_modes = _DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_grayscaleTransformationModes_get(self)
|
|
43
|
+
return self._grayscale_transformation_modes
|
|
44
|
+
@grayscale_transformation_modes.setter
|
|
45
|
+
def grayscale_transformation_modes(self, value):
|
|
46
|
+
if not hasattr(self, "_grayscale_transformation_modes") or self._grayscale_transformation_modes is None:
|
|
47
|
+
self._grayscale_transformation_modes = _DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_grayscaleTransformationModes_get(self)
|
|
48
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_grayscaleTransformationModes_set(self, value)
|
|
49
|
+
self._grayscale_transformation_modes = value
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def grayscale_enhancement_modes(self) -> List[int]:
|
|
53
|
+
if not hasattr(self, "_grayscale_enhancement_modes") or self._grayscale_enhancement_modes is None:
|
|
54
|
+
self._grayscale_enhancement_modes = _DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_grayscaleEnhancementModes_get(self)
|
|
55
|
+
return self._grayscale_enhancement_modes
|
|
56
|
+
@grayscale_enhancement_modes.setter
|
|
57
|
+
def grayscale_enhancement_modes(self, value):
|
|
58
|
+
if not hasattr(self, "_grayscale_enhancement_modes") or self._grayscale_enhancement_modes is None:
|
|
59
|
+
self._grayscale_enhancement_modes = _DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_grayscaleEnhancementModes_get(self)
|
|
60
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_grayscaleEnhancementModes_set(self, value)
|
|
61
|
+
self._grayscale_enhancement_modes = value
|
|
62
|
+
|
|
63
|
+
character_model_name: str = property(
|
|
64
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_characterModelName_get,
|
|
65
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_characterModelName_set,
|
|
66
|
+
doc="Specifies a character model by its name.",
|
|
67
|
+
)
|
|
68
|
+
line_string_regex_pattern: str = property(
|
|
69
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_lineStringRegExPattern_get,
|
|
70
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_lineStringRegExPattern_set,
|
|
71
|
+
doc="Specifies the RegEx pattern of the text line string to filter out the unqualified results.",
|
|
72
|
+
)
|
|
73
|
+
max_threads_in_one_task: int = property(
|
|
74
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_maxThreadsInOneTask_get,
|
|
75
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_maxThreadsInOneTask_set,
|
|
76
|
+
doc="""
|
|
77
|
+
Specifies the maximum available threads count in one label recognition task.
|
|
78
|
+
Value Range: [1, 256]
|
|
79
|
+
Default value: 4
|
|
80
|
+
""",
|
|
81
|
+
)
|
|
82
|
+
scale_down_threshold: int = property(
|
|
83
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_scaleDownThreshold_get,
|
|
84
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_scaleDownThreshold_set,
|
|
85
|
+
doc="""
|
|
86
|
+
Specifies the threshold for the image shrinking.
|
|
87
|
+
Value Range: [512, 0x7fffffff]
|
|
88
|
+
Default Value: 2300
|
|
89
|
+
""",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def __init__(self):
|
|
93
|
+
_DynamsoftLabelRecognizer.Class_init(
|
|
94
|
+
self, _DynamsoftLabelRecognizer.new_SimplifiedLabelRecognizerSettings()
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
__destroy__ = _DynamsoftLabelRecognizer.delete_SimplifiedLabelRecognizerSettings
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
_DynamsoftLabelRecognizer.SimplifiedLabelRecognizerSettings_register(
|
|
101
|
+
SimplifiedLabelRecognizerSettings
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
class CharacterResult:
|
|
105
|
+
"""
|
|
106
|
+
The CharacterResult class represents the result of a character recognition process.
|
|
107
|
+
It contains the characters recognized (high, medium, and low confidence), their respective confidences, and the location of the character in a quadrilateral shape.
|
|
108
|
+
|
|
109
|
+
Attributes:
|
|
110
|
+
character_h(str): The character with high confidence.
|
|
111
|
+
character_m(str): The character with medium confidence.
|
|
112
|
+
character_l(str): The character with low confidence.
|
|
113
|
+
location(Quadrilateral): The location of the character in a quadrilateral shape.
|
|
114
|
+
character_h_confidence(int): The confidence of the character with high confidence.
|
|
115
|
+
character_m_confidence(int): The confidence of the character with medium confidence.
|
|
116
|
+
character_l_confidence(int): The confidence of the character with low confidence.
|
|
117
|
+
"""
|
|
118
|
+
_thisown = property(
|
|
119
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
character_h: str = property(
|
|
123
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterH_get,
|
|
124
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterH_set,
|
|
125
|
+
doc="The character with high confidence."
|
|
126
|
+
)
|
|
127
|
+
character_m: str = property(
|
|
128
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterM_get,
|
|
129
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterM_set,
|
|
130
|
+
doc="The character with medium confidence."
|
|
131
|
+
)
|
|
132
|
+
character_l: str = property(
|
|
133
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterL_get,
|
|
134
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterL_set,
|
|
135
|
+
doc="The character with low confidence."
|
|
136
|
+
)
|
|
137
|
+
location: Quadrilateral = property(
|
|
138
|
+
_DynamsoftLabelRecognizer.CCharacterResult_location_get,
|
|
139
|
+
_DynamsoftLabelRecognizer.CCharacterResult_location_set,
|
|
140
|
+
doc="The location of the character in a quadrilateral shape."
|
|
141
|
+
)
|
|
142
|
+
character_h_confidence: int = property(
|
|
143
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterHConfidence_get,
|
|
144
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterHConfidence_set,
|
|
145
|
+
doc="The confidence of the character with high confidence."
|
|
146
|
+
)
|
|
147
|
+
character_m_confidence: int = property(
|
|
148
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterMConfidence_get,
|
|
149
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterMConfidence_set,
|
|
150
|
+
doc="The confidence of the character with medium confidence."
|
|
151
|
+
)
|
|
152
|
+
character_l_confidence: int = property(
|
|
153
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterLConfidence_get,
|
|
154
|
+
_DynamsoftLabelRecognizer.CCharacterResult_characterLConfidence_set,
|
|
155
|
+
doc="The confidence of the character with low confidence."
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
def __init__(self):
|
|
159
|
+
_DynamsoftLabelRecognizer.Class_init(
|
|
160
|
+
self, _DynamsoftLabelRecognizer.new_CCharacterResult()
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
__destroy__ = _DynamsoftLabelRecognizer.delete_CCharacterResult
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
_DynamsoftLabelRecognizer.CCharacterResult_register(CharacterResult)
|
|
167
|
+
|
|
168
|
+
class TextLineResultItem(CapturedResultItem):
|
|
169
|
+
"""
|
|
170
|
+
The TextLineResultItem class represents a text line result item recognized by the library. It is derived from CapturedResultItem.
|
|
171
|
+
|
|
172
|
+
Methods:
|
|
173
|
+
get_text(self) -> str: Gets the text content of the text line.
|
|
174
|
+
get_location(self) -> Quadrilateral: Gets the location of the text line in the form of a quadrilateral.
|
|
175
|
+
get_confidence(self) -> int: Gets the confidence of the text line recognition result.
|
|
176
|
+
get_character_results(self) -> List[CharacterResult]: Gets all the character results.
|
|
177
|
+
get_specification_name(self) -> str: Gets the name of the text line specification that generated this item.
|
|
178
|
+
get_raw_text(self) -> str: Gets the recognized raw text, excluding any concatenation separators.
|
|
179
|
+
"""
|
|
180
|
+
_thisown = property(
|
|
181
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
def __init__(self):
|
|
185
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
186
|
+
|
|
187
|
+
def get_text(self) -> str:
|
|
188
|
+
"""
|
|
189
|
+
Gets the text content of the text line.
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
The text content of the text line.
|
|
193
|
+
"""
|
|
194
|
+
return _DynamsoftLabelRecognizer.CTextLineResultItem_GetText(self)
|
|
195
|
+
|
|
196
|
+
def get_location(self) -> Quadrilateral:
|
|
197
|
+
"""
|
|
198
|
+
Gets the location of the text line in the form of a quadrilateral.
|
|
199
|
+
|
|
200
|
+
Returns:
|
|
201
|
+
The location of the text line in the form of a quadrilateral.
|
|
202
|
+
"""
|
|
203
|
+
return _DynamsoftLabelRecognizer.CTextLineResultItem_GetLocation(self)
|
|
204
|
+
|
|
205
|
+
def get_confidence(self) -> int:
|
|
206
|
+
"""
|
|
207
|
+
Gets the confidence of the text line recognition result.
|
|
208
|
+
|
|
209
|
+
Returns:
|
|
210
|
+
The confidence of the text line recognition result.
|
|
211
|
+
"""
|
|
212
|
+
return _DynamsoftLabelRecognizer.CTextLineResultItem_GetConfidence(self)
|
|
213
|
+
|
|
214
|
+
def get_character_results(self) -> List[CharacterResult]:
|
|
215
|
+
"""
|
|
216
|
+
Gets all the character results.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
All the character results as a CharacterResult list.
|
|
220
|
+
"""
|
|
221
|
+
list = []
|
|
222
|
+
count = _DynamsoftLabelRecognizer.CTextLineResultItem_GetCharacterResultsCount(
|
|
223
|
+
self
|
|
224
|
+
)
|
|
225
|
+
for i in range(count):
|
|
226
|
+
list.append(
|
|
227
|
+
_DynamsoftLabelRecognizer.CTextLineResultItem_GetCharacterResult(
|
|
228
|
+
self, i
|
|
229
|
+
)
|
|
230
|
+
)
|
|
231
|
+
return list
|
|
232
|
+
|
|
233
|
+
def get_specification_name(self) -> str:
|
|
234
|
+
"""
|
|
235
|
+
Gets the name of the text line specification that generated this item.
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
238
|
+
The name of the text line specification that generated this item.
|
|
239
|
+
"""
|
|
240
|
+
return _DynamsoftLabelRecognizer.CTextLineResultItem_GetSpecificationName(self)
|
|
241
|
+
|
|
242
|
+
def get_raw_text(self) -> str:
|
|
243
|
+
"""
|
|
244
|
+
Gets the recognized raw text, excluding any concatenation separators.
|
|
245
|
+
|
|
246
|
+
Returns:
|
|
247
|
+
The recognized raw text.
|
|
248
|
+
"""
|
|
249
|
+
return _DynamsoftLabelRecognizer.CTextLineResultItem_GetRawText(self)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
_DynamsoftLabelRecognizer.CTextLineResultItem_register(TextLineResultItem)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class RecognizedTextLinesResult(CapturedResultBase):
|
|
256
|
+
"""
|
|
257
|
+
The RecognizedTextLinesResult class represents the result of a text recognition process.
|
|
258
|
+
It provides access to information about the recognized text lines, the original image, and any errors that occurred during the recognition process.
|
|
259
|
+
|
|
260
|
+
Methods:
|
|
261
|
+
get_items(self) -> List[TextLineResultItem]: Gets all the text line result items.
|
|
262
|
+
"""
|
|
263
|
+
_thisown = property(
|
|
264
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
def __init__(self):
|
|
268
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
269
|
+
|
|
270
|
+
__destroy__ = _DynamsoftLabelRecognizer.CRecognizedTextLinesResult_Release
|
|
271
|
+
|
|
272
|
+
def get_items(self) -> List[TextLineResultItem]:
|
|
273
|
+
"""
|
|
274
|
+
Gets all the text line result items.
|
|
275
|
+
|
|
276
|
+
Returns:
|
|
277
|
+
A TextLineResultItem list.
|
|
278
|
+
"""
|
|
279
|
+
list = []
|
|
280
|
+
count = _DynamsoftLabelRecognizer.CRecognizedTextLinesResult_GetItemsCount(self)
|
|
281
|
+
for i in range(count):
|
|
282
|
+
list.append(
|
|
283
|
+
_DynamsoftLabelRecognizer.CRecognizedTextLinesResult_GetItem(self, i)
|
|
284
|
+
)
|
|
285
|
+
return list
|
|
286
|
+
|
|
287
|
+
_DynamsoftLabelRecognizer.CRecognizedTextLinesResult_register(RecognizedTextLinesResult)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
class LabelRecognizerModule:
|
|
291
|
+
"""
|
|
292
|
+
The LabelRecognizerModule class represents a label recognizer module.
|
|
293
|
+
|
|
294
|
+
Methods:
|
|
295
|
+
get_version() -> str: Gets the version of the label recognizer module.
|
|
296
|
+
"""
|
|
297
|
+
_thisown = property(
|
|
298
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
@staticmethod
|
|
302
|
+
def get_version() -> str:
|
|
303
|
+
"""
|
|
304
|
+
Gets the version of the label recognizer module.
|
|
305
|
+
|
|
306
|
+
Returns:
|
|
307
|
+
A string representing the version of the label recognizer module.
|
|
308
|
+
"""
|
|
309
|
+
return __version__ + " (Algorithm " + _DynamsoftLabelRecognizer.CLabelRecognizerModule_GetVersion() + ")"
|
|
310
|
+
|
|
311
|
+
def __init__(self):
|
|
312
|
+
_DynamsoftLabelRecognizer.Class_init(
|
|
313
|
+
self, _DynamsoftLabelRecognizer.new_CLabelRecognizerModule()
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
__destroy__ = _DynamsoftLabelRecognizer.delete_CLabelRecognizerModule
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
_DynamsoftLabelRecognizer.CLabelRecognizerModule_register(LabelRecognizerModule)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
class BufferedCharacterItem:
|
|
323
|
+
"""
|
|
324
|
+
The BufferedCharacterItem class represents a text line result item recognized by the library. It is derived from CapturedResultItem.
|
|
325
|
+
|
|
326
|
+
Methods:
|
|
327
|
+
get_character(self) -> str: Gets the buffered character value.
|
|
328
|
+
get_image(self) -> ImageData: Gets the image data of the buffered character.
|
|
329
|
+
get_features(self) -> List[Tuple[int, float]]: Gets all the features formatted with id and value of the buffered character.
|
|
330
|
+
"""
|
|
331
|
+
_thisown = property(
|
|
332
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
def __init__(self):
|
|
336
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
337
|
+
|
|
338
|
+
__destroy__ = _DynamsoftLabelRecognizer.delete_CBufferedCharacterItem
|
|
339
|
+
|
|
340
|
+
def get_character(self) -> str:
|
|
341
|
+
"""
|
|
342
|
+
Gets the buffered character value.
|
|
343
|
+
|
|
344
|
+
Returns:
|
|
345
|
+
The buffered character value.
|
|
346
|
+
"""
|
|
347
|
+
return _DynamsoftLabelRecognizer.CBufferedCharacterItem_GetCharacter(self)
|
|
348
|
+
|
|
349
|
+
def get_image(self) -> ImageData:
|
|
350
|
+
"""
|
|
351
|
+
Gets the image data of the buffered character.
|
|
352
|
+
|
|
353
|
+
Returns:
|
|
354
|
+
The image data of the buffered character.
|
|
355
|
+
"""
|
|
356
|
+
return _DynamsoftLabelRecognizer.CBufferedCharacterItem_GetImage(self)
|
|
357
|
+
|
|
358
|
+
def get_features(self) -> List[Tuple[int, float]]:
|
|
359
|
+
"""
|
|
360
|
+
Gets all the features formatted with id and value of the buffered character.
|
|
361
|
+
|
|
362
|
+
Returns:
|
|
363
|
+
A tuple list while each item contains following elements.
|
|
364
|
+
- feature_id <int>: The feature id.
|
|
365
|
+
- feature_value <float>: The feature value.
|
|
366
|
+
"""
|
|
367
|
+
list = []
|
|
368
|
+
count = _DynamsoftLabelRecognizer.CBufferedCharacterItem_GetFeaturesCount(self)
|
|
369
|
+
for i in range(count):
|
|
370
|
+
err,id,feature = _DynamsoftLabelRecognizer.CBufferedCharacterItem_GetFeature(self, i)
|
|
371
|
+
list.append([id,feature])
|
|
372
|
+
return list
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
_DynamsoftLabelRecognizer.CBufferedCharacterItem_register(BufferedCharacterItem)
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
class CharacterCluster:
|
|
379
|
+
"""
|
|
380
|
+
The CharacterCluster class represents a character cluster generated from the buffered character items. These buffered items will be clustered based on feature similarity to obtain cluster centers.
|
|
381
|
+
|
|
382
|
+
Methods:
|
|
383
|
+
get_character(self) -> str: Gets the character value of the cluster.
|
|
384
|
+
get_mean(self) -> BufferedCharacterItem: Gets the mean of the cluster.
|
|
385
|
+
"""
|
|
386
|
+
_thisown = property(
|
|
387
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
def __init__(self):
|
|
391
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
392
|
+
|
|
393
|
+
__destroy__ = _DynamsoftLabelRecognizer.delete_CCharacterCluster
|
|
394
|
+
|
|
395
|
+
def get_character(self) -> str:
|
|
396
|
+
"""
|
|
397
|
+
Gets the character value of the cluster.
|
|
398
|
+
|
|
399
|
+
Returns:
|
|
400
|
+
The character value of the cluster.
|
|
401
|
+
"""
|
|
402
|
+
return _DynamsoftLabelRecognizer.CCharacterCluster_GetCharacter(self)
|
|
403
|
+
|
|
404
|
+
def get_mean(self) -> BufferedCharacterItem:
|
|
405
|
+
"""
|
|
406
|
+
Gets the mean of the cluster.
|
|
407
|
+
|
|
408
|
+
Returns:
|
|
409
|
+
The mean of the cluster which is a BufferedCharacterItem object.
|
|
410
|
+
"""
|
|
411
|
+
return _DynamsoftLabelRecognizer.CCharacterCluster_GetMean(self)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
_DynamsoftLabelRecognizer.CCharacterCluster_register(CharacterCluster)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
class BufferedCharacterItemSet:
|
|
418
|
+
"""
|
|
419
|
+
The BufferedCharacterItemSet class represents a collection of buffered character items and associated character clusters.
|
|
420
|
+
|
|
421
|
+
Methods:
|
|
422
|
+
get_items(self) -> List[BufferedCharacterItem]: Gets all the buffered items.
|
|
423
|
+
get_character_clusters(self) -> List[CharacterCluster]: Gets all the character clusters.
|
|
424
|
+
"""
|
|
425
|
+
_thisown = property(
|
|
426
|
+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
def __init__(self):
|
|
430
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
431
|
+
|
|
432
|
+
__destroy__ = _DynamsoftLabelRecognizer.CBufferedCharacterItemSet_Release
|
|
433
|
+
|
|
434
|
+
def get_items(self) -> List[BufferedCharacterItem]:
|
|
435
|
+
"""
|
|
436
|
+
Gets all the buffered items.
|
|
437
|
+
|
|
438
|
+
Returns:
|
|
439
|
+
A BufferedCharacterItem list.
|
|
440
|
+
"""
|
|
441
|
+
list = []
|
|
442
|
+
count = _DynamsoftLabelRecognizer.CBufferedCharacterItemSet_GetItemsCount(self)
|
|
443
|
+
for i in range(count):
|
|
444
|
+
list.append(
|
|
445
|
+
_DynamsoftLabelRecognizer.CBufferedCharacterItemSet_GetItem(self, i)
|
|
446
|
+
)
|
|
447
|
+
return list
|
|
448
|
+
|
|
449
|
+
def get_character_clusters(self) -> List[CharacterCluster]:
|
|
450
|
+
"""
|
|
451
|
+
Gets all the character clusters.
|
|
452
|
+
|
|
453
|
+
Returns:
|
|
454
|
+
A CharacterCluster list.
|
|
455
|
+
"""
|
|
456
|
+
list = []
|
|
457
|
+
count = _DynamsoftLabelRecognizer.CBufferedCharacterItemSet_GetCharacterClustersCount(
|
|
458
|
+
self
|
|
459
|
+
)
|
|
460
|
+
for i in range(count):
|
|
461
|
+
list.append(
|
|
462
|
+
_DynamsoftLabelRecognizer.CBufferedCharacterItemSet_GetCharacterCluster(
|
|
463
|
+
self, i
|
|
464
|
+
)
|
|
465
|
+
)
|
|
466
|
+
return list
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
_DynamsoftLabelRecognizer.CBufferedCharacterItemSet_register(BufferedCharacterItemSet)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
#new
|
|
473
|
+
|
|
474
|
+
class LocalizedTextLineElement(RegionObjectElement):
|
|
475
|
+
"""
|
|
476
|
+
The LocalizedTextLineElement class represents a localized text line element. It inherits from the RegionObjectElement class.
|
|
477
|
+
"""
|
|
478
|
+
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
|
|
479
|
+
|
|
480
|
+
def __init__(self, *args, **kwargs):
|
|
481
|
+
_DynamsoftLabelRecognizer.Class_init(
|
|
482
|
+
self, _DynamsoftLabelRecognizer.CLabelRecognizerModule_CreateLocalizedTextLineElement()
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
def get_character_quads_count(self) -> int:
|
|
486
|
+
"""
|
|
487
|
+
Gets the number of character quads in the text line.
|
|
488
|
+
|
|
489
|
+
Returns:
|
|
490
|
+
The number of character quads in the text line.
|
|
491
|
+
"""
|
|
492
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLineElement_GetCharacterQuadsCount(self)
|
|
493
|
+
|
|
494
|
+
def get_character_quad(self, index: int) -> Tuple[int, Quadrilateral]:
|
|
495
|
+
"""
|
|
496
|
+
Gets the quadrilateral of a specific character in the text line.
|
|
497
|
+
|
|
498
|
+
Args:
|
|
499
|
+
index (int): The index of the character.
|
|
500
|
+
|
|
501
|
+
Returns:
|
|
502
|
+
A tuple containing following elements:
|
|
503
|
+
- error_code (int): The error code indicating the status of the operation, returns 0 if successful, otherwise returns a negative value.
|
|
504
|
+
- quadrilateral (Quadrilateral): The quadrilateral of the character.
|
|
505
|
+
"""
|
|
506
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLineElement_GetCharacterQuad(self, index)
|
|
507
|
+
|
|
508
|
+
def get_row_number(self) -> int:
|
|
509
|
+
"""
|
|
510
|
+
Gets the row number of the text line.
|
|
511
|
+
|
|
512
|
+
Returns:
|
|
513
|
+
The row number of the text line.
|
|
514
|
+
"""
|
|
515
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLineElement_GetRowNumber(self)
|
|
516
|
+
|
|
517
|
+
def set_location(self, location: Quadrilateral) -> int:
|
|
518
|
+
"""
|
|
519
|
+
Sets the location of the text line.
|
|
520
|
+
|
|
521
|
+
Args:
|
|
522
|
+
location (Quadrilateral): The location of the text line.
|
|
523
|
+
|
|
524
|
+
Returns:
|
|
525
|
+
Returns 0 if success, otherwise an error code.
|
|
526
|
+
"""
|
|
527
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLineElement_SetLocation(self, location)
|
|
528
|
+
|
|
529
|
+
_DynamsoftLabelRecognizer.CLocalizedTextLineElement_register(LocalizedTextLineElement)
|
|
530
|
+
class RecognizedTextLineElement(RegionObjectElement):
|
|
531
|
+
"""
|
|
532
|
+
The RecognizedTextLineElement class represents a recognized text line element. It inherits from the RegionObjectElement class.
|
|
533
|
+
|
|
534
|
+
Methods:
|
|
535
|
+
get_text(self) -> str: Gets the recognized text.
|
|
536
|
+
get_confidence(self) -> int: Gets the confidence level of the recognized text.
|
|
537
|
+
get_character_results_count(self) -> int: Gets the number of individual character recognition results in the line.
|
|
538
|
+
get_row_number(self) -> int: Gets the row number of the recognized text line.
|
|
539
|
+
get_character_result(self, index: int) -> CharacterResult: Gets the character recognition result at the specified index.
|
|
540
|
+
set_text(self, text: str): Sets the recognized text.
|
|
541
|
+
get_specification_name(self) -> str: Gets the name of the text line specification that generated this element.
|
|
542
|
+
get_raw_text(self) -> str: Gets the recognized raw text, excluding any concatenation separators.
|
|
543
|
+
set_location(self, location: Quadrilateral) -> int: Sets the location of the recognized text line element.
|
|
544
|
+
"""
|
|
545
|
+
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
|
|
546
|
+
|
|
547
|
+
def __init__(self, *args, **kwargs):
|
|
548
|
+
_DynamsoftLabelRecognizer.Class_init(
|
|
549
|
+
self, _DynamsoftLabelRecognizer.CLabelRecognizerModule_CreateRecognizedTextLineElement()
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
def get_text(self) -> str:
|
|
553
|
+
"""
|
|
554
|
+
Gets the recognized text.
|
|
555
|
+
|
|
556
|
+
Returns:
|
|
557
|
+
The recognized text.
|
|
558
|
+
"""
|
|
559
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetText(self)
|
|
560
|
+
|
|
561
|
+
def get_confidence(self) -> int:
|
|
562
|
+
"""
|
|
563
|
+
Gets the confidence level of the recognized text.
|
|
564
|
+
|
|
565
|
+
Returns:
|
|
566
|
+
The confidence level of the recognized text.
|
|
567
|
+
"""
|
|
568
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetConfidence(self)
|
|
569
|
+
|
|
570
|
+
def get_character_results_count(self) -> int:
|
|
571
|
+
"""
|
|
572
|
+
Gets the number of individual character recognition results in the line.
|
|
573
|
+
|
|
574
|
+
Returns:
|
|
575
|
+
The number of individual character recognition results in the line.
|
|
576
|
+
"""
|
|
577
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetCharacterResultsCount(self)
|
|
578
|
+
|
|
579
|
+
def get_row_number(self) -> int:
|
|
580
|
+
"""
|
|
581
|
+
Gets the row number of the text line within the image.
|
|
582
|
+
|
|
583
|
+
Returns:
|
|
584
|
+
The row number of the text line within the image.
|
|
585
|
+
"""
|
|
586
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetRowNumber(self)
|
|
587
|
+
|
|
588
|
+
def get_character_result(self, index: int) -> CharacterResult:
|
|
589
|
+
"""
|
|
590
|
+
Gets the character recognition result at the specified index.
|
|
591
|
+
|
|
592
|
+
Args:
|
|
593
|
+
index (int): The index of the character recognition result to retrieve.
|
|
594
|
+
|
|
595
|
+
Returns:
|
|
596
|
+
The character result.
|
|
597
|
+
"""
|
|
598
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetCharacterResult(self, index)
|
|
599
|
+
|
|
600
|
+
def set_text(self, text: str) -> None:
|
|
601
|
+
"""
|
|
602
|
+
Sets the recognized text.
|
|
603
|
+
|
|
604
|
+
Args:
|
|
605
|
+
text (str): The recognized text.
|
|
606
|
+
"""
|
|
607
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_SetText(self, text)
|
|
608
|
+
|
|
609
|
+
def get_specification_name(self) -> str:
|
|
610
|
+
"""
|
|
611
|
+
Gets the name of the text line specification that generated this element.
|
|
612
|
+
|
|
613
|
+
Returns:
|
|
614
|
+
The name of the text line specification that generated this element.
|
|
615
|
+
"""
|
|
616
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetSpecificationName(self)
|
|
617
|
+
|
|
618
|
+
def get_raw_text(self) -> str:
|
|
619
|
+
"""
|
|
620
|
+
Gets the recognized raw text, excluding any concatenation separators.
|
|
621
|
+
|
|
622
|
+
Returns:
|
|
623
|
+
The recognized raw text.
|
|
624
|
+
"""
|
|
625
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_GetRawText(self)
|
|
626
|
+
|
|
627
|
+
def set_location(self, location: Quadrilateral) -> int:
|
|
628
|
+
"""
|
|
629
|
+
Sets the location of the recognized text line element.
|
|
630
|
+
|
|
631
|
+
Args:
|
|
632
|
+
location (Quadrilateral): The location of the recognized text line element.
|
|
633
|
+
|
|
634
|
+
Returns:
|
|
635
|
+
Returns 0 if success, otherwise an error code.
|
|
636
|
+
"""
|
|
637
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLineElement_SetLocation(self, location)
|
|
638
|
+
|
|
639
|
+
_DynamsoftLabelRecognizer.CRecognizedTextLineElement_register(RecognizedTextLineElement)
|
|
640
|
+
class LocalizedTextLinesUnit(IntermediateResultUnit):
|
|
641
|
+
"""
|
|
642
|
+
The LocalizedTextLinesUnit class represents a unit that contains localized text lines. It inherits from the IntermediateResultUnit class.
|
|
643
|
+
|
|
644
|
+
Methods:
|
|
645
|
+
get_count(self) -> int: Gets the number of localized text lines in the unit.
|
|
646
|
+
get_localized_text_line(self, index: int) -> LocalizedTextLineElement: Gets the localized text line at the specified index.
|
|
647
|
+
remove_all_localized_text_lines(self): Removes all localized text lines.
|
|
648
|
+
remove_localized_text_line(self, index: int) -> int: Removes the localized text line at the specified index.
|
|
649
|
+
add_localized_text_line(self, localized_text_line: LocalizedTextLineElement) -> int: Adds a localized text line to the unit.
|
|
650
|
+
set_localized_text_line(self, index: int, element: LocalizedTextLineElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the localized text line at the specified index.
|
|
651
|
+
"""
|
|
652
|
+
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
|
|
653
|
+
|
|
654
|
+
def __init__(self, *args, **kwargs):
|
|
655
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
def get_count(self) -> int:
|
|
659
|
+
"""
|
|
660
|
+
Gets the number of localized text lines in the unit.
|
|
661
|
+
|
|
662
|
+
Returns:
|
|
663
|
+
The number of localized text lines in the unit.
|
|
664
|
+
"""
|
|
665
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_GetCount(self)
|
|
666
|
+
|
|
667
|
+
def get_localized_text_line(self, index: int) -> LocalizedTextLineElement:
|
|
668
|
+
"""
|
|
669
|
+
Gets the localized text line at the specified index.
|
|
670
|
+
|
|
671
|
+
Args:
|
|
672
|
+
index (int): The index of the localized text line to retrieve.
|
|
673
|
+
|
|
674
|
+
Returns:
|
|
675
|
+
The localized text line.
|
|
676
|
+
|
|
677
|
+
"""
|
|
678
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_GetLocalizedTextLine(self, index)
|
|
679
|
+
|
|
680
|
+
def remove_all_localized_text_lines(self) -> None:
|
|
681
|
+
"""
|
|
682
|
+
Removes all localized text lines.
|
|
683
|
+
"""
|
|
684
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_RemoveAllLocalizedTextLines(self)
|
|
685
|
+
|
|
686
|
+
def remove_localized_text_line(self, index: int) -> int:
|
|
687
|
+
"""
|
|
688
|
+
Removes the localized text line at the specified index.
|
|
689
|
+
|
|
690
|
+
Args:
|
|
691
|
+
index (int): The index of the localized text line to remove.
|
|
692
|
+
|
|
693
|
+
Returns:
|
|
694
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
695
|
+
"""
|
|
696
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_RemoveLocalizedTextLine(self, index)
|
|
697
|
+
|
|
698
|
+
def add_localized_text_line(self, element: LocalizedTextLineElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
699
|
+
"""
|
|
700
|
+
Adds a localized text line to the unit.
|
|
701
|
+
|
|
702
|
+
Args:
|
|
703
|
+
element (LocalizedTextLineElement): The localized text line to add.
|
|
704
|
+
matrix_to_original_image (List[float], optional): The matrix to transform the localized text line to the original image. Defaults to IDENTITY_MATRIX.
|
|
705
|
+
|
|
706
|
+
Returns:
|
|
707
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
708
|
+
"""
|
|
709
|
+
|
|
710
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_AddLocalizedTextLine(self, element, matrix_to_original_image)
|
|
711
|
+
|
|
712
|
+
def set_localized_text_line(self, index: int, element: LocalizedTextLineElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
713
|
+
"""
|
|
714
|
+
Sets the localized text line at the specified index.
|
|
715
|
+
|
|
716
|
+
Args:
|
|
717
|
+
index (int): The index of the localized text line to set.
|
|
718
|
+
element (LocalizedTextLineElement): The localized text line to set.
|
|
719
|
+
matrix_to_original_image (List[float], optional): The matrix to transform the localized text line to the original image. Defaults to IDENTITY_MATRIX.
|
|
720
|
+
|
|
721
|
+
Returns:
|
|
722
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
723
|
+
"""
|
|
724
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_SetLocalizedTextLine(self, index, element, matrix_to_original_image)
|
|
725
|
+
|
|
726
|
+
def get_auxiliary_region_elements_count(self) -> int:
|
|
727
|
+
"""
|
|
728
|
+
Gets the count of auxiliary region elements in the unit.
|
|
729
|
+
|
|
730
|
+
Returns:
|
|
731
|
+
Returns the number of auxiliary region elements.
|
|
732
|
+
"""
|
|
733
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_GetAuxiliaryRegionElementsCount(self)
|
|
734
|
+
|
|
735
|
+
def get_auxiliary_region_element(self, index: int) -> AuxiliaryRegionElement:
|
|
736
|
+
"""
|
|
737
|
+
Gets the auxiliary region element at the specified index.
|
|
738
|
+
|
|
739
|
+
Args:
|
|
740
|
+
index (int): The zero-based index of the auxiliary region element to retrieve.
|
|
741
|
+
|
|
742
|
+
Returns:
|
|
743
|
+
Returns a pointer to the CAuxiliaryRegionElement object, or NULL if the index is out of range.
|
|
744
|
+
"""
|
|
745
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_GetAuxiliaryRegionElement(self, index)
|
|
746
|
+
|
|
747
|
+
def set_auxiliary_region_element(self, index: int, element: AuxiliaryRegionElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
748
|
+
"""
|
|
749
|
+
Sets or replaces the auxiliary region element at the specified index.
|
|
750
|
+
|
|
751
|
+
Args:
|
|
752
|
+
index (int): The zero-based index where the element should be set.
|
|
753
|
+
element (CAuxiliaryRegionElement): The auxiliary region element to set.
|
|
754
|
+
matrix_to_original_image (List[float], optional): The matrix to original image. Defaults to IDENTITY_MATRIX.
|
|
755
|
+
|
|
756
|
+
Returns:
|
|
757
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
758
|
+
"""
|
|
759
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_SetAuxiliaryRegionElement(self, index, element, matrix_to_original_image)
|
|
760
|
+
|
|
761
|
+
def add_auxiliary_region_element(self, element: AuxiliaryRegionElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
762
|
+
"""
|
|
763
|
+
Adds a new auxiliary region element to this unit.
|
|
764
|
+
|
|
765
|
+
Args:
|
|
766
|
+
element (AuxiliaryRegionElement): The auxiliary region element to add.
|
|
767
|
+
matrix_to_original_image (List[float], optional): The matrix to original image. Defaults to IDENTITY_MATRIX.
|
|
768
|
+
|
|
769
|
+
Returns:
|
|
770
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
771
|
+
"""
|
|
772
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_AddAuxiliaryRegionElement(self, element, matrix_to_original_image)
|
|
773
|
+
|
|
774
|
+
def remove_auxiliary_region_element(self, index: int) -> int:
|
|
775
|
+
"""
|
|
776
|
+
Removes the auxiliary region element at the specified index.
|
|
777
|
+
|
|
778
|
+
Args:
|
|
779
|
+
index (int): The zero-based index of the auxiliary region element to remove.
|
|
780
|
+
|
|
781
|
+
Returns:
|
|
782
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
783
|
+
"""
|
|
784
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_RemoveAuxiliaryRegionElement(self, index)
|
|
785
|
+
|
|
786
|
+
def remove_all_auxiliary_region_elements(self):
|
|
787
|
+
"""
|
|
788
|
+
Removes all auxiliary region elements from this unit.
|
|
789
|
+
"""
|
|
790
|
+
return _DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_RemoveAllAuxiliaryRegionElements(self)
|
|
791
|
+
|
|
792
|
+
_DynamsoftLabelRecognizer.CLocalizedTextLinesUnit_register(LocalizedTextLinesUnit)
|
|
793
|
+
class RecognizedTextLinesUnit(IntermediateResultUnit):
|
|
794
|
+
"""
|
|
795
|
+
The RecognizedTextLinesUnit class represents an intermediate result unit containing recognized text lines. It inherits from the IntermediateResultUnit class.
|
|
796
|
+
|
|
797
|
+
Methods:
|
|
798
|
+
get_count(self) -> int: Gets the number of recognized text lines in the unit.
|
|
799
|
+
get_recognized_text_line(self, index: int) -> RecognizedTextLineElement: Gets the recognized text line at the specified index.
|
|
800
|
+
remove_all_recognized_text_lines(self): Removes all recognized text lines.
|
|
801
|
+
remove_recognized_text_line(self, index: int) -> int: Removes the recognized text line at the specified index.
|
|
802
|
+
add_recognized_text_line(self, recognized_text_line: RecognizedTextLineElement): Adds a recognized text line.
|
|
803
|
+
set_recognized_text_line(self, index: int, element: RecognizedTextLineElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the recognized text line at the specified index.
|
|
804
|
+
"""
|
|
805
|
+
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
|
|
806
|
+
|
|
807
|
+
def __init__(self, *args, **kwargs):
|
|
808
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
def get_count(self) -> int:
|
|
812
|
+
"""
|
|
813
|
+
Gets the number of recognized text lines in the unit.
|
|
814
|
+
|
|
815
|
+
Returns:
|
|
816
|
+
The number of recognized text lines in the unit.
|
|
817
|
+
"""
|
|
818
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_GetCount(self)
|
|
819
|
+
|
|
820
|
+
def get_recognized_text_line(self, index: int) -> RecognizedTextLineElement:
|
|
821
|
+
"""
|
|
822
|
+
Gets the RecognizedTextLineElement object at the specified index.
|
|
823
|
+
|
|
824
|
+
Args:
|
|
825
|
+
index (int): The index of the desired CRecognizedTextLineElement object.
|
|
826
|
+
|
|
827
|
+
Returns:
|
|
828
|
+
The RecognizedTextLineElement object at the specified index.
|
|
829
|
+
"""
|
|
830
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_GetRecognizedTextLine(self, index)
|
|
831
|
+
|
|
832
|
+
def remove_all_recognized_text_lines(self) -> None:
|
|
833
|
+
"""
|
|
834
|
+
Removes all recognized text lines.
|
|
835
|
+
"""
|
|
836
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_RemoveAllRecognizedTextLines(self)
|
|
837
|
+
|
|
838
|
+
def remove_recognized_text_line(self, index: int) -> int:
|
|
839
|
+
"""
|
|
840
|
+
Removes the recognized text line at the specified index.
|
|
841
|
+
|
|
842
|
+
Args:
|
|
843
|
+
index (int): The index of the recognized text line to remove.
|
|
844
|
+
|
|
845
|
+
Returns:
|
|
846
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
847
|
+
"""
|
|
848
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_RemoveRecognizedTextLine(self, index)
|
|
849
|
+
|
|
850
|
+
def add_recognized_text_line(self, element: RecognizedTextLineElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
851
|
+
"""
|
|
852
|
+
Adds a recognized text line.
|
|
853
|
+
|
|
854
|
+
Args:
|
|
855
|
+
element (RecognizedTextLineElement): The recognized text line to add.
|
|
856
|
+
matrix_to_original_image (List[float], optional): The matrix to transform the recognized text line to the original image. Defaults to IDENTITY_MATRIX.
|
|
857
|
+
|
|
858
|
+
Returns:
|
|
859
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
860
|
+
"""
|
|
861
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_AddRecognizedTextLine(self, element, matrix_to_original_image)
|
|
862
|
+
|
|
863
|
+
def set_recognized_text_line(self, index: int, element: RecognizedTextLineElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
864
|
+
"""
|
|
865
|
+
Sets the recognized text line at the specified index.
|
|
866
|
+
|
|
867
|
+
Args:
|
|
868
|
+
index (int): The index of the recognized text line to set.
|
|
869
|
+
element (RecognizedTextLineElement): The recognized text line to set.
|
|
870
|
+
matrix_to_original_image (List[float], optional): The matrix to transform the recognized text line to the original image. Defaults to IDENTITY_MATRIX.
|
|
871
|
+
|
|
872
|
+
Returns:
|
|
873
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
874
|
+
"""
|
|
875
|
+
return _DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_SetRecognizedTextLine(self, index, element, matrix_to_original_image)
|
|
876
|
+
|
|
877
|
+
_DynamsoftLabelRecognizer.CRecognizedTextLinesUnit_register(RecognizedTextLinesUnit)
|
|
878
|
+
class RawTextLine:
|
|
879
|
+
"""
|
|
880
|
+
The RawTextLine class represents a text line in an image.
|
|
881
|
+
It can be in one of the following states:
|
|
882
|
+
- `RTLS_LOCALIZED`: Localized but recognition not performed.
|
|
883
|
+
- `RTLS_RECOGNITION_FAILED`: Recognition failed.
|
|
884
|
+
- `RTLS_RECOGNITION_SUCCESSFULLY`: Successfully recognized.
|
|
885
|
+
|
|
886
|
+
Methods:
|
|
887
|
+
get_text(self) -> str: Gets the recognized text.
|
|
888
|
+
get_confidence(self) -> int: Gets the confidence level of the recognized text.
|
|
889
|
+
get_character_results_count(self) -> int: Gets the number of individual character recognition results in the line.
|
|
890
|
+
get_row_number(self) -> int: Gets the row number of the text line within the image.
|
|
891
|
+
get_character_result(self, index: int) -> CharacterResult: Gets the character recognition result at the specified index.
|
|
892
|
+
set_text(self, text: str): Sets the recognized text.
|
|
893
|
+
get_specification_name(self) -> str: Gets the name of the text line specification that generated this element.
|
|
894
|
+
get_location(self) -> Quadrilateral: Gets the location of the text line.
|
|
895
|
+
set_location(self, location: Quadrilateral) -> int: Sets the location of the text line.
|
|
896
|
+
get_status(self) -> int: Gets the status of the text line.
|
|
897
|
+
clone(self) -> "RawTextLine": Clones the RawTextLine object.
|
|
898
|
+
set_row_number(self, row_number: int) -> int: Sets the row number of the text line within the image.
|
|
899
|
+
set_specification_name(self, specification_name: str) -> int: Sets the name of the text line specification that generated this element.
|
|
900
|
+
set_character_results(self, char_array: List[CharacterResult]) -> int: Sets the character recognition results for the text line.
|
|
901
|
+
"""
|
|
902
|
+
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
|
|
903
|
+
|
|
904
|
+
def __init__(self, *args, **kwargs):
|
|
905
|
+
_DynamsoftLabelRecognizer.Class_init(
|
|
906
|
+
self, _DynamsoftLabelRecognizer.CLabelRecognizerModule_CreateRawTextLine()
|
|
907
|
+
)
|
|
908
|
+
__destroy__ = _DynamsoftLabelRecognizer.CRawTextLine_Release
|
|
909
|
+
|
|
910
|
+
def get_text(self) -> str:
|
|
911
|
+
"""
|
|
912
|
+
Gets the recognized text.
|
|
913
|
+
|
|
914
|
+
Returns:
|
|
915
|
+
The recognized text.
|
|
916
|
+
"""
|
|
917
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetText(self)
|
|
918
|
+
|
|
919
|
+
def get_confidence(self) -> int:
|
|
920
|
+
"""
|
|
921
|
+
Gets the confidence level of the recognized text.
|
|
922
|
+
|
|
923
|
+
Returns:
|
|
924
|
+
An integer value representing the confidence level of the recognized text.
|
|
925
|
+
"""
|
|
926
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetConfidence(self)
|
|
927
|
+
|
|
928
|
+
def get_character_results_count(self) -> int:
|
|
929
|
+
"""
|
|
930
|
+
Gets the number of individual character recognition results in the line.
|
|
931
|
+
|
|
932
|
+
Returns:
|
|
933
|
+
An integer value representing the number of individual character recognition results.
|
|
934
|
+
"""
|
|
935
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetCharacterResultsCount(self)
|
|
936
|
+
|
|
937
|
+
def get_row_number(self) -> int:
|
|
938
|
+
"""
|
|
939
|
+
Gets the row number of the text line within the image.
|
|
940
|
+
|
|
941
|
+
Returns:
|
|
942
|
+
An integer value representing the row number of the text line within the image.
|
|
943
|
+
"""
|
|
944
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetRowNumber(self)
|
|
945
|
+
|
|
946
|
+
def get_character_result(self, index: int) -> CharacterResult:
|
|
947
|
+
"""
|
|
948
|
+
Gets the character recognition result at the specified index.
|
|
949
|
+
|
|
950
|
+
Args:
|
|
951
|
+
index (int): The index of the character recognition result to retrieve.
|
|
952
|
+
|
|
953
|
+
Returns:
|
|
954
|
+
The character recognition result at the specified index.
|
|
955
|
+
"""
|
|
956
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetCharacterResult(self, index)
|
|
957
|
+
|
|
958
|
+
def set_text(self, text: str) -> None:
|
|
959
|
+
"""
|
|
960
|
+
Sets the recognized text.
|
|
961
|
+
|
|
962
|
+
Args:
|
|
963
|
+
text (str): The recognized text to set.
|
|
964
|
+
"""
|
|
965
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_SetText(self, text)
|
|
966
|
+
|
|
967
|
+
def get_specification_name(self) -> str:
|
|
968
|
+
"""
|
|
969
|
+
Gets the name of the text line specification that generated this element.
|
|
970
|
+
|
|
971
|
+
Returns:
|
|
972
|
+
The name of the text line specification.
|
|
973
|
+
"""
|
|
974
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetSpecificationName(self)
|
|
975
|
+
|
|
976
|
+
def get_location(self) -> Quadrilateral:
|
|
977
|
+
"""
|
|
978
|
+
Gets the location of the text line.
|
|
979
|
+
|
|
980
|
+
Returns:
|
|
981
|
+
A Quadrilateral object which represents the location of the text line.
|
|
982
|
+
"""
|
|
983
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetLocation(self)
|
|
984
|
+
|
|
985
|
+
def set_location(self, location: Quadrilateral) -> int:
|
|
986
|
+
"""
|
|
987
|
+
Sets the location of the text line.
|
|
988
|
+
|
|
989
|
+
Args:
|
|
990
|
+
location (Quadrilateral): The location of the text line to set.
|
|
991
|
+
|
|
992
|
+
Returns:
|
|
993
|
+
Returns 0 if success, otherwise an error code.
|
|
994
|
+
"""
|
|
995
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_SetLocation(self, location)
|
|
996
|
+
|
|
997
|
+
def get_status(self) -> int:
|
|
998
|
+
"""
|
|
999
|
+
Gets the status of the text line.
|
|
1000
|
+
|
|
1001
|
+
Returns:
|
|
1002
|
+
The status of the text line.
|
|
1003
|
+
"""
|
|
1004
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_GetStatus(self)
|
|
1005
|
+
|
|
1006
|
+
def clone(self) -> "RawTextLine":
|
|
1007
|
+
"""
|
|
1008
|
+
Clones the RawTextLine object.
|
|
1009
|
+
|
|
1010
|
+
Returns:
|
|
1011
|
+
A copy of the RawTextLine object.
|
|
1012
|
+
"""
|
|
1013
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_Clone(self)
|
|
1014
|
+
|
|
1015
|
+
def set_row_number(self, row_number: int) -> int:
|
|
1016
|
+
"""
|
|
1017
|
+
Sets the row number of the text line within the image.
|
|
1018
|
+
|
|
1019
|
+
Args:
|
|
1020
|
+
row_number (int): The row number to set.
|
|
1021
|
+
|
|
1022
|
+
Returns:
|
|
1023
|
+
Returns 0 if success, otherwise an error code.
|
|
1024
|
+
"""
|
|
1025
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_SetRowNumber(self, row_number)
|
|
1026
|
+
|
|
1027
|
+
def set_specification_name(self, specification_name: str) -> int:
|
|
1028
|
+
"""
|
|
1029
|
+
Sets the name of the text line specification that generated this element.
|
|
1030
|
+
|
|
1031
|
+
Args:
|
|
1032
|
+
specification_name (str): The name of the text line specification to set.
|
|
1033
|
+
|
|
1034
|
+
Returns:
|
|
1035
|
+
Returns 0 if success, otherwise an error code.
|
|
1036
|
+
"""
|
|
1037
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_SetSpecificationName(self, specification_name)
|
|
1038
|
+
|
|
1039
|
+
def set_character_results(self, char_array: List[CharacterResult]) -> int:
|
|
1040
|
+
"""
|
|
1041
|
+
Sets the character recognition results for the text line.
|
|
1042
|
+
|
|
1043
|
+
Args:
|
|
1044
|
+
char_array (List[CharacterResult]): The character recognition results to set.
|
|
1045
|
+
|
|
1046
|
+
Returns:
|
|
1047
|
+
Returns 0 if success, otherwise an error code.
|
|
1048
|
+
"""
|
|
1049
|
+
return _DynamsoftLabelRecognizer.CRawTextLine_SetCharacterResults(self, char_array)
|
|
1050
|
+
|
|
1051
|
+
_DynamsoftLabelRecognizer.CRawTextLine_register(RawTextLine)
|
|
1052
|
+
class RawTextLinesUnit(IntermediateResultUnit):
|
|
1053
|
+
"""
|
|
1054
|
+
The RawTextLinesUnit class represents an intermediate result unit containing raw text lines. It inherits from the IntermediateResultUnit class.
|
|
1055
|
+
|
|
1056
|
+
Methods:
|
|
1057
|
+
get_count(): Gets the number of raw text lines in the unit.
|
|
1058
|
+
get_raw_text_line(index): Gets the raw text line at the specified index.
|
|
1059
|
+
remove_all_raw_text_lines(): Removes all raw text lines from the unit.
|
|
1060
|
+
remove_raw_text_line(self, index: int) -> int: Removes the raw text line at the specified index.
|
|
1061
|
+
add_raw_text_line(self, text_line: RawTextLine, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Adds a raw text line.
|
|
1062
|
+
set_raw_text_line(self, index: int, text_line: RawTextLine, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the raw text line at the specified index.
|
|
1063
|
+
"""
|
|
1064
|
+
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
|
|
1065
|
+
|
|
1066
|
+
def __init__(self, *args, **kwargs):
|
|
1067
|
+
raise AttributeError("No constructor defined - class is abstract")
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
def get_count(self) -> int:
|
|
1071
|
+
"""
|
|
1072
|
+
Gets the number of raw text lines in the unit.
|
|
1073
|
+
|
|
1074
|
+
Returns:
|
|
1075
|
+
The number of raw text lines in the unit.
|
|
1076
|
+
"""
|
|
1077
|
+
return _DynamsoftLabelRecognizer.CRawTextLinesUnit_GetCount(self)
|
|
1078
|
+
|
|
1079
|
+
def get_raw_text_line(self, index: int) -> RawTextLine:
|
|
1080
|
+
"""
|
|
1081
|
+
Gets the raw text line at the specified index.
|
|
1082
|
+
|
|
1083
|
+
Args:
|
|
1084
|
+
index (int): The index of the raw text line.
|
|
1085
|
+
|
|
1086
|
+
Returns:
|
|
1087
|
+
the RawTextLine object at the specified index.
|
|
1088
|
+
"""
|
|
1089
|
+
return _DynamsoftLabelRecognizer.CRawTextLinesUnit_GetRawTextLine(self, index)
|
|
1090
|
+
|
|
1091
|
+
def remove_all_raw_text_lines(self) -> None:
|
|
1092
|
+
"""
|
|
1093
|
+
Removes all raw text lines from the unit.
|
|
1094
|
+
"""
|
|
1095
|
+
return _DynamsoftLabelRecognizer.CRawTextLinesUnit_RemoveAllRawTextLines(self)
|
|
1096
|
+
|
|
1097
|
+
def remove_raw_text_line(self, index: int) -> int:
|
|
1098
|
+
"""
|
|
1099
|
+
Removes the raw text line at the specified index.
|
|
1100
|
+
|
|
1101
|
+
Args:
|
|
1102
|
+
index (int): The index of the raw text line to remove.
|
|
1103
|
+
|
|
1104
|
+
Returns:
|
|
1105
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
1106
|
+
"""
|
|
1107
|
+
return _DynamsoftLabelRecognizer.CRawTextLinesUnit_RemoveRawTextLine(self, index)
|
|
1108
|
+
|
|
1109
|
+
def add_raw_text_line(self, text_line: RawTextLine, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
1110
|
+
"""
|
|
1111
|
+
Adds a raw text line.
|
|
1112
|
+
|
|
1113
|
+
Args:
|
|
1114
|
+
text_line (RawTextLine): The raw text line to add.
|
|
1115
|
+
matrix_to_original_image (List[float], optional): The matrix to transform the raw text line to the original image. Defaults to IDENTITY_MATRIX.
|
|
1116
|
+
|
|
1117
|
+
Returns:
|
|
1118
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
1119
|
+
"""
|
|
1120
|
+
return _DynamsoftLabelRecognizer.CRawTextLinesUnit_AddRawTextLine(self, text_line, matrix_to_original_image)
|
|
1121
|
+
|
|
1122
|
+
def set_raw_text_line(self, index: int, text_line: RawTextLine, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
|
|
1123
|
+
"""
|
|
1124
|
+
Sets the raw text line at the specified index.
|
|
1125
|
+
|
|
1126
|
+
Args:
|
|
1127
|
+
index (int): The index of the raw text line to set.
|
|
1128
|
+
text_line (RawTextLine): The raw text line to set.
|
|
1129
|
+
matrix_to_original_image (List[float], optional): The matrix to transform the raw text line to the original image. Defaults to IDENTITY_MATRIX.
|
|
1130
|
+
|
|
1131
|
+
Returns:
|
|
1132
|
+
Returns 0 if successful, otherwise returns a negative value.
|
|
1133
|
+
"""
|
|
1134
|
+
return _DynamsoftLabelRecognizer.CRawTextLinesUnit_SetRawTextLine(self, index, text_line, matrix_to_original_image)
|
|
1135
|
+
|
|
1136
|
+
_DynamsoftLabelRecognizer.CRawTextLinesUnit_register(RawTextLinesUnit)
|