1. 程式人生 > >PIE SDK圖像旋轉

PIE SDK圖像旋轉

pla null 說明 enter tput region raw 算法 vat

1.算法功能簡介

圖像旋轉可使圖像以中心點為軸沿特定方向旋轉指定的角度。

PIESDK支持算法功能的執行,下面對圖像旋轉算法功能進行介紹。

2.算法功能實現說明

2.1 實現步驟

第一步

算法參數設置

第二步

算法執行

第三步

結果顯示

2.2 算法參數

C#算法DLL

PIE.CommonAlgo.dll

C#算法名稱

PIE.CommonAlgo.ImageRotationAlgo

參數結構體

ImageRotation_Exchange_Info

參數說明

InputFilePath

String

輸入文件

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

OutputFilePath

String

輸出文件路徑

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

RotationType

Int

旋轉類別(順時針旋轉:0;逆時針旋轉:1)

RotationAngle

Int

旋轉角度(0-360度)

FuncName

String

功能名稱

FileTypeCode

String

根據輸出類型獲得文件編碼類型

.tif/.tiff——GTiff

.img—————HFA

其他—————ENVI

LowBands

IList<Int>

輸出旋轉影像的波段(至少選擇一個波段,{ 0, 1, 2, 3 })

2.3示例代碼

項目路徑

百度雲盤地址下/PIE示例程序/ FundamentalToolDemo.ImageRotationDemo ()

數據路徑

百度雲盤地址下/ PIE示例數據/柵格數/World/world.tiff

視頻路徑

百度雲盤地址下/PIE視頻教程/圖像旋轉算法avi

示例代碼

技術分享圖片
 1          /// <summary>
 2         ///圖像旋轉算法測試,本算法實現了將World.tif文件順時針旋轉90度生成World7.tif文件
3 /// </summary> 4 private void Test_KrigingInterpolationAlgo() 5 { 6 #region 1、參數設置 7 PIE.CommonAlgo.ImageRotation_Exchange_Info info = new PIE.CommonAlgo.ImageRotation_Exchange_Info(); 8 info.InputFilePath = @"D:\Data\World.tif"; 9 info.OutputFilePath = @"D:\Data\World7.tif"; 10 info.RotationType = 0; 11 info.RotationAngle = 90; 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.ImageRotationAlgo"); 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; PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo); 23 //3、結果顯示 24 ILayer layer = PIE.Carto.LayerFactory.CreateDefaultLayer(@"D:\Data\World7.tif"); 25 m_HookHelper.ActiveView.FocusMap.AddLayer(layer); m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll); 26 }
View Code

2.4示例截圖

技術分享圖片

PIE SDK圖像旋轉