DSShortLinesUnit
The DSShortLinesUnit class extends the DSIntermediateResultUnit class and represents a unit of intermediate result specifically for short lines.
Definition
Assembly: DynamsoftCaptureVisionBundle.xcframework
- Objective-C
- Swift
@interface DSShortLinesUnit: DSIntermediateResultUnitclass ShortLinesUnit: IntermediateResultUnit
Methods
| Method | Description |
|---|---|
getShortLines |
Gets an array of DSLineSegment objects, each representing a short line detected within the image. |
getCount |
Returns the number of short lines in this unit. |
getShortLine |
Returns the short line at the specified index. |
removeAllShortLines |
Removes all the short lines in this unit. |
removeShortLine |
Removes the short line at the specified index. |
addShortLine |
Adds a short line to this unit. |
setShortLine |
Sets the short line at the specified index. |
Inherited Methods
The following methods are inherited from class IntermediateResultUnit.
| Method | Description |
|---|---|
getHashId |
Gets the hash ID of the unit. The hash ID is the unique identifier for the intermediate result unit. |
getOriginalImageHashId |
Gets the hash ID of the original image associated with this unit. |
getOriginalImageTag |
Gets the tag associated with the original image. |
getType |
Gets the type of the intermediate result unit, defined by the enumeration IntermediateResultUnitType. |
getTransformMatrix |
Gets the transformation matrix via DSTransformMatrixType. |
clone |
Creates a copy of the intermediate result unit. |
replace |
Replaces the content of the intermediate result unit. |
getShortLines
Gets an array of DSLineSegment objects, each representing a short line detected within the image.
- Objective-C
- Swift
-(nullable NSArray<DSLineSegment*>*)getShortLines;func getShortLines() -> [LineSegment]?
Return Value
An array of DSLineSegment objects.
getCount
Returns the number of short lines in this unit.
- Objective-C
- Swift
-(NSInteger)getCount;func getCount() -> Int
Return Value
NSInteger as the number of short lines in this unit.
getShortLine
Returns the short line at the specified index.
- Objective-C
- Swift
-(nullable DSLineSegment *)getShortLine:(NSInteger)index;func getShortLine(_ index: Int) -> LineSegment?
Parameters
index: The index of the short line.
Return Value
A DSLineSegment object as the short line at the specified index.
removeAllShortLines
Removes all the short lines in this unit.
- Objective-C
- Swift
-(void)removeAllShortLines;func removeAllShortLines()
removeShortLine
Removes the short line at the specified index.
- Objective-C
- Swift
-(void)removeShortLine:(NSInteger)index;func removeShortLine(_ index: Int)
Parameters
index: The index of the short line.
addShortLine
Adds a short line to this unit.
- Objective-C
- Swift
-(NSInteger)addShortLine:(DSLineSegment*)line matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;func addShortLine(_ line: LineSegment, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
line: A DSLineSegment object as the short line to be added.
matrixToOriginalImage: A CGAffineTransform object as the transformation matrix from the original image to the image in this unit.
Return Value
Returns the ErrorCode if failed. Otherwise, returns 0.
setShortLine
Sets the short line at the specified index.
- Objective-C
- Swift
-(NSInteger)setShortLine:(NSInteger)index line:(DSLineSegment*)line matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;func setShortLine(_ index: Int, line: LineSegment, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
index: The index of the short line.
line: A DSLineSegment object as the short line to be set.
matrixToOriginalImage: A CGAffineTransform object as the transformation matrix from the original image to the image in this unit.
Return Value
Returns the ErrorCode if failed. Otherwise, returns 0.