diff options
author | nicholas-leonard <nick@nikopia.org> | 2014-10-09 08:13:29 +0400 |
---|---|---|
committer | nicholas-leonard <nick@nikopia.org> | 2014-10-09 08:13:29 +0400 |
commit | 9970262b8956cc706bbdfaa580554b9095061c52 (patch) | |
tree | f031207507574e48efeec55803cd5a6d064a9c1e /README.md | |
parent | a2e99d358ef1df5f8fd790031814d39d9abbaa3a (diff) |
Added doc for translate, scale and warp
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 42 |
1 files changed, 39 insertions, 3 deletions
@@ -1,8 +1,10 @@ # Image Package Reference Manual # - - * saving and loading images +Unless speficied otherwise, this package deals with images of size +`nChannel x height x width`. + * saving and loading images; + * translation, scaling and warping; -## [tensor] image.load(filename, depth, tensortype) ## +## [tensor] image.load(filename, [depth, tensortype]) ## Loads an image located at path `filename` having `depth` channels (1 or 3) into a [Tensor](https://github.com/torch/torch7/blob/master/doc/tensor.md#tensor) of type `tensortype` (*float*, *double* or *byte*). The last two arguments @@ -23,6 +25,40 @@ Saves Tensor `tensor` to disk at path `filename`. The format to which the image is saved is extrapolated from the `filename`'s extension suffix. The `tensor` should be of size `nChannel x height x width`. +## [result] image.translate([dst,] src, x, y) ## +Translates image `src` by `x` pixels horizontally and `y` pixels +vertically. If `dst` is provided, it is used to to store the output +image. Otherwise, return a new `result` Tensor. + +## [result] image.scale(src, width, height, [mode]) ## +Rescale the height and width of image `src` to have +width `width` and height `height`. Variable `mode` specifies +type of interpolation to be used. Valid values include +[bilinear](https://en.wikipedia.org/wiki/Bilinear_interpolation) +(the default) or *simple* interpolation. Returns a new `result` Tensor. + +### [result] image.scale(src, size, [mode]) ### +Rescale the height and width of image `src`. +Variable `size` is a number or a string specifying the +size of the result image. When `size` is a number, it specifies the +maximum height or width of the output. When it is a string like +*WxH* or *MAX* or *^MIN*, it specifies the `height x width`, maximum, or minimum height or +width of the output, respectively. + +### [result] image.scale(dst, src, [mode]) ### +Rescale the height and width of image `src` to fit the dimensions of +Tensor `dst`. + +### [result] image.warp([dst,] src, field, [mode, offsetMode, clampMode]) ### +Warps image `src` (of size`KxHxW`) +according to flow field `field`. The latter has size `2xHxW` where the +first dimension is for the `(y,x)` flow field. String `mode` can +take on values [lanczos](https://en.wikipedia.org/wiki/Lanczos_resampling), +[bicubic](https://en.wikipedia.org/wiki/Bicubic_interpolation), +[bilinear](https://en.wikipedia.org/wiki/Bilinear_interpolation) (the default), +or *simple*. When `offsetMode` is true (the default), `(x,y)` is added to the flow field. +The `clampMode` variable specifies how to handle the interpolation of samples off the input image. +Permitted values are *clamp* (the default) and *pad*. If `dst` is specified it is used to store the results of the warp. ## Dependencies: Torch7 (www.torch.ch) |