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.
ball-morphology
Advanced tools
Mathematical morphology for ndarrays where the structuring element is a ball in some Lp metric.
First, let's read an image:
var morphology = require("ball-morphology")
require("get-pixels")("bwimage.png", function(err, data) {
var r = data.pick(-1, -1, 0)
// ... do stuff ...
})
Which gives us the following array:
We can dilate the image using the following command:
morphology.dilate(r, 1)
Which produces the following result:
Similarly, we can also perform an erosion:
morphology.erode(r, 1)
Giving the result:
For convenience, openings and closing are also implemented:
morphology.open(r, 1)
morphology.close(r, 1)
npm install ball-morphology
var morphology = require("ball-morphology")
morphology.dilate(array, radius[, p])
Performs a binary morphological dilation with an Lp ball of a given radius
array
is a binary image (updated in place)radius
is the radius of the ball in pixel units (may be fractional)p
is an optional argument giving the exponent of the metric. (Default 2)Returns array
morphology.erode(array, radius[, p])
Performs a binary morphological erosion with an Lp ball of a given radius
array
is a binary image (updated in place)radius
is the radius of the ball in pixel units (may be fractional)p
is an optional argument giving the exponent of the metric. (Default 2)Returns array
morphology.open(array, radius[, p])
Performs a binary morphological opening with an Lp ball of a given radius
array
is a binary image (updated in place)radius
is the radius of the ball in pixel units (may be fractional)p
is an optional argument giving the exponent of the metric. (Default 2)Returns array
morphology.close(array, radius[, p])
Performs a binary morphological closing with an Lp ball of a given radius
array
is a binary image (updated in place)radius
is the radius of the ball in pixel units (may be fractional)p
is an optional argument giving the exponent of the metric. (Default 2)Returns array
(c) 2013 Mikola Lysenko. MIT License
FAQs
Morphological operations with ball shaped structuring elements
The npm package ball-morphology receives a total of 195 weekly downloads. As such, ball-morphology popularity was classified as not popular.
We found that ball-morphology demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.