Cast
Cast
节点属性
outputFrameType- 输出帧的类型。类型应与 NN 输出帧类型相同。offset- 要应用于输出帧的偏移量。默认为0。scale- 要应用于输出帧的缩放因子。默认为1。
output = input * scale + offset。如何放置
Python
Python
1pipeline = dai.Pipeline()
2cast = pipeline.create(dai.node.Cast)输入和输出
用法
Python
Python
1pipeline = dai.Pipeline()
2
3nn = pipeline.create(dai.node.NeuralNetwork)
4# 加载自定义 blob
5nn.setBlobPath("path_to_blob")
6
7cast = pipeline.create(dai.node.Cast)
8cast.setOutputFrameType(dai.ImgFrame.Type.BGR888p)
9cast.setScale(1)
10
11# 将 NN 的输出链接到 Cast 的输入
12nn.out.link(cast.input)
13
14# 通过 XLink 将转换后的输出发送到主机
15xout = pipeline.create(dai.node.XLinkOut)
16xout.setStreamName("castOut")
17cast.output.link(xout.input)功能示例
参考
class
depthai.node.Cast(depthai.Node)
method
setNumFramesPool(self, arg0: typing.SupportsInt) -> Cast: CastSet number of frames in pool Parameter ``numFramesPool``: Number of frames in pool
method
setOffset(self, arg0: typing.SupportsFloat) -> Cast: CastSet offset Parameter ``offset``: Offset
method
setOutputFrameType(self, arg0: depthai.RawImgFrame.Type) -> Cast: CastSet output frame type Parameter ``outputType``: Output frame type
method
setScale(self, arg0: typing.SupportsFloat) -> Cast: CastSet scale Parameter ``scale``: Scale
property
input
Input NNData or ImgFrame message.
property
output
Output ImgFrame message.
property
passthroughInput
Passthrough input message.
需要帮助?
请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。