awsimage {adimpro} | R Documentation |
This function implements the Propagation-Separation approach (local constant and local polynomial model) for smoothing images.
awsimage(object, hmax=4, aws=TRUE, varmodel=NULL, ladjust=1.0, mask=NULL, xind = NULL, yind = NULL, wghts=c(1,1,1,1), scorr=TRUE, lkern="Triangle", demo=FALSE, graph=FALSE, max.pixel=4.e2, clip = FALSE, compress=TRUE) awspimage(object, hmax=12, aws=TRUE, degree=1, varmodel = NULL, ladjust=1.0, xind = NULL, yind = NULL, wghts=c(1,1,1,1), scorr= TRUE, lkern="Triangle", demo=FALSE, graph=FALSE, max.pixel= 4.e2, clip = FALSE, compress=TRUE)
object |
Image object, class "adimpro", as from
read.image , read.raw , or make.image . |
hmax |
Maximum bandwidth to use in the iteration procedure. |
aws |
(logical). If TRUE the propagation - separation
(PS) approach from Polzehl and Spokoiny (2006) is used.
aws=FALSE turns off the statistical penalty resulting in a
nonadaptive kernel estimate using a kernel with bandwidth hmax . |
degree |
Degree of the local polynomial model for
awspimage . 0, 1, or 2 only. |
varmodel |
varmodel specifies how variances are to be
estimated. This can be a homogeneous variance estimate
(varmodel="None" ) assuming uncorrelated errors (both spatial
and between channels). Alternatives are an adaptive homogeneous or linear
(function of the mean) variance estimate that depends on estimated
correlations and on residuals from the last iteration step.
The default varmodel=NULL corresponds to
varmodel == "Linear" if img$gamma==FALSE and
varmodel == "Constant" otherwise. |
ladjust |
adjustment factor for lambda (>=1). Default values for
lambda are selected for Gaussian distributions. Skewed or heavy
tailed distributions may require slightly larger values for lambda
to meet the propagation condition. ladjust allows to increase
lambda in such situations. |
mask |
logical array of the same size as the image or
NULL (default). Smoothing is restricted to the smallest rectangle
including all pixel where mask==TRUE and restricts
computations to these pixel. This need not be a
connected area (Typical usage: smooth all bright regions)!
Only used if is.null(xind) &&
is.null(yind) . Inactive if
mask==NULL . Can only be used if varmodel="None" . |
xind, yind |
Restrict smoothing to rectangular area defined by pixel
indices xind,yind in x- and y-direction. Full range
if NULL (default). |
wghts |
allows to weight the information from different (up to 4) color channels. The weights are used in the statistical penalty of the PS-procedure. |
scorr |
(logical). Specifies whether spatial correlation is to be
estimated. Defaults to TRUE . Is set to FALSE if
mask is not NULL . |
lkern |
Specifies the location kernel. Defaults to "Triangle", other choices are "Quadratic", "Cubic" and "Uniform". The use of "Triangle" corresponds to the Epanechnicov kernel nonparametric kernel regression. |
demo |
(logical). If demo=TRUE the function pauses after each
iteration. Defaults to FALSE . |
graph |
(logical). If graph=TRUE intermediate results are
illustrated after each iteration step. Defaults to FALSE . |
max.pixel |
Maximum dimension of images for display
if graph=TRUE . If the true dimension is larger, the
images are downscaled for display. See also show.image . |
clip |
(logical). If TRUE a clipping region is selected, see
clip.image , using the information contained in
xind or yind . If both are NULL a clipping
region can be defined by left mouse clicks. The image object
is reduced to the clipping region before smoothing. |
compress |
logical, determines if image data are stored in raw-format. |
The function implements the Propagation-Separation (PS) approach to nonparametric smoothing (formerly introduced as Adaptive Weights Smoothing) for varying coefficient likelihood (awsimage) and local polynomial (awspimage) models for greyscale and color images.
The distribution of grey (color) values is considered to be Gaussian. Noise can be colored.
The numerical complexity of the procedure is mainly determined by
hmax
. The number of iterations is 2*log(hmax)/log(1.25)
.
Comlexity in each iteration step is Const*hakt*n
with hakt
being the actual bandwith in the iteration step and n
the number of pixels.
hmax
determines the maximal possible variance reduction.
All other parameters of the approach only depend on the specified
values for skern/lkern
and are therefore set internally to
meaningful default values.
For a detailed description of the procedure see references below.
Object of class "adimpro"
img |
Contains the reconstructed image. |
ni |
Contains the sum of weights, i.e. trace(W_i) , in all grid points i . |
ni0 |
Contains the maximum sum of weights for an nonadaptive kernel estimate with the same bandwidth. |
hmax |
Bandwidth used in the last iteration. |
call |
The arguments of the function call. |
varcoef |
Estimated coefficients in the variance model for the
color channels, if varmodel is "Constant" or "Linear". |
wghts |
The weights used for the color channels. |
scorr |
Estimated spatial correlations for each channel, if scorr=TRUE |
chcorr |
Estimated correlations between
color channels, if scorr=TRUE |
Joerg Polzehl polzehl@wias-berlin.de
Polzehl and Spokoiny (2006). Propagation-Separation Approach for Local Likelihood Estimation. Probability Theory and Related Fields. 3 (135) 335 - 362.
Polzehl and Spokoiny (2005). Structural adaptive smoothing index{adaptive smoothing} by Propagation-Separation-methods. WIAS-Preprint No. 1068.
Polzehl, J. and Tabelow, K. (2007). Adaptive smoothing of digital images, Journal of Statistical Software 19 (1).
read.image
, read.raw
, make.image
, show.image
, clip.image
img.noise <- read.image(system.file("img/wias-noise.ppm",package="adimpro")) X11(width=7,height=3) img.hat.c <- awsimage(img.noise,hmax=15,graph=TRUE)