Dev Center
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

Python API Reference - BarcodeReader Result Methods

Method Description
get_all_intermediate_results Returns intermediate results containing the original image, the colour clustered image, the binarized Image, contours, Lines, TextBlocks, etc.

get_all_intermediate_results

Returns intermediate results containing the original image, the colour clustered image, the binarized Image, contours, Lines, TextBlocks, etc.

BarcodeReader.get_all_intermediate_results() 

Return Value

intermediate_results <list[class IntermediateResult]> : A list of IntermediateResult values.

Code Snippet

from dbr import *
license_key = 'YOUR-LICENSE-KEY'
image_file = r'C:\Program Files (x86)\Dynamsoft\{Version number}\Images\AllSupportedBarcodeTypes.tif'

BarcodeReader.init_license(license_key)
reader = BarcodeReader()

sts = reader.get_runtime_settings()
sts.intermediate_result_saving_mode = EnumIntermediateResultSavingMode.IRSM_MEMORY
sts.intermediate_result_types = EnumIntermediateResultType.IRT_BINARIZED_IMAGE
reader.update_runtime_settings(sts)

try:
    text_results = reader.decode_file(image_file)
    if text_results != None:
        for text_result in text_results:
            print("Barcode Format :")
            print(text_result.barcode_format_string)
            print("Barcode Text :")
            print(text_result.barcode_text)
            print("Localization Points : ")
            print(text_result.localization_result.localization_points)
            print("-------------")
except BarcodeReaderError as bre:
    print(bre)

try: 
    intermediateResults = reader.get_all_intermediate_results()
    if intermediateResults != None:
        for intermediateResult in intermediateResults:
            if intermediateResult.data_type == EnumIMResultDataType.IMRDT_IMAGE
                # deal with the image
            else if intermediateResult.data_type == EnumIMResultDataType.IMRDT_LOCALIZATIONRESULT
                # analyze the localization result
            else if intermediateResult.data_type == EnumIMResultDataType.IMRDT_LINESEGMENT
                # obtain the line segment info for each line
            else if intermediateResult.data_type == EnumIMResultDataType.IMRDT_CONTOUR
                # analyze the contour data
            else if intermediateResult.data_type == EnumIMResultDataType.IMRDT_REGIONOFINTEREST
                # obtain the whole region of interest
            else
                # Quadrilateral data
except BarcodeReaderError as bre:
    print(bre)

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

version 9.6.20

  • Latest version
  • Version 10.x
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +