Package Exports
- @udarrr/template-matcher
- @udarrr/template-matcher/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@udarrr/template-matcher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
OpenCV 4.1.1 Template Matching Image Finder
It's either standalone or plugin for nutjs project
The best template matcher for node js ever with handlers
- Invariant Rotating
- Over Writing
- Scale Images
- Non Maximum Suppression
Standalone findMatch,findMatches
npm i @udarrr/template-matcher
import finder from "@udarrr/template-matcher";
(async () => {
const matcheImages = await finder.findMatch({haystack: 'pathToImage', needle: 'pathToTemplate'});
const matcheWithScreen = await finder.findMatch({needle: pathToTemplate});
const matchesImages = await finder.findMatches({haystack: 'pathToImage', needle: 'pathToTemplate'});
const matchesWithScreen = await finder.findMatches({needle: 'pathToTemplate'});
})();
@udarrr/template-matcher standalone API
{
haystack?: string | Image,
needle: string | Image,
confidence?: number,
providerData?: {
methodType?: MethodNameType;
scaleSteps?: Array<number>;
searchMultipleScales: boolean,
isRotation: boolean,
rotation?: { range?: number; overLap?: number; minDstLength?: number };
roi?: Region;
debug?: boolean
},
}
Nutjs v3 find,findAll
npm i @udarrr/template-matcher
import { imageResource, screen } from '@nut-tree/nut-js';
import {OptionsSearchParameterType} from '@udarrr/template-matcher/lib/types'
import "@udarrr/template-matcher"; //once wherever
(async () => {
const img = await screen.find<OptionsSearchParameterType>(imageResource("path"),{ providerData: {...}});
const imgs = await screen.findAll<OptionsSearchParameterType>(imageResource("path"),{ providerData: {...}});
})();
@udarrr/template-matcher providerData nutjs v3 Api
{
providerData?: {
methodType?: MethodNameType;
scaleSteps?: Array<number>;
searchMultipleScales: boolean,
isRotation: boolean,
rotation?: { range?: number; overLap?: number; minDstLength?: number };
debug?: boolean;
roi?: Region;
}
};
Values by default
methodType: "TM_CCOEFF_NORMED"
scaleSteps: [1, 0.9, 0.8, 0.7, 0.6, 0.5]
debug: false
searchMultipleScales: true,
isRotation: false,
rotation: {range: 180, overLap: 0.1, minDstLength: 2048}
confidence: 0.8