ImageAlign
如何放置它
Python
Python
1pipeline = dai.Pipeline()
2align = pipeline.create(dai.node.ImageAlign)输入和输出
工作原理
ImageAlign 节点接受两个 输入:inputAlignTo 和 input。inputAlignTo 是 input 帧将要对齐到的帧。input 帧将与 inputAlignTo 帧对齐,对齐后的帧被发送到 outputAligned 输出。inputAlignTo 只读取一次以提取帧元数据,然后 input 帧根据两个传感器之间的外部标定进行重投影并对齐到该元数据。用法
Python
Python
1pipeline = dai.Pipeline()
2
3rgb_cam = pipeline.create(dai.node.ColorCamera)
4# 假设 RGB 相机传感器在端口 CAM_A 上
5rgb_cam.setBoardSocket(dai.CameraBoardSocket.CAM_A)
6
7tof = pipeline.create(dai.node.ToF)
8# 假设 ToF 相机传感器在端口 CAM_B 上
9tof_cam.setBoardSocket(dai.CameraBoardSocket.CAM_B)
10
11image_align = pipeline.create(dai.node.ImageAlign)
12# 将来自 ToF 的深度对齐到 RGB
13tof.depth.link(image_align.input)
14rgb_cam.video.link(image_align.inputAlignTo)
15
16# 将对齐后的输出发送到主机
17image_align.outputAligned.link(xout.input)功能示例
参考
class
depthai.node.ImageAlign(depthai.Node)
method
setInterpolation(self, arg0: depthai.Interpolation) -> ImageAlign: ImageAlignSpecify interpolation method to use when resizing
method
setNumFramesPool(self, arg0: typing.SupportsInt) -> ImageAlign: ImageAlignSpecify number of frames in the pool
method
setNumShaves(self, arg0: typing.SupportsInt) -> ImageAlign: ImageAlignSpecify number of shaves to use for this node
method
setOutKeepAspectRatio(self, arg0: bool) -> ImageAlign: ImageAlignSpecify whether to keep aspect ratio when resizing
method
setOutputSize(self, arg0: typing.SupportsInt, arg1: typing.SupportsInt) -> ImageAlign: ImageAlignSpecify the output size of the aligned image
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.
需要帮助?
请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。