Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. pkg load image;
  2.  
  3. pic = randi(256,10);
  4.  
  5. hold on
  6.  
  7. imshow(mat2gray(pic));
  8. cols= size(pic,2);
  9. rows= size(pic,1);
  10.  
  11. ints = (0:255);
  12. ints(:)=0;
  13.  
  14.  
  15. for k = 1:1:256
  16. ints(k)=sum(pic(:)==k-1);
  17. end
  18.  
  19. figure;
  20. for c =1:cols
  21. for r = 1:rows
  22. val=pic(r,c)+1
  23. ints(val)++;
  24. end
  25. end
  26.  
  27. xaxis = (1:1:256) ;
  28. plot(xaxis,ints,'r');
  29. hold off;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement