python-3.x - 关于使用 skimage 执行基于区域边界的 RAG 的代码
问题描述
关于基于区域边界的 RAG,我不清楚定义 edges_rgb 的代码,如果我对灰度图像执行 RAG 分析,为什么需要将边缘转换为 rgb 颜色?
edges_rgb = color.gray2rgb(edges)
g = graph.rag_boundary(labels, edges)
lc = graph.show_rag(labels, g, edges_rgb, img_cmap=None, edge_cmap='viridis',
edge_width=1.2)
解决方案
事实证明你没有。这段代码做同样的事情:
g = graph.rag_boundary(labels, edges)
lc = graph.show_rag(labels, g, edges, img_cmap='gray', edge_cmap='viridis',
edge_width=1.2)
我猜原作者更喜欢使用gray2rgb
而不是颜色映射。但这是一个偏好问题,而不是必要性问题!
推荐阅读
- javascript - 使用 nodejs 从 twitter API 检索超过 100 条推文
- nginx - 在没有 ssl 的生产服务器上带有乘客和 nginx 的操作电缆
- c# - 如何编写列表
在 C# 中以科学计数法转换为 Json? - postgresql - 如何在 PostgreSql 上使用 Jooq 级联截断?
- node.js - 登录成功但没有重定向到reactjs中的另一个页面(react-router-dom,axios)
- ibm-data-replication - IBM Data Replication - 如何从另一个表中检索和复制列?
- jquery - jQuery追加和删除动态表行,什么也没发生
- python - Python SQL插入未按正确顺序插入?
- angular - 如何从我的 Web API 访问 Google Drive API
- java - 无法使用 Selenium 在 LinkedIn 中定位元素