A Julia package containing a number of algorithms for analyzing images and automatically binarizing them into background and foreground.
A full list of algorithms can be found in the documentation.
The general usage pattern is:
imgb = binarize(algorithm::ThresholdAlgorithm, img)
Original image |
||
Intermodes |
Minimum Error |
Minimum |
Moments |
Otsu |
Polysegment |
Rosin |
Sauvola |
Niblack |
Adaptive |
Yen |
Balanced |
Image of moon surface: (Unimodal)
Original image |
||
Intermodes |
Minimum Error |
Minimum |
Moments |
Otsu |
Polysegment |
Rosin |
Sauvola |
Niblack |
Adaptive |
Yen |
Balanced |
Image of text:
Original image |
||
Intermodes |
Minimum Error |
Minimum |
Moments |
Otsu |
Polysegment |
Rosin |
Sauvola |
Niblack |
Adaptive |
Yen |
Balanced |
Suppose one wants to binarize an image. This can be achieved by simply choosing
an appropriate algorithm and calling binarize
in the image. The background
and foreground will be automatically binarized.
using ImageBinarization
using TestImages # For the cameraman image.
#load cameraman image
img = testimage("cameraman")
#binarize the image
imgb = binarize(Otsu(), img)