-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAffineScript.m
More file actions
47 lines (35 loc) · 856 Bytes
/
AffineScript.m
File metadata and controls
47 lines (35 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
clear all;
close all;
clc;
% ************************************************************************
% Kris Cote
% BEE 515
% Generate various versions of img by applying different affine
% transformations.
% ************************************************************************
img=checkerboard(20);
figure(1)
imshow(img,[])
title('Identity (Original)')
mag=[1,0];
X=affine(img,'reflect',mag,'nearest',0);
figure(2)
imshow(X,[])
title('Reflected Horizontaly')
mag=[2,1];
X=affine(img,'scale',mag,'nearest',0);
figure(3)
imshow(X,[])
title('Scaled 2x Horizontaly')
% Shear
mag=[0.5,0];
X=affine(img,'shear',mag,'nearest',0);
figure(4)
imshow(X,[])
title('Sheared Horizontaly')
% Shear
mag=[pi()/4,0];
X=affine(img,'rotate',mag,'nearest',0);
figure(5)
imshow(X,[])
title('rotated by \pi/4')