Apply Vector Translation To Pixel Image
Applies a vector shift to a pixel image
## S3 method for class 'im': shift(X, vec=c(0,0), ..., origin=NULL)
- Pixel image (object of class
- Vector of length 2 representing a translation.
- Character string determining a location
that will be shifted to the origin. Options are
"bottomleft". Partially matched.
The spatial location of each pixel in the image
is translated by the vector
This is a method for the generic function
origin is given, then it should be one of the character
vec will be ignored; instead the shift will be performed
so that the specified geometric location is shifted to the origin.
origin="centroid" then the centroid of the image window will be
shifted to the origin. If
origin="midpoint" then the centre of
the bounding rectangle of the image will be shifted to the origin.
origin="bottomleft" then the bottom left corner of the
bounding rectangle of the image will be shifted to the origin.
- Another pixel image (of class
"im") representing the result of applying the vector shift.
# make up an image X <- setcov(unit.square()) plot(X) Y <- shift(X, c(10,10)) plot(Y) # no discernible difference except coordinates are different shift(X, origin="mid")