sqrt: Square Root Generic for Image objects

sqrtR Documentation

Square Root Generic for Image objects

Description

Overloaded sqrt to handle Image objects.

Usage

sqrt(x, target = "new")

Arguments

x

A 32- or 64-bit (32F or 64F) Image object.

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 Image object is created and the results are stored inside (the default).

  • "self":the results are stored back into x (faster but destructive).

  • An Image object:the results are stored in another existing Image object. This is fast but will replace the content of target. Note that target should have the same dimensions, bitdepth, and number of channels as x, 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(s)

Simon Garnier, garnier@njit.edu

See Also

exp, log, pow

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
changeBitDepth(balloon, "32F", 1 , "self")
sqrt(balloon)


swarm-lab/Rvision documentation built on Feb. 7, 2024, 4:59 a.m.