package
Convolution and cross correlation functions for ndarrays
npm install ndarray-convolveGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Convolutions and cross correlations on ndarrays.
//Read in test image
var lena = require("luminance")(require("lena"))
//Generate a 5-point Laplace filter
var filter = require("ndarray-pack")([[0, 1, 0],
[1, -4, 1],
[0, 1, 0]])
//Convolve them together
require("ndarray-convolve")(lena, filter)This produces the following array:
npm install ndarray-convolvevar convolve = require("ndarray-convolve")convolve( ... )Performs a convolution between two images with zero boundary conditions. As long as it does not cause unnecessary cropping, the kernel (b) will be assumed to have its origin in the center of the kernel (for even kernels, slightly to the right of the center, for example [1,2,3,4] would be assumed to have it origin at 3). There are four ways you can call this function:
convolve(a, b)Convolves a and b storing the result in a
convolve(out, a, b)Convolves a and b storing the result in out
convolve(a_r, a_i, b_r, b_i)Convolves two complex arrays storing the result in a_r, a_i
convolve(out_r, out_i, a_r, a_i, b_r, b_i)Convolves two complex array storing the result in out_r, out_i
convolve.wrap( ... )Convolves two arrays with periodic boundary conditions. Same convention as convolve
convolve.correlate( ... )Cross correlates two arrays with zero boundary conditions. Same convention.
convolve.correlate.wrap( ... )Cross correlates two arrays with wrapped boundary conditions. Same convention again.
(c) 2013 Mikola Lysenko. MIT License
jaspervdg
th.v.d.gronde@hccnet.nl
Estimated unpacked size across 31 packages.
2.5 MB
Includes dependencies.
7 direct dependencies.
^1.0.4
1.0.10
^1.0.15
1.1.1
^1.0.2
1.0.2
^1.0.0
1.0.3
^1.2.2
1.2.2
^1.0.1
1.0.3
^1.1.0
1.2.0