if I dct a gray image and then Idct, isnt it should be the original gray image?
2 ビュー (過去 30 日間)
古いコメントを表示
A=imread('yachae.jpg');
B=rgb2gray(A);
DCTB=dct2(B);
IDCTB=idct2(DCTB);
imshow(IDCTB);
isnt it should be the original image if I dct a gray image and idct back?
but the result is a white image...where should i fix?
0 件のコメント
回答 (1 件)
Walter Roberson
2019 年 11 月 23 日
No, it should not be the same. You are not doing an integer transform, so you are taking in a integer image and outputing a floating point result that is in approximately the same value range but is double precision instead of integer data type. imshow() applied to a double precision matrix assumes that the data is in the range 0 to 1 and that anything outside that range should saturate to the boundary.
Try
imshow(IDCTB, [])
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!