NP.最大值python3中的函数错误

2024-05-19 03:37:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在学习使用OpenCV代码清除背景 http://www.codepasta.com/site/vision/segmentation/

错误来自np.最大值在

edgeImg = np.max( np.array([ edgedetect(blurred[:,:, 0]), edgedetect(blurred[:,:, 1]), edgedetect(blurred[:,:, 2]) ]), axis=0 )

当我从np.最大值进入np.最大值错误如下:

^{pr2}$

当我从np.最大值进入np.amax公司错误如下:

Traceback (most recent call last):
File "deteksipinggir-sobel.py", line 77, in <module>
segment('078.jpg')
File "deteksipinggir-sobel.py", line 49, in segment
np.array([edgedetect(blurred[:, :, 0]), edgedetect(blurred[:, :, 1]), edgedetect(blurred[:, :, 2])]), axis=0)
File "E:\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py", line 2272, in amax
out=out, **kwargs)
File "E:\Anaconda3\lib\site-packages\numpy\core\_methods.py", line 26, in _amax
return umr_maximum(a, axis, None, out, keepdims)
TypeError: '>=' not supported between instances of 'NoneType' and 'NoneType'

我在用python3,请帮忙,谢谢。在


Tags: inpy错误nplinesiteoutarray
1条回答
网友
1楼 · 发布于 2024-05-19 03:37:54

根据numpy文档herenumpy.maximum需要两个输入数组作为参数:

numpy.maximum(arr1, arr2)

numpy.max只需要一个输入数组作为参数:

^{pr2}$

确保至少提供了两个数组作为参数。在

相关问题 更多 >

    热门问题