Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@udarrr/template-matcher

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@udarrr/template-matcher

Locate images on your screen using template matching in nut.js or standalone

  • 1.3.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

OpenCV 4.1.1 Template Matching Image Finder

Tested Released Supported node LTS versions

It's plugin for nutjs project or standalone 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

npm i @udarrr/template-matcher

and connect finder to your project

import finder from "@udarrr/template-matcher";

//some examples
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
//nutjs options 
{
    confidence?: number,
    searchMultipleScales?: boolean,
    customOptions?: {
                       methodType: MethodNameType; 
                       scaleSteps: Array<number>; 
                       roi: Region; 
                       debug: boolean
                    },
}

//standalone
{
    haystack?: string | Image,
    needle: string | Image,
    confidence?: number,
    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

Keywords

FAQs

Package last updated on 10 Dec 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc