Get Baseline和轉換外參 (extrinsics)

Get Disparity Baseline:

Config cfg = new Config();
cfg.EnableStream(Stream.Infrared, 1);
cfg.EnableStream(Stream.Infrared, 2);
var pipe = new Pipeline();
PipelineProfile selection = pipe.Start();
var ir1_stream = selection.GetStream(Stream.Infrared, 0);
var ir2_stream = selection.GetStream(Stream.Infrared, 1);
Extrinsics e = ir1_stream.GetExtrinsicsTo(ir2_stream);
var baseline = e.translation[0];

以下可通過官方自帶例子sensor-control獲得:
紅外雙目的baseline: 0.0551204m
紅外相機2(Infrared #2)到紅外相機1(Infrared #1)0的轉換外參 (extrinsics):
Translation Vector : [0.0551204,0,0]
Rotation Matrix : [1,0,0]
: [0,1,0]
: [0,0,1]
紅外相機1到彩色相機的轉換外參 (extrinsics):
Translation Vector : [0.0151751,-4.23435e-05,-0.000446917]
Rotation Matrix : [0.999964,0.00120481,0.00837446]
: [-0.00121877,0.999998,0.00166292]
: [-0.00837244,-0.00167306,0.999964]
深度圖depth 0到彩色圖color 0的轉換外參 (extrinsics):
Translation Vector : [0.0151751,-4.23435e-05,-0.000446917]
Rotation Matrix : [0.999964,0.00120481,0.00837446]
: [-0.00121877,0.999998,0.00166292]
: [-0.00837244,-0.00167306,0.999964]
紅外相機1(Infrared #1)到深度圖depth 0的轉換外參 (extrinsics):
Translation Vector : [0,0,0]
Rotation Matrix : [1,0,0]
: [0,1,0]
: [0,0,1]
紅外相機2(Infrared #2)到深度圖depth 0的轉換外參 (extrinsics):
Translation Vector : [0.0551204,0,0]
Rotation Matrix : [1,0,0]
: [0,1,0]
: [0,0,1]
Get Video Stream Intrinsics:

var pipe = new Pipeline();
PipelineProfile selection = pipe.Start();
var depth_stream = selection.GetStream(Stream.Depth);
Intrinsics i = depth_stream.GetIntrinsics();

Controlling the Laser:

var pipe = new Pipeline();
PipelineProfile selection = pipe.Start();
var selected_device = selection.Device;
var depth_sensor = selected_device.Sensors[0];

if (depth_sensor.Options.Supports(Option.EmitterEnabled))
{
depth_sensor.Options[Option.EmitterEnabled].Value = 1f; // Enable emitter
depth_sensor.Options[Option.EmitterEnabled].Value = 0f; // Disable emitter
}
if (depth_sensor.Options.Supports(Option.LaserPower))
{
var laserPower = depth_sensor.Options[Option.LaserPower];
laserPower.Value = laserPower.Max; // Set max power
laserPower.Value = 0f; // Disable laser
}

Get Field of View:

var pipe = new Pipeline();
PipelineProfile selection = pipe.Start();
var depth_stream = selection.GetStream(Stream.Depth);
Intrinsics i = depth_stream.GetIntrinsics();
float[] fov = i.FOV; // float[2] - horizontal and vertical field of view in degrees

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章