移除图像边缘的标签
在科学分析图像时,通常只分析那些完全捕捉到的图像对象是相关的。
我们的起点应该是一个标签图像;例如通过对blobs.tif进行阈值处理和连通组件标记得到的:
c:\structure\code\pyclesperanto_prototype\pyclesperanto_prototype\_tier9\_imshow.py:34: UserWarning: cle.imshow is deprecated, use stackview.imshow instead.
warnings.warn("cle.imshow is deprecated, use stackview.imshow instead.")
|
cle._ image
| shape | (254, 256) |
| dtype | uint32 |
| size | 254.0 kB |
| min | 0.0 | | max | 62.0 |
|
Number of objects in the image: 62
如果对象的大小很重要,那么应该排除那些没有被完全成像并因此接触图像边缘的对象。
|
| shape | (254, 256) |
| dtype | uint32 |
| size | 254.0 kB |
| min | 0 | | max | 55 |
|
注意,上面标签图像中的最大强度是55,对象数量是44(见下文)。因此,这是一个并非所有1到44之间的标签都存在的标签图像。
Number of objects in the image: 44
随后的标记
许多用于进一步处理标签图像的算法要求标签是连续标记的。因此,我们需要修复上面的图像。
|
| shape | (254, 256) |
| dtype | uint32 |
| size | 254.0 kB |
| min | 0 | | max | 44 |
|
其他用于移除图像边缘对象的实现不需要这一步骤:
|
cle._ image
| shape | (254, 256) |
| dtype | uint32 |
| size | 254.0 kB |
| min | 0.0 | | max | 44.0 |
|
Number of objects in the image: 44