source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/add_translations.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 550 bytes
Line 
1function Mt = add_translations(M,ftrans)
2% Translation is assumed constant, in a random direction.  ftrans is the total
3% amount.
4nframes = size(M,1)/2;
5npts = size(M,2);
6
7translation_mag = ftrans/(nframes-1);
8% By the last frame, total translation should be ftrans.
9translation_dir = 2*pi*rand(1);
10translation_vec = translation_mag*[cos(translation_dir), sin(translation_dir)];
11
12A = repeat((0:nframes-1)',npts);
13Mt = M;
14Mt(1:2:2*nframes,:) = Mt(1:2:2*nframes,:)+translation_vec(1)*A;
15Mt(2:2:2*nframes,:) = Mt(2:2:2*nframes,:)+translation_vec(2)*A;
Note: See TracBrowser for help on using the repository browser.