Я изучаю удаление фона с помощью кода OpenCV из
http://www.codepasta.com/site/vision/segmentation/
Ошибка от np.max
edgeImg = np.max( np.array([ edgedetect(blurred[:,:, 0]), edgedetect(blurred[:,:, 1]), edgedetect(blurred[:,:, 2]) ]), axis=0 )
Когда я изменяю значение от np.max до np.maximum, ошибка выглядит следующим образом:
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)
ValueError: invalid number of arguments
Когда я перехожу с np.max на 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'
Я использую Python 3, пожалуйста, помогите, спасибо.