new QualitySettings()

Example

//This sample shows how to use QualitySettings with BarCodeReader
let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
//set high performance mode
reader.setQualitySettings(QualitySettings.getHighPerformance());
reader.readBarCodes().forEach(function(result, i, results)
{
   console.log("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
//normal quality mode is set by default
reader.readBarCodes().forEach(function(result, i, results)
{
  console.log("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
//set high quality mode with low speed recognition
reader.setQualitySettings(QualitySettings.getHighQuality());
reader.readBarCodes().forEach(function(result, i, results)
{
  console.log("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
//set max barcodes mode, which tries to find all possible barcodes, even incorrect. The slowest recognition mode
reader.setQualitySettings(QualitySettings.getMaxBarCodes());
reader.readBarCodes().forEach(function(result, i, results)
{
  console.log("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
//set high performance mode
reader.setQualitySettings(QualitySettings.getHighPerformance());
//set separate options
reader.getQualitySettings().setAllowMedianSmoothing(true);
reader.getQualitySettings().setMedianSmoothingWindowSize(5);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
//default mode is NormalQuality
//set separate options
reader.getQualitySettings().setAllowMedianSmoothing(true);
reader.getQualitySettings().setMedianSmoothingWindowSize(5);
reader.readBarCodes().forEach(function(result, i, results)
{
  console.log("BarCode CodeText: " + result.getCodeText());
});

Methods

static

getHighPerformance()

HighPerformance recognition quality preset. High quality barcodes are recognized well in this mode.

Example

let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getHighPerformance());

 Value:
HighPerformance recognition quality preset.
static

getHighQuality()

HighQuality recognition quality preset. This preset is developed for low quality barcodes.

Example

let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getHighQuality());

 Value:
HighQuality recognition quality preset.
static

getHighQualityDetection()

HighQualityDetection recognition quality preset. Same as NormalQuality but with high quality DetectorSettings

Example

let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getHighQualityDetection());     *

 Value:
HighQualityDetection recognition quality preset.
static

getMaxBarCodes()

MaxBarCodes recognition quality preset. This preset is developed to recognize all possible barcodes, even incorrect barcodes.

Example

let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getMaxBarCodes());

 Value:
MaxBarCodes recognition quality preset.
static

getMaxQualityDetection()

MaxQualityDetection recognition quality preset. Same as NormalQuality but with highest quality DetectorSettings. Allows to detect diagonal and damaged barcodes.

Example

let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getMaxQualityDetection());

 Value:
MaxQualityDetection recognition quality preset.
static

getNormalQuality()

NormalQuality recognition quality preset. Suitable for the most of barcodes

Example

let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getNormalQuality());

 Value:
NormalQuality recognition quality preset.

applyAll(Src)

apply all values from Src setting to this

Parameter

Name Type Optional Description

Src

 

 

source settings

getAllowComplexBackground()

Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. Value: Allows engine to recognize color barcodes on color background.

getAllowDatamatrixIndustrialBarcodes()

Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. Value: Allows engine for Datamatrix to recognize dashed industrial barcodes.

getAllowDecreasedImage()

Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. Value: Allows engine to recognize decreased image

getAllowDetectScanGap()

Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. Value: Allows engine to use gap between scans to increase recognition speed.

getAllowIncorrectBarcodes()

Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. Value: Allows engine to recognize incorrect barcodes.

getAllowInvertImage()

Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. Value: Allows engine to recognize inverse color image.

getAllowMedianSmoothing()

Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. Value: Allows engine to enable median smoothing.

getAllowMicroWhiteSpotsRemoving()

Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize sligtly damaged Postal barcodes. Value: Allows engine for Postal barcodes to recognize slightly noised images.

getAllowOneDAdditionalScan()

Allows engine for 1D barcodes to recognize regular image with different params as additional scan. Mode helps to recongize low height 1D barcodes. Value: Allows engine for 1D barcodes to run additional scan.

getAllowOneDFastBarcodesDetector()

Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. Value: Allows engine for 1D barcodes to quickly recognize high quality barcodes.

getAllowOneDWipedBarsRestoration()

Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. Value: Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.

getAllowQRMicroQrRestoration()

Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. Value: Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.

getAllowRegularImage()

Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. Value: Allows to recognize regular image without any restorations.

getAllowSaltAndPaperFiltering()

Allows engine to recognize barcodes with salt and paper noise type. Mode can remove small noise with white and black dots. Value: Allows engine to recognize barcodes with salt and paper noise type.

getAllowWhiteSpotsRemoving()

Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. Value: Allows engine to recognize image without small white spots.

getCheckMore1DVariants()

Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False.

Returns

If True, allows engine to recognize 1D barcodes with checksum.

getDetectorSettings()

Barcode detector settings.

getFastScanOnly()

Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.

Returns

Allows engine for 1D barcodes to quickly recognize high quality barcodes.

getMedianSmoothingWindowSize()

Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. Value: Window size for median smoothing.

getReadTinyBarcodes()

Allows engine to recognize tiny barcodes on large images. Ignored if is set to True. Default value: False.

Returns

If True, allows engine to recognize tiny barcodes on large images.

getUseOldBarcodeDetector()

Switches to the old barcode detector.

Value: Switches to the old barcode detector.

setAllowComplexBackground()

Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. Value:v Allows engine to recognize color barcodes on color background.

setAllowDatamatrixIndustrialBarcodes()

Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. Value: Allows engine for Datamatrix to recognize dashed industrial barcodes.

setAllowDecreasedImage()

Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. Value: Allows engine to recognize decreased image

setAllowDetectScanGap()

Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. Value: Allows engine to use gap between scans to increase recognition speed.

setAllowIncorrectBarcodes()

Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. Value: Allows engine to recognize incorrect barcodes.

setAllowInvertImage()

Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. Value: Allows engine to recognize inverse color image.

setAllowMedianSmoothing()

Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. Value: Allows engine to enable median smoothing.

setAllowMicroWhiteSpotsRemoving()

Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize sligtly damaged Postal barcodes. Value: Allows engine for Postal barcodes to recognize slightly noised images.

setAllowOneDAdditionalScan()

Allows engine for 1D barcodes to recognize regular image with different params as additional scan. Mode helps to recongize low height 1D barcodes. Value: Allows engine for 1D barcodes to run additional scan.

setAllowOneDFastBarcodesDetector()

Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. Value: Allows engine for 1D barcodes to quickly recognize high quality barcodes.

setAllowOneDWipedBarsRestoration()

Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. Value: Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.

setAllowQRMicroQrRestoration()

Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. Value: Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.

setAllowRegularImage()

Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. Value: Allows to recognize regular image without any restorations.

setAllowSaltAndPaperFiltering()

Allows engine to recognize barcodes with salt and paper noise type. Mode can remove small noise with white and black dots. Value: Allows engine to recognize barcodes with salt and paper noise type.

setAllowWhiteSpotsRemoving()

Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. Value: Allows engine to recognize image without small white spots.

setCheckMore1DVariants(value)

Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False.

Parameter

Name Type Optional Description

value

 

 

If True, allows engine to recognize 1D barcodes with checksum.

setDetectorSettings()

Barcode detector settings.

setFastScanOnly(value)

Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.

Parameter

Name Type Optional Description

value

 

 

Allows engine for 1D barcodes to quickly recognize high quality barcodes.

setMedianSmoothingWindowSize()

Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. Value: Window size for median smoothing.

setReadTinyBarcodes(value)

Allows engine to recognize tiny barcodes on large images. Ignored if is set to True. Default value: False.

Parameter

Name Type Optional Description

value

 

 

If True, allows engine to recognize tiny barcodes on large images.

setUseOldBarcodeDetector()

Switches to the old barcode detector.

Value: Switches to the old barcode detector.