我需要执行一个阈值过零检测滤波图像的拉普拉斯。但是一旦应用拉普拉斯算子,在进行阈值分割时就会产生误差。有什么建议吗?你知道吗
代码:
img = cv2.imread('H:/FYP/interim/aniso.jpg')
lap = cv2.Laplacian(img, 1, ksize=5)
retval, threshold = cv2.threshold(lap, 70, 255, cv2.THRESH_BINARY)
plt.imshow(threshold)
错误:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-23-e36300501b24> in <module>
1 img = cv2.imread('H:/FYP/interim/aniso.jpg')
2 lap = cv2.Laplacian(img, 1, ksize=5)
----> 3 retval, threshold = cv2.threshold(lap, 70, 255, cv2.THRESH_BINARY)
4 plt.imshow(threshold)
error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\thresh.cpp:1612: error: (-210:Unsupported format or combination of formats) in function 'cv::threshold'
你可以这样改变
相关问题 更多 >
编程相关推荐