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

inpaint

Fill-in NA values in an image


Description

Fill in NA values (inpainting) using a Gaussian filter, i.e. replace missing pixel values with a weighted average of the neighbours.

Usage

inpaint(im, sigma)

Arguments

im

input image

sigma

std. deviation of the Gaussian (size of neighbourhood)

Value

an image with missing values filled-in.

Author(s)

Simon Barthelme

Examples

im <- boats
im[sample(nPix(im),1e4)] <- NA
inpaint(im,1) %>% imlist(im,.) %>%
   setNames(c("before","after")) %>% plot(layout="row")

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.