source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/torr/torr_robust_chieral.m @ 37

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

Added original make3d

File size: 691 bytes
Line 
1%       By Philip Torr 2002
2%       copyright Microsoft Corp.
3%this is code to remove outliers via chieral constraint
4
5
6function inlier_index = torr_robust_chieral(X,P1,P2)
7
8%next reproject and compare with the images
9%the chieral constraint is sign(det M) * sign (third homog coord of reprojected image) * sign (fourth homog coord X)
10% to make sure we dont get any outliers we average the inequalities over all the points, ones with a bad sign
11% can later be removed as outleirs.
12%we want chieral for both cameras to be positive
13
14ax1 = P1 * X;
15
16bx1 = P2 * X;
17
18chieral = (sign(ax1(3,:) ) .* sign (X(4,:))) +  (sign(bx1(3,:) ) .* sign (X(4,:)));
19
20inlier_index = find(chieral == 2);
21
Note: See TracBrowser for help on using the repository browser.