ndarray-warp
Inverse image warping operations for ndarrays.
Example
//Load input imagevar lena = //Allocate storage for resultvar result = 512 512 //Apply warpresult lena { var dx = inp0 - 256 var dy = inp1 - 256 var r = Math var theta = Math out0 = 09 * r * Math + 256 out1 = 07 * r * Math + 256} //Save the result to stdoutresult "png"
Which produces the following image:
Install
npm install ndarray-warp
require("ndarray-warp")(output, input, map(out_coord, in_coord))
Applies an inverse warp to an image
-
output
is an ndarray image that gets the result of applying the warp -
input
is an ndarray iamge that is warped -
map(result, coord)
is a mapping from the coordinates of out image to input image.result
gets the resulting coordinate ininput
coord
is the coordinate inoutput
Credits
(c) 2013 Mikola Lysenko. MIT License