How to obtain the DCT ( discrete cosine transform )?

5 ビュー (過去 30 日間)
Moon Shadow
Moon Shadow 2014 年 2 月 13 日
編集済み: Walter Roberson 2016 年 1 月 11 日
I want to btain the DCT on kids.tif image but I have these errors, What should I have do ?
RGB = imread ('kids.tif');
I = rgb2gray(RGB);
J= dct2 (I);
%taking logarithm
imshow (log(abs(J)),[]), colormap(jet(64)), colorbar
Now set values smaller than 10 in dct matrix to 0 and reconstruct the image using idct.
J(abs(J)<10) = 0;
K = idct2(J)/255;
imshow(K);
Error using rgb2gray>parse_inputs (line 81)
MAP must be a m x 3 array.
Error in rgb2gray (line 35)
X = parse_inputs(varargin{:});
Error using rgb2gray>parse_inputs (line 81)
MAP must be a m x 3 array.
Error in rgb2gray (line 35)
X = parse_inputs(varargin{:});

採用された回答

Dishant Arora
Dishant Arora 2014 年 2 月 13 日
編集済み: Dishant Arora 2014 年 2 月 13 日
The image must be an indexed image not a RGB image. You shall use ind2gray.
[I, map]=imread('kids.tif');
I1=ind2gray(I,map);

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by