Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.44 KB | None | 0 0
  1. %{
  2. FIND THE NEGATIVE IMAGE
  3. %}
  4.  
  5. real = imread('z.jpg');
  6. real1=real;
  7. %%showing the image
  8. figure(1)
  9. subplot(2,2,[1 2]),imshow(real),title('Original Image');
  10. %%getting the gray image
  11. gray=rgb2gray(real1);
  12. [m,n]=size(gray);
  13. %now converting to get a negative image i.e 255-pixel value
  14. for i=1:m
  15.     for j=1:n
  16.         val=255-gray(i,j);
  17.         gray(i,j)=val;
  18.     end
  19. end
  20. subplot(2,2,[3 4]),imshow(uint8(gray)),title('Negative Image');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement