파이썬에서 3d 배열의 최대 값을 찾고 싶습니다. 나는 파이썬에서 3d 배열의 최대 값
image_file1 = open("lena256x256.bmp","rb")
img_i = PIL.Image.open(image_file1)
pix = numpy.array(img_i);
maxval= max(pix)
을 시도하지만 난, 저를 도와주세요 여기 내 실수를 잡을 수 없다는 오류
File "test.py", line 31, in <module>
maxval= max(pix)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
을 얻고있다.
올바르지 않습니다. 'numpy.max'는 다차원 배열을 이해하는 [numpy.amax'] (http://docs.scipy.org/doc/numpy/reference/generated/numpy.amax.html)의 별명입니다. 그러나 OP는'numpy.max'를 사용하지 않습니다. –