Last change
on this file since 37 was
37,
checked in by (none), 14 years ago
|
Added original make3d
|
-
Property svn:executable set to
*
|
File size:
780 bytes
|
Rev | Line | |
---|
[37] | 1 | % S = vgg_vec_swap(x,y) For square matrix A and vectors x, y it is x'*A*y = vgg_vec(A)'*vgg_vec_swap(x,y).
|
---|
| 2 | %
|
---|
| 3 | % x ... matrix N-by-K
|
---|
| 4 | % y ... matrix N-by-K
|
---|
| 5 | % S ... matrix K^2-by-N
|
---|
| 6 | %
|
---|
| 7 | % Examples :-
|
---|
| 8 | %
|
---|
| 9 | % - Estimating fundamental matrix F that should satisfy x(:,k)'*F*y(:,k) = 0 from
|
---|
| 10 | % given points x(:,k), y(:,k). We solve homogeneous system vec(F)*vgg_vec_swap(x,y) = 0.
|
---|
| 11 | %
|
---|
| 12 | % - Evaluating values v(k) of x(:,k)'*A{k}*y(:,k) for all k, A{k} are square matrices.
|
---|
| 13 | % If column vectors vec(A{k}) are stacked to a single matrix AA, then
|
---|
| 14 | % v = sum(AA'.*vgg_vec_swap(x,y)).
|
---|
| 15 | %
|
---|
| 16 | % See also vgg_vech_swap
|
---|
| 17 |
|
---|
| 18 | % Tomas Werner, Oct 2001
|
---|
| 19 |
|
---|
| 20 | function M = vgg_vec_swap(x,y)
|
---|
| 21 |
|
---|
| 22 | if nargin==1
|
---|
| 23 | y = x;
|
---|
| 24 | end
|
---|
| 25 |
|
---|
| 26 | [i j] = find(ones(size(x,1)));
|
---|
| 27 | M = x(i,:).*y(j,:);
|
---|
| 28 |
|
---|
| 29 | return
|
---|
| 30 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.