reconstructImage {MBCbook} | R Documentation |
Reconstructing an image from a patch decomposition
Description
A simple way of reconstructing an image from a patch decomposition.
Usage
reconstructImage(X,nl,nc)
Arguments
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. |
Value
an image is returned as a matrix object, that can be display with the imshow
function.
Author(s)
C. Bouveyron & J. Delon
Examples
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)
[Package MBCbook version 0.1.2 Index]