apply_depth_colormap
最后更新
depthai_nodes.node.apply_depth_colormapClasses
ApplyDepthColormap
frame : dai.ImgFrame:包含要着色的 2D 数组的输入消息。
output : dai.ImgFrame:着色输出帧(3 通道 BGR)。
colormapValue:OpenCV 颜色映射枚举(例如 cv2.COLORMAP_JET)或自定义的 OpenCV 兼容颜色映射 LUT。默认为 cv2.COLORMAP_JET。pLow:下限归一化百分位数,范围为 [0, 100)。默认为 2.0。pHigh:上限归一化百分位数,范围为 (0, 100]。默认为 98.0。
方法
init
Python
1def __init__(colormapValue: int | np.ndarray = cv2.COLORMAP_JET, pLow: float = 2.0, pHigh: float = 98.0):colormapValue(int | np.ndarray):OpenCV 颜色映射枚举(例如 cv2.COLORMAP_JET)或自定义的 OpenCV 兼容颜色映射 LUT。默认为 cv2.COLORMAP_JET。pLow(float):下限归一化百分位数,范围为 [0, 100)。默认为 2.0。pHigh(float):上限归一化百分位数,范围为 (0, 100]。默认为 98.0。
build
Python
1def build(frame: dai.Node.Output) -> ApplyDepthColormap:frame(dai.Node.Output):生成 RAW 深度 dai.ImgFrame 的上游输出。
ApplyDepthColormap:配置好的节点实例。
process
Python
1def process(frame: dai.Buffer):frame(dai.Buffer):RAW 深度或视差 ImgFrame。非正像素变为黑色。没有可用归一化范围的帧会生成全黑图像。
TypeError:如果输入不是具有 RAW 格式的 ImgFrame。
setColormap
Python
1def setColormap(colormapValue: int | np.ndarray):colormapValue(int | np.ndarray):OpenCV 颜色映射枚举值或自定义的 OpenCV 兼容 LUT。
ValueError:如果自定义颜色映射不是形状为(256, 1, 3)的 uint8 数组。
setPercentileRange
Python
1def setPercentileRange(low: float, high: float):low(float):范围 [0, 100) 中的下限百分位数。high(float):范围 (0, 100] 中的上限百分位数。
ValueError:如果边界不满足0 <= low < high <= 100。