I'm using the regionprops
function from the scikit-imag
e (or skimage
) package to compute region features of a segmented image using the SLIC superpixel algorithm from the same package.
I need additional features than those computed in the fucntion, mainly : standrad deviation, skewness, kurtosis.
I modified the source code of _regionprops.py
using the other features as template in order to include those properties :
@property
def sd_intensity(self):
return np.std(self.intensity_image[self.image])
@property
def skew_intensity(self):
return skew(self.intensity_image[self.image])
I know this is bad practice, and not a long term solution because my code won't be able to run on another machine or if i update skimage.
I discovered that the function skimage.measure.regionprops()
has a extra_properties=None
parameter, which according to the doc:
Add extra property computation functions that are not included with skimage.
My question is : Can I get a working example with np.std ? I don't really know how to use this parameter.
Thanks