惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 风过 无痕

ArcGIS Pro+Gemini+ChatGPT+遥感AI+图解建模+无人机赠送GMail+高分影像 3种数字高程模型模型精度对比研究Accuracy Assessment of Alos W3d30, Aster Gdem and Srtm30 Dem The State of World Fisheries and Aquaculture 2024 - Blue Transformation in action Global Food and Nutrition Security - Key messages What is the naming convention for Landsat Collections Level-1 scenes? 大模型的幻觉是不可避免 GEE哨兵-2光学卫星(S2)地表反射率和NDVI下载 CreateHolesInImage说明文档-对于遥感影像的空洞创建多边形矢量数据 博客园导入word文档docx, doc, markdown md文档的方法 搜狗输入法占用vs visual studio 编译快捷键冲突的解决方法 安卓平板小米平板5取消自动分屏 LANDSAT LC08 C02 T1_L2 metadata dictory 元数据字典 GEE云量计算简单云量估计 主要功能 从数据集中选择云量最小的像素,输出展示 Landsat 8 Collection 2 Tier 1 calibrated top-of-atmosphere (TOA) reflectance Acrobat pdf 编辑添加下划线acrobat pro SuperMap iObjects.NET 64位开发入门 多个文本文件合并 envi5.3打开失败JSON_PARSE: Invalid string, no closing '"' GEE的存储空间 Photoshop无法载入动作,因为意外地遇到文件尾-处理办法 ArcGIS空间分析案例教程-网格和标记生成
IDL实现TM遥感影像直方图统计(中值、均值、方差、众数及峰度系数计算)(转)
风过 无痕 · 2022-09-02 · via 博客园 - 风过 无痕

IDL实现TM遥感影像直方图统计(中值、均值、方差、众数及峰度系数计算)(转)

1 代码

近红外波段:

Pro statistic_tm

  fn=dialog_pickfile(title='Plesse choose image:')

  tm_img=read_image(fn)

  sz=size(tm_img)

  n_columns=sz[2] & n_raws=sz[3]

  ;window,0,xsize=n_columns,ysize=n_raws

  ;tvscl,tm_img,/true

  ;tm_ref=reform(tm_img,)

  tm_rgb=tm_img[0:2,*,*]

  tm_nir=tm_img[3,*,*]

  tm_r=tm_img[2,*,*]

  tm_g=tm_img[1,*,*]

  tm_b=tm_img[0,*,*]

  tm_sf=[tm_nir,tm_r,tm_g]

  ;szr=size(tm_r)

  ;n_c=szr[2] & n_r=szr[3]

  ;statastic

  MED=median(tm_nir)

  MEA=mean(tm_nir)

  VAR=variance(tm_nir)

  KUR=kurtosis(tm_nir)

  His=histogram(tm_nir,nbins=100,locations=locations,omin=omim,omax=omax)

  Sel=where(His EQ max(His))

  MODE=tm_nir[Sel[0]]

  MED_label='Median='+string(MED,format='(f5.2)')

  MEA_label='Mean='+string(MEA,format='(f5.2)')

  VAR_label='Variance='+string(VAR,format='(f7.2)')

  KUR_label='Kurtosis='+string(KUR,format='(f5.2)')

  MOD_label='Mode='+string(MODE,format='(f5.2)')

  p1=plot(locations,His,linestyle=0,color='red',thick=2,dimensions=[600,400],$

  title='Histogram Of NIR Band',window_title='Histogram',xrange=[0,200],yrange=[0,10000])

  t1=text(0.20,0.80,MED_label,target=p1,font_size=12)

  t2=text(0.20,0.75,MEA_label,target=p1,font_size=12)

  t3=text(0.20,0.70,VAR_label,target=p1,font_size=12)

  t4=text(0.20,0.65,KUR_label,target=p1,font_size=12)

  t5=text(0.20,0.60,MOD_label,target=p1,font_size=12)

  ;window,0,xsize=n_columns,ysize=n_raws

  ;tvscl,tm_img,/true

  ;imgshow_r=image(tm_r,dimension=[n_c,n_r],margin=0,title='TM Image of R',window_title='True R')

  ;imgshow_false=image(tm_sf,dimension=[n_columns,n_raws],margin=0,title='TM Image of Standared False',window_title='False Image')

  ;imgshow_true.save,'true.jpeg',resolution=600

  ;imgshow_false.save,'false.jpeg',resolution=600

End

注:以上代码是TM近红外波段统计与直方图显示,其他波段类似只需换一下如下代码,如统计红波段改为:

 ;statastic

  MED=median(tm_r)

  MEA=mean(tm_r)

  VAR=variance(tm_r)

  KUR=kurtosis(tm_r)

  His=histogram(tm_r,nbins=100,locations=locations,omin=omim,omax=omax)

  Sel=where(His EQ max(His))

  MODE=tm_r[Sel[0]]

p1=plot(locations,His,linestyle=0,color='red',thick=2,dimensions=[600,400],$

  title='Histogram Of R Band',window_title='Histogram',xrange=[0,200],yrange=[0,12000])

2 结果:

近红外波段直方图统计:

版权声明:本文为CSDN博主「遇见飖雪」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/qq_41799597/article/details/106452870