zoukankan      html  css  js  c++  java
  • PIE SDK过滤

     

    1. 算法功能简介

        过滤功能使用斑点分组方法来消除分类文件中被隔离的分类像元,用以解决分类图像中出现的孤岛问题。

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

    2. 算法功能实现说明

    2.1. 实现步骤

    第一步

    算法参数设置

    第二步

    算法执行

    第三步

    结果显示

    2.2. 算法参数

    算法名称

    过滤

    C#算法DLL

    PIE.CommonAlgo.dll

    C#算法名称

    PIE.CommonAlgo.ImgClassPostSieveAlgo

    参数结构体

    StClassPostclump

    参数说明

    inputfile

    String

    输入分类后的影像路径

    *.tif;*.tiff;*.img

    outputfile

    String

    输出影像路径

    classindex

    IList<Int>

    选择的分类列表

    kernel

    IList<Int>

    本算法中该参数一共需要两个变量

    第一个值表示聚类邻域大小值为4或8;表示参与分析的周围像元大小

    第二个值表示过滤阈值 (值大于1)一组中小于该值的像元将被删除

    2.3. 示例代码

    项目路径

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

    数据路径

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

    视频路径

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

    示例代码

     1 /// <summary>
     2 /// 过滤算法测试,本算法实现了将ip_result1.tif进行过滤,选择的分类列表为全部分类,聚类邻域为4,过滤阈值为2
     3 /// </summary>
     4 public override void OnClick()
     5 {
     6 #region 1、参数设置
     7 PIE.CommonAlgo.StClassPostclump info = new PIE.CommonAlgo.StClassPostclump();
     8 
     9 info.inputfile = @"D:DataISODataClassification.tif";
    10 info.outputfile = @"D:Dataip_result4.tif";
    11 info.classindex = new List<int> { 0, 1, 2, 3,4,5,6,7,8 };
    12 info.kernel = new List<int> { 4, 2 };
    13 
    14 PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.ImgClassPostSieveAlgo");
    15 if (algo == null) return;
    16 #endregion
    17 
    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:Dataip_result4.tif");
    26 m_HookHelper.ActiveView.FocusMap.AddLayer(layer);
    27 m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
    28 }
    View Code

    2.4. 示例截图

  • 相关阅读:
    shell之for和if实现批量替换多目录下的文件
    问题:Linux报swap空间占用过高,但物理内存还有空余
    git常用命令汇总
    VMware下liunx虚拟机仅主机模式上网
    通过Navicat for MySQL远程连接的时候报错mysql 1130的解决方法
    Linux启动过程简述
    Nginx禁止ip访问或IP网段访问方法
    解决docker主机配置了DaoCloud.io的加速后重启失败问题Failed to start Docker Application Container Engine
    Windows下用python来获取微信撤回消息
    Oracle 参数文件spfile
  • 原文地址:https://www.cnblogs.com/PIESat/p/10214800.html
Copyright © 2011-2022 走看看