code: def __call__(self, _image, nb_channels, random_state):
      alpha_sample = self.alpha.draw_sample(random_state=random_state)
      assert 0 <= alpha_sample <= 1.0, (
          "Expected 'alpha' to be in the interval [0.0, 1.0], "
          "got %.4f." % (alpha_sample,)
      )
      direction_sample = self.direction.draw_sample(
          random_state=random_state
      )
  
      deg = int(direction_sample * 360) % 360
      rad = np.deg2rad(deg)
      x = np.cos(rad - 0.5 * np.pi)
      y = np.sin(rad - 0.5 * np.pi)
      direction_vector = np.array([x, y])
  
      matrix_effect = np.array(
          [[0, 0, 0], [0, 0, 0], [0, 0, 0]], dtype=np.float32
      )
      for x, y in itertools.product([-1, 0, 1], [-1, 0, 1]):
          if (x, y) != (0, 0):
              cell_vector = np.array([x, y])
              distance_deg = np.rad2deg(
                  ia.angle_between_vectors(
                      cell_vector, direction_vector
                  )
              )
              distance = distance_deg / 180
              similarity = (1 - distance) ** 4
              matrix_effect[y + 1, x + 1] = similarity
      matrix_effect = matrix_effect / np.sum(matrix_effect)
      matrix_effect = matrix_effect * (-1)
      matrix_effect[1, 1] = 1
  
      matrix_nochange = np.array(
          [[0, 0, 0], [0, 1, 0], [0, 0, 0]], dtype=np.float32
      )
  
      matrix = (
          1 - alpha_sample
      ) * matrix_nochange + alpha_sample * matrix_effect
  
      return matrix
  
imports: from __future__ import print_function, division, absolute_import
  import itertools
  import numpy
  import cv2
  import six.moves
  import imgaug
  from .None import meta
  from ..None import parameters
  from ..None import dtypes
label_desc: Use image node_id 2 for calling the _DirectedEdgeDetectMatrixGenerator obj's underlying member method code with example usage: obj.__call__(_image, nb_channels, random_state) and returns: matrix