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

patch_summary_cimg

Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.


Description

Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.

Usage

patch_summary_cimg(im, expr, cx, cy, wx, wy)

Arguments

im

an image

expr

a CImg expression (as a string)

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

Examples

#Example: median filtering using patch_summary_cimg
#Center a patch at each pixel
im <- grayscale(boats)
patches <- pixel.grid(im)  %>% dplyr::mutate(w=3,h=3)
#Extract patch summary
out <- dplyr::mutate(patches,med=patch_summary_cimg(im,"ic",x,y,w,h))
as.cimg(out,v.name="med") %>% plot

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.