Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %zoom in / zoom out an image
- %scaleX = 2;
- %scaleY = 0.5;
- %
- %new = uint8(zeros(r * scaleX, c * scaleY));
- %for x = 1:r
- % for y = 1:c
- % new(ceil(scaleX * x), ceil(scaleY * y)) = i (x, y);
- % end
- %end
- %i = new
- %negation transform
- %for x = 1 : r
- % for y = 1 : c
- % i(x, y) = 255 - i(x, y);
- % end
- %end
- %gamma transform
- %gamma = 0.8
- %a = 1
- %for x = 1:r
- % for y = 1:c
- % i(x, y) = ceil (a * i(x, y) ^ gamma);
- % end
- % end
- %log transform
- %gamma = 1
- %for x = 1 : r
- % for y = 1 : c
- % i(x, y) = ceil(gamma * log( i(x, y) + 1));
- % end
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement