(template parameter) Interpolation function, default linear.
Input image, which is remapped. Single and multiple channel images are allowed.
Target map, which holds [x, y] position for each pixel of an image.
Pre-allocated memory where resulting remapped image is stored, if defined. Should be of same shape as input image, or an emptySlice, which implies newly allocated image is used.
Remapped input image by given map.
Test if warp and remap always returns slice of corresponding format.
1 t 2 { 3 import std.random : uniform01; 4 import mir.ndslice.allocation; 5 6 auto image = iota(3, 3).as!float.slice; 7 auto wmap = iota(3, 3, 2).map!(v => cast(float)uniform01).slice; 8 9 auto warped = image.warp(wmap); 10 assert(warped.shape == image.shape); 11 12 auto remapped = image.remap(wmap); 13 assert(remapped.shape == image.shape
Pixel-wise remapping of the image.
Move each pixel of an image to a given [x, y] location defined by the map. Function is similar to dcv.imgproc.imgmanip.warp, except displacement of pixels is absolute, rather than relative.