A Dijkstra-based route-planner between two points on a grid.
This repo contains a utility application that can generate the cheapest route between two points A and B, using a raster image as input. It is possible to write the resulting curve in SVG, white-space separated values, or JSON format. Below is an example of a generated path on top of a false-color representation with level curves of the input data.
The input is an image in EXR format, which may be a grayscale image, or an RGBA image. In the case of a grayscale image, the Y component is used as a height-map. In the RGBA case, it the additional channels gives control over pixel traversal cost, as well as the cost of traveling in a different direction. In both cases, a regular Euclidian norm is used to measure the distance between two points, that is
For a grayscale image, the Y component is mapped to
with respect to
For a RGBA image, the R component takes the role of describing the elevation at the current pixel.
The G component is used for describing cost of traversing the current pixel. It can be thought of as
a local friction coefficient
Notice that the vector part of the integral is over the absolute value of the projection between
Install maike2
, as well as the OpenEXR
dev libraries. After running maike2, you can launch the
program by running
__targets/bin/cheapest_route help=