Rename weighted central moments property

This commit is contained in:
Johannes Schönberger
2013-10-15 15:12:00 +02:00
parent f5337e3616
commit 6711bfb3c8
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -47,7 +47,7 @@ PROPS = {
# 'PixelList',
'Solidity': 'solidity',
# 'SubarrayIdx'
'WeightedCentralMoments': 'weighted_central_moments',
'WeightedCentralMoments': 'weighted_moments_central',
'WeightedCentroid': 'weighted_centroid',
'WeightedHuMoments': 'weighted_moments_hu',
'WeightedMoments': 'weighted_moments',
@@ -288,7 +288,7 @@ class _RegionProperties(object):
return _moments.moments_central(self._intensity_image_double, 0, 0, 3)
@_cached_property
def weighted_central_moments(self):
def weighted_moments_central(self):
row, col = self.weighted_local_centroid
return _moments.moments_central(self._intensity_image_double,
row, col, 3)
@@ -299,7 +299,7 @@ class _RegionProperties(object):
@_cached_property
def weighted_moments_normalized(self):
return _moments.moments_normalized(self.weighted_central_moments, 3)
return _moments.moments_normalized(self.weighted_moments_central, 3)
def __getitem__(self, key):
value = getattr(self, key, None)
@@ -430,7 +430,7 @@ def regionprops(label_image, properties=None,
wm_ji = sum{ array(x, y) * x^j * y^i }
where the sum is over the `x`, `y` coordinates of the region.
**weighted_central_moments** : (3, 3) ndarray
**weighted_moments_central** : (3, 3) ndarray
Central moments (translation invariant) of intensity image up to
3rd order::
+2 -2
View File
@@ -269,9 +269,9 @@ def test_solidity():
assert_almost_equal(solidity, 0.580645161290323)
def test_weighted_central_moments():
def test_weighted_moments_central():
wmu = regionprops(SAMPLE, intensity_image=INTENSITY_SAMPLE
)[0].weighted_central_moments
)[0].weighted_moments_central
ref = np.array(
[[ 7.4000000000e+01, -2.1316282073e-13, 4.7837837838e+02,
-7.5943608473e+02],