ON THIS PAGE

  • ImageAlign
  • How to place it
  • Inputs and Outputs
  • How it works
  • Usage
  • Examples of functionality
  • Reference

ImageAlign

ImageAlign node is used for aligning sensor frames to any other sensor frame on the device, including ToF sensors. It can also align two sensors with a static depth, making it useful for thermal-RGB alignment.

How to place it

Python
C++

Python

Python
1pipeline = dai.Pipeline()
2align = pipeline.create(dai.node.ImageAlign)

Inputs and Outputs

How it works

The ImageAlign node takes two inputs: inputAlignTo and input. The inputAlignTo is the frame to which the input frame will be aligned. The input frame will be aligned to the inputAlignTo frame and the aligned frame will be sent to the outputAligned output. The inputAlignTo is only read once to extract the frame metadata, then the input frame is reprojected and aligned to it based on the extrinsic calibration between the two sensors.

Usage

Python
C++

Python

Python
1pipeline = dai.Pipeline()
2
3rgb_cam = pipeline.create(dai.node.ColorCamera)
4# Assume the RGB camera sensor is on port CAM_A
5rgb_cam.setBoardSocket(dai.CameraBoardSocket.CAM_A)
6
7tof = pipeline.create(dai.node.ToF)
8# Assume the ToF camera sensor is on port CAM_B
9tof_cam.setBoardSocket(dai.CameraBoardSocket.CAM_B)
10
11image_align = pipeline.create(dai.node.ImageAlign)
12# Align depth from ToF to RGB
13tof.depth.link(image_align.input)
14rgb_cam.video.link(image_align.inputAlignTo)
15
16# Send aligned output to the host
17image_align.outputAligned.link(xout.input)

Examples of functionality

Reference

class

depthai.node.ImageAlign(depthai.Node)

method
method
method
setNumShaves(self, arg0: int) -> ImageAlign: ImageAlign
Specify number of shaves to use for this node
method
setOutKeepAspectRatio(self, arg0: bool) -> ImageAlign: ImageAlign
Specify whether to keep aspect ratio when resizing
method
property
initialConfig
Initial config to use when calculating spatial location data.
property
input
Input message. Default queue is non-blocking with size 4.
property
inputAlignTo
Input align to message. Default queue is non-blocking with size 1.
property
inputConfig
Input message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
property
outputAligned
Outputs ImgFrame message that is aligned to inputAlignTo.
property
passthroughInput
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.

Need assistance?

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