フィルターのクリア

How to Reconstruct an Image using bit plane. I have already separated all the bit layers of the image using for loops and bitget ?

21 ビュー (過去 30 日間)
if true
% code
endclc;
close all;
clear all;
I=imread('car.jpg');
Im=I(:,:,1);
figure
[r,c]=size(Im);
s=zeros(r,c,8);
for k= 1:8
for i=1:r
for j=1:c
s(i,j,k)=bitget(Im(i,j),k);
end
end
end
subplot(3,3,1) MSB=s(:,:,8); imshow(MSB) title('8th Bit/MSB Layer ')
subplot(3,3,2) Bit7=s(:,:,7); imshow(Bit7) title('7th Bit Layer ')
subplot(3,3,3) Bit6=s(:,:,6); imshow(Bit6) title('6th Bit Layer ')
subplot(3,3,4) Bit5=s(:,:,5); imshow(Bit5) title('5th Bit Layer ')
subplot(3,3,5) Bit4=s(:,:,4); imshow(Bit4) title('4th Bit Layer ')
subplot(3,3,6) Bit3=s(:,:,3); imshow(Bit3) title('3rd Bit Layer ')
subplot(3,3,7) Bit2=s(:,:,2); imshow(Bit2) title('2nd Bit Layer ')
subplot(3,3,8) LSB=s(:,:,1); imshow(LSB) title('LSB Layer ')

採用された回答

Image Analyst
Image Analyst 2018 年 7 月 1 日
Just multiply and add
uint8Image = uint8(LSB + 2*Bit2 + 4*Bit3 + 8*Bit4 + 16*Bit5 + 32*Bit6 + 64*Bit7 + 128*MSB);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by