Documentation
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
addRecognizedTextLine Adds a recognized text line.
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.
removeRecognizedTextLine Removes the recognized text line at the specified index.
setRecognizedTextLine(index, element, matrixToOriginalImage) Sets the recognized text line at the specified index.
setRecognizedTextLine(element, matrixToOriginalImage) Sets the recognized text line at the specified index.

AddRecognizedTextLine

Adds a recognized text line.

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

Parameters

element: The DSRecognizedTextLineElement object to be added.

matrixToOriginalImage: The matrix to transform the original image.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

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()
    

removeRecognizedTextLine

Removes the RecognizedTextLineElement at the specified index.

  • Objective-C
  • Swift
  1. -(NSInteger)removeRecognizedTextLine:(NSInteger)index;
    
  2. func removeRecognizedTextLine(_ index: Int) -> Int
    

Parameters

index: The index of the recognized text line to remove.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

setRecognizedTextLine(index, element, matrixToOriginalImage)

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

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

Parameters

index: The index of the recognized text line to set.

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.

setRecognizedTextLine(element, matrixToOriginalImage)

This method is deprecated.

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.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: