フィルターのクリア

how to save bit plane images created from a gray image

3 ビュー (過去 30 日間)
faraz.a
faraz.a 2013 年 5 月 29 日
this is the code which i wrote
A=imread('boy.tif');
B=bitget(A,1); figure, imshow(logical(B));title('Bit plane 1');imwrite(uint8(B), 'bp0.png');
B=bitget(A,2); figure, imshow(logical(B));title('Bit plane 2');imwrite(uint8(B), 'bp1.png');
B=bitget(A,3); figure, imshow(logical(B));title('Bit plane 3');imwrite(uint8(B), 'bp2.png');
B=bitget(A,4); figure, imshow(logical(B));title('Bit plane 4');imwrite(uint8(B), 'bp3.png');
B=bitget(A,5); figure, imshow(logical(B));title('Bit plane 5');imwrite(uint8(B), 'bp4.png');
B=bitget(A,6); figure, imshow(logical(B));title('Bit plane 6');imwrite(uint8(B), 'bp5.png');
B=bitget(A,7); figure, imshow(logical(B));title('Bit plane 7');imwrite(uint8(B), 'bp6.png');
B=bitget(A,8); figure, imshow(logical(B));title('Bit plane 8');imwrite(uint8(B), 'bp7.png');
then i wrote this
d=imread('bp7.png'); imshow(d)
it displayed a complete black image why is that now?
i want to save those bit plane images how to do that?

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 5 月 29 日
imshow(logical(d))
Otherwise you are attempting to display an image that has some pixels of value 0, and some pixels of value 1, in a situation where imshow() is expecting that the maximum value (white) will be 255. If you switch to logical() then it knows to use 0 for black, 1 for white.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by