Skip to content

Commit ac87555

Browse files
committed
update readme
1 parent 87cfc08 commit ac87555

File tree

1 file changed

+16
-65
lines changed

1 file changed

+16
-65
lines changed

README.md

Lines changed: 16 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22
# vision-camera-dynamsoft-document-normalizer
33

4-
React Native Vision Camera Frame Processor Plugin of [Dynamsoft Barcode Reader](https://www.dynamsoft.com/document-normalizer/overview/).
4+
A React Native Vision Camera frame processor plugin for [Dynamsoft Document Normalizer](https://www.dynamsoft.com/document-normalizer/docs/).
5+
6+
It can detect document boundaries and run perspective transformation to get a normalized image.
7+
8+
[Demo video](https://user-images.githubusercontent.com/5462205/200720562-a7b91e06-cf6c-4235-a8cd-ef200012a42a.MP4)
59

610
## Versions
711

@@ -28,94 +32,41 @@ module.exports = {
2832
2933
## Usage
3034
31-
1. Scan barcodes with vision camera.
35+
1. Scan documents with vision camera.
3236
3337
```js
34-
import { decode } from 'vision-camera-dynamsoft-document-normalizer';
38+
import { detect } from 'vision-camera-dynamsoft-document-normalizer';
3539

3640
// ...
3741
const frameProcessor = useFrameProcessor((frame) => {
3842
'worklet';
39-
const barcodes = decode(frame);
43+
const detectionResults = detect(frame);
4044
}, []);
4145
```
4246
43-
2. Scan barcodes from a base64-encoded static image.
47+
2. Scan documents from a file.
4448
4549
```ts
46-
let results = await decodeBase64(base64);
50+
let detectionResults = await detectFile(photoPath);
4751
```
4852
49-
3. License initialization ([apply for a trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr)).
53+
3. Normalize a document image with the detection result.
5054
5155
```ts
52-
await initLicense("your license");
56+
let normalizedImageResult = await normalizeFile(photoPath, detectionResult.location,{saveNormalizationResultAsFile:true});
5357
```
5458
55-
### Interfaces
56-
57-
TextResult:
58-
59-
```js
60-
TextResult{
61-
barcodeText:string;
62-
barcodeFormat:string;
63-
barcodeBytesBase64:string;
64-
x1:number;
65-
x2:number;
66-
x3:number;
67-
x4:number;
68-
y1:number;
69-
y2:number;
70-
y3:number;
71-
y4:number;
72-
}
73-
```
74-
75-
Configuration:
59+
4. License initialization ([apply for a trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=ddn)).
7660
77-
```js
78-
DBRConfig{
79-
template?:string;
80-
license?:string;
81-
isFront?:boolean;
82-
rotateImage?:boolean;
83-
}
84-
```
85-
86-
`isFront` and `rotateImage` are Android-only. Since the natural camera sensor's orientation in Android is landscape, the camera image may be rotated for preview while the raw image we get is still not rotated. If we enable `rotateImage`, the plugin will rotate the image automatically to match the camera preview. If it is disabled, the plugin will rotate the returned coordinates instead of the image which may have a slight performance gain. `isFront` is needed for rotating the coordinates since the image of front camera is mirrored.
61+
```ts
62+
await initLicense("your license");
63+
```
8764
8865
## Supported Platforms
8966
9067
* Android
9168
* iOS
9269
93-
## Supported Barcode Symbologies
94-
95-
* Code 11
96-
* Code 39
97-
* Code 93
98-
* Code 128
99-
* Codabar
100-
* EAN-8
101-
* EAN-13
102-
* UPC-A
103-
* UPC-E
104-
* Interleaved 2 of 5 (ITF)
105-
* Industrial 2 of 5 (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5)
106-
* ITF-14
107-
* QRCode
108-
* DataMatrix
109-
* PDF417
110-
* GS1 DataBar
111-
* Maxicode
112-
* Micro PDF417
113-
* Micro QR
114-
* PatchCode
115-
* GS1 Composite
116-
* Postal Code
117-
* Dot Code
118-
11970
## Contributing
12071
12172
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

0 commit comments

Comments
 (0)