BarCodeReader

BarCodeReader class

Module: aspose_barcode.recognition.barcode_reader

BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform ReadBarCodes operation to detect barcodes. This sample shows how to detect Code39 and Code128 barcodes.

Constructors

NameDescription
initInitializes a new instance of the BarCodeReader.

Methods

NameReturn TypeStaticDescription
abortNoneNo
barcode_imageNoneNoSets bitmap image and areas for Recognition. Must be called before ReadBarCodes() method. This sample shows how to detect Code39 and Code128 barcodes.
barcode_settingsOptional[BarcodeSettings]No
contains_anyboolNo
export_to_xmlboolNo
found_barcodesOptional[List[BarCodeResult]]No
found_countintNo
from_image_with_areasdefNoInitializes a new instance of the BarCodeReader.
import_from_xmlBarCodeReaderNoImports BarCode properties from the specified XML file.
read_barcodesOptional[List[BarCodeResult]]No

Properties

NameTypeDescription
barcode_read_typeUnion[List[DecodeType], DecodeType]Sets SingleDecodeType type array for Recognition. Must be called before readBarCodes() method. This sample shows how to detect Code39 and Code128 barcodes.
quality_settingsOptional[QualitySettings]
timeoutint

BarCodeReader Constructor

__init__(self, Optional[Union[str, os.PathLike, bytes, BinaryIO, Image.Image, None]] image, Optional[Union[List[DecodeType], DecodeType, None]] decode_types) -> def

Initializes a new instance of the BarCodeReader.

ParameterTypeDescription
imageOptional[Union[str, os.PathLike, bytes, BinaryIO, Image.Image, None]]
decode_typesOptional[Union[List[DecodeType], DecodeType, None]]

BarCodeReader.abort

abort(self)

BarCodeReader.barcode_image

barcode_image(self, Optional[Union[str, "os.PathLike"], bytes, BinaryIO, Image.Image, None] image, Optional[Union[List[RectLike], RectLike]] areas)

Sets bitmap image and areas for Recognition. Must be called before ReadBarCodes() method. This sample shows how to detect Code39 and Code128 barcodes.

ParameterTypeDescription
imageOptional[Union[str, "os.PathLike"], bytes, BinaryIO, Image.Image, None]
areasOptional[Union[List[RectLike], RectLike]]

BarCodeReader.barcode_settings

barcode_settings(self) -> Optional[BarcodeSettings]

Return Type: Optional[BarcodeSettings]

BarCodeReader.contains_any

contains_any(self, Union[List[DecodeType], DecodeType] decode_types) -> bool
ParameterTypeDescription
decode_typesUnion[List[DecodeType], DecodeType]

Return Type: bool

BarCodeReader.export_to_xml

export_to_xml(self, str xml_file) -> bool
ParameterTypeDescription
xml_filestr

Return Type: bool

BarCodeReader.found_barcodes

found_barcodes(self) -> Optional[List[BarCodeResult]]

Return Type: Optional[List[BarCodeResult]]

BarCodeReader.found_count

found_count(self) -> int

Return Type: int

BarCodeReader.from_image_with_areas

from_image_with_areas(self, cls, Optional[Union[str, os.PathLike, bytes, BinaryIO, Image.Image]] image, Optional[Union[List[RectLike], RectLike]] areas, Optional[Union[List[DecodeType], DecodeType]] decode_types) -> def

Initializes a new instance of the BarCodeReader.

ParameterTypeDescription
cls``
imageOptional[Union[str, os.PathLike, bytes, BinaryIO, Image.Image]]
areasOptional[Union[List[RectLike], RectLike]]
decode_typesOptional[Union[List[DecodeType], DecodeType]]

Return Type: def

BarCodeReader.import_from_xml

import_from_xml(self, cls, str xml_file) -> BarCodeReader

Imports BarCode properties from the specified XML file.

ParameterTypeDescription
cls``
xml_filestr

Return Type: BarCodeReader

BarCodeReader.read_barcodes

read_barcodes(self) -> Optional[List[BarCodeResult]]

Return Type: Optional[List[BarCodeResult]]

BarCodeReader.barcode_read_type

Type: Union[List[DecodeType], DecodeType]

Sets SingleDecodeType type array for Recognition. Must be called before readBarCodes() method. This sample shows how to detect Code39 and Code128 barcodes.

ParameterTypeDescription
typesUnion[List[DecodeType], DecodeType]

BarCodeReader.quality_settings

Type: Optional[QualitySettings]

ParameterTypeDescription
valueQualitySettings

BarCodeReader.timeout

Type: int

ParameterTypeDescription
valueint