-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind_points.m
More file actions
35 lines (23 loc) · 910 Bytes
/
find_points.m
File metadata and controls
35 lines (23 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function X = find_points(R, theta, Y)
% X = find_points(R, theta, Y)
%
% Computes an estimate of a set of 3d points X based on the positions
% of these points Y in the images from a set of cameras positions a
% distance R and angle theta away from the subject.
%
% Inputs:
% R: m x 1 vector specifing the distance to each camera
% theta: m x 1 vector specifing the angle for each camera
% Y: 2*m x N vector specifing the position of each of
% the N points in the camera image
%
% Outputs:
% X: 3 x N vector specifing the 3d position of each of
% the N points
m = size(R,1);
N = size(Y,2);
checkdims(R, [m 1], 'R must be a column vector');
checkdims(theta, [m 1], 'Dimensions of R and theta must match');
checkdims(Y, [2*m, N], 'Dimensions of Y and R not consistent');
[A, Beta, C0] = camera2hyperplane(R, theta);
X = pointsfromhyperplanes(A', Beta, C0, Y, m);