フィルターのクリア

how qtdecomp works with uint8 matrix?

1 回表示 (過去 30 日間)
HaveF
HaveF 2012 年 8 月 11 日
I haven't fully understand how the qtdecomp works...
I = [1 1 1 1 2 3 6 6
1 1 2 1 4 5 6 8
1 1 1 1 10 15 7 7
1 1 1 1 20 25 7 7
20 22 20 22 1 2 3 4
20 22 22 20 5 6 7 8
20 22 20 20 9 10 11 12
22 22 20 20 13 14 15 16];
S = qtdecomp(I,2);
disp(full(S));
The answer is like this:
4 0 0 0 1 1 2 0
0 0 0 0 1 1 0 0
0 0 0 0 1 1 2 0
0 0 0 0 1 1 0 0
4 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
in the left bottom 4*4 matrix, maximum value(22) of the block elements minus the minimum value(20) is 2, so when decomposition this part, it will left as it is.
when I do this on a uint8 matrix:
I = uint8([1 1 1 1 2 3 6 6
1 1 2 1 4 5 6 8
1 1 1 1 10 15 7 7
1 1 1 1 20 25 7 7
20 22 20 22 1 2 3 4
20 22 22 20 5 6 7 8
20 22 20 20 9 10 11 12
22 22 20 20 13 14 15 16]);
S = qtdecomp(I,2/255);
disp(full(S));
the answer is just like before. but when I change S to this:
S = qtdecomp(I,1.9/255);
The answer is
4 0 0 0 1 1 2 0
0 0 0 0 1 1 0 0
0 0 0 0 1 1 2 0
0 0 0 0 1 1 0 0
4 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
I suppose the left bottom 4*4 matrix should decompose, but why it doesn't?

採用された回答

HaveF
HaveF 2012 年 9 月 17 日
What matlab does here is when I is uint8 it multiples the threshold by 255 and rounds it, so 1.9/255 is evaluated to 2.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOctave についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by