8000 `peak_local_max` takes a very long time to complete · Issue #2758 · scikit-image/scikit-image · GitHub
[go: up one dir, main page]

Skip to content
peak_local_max takes a very long time to complete #2758
@stefanv

Description

@stefanv

From StackOverflow/45682644:

The following script computing peak_local_max on a binary image takes a very long time to complete.

from scipy import ndimage as ndi
from skimage import feature, io, img_as_float, measure, color
import numpy as np

binary_image_of_interest = img_as_float(color.rgb2gray(io.imread('test.png'))) > 0.5
cells = binary_image_of_interest
distance = ndi.distance_transform_edt(cells)

local_maxi = feature.peak_local_max(
    distance,
    footprint=np.ones((3, 3), dtype=np.bool),
    indices=False,
    labels = measure.label(cells)
)

test

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0