salut,
J'essaye d'appliquer la décomposition en curvelet pour l'image de huffman,
Pour cela j'applique un bruit à l'image originale puis je calcul le psnr entre l'image originale et celle débruité.
Je vous donne le code matlab que j'ai utilisé :
quand je l'exécute j'ai le message d'erreur suivantCode:close all; clear all; clc im = double(imread('C:\Users\user\Desktop\ACTIVITEMULTI\base_originale\Hoffman.jpg')); %s = 512; sigma = 20; % NV(in); noise = randn(size(im)); noise = sigma.*(noise./(std(noise(:)))); % cfg = [4 5 5 6]; %cfg = [3 4 4 5]; cfg = [2 2 2 2 2]; alpha = 0.15; s = 512; resi = false; %%%%%%%%%%PDTDFB_WIN Generate the Freq. windows that used in PDTDFB toolbox%% % % F2 = pdtdfb_win(s2, alpha, Lnlev, res) % % Input: % s : size of the generated window % alpha : paramter for meyer window % % Output: % FL: 2-D window of low pass function for lower resolution curvelet % F : cell of size n containing 2-D matrices of size s*s %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% F = pdtdfb_win(s, alpha, length(cfg), resi); % disp('Compute all thresholds'); Ff = ones(s); X = fftshift(ifft2(Ff)) * sqrt(prod(size(Ff))); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % PDTDFBDEC_F Pyramidal Dual Tree Directional Filter Bank Decomposition % using FFT at the multresolution FB and the first two level of dual DFB % tree % % y2 = pdtdfbdec_f(im, nlevs, F2, alpha, res) % % Input: % x: Input image % nlevs: vector of numbers of directional filter bank decomposition levels % at each pyramidal level (from coarse to fine scale). % 0 : Laplacian pyramid level % 1 : Wavelet decomposition % n : 2^n directional PDTDFB decomposition % F2: [optional] Precomputed F window % alpha: [optional] Parameter for F2 window, incase F2 is not pre-computed % res : [optional] Boolean value, specify weather existing residual % band % % Output: % y: a cell vector of length length(nlevs) + 1, where except y{1} is % the lowpass subband, each cell corresponds to one pyramidal % level and is a cell vector that contains bandpass directional % subbands from the DFB at that level. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% yn = pdtdfbdec_f(noise, cfg, F, alpha, resi); y = pdtdfbdec_f(im, cfg, F, alpha, resi); clear eng for scale = 1:length(cfg) for dir = 1:2^cfg(scale) Y_coef_real = y{scale+1}{1}{dir}; % imaginary part Y_coef_imag = y{scale+1}{2}{dir}; % Signal variance estimation Y_coef = Y_coef_real+j*Y_coef_imag; Y_noise_real = yn{scale+1}{1}{dir}; % imaginary part Y_noise_imag = yn{scale+1}{2}{dir}; % Signal variance estimation Y_noise = Y_noise_real+j*Y_noise_imag; Y_coef = abs(Y_noise).*Y_coef./abs(Y_coef); y{scale+1}{1}{dir} = real(Y_coef); y{scale+1}{2}{dir} = imag(Y_coef); end end y{1} = zeros(size(y{1})); % Inverse Transform tic pim = pdtdfbrec_f(y, F, alpha,resi);toc respdtdfb = psnr(im, pim)
?? Error using ==> times
Matrix dimensions must agree.
Error in ==> pdtdfbdec_f at 74
imf2 = imf.*F{1};
Error in ==> curvelette at 62
yn = pdtdfbdec_f(noise, cfg, F, alpha, resi);
Je serais reconnaissante à vous si vous pouvez m'aider.
Merci d'avance.
-----