Did I find the right examples for you? yes no

All Samples(21)  |  Call(12)  |  Derive(0)  |  Import(9)

src/s/c/scikits-image-0.7.1/skimage/segmentation/boundaries.py   scikits-image(Download)
import numpy as np
from ..morphology import dilation, square
from ..util import img_as_float
 
 
def visualize_boundaries(img, label_img):
    img = img_as_float(img, force_copy=True)
    boundaries = find_boundaries(label_img)
    outer_boundaries = dilation(boundaries.astype(np.uint8), square(2))
    img[outer_boundaries != 0, :] = np.array([0, 0, 0])  # black

src/s/c/scikit-image-HEAD/skimage/segmentation/boundaries.py   scikit-image(Download)
import numpy as np
from ..morphology import dilation, square
from ..util import img_as_float
from ..color import gray2rgb
from .._shared.utils import deprecated
    if image.ndim == 2:
        image = gray2rgb(image)
    image = img_as_float(image, force_copy=True)
 
    boundaries = find_boundaries(label_img)

src/s/c/scikit-image-0.9.3/skimage/segmentation/boundaries.py   scikit-image(Download)
import numpy as np
from ..morphology import dilation, square
from ..util import img_as_float
from ..color import gray2rgb
from .._shared.utils import deprecated
    if image.ndim == 2:
        image = gray2rgb(image)
    image = img_as_float(image, force_copy=True)
 
    boundaries = find_boundaries(label_img)

src/s/c/scikit-image-0.9.3/skimage/feature/_brief.py   scikit-image(Download)
import numpy as np
from scipy.ndimage.filters import gaussian_filter
 
from ..util import img_as_float
from .util import _mask_border_keypoints, pairwise_hamming_distance
        raise ValueError("Only 2-D gray-scale images supported.")
 
    image = img_as_float(image)
 
    # Gaussian Low pass filtering to alleviate noise

src/s/c/scikit-image-HEAD/skimage/segmentation/random_walker_segmentation.py   scikit-image(Download)
    amg_loaded = False
from scipy.sparse.linalg import cg
from ..util import img_as_float
from ..filter import rank_order
 
                             'dimension 2 or 3.')
        dims = data.shape  # To reshape final labeled result
        data = np.atleast_3d(img_as_float(data))[..., np.newaxis]
    else:
        if data.ndim < 3:
            raise ValueError('For multichannel input, data must have 3 or 4 '
                             'dimensions.')
        dims = data[..., 0].shape  # To reshape final labeled result
        data = img_as_float(data)

src/s/c/scikit-image-0.9.3/skimage/segmentation/random_walker_segmentation.py   scikit-image(Download)
    amg_loaded = False
from scipy.sparse.linalg import cg
from ..util import img_as_float
from ..filter import rank_order
 
                                                 or 3.'
        dims = data.shape
        data = np.atleast_3d(img_as_float(data))[..., np.newaxis]
    else:
        dims = data[..., 0].shape
        assert multichannel and data.ndim > 2, 'For multichannel input, data \
                                                must have >= 3 dimensions.'
        data = img_as_float(data)

src/s/c/scikits-image-0.7.1/skimage/segmentation/random_walker_segmentation.py   scikits-image(Download)
    amg_loaded = False
from scipy.sparse.linalg import cg
from ..util import img_as_float
from ..filter import rank_order
 
        # We work with 4-D arrays of floats
        dims = data.shape
        data = np.atleast_3d(img_as_float(data))
        data.shape += (1,)
    else:
        dims = data[..., 0].shape
        assert multichannel and data.ndim > 2, 'For multichannel input, data \
                                                must have >= 3 dimensions.'
        data = img_as_float(data)

src/s/c/scikit-image-HEAD/skimage/filter/_gaussian.py   scikit-image(Download)
import warnings
 
from ..util import img_as_float
from ..color import guess_spatial_dimensions
 
        if len(sigma) != image.ndim:
            sigma = np.concatenate((np.asarray(sigma), [0]))
    image = img_as_float(image)
    return ndimage.gaussian_filter(image, sigma, mode=mode, cval=cval)
 

src/s/c/scikit-image-0.9.3/skimage/filter/_gaussian.py   scikit-image(Download)
import warnings
 
from ..util import img_as_float
from ..color import guess_spatial_dimensions
 
        if len(sigma) != image.ndim:
            sigma = np.concatenate((np.asarray(sigma), [0]))
    image = img_as_float(image)
    return ndimage.gaussian_filter(image, sigma, mode=mode, cval=cval)