QualitySettings

Inheritance: java.lang.Object

public final class QualitySettings

QualitySettings allows to configure recognition quality and speed manually. You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of QualitySettings is NormalQuality.


This sample shows how to use QualitySettings with BarCodeReader
 
 BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
 //set high performance mode
 reader.setQualitySettings(QualitySettings.getHighPerformance());
 for(BarCodeResult result : reader.readBarCodes())
    System.out.println("BarCode CodeText: " + result.getCodeText());
 BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
 //normal quality mode is set by default
 for(BarCodeResult result : reader.readBarCodes())
   System.out.println("BarCode CodeText: " + result.getCodeText());
 BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
 //set high quality mode with low speed recognition
 reader.setQualitySettings(QualitySettings.getHighQuality());
 for(BarCodeResult result : reader.readBarCodes())
   System.out.println("BarCode CodeText: " + result.getCodeText());
 BarCodeReader reader = new BarCodeReader("c:\\test.png", 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());
 for(BarCodeResult result : reader.readBarCodes())
   System.out.println("BarCode CodeText: " + result.getCodeText());
 BarCodeReader reader = new BarCodeReader("c:\\test.png", 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);
 for(BarCodeResult result : reader.readBarCodes())
       System.out.println("BarCode CodeText: " + result.getCodeText());
 BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
 //default mode is NormalQuality
 //set separate options
 reader.getQualitySettings().setAllowMedianSmoothing(true);
 reader.getQualitySettings().setMedianSmoothingWindowSize(5);
 for(BarCodeResult result : reader.readBarCodes())
   System.out.println("BarCode CodeText: " + result.getCodeText());

Constructors

ConstructorDescription
QualitySettings()QualitySettings constructor
QualitySettings(QualitySettings Settings)QualitySettings copy constructor

Methods

MethodDescription
applyAll(QualitySettings Src)Function apply all values from Src setting to this
equals(Object arg0)
getAllowComplexBackground()Allows engine to recognize color barcodes on color background as additional scan.
getAllowDatamatrixIndustrialBarcodes()Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes.
getAllowDecreasedImage()Allows engine to recognize decreased image as additional scan.
getAllowDetectScanGap()Allows engine to use gap between scans to increase recognition speed.
getAllowIncorrectBarcodes()Allows engine to recognize barcodes which has incorrect checksumm or incorrect values.
getAllowInvertImage()Allows engine to recognize inverse color image as additional scan.
getAllowMedianSmoothing()Allows engine to enable median smoothing as additional scan.
getAllowMicroWhiteSpotsRemoving()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.
getAllowOneDFastBarcodesDetector()Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image.
getAllowOneDWipedBarsRestoration()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.
getAllowRegularImage()Allows engine to recognize regular image without any restorations as main scan.
getAllowSaltAndPaperFiltering()Allows engine to recognize barcodes with salt and paper noise type.
getAllowWhiteSpotsRemoving()Allows engine to recognize image without small white spots as additional scan.
getCheckMore1DVariants()Allows engine to recognize 1D barcodes with checksum by checking more recognition variants.
getClass()
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.
getHighPerformance()HighPerformance recognition quality preset.
getHighQuality()HighQuality recognition quality preset.
getHighQualityDetection()HighQualityDetection recognition quality preset.
getMaxBarCodes()MaxBarCodes recognition quality preset.
getMaxQualityDetection()MaxQualityDetection recognition quality preset.
getMedianSmoothingWindowSize()Window size for median smoothing.
getNormalQuality()NormalQuality recognition quality preset.
getReadTinyBarcodes()Allows engine to recognize tiny barcodes on large images.
getUseOldBarcodeDetector()Switches to the old barcode detector.
hashCode()
notify()
notifyAll()
setAllowComplexBackground(boolean value)Allows engine to recognize color barcodes on color background as additional scan.
setAllowDatamatrixIndustrialBarcodes(boolean value)Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes.
setAllowDecreasedImage(boolean value)Allows engine to recognize decreased image as additional scan.
setAllowDetectScanGap(boolean value)Allows engine to use gap between scans to increase recognition speed.
setAllowIncorrectBarcodes(boolean value)Allows engine to recognize barcodes which has incorrect checksumm or incorrect values.
setAllowInvertImage(boolean value)Allows engine to recognize inverse color image as additional scan.
setAllowMedianSmoothing(boolean value)Allows engine to enable median smoothing as additional scan.
setAllowMicroWhiteSpotsRemoving(boolean value)Allows engine for Postal barcodes to recognize slightly noised images.
setAllowOneDAdditionalScan(boolean value)Allows engine for 1D barcodes to recognize regular image with different params as additional scan.
setAllowOneDFastBarcodesDetector(boolean value)Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image.
setAllowOneDWipedBarsRestoration(boolean value)Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.
setAllowQRMicroQrRestoration(boolean value)Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.
setAllowRegularImage(boolean value)Allows engine to recognize regular image without any restorations as main scan.
setAllowSaltAndPaperFiltering(boolean value)Allows engine to recognize barcodes with salt and paper noise type.
setAllowWhiteSpotsRemoving(boolean value)Allows engine to recognize image without small white spots as additional scan.
setCheckMore1DVariants(boolean value)Allows engine to recognize 1D barcodes with checksum by checking more recognition variants.
setDetectorSettings(BarcodeSvmDetectorSettings value)Barcode detector settings.
setFastScanOnly(boolean value)Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.
setMedianSmoothingWindowSize(int value)Window size for median smoothing.
setReadTinyBarcodes(boolean value)Allows engine to recognize tiny barcodes on large images.
setUseOldBarcodeDetector(boolean value)Switches to the old barcode detector.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

