CaptureVisionRouter Multiple Image Processing
Name | Description |
---|---|
setInput() | Sets up an image source to provide images for continuous processing. |
getInput() | Returns the image source object. |
addResultReceiver() | Adds a CapturedResultReceiver object as the receiver of captured results. |
removeResultReceiver() | Removes the specified CapturedResultReceiver object. |
addResultFilter() | Adds a MultiFrameResultCrossFilter object to filter non-essential results. |
removeResultFilter() | Removes the specified MultiFrameResultCrossFilter object. |
startCapturing() | Initiates a capturing process based on a specified template. |
stopCapturing() | Stops the capturing process. |
setInput
Sets up an image source to provide images for continuous processing.
Syntax
setInput(imageSource: ImageSourceAdapter): void;
Parameters
imageSource
: The image source which is compliant with the ImageSourceAdapter
interface.
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);
See Also
getInput
Returns the image source object.
Syntax
getInput(): ImageSourceAdapter;
Parameters
None.
Return Value
Returns the current image source.
Code snippet
const imageSource = CaptureVisionRouter.getInput();
addResultReceiver
Adds a CapturedResultReceiver
object as the receiver of captured results.
Syntax
addResultReceiver(receiver: 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.onCapturedResultReceived = (result) => {
/* Do something with the result */
};
router.addResultReceiver(resultReceiver);
removeResultReceiver
Removes the specified CapturedResultReceiver
object.
Syntax
removeResultReceiver(receiver: 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.onCapturedResultReceived = (result) => {
/* Do something with the result */
};
router.addResultReceiver(resultReceiver);
//...
router.removeResultReceiver(resultReceiver);
addResultFilter
Adds a MultiFrameResultCrossFilter
object to filter non-essential results.
Syntax
addResultFilter(filter: MultiFrameResultCrossFilter): Promise<void>;
Parameters
filter
: The filter object, of type MultiFrameResultCrossFilter
.
Return Value
A promise that resolves when the operation has successfully completed. It does not provide any value upon resolution.
Code snippet
filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter();
router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
router.addResultFilter(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
removeResultFilter
Removes the specified MultiFrameResultCrossFilter
object.
Syntax
removeResultFilter(filter: MultiFrameResultCrossFilter): : Promise<void>;
Parameters
filter
: The filter object, of type MultiFrameResultCrossFilter
.
Return Value
A promise that resolves when the operation has successfully completed. It does not provide any value upon resolution.
Code snippet
filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter();
router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
router.addResultFilter(filter);
// ...
router.removeResultFilter(filter);
startCapturing
Initiates a capturing process based on a specified template. This process is repeated for each image fetched from the source.
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 built-in 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("ReadSingleBarcode");
stopCapturing
Stops the capturing process.
Syntax
stopCapturing(): void;
Parameters
None.
Return Value
None.
Code snippet
router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
await router.startCapturing("ReadSingleBarcode");
// ...
router.stopCapturing();