GithubHelp home page GithubHelp logo

mnogom / pathfinder Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 527 KB

Console utility to find path on RGB image

Makefile 0.57% Python 99.43%
console-application path-planning pathfinding-algorithm

pathfinder's Introduction

Path Finder

Console utility to find path on RGB image


Maintainability python-ci


Installation

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

Usage

  1. 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
  1. 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')

Features

  1. Set up white value for outline image
  2. Reduce image for performance improvement
  3. Working with only RGB image

Examples

  1. Input image examples/1/plan.jpg Input image
pathfinder examples/1/plan.jpg -s 420 380 -g 250 40 -r 5 -w 240

Output image

pathfinder examples/1/plan.jpg -s 420 380 -g 520 600 -r 5 -w 240

Output image

pathfinder examples/1/plan.jpg -s 420 380 -g 45 350 -r 5 -w 240

Output image

  1. Input image examples/2/maze.jpg Input image
pathfinder examples/2/maze.jpg -s 20 300 -g 620 300 -r 8

Output image

pathfinder's People

Contributors

mnogom avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.