📄 s051.m
字号:
% 灰度图像位面切分 s051
a=imread('1.jpg');
a=rgb2gray(a);
s=im2double(a);
[m,n]=size(a);
for i=1:m
for j=1:n
s0=fix(s(i,j)*256);
r7(i,j)=bitget(s0,8);
r6(i,j)=bitget(s0,7);
r5(i,j)=bitget(s0,6);
r4(i,j)=bitget(s0,5);
r3(i,j)=bitget(s0,4);
r2(i,j)=bitget(s0,3);
r1(i,j)=bitget(s0,2);
r0(i,j)=bitget(s0,1);
end
end
subplot(2,4,1),imshow(r7);
subplot(2,4,2),imshow(r6);
subplot(2,4,3),imshow(r5);
subplot(2,4,4),imshow(r4);
subplot(2,4,5),imshow(r3);
subplot(2,4,6),imshow(r2);
subplot(2,4,7),imshow(r1);
subplot(2,4,8),imshow(r0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -