Resource Base
Table of contents

CaptureVisionRouter Single Image Processing

Name Description
capture() Processes a single image or a file containing a single image to derive important information.

capture

Processes a single image or a file containing a single image to derive important information.

Syntax

capture(imageOrFile: Blob | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | DSImageData | string, templateName?: string): Promise<CapturedResult>;

Parameters

imageOrFile: specifies the image or file to be processed. The following data types are accepted: Blob, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, DSImageData, string.

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 with a CapturedResult object which contains the derived information from the image processed.

Code snippet

let router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
let results = await router.capture("blob:https://demo.dynamsoft.com/afb84bd2-e8cb-4b96-92b6-36dc89783692", "ReadSingleBarcode");
let count = results.items.length;
for(let i = 0; i < count; i++) {
    //...
}

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • 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