code: def _cvtColor_helper(img, num_channels):
      # convert num_channels which means (h, w, c) -> (h, w, num_channels)
      if len(img.shape) == 2:
          return Cv2Backend.convert_channel_from_gray(img, num_channels)
  
      elif img.shape[-1] == 3:
          return Cv2Backend.convert_channel_from_bgr(img, num_channels)
  
      elif img.shape[-1] == 4:
          return Cv2Backend.convert_channel_from_bgra(img, num_channels)
  
      raise ValueError("Bad image shape. ({})".format(img.shape))
  
file_path: nnabla/python/src/nnabla/utils/image_utils/backend_events/cv2_backend.py
imports: from __future__ import absolute_import, division
  import cv2
  import numpy
  from nnabla.logger import logger
  from .common import upscale_pixel_intensity, check_type_and_cast_if_necessary, _imread_before, _imread_after, _imsave_before, _imresize_before, _imresize_after
  from .image_utils_backend import ImageUtilsBackend
label_desc: Use image node_id 6 for calling the Cv2Backend obj's underlying member method code with example usage: obj._cvtColor_helper(img, num_channels) and returns: Cv2Backend, Cv2Backend, Cv2Backend