‪Aspose.Barcode for PHP via Java  22.4
‪Aspose.Barcode for PHP via Java Generation and Recognition API docs
QualitySettings Class Reference

Inherits BaseJavaClass.

Public Member Functions

 __construct ($qualitySettings)
 
 getAllowInvertImage ()
 
 setAllowInvertImage (bool $value)
 
 getAllowIncorrectBarcodes ()
 
 setAllowIncorrectBarcodes (bool $value)
 
 getReadTinyBarcodes ()
 
 setReadTinyBarcodes (bool $value)
 
 getCheckMore1DVariants ()
 
 setCheckMore1DVariants (bool $value)
 
 getAllowComplexBackground ()
 
 setAllowComplexBackground (bool $value)
 
 getAllowMedianSmoothing ()
 
 setAllowMedianSmoothing (bool $value)
 
 getMedianSmoothingWindowSize ()
 
 setMedianSmoothingWindowSize (int $value)
 
 getAllowRegularImage ()
 
 setAllowRegularImage (bool $value)
 
 getAllowDecreasedImage ()
 
 setAllowDecreasedImage (bool $value)
 
 getAllowWhiteSpotsRemoving ()
 
 setAllowWhiteSpotsRemoving (bool $value)
 
 getAllowOneDAdditionalScan ()
 
 setAllowOneDAdditionalScan (bool $value)
 
 getAllowOneDFastBarcodesDetector ()
 
 setAllowOneDFastBarcodesDetector (bool $value)
 
 getUseOldBarcodeDetector ()
 
 setUseOldBarcodeDetector (bool $value)
 
 getAllowMicroWhiteSpotsRemoving ()
 
 setAllowMicroWhiteSpotsRemoving (bool $value)
 
 getFastScanOnly ()
 
 setFastScanOnly (bool $value)
 
 getAllowSaltAndPaperFiltering ()
 
 setAllowSaltAndPaperFiltering (bool $value)
 
 getAllowDetectScanGap ()
 
 setAllowDetectScanGap (bool $value)
 
 getAllowDatamatrixIndustrialBarcodes ()
 
 setAllowDatamatrixIndustrialBarcodes (bool $value)
 
 getAllowQRMicroQrRestoration ()
 
 setAllowQRMicroQrRestoration (bool $value)
 
 getAllowOneDWipedBarsRestoration ()
 
 setAllowOneDWipedBarsRestoration (bool $value)
 
 getDetectorSettings ()
 
 setDetectorSettings (BarcodeSvmDetectorSettings $value)
 
 applyAll (QualitySettings $Src)
 
 getJavaClass ()
 
 getJavaClassName ()
 
 isNull ()
 
 printJavaClassName ()
 

Static Public Member Functions

static getHighPerformance ()
 
static getNormalQuality ()
 
static getHighQualityDetection ()
 
static getMaxQualityDetection ()
 
static getHighQuality ()
 
static getMaxBarCodes ()
 

Protected Member Functions

 init ()
 
 setJavaClass ($javaClass)
 

Detailed Description

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

//set high performance mode
$reader->setQualitySettings(QualitySettings::getHighPerformance());
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
//normal quality mode is set by default
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
//set high quality mode with low speed recognition
$reader->setQualitySettings(QualitySettings::getHighQuality());
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
//set max barcodes mode, which tries to find all possible barcodes, even incorrect. The slowest recognition mode
$reader->setQualitySettings(QualitySettings::getMaxBarCodes());
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
//set high performance mode
$reader->setQualitySettings(QualitySettings::getHighPerformance());
//set separate options
$reader->getQualitySettings()->setAllowMedianSmoothing(true);
$reader->getQualitySettings()->setMedianSmoothingWindowSize(5);
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
//default mode is NormalQuality
//set separate options
$reader->getQualitySettings()->setAllowMedianSmoothing(true);
$reader->getQualitySettings()->setMedianSmoothingWindowSize(5);
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());

