Skip to content

Latest commit

 

History

History
179 lines (148 loc) · 5.7 KB

simplified-document-normalizer-settings.md

File metadata and controls

179 lines (148 loc) · 5.7 KB
layout title description keywords needGenerateH3Content needAutoGenerateSidebar noTitleIndex
default-layout
DSSimplifiedDocumentNormalizerSettings - Dynamsoft Document Normalizer module iOS Edition API Reference
The class DSSimplifiedDocumentNormalizerSettings of Dynamsoft Document Normalizer module represents the simplified document normalizer settings.
document normalizer settings, objective-c, swift
true
true
true

DSSimplifiedDocumentNormalizerSettings

The DSSimplifiedDocumentNormalizerSettings class represents a series of simple settings related to the Document Normalizer. Please note that this is not the full list of settings that can be utilized by the Document Normalizer, which you can find on the [Dynamsoft Document Normalizer Parameters]({{ site.parameters }}reference/index.html){:target="_blank"} page.

Definition

Assembly: DynamsoftDocumentNormalizer.xcframework

>- Objective-C >- Swift > >1. ```objc @interface DSSimplifiedDocumentNormalizerSettings: NSObject ``` 2. ```swift class SimplifiedDocumentNormalizerSettings: NSObject ```

Attributes

Attributes Type Description
grayscaleTransformationModes NSArray * An array of DSGrayscaleTransformationMode. It controls whether to detect the inverted document boundary.
grayscaleEnhancementModes NSArray * An array of DSGrayscaleEnhancementModes.
colourMode *DSImageColourMode * The grayscale transformation mode. It controls whether to decode the inverted text.
pageSize *CGSize * The page size.
brightness *NSInteger * The brightness.
contrast *NSInteger * The contrast.
maxThreadsInOneTask *NSInteger * The maximum number of threads in one task.
scaleDownThreshold *NSInteger * The scale down threshold.

grayscaleTransformationModes

Defines the grayscale transformation modes with an array of [DSGrayscaleTransformationMode]({{ site.dcv_enumerations }}core/grayscale-transformation-mode.html?lang=objc,swift) items. This parameter is important when working with inverted documents, and must be used in order to locate the inverted document boundary.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, nullable, copy) NSArray* grayscaleTransformationModes; ``` 2. ```swift var grayscaleTransformationModes: [NSNumber]? { get set } ```

grayscaleEnhancementModes

Defines the grayscale enhancement modes with an array of [DSGrayscaleEnhancementModes]({{ site.dcv_enumerations }}core/grayscale-enhancement-modes.html?lang=objc,swift) items. This parameter can be quite powerful in increasing the border detection rate of your application should you experience any trouble in that area. To learn more about the grayscaleEnhancementModes and how they can be used, please visit the main [GrayscaleEnhancementModes]({{ site.dcv_parameters }}reference/image-parameter/grayscale-enhancement-modes.html) parameter page.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, nullable, copy) NSArray* grayscaleEnhancementModes; ``` 2. ```swift var grayscaleEnhancementModes: [NSNumber]? { get set } ```

colourMode

Defines the colour mode (pixel type) of the normalized image with a [DSImageColourMode]({{ site.dcv_enumerations }}document-normalizer/image-colour-mode.html?lang=objc,swift) member. By default, the normalized image will output in colour. In order to make the result image grayscale or binary, setting the colourMode to the corresponding pixel type will do the trick.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, assign) DSImageColourMode colourMode; ``` 2. ```swift var colourMode: ImageColourMode { get set } ```

pageSize

Defines the page size of the normalized image with a CGSize{:target="_blank"} object.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, assign) CGSize pageSize; ``` 2. ```swift var pageSize: CGSize { get set } ```

brightness

Defines the brightness of the normalized image result with an integer.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, assign) NSInteger brightness; ``` 2. ```swift var brightness: Int { get set } ```

contrast

Defines the contrast of the normalized image result with an integer.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, assign) NSInteger contrast; ``` 2. ```swift var contrast: Int { get set } ```

maxThreadsInOneTask

Defines the maximum number of threads dedicated to a single task.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, assign) NSInteger maxThreadsInOneTask; ``` 2. ```swift var maxThreadsInOneTask: Int { get set } ```

scaleDownThreshold

If the original image size is quite large, then the scaledownThreshold can be used to shrink the image and speed up the processing. If the shorter edge size is larger than the defined scale down threshold, the library will calculate the required width and height of the image and shrink it to that size before moving forward in the process.

>- Objective-C >- Swift > >1. ```objc @property (nonatomic, assign) NSInteger scaleDownThreshold; ``` 2. ```swift var scaleDownThreshold: Int { get set } ```