Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def features_for(im):
from features import chist
im = mh.imread(im)
img = mh.colors.rgb2grey(im).astype(np.uint8)
return np.concatenate([mh.features.haralick(img).ravel(),
chist(im)])
def compute_texture(im):
'''Compute features for an image
Parameters
----------
im : str
filepath for image to process
Returns
-------
fs : ndarray
1-D array of features
'''
from features import texture
imc = mh.imread(im)
return texture(mh.colors.rgb2grey(imc))