View source: R/denoisePatches.R
| denoisePatches | R Documentation | 
Denoising of image patches based on the clustering of patches.
denoisePatches(Y,out,P,sigma=10)
Y | 
 a data frame containing as rows the image patches to denoise  | 
out | 
 the mixmodCluster object that contains mixture parameters  | 
P | 
 the posterior probabilities that patches belong to the clusters  | 
sigma | 
 the noise standard deviation  | 
A data fame of the denoised patches is returned.
C. Bouveyron & J. Delon
Im = diag(16) 
ImNoise = Im + rnorm(256,0,0.1)
X = imageToPatch(ImNoise,4)
out = mixmodCluster(X,10,model=mixmodGaussianModel(family=c("spherical")))
res = mixmodPredict(X,out@bestResult)
Xdenoised = denoisePatches(X,out,P = res@proba,sigma = 0.1) 
ImRec = reconstructImage(Xdenoised,16,16)
oldpar <- par(no.readonly = TRUE)
par(mfrow=c(1,3))
imshow(Im); imshow(ImNoise); imshow(ImRec)
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.