Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extract_patches

Extract image patches and return a list


Description

Patches are rectangular (cubic) image regions centered at cx,cy (cz) with width wx and height wy (opt. depth wz) WARNINGS: - values outside of the image region are subject to boundary conditions. The default is to set them to 0 (Dirichlet), other boundary conditions are listed below. - widths and heights should be odd integers (they're rounded up otherwise).

Usage

extract_patches(im, cx, cy, wx, wy, boundary_conditions = 0L)

extract_patches3D(im, cx, cy, cz, wx, wy, wz, boundary_conditions = 0L)

Arguments

im

an image

cx

vector of x coordinates for patch centers

cy

vector of y coordinates for patch centers

wx

vector of patch widths (or single value)

wy

vector of patch heights (or single value)

boundary_conditions

integer. Can be 0 (Dirichlet, default), 1 (Neumann) 2 (Periodic) 3 (mirror).

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

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

imager

Image Processing Library Based on 'CImg'

v0.42.10
LGPL-3
Authors
Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.