DSDetectedQuadsUnit
The DSDetectedQuadsUnit
class represents an intermediate result unit whose type is detected quads. It is inherited from the DSIntermediateResultUnit
class.
Definition
Assembly: DynamsoftDocumentNormalizer.xcframework
- Objective-C
- Swift
@interface DSDetectedQuadsUnit : DSIntermediateResultUnit
class DetectedQuadsUnit : IntermediateResultUnit
Methods
Methods | Description |
---|---|
getDetectedQuads |
Get an array of DSDetectedQuadElement that represent all the detected quadrilaterals. |
getCount |
Get the number of detected quadrilaterals. |
getDetectedQuad |
Get the DSDetectedQuadElement at the specified index. |
removeAllDetectedQuads |
Remove all detected quadrilaterals. |
removeDetectedQuad |
Remove the DSDetectedQuadElement at the specified index. |
addDetectedQuad |
Add a new DSDetectedQuadElement to the unit. |
setDetectedQuad |
Set the DSDetectedQuadElement at the specified index. |
The following methods are inherited from class DSIntermediateResultUnit
.
Method | Description |
---|---|
getHashId |
Returns the hash ID of the unit. |
getOriginalImageHashId |
Returns the hash ID of the original image. |
getOriginalImageTag |
Returns the image tag of the original image. |
getType |
Returns the type of the intermediate result unit. |
getTransformMatrix |
Returns the transformation matrix via DSTransformMatrixType . |
clone |
Creates a copy of the intermediate result unit. |
replace |
Replaces the content of the intermediate result unit. |
getDetectedQuads
Get an array of DSDetectedQuadElement
that represent all the detected quadrilaterals.
- Objective-C
- Swift
-(nullable NSArray<DSDetectedQuadElement*>*)getDetectedQuads;
func getDetectedQuads() -> [DetectedQuadElement]?
Return Value
An array of DSDetectedQuadElement
that represent all the detected quadrilaterals.
getCount
Get the number of detected quadrilaterals.
- Objective-C
- Swift
-(NSInteger)getCount;
func getCount() -> Int
Return Value
The number of detected quadrilaterals.
getDetectedQuad
Get the DSDetectedQuadElement
at the specified index.
- Objective-C
- Swift
-(nullable DSDetectedQuadElement*)getDetectedQuad:(NSInteger)index;
func getDetectedQuad(index: Int) -> DetectedQuadElement?
Parameters
[in] index
: The index of the detected quadrilateral.
Return Value
The DSDetectedQuadElement
object at the specified index. If the index is out of range, nil
will be returned.
removeAllDetectedQuads
Remove all detected quadrilaterals.
- Objective-C
- Swift
-(void)removeAllDetectedQuads;
func removeAllDetectedQuads()
removeDetectedQuad
Remove the DSDetectedQuadElement
at the specified index.
- Objective-C
- Swift
-(NSInteger)removeDetectedQuad:(NSInteger)index;
func removeDetectedQuad(_ index: Int) -> Int
Parameters
[in] index
: The index of the detected quadrilateral.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.
addDetectedQuad
Add a new DSDetectedQuadElement
to the unit.
- Objective-C
- Swift
-(NSInteger)addDetectedQuad:(DSDetectedQuadElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func addDetectedQuad(_ element: DetectedQuadElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
[in] element
: The detected quadrilateral to be added.
[in] matrixToOriginalImage
: The matrix to the original image.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.
setDetectedQuad
Set the DSDetectedQuadElement
at the specified index.
- Objective-C
- Swift
-(NSInteger)setDetectedQuad:(NSInteger)index element:(DSDetectedQuadElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func setDetectedQuad(_ index: Int, element: DetectedQuadElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
[in] index
: The index of the detected quadrilateral.
[in] element
: The detected quadrilateral to be set.
[in] matrixToOriginalImage
: The matrix to the original image.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.