[英]OpenCV - numpy array is 'bad argument type' for cv2.imread?
I'm trying to read an image using cv2.imread(image). 我正在尝试使用cv2.imread(image)读取图像。 'image' is a reference to an element of a list of numpy arrays.
“图像”是对numpy数组列表的元素的引用。 The console tells me that my argument - image - is of type , so it should work with cv2.imread(), but i get the following error: 'TypeError: bad argument type for built-in operation'.
控制台告诉我,我的参数-image-是type,因此它应与cv2.imread()一起使用,但出现以下错误:'TypeError:内置操作的错误参数类型'。
What gives? 是什么赋予了?
The image argument which you're passing must be a path to the actual image ie 您要传递的图像参数必须是实际图像的路径,即
image = 'picture/image/trail.jpg'
cv2.imread()
accepts the path where the actual image is located in your drive. cv2.imread()
接受驱动器中实际映像所在的路径。 numpy.ndarray
which is already an array of image values, it gives the that TypeError: bad argument type for built-in operation
numpy.ndarray
,它将TypeError: bad argument type for built-in operation
提供该TypeError: bad argument type for built-in operation
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.