簡體   English   中英

如何使用python matplotlib估算衛星圖像中的像素數

[英]How to estimate the number of pixels in a satellite image using python 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') 

現在,我需要估算每種溫度范圍的像素數量。 我該怎么做? 請幫我。

現在,我需要估算每種溫度范圍的像素數量。

我想histogram功能就是您所需要的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM