不幸的是,我还没有找到解决这个问题的办法。
from imgutils import imshow
import cv2
img3 = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
plt.figure(figsize=(20,10))
plt.subplot(1,2,1); imshow(img)
plt.subplot(1,2,2); imshow(img3)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-31-8006396b3a04> in <module>
----> 1 from imgutils import imshow
2
3 img3 = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
4
5 plt.figure(figsize=(20,10))
ImportError: cannot import name 'imshow'
我正在开发一个macosx10.11,带有anaconda环境python3.5。
有什么建议吗?
更新
from cv2 import imshow
img3 = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
plt.figure(figsize=(20,10))
plt.subplot(1,2,1); imshow(img)
plt.subplot(1,2,2); imshow(img3)
回溯
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-d01b4c235975> in <module>
5 plt.figure(figsize=(20,10))
6
----> 7 plt.subplot(1,2,1); imshow(img)
8 plt.subplot(1,2,2); imshow(img3)
TypeError: Required argument 'mat' (pos 2) not found