我正在尝试用形态去除噪音,但内核给了我错误:
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: 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'