summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/is3D.m
blob: ab00b3db2b3d55ea8862c03a84a96efe816d6cb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function test = is3D(X),


Np = size(X,2);

%% Check for planarity of the structure:

X_mean = mean(X')';

Y = X - (X_mean*ones(1,Np));

YY = Y*Y';

[U,S,V] = svd(YY);

r = S(3,3)/S(2,2);

test = (r > 1e-3);