You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -102,13 +107,13 @@ The following sample code sets up the SDK and implements boundary detection on a
102
107
103
108
-`Dynamsoft.Core.CoreModule.loadWasm(["DDN"])`: preloads the `DocumentNormalizer` module, saving time in preparing for document border detection and image normalization.
104
109
105
-
-`Dynamsoft.CVR.CaptureVisionRouter.createInstance()`: initializes the `cvRouter` variable by creating an instance of the `CaptureVisionRouter` class. An instance of `CaptureVisionRouter` is the core of any solution based on Dynamsoft Capture Vision architecture.
110
+
-`Dynamsoft.CVR.CaptureVisionRouter.createInstance()`: initializes the `router` variable by creating an instance of the `CaptureVisionRouter` class. An instance of `CaptureVisionRouter` is the core of any solution based on Dynamsoft Capture Vision architecture.
106
111
107
112
> Read more on [what is CaptureVisionRouter](https://www.dynamsoft.com/capture-vision/docs/core/architecture/#capture-vision-router)
108
113
109
114
-`Dynamsoft.DCE.CameraEnhancer.createInstance(view)`: initializes the `cameraEnhancer` variable by creating an instance of the `CameraEnhancer` class.
110
115
111
-
-`setInput()`: `cvRouter` connects to the image source through the [Image Source Adapter](https://www.dynamsoft.com/capture-vision/docs/web//programming/javascript/api-reference/core/image-source-adapter.html) interface with the method `setInput()`.
116
+
-`setInput()`: `router` connects to the image source through the [Image Source Adapter](https://www.dynamsoft.com/capture-vision/docs/web//programming/javascript/api-reference/core/image-source-adapter.html) interface with the method `setInput()`.
112
117
113
118
> The image source in our case is a CameraEnhancer object created with `Dynamsoft.DCE.CameraEnhancer.createInstance(view)`
114
119
@@ -168,46 +173,33 @@ To utilize the SDK, the initial step involves including the corresponding resour
168
173
*`cvr.js`: Required, introduces the `CaptureVisionRouter` class, which governs the entire image processing workflow.
169
174
*`dce.js`: Recommended, comprises classes that offer camera support and basic user interface functionalities.
170
175
171
-
For simplification, starting from version 2.2.10, we introduced ddn.bundle.js. Including this file is equivalent to incorporating all six packages.
- In some rare cases (such as some restricted areas), you might not be able to access the CDN. If this happens, you can use the following files for the test.
However, please **DO NOT** use `download2.dynamsoft.com` resources in a production application as they are for temporary testing purposes only. Instead, you can try hosting the SDK yourself.
209
-
210
-
#### Host the SDK yourself (Optional)
202
+
#### Host the SDK yourself
211
203
212
204
Besides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application. When using a CDN, resources related to `dynamsoft-image-processing` and `dynamsoft-capture-vision-std` are automatically loaded over the network; When using them locally, these two packages need to be configured manually.
213
205
@@ -217,35 +209,53 @@ Options to download the SDK:
217
209
218
210
[Download the JavaScript ZIP package](https://www.dynamsoft.com/document-normalizer/downloads/?ver=2.2.10&utm_source=guide)
219
211
220
-
-npm
212
+
-yarn
221
213
222
214
```cmd
223
-
npm i dynamsoft-document-normalizer-bundle@2.2.1000 -E
@@ -384,15 +394,15 @@ async function startDetecting() {
384
394
The steps of the workflow is as follows
385
395
386
396
1.`cameraEnhancer` streams the video, captures live video frames and stores them in a buffer.
387
-
2.`cvRouter` gets the video frames from `Image Source Adapter` and passes them to be processed by an internal `DocumentNormalizer` instance. The `cameraEnhancer` used here is a special implementation of the `Image Source Adapter`.
388
-
3. The internal `DocumentNormalizer` instance returns the found document boundaries, known as `quadsResultItems`, to `cvRouter`.
389
-
4. The `cvRouter` can output all types of CapturedResults that need to be captured through the `onCapturedResultReceived` callback function. In this example code we use the callback function to output `quadsResultItems` and `originalImageResultItem`.
397
+
2.`router` gets the video frames from `Image Source Adapter` and passes them to be processed by an internal `DocumentNormalizer` instance. The `cameraEnhancer` used here is a special implementation of the `Image Source Adapter`.
398
+
3. The internal `DocumentNormalizer` instance returns the found document boundaries, known as `quadsResultItems`, to `router`.
399
+
4. The `router` can output all types of CapturedResults that need to be captured through the `onCapturedResultReceived` callback function. In this example code we use the callback function to output `quadsResultItems` and `originalImageResultItem`.
390
400
391
401
> Also note that the `quadsResultItems` are drawn over the video automatically to show the detection in action.
392
402
393
403
*Note*:
394
404
395
-
*`cvRouter` is engineered to consistently request images from the image source.
405
+
*`router` is engineered to consistently request images from the image source.
396
406
* Three preset templates are at your disposal for document normalizing or border detection:
397
407
398
408
| Template Name | Function |
@@ -431,7 +441,7 @@ async function handleCapturedResult(result) {
431
441
if (frameCount ===30) {
432
442
frameCount =0;
433
443
/* Stops the detection task since we assume we have found a good boundary. */
434
-
cvRouter.stopCapturing();
444
+
router.stopCapturing();
435
445
/* Hides the cameraView and shows the imageEditorView. */
0 commit comments