• PIE SDK位深转换


     

    1.算法功能简介

        位深转换功能是一种用于更改一个给定输入文件数据范围的灵活方法。可以完全控制输入和输出直方图,以及输出数据类型(字节型、整型、浮点型等)。

        PIE支持算法功能的执行,下面对位深转换算法功能进行介绍。

    2.算法功能实现说明

    2.1. 实现步骤

    第一步

    算法参数设置

    第二步

    算法执行

    第三步

    结果显示

    2.2. 算法参数

    C#算法DLL

    PIE.CommonAlgo.dll

    C#算法名称

    PIE.CommonAlgo.BitDepthTransAlgo

    参数结构体

    DataBitDepthTrans_Exchange_Info

    参数说明

    m_strInputFile

    String

    输入栅格影像的路径

    m_strOutputFile

    String

    输出影像的路径

    m_strMinIn

    Double

    输入文件的像元最小值

    m_strMaxIn

    Double

    输入文件的像元最大值

    m_strMinOu

    Double

    输出文件的像元最小值

    数据格式/最小值

    "Byte";0

    Int16";-32768

    "UInt16";0

    Int32";-2147483648

    "UInt32";0

    "Float32";0

    "Float64";0

    m_strMaxOu

    Double

    输出文件的像元最大值

    数据格式/最大值

    "Byte"; 255.0

    Int16";32768

    "UInt16"; 65535.0

    Int32";2147483648

    "UInt32"; 4294967295.0

    m_strOutDataType

    String

    输出数据类型

    "Byte";"Int16";"UInt16";

    Int32";"UInt32";"Float32";"Float64";

    m_strOutFileType

    String

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

    .tif/.tiff——GTiff

    .img—————HFA

    其他—————ENVI

    2.3. 示例代码

    项目路径

    百度云盘地址下/PIE示例程序/ FundamentalToolDemo. BitDepthTransDemo 

    数据路径

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

    视频路径

    百度云盘地址下/PIE视频教程10.算法调用/多功能工具/位深转换算法.avi

    示例代码

     1          /// <summary>
     2         ///位深转换算法测试,本算法实现了将World.tif的数据类型转换为”Int16”生成World2.tif文件
     3         /// </summary>
     4         private void Test_KrigingInterpolationAlgo()
     5         {
     6             #region 1、参数设置
     7             PIE.CommonAlgo.DataBitDepthTrans_Exchange_Info info = new PIE.CommonAlgo.DataBitDepthTrans_Exchange_Info();
     8             info.InputFile = @"D:DataWorld.tif";
     9             info.OutputFile = @"D:DataWorld2.tif";
    10             info.MaxIn = 255;
    11             info.MinIn = 0;
    12             info.MaxOut = 32768;
    13             info.MinOut = -32768;
    14             info.OutDataType = 1;
    15 
    16             PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.BitDepthTransAlgo");
    17             if (algo == null) return;
    18 #endregion
    19             //2、算法执行
    20             PIE.SystemAlgo.ISystemAlgoEvents algoEvents = algo as PIE.SystemAlgo.ISystemAlgoEvents;
    21             algo.Name = "位深转换";
    22             algo.Params = info;
    23           PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo);          
    24             //3、结果显示
    25 ILayer layer = PIE.Carto.LayerFactory.CreateDefaultLayer(@"D:DataWorld2.tif");
    26             m_HookHelper.ActiveView.FocusMap.AddLayer(layer);           m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);        
    27        }
    View Code

    2.4. 示例截图

     

  • 相关阅读:
    flash 中无法导出swf文件的解决方法
    codeforces 341C Iahub and Permutations(组合数dp)
    CSS里的 no-repeat 是什么意思
    linux enable命令学习
    config large memory
    java中集合杂记
    Linux操作系统以及各大发行版介绍——Linux operating system and major distribution is introduced
    KVM几种缓存模式
    Elastic-Job
    日交易额百亿级交易系统的超轻量日志实现
  • 原文地址:https://www.cnblogs.com/PIESat/p/10156702.html
Copyright © 2020-2023  润新知