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

ToF node

class Connection

Connection between an Input and Output

class Id

Node identificator. Unique for every node on a single Pipeline

Properties

alias of depthai.ToFProperties

property depth

Outputs ImgFrame message that carries modified image.

getAssetManager(*args, **kwargs)

Overloaded function.

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

Get node AssetManager as a const reference

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

Get node AssetManager as a const reference

getInputRefs(*args, **kwargs)

Overloaded function.

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

Retrieves reference to node inputs

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

Retrieves reference to node inputs

getInputs(self: depthai.Node) → List[depthai.Node.Input]

Retrieves all nodes inputs

getName(self: depthai.Node)str

Retrieves nodes name

getOutputRefs(*args, **kwargs)

Overloaded function.

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

Retrieves reference to node outputs

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

Retrieves reference to node outputs

getOutputs(self: depthai.Node) → List[depthai.Node.Output]

Retrieves all nodes outputs

getParentPipeline(*args, **kwargs)

Overloaded function.

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

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

property id

Id of node

property initialConfig

Initial config to use for depth calculation.

property inputConfig

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

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.