Skip to content

Latest commit

 

History

History
260 lines (209 loc) · 8.83 KB

simplified-barcode-reader-settings.md

File metadata and controls

260 lines (209 loc) · 8.83 KB
layout title description keywords needAutoGenerateSidebar needGenerateH3Content breadcrumbText permalink
default-layout
DSSimplifiedBarcodeReaderSettings Class - Dynamsoft Barcode Reader iOS Edition
DSSimplifiedBarcodeReaderSettings class contains settings for barcode decoding. It is a sub-parameter of DSSimplifiedCaptureVisionSettings
DSSimplifiedBarcodeReaderSettings, DSSimplifiedCaptureVisionSettings, inverted barcode, Deblur, localization, expected barcodes count, barcode format, confidence, RegEx pattern
true
true
DSSimplifiedBarcodeReaderSettings
/programming/objectivec-swift/api-reference/simplified-barcode-reader-settings.html

DSSimplifiedBarcodeReaderSettings

The DSSimplifiedBarcodeReaderSettings struct contains settings for barcode decoding. It is a sub-parameter of [DSSimplifiedCaptureVisionSettings]({{ site.dcv_ios_api }}capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.html).

Definition

Assembly: DynamsoftBarcodeReader.xcframework

>- Objective-C >- Swift > >1. ```objc NS_SWIFT_NAME(SimplifiedBarcodeReaderSettings) @interface DSSimplifiedBarcodeReaderSettings : NSObject ``` 2. ```swift class SimplifiedBarcodeReaderSettings : NSObject ```

Attributes

Attributes Type Description
barcodeFormatIds DSBarcodeFormat Input a combined value of BarcodeFormat to specify the targeting barcode formats.
expectedBarcodesCount NSInteger Set the expected barcode count. You can set it to 0 if the barcode count is unknown.
localizationModes NSArray Set the localization modes with an array of DSLocalizationMode.
deblurModes NSArray Set the deblur modes with an array of DSDeblurMode.
minResultConfidence NSInteger Set the minimum barcode result confidence to filter out the low confidence results.
minBarcodeTextLength NSInteger Set the minimum barcode result text length.
barcodeTextRegExPattern NSString Set a RegEx pattern for the barcode text.
maxThreadsInOneTask NSInteger Set the max available threads for one task.
grayscaleTransformationModes NSArray Set the grayscale transformation mode with an array of [DSGrayscaleTransformationMode]({{ site.dcv_enumerations }}core/grayscale-transformation-mode.html?lang=objc,swift). This parameter should be used when trying to decode inverted barcodes.
grayscaleEnhancementModes NSArray Set the grayscale enhancement mode with an array of DSGrayscaleEnhancementModes.
scaleDownThreshold NSInteger Set the threshold for image shrinking.

barcodeFormatIds

Input a combined value of enumeration BarcodeFormat to specify the targeted barcode formats.

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

expectedBarcodesCount

Set the expected barcode count. You can set it to 0 if the barcode count is unknown.

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

Remarks

  • 0: detects at least one barcode.
  • N ( N > 0 ): detects N barcodes.
  • Dynamsoft Barcode Reader works in a loop trying different parameters to reach the number of expected barcodes specified by this parameter. If ExpectedBarcodesCount is 0, the loop stops after at least one barcode is found in an iteration. If ExpectedBarcodesCount is N, the loop stops once N barcodes are detected.

localizationModes

Determines how to localize barcodes. The array consists of one or more modes, with each LocalizationMode representing a different localization process.

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

Remarks

Some of the localization modes are specially optimized for certain barcode formats. For example, statistic marks for DPM barcodes and statistic postal code for postal code. If you want to further improve the read rate of certain barcodes, you can read the parameter reference of LocalizationModes for more information.

deblurModes

Sets the priority for which deblurring algorithms the library will employ when dealing with blurry images. This array consists of DeblurMode items.

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

minResultConfidence

Set the minimum barcode result confidence to filter out low confidence results. This parameter helps the library return only the most accurate results.

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

Remarks

The default minresultConfidence value is 30.

minBarcodeTextLength

Sets the minimum text length of the barcode results that the library will share. Any results that do not meet this text length will be discarded by the library.

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

barcodeTextRegExPattern

Set a RegEx pattern for the barcode text. Any barcode results that don't follow this RegEx pattern will be discarded by the library.

>- Objective-C >- Swift > >1. ```objc @property(nonatomic, nullable, copy) NSString *barcodeTextRegExPattern; ``` 2. ```swift var barcodeTextRegExPattern: String? { get set } ```

maxThreadsInOneTask

Set the maximum available threads for a single task.

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

grayscaleTransformationModes

Sets which grayscale transformation mode(s) the library will employ when reading barcodes. This parameter controls the library's ability to read inverted barcodes. The array consists of GrayscaleTransformationMode items.

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

Remarks

To learn more about reading inverted barcodes, please view how to read inverted barcodes article

grayscaleEnhancementModes

Sets which grayscale enhancement mode(s) the library will use when reading barcodes. The array consists of GrayscaleEnhancementModes.

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

Remarks

This parameter can be quite powerful if used properly. To learn more about this parameter and how it can be used, please see this page on how to preprocess images.

scaleDownThreshold

Set the threshold for image shrinking when dealing with large images to help with the memory overhead. If both the width and height are larger then the threshold, the image is shrinked by half.

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

Remarks

If you would like to learn more on how this parameter works, please see this page on how to read barcodes from large images.