# HG changeset patch # User idamnjanovic # Date 1269525729 0 # Node ID cd55209c69e1fee4119560f108c9dde1f74517ee # Parent b6d8f2c4f5fa3782477eed89a3f00de3d9c7f52d diff -r b6d8f2c4f5fa -r cd55209c69e1 examples/Image Denoising/SMALL_ImgDenoise_DL_test_KSVDvsSPAMS.m --- a/examples/Image Denoising/SMALL_ImgDenoise_DL_test_KSVDvsSPAMS.m Thu Mar 25 13:03:50 2010 +0000 +++ b/examples/Image Denoising/SMALL_ImgDenoise_DL_test_KSVDvsSPAMS.m Thu Mar 25 14:02:09 2010 +0000 @@ -166,60 +166,60 @@ SMALL.solver(2)=SMALL_denoise(SMALL.Problem, SMALL.solver(2)); -%% -% Use SPAMS Online Dictionary Learning Algorithm -% to Learn overcomplete dictionary (Julien Mairal 2009) -% (If you have not installed SPAMS please comment the following two cells) - -% Initialising Dictionary structure -% Setting Dictionary structure fields (toolbox, name, param, D and time) -% to zero values - -SMALL.DL(3)=SMALL_init_DL(); - -% Defining fields needed for dictionary learning - -SMALL.DL(3).toolbox = 'SPAMS'; -SMALL.DL(3).name = 'mexTrainDL'; - -% Type 'help mexTrainDL in MATLAB prompt for explanation of parameters. - -SMALL.DL(3).param=struct(... - 'D', SMALL.Problem.initdict,... - 'K', SMALL.Problem.p,... - 'lambda', 2,... - 'iter', 200,... - 'mode', 3, ... - 'modeD', 0); - -% Learn the dictionary - -SMALL.DL(3) = SMALL_learn(SMALL.Problem, SMALL.DL(3)); - -% Set SMALL.Problem.A dictionary -% (backward compatiblity with SPARCO: solver structure communicate -% only with Problem structure, ie no direct communication between DL and -% solver structures) - -SMALL.Problem.A = SMALL.DL(3).D; - - -%% -% Initialising solver structure -% Setting solver structure fields (toolbox, name, param, solution, -% reconstructed and time) to zero values - -SMALL.solver(3)=SMALL_init_solver; - -% Defining the parameters needed for denoising - -SMALL.solver(3).toolbox='ompbox'; -SMALL.solver(3).name='ompdenoise'; - -% Denoising the image - SMALL_denoise function is similar to SMALL_solve, -% but backward compatible with KSVD definition of denoising - -SMALL.solver(3)=SMALL_denoise(SMALL.Problem, SMALL.solver(3)); +% %% +% % Use SPAMS Online Dictionary Learning Algorithm +% % to Learn overcomplete dictionary (Julien Mairal 2009) +% % (If you have not installed SPAMS please comment the following two cells) +% +% % Initialising Dictionary structure +% % Setting Dictionary structure fields (toolbox, name, param, D and time) +% % to zero values +% +% SMALL.DL(3)=SMALL_init_DL(); +% +% % Defining fields needed for dictionary learning +% +% SMALL.DL(3).toolbox = 'SPAMS'; +% SMALL.DL(3).name = 'mexTrainDL'; +% +% % Type 'help mexTrainDL in MATLAB prompt for explanation of parameters. +% +% SMALL.DL(3).param=struct(... +% 'D', SMALL.Problem.initdict,... +% 'K', SMALL.Problem.p,... +% 'lambda', 2,... +% 'iter', 200,... +% 'mode', 3, ... +% 'modeD', 0); +% +% % Learn the dictionary +% +% SMALL.DL(3) = SMALL_learn(SMALL.Problem, SMALL.DL(3)); +% +% % Set SMALL.Problem.A dictionary +% % (backward compatiblity with SPARCO: solver structure communicate +% % only with Problem structure, ie no direct communication between DL and +% % solver structures) +% +% SMALL.Problem.A = SMALL.DL(3).D; +% +% +% %% +% % Initialising solver structure +% % Setting solver structure fields (toolbox, name, param, solution, +% % reconstructed and time) to zero values +% +% SMALL.solver(3)=SMALL_init_solver; +% +% % Defining the parameters needed for denoising +% +% SMALL.solver(3).toolbox='ompbox'; +% SMALL.solver(3).name='ompdenoise'; +% +% % Denoising the image - SMALL_denoise function is similar to SMALL_solve, +% % but backward compatible with KSVD definition of denoising +% +% SMALL.solver(3)=SMALL_denoise(SMALL.Problem, SMALL.solver(3)); %% % Plot results and save midi files