Aspose.Barcode for PHP via Java Generation and Recognition API docs

Inherits BaseJavaClass.

Public Member Functions

 __construct ($javaClass)
 
 getXDimension ()
 
 setXDimension (float $value)
 
 getMinimalXDimension ()
 
 setMinimalXDimension (float $value)
 
 getBarcodeQuality ()
 
 setBarcodeQuality (int $value)
 
 getDeconvolution ()
 
 setDeconvolution (int $value)
 
 getInverseImage ()
 
 setInverseImage (int $value)
 
 getComplexBackground ()
 
 setComplexBackground (int $value)
 
 getAllowIncorrectBarcodes ()
 
 setAllowIncorrectBarcodes (bool $value)
 
- Public Member Functions inherited from BaseJavaClass
 getJavaClass ()
 
 getJavaClassName ()
 
 isNull ()
 
 printJavaClassName ()
 

Static Public Member Functions

static getHighPerformance ()
 
static getNormalQuality ()
 
static getHighQuality ()
 
static getMaxQuality ()
 

Protected Member Functions

 init ()
 
- Protected Member Functions inherited from BaseJavaClass
 setJavaClass ($javaClass)
 

Static Private Member Functions

static initQualitySettings ()
 

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

$reader = new BarCodeReader("test.png", null, array(DecodeType::CODE_39, DecodeType::CODE_128));
//set high performance mode
$reader->setQualitySettings(QualitySettings::getHighPerformance());
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
$reader = new BarCodeReader("test.png", null, array(DecodeType::CODE_39, DecodeType::CODE_128));
//normal quality mode is set by default
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
$reader = new BarCodeReader("test.png", null, array(DecodeType::CODE_39, DecodeType::CODE_128));
//set high quality mode with low speed recognition
$reader->setQualitySettings(QualitySettings::getHighQuality());
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
$reader = new BarCodeReader("test.png", null, array(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());
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
$reader = new BarCodeReader("test.png", null, array(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);
foreach($reader->readBarCodes() as $result)
print("BarCode CodeText: ".$result->getCodeText());
$reader = new BarCodeReader("test.png", null, array(DecodeType::CODE_39, DecodeType::CODE_128));
//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 (   $javaClass)

Reimplemented from BaseJavaClass.

Member Function Documentation

◆ getAllowIncorrectBarcodes()

QualitySettings::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
: Allows engine to recognize incorrect barcodes.

◆ getBarcodeQuality()

QualitySettings::getBarcodeQuality ( )

Mode which enables methods to recognize barcode elements with the selected quality. Barcode element with lower quality requires more hard methods which slows the recognition.

Returns
: Mode which enables methods to recognize barcode elements with the selected quality.

◆ getComplexBackground()

QualitySettings::getComplexBackground ( )

Mode which enables or disables additional recognition of color barcodes on color images.

Returns
: Additional recognition of color barcodes on color images.

◆ getDeconvolution()

QualitySettings::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
: Deconvolution mode which defines level of image degradation.

◆ 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

◆ getInverseImage()

QualitySettings::getInverseImage ( )

Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance).

Returns
: Additional recognition of barcodes on images with inverse colors

◆ getMaxQuality()

static QualitySettings::getMaxQuality ( )
static

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


 This sample shows how to use MaxQuality mode
 

 $reader = new BarCodeReader("test.png"null, null, array(DecodeType::CODE_39_FULL_ASCII, DecodeType::CODE_128));
 {
     $reader->setQualitySettings(QualitySettings::getMaxQuality());
     foreach($reader->readBarCodes() as $result)
         echo ($result->getCodeText());
 }
    

Value: MaxQuality recognition quality preset.

◆ getMinimalXDimension()

QualitySettings::getMinimalXDimension ( )

Minimal size of XDimension in pixels which is used with UseMinimalXDimension.

Returns
: Minimal size of XDimension in pixels which is used with UseMinimalXDimension.

◆ 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

◆ getXDimension()

QualitySettings::getXDimension ( )

Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar.

Returns
: size (from 1 to infinity) of barcode minimal element: matrix cell or bar.

◆ init()

QualitySettings::init ( )
protected

Reimplemented from BaseJavaClass.

◆ initQualitySettings()

static QualitySettings::initQualitySettings ( )
staticprivate

◆ setAllowIncorrectBarcodes()

QualitySettings::setAllowIncorrectBarcodes ( bool  $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
$valueAllows engine to recognize incorrect barcodes.

◆ setBarcodeQuality()

QualitySettings::setBarcodeQuality ( int  $value)

Mode which enables methods to recognize barcode elements with the selected quality. Barcode element with lower quality requires more hard methods which slows the recognition.

Parameters
$valueMode which enables methods to recognize barcode elements with the selected quality.

◆ setComplexBackground()

QualitySettings::setComplexBackground ( int  $value)

Mode which enables or disables additional recognition of color barcodes on color images.

Parameters
$valueAdditional recognition of color barcodes on color images.

◆ setDeconvolution()

QualitySettings::setDeconvolution ( int  $value)

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.

Parameters
$valueDeconvolution mode which defines level of image degradation.

◆ setInverseImage()

QualitySettings::setInverseImage ( int  $value)

Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance).

Parameters
$valueAdditional recognition of barcodes on images with inverse colors

◆ setMinimalXDimension()

QualitySettings::setMinimalXDimension ( float  $value)

Minimal size of XDimension in pixels which is used with UseMinimalXDimension.

Parameters
$valueMinimal size of XDimension in pixels which is used with UseMinimalXDimension.

◆ setXDimension()

QualitySettings::setXDimension ( float  $value)

Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar.

Parameters
$valuesize (from 1 to infinity) of barcode minimal element: matrix cell or bar.