Constructor & Destructor Documentation

◆ __construct()

QualitySettings::__construct (   $qualitySettings)

Reimplemented from BaseJavaClass.

Member Function Documentation

◆ applyAll()

QualitySettings::applyAll ( QualitySettings  $Src)

Function apply all values from Src setting to this

Parameters
QualitySettings‪Src source settings

◆ getAllowComplexBackground()

QualitySettings::getAllowComplexBackground ( )
final

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

Returns
‪bool Allows engine to recognize color barcodes on color background.
Exceptions
BarcodeException

◆ getAllowDatamatrixIndustrialBarcodes()

QualitySettings::getAllowDatamatrixIndustrialBarcodes ( )
final

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

Returns
‪bool Allows engine for Datamatrix to recognize dashed industrial barcodes.
Exceptions
BarcodeException

◆ getAllowDecreasedImage()

QualitySettings::getAllowDecreasedImage ( )
final

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.

Returns
‪bool Allows engine to recognize decreased image
Exceptions
BarcodeException

◆ getAllowDetectScanGap()

QualitySettings::getAllowDetectScanGap ( )
final

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

Returns
‪bool Allows engine to use gap between scans to increase recognition speed.
Exceptions
BarcodeException

◆ getAllowIncorrectBarcodes()

QualitySettings::getAllowIncorrectBarcodes ( )
final

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

Returns
‪bool Allows engine to recognize incorrect barcodes.
Exceptions
BarcodeException

◆ getAllowInvertImage()

QualitySettings::getAllowInvertImage ( )
final

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

Returns
‪bool Allows engine to recognize inverse color image.
Exceptions
BarcodeException

◆ getAllowMedianSmoothing()

QualitySettings::getAllowMedianSmoothing ( )
final

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

Returns
‪bool Allows engine to enable median smoothing.
Exceptions
BarcodeException

◆ getAllowMicroWhiteSpotsRemoving()

QualitySettings::getAllowMicroWhiteSpotsRemoving ( )
final

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

Returns
‪bool Allows engine for Postal barcodes to recognize slightly noised images.
Exceptions
BarcodeException

◆ getAllowOneDAdditionalScan()

QualitySettings::getAllowOneDAdditionalScan ( )
final

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

Returns
‪bool Allows engine for 1D barcodes to run additional scan.
Exceptions
BarcodeException

◆ getAllowOneDFastBarcodesDetector()

QualitySettings::getAllowOneDFastBarcodesDetector ( )
final

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.

Returns
‪bool Allows engine for 1D barcodes to quickly recognize high quality barcodes.
Exceptions
BarcodeException

◆ getAllowOneDWipedBarsRestoration()

QualitySettings::getAllowOneDWipedBarsRestoration ( )

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

Returns
‪bool Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.
Exceptions
BarcodeException

◆ getAllowQRMicroQrRestoration()

QualitySettings::getAllowQRMicroQrRestoration ( )
final

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

Returns
‪bool Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.
Exceptions
BarcodeException

◆ getAllowRegularImage()

QualitySettings::getAllowRegularImage ( )
final

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

Returns
‪bool Allows to recognize regular image without any restorations.
Exceptions
BarcodeException

◆ getAllowSaltAndPaperFiltering()

QualitySettings::getAllowSaltAndPaperFiltering ( )
final

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

Returns
‪bool Allows engine to recognize barcodes with salt and paper noise type.
Exceptions
BarcodeException

◆ getAllowWhiteSpotsRemoving()

QualitySettings::getAllowWhiteSpotsRemoving ( )
final

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

Returns
‪bool Allows engine to recognize image without small white spots.
Exceptions
BarcodeException

◆ getCheckMore1DVariants()

QualitySettings::getCheckMore1DVariants ( )

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

Returns
‪bool If True, allows engine to recognize 1D barcodes with checksum.
Exceptions
BarcodeException

◆ getDetectorSettings()

QualitySettings::getDetectorSettings ( )

