DSPredetectedRegionsUnit
The DSPredetectedRegionsUnit
class extends the DSIntermediateResultUnit
class and represents a unit of intermediate result specifically for pre-detected regions.
Definition
Assembly: DynamsoftCore.xcframework
- Objective-C
- Swift
@interface DSPredetectedRegionsUnit: DSIntermediateResultUnit
class PredetectedRegionsUnit: IntermediateResultUnit
Methods
Method | Description |
---|---|
getPredetectedRegions |
Gets an array of DSPredetectedRegionElement objects, each representing a pre-detected region detected within the image. |
getCount |
Returns the number of pre-detected regions. |
getPredetectedRegion |
Returns a pre-detected region. |
removeAllPredectedRegions |
Removes all pre-detected regions. |
removePredetectedRegion |
Removes the pre-detected region at the specified index. |
addPredetectedRegion |
Adds a pre-detected region. |
setPredetectedRegion |
Sets a pre-detected region. |
Inherited Methods
The following methods are inherited from class DSIntermediateResultUnit
.
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. |
getPredetectedRegions
Get an array of DSPredetectedRegionElement
objects, each representing a pre-detected region detected within the image.
- Objective-C
- Swift
-(nullable NSArray<DSPredetectedRegionElement*>*)getPredetectedRegions;
func getPredetectedRegions() -> [PredetectedRegionElement]?
Return Value
An array of DSPredetectedRegionElement
objects that indicates the pre-detected regions.
getCount
Returns the number of pre-detected regions.
- Objective-C
- Swift
-(NSInteger)getCount;
func getCount() -> Int
Return Value
Returns the number of pre-detected regions.
getPredetectedRegion
Returns a pre-detected region.
- Objective-C
- Swift
-(nullable DSPredetectedRegionElement*)getPredetectedRegion:(NSInteger)index;
func getPredetectedRegion(_ index: Int) -> PredetectedRegionElement?
Parameters
index
: Specify the index of the pre-detected region.
Return Value
Returns the pre-detected region at the specified index.
removeAllPredectedRegions
Removes all pre-detected regions.
- Objective-C
- Swift
-(void)removeAllPredectedRegions;
func removeAllPredectedRegions()
removePredetectedRegion
Removes the pre-detected region at the specified index.
- Objective-C
- Swift
-(NSInteger)removePredetectedRegion:(NSInteger)index;
func removePredetectedRegion(_ index: Int) -> Int
Parameters
index
: Specify the index of the pre-detected region.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.
addPredetectedRegion
Adds a pre-detected region.
- Objective-C
- Swift
-(NSInteger)addPredetectedRegion:(DSPredetectedRegionElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func addPredetectedRegion(_ element: PredetectedRegionElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
element
: A DSPredetectedRegionElement
object that indicates the pre-detected region.
matrixToOriginalImage
: A CGAffineTransform
object that indicates the transformation matrix from the original image to the pre-detected region.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.
setPredetectedRegion
Sets a pre-detected region.
- Objective-C
- Swift
-(NSInteger)setPredetectedRegion:(NSInteger)index element:(DSPredetectedRegionElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func setPredetectedRegion(_ index: Int, element: PredetectedRegionElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
index
: Specify the index of the pre-detected region.
element
: A DSPredetectedRegionElement
object that indicates the pre-detected region.
matrixToOriginalImage
: A CGAffineTransform
object that indicates the transformation matrix from the original image to the pre-detected region.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.