|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +title: CRawTextLine - Dynamsoft Label Recognizer Classes |
| 4 | +description: The class CRawTextLine of Dynamsoft Label Recognizer represents a recognized raw text line. |
| 5 | +keywords: Recognized raw text line |
| 6 | +needGenerateH3Content: true |
| 7 | +needAutoGenerateSidebar: true |
| 8 | +noTitleIndex: true |
| 9 | +breadcrumbText: CRawTextLine |
| 10 | +--- |
| 11 | + |
| 12 | +# CRawTextLine |
| 13 | + |
| 14 | +The class `CRawTextLine` of Dynamsoft Label Recognizer represents a recognized raw text line in an image. It can be in one of the following states: |
| 15 | + |
| 16 | +* `RTLS_LOCALIZED`: Localized but recognition not performed. |
| 17 | +* `RTLS_RECOGNITION_FAILED`: Recognition failed. |
| 18 | +* `RTLS_RECOGNITION_SUCCEEDED`: Successfully recognized. |
| 19 | + |
| 20 | +## Definition |
| 21 | + |
| 22 | +*Namespace:* dynamsoft::dlr::intermediate_results |
| 23 | + |
| 24 | +*Assembly:* DynamsoftLabelRecognizer |
| 25 | + |
| 26 | +```cpp |
| 27 | +class CRawTextLine |
| 28 | +``` |
| 29 | +
|
| 30 | +## Methods |
| 31 | +
|
| 32 | +| Method | Description | |
| 33 | +|----------------------|-------------| |
| 34 | +| [`GetText`](#gettext) | Gets the recognized text.| |
| 35 | +| [`GetConfidence`](#getconfidence) | Gets the confidence level of the recognized text.| |
| 36 | +| [`GetCharacterResultsCount`](#getcharacterresultscount) | Gets the number of individual character recognition results in the line.| |
| 37 | +| [`GetCharacterResult`](#getcharacterresult) | Gets the character recognition result at the specified index.| |
| 38 | +| [`GetLocation`](#getlocation) | Gets the location of the text line.| |
| 39 | +| [`GetRowNumber`](#getrownumber) | Gets the row number of the text line within the image.| |
| 40 | +| [`GetSpecificationName`](#getspecificationname) | Gets the name of the text line specification that generated this element.| |
| 41 | +| [`GetStatus`](#getstatus) | Gets the status of the text line.| |
| 42 | +| [`SetText`](#settext) | Sets the recognized text.| |
| 43 | +| [`SetLocation`](#setlocation) | Set the location of the text line.| |
| 44 | +| [`SetRowNumber`](#setrownumber) | Set the row number of the text line within the image.| |
| 45 | +| [`SetSpecificationName`](#setspecificationname) | Sets the name of the text line specification that generated this element. |
| 46 | +| [`Release`](#release) | Decreases the reference count of the CRawTextLine object.| |
| 47 | +| [`Clone`](#clone) | Clone the CRawTextLine object.| |
| 48 | +| [`SetCharacterResults`](#setcharacterresults) | Sets the character recognition results.| |
| 49 | +
|
| 50 | +### GetText |
| 51 | +
|
| 52 | +Gets the recognized text. |
| 53 | +
|
| 54 | +```cpp |
| 55 | +const char* GetText() const |
| 56 | +``` |
| 57 | + |
| 58 | +**Return value** |
| 59 | + |
| 60 | +Returns a pointer to the recognized text. |
| 61 | + |
| 62 | +### GetConfidence |
| 63 | + |
| 64 | +Gets the confidence level of the recognized text. |
| 65 | + |
| 66 | +```cpp |
| 67 | +int GetConfidence() const |
| 68 | +``` |
| 69 | + |
| 70 | +**Return value** |
| 71 | + |
| 72 | +Returns an integer value representing the confidence level of the recognized text. |
| 73 | + |
| 74 | +### GetCharacterResultsCount |
| 75 | + |
| 76 | +Gets the number of individual character recognition results in the line. |
| 77 | + |
| 78 | +```cpp |
| 79 | +int GetCharacterResultsCount() const |
| 80 | +``` |
| 81 | + |
| 82 | +**Return value** |
| 83 | + |
| 84 | +Returns an integer value representing the number of individual character recognition results. |
| 85 | + |
| 86 | +### GetCharacterResult |
| 87 | + |
| 88 | +Gets the character recognition result at the specified index. |
| 89 | + |
| 90 | +```cpp |
| 91 | +const CCharacterResult* GetCharacterResult(int index) const |
| 92 | +``` |
| 93 | +
|
| 94 | +**Parameters** |
| 95 | +
|
| 96 | +`[in] index` The index of the character recognition result to retrieve. |
| 97 | +
|
| 98 | +**Return value** |
| 99 | +
|
| 100 | +Returns a pointer to the character recognition result. |
| 101 | +
|
| 102 | +### GetLocation |
| 103 | +
|
| 104 | +Gets the location of the text line. |
| 105 | +
|
| 106 | +```cpp |
| 107 | +CQuadrilateral GetLocation() const |
| 108 | +``` |
| 109 | + |
| 110 | +**Return value** |
| 111 | + |
| 112 | +Returns a CQuadrilateral object which represents the location of the text line. |
| 113 | + |
| 114 | +### GetRowNumber |
| 115 | + |
| 116 | +Gets the row number of the text line within the image. |
| 117 | + |
| 118 | +```cpp |
| 119 | +int GetRowNumber() const |
| 120 | +``` |
| 121 | + |
| 122 | +**Return value** |
| 123 | + |
| 124 | +Returns an integer value representing the row number of the text line within the image. |
| 125 | + |
| 126 | +### GetSpecificationName |
| 127 | + |
| 128 | +Gets the name of the text line specification that generated this element. |
| 129 | + |
| 130 | +```cpp |
| 131 | +const char* GetSpecificationName() const |
| 132 | +``` |
| 133 | + |
| 134 | +**Return value** |
| 135 | + |
| 136 | +Returns the name of the text line specification. |
| 137 | + |
| 138 | +### GetStatus |
| 139 | + |
| 140 | +Gets the status of the text line. |
| 141 | + |
| 142 | +```cpp |
| 143 | +RawTextLineStatus GetStatus() const |
| 144 | +``` |
| 145 | + |
| 146 | +**Return value** |
| 147 | + |
| 148 | +Returns the status of the text line. |
| 149 | + |
| 150 | +**See also** |
| 151 | + |
| 152 | +* [RawTextLineStatus](enum-raw-text-line-status.md) |
| 153 | + |
| 154 | +### SetText |
| 155 | + |
| 156 | +Sets the recognized text. |
| 157 | + |
| 158 | +```cpp |
| 159 | +void SetText(const char* text) |
| 160 | +``` |
| 161 | +
|
| 162 | +**Parameters** |
| 163 | +
|
| 164 | +`[in] text` The text to be set. |
| 165 | +
|
| 166 | +
|
| 167 | +### SetLocation |
| 168 | +
|
| 169 | +Set the location of the text line. |
| 170 | +
|
| 171 | +```cpp |
| 172 | +int SetLocation(const CQuadrilateral& location) |
| 173 | +``` |
| 174 | + |
| 175 | +**Parameters** |
| 176 | + |
| 177 | +`[in] location` The location of the text line. |
| 178 | + |
| 179 | +** Return value** |
| 180 | + |
| 181 | +Returns 0 if successful; otherwise returns an error code. |
| 182 | + |
| 183 | +### SetRowNumber |
| 184 | + |
| 185 | +Set the row number of the text line within the image. |
| 186 | + |
| 187 | +```cpp |
| 188 | +void SetRowNumber(int rowNumber) |
| 189 | +``` |
| 190 | +
|
| 191 | +**Parameters** |
| 192 | +
|
| 193 | +`[in] rowNumber` The row number of the text line within the image. |
| 194 | +
|
| 195 | +### SetSpecificationName |
| 196 | +
|
| 197 | +Sets the name of the text line specification that generated this element. |
| 198 | +
|
| 199 | +```cpp |
| 200 | +void SetSpecificationName(const char* specificationName) |
| 201 | +``` |
| 202 | + |
| 203 | +**Parameters** |
| 204 | + |
| 205 | +`[in] specificationName` The name of the text line specification. |
| 206 | + |
| 207 | +### Release |
| 208 | + |
| 209 | +Decreases the reference count of the CRawTextLine object. |
| 210 | + |
| 211 | +```cpp |
| 212 | +void Release() |
| 213 | +``` |
| 214 | + |
| 215 | +### Clone |
| 216 | + |
| 217 | +Clone the CRawTextLine object. |
| 218 | + |
| 219 | +```cpp |
| 220 | +CRawTextLine* Clone() const |
| 221 | +``` |
| 222 | + |
| 223 | +**Return value** |
| 224 | + |
| 225 | +Returns a pointer to the cloned CRawTextLine object. |
| 226 | + |
| 227 | +**Remarks** |
| 228 | + |
| 229 | +Don't forget to call `Release` after you have finished using the cloned CRawTextLine object. |
| 230 | + |
| 231 | +### SetCharacterResults |
| 232 | + |
| 233 | +Sets the character recognition results. |
| 234 | + |
| 235 | +```cpp |
| 236 | +int SetCharacterResults(const CCharacterResult* charArray, int charArrayLength) |
| 237 | +``` |
| 238 | +
|
| 239 | +**Parameters** |
| 240 | +
|
| 241 | +`[in] charArray` The character result array. |
| 242 | +
|
| 243 | +`[in] charArrayLength` The length of the character result array. |
| 244 | +
|
| 245 | +**Return value** |
| 246 | +
|
| 247 | +Returns 0 if successful; otherwise returns an error code. |
0 commit comments