Constructor
new QualitySettings()
- Source:
Examples
//This sample shows how to use QualitySettings with BarCodeReader
let reader = new BarCodeReader("test.png", null, [ DecodeType.CODE_39, 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, 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, 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, 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, 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, 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
getAllowIncorrectBarcodes()
Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text.
Returns:
Type | Description |
---|---|
Allows engine to recognize incorrect barcodes. |
- Source:
getBarcodeQuality()
Returns:
Type | Description |
---|---|
Mode which enables methods to recognize barcode elements with the selected quality. |
- Source:
getComplexBackground()
Returns:
Type | Description |
---|---|
Additional recognition of color barcodes on color images. |
- Source:
getDeconvolution()
Deconvolution (image restorations) mode which defines level of image degradation. Originally deconvolution is a function which can restore image degraded (convoluted) by any natural function like blur, during obtaining image by camera. Because we cannot detect image function which corrupt the image, we have to check most well know functions like sharp or mathematical morphology.
Returns:
Type | Description |
---|---|
Deconvolution mode which defines level of image degradation. |
- Source:
getInverseImage()
Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance).
Returns:
Type | Description |
---|---|
Additional recognition of barcodes on images with inverse colors |
- Source:
getMinimalXDimension()
Returns:
Type | Description |
---|---|
Minimal size of XDimension in pixels which is used with UseMinimalXDimension. |
- Source:
getXDimension()
Returns:
Type | Description |
---|---|
size (from 1 to infinity) of barcode minimal element: matrix cell or bar. |
- Source:
setAllowIncorrectBarcodes(value)
Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text.
Parameters:
Name | Type | Description |
---|---|---|
value |
Allows engine to recognize incorrect barcodes. |
- Source:
setBarcodeQuality(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
Mode which enables methods to recognize barcode elements with the selected quality. |
- Source:
setComplexBackground(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
Additional recognition of color barcodes on color images. |
- Source:
setDeconvolution(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
Deconvolution mode which defines level of image degradation. |
- Source:
setInverseImage(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
Additional recognition of barcodes on images with inverse colors |
- Source:
setMinimalXDimension(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
Minimal size of XDimension in pixels which is used with UseMinimalXDimension. |
- Source:
setXDimension(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
(from 1 to infinity) of barcode minimal element: matrix cell or bar. |
- Source:
(static) getHighPerformance()
- Source:
Example
let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getHighPerformance());
(static) getHighQuality()
- Source:
Example
let reader = new BarCodeReader("test.png");
reader.setQualitySettings(QualitySettings.getHighQuality());
(static) getMaxQuality()
MaxQuality recognition quality preset. This preset is developed to recognize all possible barcodes, even incorrect barcodes.
Value: MaxQuality recognition quality preset.This sample shows how to use MaxQuality modereader = new BarCodeReader("test.png"null, null, DecodeType.CODE_39_FULL_ASCII, DecodeType.CODE_128); { reader.setQualitySettings(QualitySettings.getMaxQuality()); for(let i = 0; i < reader.readBarCodes().length; i++) echo (reader.getFoundBarcodes()[i].getCodeText()); }
- Source:
(static) getNormalQuality()
- Source: