Giter VIP home page Giter VIP logo

geometric-median's Introduction

Pixelwise Geometric Median

Average multiple images, using geometric median. Averaging is done pixelwise, using iterative vaiation of the Weiszfeld's algorithm.

Usage

geometric_median.py [-h] [-g] [-p] [-t N] [-i N] [--bias BIAS] [-n ORDER] [-c NAME] [-o OUTPUT] IMAGE [IMAGE ...]

  • -h, --help show this help message and exit
  • -g, --glob Apply glob on given paths (useful on windows)
  • -p, --preload Preload all images to memory. Faster, but requires a lot of memory.
  • -t N, --threads N Use N worker threads, default is processor number+1
  • -i N, --iterations N Number of iterations of the algorithm
  • --bias BIAS Bias of the algorithm, small positive floating-point value. Default is 1e-6.
  • -n ORDER, --norm ORDER Order of the norm function to calculate distances. Possible values are 1, 2, inf, -inf
  • -c NAME, --colormap NAME Apply specified color mapping before averaging images. Possible values are: none (use RGB as is), projective[:luma-weight=0.3] (suppress importance of luminance by luma-weight factor, value between 0 and 1)
  • -o OUTPUT, --output OUTPUT Output image file

Requirements

Code written in Python 3, but should be easily adaptable to Python 2. Requires following Python modules:

  • Numpy: for numeric calculations
  • PIL (or its fork Pillow): for reading and writing image files.

Troubleshooting

Script uses too much memory

Try reduce number of worker threads (default is number of processors).

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.