code: def flow_compute_color(u, v, convert_to_bgr=False):
      """
      Applies the flow color wheel to (possibly clipped) flow components u and v.
      According to the C++ source code of Daniel Scharstein
      According to the Matlab source code of Deqing Sun
      :param u: np.ndarray, input horizontal flow
      :param v: np.ndarray, input vertical flow
      :param convert_to_bgr: bool, whether to change ordering and output BGR instead of RGB
      :return:
      """
  
      flow_image = np.zeros((u.shape[0], u.shape[1], 3), np.uint8)
  
      colorwheel = make_colorwheel()  # shape [55x3]
      ncols = colorwheel.shape[0]
  
      rad = np.sqrt(np.square(u) + np.square(v))
      a = np.arctan2(-v, -u) / np.pi
  
      fk = (a + 1) / 2 * (ncols - 1) + 1
      k0 = np.floor(fk).astype(np.int32)
      k1 = k0 + 1
      k1[k1 == ncols] = 1
      f = fk - k0
  
      for i in range(colorwheel.shape[1]):
          tmp = colorwheel[:, i]
          col0 = tmp[k0] / 255.0
          col1 = tmp[k1] / 255.0
          col = (1 - f) * col0 + f * col1
  
          idx = rad <= 1
          col[idx] = 1 - rad[idx] * (1 - col[idx])
          col[~idx] = col[~idx] * 0.75  # out of range?
  
          # Note the 2-i => BGR instead of RGB
          ch_idx = 2 - i if convert_to_bgr else i
          flow_image[:, :, ch_idx] = np.floor(255 * col)
  
      return flow_image
  
imports: import os
  import numpy
  import platform
  import random
  import cv2
  from nvidia.dali.pipeline import pipeline_def
  from nvidia.dali import fn, types
  from test_utils import get_dali_extra_path, get_arch
  from nose_utils import raises, assert_raises
  from nose import SkipTest
label_desc: Use image node_id 6 for calling a global function with example usage: flow_compute_color(u, v, convert_to_bgr) and returns: flow_image