title: Getting an error when trying to do morphological transformations on an 8x8 matrix
body: <p>I'm trying to do morphological transformations on a 8x8 matrix with a 3x3 cross shaped kernel. I want to apply erosion, dilation,open and close to A1 with the kernel B1. I am getting an error and I don't know how to solve the issue.
  <a href="https://i.stack.imgur.com/mZzoM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mZzoM.png" alt="Here what the matrix and kernel look like"></a></p>
  
  <p>This is what I have so far.</p>
  
  <pre><code>import cv2 as cv
  import numpy as np
  
  # A1 = 8x8 matrix
  A1 = np.array([[0,0,0,0,0,0,0,0],
                 [0,0,0,1,1,1,1,0],
                 [0,0,0,1,1,1,1,0],
                 [0,1,1,1,1,1,1,0],
                 [0,1,1,1,1,1,1,0],
                 [0,1,1,1,1,0,0,0],
                 [0,1,1,1,1,0,0,0],
                 [0,0,0,0,0,0,0,0]])
  
  # Cross-shaped kernel (structuring element)
  cv.getStructuringElement(cv.MORPH_CROSS,(3,3))
  kernel = np.array ([[0, 1, 0],
                      [1, 1, 1],
                      [0, 1, 0]], dtype = np.uint8)
  
  # Dilation
  dilation = cv.dilate(A1,kernel,iterations = 1)
  cv.imshow('dilation', dilation)
  
  # Erosion
  erosion = cv.erode(A1,kernel,iterations = 1)
  cv.imshow('erosion', erosion)
  
  # Opening
  opening = cv.morphologyEx(A1, cv.MORPH_OPEN, kernel)
  cv.imshow('opening', opening)
  
  # Closing
  closing = cv.morphologyEx(A1, cv.MORPH_CLOSE, kernel)
  cv.imshow('closing', closing)
  
  cv.waitKey(0)
  cv.destroyAllWindows()
  cv.waitKey(1)  # If I dont have this line then the window won't close for me on my mac when I enter a key
  </code></pre>
  
  <p>I don't know why I'm getting this error?</p>
  
  <pre><code>
    File "/Users/p/.spyder-py3/My_OpenCV_Files/Homework3_CSC317/Hw3-problem1.py", line 24, in &lt;module&gt;
      dilation = cv.dilate(A1,kernel,iterations = 1)
  
  error: OpenCV(3.4.2) /opt/concourse/worker/volumes/live/
  9523d527-1b9e-48e0-7ed0a36adde286f0/volume/opencvsuite_1535558719691/work
  /modules/imgproc/src/morph.cpp:973: 
  error: (-213:The function/feature is not implemented) Unsupported data type (=4) in function 'getMorphologyFilter'
  </code></pre>