Smoothing labels
In this notebook we will demonstrate how to fine-tune outlines of labels by smoothing them. The operation is related to erosion and dilation of labels. It is however not exactly what opening does. It differs by not leaving gaps behind but filling them with the closest labels.
A potential use-case is fine-tuning cell segmentation results. Thus, we take a look at a segmentation of cells based on membranes.
|
cle._ image
shape | (256, 256) |
dtype | float32 |
size | 256.0 kB |
min | 277.0 | max | 44092.0 |
|
|
cle._ image
shape | (256, 256) |
dtype | uint32 |
size | 256.0 kB |
min | 1.0 | max | 28.0 |
|
The smooth_labels
function allows to straighten the outlines of the labels.
|
cle._ image
shape | (256, 256) |
dtype | uint32 |
size | 256.0 kB |
min | 1.0 | max | 27.0 |
|
The following code block is a modified version of the code that was used to generate the video in this tweet where we discussed the name of the filter.