python - 如何使用 python matplotlib 估计卫星图像中的像素数

标签 python image-processing matplotlib

我正在处理卫星图像。我有一个程序(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/

相关文章:

python - 按 x 和 y 坐标绘制条形图

python - 如何使用 matplotlib 绘制这样的图

Python Requests Post 卡在开始新的 HTTP 连接

Android 在图像上应用自定义贴纸

python - 如何使用 python 在 Windows 10 中获取当前正在播放的媒体的标题

python - "System error: new style getargs format but argument is not a tuple"使用 cv2.blur 时

python - Python 或 C 中的 Matlab/Octave bwdist()

python - matplotlib 中的散点图

python - 如何从 Dragon NaturallySpeaking 中的高级脚本语音命令调用 python 函数?

python - numpy/scipy 中的快速二维刚体变换