Console utility to find path on RGB image
pip3 install --upgrade git+https://github.com/mnogom/pathfinder.git
or clone repo. Make sure you have poetry
git clone https://github.com/mnogom/pathfinder.git
cd pathfinder
make install
- From command line:
usage: pathfinder [-h] [-s X Y] [-g X Y] [-r REDUCE_FACTOR] [-w WHITE_VALUE]
path
Path finder
positional arguments:
path Path of image
optional arguments:
-h, --help show this help message and exit
-s X Y, --start X Y start coordinates
-g X Y, --goal X Y goal coordinates
-r REDUCE_FACTOR, --reduce-factor REDUCE_FACTOR
reduce factor
-w WHITE_VALUE, --white-value WHITE_VALUE
white value
- From Python
import pathfinder
plan = pathfinder.read('path/to/file.jpg', reduce_factor=5, white_value=240)
pathfinder.get_path(start_x, start_y, goal_x, goal_y, plan)
output_image = pathfinder.get_image_with_path(plan)
pathfinder.put_image(output_image, 'path/to/pathed_file.jpg')
- Set up white value for outline image
- Reduce image for performance improvement
- Working with only RGB image
pathfinder examples/1/plan.jpg -s 420 380 -g 250 40 -r 5 -w 240
pathfinder examples/1/plan.jpg -s 420 380 -g 520 600 -r 5 -w 240
pathfinder examples/1/plan.jpg -s 420 380 -g 45 350 -r 5 -w 240
pathfinder examples/2/maze.jpg -s 20 300 -g 620 300 -r 8