why does my colorbar look like this?

1 回表示 (過去 30 日間)
Hadeer tawfik
Hadeer tawfik 2016 年 8 月 8 日
コメント済み: Hadeer tawfik 2016 年 8 月 9 日
why does The colorbar looks gray all the time and matlab gives me this warning ?:
Warning: Error updating ColorBar. While setting the 'Limits_I' property of ColorBar: Value must be a 1x2 vector of numeric type in which the second element is larger than the first
> In defaulterrorcallback (line 12) In movegui (line 113) In images.internal.initSize (line 112) In imshow (line 305) In lena (line 13)
and here is the code:
A = imread('process/1.jpg');
B=blkproc(A,[8 8],'dct2')
imshow(log(abs(B)),[]), colormap(jet(64)), colorbar
figure
imshow(B);
B(abs(B)<10)=0;
figure
imshow(B);
C=blkproc(B,[8 8],'idct2');
round(C);
figure
imshow(C,[0 255]);
The image that i used :
the colorbar:

採用された回答

Image Analyst
Image Analyst 2016 年 8 月 8 日
You are not showing B and C with a colormap. They are on new figures and the colormap does automatically get copied onto completely new and different figures. Not only that, but they are different display ranges so even if you did they wouldn't look right.
Reissue the colormap command after you show the images on the new figures
colormap(jet(256));
  3 件のコメント
Image Analyst
Image Analyst 2016 年 8 月 9 日
I'm not really sure what you want. This is what I get:
indexedImage = imread('1.jpg');
blockImage = blkproc(indexedImage, [8, 8], 'dct2')
displayImage = log(abs(blockImage));
cmap = jet(64);
imshow(displayImage, cmap, 'InitialMagnification', 400);
axis on;
movegui('northwest');
colorbar
figure
imshow(blockImage, 'InitialMagnification', 400);
colormap(cmap);
colorbar
axis on;
movegui('northeast');
blockImage(abs(blockImage) < 10)=0;
figure
imshow(blockImage, 'InitialMagnification', 400);
colormap(cmap);
colorbar
axis on;
movegui('southwest');
C = blkproc(blockImage,[8 8],'idct2');
C = round(C);
figure
imshow(C, [0 255], 'InitialMagnification', 400);
colormap(cmap);
colorbar
axis on;
movegui('southeast');
Hadeer tawfik
Hadeer tawfik 2016 年 8 月 9 日
This is perfect, Thank you so much for your time

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by