Files
dev/script/test/test_binary.py
2018-08-15 17:04:21 +02:00

24 lines
1015 B
Python

###################################################################################################
# Example of using ImageJ functionalities through ijutils.
###################################################################################################
from ijutils import *
import java.awt.Color as Color
#Image Loading
ip = load_image("images/img.png", title="Image")
aux = grayscale(ip, in_place = False)
bin = ip.duplicate()
ip_bin = auto_threshold(aux, in_place=False)
create_stack([ ip_bin,
#binary_fill_holes(ip_bin, in_place=False),
#binary_outline(ip_bin, in_place=False),
#binary_outline(binary_fill_holes(ip_bin, in_place=False)),
binary_dilate(ip_bin, in_place=False),
binary_erode(ip_bin, in_place=False),
binary_open(ip_bin, in_place=False),
binary_close(ip_bin, in_place=False),
binary_skeletonize(ip_bin, in_place=False)], title = "Binarization").show()