logo

Décomposition en curvelet

C'est ici que vous poserez vos question sur mon logiciel de traitements d'images

Décomposition en curvelet

Messagede bassouma » 07 Mar 2012, 12:58

salut :)

Je cherche à appliquer la décomposition en curvelet pour l'image de Huffman, le code matlab est le suivant :
Code: Tout sélectionner
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)


Mais je n'arrive pas à l'exécuter :( , j'ai le message d'erreur suivant :

??? 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);

SVP pouvez vous m'aider à le corrigé.

Merci d'avance.
bassouma
 
Messages: 18
Inscription: 31 Jan 2012, 23:20

Retourner vers Logiciel de traitement d'images

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité

cron
Hit-Parade des sites francophones