Hi all, Zachary posted code on scipy-dev to trace a shortest path through an image, given specified start and end points. With the shortest path algorithm already in scikits.image.graph, it would be possible to fix either the start or the end points, but not both. Zach's algorithm uses an iterative approach to achieve this goal. I'd be glad for any review comments. The code is here: http://github.com/stefanv/scikits.image/tree/master/scikits/image/graph Cheers Stéfan
Hi Stéfan, Assuming it's not easy to cast the input array to the float32 type, because I'm guessing it will be called with int arrays if not explicitly stated, can I suggest changing the documentation like: costs : (M, N) ndarray of float32 Also, can I suggest a returns section like this: Returns ------- tuple : (costs, paths) ``costs`` is an (M, N) ndarray of float32 of cumulative costs from the starting point ``paths`` is a list of paths where each path is a list of ``(x, y)`` positions ordered from the start to each end point -- Apart from that, I had a bit of a play with it and it worked nicely for me. The only other thing is maybe adding a test case with a couple of different goals might be good, like a goal that is the same as the start point and two goals that have the same coords (I tried these by had and they both work correctly) Gary R. On Nov 22, 10:31 pm, Stéfan van der Walt <ste...@sun.ac.za> wrote:
Hi all,
Zachary posted code on scipy-dev to trace a shortest path through an image, given specified start and end points. With the shortest path algorithm already in scikits.image.graph, it would be possible to fix either the start or the end points, but not both. Zach's algorithm uses an iterative approach to achieve this goal.
I'd be glad for any review comments. The code is here:
http://github.com/stefanv/scikits.image/tree/master/scikits/image/graph
Cheers Stéfan
participants (2)
-
Gary Ruben
-
Stéfan van der Walt