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, 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 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 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 = Recognition.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 = Recognition.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 = Recognition.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 = Recognition.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 = Recognition.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 = Recognition.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 __init__ (   self,
  qualitySettings 
)

Reimplemented from BaseJavaClass.

Member Function Documentation

◆ applyAll()

def applyAll (   self,
  Src 
)

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

◆ getAllowComplexBackground()

def 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 getDetectorSettings (   self)

Barcode detector settings.

◆ getFastScanOnly()

def 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 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
Value:
HighPerformance recognition quality preset.

◆ getHighQuality()

def getHighQuality ( )
static

HighQuality recognition quality preset.

This preset is developed for low quality barcodes.

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

Value: HighQuality recognition quality preset.

◆ getHighQualityDetection()

def getHighQualityDetection ( )
static

HighQualityDetection recognition quality preset.

Same as NormalQuality but with high quality DetectorSettings

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

Value: HighQualityDetection recognition quality preset.

◆ getMaxBarCodes()

def getMaxBarCodes ( )
static

MaxBarCodes recognition quality preset.

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

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

Value: MaxBarCodes recognition quality preset.

◆ getMaxQualityDetection()

def getMaxQualityDetection ( )
static

MaxQualityDetection recognition quality preset.

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

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

Value: MaxQualityDetection recognition quality preset.

◆ getMedianSmoothingWindowSize()

def 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 getNormalQuality ( )
static

NormalQuality recognition quality preset.

Suitable for the most of barcodes

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

Value: NormalQuality recognition quality preset.

◆ getReadTinyBarcodes()

def 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 getUseOldBarcodeDetector (   self)

Switches to the old barcode detector.

:return: Switches to the old barcode detector.

◆ init()

def init (   self)

Reimplemented from BaseJavaClass.

◆ initQualitySettings()

def initQualitySettings (   qualitySettings)
static

◆ setAllowComplexBackground()

def 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 setDetectorSettings (   self,
  value 
)

Barcode detector settings.

◆ setFastScanOnly()

def 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 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 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 setUseOldBarcodeDetector (   self,
  value 
)
Switches to the old barcode detector.
:param value: Switches to the old barcode detector.

Member Data Documentation

◆ detectorSettings

detectorSettings

◆ javaClassName

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