inpaintImage: Use a given dictionary D to inpaint image

Description Usage Arguments Value Examples

View source: R/Inpaint.R

Description

The corrupted image is split into sqrt(m) by sqrt(m) patches. Each patch is vectorized into a column of matrix Y. Mask matrix M is constructed to indicate the location of missing pixels. Using the given D, the sparse coding A_hat in Y=DA is obtained. Then Y_inpaint=DA_hat. Then the final inpainted image is reconstruncted. See https://arxiv.org/abs/1605.07870

Usage

1
2
inpaintImage(I_corrupt, I_mask, D, L = 30, eps = NULL, sigma = 0,
  stepsize = 1)

Arguments

I_corrupt

The image to be inpainted. In form of matrix.

I_mask

0,1 matrix of the same size as I_corrupt to indicate the location of corrupted pixels.

D

D is the dictionary used in Y=DA to inpaint.

L

(optional) This parameter controls the maximum number of non-zero elements in each column of sparsecolding A.

eps

(optional) A lasso tuning paramter

sigma

Noise level.

stepsize

(optional) The stepsize when splicting the image. Default is 1

Value

The denoised image in for of a matrix.

Examples

1
2
3
4
5
6
7
8
9
I=lena_crop
## corrupt 30% of the image
out_corrupt=AddHoles(I,0.3)
I_corrupt=out_corrupt$corruptedImage
I_mask=out_corrupt$maskImage
## use ODCT dictionary
D0=ODCT(64,100)
## inpaint
out=inpaintImage(I_corrupt,I_mask,D0)

GSCAD documentation built on Oct. 6, 2017, 5:04 p.m.

Related to inpaintImage in GSCAD...