Resource Base
Table of contents

CaptureVisionRouter Multiple Image Processing

Name Description
setInput() Sets an image source to provide images for consecutive process.
getInput() Gets an image source to provide images for consecutive process.
addResultReceiver() Adds an object as the receiver of captured results.
removeResultReceiver() Removes an object which was added as a receiver of captured results.
addResultFilter() Adds a result filter to the capture process for filtering non-essential results.
removeResultFilter() Removes a result filter for filtering non-essential results.
startCapturing() Initiates a capturing process based on a specified template.
stopCapturing() Stops the capturing process.

setInput

Sets the input image source for consecutive process.

Syntax

setInput(imageSource: Core.ImageSourceAdapter): void;

Parameters

imageSource: The image source adapter object representing the input image source.

Return Value

None.

Code snippet

router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
let view = await Dynamsoft.DCE.CameraView.createInstance();
cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(view);
router.setInput(cameraEnhancer);

getInput

Returns the current input image source of the CaptureVisionRouter.

Syntax

getInput(): Core.ImageSourceAdapter;

Parameters

None.

Return Value

Returns the current image source adapter object representing the input image source.

Code snippet

const imageSource = CaptureVisionRouter.getInput();

addResultReceiver

Adds an object as the receiver of captured results.

Syntax

addResultReceiver(receiver: Core.CapturedResultReceiver): void;

Parameters

receiver: The receiver object, of type CapturedResultReceiver.

Return Value

None.

Code snippet

router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
const resultReceiver = new Dynamsoft.CVR.CapturedResultReceiver();
resultReceiver.onDetectedQuadsReceived(result) {
    //* Do something with the result */
};
router.addResultReceiver(resultReceiver);

removeResultReceiver

Removes an object which was added as a receiver of captured results.

Syntax

removeResultReceiver(receiver: Core.CapturedResultReceiver): void;

Parameters

receiver: The receiver object, of type CapturedResultReceiver.

Return Value

None.

Code snippet

router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
const resultReceiver = new Dynamsoft.CVR.CapturedResultReceiver();
resultReceiver.onDetectedQuadsReceived(result) {
    //* Do something with the result */
};
router.addResultReceiver(resultReceiver);
router.removeResultReceiver(resultReceiver);

addResultFilter

Syntax

addResultFilter(filter: MultiFrameResultCrossFilter): Promise<void>;

Parameters

filter: The result filter object to be added.

Return Value

Returns a promise that resolves when the result filter have been successfully added.

Code snippet

filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter();
router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
router.addResultReceiver(filter);

In the provided code snippet, the default filter implementation is utilized. This filter can offer cross-validation and de-duplication functionalities. To utilize this filter, it’s necessary to include the corresponding package dynamsoft-utility.

See also

MultiFrameResultCrossFilter

removeResultFilter

Syntax

removeResultFilter(filter: MultiFrameResultCrossFilter): void;

Parameters

filter: The result filter object to be removed.

Return Value

None.

Code snippet

filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter();
router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
router.addResultReceiver(filter);
router.removeResultFilter(filter);

startCapturing

Initiates a capturing process based on a specified template.

Syntax

startCapturing(templateName?: string): Promise<void>;

Parameters

templateName: specifies a “CaptureVisionTemplate” to use. If not specified, “Default” is used. There are two types of CaptureVisionTemplates: the preset ones which come with the SDK and the custom ones that get initialized when the user calls initSettings. Please be aware that the preset CaptureVisionTemplates will be overwritten should the user calls initSettings and pass his own settings.

Return Value

A promise that resolves when the capturing process has successfully started. It does not provide any value upon resolution.

Code snippet

router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
await router.startCapturing();

stopCapturing

Stops the capturing process.

Syntax

stopCapturing(): void;

Parameters

None.

Return Value

None.

Code snippet

router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
router.stopCapturing();

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 2.0.10

  • Latest version(2.2.30)
  • Version 2.x
    • Version 2.2.10
    • Version 2.0.30
    • Version 2.0.20
    • Version 2.0.10
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support