Find nearest seed index given geodesic distance of a binary image
4 views (last 30 days)
Show older comments
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.
0 Comments
Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!