Info

This question is closed. Reopen it to edit or answer.

How to obtain wavelet reconstructed image under command line?, how to get result in gray scale under command line?

1 view (last 30 days)
I am trying to learn wavelet toolbox (R2010a version) for developing some m-functions for image (gray scale) segmentation. To start with, I was analysing an image using Graphical interface and command line to check whether I am getting identical results (to build confidence!). I used simple 'dwt2' command to extract coefficients and then 'idwt2'/'upcoef2' commands (as per instructions) for reconstruction. However, I am getting two completely different results. Please help me in finding out my mistakes. Command line instructions used by me are:
[cA1,cH1,cV1,cD1] = dwt2(I,'db4');
A1 = upcoef2('a',cA1,'db4',1);
H1 = upcoef2('h',cH1,'db4',1);
V1 = upcoef2('v',cV1,'db4',1);
D1 = upcoef2('d',cD1,'db4',1);
OR
sx = size(I); A1 = idwt2(cA1,[],[],[],'db4',sx); H1 = idwt2([],cH1,[],[],'db4',sx); V1 = idwt2([],[],cV1,[],'db4',sx); D1 = idwt2([],[],[],cD1,'db4',sx);
For display:
subplot(2,2,1); image(wcodemat(A1,512)); title('Approximation A1') subplot(2,2,2); image(wcodemat(H1,512)); title('Horizontal Detail H1') subplot(2,2,3); image(wcodemat(V1,512)); title('Vertical Detail V1') subplot(2,2,4); image(wcodemat(D1,512)); title('Diagonal Detail D1')
Further, how to get result in gray scale under command line? Thanks a lot.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!