Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
vision-camera-dynamsoft-label-recognizer
Advanced tools
Readme
React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer
For vision-camera v2, use versions 0.x.
For vision-camera v3, use versions >= 1.0.0.
yarn add vision-camera-dynamsoft-label-recognizer
cd ios && pod install
Add the plugin to your babel.config.js
:
module.exports = {
plugins: [['react-native-worklets-core/plugin']],
// ...
Note: You have to restart metro-bundler for changes in the
babel.config.js
file to take effect.
Scan text with vision camera.
import { recognize } from 'vision-camera-dynamsoft-label-recognizer';
// ...
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
const scanResult = recognize(frame);
}, []);
Scan text from base64-encoded static images.
const scanResult = await decodeBase64(base64);
License initialization (apply for a trial license).
await initLicense("your license");
Scanning configuration:
//the value is in percentage
export interface ScanRegion{
left: number;
top: number;
width: number;
height: number;
}
export interface ScanConfig{
scanRegion?: ScanRegion;
includeImageBase64?: boolean;
}
export interface CustomModelConfig {
customModelFolder: string;
customModelFileNames: string[];
}
You can use a custom model like a model for MRZ passport reading using the CustomModelConfig
prop and update the template. You can find the MRZ model and template in the example.
You need to put the model folder in the assets
folder for Android or the root for iOS.
About the result:
export interface ScanResult {
results: DLRResult[];
imageBase64?: string;
}
export interface DLRResult {
referenceRegionName: string;
textAreaName: string;
pageNumber: number;
location: Quadrilateral;
lineResults: DLRLineResult[];
}
export interface Quadrilateral{
points:Point[];
}
export interface Point {
x:number;
y:number;
}
export interface DLRLineResult {
text: string;
confidence: number;
characterModelName: string;
characterResults: DLRCharacherResult[];
lineSpecificationName: string;
location: Quadrilateral;
}
export interface DLRCharacherResult {
characterH: string;
characterM: string;
characterL: string;
characterHConfidence: number;
characterMConfidence: number;
characterLConfidence: number;
location: Quadrilateral;
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer
The npm package vision-camera-dynamsoft-label-recognizer receives a total of 9 weekly downloads. As such, vision-camera-dynamsoft-label-recognizer popularity was classified as not popular.
We found that vision-camera-dynamsoft-label-recognizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.