Git Product home page Git Product logo

ndarray-resample's Introduction

ndarray-resample

Resamples an ndarray by an arbitrary (rational) factor using a sinc kernel.

build status

Example

Here is a simple example showing how to downsample an image:

var baboon = require("luminance")(require("baboon-image"))
var x = require("zeros")([256,256])
require("ndarray-resample")(x, baboon)
require("save-pixels")(x, "png").pipe(process.stdout)

Output

Output

##Install Install using npm:

npm install ndarray-resample

API

require("ndarray-resample")(output, input[, clamp_lo, clamp_hi])

Resamples input by a factor of output.shape/input.shape, storing the result in output (this also means the factor can differ per dimension).

  • output gets the result of resampling
  • input is the array that gets resampled
  • clamp_lo is a threshold placed on the pixels
  • clamp_hi is an upper threhsold placed on the pixels

Note that the pixel at the "origin" in the output corresponds to the pixel at the origin in the input. Also, the boundary conditions are periodic (for now).

License

(c) 2013-2015 Mikola Lysenko, Jasper van de Gronde. MIT License

ndarray-resample's People

Contributors

deathcap avatar jaspervdg avatar mikolalysenko avatar rreusser avatar

Watchers

 avatar  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.