Closed Xstoudi closed 1 year ago
Consider the following image.
Run this script in the same folder:
const { readSync, writeSync } = require('image-js') const image = readSync('image.png').grey().threshold({algorithm: 'otsu'}) writeSync('image-threshold.png', image) writeSync('image-eroded.png', image.erode()) writeSync('image-dilated.png', image.dilate())
Outputed image are the following.
image.erode():
image.erode()
image.dilate():
image.dilate()
My bad I obviously inverted white and black meaning myself. Nothing problematic here.
Consider the following image.
Run this script in the same folder:
Outputed image are the following.
image.erode()
:image.dilate()
: