1.2.0 • Published 7 years ago

adaptive-threshold v1.2.0

Weekly downloads
269
License
MIT
Repository
github
Last release
7 years ago

node-adaptive-threshold

Adaptive Threshold in JavaScript. Both in Node.js and browser.

Install

$ npm install adaptive-threshold

Usage

I made it as an ndarray module. So, the simplest usage is with get-pixels and save-pixels as below.

const fs = require('fs')
const savePixels = require('save-pixels')
const getPixels = require('get-pixels')
const adaptiveThreshold = require('adaptive-threshold')

getPixels('src.png', (err, pixels) => {
  if (err) {
    console.error(err)
    return
  }
  let thresholded = adaptiveThreshold(pixels)
  savePixels(thresholded, 'png').pipe(fs.createWriteStream('dist.png'))
})

API

adaptiveThreshold(pixels[, options])

Returns a thresholded ndarray.

  • pixels - an ndarray whose shape is width, height, channels.
  • options.size - the size of neighbourhood area.
  • options.compensation - a constant which is subtracted from the mean.
1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago