# integral.im

0th

Percentile

##### Integral of a Pixel Image

Computes the integral of a pixel image.

Keywords
spatial, math
##### Usage
integral(f, domain=NULL, ...)## S3 method for class 'im':
integral(f, domain=NULL, \dots)
##### Arguments
f
A pixel image (object of class "im") with pixel values that can be treated as numeric or complex values.
domain
Optional. Window specifying the domain of integration.
...
Ignored.
##### Details

The function integral is generic, with methods for "im", "msr", "linim" and "linfun". The method integral.im treats the pixel image f as a function of the spatial coordinates, and computes its integral. The integral is calculated by summing the pixel values and multiplying by the area of one pixel.

The pixel values of f may be numeric, integer, logical or complex. They cannot be factor or character values.

The logical values TRUE and FALSE are converted to 1 and 0 respectively, so that the integral of a logical image is the total area of the TRUE pixels, in the same units as unitname(x).

##### Value

• A single numeric or complex value.

eval.im, [.im

• integral
• integral.im
##### Examples
# approximate integral of f(x,y) dx dy
f <- function(x,y){3*x^2 + 2*y}
Z <- as.im(f, square(1))
integral.im(Z)
integral.im(D, W)