This example program is located in your CVB installation under %CVB%Tutorial/cvb_code_reader/CVBpy/CodeReading
.
code_reading.py:
import os
import cvb
config = decoder.config(cvb.code_reader.Symbology.DataMatrix)
config.enable()
config.polarity = cvb.code_reader.Polarity.DarkOnLight
image_file = os.path.join(
cvb.install_path(),
"tutorial",
"CodeReader",
"Images",
"DataMat",
"Surrounded.bmp")
results = decoder.execute(image.planes[0])
print(f"{len(results)} code(s) found.")
for result in results:
print(f"{result.data}")
cvb.Image load(str file_name)
cvb.code_reader.Decoder create()