我正在处理卫星图像。我有一个程序(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')
现在我需要估计每个温度等级的像素数。我该怎么做?请帮助我。
最佳答案
Now i need to estimate the number of pixels for each scale of temperatures.
我想histogram
功能就是您所需要的。
关于python - 如何使用 python matplotlib 估计卫星图像中的像素数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5377065/