Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.40 KB | None | 0 0
  1. clear all
  2. clc
  3. close all
  4. A=imread('./images/wdg4.gif');
  5.  
  6. subplot(2,2,1)
  7. imshow(A,[0,255])
  8.  
  9. H_A = imhist(A);
  10. subplot(2,2,2)
  11. bar(H_A)
  12.  
  13. PROG = 40;
  14. B=A;
  15. [a,b]=size(B);
  16. pole=0;
  17. for i=1:a
  18.     for j=1:b
  19.         if B(i,j) <= PROG
  20.             B(i,j)=1;
  21.             pole = pole + 1;
  22.         else
  23.             B(i,j)=0;
  24.         end
  25.     end
  26. end
  27. subplot(2,2,3)
  28. imshow(B,[0,1]);
  29. pole/(a*b)
  30. pole
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement