I have problem with my basic script which load image, then convert it to array, zooming by interpolation and should save zoomed image to file but this last line don't work. I have no idea how to fix it, i know that problem it is with zoomed array. I will be very glad for any help.
Script Code:
import numpy as np
import scipy.ndimage as ndimage
from scipy import misc
import matplotlib.pyplot as plt
x= misc.imread('img400x400.jpg')
x2= ndimage.zoom(x, 2, order=0)
#print x
#print x2
#plt.imshow(x)
plt.savefig(x2)
Output that I got:
Traceback (most recent call last): File "imgpolar.py", line 11, in plt.savefig(x2) File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 561, in savefig return fig.savefig(*args, **kwargs) File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 1421, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib/pymodules/python2.7/matplotlib/backend_bases.py", line 2220, in print_figure **kwargs) File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 517, in print_png filename_or_obj, self.figure.dpi) TypeError: Object does not appear to be a 8-bit string path or a Python file-like object