QualitySettings()

public QualitySettings()

QualitySettings constructor

QualitySettings(QualitySettings Settings)

public QualitySettings(QualitySettings Settings)

QualitySettings copy constructor

Parameters:

ParameterTypeDescription
SettingsQualitySettingsThe source of the data

applyAll(QualitySettings Src)

public void applyAll(QualitySettings Src)

Function apply all values from Src setting to this

Parameters:

ParameterTypeDescription
SrcQualitySettingssource settings

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAllowComplexBackground()

public boolean 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.

Returns: boolean

getAllowDatamatrixIndustrialBarcodes()

public boolean 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.

Returns: boolean

getAllowDecreasedImage()

public boolean 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

Returns: boolean

getAllowDetectScanGap()

public boolean 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.

Returns: boolean

getAllowIncorrectBarcodes()

public boolean 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.

Returns: boolean

getAllowInvertImage()

public boolean 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.

Returns: boolean

getAllowMedianSmoothing()

public boolean getAllowMedianSmoothing()

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

Value: Allows engine to enable median smoothing.

Returns: boolean

getAllowMicroWhiteSpotsRemoving()

public boolean 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.

Returns: boolean

getAllowOneDAdditionalScan()

public boolean 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.

Returns: boolean

getAllowOneDFastBarcodesDetector()

public boolean 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.

Returns: boolean

getAllowOneDWipedBarsRestoration()

public boolean 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.

Returns: boolean

getAllowQRMicroQrRestoration()

public boolean getAllowQRMicroQrRestoration()

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

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

Returns: boolean

getAllowRegularImage()

public boolean 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.

Returns: boolean

getAllowSaltAndPaperFiltering()

public boolean 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.

Returns: boolean

getAllowWhiteSpotsRemoving()

public boolean 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.

Returns: boolean

getCheckMore1DVariants()

public boolean getCheckMore1DVariants()

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

Returns: boolean - If True, allows engine to recognize 1D barcodes with checksum.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDetectorSettings()

public BarcodeSvmDetectorSettings getDetectorSettings()

Barcode detector settings.

Returns: BarcodeSvmDetectorSettings

getFastScanOnly()

public boolean getFastScanOnly()

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

Returns: boolean - Allows engine for 1D barcodes to quickly recognize high quality barcodes.

getHighPerformance()

public static QualitySettings getHighPerformance()

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

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

Value: HighPerformance recognition quality preset.

Returns: QualitySettings

getHighQuality()

