1.1.8 • Published 5 years ago

nathan-rectangle-scan v1.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Rectangle scan

Scans an image to see if there is a rectangle in a predefined place.

Setup

npm i nathan-rectangle-scan

const checker = new RectCheck();
const image = new Image();
image.onload = () => alert(checker.check(image, x, y, width, height)) ? "Found a rectangle!" : "Didn't find it"
image.src = "path-to-some-image.jpg";

Demo

Run gulp demo or visit the Live demo

Options

When instantiating the RectCheck class you can pass an object with options. const checker = new RectCheck(options)

namedefaultdescription
edgeThreshhold250how much of the search area has to be covered in edge for it to be considered valid
minContrast80The amount of contrast needed to be considered an edge
scale0.5The amount to scale the image by before running the edge detection (lower is faster)
searchWidth30The width (on side sides, height on top and bottom) to search for edges around input area

Building

Building index.js gulp build

Building the /dist version gulp build-dist

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago