在进行拉普拉斯算子的计算时,报错:
filter.simd.hpp:3110: error: (-215:Assertion failed) cn == CV_MAT_CN(dstType) && ddepth >= sdepth in function 'cv::opt_AVX2::getLinearFilter'
应该转换类型为np.uint8,即可,问题解决。
img = np.array(img, dtype='uint8')
print(img.shape)
img1 = cv2.Laplacian(img, cv2.CV_8U, 3)