Fix euler number bug for scipy-0.13

This commit is contained in:
Johannes Schönberger
2013-10-11 17:34:47 +02:00
parent 547c0bb7d8
commit f10c362b1a
+3 -3
View File
@@ -4,7 +4,7 @@ from math import sqrt, atan2, pi as PI
import numpy as np
from scipy import ndimage
from skimage.morphology import convex_hull_image
from skimage.morphology import convex_hull_image, label
from skimage.measure import _moments
@@ -155,8 +155,8 @@ class _RegionProperties(object):
@_cached_property
def euler_number(self):
euler_array = self.filled_image != self.image
_, num = ndimage.label(euler_array, STREL_8)
return -num
_, num = label(euler_array, neighbors=8, return_num=True)
return -num + 1
@_cached_property
def extent(self):