0.5.0 • Published 5 years ago

ndarray-entropy v0.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

ndarray-entropy

Calculate the entropy of an intensity image, inspired by Matlab "entropy" function.

Usage

Syntax

entropy(img [,options]);

Options

Optionrequireddefaultdescription
channelno0Select the RGB channel to calculate the entropy for. 0 for the red channel, 1 for the green and 2 for the blue one. If img is a 2D array, this option has no effect.

Example

const getPixels = require('get-pixels');
const entropy = require('ndarray-entropy');

getPixels('nature.png', (err, img) => {
  if (!err && img) {
    console.log(entropy(img));
    // > 7.140717410116984
  }
})
0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago