我正在处理卫星图像。我有一个程序(Python)来根据云顶的温度对比卫星图像,程序如下:
from pylab import *
#import pylab imread,imshow
sat=imread('1101092045G13I04.tif')
imshow(sat)
map=imread('map.tif')
map=mean(map,2,)/3
#contour(map,cmap=cm.gray)
imshow((sat+map)**2,cmap=cm.gray,origin=1)
frio=where(logical_and((418.-sat)-273.15>=-110,(418.-sat)-273.15<=-31),(418.-sat)-273.15,0)
quente=where(logical_and((660.-sat)/2-273.15>-31,(660.-sat)/2-273.15<=40),(660.-sat)/2-273.15,0)
imshow=((frio+quente))
temperatura=[-80,-70,-60,-50,-40,-30]
#cores -> 'r','b','k','c','g','m','y'
amar='#ffff00'
verm='#ff3333'
verd='#00ff00'
lara='#ff9900'
aaaa='#ff00ff'
contourf((frio+quente),temperatura,transparent='true',colors=[aaaa,verm,lara,amar,verd])
colorbar(cmap=cm.hot,shrink=0.6,orientation='horizontal',ticks=[-80, -70, -60, -50, -40, -30])
show()
#savefig('testeII.png')
现在我需要估算每个温度范围的像素数。我该怎么做?请帮帮我。