mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 20:30:14 +08:00
Merge pull request #688 from ahojnnes/regionprops-bugfix
Fix missing label property description and backwards compatibility of regionprops.
This commit is contained in:
@@ -33,6 +33,7 @@ PROPS = {
|
||||
'FilledImage': 'filled_image',
|
||||
'HuMoments': 'hu_moments',
|
||||
'Image': 'image',
|
||||
'Label': 'label',
|
||||
'MajorAxisLength': 'major_axis_length',
|
||||
'MaxIntensity': 'max_intensity',
|
||||
'MeanIntensity': 'mean_intensity',
|
||||
@@ -386,6 +387,8 @@ def regionprops(label_image, properties=None,
|
||||
Inertia tensor of the region for the rotation around its masss.
|
||||
**inertia_tensor_eigvals** : tuple
|
||||
The two eigen values of the inertia tensor in decreasing order.
|
||||
**label** : int
|
||||
The label in the labelled input image.
|
||||
**major_axis_length** : float
|
||||
The length of the major axis of the ellipse that has the same
|
||||
normalized second central moments as the region.
|
||||
|
||||
@@ -149,6 +149,11 @@ def test_image():
|
||||
assert_array_equal(img, SAMPLE)
|
||||
|
||||
|
||||
def test_label():
|
||||
label = regionprops(SAMPLE)[0].label
|
||||
assert_array_equal(label, 1)
|
||||
|
||||
|
||||
def test_filled_area():
|
||||
area = regionprops(SAMPLE)[0].filled_area
|
||||
assert area == np.sum(SAMPLE)
|
||||
|
||||
Reference in New Issue
Block a user