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

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

Inherits asposebarcode.Assist.BaseJavaClass.

Public Member Functions

def __init__ (self, qualitySettings)
 
def init (self)
 
def getAllowInvertImage (self)
 Allows engine to recognize inverse color image as additional scan. More...
 
def setAllowInvertImage (self, value)
 Allows engine to recognize inverse color image as additional scan. More...
 
def getAllowIncorrectBarcodes (self)
 Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. More...
 
def setAllowIncorrectBarcodes (self, value)
 Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. More...
 
def getReadTinyBarcodes (self)
 Allows engine to recognize tiny barcodes on large images. More...
 
def setReadTinyBarcodes (self, value)
 Allows engine to recognize tiny barcodes on large images. More...
 
def getCheckMore1DVariants (self)
 Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. More...
 
def setCheckMore1DVariants (self, value)
 Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. More...
 
def getAllowComplexBackground (self)
 Allows engine to recognize color barcodes on color background as additional scan. More...
 
def setAllowComplexBackground (self, value)
 Allows engine to recognize color barcodes on color background as additional scan. More...
 
def getAllowMedianSmoothing (self)
 Allows engine to enable median smoothing as additional scan. More...
 
def setAllowMedianSmoothing (self, value)
 Allows engine to enable median smoothing as additional scan. More...
 
def getMedianSmoothingWindowSize (self)
 Window size for median smoothing. More...
 
def setMedianSmoothingWindowSize (self, value)
 Window size for median smoothing. More...
 
def getAllowRegularImage (self)
 Allows engine to recognize regular image without any restorations as main scan. More...
 
def setAllowRegularImage (self, value)
 Allows engine to recognize regular image without any restorations as main scan. More...
 
def getAllowDecreasedImage (self)
 Allows engine to recognize decreased image as additional scan. More...
 
def setAllowDecreasedImage (self, value)
 Allows engine to recognize decreased image as additional scan. More...
 
def getAllowWhiteSpotsRemoving (self)
 Allows engine to recognize image without small white spots as additional scan. More...
 
def setAllowWhiteSpotsRemoving (self, value)
 Allows engine to recognize image without small white spots as additional scan. More...
 
def getAllowOneDAdditionalScan (self)
 Allows engine for 1D barcodes to recognize regular image with different params as additional scan. More...
 
def setAllowOneDAdditionalScan (self, value)
 Allows engine for 1D barcodes to recognize regular image with different params as additional scan. More...
 
def getAllowOneDFastBarcodesDetector (self)
 Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. More...
 
def setAllowOneDFastBarcodesDetector (self, value)
 Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. More...
 
def getUseOldBarcodeDetector (self)
 Switches to the old barcode detector. More...
 
def setUseOldBarcodeDetector (self, value)
 
def getAllowMicroWhiteSpotsRemoving (self)
 Allows engine for Postal barcodes to recognize slightly noised images. More...
 
def setAllowMicroWhiteSpotsRemoving (self, value)
 Allows engine for Postal barcodes to recognize slightly noised images. More...
 
def getFastScanOnly (self)
 
def setFastScanOnly (self, value)
 
def getAllowSaltAndPaperFiltering (self)
 Allows engine to recognize barcodes with salt and paper noise type. More...
 
def setAllowSaltAndPaperFiltering (self, value)
 Allows engine to recognize barcodes with salt and paper noise type. More...
 
def getAllowDetectScanGap (self)
 Allows engine to use gap between scans to increase recognition speed. More...
 
def setAllowDetectScanGap (self, value)
 Allows engine to use gap between scans to increase recognition speed. More...
 
def getAllowDatamatrixIndustrialBarcodes (self)
 Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. More...
 
def setAllowDatamatrixIndustrialBarcodes (self, value)
 Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. More...
 
def getAllowQRMicroQrRestoration (self)
 Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. More...
 
def setAllowQRMicroQrRestoration (self, value)
 Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. More...
 
def getAllowOneDWipedBarsRestoration (self)
 Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. More...
 
def setAllowOneDWipedBarsRestoration (self, value)
 Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. More...
 
