nut.js Template Matching Image Finder
| GitHub Actions |
---|
Master | |
Develop | |
It's plugin for nutjs project with some features like
- incresed accuracy (x10)
- incresed perfomance (~x2)
- added some customOptions for arguments
params?: OptionalSearchParameters
in nutjs !not implemented in nutjs yet, but available in standalone - added standalone
Installation for nutjs
npm i @udarrr/template-matcher
and then just use it in your project once
import "@udarrr/template-matcher"
or require("@udarrr/template-matcher")
Installation for standalone
import finder from "@udarrr/template-matcher";
const matcheImages = finder.findMatch({haystack: pathToImage, needle: pathToTemplate});
const matcheWithScreen = finder.findMatch({needle: pathToTemplate});
const matchesImages = finder.findMatches({haystack: pathToImage, needle: pathToTemplate});
const matchesWithScreen = finder.findMatches({needle: pathToTemplate});
Options
{
public confidence?: number,
public searchMultipleScales?: boolean,
customOptions?: {
methodType: MethodNameType;
scaleSteps: Array<number>;
roi: Region;
debug: boolean
},
}
- methodType: "TM_CCOEFF" | "TM_CCOEFF_NORMED" | "TM_CCORR" | "TM_CCORR_NORMED" | "TM_SQDIFF" | "TM_SQDIFF_NORMED" by default "TM_CCOEFF_NORMED"
- scaleSteps: [0.9]; by default [1, 0.9, 0.8, 0.7, 0.6, 0.5]
- debug: true | false by default false
for "TM_SQDIFF" | "TM_SQDIFF_NORMED" confidence by default 0.98
for "TM_CCOEFF" | "TM_CCOEFF_NORMED" | "TM_CCORR" | "TM_CCORR_NORMED" by default 0.8