Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
distance-transform
Advanced tools
Distance transforms for Lp metrics on binary ndarrays. This code is based on Meijster's algorithm. For more information see:
//Generate some shape as a binary voxel image
var x = require("zeros")([256, 256])
x.set(128, 128, 1)
//Distance transform x in the Euclidean metric
require("distance-transform")(x)
//Save result
require("save-pixels")(x, "png").pipe(process.stdout)
Install using npm:
npm install distance-transform
require("distance-transform")(array[, p])
Performs a distance transform of array
in place using Meijster's algorithm.
array
is the array to transformp
is the exponent for the metric. (Default 2)For different values of p you get different transforms
p = 1
gives the Manhattan/taxicab distance metricp = 2
gives the Euclidean distance metricp = Infinity
gives the Chebyshev/chessboard distance metricarray
is updated in place and gets the distance values.
(c) 2013 Mikola Lysenko. MIT License.
FAQs
Distance transforms for ndarrays
The npm package distance-transform receives a total of 407 weekly downloads. As such, distance-transform popularity was classified as not popular.
We found that distance-transform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.