0.2.0 • Published 7 years ago

ndarray-mean v0.2.0

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

ndarray-mean

build status coverage status greenkeeper

calculates the mean average of multiple images

This module allows you to calculate the mean average, or centroid, of multiple images. So these input images:

input

Would be averaged to this output image:

output

Installation

npm install ndarray-mean

Example

So for example, to average two images:

const lena = require('lena');
const baboon = require('baboon-image');
const save = require('save-pixels');
const fs = require('fs');
const streamToPromise = require('stream-to-promise');
const mean = require('ndarray-mean');
const fs = require('fs');

const images = [lena, baboon];
const average = mean(images);

streamToPromise(save(average, 'png')).then(imageBuffer => {
  fs.writeFileSync('average.png', imageBuffer);
});

API

mean(images) ⇒ ndarray

Calculates the mean average of multiple images

Kind: global function Returns: ndarray - The mean average of all input images

ParamTypeDescription
imagesarrayAn array of ndarrays, all of the same dimensions

License

MIT

0.2.0

7 years ago

0.1.0

7 years ago