PIE SDK聚类
发布日期:2021-09-02 05:58:47 浏览次数:2 分类:技术文章

本文共 1822 字,大约阅读时间需要 6 分钟。

 

1.算法功能简介

    聚类处理时运用形态学算子将临近的类似分类区域聚类并合并。

    PIE SDK支持算法功能的执行,下面对聚类算法功能进行介绍。

2.算法功能实现说明

2.1. 实现步骤

第一步

算法参数设置

第二步

算法执行

第三步

结果显示

2.2. 算法参数

算法名称

聚类

C#算法DLL

PIE.CommonAlgo.dll

C#算法名称

PIE.CommonAlgo.ImgClassPostClumpAlgo

参数结构体

StClassPostclump

参数说明

inputfile

String

输入分类后的影像路径

*.tif;*.tiff;*.img

outputfile

String

输出影像路径

classindex

IList<Int>

选择的分类列表

kernel

IList<Int>

本算法中该参数含义为形态学算子,一共需要两个变量

第一个值表示形态学算子Rows大小值为奇数

第二个值表示形态学算子Columns大小值为奇数

2.3. 示例代码

项目路径

百度云盘地址下/PIE示例程序/10.算法调用/图像处理/ ImageProcessing. ImgClassPostClumpAlgo

数据路径

百度云盘地址下/PIE示例数据/栅格数据/01.GF1/ISODataClassification.tif

视频路径

百度云盘地址下/PIE视频教程/10.算法调用/图像处理/聚类算法avi

示例代码

1 ///  2 /// 聚类算法测试,本算法实现了将ip_result1.tif进行聚类,选择的分类列表为全部分类,形态学算子Rows和Columns均为3 3 ///  4 public override void OnClick() 5 { 6 #region 1、参数设置 7 PIE.CommonAlgo.StClassPostclump info = new PIE.CommonAlgo.StClassPostclump(); 8  9 info.inputfile = @"D:\Data\ISODataClassification.tif";10 info.outputfile = @"D:\Data\ip_result5.tif";11 info.classindex = new List
{ 0, 1, 2, 3, 4, 5, 6, 7, 8 };12 info.kernel = new List
{ 3,3 };13 14 PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.ImgClassPostClumpAlgo");15 if (algo == null) return;16 #endregion17 18 //2、算法执行19 PIE.SystemAlgo.ISystemAlgoEvents algoEvents = algo as PIE.SystemAlgo.ISystemAlgoEvents;20 algo.Name = " 聚类";21 algo.Params = info;22 bool result = PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo);23 24 //3、结果显示25 ILayer layer = PIE.Carto.LayerFactory.CreateDefaultLayer(@"D:\Data\ip_result5.tif");26 m_HookHelper.ActiveView.FocusMap.AddLayer(layer);27 m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);28 }
View Code

2.4. 示例截图

转载于:https://www.cnblogs.com/PIESat/p/10215019.html

转载地址:https://blog.csdn.net/weixin_34138255/article/details/93758833 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:storm中KafkaSpout的选择
下一篇:三大经济体年2018年末形势一览

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月04日 10时09分42秒