it-lady 0 Newbie Poster

I am trying to solve bit plane free error >.>

What is wronge here ?


img = imread('rose.tif');


img7 = double(bitand(img,128)); img6 = double(bitand(img,64));
img5 = double(bitand(img,32)); img4 = double(bitand(img,16));
img3 = double(bitand(img,8)); img2 = double(bitand(img,4));
img1 = double(bitand(img,2)); img0 = double(bitand(img,1));
subplot(4,1,2); imshow(img);title('rose.tif');
subplot(4,4,1); imshow(img7); title('Bit-plane 7');
subplot(4,4,2); imshow(img6); title('Bit-plane 6');
subplot(4,4,3); imshow(img5); title('Bit-plane 5');
subplot(4,4,4); imshow(img4); title('Bit-plane 4');
subplot(4,4,5); imshow(img3); title('Bit-plane 3');
subplot(4,4,6); imshow(img2); title('Bit-plane 2');
subplot(4,4,7); imshow(img1); title('Bit-plane 1');
subplot(4,4,8); imshow(img0); title('Bit-plane 0');
imwrite(img,'img7.tif');
imwrite(img,'img6.tif');
imwrite(img,'img5.tif');
imwrite(img,'img4.tif');
imwrite(img,'img3.tif');
imwrite(img,'img2.tif');
imwrite(img,'img1.tif');
imwrite(img,'img0.tif');
img7= img; img6 = img; img5 = img; img4 = img;
img3 = img; img2 = img; img1 = img; img0 = img;

h=imread('img7.tif');
a=imread('img6.tif');
b=imread('img5.tif');
c=imread('img4.tif');
d=imread('img3.tif');
r=imread('img2.tif');
t=imread('img1.tif');
y=imread('img0.tif');
g=imadd(h,a);
x=imadd(g,b);
s=imadd(x,c);
v=imadd(s,d);
% j=imadd(v,r);
% m=imadd(j,t);
% n=imadd(m,y);
subplot(4,4,9); imshow(g);
subplot(4,4,10); imshow(x);
subplot(4,4,11); imshow(s);
subplot(4,4,12); imshow(v);
% subplot(4,4,13); imshow(j);
% subplot(4,4,14); imshow(m);
% subplot(4,4,15); imshow(n);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.