Result Methods
Method | Description |
---|---|
initIntermediateResult |
Inits an intermediateResult struct with default values. |
getIntermediateResults |
Get intermediate results. |
decodeIntermediateResults |
Decodes barcode from intermediate results. |
initIntermediateResult
Inits an intermediateResult struct with default values.
IntermediateResult initIntermediateResults(int resultType) throws BarcodeReaderException
Parameters
resultType
: An int value that indicates the intermediate result type. The int value should be available in (EnumIntermediateResultType).
Return Value
An IntermediateResult
struct with default values.
Exceptions
A BarcodeReaderException
is thrown when:
- Your license key doesn’t include the intermediate result item.
Code Snippet
BarcodeReader reader = new BarcodeReader();
/*Init DBR license before decoding*/
IntermediateResult imResult = reader.initIntermediateResult(EnumIntermediateResultType.IRT_ORIGINAL_IMAGE);
getIntermediateResults
Get intermediate results containing the original image, the color clustered image, the binarized Image, contours, Lines, TextBlocks, etc.
IntermediateResult[] getIntermediateResults() throws BarcodeReaderException
Return Value
The IntermediateResult
array were returned by the SDK.
Exceptions
A BarcodeReaderException
is thrown when:
- The library failed to get the intermediate result, which might because your license key doesn’t include the intermediate result item.
Code Snippet
BarcodeReader reader = new BarcodeReader();
PublicRuntimeSettings settings = reader.getRuntimeSettings();
settings.intermediateResultTypes = EnumIntermediateResultType.IRT_ORIGINAL_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CLUSTERED_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE;
reader.updateRuntimeSettings(settings);
TextResult[] result = reader.decodeFile("your file path");
IntermediateResult[] irtResult = reader.getIntermediateResults();
decodeIntermediateResults
Decodes barcode from intermediate results.
TextResult[] decodeIntermediateResults(IntermediateResult[] results) throws BarcodeReaderException
Parameters
results
: An array of intermediate result.
Return Value
The TextResult
of all successfully decoded barcodes. TextResult
includes the text, format and other information about the barcodes.
Exceptions
Code Snippet
BarcodeReader reader = new BarcodeReader();
/*Init DBR license before decoding*/
PublicRuntimeSettings settings = reader.getRuntimeSettings();
settings.intermediateResultTypes = EnumIntermediateResultType.IRT_ORIGINAL_IMAGE;
reader.updateRuntimeSettings(settings);
reader.decodeFile("your file path");
IntermediateResult[] irtResult = reader.getIntermediateResults();
TextResult[] result = reader.decodeIntermediateResults(irtResult);