Find nearest seed index given geodesic distance of a binary image

4 vues (au cours des 30 derniers jours)
Zohaib Khan
Zohaib Khan le 18 Mar 2015
Given a binary image, BW, and a vector of seed locations, ind
D = bwdistgeodesic(BW,ind) computes the geodesic distance of each pixel in BW to the nearest seed.
How can one find a matrix I, same size as BW, which gives the index of the nearest seed for each pixel? For example, if there are 5 seeds, each pixel in I should have a value (1,2,3,4 or 5) depending on the nearest seed location based on the distance already found in D.
Cheers.

Réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by