mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-23 13:10:18 +08:00
Added example with cubehelix
This commit is contained in:
@@ -27,6 +27,13 @@ out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap,
|
||||
plt.figure()
|
||||
plt.title("RAG with edge weights less than 30, color "
|
||||
"mapped between blue and orange.")
|
||||
plt.imshow(out)
|
||||
|
||||
plt.figure()
|
||||
plt.title("All edges drawn with cubehelix colormap")
|
||||
cmap = plt.get_cmap('cubehelix')
|
||||
out = graph.draw_rag(labels, g, img, colormap=cmap,
|
||||
desaturate=True)
|
||||
|
||||
plt.imshow(out)
|
||||
plt.show()
|
||||
|
||||
@@ -251,8 +251,8 @@ def draw_rag(labels, rag, img, border_color=None, node_color='#ffff00',
|
||||
"""Draw a Region Adjacency Graph on an image.
|
||||
|
||||
Given a labelled image and its corresponding RAG, draw the nodes and edges
|
||||
of the RAG on the image with the specified colors. Nodes are markes by
|
||||
the centroids of the corresposning regions.
|
||||
of the RAG on the image with the specified colors. Nodes are marked by
|
||||
the centroids of the corresponding regions.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -276,7 +276,7 @@ def draw_rag(labels, rag, img, border_color=None, node_color='#ffff00',
|
||||
mapping.
|
||||
desaturate : bool, optional
|
||||
Convert the image to grayscale before displaying. Particularly helps
|
||||
visualiztion when using the `colormap` option.
|
||||
visualization when using the `colormap` option.
|
||||
in_place : bool, optional
|
||||
If set, the RAG is modified in place. For each node `n` the function
|
||||
will set a new attribute ``rag.node[n]['centroid']``.
|
||||
|
||||
Reference in New Issue
Block a user