mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 11:21:07 +08:00
Rename weighted central moments property
This commit is contained in:
@@ -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::
|
||||
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user