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

QualitySettings allows to configure recognition quality and speed manually. More...

Inherits BaseJavaClass.

Public Member Functions

def __init__ (self, javaClass)
 
bool getAllowIncorrectBarcodes (self)
 Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. More...
 
BarcodeQualityMode getBarcodeQuality (self)
 Mode which enables methods to recognize barcode elements with the selected quality. More...
 
ComplexBackgroundMode getComplexBackground (self)
 Mode which enables or disables additional recognition of color barcodes on color images. More...
 
DeconvolutionMode getDeconvolution (self)
 Deconvolution (image restorations) mode which defines level of image degradation. More...
 
InverseImageMode getInverseImage (self)
 Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance). More...
 
int getMinimalXDimension (self)
 Minimal size of XDimension in pixels which is used with UseMinimalXDimension. More...
 
XDimensionMode getXDimension (self)
 Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar. More...
 
None init (self)
 
None setAllowIncorrectBarcodes (self, bool value)
 Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. More...
 
None setBarcodeQuality (self, BarcodeQualityMode value)
 Mode which enables methods to recognize barcode elements with the selected quality. More...
 
None setComplexBackground (self, ComplexBackgroundMode value)
 Mode which enables or disables additional recognition of color barcodes on color images. More...
 
None setDeconvolution (self, DeconvolutionMode value)
 Deconvolution (image restorations) mode which defines level of image degradation. More...
 
None setInverseImage (self, InverseImageMode value)
 Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance). More...
 
None setMinimalXDimension (self, int value)
 Minimal size of XDimension in pixels which is used with UseMinimalXDimension. More...
 
None setXDimension (self, XDimensionMode value)
 Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar. More...
 
- Public Member Functions inherited from BaseJavaClass
def getJavaClass (self)
 
str getJavaClassName (self)
 
bool isNull (self)
 
None printJavaClassName (self)
 
None setJavaClass (self, javaClass)
 

Static Public Member Functions

QualitySettings getHighPerformance ()
 HighPerformance recognition quality preset. More...
 
QualitySettings getHighQuality ()
 HighQuality recognition quality preset. More...
 
QualitySettings getMaxQuality ()
 MaxQuality recognition quality preset. More...
 
QualitySettings getNormalQuality ()
 NormalQuality recognition quality preset. More...
 
def initQualitySettings ()
 

Static Public Attributes

string javaClassName = "com.aspose.mw.barcode.recognition.MwQualitySettings"
 

Additional Inherited Members

- Public Attributes inherited from BaseJavaClass
 javaClass
 
 javaClassName
 

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 = Recognition.BarCodeReader(self.image_path, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.CODE_128])
# set high performance mode
reader.setQualitySettings(Recognition.QualitySettings.getHighPerformance())
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = Recognition.BarCodeReader(self.image_path, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.CODE_128])
# normal quality mode is set by default
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = Recognition.BarCodeReader(self.image_path, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.CODE_128])
# normal quality mode is set by default
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = Recognition.BarCodeReader(self.image_path, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.CODE_128])
# set max barcodes mode, which tries to find all possible barcodes, even incorrect. The slowest recognition mode
reader.setQualitySettings(Recognition.QualitySettings.getMaxQuality())
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = Recognition.BarCodeReader(self.image_path, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.CODE_128])
# set high performance mode
reader.setQualitySettings(Recognition.QualitySettings.getHighPerformance())
qualitySettings = reader.getQualitySettings()
qualitySettings.setAllowIncorrectBarcodes(True)
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  javaClass 
)

Reimplemented from BaseJavaClass.

Member Function Documentation

◆ getAllowIncorrectBarcodes()

bool getAllowIncorrectBarcodes (   self)

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()

BarcodeQualityMode getBarcodeQuality (   self)

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

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

◆ getComplexBackground()

ComplexBackgroundMode getComplexBackground (   self)

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

Returns
: Additional recognition of color barcodes on color images.

◆ getDeconvolution()

DeconvolutionMode getDeconvolution (   self)

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()

QualitySettings getHighPerformance ( )
static

HighPerformance recognition quality preset.

High quality barcodes are recognized well in this mode.

reader = Recognition.BarCodeReader("test.png")
reader.setQualitySettings(QualitySettings.getHighPerformance())
\ebdcode
@return HighPerformance recognition quality preset.

◆ getHighQuality()

QualitySettings getHighQuality ( )
static

HighQuality recognition quality preset.

This preset is developed for low quality barcodes.

reader = Recognition.BarCodeReader(self.image_path_code128,None, [Recognition.DecodeType.CODE_128])
reader.setQualitySettings(Recognition.QualitySettings.getHighQuality())
results = reader.readBarCodes()
for result in results:
print(f"\nBarCode Type: {result.getCodeTypeName()}")
print(f"BarCode CodeText: {result.getCodeText()}")

◆ getInverseImage()

InverseImageMode getInverseImage (   self)

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()

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 = Recognition.BarCodeReader(self.image_path_code128, None, [Recognition.DecodeType.CODE_128])

default mode is NormalQuality

set separate options

            reader.setQualitySettings(Recognition.QualitySettings.getMaxQuality())
            results = reader.readBarCodes()
            for result in results:
                print(f"\nBarCode Type: {result.getCodeTypeName()}")
                print(f"BarCode CodeText: {result.getCodeText()}")

            
Returns
: MaxQuality recognition quality preset.

◆ getMinimalXDimension()

int getMinimalXDimension (   self)

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

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

◆ getNormalQuality()

QualitySettings getNormalQuality ( )
static

NormalQuality recognition quality preset.

Suitable for most barcodes

reader = Recognition.BarCodeReader(self.image_path_code128,None, [Recognition.DecodeType.CODE_128])
reader.setQualitySettings(Recognition.QualitySettings.getNormalQuality())
results = reader.readBarCodes()
for result in results:
print(f"\nBarCode Type: {result.getCodeTypeName()}")
print(f"BarCode CodeText: {result.getCodeText()}")
Returns
NormalQuality recognition quality preset.

◆ getXDimension()

XDimensionMode getXDimension (   self)

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()

None init (   self)

Reimplemented from BaseJavaClass.

◆ initQualitySettings()

def initQualitySettings ( )
static

◆ setAllowIncorrectBarcodes()

None setAllowIncorrectBarcodes (   self,
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
Allows engine to recognize incorrect barcodes.

◆ setBarcodeQuality()

None setBarcodeQuality (   self,
BarcodeQualityMode  value 
)

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

Parameters
modewhich enables methods to recognize barcode elements with the selected quality.

◆ setComplexBackground()

None setComplexBackground (   self,
ComplexBackgroundMode  value 
)

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

Parameters
additional recognition of color barcodes on color images.

◆ setDeconvolution()

None setDeconvolution (   self,
DeconvolutionMode  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
Deconvolution mode which defines level of image degradation.

◆ setInverseImage()

None setInverseImage (   self,
InverseImageMode  value 
)

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

Parameters
Additional recognition of barcodes on images with inverse colors

◆ setMinimalXDimension()

None setMinimalXDimension (   self,
int  value 
)

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

Parameters
minimalsize of XDimension in pixels which is used with UseMinimalXDimension.

◆ setXDimension()

None setXDimension (   self,
XDimensionMode  value 
)

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

Member Data Documentation

◆ javaClassName

string javaClassName = "com.aspose.mw.barcode.recognition.MwQualitySettings"
static