Result Methods
Method | Description |
---|---|
initIntermediateResult |
Inits an intermediateResult struct with default values. |
getIntermediateResults |
Get intermediate results. |
decodeIntermediateResults |
Decodes barcode from intermediate results. |
enableResultVerification |
Enable Result Verification feature to improve the accuracy of barcode results for video streaming barcode decoding. This feature is not enabled by default. |
enableDuplicateFilter |
Enable Duplicate Filter feature to filter out the duplicate results in the period of 3000ms for video barcode decoding. Barcode results with the same text and format will be returned only once during the period. |
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,"");
enableResultVerification
Enable Result Verification feature to improve the accuracy of barcode results for video streaming barcode decoding. This feature is not enabled by default.
There are 2 way for you to get barcode results:
- From the return value of
decode
methods when processing a single image. - From the
textResultCallback
when processing the video streaming.
Result verification feature only effects on the OneD barcode results you get from textResultCallback
.
void enableResultVerification(boolean)
Code Snippet
reader.enableResultVerification(true)
// To check the status of this mode:
boolean x = reader.getEnableResultVerificationStatus();
enableDuplicateFilter
Enable Duplicate Filter feature to filter out the duplicate results in the period of 3000ms for video barcode decoding. Barcode results with the same text and format will be returned only once during the period.
There are 2 way for you to get barcode results:
- From the return value of
decode
methods when processing a single image. - From the
textResultCallback
when processing the video streaming.
Duplicate filter only effects on the duplicate results that output by textResultCallback
.
void enableDuplicateFilter(boolean)
Code Snippet
reader.enableDuplicateFilter(true)