-
Notifications
You must be signed in to change notification settings - Fork 0
/
drawAffine.m
21 lines (19 loc) · 898 Bytes
/
drawAffine.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function drawAffine(afnv, tsize, color, linewidth, LineStyle)
rect= round(aff2image(afnv', tsize));
inp = reshape(rect,2,4);
topleft_r = inp(1,1);
topleft_c = inp(2,1);
botleft_r = inp(1,2);
botleft_c = inp(2,2);
topright_r = inp(1,3);
topright_c = inp(2,3);
botright_r = inp(1,4);
botright_c = inp(2,4);
p = line([topleft_c, topright_c], [topleft_r, topright_r]);
set(p, 'Color', color); set(p, 'LineWidth', linewidth); set(p, 'LineStyle', LineStyle);
p = line([topright_c, botright_c], [topright_r, botright_r]);
set(p, 'Color', color); set(p, 'LineWidth', linewidth); set(p, 'LineStyle', LineStyle);
p = line([botright_c, botleft_c], [botright_r, botleft_r]);
set(p, 'Color', color); set(p, 'LineWidth', linewidth); set(p, 'LineStyle',LineStyle);
p = line([botleft_c, topleft_c], [botleft_r, topleft_r]);
set(p, 'Color', color); set(p, 'LineWidth', linewidth); set(p, 'LineStyle', LineStyle);