Shortcuts

mmcv.video.quantize_flow

mmcv.video.quantize_flow(flow: numpy.ndarray, max_val: float = 0.02, norm: bool = True)tuple[源代码]

Quantize flow to [0, 255].

After this step, the size of flow will be much smaller, and can be dumped as jpeg images.

参数
  • flow (ndarray) – (h, w, 2) array of optical flow.

  • max_val (float) – Maximum value of flow, values beyond [-max_val, max_val] will be truncated.

  • norm (bool) – Whether to divide flow values by image width/height.

返回

Quantized dx and dy.

返回类型

tuple[ndarray]