OpenCV Python error: Unsupported data type (=4) in function 'cv::opt_AVX2::getMorphologyRowFilter'

asked 2020-05-03 20:57:26 -0500

I'm trying to remove noise with morphology and the kernel is giving me errors:

import skimage.io as io
import numpy as np
import cv2

c=io.imread('circles.png').astype('bool')*1
x=np.random.random_sample(c.shape)
c[np.nonzero(x>0.95)]= 0
c[np.nonzero(x<=0.05)] = 1

opening = cv2.morphologyEx(c, cv2.MORPH_OPEN, np.ones((2,2),np.uint8))

io.imshow(opening)

error:

error: OpenCV(4.1.2) C:/projects/opencv-python/opencv/modules/imgproc/src/morph.simd.hpp:756: error: (-213:The function/feature is not implemented) Unsupported data type (=4) in function 'cv::opt_AVX2::getMorphologyRowFilter'
edit retag flag offensive close merge delete