#---------------read and scan an image---------
img = cv.imread('qr.bmp', cv.IMREAD_GRAYSCALE)
assert img is not None, "file could not be read, check with os.path.exists()"
height, width = img.shape[:2]
result_json = BarkoderSDK.decodeImage(img, width, height)
#---------------handle the result--------------
result = json.loads(result_json)
print("resultsCount: ", result["resultsCount"])
# the result is a Python dictionary:
if result["resultsCount"] == 1:
print(result["barcodeTypeName"])
print(result["textualData"])
elif result["resultsCount"] > 1:
for res in result["results"]:
print(res["barcodeTypeName"])
print(res["textualData"])
print("---------------------------")
else:
print("No barcode found.")
#---------------handle the result--------------