Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ndarray-gaussian-filter

Package Overview
Dependencies
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-gaussian-filter - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

.travis.yml

4

example/example.js
"use strict"
var lena = require("luminance")(require("lena"))
var baboon = require("luminance")(require("baboon-image"))
var savePixels = require("save-pixels")
var blur = require("../gauss")
savePixels(blur(lena, 5), "png").pipe(process.stdout)
savePixels(blur(baboon, 5), "png").pipe(process.stdout)

@@ -6,3 +6,3 @@ "use strict"

var ndarray = require("ndarray")
var bits = require("bit-twiddle")
var nextPow2 = require("next-pow-2")
var ops = require("ndarray-ops")

@@ -22,3 +22,3 @@ var fft = require("ndarray-fft")

} else {
this.w[i] = -Math.pow(Math.PI * sigma[i] / n[i], 2)
this.w[i] = -2*Math.pow(Math.PI * sigma[i] / n[i], 2)
}

@@ -45,2 +45,5 @@ }

}
if(!Array.isArray(sigma)) {
sigma = dup(arr.dimension, sigma)
}
for(var i=0; i<arr.dimension; ++i) {

@@ -50,3 +53,3 @@ if(wrap[i]) {

} else {
padded[i] = bits.nextPow2(arr.shape[i])
padded[i] = nextPow2(arr.shape[i] + 2*Math.ceil(3*sigma[i]))
}

@@ -62,7 +65,3 @@ nsize *= padded[i]

fft(1, re, im)
if(Array.isArray(sigma)) {
gaussFilter(re, im, sigma)
} else {
gaussFilter(re, im, dup(arr.dimension, sigma))
}
gaussFilter(re, im, sigma)
fft(-1, re, im)

@@ -69,0 +68,0 @@ ops.assign(arr, re_top)

{
"name": "ndarray-gaussian-filter",
"version": "0.0.0",
"version": "1.0.0",
"description": "Gaussian filter for ndarrays",

@@ -9,24 +9,32 @@ "main": "gauss.js",

},
"browserify": {
"transform": [
"cwise"
]
},
"dependencies": {
"bit-twiddle": "^0.0.2",
"cwise": "^0.4.0",
"dup": "^0.0.0",
"ndarray": "^1.0.10",
"ndarray-fft": "^0.1.0",
"ndarray-ops": "^1.2.1",
"typedarray-pool": "^0.1.2"
"next-pow-2": "^1.0.0",
"cwise": "^1.0.7",
"dup": "^1.0.0",
"ndarray": "^1.0.18",
"ndarray-fft": "^1.0.0",
"ndarray-ops": "^1.2.2",
"typedarray-pool": "^1.1.0"
},
"devDependencies": {
"lena": "^1.0.0",
"luminance": "^1.0.2",
"save-pixels": "^0.3.0"
"baboon-image": "^2.0.0",
"luminance": "^1.0.3",
"save-pixels": "^2.2.0",
"tape": "^4.0.0",
"test-fuzzy-array": "^1.0.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "tape test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/mikolalysenko/ndarray-gaussian-filter.git"
"url": "git://github.com/scijs/ndarray-gaussian-filter.git"
},
"keywords": [
"scijs",
"ndarray",

@@ -38,7 +46,9 @@ "gaussian",

"author": "Mikola Lysenko",
"contributors": [
"Jasper van de Gronde <th.v.d.gronde@hccnet.nl>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/mikolalysenko/ndarray-gaussian-filter/issues"
},
"homepage": "https://github.com/mikolalysenko/ndarray-gaussian-filter"
"url": "https://github.com/scijs/ndarray-gaussian-filter/issues"
}
}

@@ -5,28 +5,28 @@ ndarray-gaussian-filter

# Example
[![build status](https://secure.travis-ci.org/scijs/ndarray-gaussian-filter.png)](http://travis-ci.org/scijs/ndarray-gaussian-filter)
## Example
```javascript
var lena = require("luminance")(require("lena"))
var baboon = require("luminance")(require("baboon-image"))
var savePixels = require("save-pixels")
var blur = require("ndarray-gaussian-filter")
savePixels(blur(lena, 5), "png").pipe(process.stdout)
savePixels(blur(baboon, 5), "png").pipe(process.stdout)
```
Writes the following png to stdout:
#### Output
![Output](example/blur.png)
<img src="https://raw.github.com/mikolalysenko/ndarray-gaussian-filter/master/example/blur.png">
## Install
Install using [npm](https://www.npmjs.com/):
# Install
npm install ndarray-gaussian-filter
```
npm install ndarray-gaussian-filter
```
## API
# API
### `require("ndarray-gaussian-filter")(array,radius[,wrap])`
#### `require("ndarray-gaussian-filter")(array,radius[,wrap])`
Filters an ndarray using a Gaussian filter.
* `array` is an ndarray
* `sigma` is the radius of the Gaussian filter. Can be either a scalar or array
* `array` is an ndarray.
* `sigma` is the radius of the Gaussian filter. Can be either a scalar or an array.
* `wrap` is checks whether the filter is applied as a circular convolution or uses `0` boundary. Default is `false`. Can be set as an array to select boundary conditions independently for each axis.

@@ -36,3 +36,3 @@

# Credits
## License
(c) 2014 Mikola Lysenko. MIT License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc