Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ObrazWejsciowy=double(ObrazWej);
  2.  
  3. lw=size(ObrazWejsciowy,1);
  4. lk=size(ObrazWejsciowy,2);
  5.  
  6. histogram=zeros(2, 256);
  7. dystrybuanta=zeros(2,256);
  8.  
  9. for i=1:lk
  10. histogram(2,i) = i - 1;
  11. end
  12.  
  13. for k=1:lw
  14. for j=1:lk
  15. histogram(1,ObrazWejsciowy(k,j)) = histogram(1,ObrazWejsciowy(k,j)) + 1;
  16. end
  17. end
  18.  
  19. dystrybuanta(1,1) = histogram(1,1);
  20.  
  21. for m=2:lw
  22. dystrybuanta(1,m) = dystrybuanta(1,m-1)+histogram(1,m);
  23. end
  24.  
  25. for k=1:lw
  26. for j=1:lk
  27. ObrazWyjsciowy(k,j)=round(((dystrybuanta(1,ObrazWejsciowy(k,j) - dystrybuanta(1,1)))/dystrybuanta(1,256))*255);
  28. end
  29. end
  30.  
  31. ObrazWyjsciowy=uint8(ObrazWyjsciowy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement