Morphological operations with ball shaped structuring elements
npm install ball-morphologyball-morphology
===============
Mathematical morphology for ndarrays where the structuring element is a ball in some Lp metric.
First, let's read an image:
``javascript
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:
`javascript`
morphology.dilate(r, 1)
Which produces the following result:

Similarly, we can also perform an erosion:
`javascript`
morphology.erode(r, 1)
Giving the result:

For convenience, openings and closing are also implemented:
`javascript`
morphology.open(r, 1)
morphology.close(r, 1)


npm install ball-morphology
`javascript`
var morphology = require("ball-morphology")
* 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
* 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
* 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
* 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`