Formatting and docstring changes

This commit is contained in:
Vighnesh Birodkar
2014-06-23 22:26:53 +05:30
parent 66d3ec3831
commit 27831d8e2f
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import numpy as np
def threshold_cut(label_image, rag, thresh):
"""Combines regions seperated by weight less than threshold.
"""Combine regions seperated by weight less than threshold.
Given an image's labels and its RAG, outputs new labels by
combining regions whose nodes are seperated by a weight less
@@ -46,7 +46,7 @@ def threshold_cut(label_image, rag, thresh):
comps = nx.connected_components(rag)
map_array = np.arange(label_image.max()+1, dtype=np.int)
map_array = np.arange(label_image.max() + 1, dtype=np.int)
for i, nodes in enumerate(comps):
for node in nodes:
for label in rag.node[node]['labels']:
+4 -3
View File
@@ -96,10 +96,11 @@ def rag_meancolor(image, label_image, connectivity=2):
Parameters
----------
image : (width, height, 3) or (width, height, depth, 3) ndarray
image : ndarray
Input image.
label_image : (width, height) or (width, height, depth) ndarray
The array with labels.
label_image : ndarray
The array with labels. This should have one dimention lesser than
`image`
connectivity : float, optional
Pixels with a squared distance less than `connectivity`from each other
are considered adjacent.