当cropped_image = image.crop( cords )
工作正常时,它返回一个Image
与 Scipy's 一起工作的对象assaray
:
bitmap <PIL.Image.Image image mode=RGBA size=1600x1200 at 0xAC9CFEC>
#SCIPY'S ASARRAY WORKS PROPERLY!
pic!! [[[ 16 18 31 255]
[ 16 18 31 255]
[ 16 18 31 255]
...,
但现在我得到一个PIL.Image._ImageCrop
失败的对象。
bitmap <PIL.Image._ImageCrop image mode=RGBA size=1600x80 at 0x99635AC>
#SCIPY'S ASARRAY FAILS WITHOUT WARNING
pic!! <PIL.Image._ImageCrop image mode=RGBA size=1600x80 at 0x99635AC>
Traceback (most recent call last):
File "/root/dev/spectrum/final/image_handler.py", line 216, in on_left_down
self._sample_callback()
File "/root/dev/spectrum/final/image_handler.py", line 237, in _sample_callback
self.__callback_function( sample )
File "/root/dev/spectrum/final/plot_handler.py", line 117, in __init__
self.InitUI()
File "/root/dev/spectrum/final/plot_handler.py", line 163, in InitUI
self.canvas_panel.draw(self.__crop_section)
File "/root/dev/spectrum/final/plot_handler.py", line 78, in draw
pic_avg = pic.mean(axis=2)
ValueError: axis(=2) out of bounds
为什么会出现这样的问题?