Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer
Capacitor plugin of Dynamsoft Label Recognizer
https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer
Last synced: 3 months ago
JSON representation
Capacitor plugin of Dynamsoft Label Recognizer
- Host: GitHub
- URL: https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer
- Owner: tony-xlh
- Created: 2022-10-13T02:04:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T09:50:43.000Z (3 months ago)
- Last Synced: 2024-07-29T13:06:31.066Z (3 months ago)
- Language: JavaScript
- Size: 3.86 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
- awesome-capacitor - Label Recognizer - Recognize text on labels like MRZ on passports using Dynamsoft Label Recognizer. (Other plugins)
README
# capacitor-plugin-dynamsoft-label-recognizer
Capacitor plugin of [Dynamsoft Label Recognizer](https://www.dynamsoft.com/label-recognition/overview/) which brings text recognition ability to your apps.
## Versions
For Capacitor v5, use v1.x.
For Capacitor v4, use v0.x.
## SDK Versions Used for Different Platforms
| Product | Android | iOS | Web |
| ----------- | ----------- | ----------- | ----------- |
| Dynamsoft Label Recognizer | 2.x | 2.x | 2.x |## Install
```bash
npm install capacitor-plugin-dynamsoft-label-recognizer
npx cap sync
```## Demo
[Vanilla JS example](https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer/tree/main/example)
## API
* [`initialize()`](#initialize)
* [`initLicense(...)`](#initlicense)
* [`recognizeBase64String(...)`](#recognizebase64string)
* [`recognizeBitmap()`](#recognizebitmap)
* [`updateRuntimeSettings(...)`](#updateruntimesettings)
* [`resetRuntimeSettings()`](#resetruntimesettings)
* [`setEngineResourcesPath(...)`](#setengineresourcespath)
* [`addListener('onResourcesLoadStarted', ...)`](#addlisteneronresourcesloadstarted)
* [`addListener('onResourcesLoaded', ...)`](#addlisteneronresourcesloaded)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)### initialize()
```typescript
initialize() => Promise
```--------------------
### initLicense(...)
```typescript
initLicense(options: { license: string; }) => Promise
```| Param | Type |
| ------------- | --------------------------------- |
| **`options`** |{ license: string; }
|--------------------
### recognizeBase64String(...)
```typescript
recognizeBase64String(options: { base64: string; }) => Promise<{ results: DLRResult[]; }>
```| Param | Type |
| ------------- | -------------------------------- |
| **`options`** |{ base64: string; }
|**Returns:**
Promise<{ results: DLRResult[]; }>
--------------------
### recognizeBitmap()
```typescript
recognizeBitmap() => Promise<{ results: DLRResult[]; }>
```Android and iOS only method which directly read camera frames from capacitor-plugin-dynamsoft-camera-preview
**Returns:**
Promise<{ results: DLRResult[]; }>
--------------------
### updateRuntimeSettings(...)
```typescript
updateRuntimeSettings(options: { settings: RuntimeSettings; }) => Promise
```| Param | Type |
| ------------- | -------------------------------------------------------------------------- |
| **`options`** |{ settings: RuntimeSettings; }
|--------------------
### resetRuntimeSettings()
```typescript
resetRuntimeSettings() => Promise
```--------------------
### setEngineResourcesPath(...)
```typescript
setEngineResourcesPath(options: { path: string; }) => Promise
```| Param | Type |
| ------------- | ------------------------------ |
| **`options`** |{ path: string; }
|--------------------
### addListener('onResourcesLoadStarted', ...)
```typescript
addListener(eventName: 'onResourcesLoadStarted', listenerFunc: onResourcesLoadStartedListener) => Promise & PluginListenerHandle
```| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------------- |
| **`eventName`** |'onResourcesLoadStarted'
|
| **`listenerFunc`** |onResourcesLoadStartedListener
|**Returns:**
Promise<PluginListenerHandle> & PluginListenerHandle
--------------------
### addListener('onResourcesLoaded', ...)
```typescript
addListener(eventName: 'onResourcesLoaded', listenerFunc: onResourcesLoadedListener) => Promise & PluginListenerHandle
```| Param | Type |
| ------------------ | ------------------------------------------------------------------------------- |
| **`eventName`** |'onResourcesLoaded'
|
| **`listenerFunc`** |onResourcesLoadedListener
|**Returns:**
Promise<PluginListenerHandle> & PluginListenerHandle
--------------------
### removeAllListeners()
```typescript
removeAllListeners() => Promise
```--------------------
### Interfaces
#### DLRResult
| Prop | Type |
| ----------------- | ------------------------------------------------------------- |
| **`location`** |DLRQuadrilateral
|
| **`confidence`** |number
|
| **`lineResults`** |DLRLineResult[]
|#### DLRQuadrilateral
| Prop | Type |
| ------------ | ----------------------- |
| **`points`** |DLRPoint[]
|#### DLRPoint
| Prop | Type |
| ------- | ------------------- |
| **`x`** |number
|
| **`y`** |number
|#### DLRLineResult
| Prop | Type |
| ------------------------- | ------------------------------------------------------------- |
| **`text`** |string
|
| **`location`** |DLRQuadrilateral
|
| **`confidence`** |number
|
| **`isCheckDigitMatched`** |boolean
|#### RuntimeSettings
| Prop | Type |
| ----------------------- | --------------------------------------------------------------- |
| **`template`** |string
|
| **`customModelConfig`** |CustomModelConfig
|#### CustomModelConfig
| Prop | Type |
| -------------------------- | --------------------- |
| **`customModelFolder`** |string
|
| **`customModelFileNames`** |string[]
|#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** |() => Promise<void>
|### Type Aliases
#### onResourcesLoadStartedListener
(resourcePath: string): void
#### onResourcesLoadedListener
(resourcePath: string): void