euler number now behaves like MATLAB implementation

This commit is contained in:
Johannes Schönberger
2012-05-11 23:00:08 +02:00
parent 4eb3028a64
commit 19614cc8d7
+1 -1
View File
@@ -213,7 +213,7 @@ def regionprops(image, properties='all'):
_filled_image = ndimage.binary_fill_holes(array, STREL_8)
euler_array = _filled_image != array
_, num = ndimage.label(euler_array, STREL_8)
obj_props['EulerNumber'] = 1 - num
obj_props['EulerNumber'] = - num
if 'Extent' in properties:
obj_props['Extent'] = m[0,0] / (array.shape[0] * array.shape[1])