Learn R Programming

imager (version 0.14)

extract_patches: Return image patches

Description

Patches are rectangular (cubic) image regions centered at cx,cy (cz) with width wx and height wy (opt. depth wz)

Usage

extract_patches(im, cx, cy, wx, wy)

extract_patches3D(im, cx, cy, cz, wx, wy, wz)

Arguments

im
an image
cx
vector of x coordinates for patch centers
cy
vector of y coordinates for patch centers
wx
vector of coordinates for patch width
wy
vector of coordinates for patch height
cz
vector of z coordinates for patch centers
wz
vector of coordinates for patch depth

Value

  • a list of image patches (cimg objects)

Functions

  • extract_patches3D: Extract 3D patches

Examples

Run this code
#2 patches of size 5x5 located at (10,10) and (10,20)
extract_patches(boats,c(10,10),c(10,20),rep(5,2),rep(5,2))

Run the code above in your browser using DataLab