Description Usage Arguments Value Author(s) Examples
A simple way of reconstructing an image from a patch decomposition.
1 | reconstructImage(X,nl,nc)
|
X |
the matrix of patches to be used for reconstructing the image. |
nl |
the number of rows of the image. |
nc |
the number of columns of the image. |
an image is returned as a matrix object, that can be display with the imshow
function.
C. Bouveyron & J. Delon
1 2 3 4 5 6 7 8 | 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)
par(mfrow=c(1,3)); imshow(Im); imshow(ImNoise); imshow(ImRec)
|
Loading required package: mclust
Package 'mclust' version 5.4.7
Type 'citation("mclust")' for citing this R package in publications.
Loading required package: Rmixmod
Loading required package: Rcpp
Rmixmod v. 2.1.5 / URI: www.mixmod.org
Loading required package: MASS
Loading required package: mvtnorm
Attaching package: ‘mvtnorm’
The following object is masked from ‘package:mclust’:
dmvnorm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.