4.5.4 • Published 9 months ago

@udarrr/template-matcher v4.5.4

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
9 months ago

OpenCV 4.1.1 Template Matching Image Finder

Tested Released Supported node LTS versions

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,
                       rotationOption?: { range?: number; overLap?: number; minDstLength?: number, subPixEstimation?: boolean };
                       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

{
  searchInput: RegionResultFindInput | Promise<RegionResultFindInput>
  params?: {
      searchRegion?: Region | Promise<Region> | undefined;
      confidence?: number | undefined;
      abort?: AbortSignal | undefined;
      providerData?: {
          methodType?: MethodNameType;
          scaleSteps?: Array<number>;
          searchMultipleScales: boolean,
          isRotation: boolean,
          rotationOption?: { range?: number; overLap?: number; minDstLength?: number, subPixEstimation?: boolean };
          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,
rotationOption: {
                 range: 180, //-180 +180
                 overLap: 0.1, //inverted scale 0.1 = scaleSteps[0.9]
                 minDstLength: 32, //quality matching up to 4096
                 subPixEstimation: false //for low quality pics
                }
confidence: 0.8 //0.98 for TM_SQDIFF
4.5.4

9 months ago

4.5.3

9 months ago

2.2.1

11 months ago

2.0.4

11 months ago

3.0.1

11 months ago

4.4.1

10 months ago

4.0.1

11 months ago

4.2.1

10 months ago

4.0.3

11 months ago

2.1.2

11 months ago

2.1.1

11 months ago

2.1.4

11 months ago

2.1.3

11 months ago

2.1.6

11 months ago

2.1.8

11 months ago

2.1.7

11 months ago

4.3.2

10 months ago

4.3.1

10 months ago

4.1.3

10 months ago

4.5.2

10 months ago

4.1.0

11 months ago

4.1.2

10 months ago

4.1.1

11 months ago

2.0.1

1 year ago

1.4.6

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.9

1 year ago

1.2.0

1 year ago

1.3.7

1 year ago

1.2.8

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.3.5

1 year ago

1.1.7

1 year ago

1.3.4

1 year ago

1.2.5

1 year ago

1.1.6

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.2.3

1 year ago

1.3.1

1 year ago

1.2.2

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.3.8

1 year ago

1.2.9

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago