mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-09 12:30:07 +08:00
Formatting and docstring changes
This commit is contained in:
@@ -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']:
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user