Wavelet and image processing

2 ビュー (過去 30 日間)
Ayesha
Ayesha 2014 年 1 月 17 日
コメント済み: Walter Roberson 2017 年 1 月 24 日
Hi there!
Alright, so I've been working on this little piece of code to approximate image using wavelets and there's this error I'm getting:
Subscripted assignment dimension mismatch.
So the code goes this way:
I = imread('lena.png');
J = perform_wavelet_transf(I,j0,+1);
n = size(I,1);
J1 = zeros(n);
J1(1:n/4,1:n/4) = J(1:m,1:m);
result = perform_wavelet_transf(J1,j0,-1);
imshow(result,[]);
I've been wondering since hours on what could possibly go wrong with this piece and I guess somethings not right with
J1(1:n/4,1:n/4) = J(1:m,1:m);
What do you think?
And yes, Thanks alot!!! for your help in advance :)
  2 件のコメント
Walter Roberson
Walter Roberson 2014 年 1 月 17 日
Which line is the error occurring on?
Ayesha
Ayesha 2014 年 1 月 17 日
The fifth line:
J1(1:n/4,1:n/4) = J(1:m,1:m);

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 1 月 17 日
You have not shown us how you construct "m" so all we can do is hypothesize that you construct it without regard for the actual size of lena.png
  2 件のコメント
Ayesha
Ayesha 2014 年 1 月 17 日
That's the part I'm experimenting since wavelets deals with coarse details and hence j0 is an integer.
j0=128;
M = 2^(-j0);
m=sqrt(M);
Walter Roberson
Walter Roberson 2017 年 1 月 24 日
sqrt(2^-128) is 2^-64, which is a number less than 1. 1:m would then be the empty range, so J(1:m,1:m) would be empty. You are trying to store that empty range into a non-empty location.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAI for Signals and Images についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by