Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. %zoom in / zoom out an image
  2. %scaleX = 2;
  3. %scaleY = 0.5;
  4. %
  5. %new = uint8(zeros(r * scaleX, c * scaleY));
  6.  
  7. %for x = 1:r
  8. % for y = 1:c
  9. % new(ceil(scaleX * x), ceil(scaleY * y)) = i (x, y);
  10. % end
  11. %end
  12. %i = new
  13.  
  14.  
  15. %negation transform
  16. %for x = 1 : r
  17. % for y = 1 : c
  18. % i(x, y) = 255 - i(x, y);
  19. % end
  20. %end
  21.  
  22. %gamma transform
  23. %gamma = 0.8
  24. %a = 1
  25. %for x = 1:r
  26. % for y = 1:c
  27. % i(x, y) = ceil (a * i(x, y) ^ gamma);
  28. % end
  29. % end
  30.  
  31. %log transform
  32. %gamma = 1
  33. %for x = 1 : r
  34. % for y = 1 : c
  35. % i(x, y) = ceil(gamma * log( i(x, y) + 1));
  36. % end
  37. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement