How to use the mahotas.colors.rgb2grey function in mahotas

To help you get started, we’ve selected a few mahotas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github luispedro / BuildingMachineLearningSystemsWithPython / ch10 / large_classification.py View on Github external
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)])
github luispedro / BuildingMachineLearningSystemsWithPython / ch12 / image-classification.py View on Github external
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))