source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/approx_full_matrix.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 316 bytes |
Line | |
---|---|
1 | function [L, pts] = approx_full_matrix(M,r) |
2 | % approximate a matrix, M, that has no missing elements, with a rank r matrix |
3 | % this is essentially the Tomasi and Kanade algorithm. |
4 | |
5 | [u,s,v] = svd(M); |
6 | vp = v'; |
7 | % M = u*s*vp |
8 | ur = u(:,1:r); |
9 | sr = s(1:r,1:r); |
10 | vpr = vp(1:r,:); |
11 | L = ur*sr*vpr; |
12 | pts = [vpr; ones(1,size(vpr,2))]; |
Note: See TracBrowser
for help on using the repository browser.