Rev | Line | |
---|
[37] | 1 | % By Philip Torr 2002
|
---|
| 2 | % copyright Microsoft Corp.
|
---|
| 3 | %this is code to remove outliers via chieral constraint
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | function 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 |
|
---|
| 14 | ax1 = P1 * X;
|
---|
| 15 |
|
---|
| 16 | bx1 = P2 * X;
|
---|
| 17 |
|
---|
| 18 | chieral = (sign(ax1(3,:) ) .* sign (X(4,:))) + (sign(bx1(3,:) ) .* sign (X(4,:)));
|
---|
| 19 |
|
---|
| 20 | inlier_index = find(chieral == 2);
|
---|
| 21 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.