This tutorial explains how to read Data Matrix barcodes using Python. All necessary details are provided, such as IDE configuration, a list of programming steps, and sample code for a Data Matrix reader in Python. Various options will be introduced to customize the reading process.
Steps to scan the Data Matrix code with Python
- Configure the development environment to use Aspose.BarCode for Python via .NET to scan Data Matrix barcodes.
- Import the necessary classes and modules from the Python library mentioned above.
- Apply a license to read the Data Matrix code text; otherwise, a partial read will be performed.
- Instantiate the BarCodeReader object to read the Data Matrix code from the provided image.
- Set the quality settings to high to handle the more difficult images.
- Invocare il metodo
read_bar_codes()to read all the Data Matrix codes - Iterate over all the codes and display some properties such as the code text, the symbology, and the region.
The steps above describe the procedure to develop a Data Matrix code reader using Python. Applica la licenza poiché solo Code39 può essere letto senza restrizioni in modalità di prova, inizializza il lettore con il tipo di decodifica target Data Matrix e il nome del file immagine, e migliora l’accuratezza per immagini più difficili. Infine, leggi i codici a barre con i parametri forniti e itera attraverso tutte le immagini stampando tutte le proprietà.
Code for a Data Matrix scanner using Python
Il codice fornito mostra come sviluppare uno scanner Data Matrix in Python. It is possible to set a list of decode types by adding GS1_DATA_MATRIX to read all types of Data Matrix codes from the image. To control the long recognition cycle, use the reader property.tempo scaduto; prova la proprietà risultato.Livello di confidenza per filtrare le letture inaffidabili.
Questo articolo aiuta nella lettura dei codici Data Matrix. To create a Data Matrix code, refer to the article Generate Data Matrix barcode using Python.