pow raises every element of an Image object
to a power.
Arguments
- x
A 32- or 64-bit (32F or 64F)
Imageobject.- y
A numeric value representing the exponent of power. Note that for a non-integer power exponent, the absolute values of the
Imageobject are used.- target
The location where the results should be stored when passing a sum of images to the function. It can take 3 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- "self":
the results are stored back into
x(faster but destructive).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast but will replace the content oftarget. Note thattargetshould have the same dimensions, bitdepth, and number of channels asx, otherwise an error will be thrown.
Value
If target="new", the function returns an Image
object. If target="self", the function returns nothing and modifies
x in place. If target is an Image object, the
function returns nothing and modifies that Image object in
place.
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
changeBitDepth(balloon, "32F", 1 , "self")
#> NULL
pow(balloon, 2)
#> Class: image.
#> Dimensions: 640x360.
#> Type: BGR, 3-channel, 32F.
#> GPU: FALSE.