观察内存使用情况:
使用 gc.mem_free() 查看当前可用内存,确保有足够的内存捕获较大图像。
python
複製程式碼
import gc
print("当前可用内存:", gc.mem_free())