圖像旋轉可以使圖像以中心點爲軸沿特定方向旋轉指定的角度。算法
PIESDK支持算法功能的執行,下面對圖像旋轉算法功能進行介紹。ide
第一步工具 |
算法參數設置測試 |
第二步編碼 |
算法執行spa |
第三步3d |
結果顯示code |
C#算法DLL視頻 |
PIE.CommonAlgo.dllblog |
|
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 }) |
項目路徑 |
百度雲盤地址下/PIE示例程序/10.算法調用/多功能工具/ FundamentalToolDemo.ImageRotationDemo |
數據路徑 |
百度雲盤地址下/ PIE示例數據/柵格數/04.World/World.tif |
視頻路徑 |
百度雲盤地址下/PIE視頻教程/10.算法調用/多功能工具/圖像旋轉算法.avi |
示例代碼 |
|
![]() 1 /// <summary> 2 ///圖像旋轉算法測試,本算法實現了將World.tif文件順時針旋轉90度生成World7.tif文件 3 /// </summary> 4 private void Test_KrigingInterpolationAlgo() 5 { 6 #region 一、參數設置 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 //二、算法執行 20 PIE.SystemAlgo.ISystemAlgoEvents algoEvents = algo as PIE.SystemAlgo.ISystemAlgoEvents; 21 algo.Name = "圖像旋轉"; 22 algo.Params = info; PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo); 23 //三、結果顯示 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 } |