Barcode detector settings.

◆ getFastScanOnly()

QualitySettings::getFastScanOnly ( )
final

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

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

◆ getHighPerformance()

static QualitySettings::getHighPerformance ( )
static

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

$reader = new BarCodeReader("test.png");
$reader->setQualitySettings(QualitySettings::getHighPerformance());
@return QualitySettings HighPerformance recognition quality preset.
Exceptions
BarcodeException

◆ getHighQuality()

static QualitySettings::getHighQuality ( )
static

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

$reader = new BarCodeReader("test.png");
$reader->setQualitySettings(QualitySettings::getHighQuality());
Returns
QualitySettings HighQuality recognition quality preset.
Exceptions
BarcodeException

◆ getHighQualityDetection()

static QualitySettings::getHighQualityDetection ( )
static

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

$reader = new BarCodeReader("test.png");
$reader->setQualitySettings(QualitySettings::getHighQualityDetection());
Returns
QualitySettings HighQualityDetection recognition quality preset.
Exceptions
BarcodeException

◆ getJavaClass()

BaseJavaClass::getJavaClass ( )
inherited

◆ getJavaClassName()

BaseJavaClass::getJavaClassName ( )
inherited

◆ getMaxBarCodes()

static QualitySettings::getMaxBarCodes ( )
static

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

$reader = new BarCodeReader("test.png");
$reader->setQualitySettings(QualitySettings::getMaxBarCodes());
Returns
QualitySettings MaxBarCodes recognition quality preset.
Exceptions
BarcodeException

◆ getMaxQualityDetection()

static QualitySettings::getMaxQualityDetection ( )
static

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

$reader = new BarCodeReader("test.png");
$reader->setQualitySettings(QualitySettings::getMaxQualityDetection());
Returns
QualitySettings MaxQualityDetection recognition quality preset.
Exceptions
BarcodeException

◆ getMedianSmoothingWindowSize()

QualitySettings::getMedianSmoothingWindowSize ( )
final

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

Returns
‪int Window size for median smoothing.
Exceptions
BarcodeException

◆ getNormalQuality()

static QualitySettings::getNormalQuality ( )
static

NormalQuality recognition quality preset. Suitable for the most of barcodes

$reader = new BarCodeReader("test.png");
$reader->setQualitySettings(QualitySettings::getNormalQuality());
Returns
QualitySettings NormalQuality recognition quality preset.
Exceptions
BarcodeException

◆ getReadTinyBarcodes()

QualitySettings::getReadTinyBarcodes ( )

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

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

◆ getUseOldBarcodeDetector()

QualitySettings::getUseOldBarcodeDetector ( )

Switches to the old barcode detector.

Value: Switches to the old barcode detector.

◆ init()

QualitySettings::init ( )
protected

Reimplemented from BaseJavaClass.

◆ isNull()

BaseJavaClass::isNull ( )
inherited

◆ printJavaClassName()

BaseJavaClass::printJavaClassName ( )
inherited

◆ setAllowComplexBackground()

QualitySettings::setAllowComplexBackground ( bool  $value)
final

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

Parameters
bool$value‪Allows engine to recognize color barcodes on color background.
Exceptions
BarcodeException

◆ setAllowDatamatrixIndustrialBarcodes()

QualitySettings::setAllowDatamatrixIndustrialBarcodes ( bool  $value)
final

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

Parameters
bool$value‪Allows engine for Datamatrix to recognize dashed industrial barcodes.
Exceptions
BarcodeException

◆ setAllowDecreasedImage()

QualitySettings::setAllowDecreasedImage ( bool  $value)
final

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.

Parameters
bool$value‪Allows engine to recognize decreased image
Exceptions
BarcodeException

◆ setAllowDetectScanGap()

QualitySettings::setAllowDetectScanGap ( bool  $value)
final

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

Parameters
bool$value‪Allows engine to use gap between scans to increase recognition speed.
Exceptions
BarcodeException

