Table of contents

DSRecognizedTextLinesUnit

The DSRecognizedTextLinesUnit class represents an intermediate result unit containing recognized text lines. It inherits from the DSIntermediateResultUnit class.

Definition

Assembly: DynamsoftLabelRecognizer.xcframework

  • Objective-C
  • Swift
  1. @interface DSRecognizedTextLinesUnit: DSIntermediateResultUnit
    
  2. class RecognizedTextLinesUnit: IntermediateResultUnit
    

Inheritance: DSIntermediateResultUnit -> DSRecognizedTextLinesUnit

Methods

Method Description
getRecognizedTextLines Get all the recognized text lines in an array of DSRecognizedTextLineElement.
getCount Returns the number of text lines in this unit.
getRecognizedTextLine Returns the text line at the specified index in a DSRecognizedTextLineElement object.
removeAllRecognizedTextLines Removes all the recognized text lines from this unit.
setRecognizedTextLine Sets the text line at the specified index.

recognizedTextLines

All the recognized text lines of this unit in an array of DSRecognizedTextLineElement.

  • Objective-C
  • Swift
  1. @property (nonatomic, nullable, copy) NSArray<DSRecognizedTextLineElement*>* recognizedTextLines;
    
  2. var recognizedTextLines: [RecognizedTextLineElement]? { get }
    

getRecognizedTextLines

Gets all the recognized text lines in an array of DSRecognizedTextLineElement.

  • Objective-C
  • Swift
  1. - (NSArray<DSRecognizedTextLineElement*>*)getRecognizedTextLines;
    
  2. func getRecognizedTextLines() -> [RecognizedTextLineElement]?
    

Return value

All the recognized text lines in an array of DSRecognizedTextLineElement.

getCount

Returns the number of text lines in this unit.

  • Objective-C
  • Swift
  1. - (NSInteger)getCount;
    
  2. func getCount() -> Int
    

Return value

The number of text lines in this unit.

getRecognizedTextLine

Returns the text line at the specified index in a DSRecognizedTextLineElement object.

  • Objective-C
  • Swift
  1. - (nullable DSRecognizedTextLineElement*)getRecognizedTextLine:(NSInteger)index;
    
  2. func getRecognizedTextLine(_ index: Int) -> RecognizedTextLineElement?
    

Parameters

index: The index of the text line in this unit.

Return value

The text line at the specified index in a DSRecognizedTextLineElement object.

removeAllRecognizedTextLines

Removes all the recognized text lines from this unit.

  • Objective-C
  • Swift
  1. - (void)removeAllRecognizedTextLines;
    
  2. func removeAllRecognizedTextLines()
    

setRecognizedTextLine

Sets the text line at the specified index in a DSRecognizedTextLineElement object.

  • Objective-C
  • Swift
  1. - (NSInteger)setRecognizedTextLine:(DSRecognizedTextLineElement*)element
    matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
    
  2. func setRecognizedTextLine(_ element: RecognizedTextLineElement, matrixToOriginalImage: CGAffineTransform) -> Int
    

Parameters

element: The DSRecognizedTextLineElement object to be set.

matrixToOriginalImage: The matrix to transform the original image.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.