0

Regarding the Region Boundary based RAGs, I am not clear about the code on defining edges_rgb, if I perform the RAG analysis over a gray image, why I need to transfer the edges into rgb color?

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)
user288609
  • 12,465
  • 26
  • 85
  • 127

1 Answers1

0

It turns out you don't. This code does the same thing:

g = graph.rag_boundary(labels, edges)
lc = graph.show_rag(labels, g, edges, img_cmap='gray', edge_cmap='viridis',
                    edge_width=1.2)

I guess the original author preferred using gray2rgb and no colormapping. But it's a matter of preference, not necessity!

Juan
  • 5,433
  • 21
  • 23