Hi,
First you need to enable the positional tracking module so that the object detection can output real world coordinates.
You can either set the position manually by giving an initial world transform (if you want to set (x-y) position on the canvas), and/or use the floor_as_origin parameters (that will calculate height of the camera regarding the floor + the gravity of the camera).
PositionalTrackingParameters positional_tracking_parameters;
positional_tracking_parameters.set_as_static = true; //If your camera is static, set to true
positional_tracking_parameters.set_floor_as_origin = true;
positional_tracking_parameters.initial_world_transform = <your_transform>;
zed.enablePositionalTracking(positional_tracking_parameters);
Then, call the grab function with the world reference frame in the runtime parameters
sl::RuntimeParameters rt_param;
rt_param.measure3D_reference_frame = sl::REFERENCE_FRAME::WORLD;
sl::ERROR_CODE err_ = p_zed->grab(rt_param);
That will ensure that the objects position are given in the world frame (and not the camera frame).
Then use the position from the objectData of the sl::Objects (objectdata.position.x/y/z…)
All metrics output of the SDK are given according to the InitParameters::coordinate_units , used in the open() function.
https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html#a75cb1e715c1be19c591d21fa2591b421
You should take a look at this sample here :
The bird view window seems to be exactly what you want to do…
OB.