ToF

ToF node is used for converting the raw data from the ToF sensor into a depth map. Currently, these 2 products contain a ToF sensor:

  • OAK-D SR PoE - integrated 33D ToF sensor, together with a stereo camera pair

  • OAK-FFC ToF 33D - standalone FFC module with a 33D ToF sensor

ToF’s depth output can be used instead of StereoDepth’s - so you can link ToF.depth to MobileNetSpatialDetectionNetwork/YoloSpatialDetectionNetwork or SpatialLocationCalculator directly.

How to place it

pipeline = dai.Pipeline()
warp = pipeline.create(dai.node.ToF)
dai::Pipeline pipeline;
auto warp = pipeline.create<dai::node::ToF>();

Inputs and Outputs

            ┌───────────┐    depth
inputConfig |           ├────────►
───────────►│           | amplitude
   input    |    ToF    ├────────►
───────────►│           │    error
            │           ├────────►
            └───────────┘

Message types

Usage

pipeline = dai.Pipeline()

tof_cam = pipeline.create(dai.node.Camera)
# We assume the ToF camera sensor is on port CAM_A
tof_cam.setBoardSocket(dai.CameraBoardSocket.CAM_A)

tof = pipeline.create(dai.node.ToF)
# ToF node converts raw sensor frames into depth
tof_cam.raw.link(tof.input)

# Send ToF depth output to the host, or perhaps to SLC / Spatial Detection Network
tof.depth.link(xout.input)
dai::Pipeline pipeline;

auto tofCam = pipeline.create<dai::node::MonoCamera>();
// We assume the ToF camera sensor is on port CAM_A
tofCam->setBoardSocket(dai::CameraBoardSocket::AUTO);

auto tof = pipeline.create<dai::node::ToF>();
// ToF node converts raw sensor frames into depth
tofCam->raw.link(tof->input);

auto xout = pipeline.create<dai::node::XLinkOut>();
xout->setStreamName("depth");
// Send ToF depth output to the host
tof->depth.link(xout->input);

Examples of functionality

Reference

class depthai.node.ToF
class Id

Node identificator. Unique for every node on a single Pipeline

getAssetManager(*args, **kwargs)

Overloaded function.

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

  2. getAssetManager(self: depthai.Node) -> depthai.AssetManager

getInputRefs(*args, **kwargs)

Overloaded function.

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

  2. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

getInputs(self: depthai.Node) → List[depthai.Node.Input]
getName(self: depthai.Node)str
getOutputRefs(*args, **kwargs)

Overloaded function.

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

  2. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

getOutputs(self: depthai.Node) → List[depthai.Node.Output]
getParentPipeline(*args, **kwargs)

Overloaded function.

  1. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

  2. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

class dai::node::ToF : public dai::NodeCRTP<Node, ToF, ToFProperties>

ToF node.

Public Functions

ToF(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)

Constructs ToF node.

ToF(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId, std::unique_ptr<Properties> props)

Public Members

ToFConfig initialConfig

Initial config to use for depth calculation.

Input inputConfig = {*this, "inputConfig", Input::Type::SReceiver, false, 4, {{DatatypeEnum::ToFConfig, false}}}

Input ToF message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.

Input input = {*this, "input", Input::Type::SReceiver, true, 8, {{DatatypeEnum::ImgFrame, true}}}
Output depth = {*this, "depth", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}

Outputs ImgFrame message that carries modified image.

Output amplitude = {*this, "amplitude", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}
Output intensity = {*this, "intensity", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}
Output error = {*this, "error", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}

Public Static Attributes

static constexpr const char *NAME = "ToF"

Private Members

std::shared_ptr<RawToFConfig> rawConfig

Got questions?

Head over to Discussion Forum for technical support or any other questions you might have.