graph.route_through_array, a route is "outside"

Zachary Pincus zachary.pincus at yale.edu
Thu Nov 8 14:53:55 EST 2012


If you want a path that trends toward the "center" of the binary blobs, I have had luck using the MCP algorithm on suitably-transformed distance maps from the blobs. (You need to negate the distances and then add an offset to get the minimum cost to 1. Also, I've found that sometimes taking the log of the distances gives the path-finding algorithm a little more freedom, or you can exponentiate them to keep the path more centered.)

Zach


On Nov 8, 2012, at 2:44 PM, Jean-Patrick Pommier wrote:

> I could simplify my script but Zachary's message make me understand I can't directly use an idea from binary image to greyscale image.
> 
> Thanks
> 
> JP 
> 
> Le jeudi 8 novembre 2012 18:57:51 UTC+1, Stefan van der Walt a écrit :
> Hi JP 
> 
> On Thu, Nov 8, 2012 at 8:59 AM, jip <jeanpatri... at gmail.com> wrote: 
> > How to get a minimal cost route "inside" a particle (<>255)? 
> 
> Could you upload a minimal snippet to illustrate this behavior to 
> gist.github.com? 
> 
> Thanks 
> Stéfan 
> 
> -- 
>  
>  




More information about the scikit-image mailing list