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

如何使用OpenCV去除图像中的液滴与孔洞

问题:仅用OpenCV去除图像中的液滴与孔洞

处理前效果

使用remove_small_objects前

已尝试的代码

retval, labels, stats, centroids = cv2.connectedComponentsWithStats(output_im)

cleaned = morphology.remove_small_objects(labels, 1000)
cleaned = cleaned.astype(np.uint8)
labels = (labels * 255).astype(np.uint8)

retval_cl, labels_cl, stats_cl, centroids_cl = cv2.connectedComponentsWithStats(cleaned)

处理后效果(使用remove_small_objects)

使用remove_small_objects后

预期达成效果

预期效果

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.02 11:42:02