layout | title | description | keywords | needAutoGenerateSidebar | needGenerateH3Content | noTitleIndex | breadcrumbText |
---|---|---|---|---|---|---|---|
default-layout |
CaptureVisionRouter v2.0.10 Consecutive Process - Dynamsoft Capture Vision JavaScript Edition API |
This page introduces APIs related to Consecutive Process of Dynamsoft Capture Vision JavaScript Edition v2.0.10. |
capture vision, Consecutive Process, api reference, javascript, js |
true |
false |
true |
CVR JavaScript CaptureVisionRouter |
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. |
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);
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();
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);
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);
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
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);
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();
Stops the capturing process.
Syntax
stopCapturing(): void;
Parameters
None.
Return Value
None.
Code snippet
router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
router.stopCapturing();