no attribute??
"""例2.11
生成一幅彩色图图像,让其中的像素值均为随机数
"""
import cv2
import numpy as np
img = np.random.randint(0,256,size=,dtype=np.unit8)
cv2.imshow('demo',img)
cv2.waitKey()
cv2.destroyAllWindows()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-d3be196aaa72> in <module>
6 import cv2
7 import numpy as np
----> 8 img = np.random.randint(0,256,size=,dtype=np.unit8)
9 cv2.imshow('demo',img)
10 cv2.waitKey()
/opt/anaconda3/envs/OpenCV-Python37/lib/python3.7/site-packages/numpy/__init__.py in __getattr__(attr)
218 else:
219 raise AttributeError("module {!r} has no attribute "
--> 220 "{!r}".format(__name__, attr))
221
222 def __dir__():
AttributeError: module 'numpy' has no attribute 'unit8' uint8不是unit8
页:
[1]