(image_segmentation.split_touching_objects)
分离接触的对象#
在本节中,我们将分离二值图像中具有圆形形状且相互接触的对象。我们将使用napari插件napari-segment-blobs-and-things-with-membranes。该插件在底层使用了scikit-image中的函数。
from napari_segment_blobs_and_things_with_membranes import threshold_otsu, split_touching_objects
from skimage.io import imread
from skimage import data
from pyclesperanto_prototype import imshow
这个过程的起点是一个二值图像,例如使用阈值分割生成的图像。
blobs = imread('../../data/blobs.tif')
binary = threshold_otsu(blobs)
imshow(binary)
然后,我们可以仅考虑二值图像来分离接触的对象。底层算法旨在产生类似于ImageJ的二值分水岭算法的结果,并且此处的实现也适用于3D图像。
split_objects = split_touching_objects(binary)
imshow(split_objects)