source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/LocalAlignments/nfi2r.m @ 37

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

Added original make3d

File size: 1.1 KB
Line 
1% nfi2r   Computes rotation matrix, axis of rotation and the angle are given
2%
3% R = nfi2r(n,fi)
4% Inputs:
5% n[3x1]  ... axis of rotation (vector of direction)
6% fi[rad] ... angle of rotation (counter clockwise)
7% Return:
8% R ... rotation matrix
9%
10% T. Svoboda, 3/1998, CMP Prague
11%
12% $Id: nfi2r.m,v 1.1 2003/07/03 15:38:40 svoboda Exp $
13
14% page 203 of the book:
15% @BOOK{Kanatani90,
16% AUTHOR             = {Kanatani, Kenichi},
17% PUBLISHER          = {Springer-{V}erlag},
18% TITLE              = {Group-{T}heoretical Methods in Image Understanding},
19% YEAR               = {1990},
20% HARDCOPY            = { CMPlib.book.BC14 },
21% SIGNATURE          = {X-copy},
22% ISSN_ISBN          = {3-540-51263-5},
23%
24
25function R = nfi2r(n,fi)
26
27n = n./norm(n,2);
28cfi = cos(fi);
29sfi = sin(fi);
30
31R(1,1:3) = [ cfi+n(1)^2*(1-cfi), n(1)*n(2)*(1-cfi)-n(3)*sfi, n(1)*n(3)*(1-cfi)+n(2)*sfi ];
32R(2,1:3) = [ n(1)*n(2)*(1-cfi)+n(3)*sfi, cfi+n(2)^2*(1-cfi), n(2)*n(3)*(1-cfi)-n(1)*sfi ];
33R(3,1:3) = [ n(3)*n(1)*(1-cfi)-n(2)*sfi, n(3)*n(2)*(1-cfi)+n(1)*sfi, cfi+n(3)^2*(1-cfi) ];
34
35R = R'; % due to reverse notation of Kanatani
36
37return
Note: See TracBrowser for help on using the repository browser.