problem using morphologyEx [closed]
I tried to use
close0 = cv2.morphologyEx(image, cv2.MORPH_CLOSE, mask, iterations = 1)
and I got this error:
error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\imgproc\src\morph.cpp:787: error: (-215) _kernel.type() == 0 in function cv::MorphFilter<struct cv::MaxOp<unsigned char>,struct cv::MorphIVec<struct cv::VMax8u> >::MorphFilter
what should I do?
it complains, that your kernel has the wrong type (should be 0, uchar).
so what is
mask
? (also a misnomer)mask is a 3 by 3 zero-matrix with only ones in the middle row.
and
mask.dtype
is ? (should be 0, np.uint8)it returns: dtype('float64')