Hi,
I'm trying to equalize an histogram of a raster image. I'm trying to following the method found in this site:
So I did the following step:
But I get the following error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'numpy.ndarray' object has no attribute 'save'
Do you know where I wrong?How can I fix it?
thx
I'm trying to equalize an histogram of a raster image. I'm trying to following the method found in this site:
So I did the following step:
Code:
from PIL import Image
from numpy import *
im = array(Image.open('AquaTermi_lowcontrast.jpg').convert('L'))
imhist,bins = histogram(im.flatten(),nbr_bins,normed=True)
cdf = imhist.cumsum()
cdf = 255 * cdf / cdf[-1]
im2 = interp(im.flatten(),bins[:-1],cdf)
im2.reshape(im.shape)
im2.save(filename)
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'numpy.ndarray' object has no attribute 'save'
Do you know where I wrong?How can I fix it?
thx
Comment