关于使用 skimage 执行基于区域边界的 RAG 的代码

regarding the code performing region boundary based RAGs using skimage

关于Region Boundary based RAGs,我不清楚定义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 并且没有颜色映射。但这是一个偏好问题,不是必需的!