# NOT RUN {
I = lena_crop #use a smaller image as an example
## add noise
sigma=20;
I_noise=AddNoise(I,sigma)
## spliting image into patches
m=64;
Y_nc = ImageSplit(I_noise,sqrt(m),sqrt(m));
mu=colMeans(Y_nc)
Y=Y_nc-rep(mu,each=nrow(Y_nc))
## use ODCT dictionary
D0=ODCT(64,100)
## denoise
# }
# NOT RUN {
Y_denoise=denoise(Y,D0,sigma)
# }
Run the code above in your browser using DataLab