◆ setAllowIncorrectBarcodes()

QualitySettings::setAllowIncorrectBarcodes ( bool  $value)
final

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

Parameters
bool$value‪Allows engine to recognize incorrect barcodes.
Exceptions
BarcodeException

◆ setAllowInvertImage()

QualitySettings::setAllowInvertImage ( bool  $value)
final

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

Parameters
bool$value‪Allows engine to recognize inverse color image.
Exceptions
BarcodeException

◆ setAllowMedianSmoothing()

QualitySettings::setAllowMedianSmoothing ( bool  $value)
final

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

Parameters
bool$value‪Allows engine to enable median smoothing.
Exceptions
BarcodeException

◆ setAllowMicroWhiteSpotsRemoving()

QualitySettings::setAllowMicroWhiteSpotsRemoving ( bool  $value)
final

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

Parameters
bool$value‪Allows engine for Postal barcodes to recognize slightly noised images.
Exceptions
BarcodeException

◆ setAllowOneDAdditionalScan()

QualitySettings::setAllowOneDAdditionalScan ( bool  $value)
final

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

Parameters
bool$value‪Allows engine for 1D barcodes to run additional scan.
Exceptions
BarcodeException

◆ setAllowOneDFastBarcodesDetector()

QualitySettings::setAllowOneDFastBarcodesDetector ( bool  $value)
final

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.

Parameters
bool$value‪Allows engine for 1D barcodes to quickly recognize high quality barcodes.
Exceptions
BarcodeException

◆ setAllowOneDWipedBarsRestoration()

QualitySettings::setAllowOneDWipedBarsRestoration ( bool  $value)

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

Parameters
bool$value‪Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.
Exceptions
BarcodeException

◆ setAllowQRMicroQrRestoration()

QualitySettings::setAllowQRMicroQrRestoration ( bool  $value)
final

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

Parameters
bool$value‪Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.
Exceptions
BarcodeException

◆ setAllowRegularImage()

QualitySettings::setAllowRegularImage ( bool  $value)
final

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

Parameters
bool$value‪Allows to recognize regular image without any restorations.
Exceptions
BarcodeException

◆ setAllowSaltAndPaperFiltering()

QualitySettings::setAllowSaltAndPaperFiltering ( bool  $value)
final

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

Parameters
bool$value‪Allows engine to recognize barcodes with salt and paper noise type.
Exceptions
BarcodeException

◆ setAllowWhiteSpotsRemoving()

QualitySettings::setAllowWhiteSpotsRemoving ( bool  $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.

Parameters
bool$value‪Allows engine to recognize image without small white spots.
Exceptions
BarcodeException

◆ setCheckMore1DVariants()

QualitySettings::setCheckMore1DVariants ( bool  $value)

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

Parameters
bool$value‪If True, allows engine to recognize 1D barcodes with checksum.

◆ setDetectorSettings()

QualitySettings::setDetectorSettings ( BarcodeSvmDetectorSettings  $value)

Barcode detector settings.

◆ setFastScanOnly()

QualitySettings::setFastScanOnly ( bool  $value)
final

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

Parameters
bool‪value Allows engine for 1D barcodes to quickly recognize high quality barcodes.

◆ setJavaClass()

BaseJavaClass::setJavaClass (   $javaClass)
protectedinherited

◆ setMedianSmoothingWindowSize()

QualitySettings::setMedianSmoothingWindowSize ( int  $value)
final

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

Parameters
int$value‪Window size for median smoothing.
Exceptions
BarcodeException

◆ setReadTinyBarcodes()

QualitySettings::setReadTinyBarcodes ( bool  $value)

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

Parameters
bool$value‪If True, allows engine to recognize tiny barcodes on large images.
Exceptions
BarcodeException

◆ setUseOldBarcodeDetector()

QualitySettings::setUseOldBarcodeDetector ( bool  $value)

Switches to the old barcode detector.

Value: Switches to the old barcode detector.