Note:- write this code in Matlab
CODE
%To create negative image
clf;
clf;
clear all;
close all;
i=imread('camera.bmp');
subplot(1,2,1);
imshow(i);
title('original image');
i=double(i);
[r c]=size(i);
for x=1:c
for y=1:r
i(y,x)=255-i(y,x);
end
end
i=uint8(i);
subplot(1,2,2)
imshow(i);
title('Negative image');
No comments:
Post a Comment