You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

skimage.feature的peak_local_max变更:如何获取图像同形布尔数组?

解决skimage.feature.peak_local_max返回布尔数组的官方方法

在scikit-image的新版本中,indices参数已被移除,若要获取标记局部最大值的布尔数组,只需在调用peak_local_max时指定output_type='mask'参数即可,替代旧版本indices=False的写法。

修改后的代码如下:

local_maxi = peak_local_max(distance, min_distance=50, labels=dapi_mask_oksize, output_type='mask')

如果需要同时获取局部最大值的坐标和布尔掩码,可设置output_type='both',函数会返回一个包含坐标数组与掩码数组的元组。

内容的提问来源于stack exchange,提问作者Emile Fortier

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 11:02:01