def getDetectorSettings (self)
 Barcode detector settings. More...
 
def setDetectorSettings (self, value)
 Barcode detector settings. More...
 
def applyAll (self, Src)
 apply all values from Src setting to this :param: Src source settings More...
 
- Public Member Functions inherited from asposebarcode.Assist.BaseJavaClass
def getJavaClass (self)
 
def setJavaClass (self, javaClass)
 
def getJavaClassName (self)
 
def isNull (self)
 
def printJavaClassName (self)
 

Static Public Member Functions

def initQualitySettings (qualitySettings)
 
def getHighPerformance ()
 HighPerformance recognition quality preset. More...
 
def getNormalQuality ()
 NormalQuality recognition quality preset. More...
 
def getHighQualityDetection ()
 HighQualityDetection recognition quality preset. More...
 
def getMaxQualityDetection ()
 MaxQualityDetection recognition quality preset. More...
 
def getHighQuality ()
 HighQuality recognition quality preset. More...
 
def getMaxBarCodes ()
 MaxBarCodes recognition quality preset. More...
 

Public Attributes

 detectorSettings
 
- Public Attributes inherited from asposebarcode.Assist.BaseJavaClass
 javaClass
 
 javaClassName
 

Static Public Attributes

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

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 = BarCodeReader("test.png", None, [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ])
#set high performance mode
reader.setQualitySettings(QualitySettings.getHighPerformance())
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = BarCodeReader("test.png", None, [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ])
#normal quality mode is set by default
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = BarCodeReader("test.png", None, [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ])
#set high quality mode with low speed recognition
reader.setQualitySettings(QualitySettings.getHighQuality())
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = BarCodeReader("test.png", None, [ 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 result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = BarCodeReader("test.png", None, [ 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 result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())
reader = BarCodeReader("test.png", None, [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ])
#default mode is NormalQuality
#set separate options
reader.getQualitySettings().setAllowMedianSmoothing(true)
reader.getQualitySettings().setMedianSmoothingWindowSize(5)
for result in reader.readBarCodes():
print("BarCode CodeText: " + result.getCodeText())

Constructor & Destructor Documentation

◆ __init__()

def asposebarcode.Recognition.QualitySettings.__init__ (   self,
  qualitySettings 
)

Member Function Documentation

◆ applyAll()

def asposebarcode.Recognition.QualitySettings.applyAll (   self,
  Src 
)

apply all values from Src setting to this :param: Src source settings

◆ getAllowComplexBackground()

def asposebarcode.Recognition.QualitySettings.getAllowComplexBackground (   self)

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.

◆ getAllowDatamatrixIndustrialBarcodes()

def asposebarcode.Recognition.QualitySettings.getAllowDatamatrixIndustrialBarcodes (   self)

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.

◆ getAllowDecreasedImage()

def asposebarcode.Recognition.QualitySettings.getAllowDecreasedImage (   self)

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

◆ getAllowDetectScanGap()

def asposebarcode.Recognition.QualitySettings.getAllowDetectScanGap (   self)

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.

◆ getAllowIncorrectBarcodes()

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

◆ getAllowInvertImage()

def asposebarcode.Recognition.QualitySettings.getAllowInvertImage (   self)

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.

◆ getAllowMedianSmoothing()

def asposebarcode.Recognition.QualitySettings.getAllowMedianSmoothing (   self)

Allows engine to enable median smoothing as additional scan.

Mode helps to recognize noised barcodes. Value: Allows engine to enable median smoothing.

◆ getAllowMicroWhiteSpotsRemoving()

def asposebarcode.Recognition.QualitySettings.getAllowMicroWhiteSpotsRemoving (   self)

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.

◆ getAllowOneDAdditionalScan()

def asposebarcode.Recognition.QualitySettings.getAllowOneDAdditionalScan (   self)

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.

◆ getAllowOneDFastBarcodesDetector()

def asposebarcode.Recognition.QualitySettings.getAllowOneDFastBarcodesDetector (   self)

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.

◆ getAllowOneDWipedBarsRestoration()

def asposebarcode.Recognition.QualitySettings.getAllowOneDWipedBarsRestoration (   self)

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.

◆ getAllowQRMicroQrRestoration()

def asposebarcode.Recognition.QualitySettings.getAllowQRMicroQrRestoration (   self)

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

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

◆ getAllowRegularImage()

def asposebarcode.Recognition.QualitySettings.getAllowRegularImage (   self)

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.

◆ getAllowSaltAndPaperFiltering()

def asposebarcode.Recognition.QualitySettings.getAllowSaltAndPaperFiltering (   self)

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.

◆ getAllowWhiteSpotsRemoving()

def asposebarcode.Recognition.QualitySettings.getAllowWhiteSpotsRemoving (   self)

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.

◆ getCheckMore1DVariants()

def asposebarcode.Recognition.QualitySettings.getCheckMore1DVariants (   self)

Allows engine to recognize 1D barcodes with checksum by checking more recognition variants.

Default value: False. :return: If True, allows engine to recognize 1D barcodes with checksum.

◆ getDetectorSettings()

def asposebarcode.Recognition.QualitySettings.getDetectorSettings (   self)

Barcode detector settings.

◆ getFastScanOnly()

def asposebarcode.Recognition.QualitySettings.getFastScanOnly (   self)
Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.
:return: Allows engine for 1D barcodes to quickly recognize high quality barcodes.

◆ getHighPerformance()

def asposebarcode.Recognition.QualitySettings.getHighPerformance ( )
static

HighPerformance recognition quality preset.

High quality barcodes are recognized well in this mode.

reader = BarCodeReader("test.png")
reader.setQualitySettings(QualitySettings.getHighPerformance())
\ebdcode
Value:
HighPerformance recognition quality preset.

◆ getHighQuality()

def asposebarcode.Recognition.QualitySettings.getHighQuality ( )
static

HighQuality recognition quality preset.

This preset is developed for low quality barcodes.

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

Value: HighQuality recognition quality preset.

◆ getHighQualityDetection()

def asposebarcode.Recognition.QualitySettings.getHighQualityDetection ( )
static

HighQualityDetection recognition quality preset.

Same as NormalQuality but with high quality DetectorSettings

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

Value: HighQualityDetection recognition quality preset.

◆ getMaxBarCodes()

def asposebarcode.Recognition.QualitySettings.getMaxBarCodes ( )
static

MaxBarCodes recognition quality preset.

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

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

Value: MaxBarCodes recognition quality preset.

◆ getMaxQualityDetection()

def asposebarcode.Recognition.QualitySettings.getMaxQualityDetection ( )
static

MaxQualityDetection recognition quality preset.

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

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

Value: MaxQualityDetection recognition quality preset.

◆ getMedianSmoothingWindowSize()

def asposebarcode.Recognition.QualitySettings.getMedianSmoothingWindowSize (   self)

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.

◆ getNormalQuality()

def asposebarcode.Recognition.QualitySettings.getNormalQuality ( )
static

NormalQuality recognition quality preset.

Suitable for the most of barcodes

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

Value: NormalQuality recognition quality preset.

◆ getReadTinyBarcodes()

def asposebarcode.Recognition.QualitySettings.getReadTinyBarcodes (   self)

Allows engine to recognize tiny barcodes on large images.

Ignored if AllowIncorrectBarcodes is set to True.

Default value: False.

:return: If True, allows engine to recognize tiny barcodes on large images.

◆ getUseOldBarcodeDetector()

def asposebarcode.Recognition.QualitySettings.getUseOldBarcodeDetector (   self)

Switches to the old barcode detector.

:return: Switches to the old barcode detector.

◆ init()

def asposebarcode.Recognition.QualitySettings.init (   self)

◆ initQualitySettings()

def asposebarcode.Recognition.QualitySettings.initQualitySettings (   qualitySettings)
static

◆ setAllowComplexBackground()

def asposebarcode.Recognition.QualitySettings.setAllowComplexBackground (   self,
  value 
)

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

Extremely slow mode. Value:v Allows engine to recognize color barcodes on color background.

◆ setAllowDatamatrixIndustrialBarcodes()

def asposebarcode.Recognition.QualitySettings.setAllowDatamatrixIndustrialBarcodes (   self,
  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.

◆ setAllowDecreasedImage()

def asposebarcode.Recognition.QualitySettings.setAllowDecreasedImage (   self,
  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

◆ setAllowDetectScanGap()

def asposebarcode.Recognition.QualitySettings.setAllowDetectScanGap (   self,
  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.

◆ setAllowIncorrectBarcodes()

def asposebarcode.Recognition.QualitySettings.setAllowIncorrectBarcodes (   self,
  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.

◆ setAllowInvertImage()

def asposebarcode.Recognition.QualitySettings.setAllowInvertImage (   self,
  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.

◆ setAllowMedianSmoothing()

def asposebarcode.Recognition.QualitySettings.setAllowMedianSmoothing (   self,
  value 
)

Allows engine to enable median smoothing as additional scan.

Mode helps to recognize noised barcodes. Value: Allows engine to enable median smoothing.

◆ setAllowMicroWhiteSpotsRemoving()

def asposebarcode.Recognition.QualitySettings.setAllowMicroWhiteSpotsRemoving (   self,
  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.

◆ setAllowOneDAdditionalScan()

def asposebarcode.Recognition.QualitySettings.setAllowOneDAdditionalScan (   self,
  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.

◆ setAllowOneDFastBarcodesDetector()

def asposebarcode.Recognition.QualitySettings.setAllowOneDFastBarcodesDetector (   self,
  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.

◆ setAllowOneDWipedBarsRestoration()

def asposebarcode.Recognition.QualitySettings.setAllowOneDWipedBarsRestoration (   self,
  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.

◆ setAllowQRMicroQrRestoration()

def asposebarcode.Recognition.QualitySettings.setAllowQRMicroQrRestoration (   self,
  value 
)

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

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

◆ setAllowRegularImage()

def asposebarcode.Recognition.QualitySettings.setAllowRegularImage (   self,
  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.

◆ setAllowSaltAndPaperFiltering()

def asposebarcode.Recognition.QualitySettings.setAllowSaltAndPaperFiltering (   self,
  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.

◆ setAllowWhiteSpotsRemoving()

def asposebarcode.Recognition.QualitySettings.setAllowWhiteSpotsRemoving (   self,
  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.

◆ setCheckMore1DVariants()

def asposebarcode.Recognition.QualitySettings.setCheckMore1DVariants (   self,
  value 
)

Allows engine to recognize 1D barcodes with checksum by checking more recognition variants.

Default value: False. :param value If True, allows engine to recognize 1D barcodes with checksum.

◆ setDetectorSettings()

def asposebarcode.Recognition.QualitySettings.setDetectorSettings (   self,
  value 
)

Barcode detector settings.

◆ setFastScanOnly()

def asposebarcode.Recognition.QualitySettings.setFastScanOnly (   self,
  value 
)
Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.
:param value: Allows engine for 1D barcodes to quickly recognize high quality barcodes.

◆ setMedianSmoothingWindowSize()

def asposebarcode.Recognition.QualitySettings.setMedianSmoothingWindowSize (   self,
  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.

◆ setReadTinyBarcodes()

def asposebarcode.Recognition.QualitySettings.setReadTinyBarcodes (   self,
  value 
)

Allows engine to recognize tiny barcodes on large images.

Ignored if AllowIncorrectBarcodes is set to True.

Default value: False.

:param: value If True, allows engine to recognize tiny barcodes on large images.

◆ setUseOldBarcodeDetector()

def asposebarcode.Recognition.QualitySettings.setUseOldBarcodeDetector (   self,
  value 
)
Switches to the old barcode detector.
:param value: Switches to the old barcode detector.

Member Data Documentation

◆ detectorSettings

asposebarcode.Recognition.QualitySettings.detectorSettings

◆ javaClassName

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