Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

canny-edge-detector

image-js105.3kMIT1.0.0

Canny edge detector

image-js, image, computer, vision, canny, edge, detector

readme

canny-edge-detector

NPM version build status npm download

Canny edge detector

Installation

$ npm install canny-edge-detector

Usage

cannyEdgeDetector(image[, options])

Find edges in an image using the Canny algorithm.
Returns a greyscale image with the edges at options.brightness value.

arguments

  • image - a greyscale Image
  • options - an optional object

options

  • lowThreshold: Low threshold for the hysteresis procedure (default: 10).
  • highThreshold: High threshold for the hysteresis procedure (default: 30).
  • gaussianBlur: Sigma parameter for the gaussian filter step (default: 1.1).
  • brightness: Values assigned to each edge pixel on the result image (default: image.maxValue).

Example

import cannyEdgeDetector from 'canny-edge-detector';
import Image from 'image-js';

Image.load('my-image.png').then((img) => {
  const grey = img.grey();
  const edge = cannyEdgeDetector(grey);
  return edge.save('edge.png');
})

License

MIT

changelog

1.0.0 (2017-06-28)