layout | title | description | keywords | needGenerateH3Content | needAutoGenerateSidebar | noTitleIndex |
---|---|---|---|---|---|---|
default-layout |
DSPredetectedRegionsUnit - Dynamsoft Core Module iOS Edition API Reference |
The class DSPredetectedRegionsUnit of Dynamsoft Core Module represents a unit that contains a collection of pre-detected regions. |
pre-detected regions, objective-c, swift |
true |
true |
true |
The DSPredetectedRegionsUnit
class extends the DSIntermediateResultUnit
class and represents a unit of intermediate result specifically for pre-detected regions.
Assembly: DynamsoftCore.framework
>- Objective-C >- Swift > >1. ```objc @interface DSPredetectedRegionsUnit: DSIntermediateResultUnit ``` 2. ```swift class PredetectedRegionsUnit: IntermediateResultUnit ```Method | Description |
---|---|
getPredetectedRegions |
Gets an array of [DSPredetectedRegionElement ]({{ site.dcv_ios_api }}core/intermediate-results/predetected-region-element.html) 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. |
The following methods are inherited from class [DSIntermediateResultUnit
]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html).
Method | Description |
---|---|
[getHashId ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#gethashid) |
Gets the hash ID of the unit. The hash ID is the unique identifier for the intermediate result unit. |
[getOriginalImageHashId ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#getoriginalimagehashid) |
Gets the hash ID of the original image associated with this unit. |
[getOriginalImageTag ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#getoriginalimagetag) |
Gets the tag associated with the original image. |
[getType ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#gettype) |
Gets the type of the intermediate result unit, defined by the enumeration [IntermediateResultUnitType ]({{ site.dcv_enumerations }}core/intermediate-result-unit-type.html?lang=objc,swift). |
[getTransformMatrix ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#gettransformmatrix) |
Gets the transformation matrix via DSTransformMatrixType . |
[clone ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#clone) |
Creates a copy of the intermediate result unit. |
[replace ]({{ site.dcv_ios_api }}core/intermediate-results/intermediate-result-unit.html#replace) |
Replaces the content of the intermediate result unit. |
Get an array of [DSPredetectedRegionElement
]({{ site.dcv_ios_api }}core/intermediate-results/predetected-region-element.html) objects, each representing a pre-detected region detected within the image.
Return Value
An array of DSPredetectedRegionElement
objects that indicates the pre-detected regions.
Returns the number of pre-detected regions.
>- Objective-C >- Swift > >1. ```objc -(NSInteger)getCount; ``` 2. ```swift func getCount() -> Int ```Return Value
Returns the number of pre-detected regions.
Returns a pre-detected region.
>- Objective-C >- Swift > >1. ```objc -(nullable DSPredetectedRegionElement*)getPredetectedRegion:(NSInteger)index; ``` 2. ```swift 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.
Removes all pre-detected regions.
>- Objective-C >- Swift > >1. ```objc -(void)removeAllPredectedRegions; ``` 2. ```swift func removeAllPredectedRegions() ```Removes the pre-detected region at the specified index.
>- Objective-C >- Swift > >1. ```objc -(NSInteger)removePredetectedRegion:(NSInteger)index; ``` 2. ```swift 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.
Adds a pre-detected region.
>- Objective-C >- Swift > >1. ```objc -(NSInteger)addPredetectedRegion:(DSPredetectedRegionElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage; ``` 2. ```swift 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.
Sets a pre-detected region.
>- Objective-C >- Swift > >1. ```objc -(NSInteger)setPredetectedRegion:(NSInteger)index element:(DSPredetectedRegionElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage; ``` 2. ```swift 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.