gtsam/matlab/gtsam_examples/CameraFlyingExample.m

35 lines
719 B
Matlab
Raw Normal View History

2015-01-07 22:56:18 +08:00
clear all;
clc;
import gtsam.*
cylinder_num = 20;
2015-01-07 22:56:18 +08:00
cylinders = cell(cylinder_num, 1);
% generate a set of cylinders
fieldSize = Point2([100, 100]');
% random generate cylinders on the fields
2015-01-07 22:56:18 +08:00
for i = 1:cylinder_num
baseCentroid = Point2([fieldSize.x * rand, fieldSize.y * rand]');
cylinders{i,1} = cylinderSampling(baseCentroid, 1, 5, 30);
2015-01-07 22:56:18 +08:00
end
% plot all the cylinders and sampled points
% now is plotting on a 100 * 100 field
plotCylinderSamples(cylinders, fieldSize);
2015-01-07 22:56:18 +08:00
% visibility validation
K = Cal3_S2(525,525,0,320,240);
cameraPose = Pose3(); % now set to be default
2015-01-07 22:56:18 +08:00
% the projections of all visible 3D points
% visiblePoints3 = cylinderSampleProjection(K, cameraPose, cylinders);
2015-01-07 22:56:18 +08:00
2015-01-07 22:56:18 +08:00