3.0.3 • Published 1 month ago

@appium/opencv v3.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 month ago

@appium/opencv

OpenCV-related helper methods

NPM version Downloads

Installation

npm install @appium/opencv

Usage

initOpenCv

Loads the opencv bindings. You only need to explicitly call this if you want to use your own opencv methods that are not included in this module.

import {initOpenCv} from '@appium/opencv';
await initOpenCv();

getImagesMatches

Calculates the count of common edges between two images. The images might be rotated or resized relatively to each other. See the function definition for more details.

import {getImagesMatches} from '@appium/opencv';
import {fs} from '@appium/support';

const image1 = await fs.readFile('image1.jpg')
const image2 = await fs.readFile('image2.jpg')
const {points1, rect1, points2, rect2, totalCount, count} = await getImagesMatches(image1, image2);

getImagesSimilarity

Calculates the similarity score between two images. It is expected that both images have the same resolution. See the function definition for more details.

import {getImagesSimilarity} from '@appium/opencv';
import {fs} from '@appium/support';

const image1 = await fs.readFile('image1.jpg')
const image2 = await fs.readFile('image2.jpg')
const {score} = await getImagesSimilarity(image1, image2);

getImageOccurrence

Calculates the occurrence position of a partial image in the full image. See the function definition for more details.

import {getImageOccurrence} from '@appium/opencv';
import {fs} from '@appium/support';

const fullImage = await fs.readFile('image1.jpg')
const partialImage = await fs.readFile('image2.jpg')
const {rect, score} = await getImageOccurrence(fullImage, partialImage);

License

Apache-2.0

3.0.3

1 month ago

3.0.2

3 months ago

3.0.1

4 months ago

3.0.0

5 months ago

2.1.6

6 months ago

2.1.2

9 months ago

2.1.4

7 months ago

2.1.3

9 months ago

2.1.5

7 months ago

2.1.1

11 months ago

2.1.0

12 months ago

2.0.10

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.1

1 year ago

1.0.13

2 years ago

2.0.0

1 year ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.2

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago