code: def test_augment_images__four_channels(self):
      colorizer = iaa.RandomColorsBinaryImageColorizer(
          color_true=254, color_false=1
      )
  
      aug = iaa.Canny(
          alpha=1.0,
          hysteresis_thresholds=100,
          sobel_kernel_size=3,
          colorizer=colorizer,
          random_state=1,
      )
  
      image_single_chan = np.uint8(
          [
              [0, 0, 0, 1, 0, 0, 0],
              [0, 0, 0, 1, 0, 0, 0],
              [0, 0, 0, 1, 0, 0, 0],
              [0, 0, 0, 1, 0, 0, 0],
              [0, 1, 1, 1, 0, 0, 0],
          ]
      )
      image_alpha_channel = (
          np.uint8(
              [
                  [0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 1, 0, 0, 0],
                  [0, 0, 1, 1, 1, 0, 0],
                  [0, 0, 1, 1, 0, 0, 0],
                  [0, 0, 1, 0, 0, 0, 0],
              ]
          )
          * 255
      )
      image = np.tile(
          image_single_chan[:, :, np.newaxis] * 128, (1, 1, 3)
      )
      image = np.dstack([image, image_alpha_channel[:, :, np.newaxis]])
      assert image.ndim == 3
      assert image.shape[-1] == 4
  
      # canny image, looks a bit unintuitive, but is what OpenCV returns
      # can be checked via something like
      # print("canny\n", cv2.Canny(image_single_chan*255, threshold1=100,
      #            threshold2=200,
      #            apertureSize=3,
      #            L2gradient=True))
      image_canny = np.array(
          [
              [0, 0, 1, 0, 1, 0, 0],
              [0, 0, 1, 0, 1, 0, 0],
              [0, 0, 1, 0, 1, 0, 0],
              [0, 0, 1, 0, 1, 0, 0],
              [0, 1, 0, 0, 1, 0, 0],
          ],
          dtype=bool,
      )
  
      image_aug_expected = np.copy(image)
      image_aug_expected[image_canny, 0:3] = 254
      image_aug_expected[~image_canny, 0:3] = 1
  
      image_aug = aug.augment_image(image)
      assert np.array_equal(image_aug, image_aug_expected)
  
imports: from __future__ import print_function, division, absolute_import
  import itertools
  import sys
  import numpy
  import cv2
  from imgaug import augmenters
  from imgaug import parameters
  from imgaug import random
  from imgaug.testutils import reseed, runtest_pickleable_uint8_img, is_parameter_instance, remove_prefetching
label_desc: Use image node_id 9 for calling the TestCanny obj's underlying member method code with example usage: obj.test_augment_images__four_channels() without return types