zoukankan      html  css  js  c++  java
  • PIE SDK定向滤波

    1. 算法功能简介

        定向滤波又称为匹配滤波,是通过一定尺寸的方向模板对图像进行卷积计算,并以卷积值代替各像元点灰度值,强调的是某一些方向的地面形迹,例如水系。线性影像等。

        方向模板是一个各元素大小按照一定规律取值,并对某一方向灰度变化最敏感的矩阵。将方向模板的中心沿图像像元依次移动,在每一位置上把模板中每个点的值与图像上相对的像元值点相乘后再相加。

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

    2. 算法功能实现说明

    2.1. 实现步骤

    第一步

    算法参数设置

    第二步

    算法执行

    第三步

    结果显示

    2.2. 算法参数

    算法名称

    微分锐化

    C#算法DLL

    PIE.CommonAlgo.dll

    C#算法名称

    PIE.CommonAlgo.ImgProFiltSpaDirectAlgo

    参数结构体

    StImageDirectInfo

    参数说明

    InputFilePath

    String

    输入文件

    (*.tif;*.tiff; *.img)

    OutputFilePath

    String

    输出文件路径

    (*.tif;*.tiff; *.img)

    XMLFile

    String

    XML文件路径

    (*.xml)

    FilterDirect

    Int

    定向滤波方向类别(横向滤波:0;纵向滤波:1;斜向45度滤波:2;斜向135度滤波:3)

    FuncName

    String

    功能名称

    FileTypeCode

    String

    根据输出类型获得文件编码类型

    .tif/.tiff——GTiff

    .img—————HFA

    其他—————ENVI

    LowBands

    IList<Int>

    输出影像的波段(至少选择一个波段,{ 0, 1, 2, 3 })

    2.3. 示例代码

    项目路径

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

    数据路径

    百度云盘地址下/PIE示例数据/栅格数据/04.World/World.tif

    视频路径

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

    示例代码

     1          /// <summary>
     2         /// 定向滤波算法测试,本算法实现了将World.tif进行定向滤波,定向滤波方向类别为横向滤波
     3         /// </summary>
     4         public override void OnClick()
     5         {
     6             #region 1、参数设置
     7             PIE.CommonAlgo.StImageDirectInfo info = new PIE.CommonAlgo.StImageDirectInfo();
     8 
     9             info.InputFilePath = @"D:DataWorld.tif";
    10             info.OutputFilePath = @"D:Dataip_result19.tif";
    11             info.FilterDirect = 0;
    12             info.FileTypeCode = "GTiff";
    13             info.LowBands = new List<int> { 0, 1, 2 };
    14 
    15             PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.ImgProFiltSpaDirectAlgo");
    16             if (algo == null) return;
    17             #endregion
    18 
    19             //2、算法执行
    20             PIE.SystemAlgo.ISystemAlgoEvents algoEvents = algo as PIE.SystemAlgo.ISystemAlgoEvents;
    21             algo.Name = " 定向滤波";
    22             algo.Params = info;
    23             bool result = PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo);
    24 
    25             //3、结果显示
    26             ILayer layer = PIE.Carto.LayerFactory.CreateDefaultLayer(@"D:Dataip_result19.tif");
    27             m_HookHelper.ActiveView.FocusMap.AddLayer(layer);           m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
    28         }
    View Code


    2.4. 示例截图

  • 相关阅读:
    MyEclipse配置Tomcat 并编写第一个JSP程序
    ubuntu安装postgresql与postgis
    ubuntu12.10升级至14.04
    ubuntu 12.10无法用apt-get安装软件 Err http://us.archive.ubuntu.com quantal-updates/main Sources 404 Not
    hive0.13网络接口安装
    hive报错 Another instance of Derby may have already booted the database
    前端开发者进阶之函数柯里化Currying
    js中的事件委托
    while 和 for 对比
    小图标文字对齐的终极解决方案
  • 原文地址:https://www.cnblogs.com/PIESat/p/10214101.html
Copyright © 2011-2022 走看看