public static QualitySettings getHighQuality()

HighQuality recognition quality preset. This preset is developed for low quality barcodes. Allows to detect diagonal and highly damaged barcodes.

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

Value: HighQuality recognition quality preset.

Returns: QualitySettings

getHighQualityDetection()

public static QualitySettings getHighQualityDetection()

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

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

Value: HighQualityDetection recognition quality preset.

Returns: QualitySettings

getMaxBarCodes()

public static QualitySettings getMaxBarCodes()

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

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

Value: MaxBarCodes recognition quality preset.

Returns: QualitySettings

getMaxQualityDetection()

public static QualitySettings getMaxQualityDetection()

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

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

Value: MaxQualityDetection recognition quality preset.

Returns: QualitySettings

getMedianSmoothingWindowSize()

public int 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.

Returns: int

getNormalQuality()

public static QualitySettings getNormalQuality()

NormalQuality recognition quality preset. Suitable for the most of barcodes

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

Value: NormalQuality recognition quality preset.

Returns: QualitySettings

getReadTinyBarcodes()

public boolean getReadTinyBarcodes()

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

Returns: boolean - If True, allows engine to recognize tiny barcodes on large images.

getUseOldBarcodeDetector()

public boolean getUseOldBarcodeDetector()

Switches to the old barcode detector.

Value: Switches to the old barcode detector.

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAllowComplexBackground(boolean value)

public void setAllowComplexBackground(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowDatamatrixIndustrialBarcodes(boolean value)

public void setAllowDatamatrixIndustrialBarcodes(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowDecreasedImage(boolean value)

public void setAllowDecreasedImage(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setAllowDetectScanGap(boolean value)

public void setAllowDetectScanGap(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowIncorrectBarcodes(boolean value)

public void setAllowIncorrectBarcodes(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowInvertImage(boolean value)

public void setAllowInvertImage(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowMedianSmoothing(boolean value)

public void setAllowMedianSmoothing(boolean value)

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

Value: Allows engine to enable median smoothing.

Parameters:

ParameterTypeDescription
valueboolean

setAllowMicroWhiteSpotsRemoving(boolean value)

public void setAllowMicroWhiteSpotsRemoving(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowOneDAdditionalScan(boolean value)

public void setAllowOneDAdditionalScan(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowOneDFastBarcodesDetector(boolean value)

public void setAllowOneDFastBarcodesDetector(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowOneDWipedBarsRestoration(boolean value)

public void setAllowOneDWipedBarsRestoration(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowQRMicroQrRestoration(boolean value)

public void setAllowQRMicroQrRestoration(boolean value)

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

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

Parameters:

ParameterTypeDescription
valueboolean

setAllowRegularImage(boolean value)

public void setAllowRegularImage(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowSaltAndPaperFiltering(boolean value)

public void setAllowSaltAndPaperFiltering(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setAllowWhiteSpotsRemoving(boolean value)

public void setAllowWhiteSpotsRemoving(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setCheckMore1DVariants(boolean value)

public void setCheckMore1DVariants(boolean value)

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

Parameters:

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

setDetectorSettings(BarcodeSvmDetectorSettings value)

public void setDetectorSettings(BarcodeSvmDetectorSettings value)

Barcode detector settings.

Parameters:

ParameterTypeDescription
valueBarcodeSvmDetectorSettings

setFastScanOnly(boolean value)

public void setFastScanOnly(boolean value)

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

Parameters:

ParameterTypeDescription
valuebooleanAllows engine for 1D barcodes to quickly recognize high quality barcodes.

setMedianSmoothingWindowSize(int value)

public void setMedianSmoothingWindowSize(int value)

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.

Parameters:

ParameterTypeDescription
valueint

setReadTinyBarcodes(boolean value)

public void setReadTinyBarcodes(boolean value)

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

Parameters:

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

setUseOldBarcodeDetector(boolean value)

public void setUseOldBarcodeDetector(boolean value)

Switches to the old barcode detector.

Value: Switches to the old barcode detector.

Parameters:

ParameterTypeDescription
valueboolean

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int