壞條帶的由來:2003年5月31日,Landsat-7ETM+機載掃描行校訂器(SLC) 故障,致使此後獲取的影像出現了數據條帶丟失,嚴重影響了Landsat ETM遙感影像的使用。此後Landsat 7 ETM SLC-on是指2003.5.31日Landsat 7SLC故障以前的數據產品,Landsat 7 ETMSLC-OFF則是故障以後的數據產品。算法
目前咱們PIE SDK支持影像壞線修復,並提供了相應的算法。ide
第一步工具 |
算法參數設置測試 |
第二步spa |
算法執行code |
第三步視頻 |
結果顯示blog |
C#算法DLL教程 |
PIE.CommonAlgo.dllci |
|
C#算法名稱 |
PIE.CommonAlgo. BadLineFixAlgo |
|
參數結構體 |
BadLineFix_Exchange_Info |
|
參數說明 |
||
FixedOnSourceFile |
bool |
是否在原數據上修復 |
InputFilePath |
String |
輸入文件的路徑 |
OutputFilePath |
String |
輸出文件的路徑 |
InputRasterDataset |
IRasterDataset |
輸入數據集 |
OutputRasterDataset |
IRasterDataset |
輸出數據集 |
HorizontalBadLineIndexs |
IList<int> |
水平方向數據壞線所在的行號集合 |
HorizontalFixedType |
int |
水平方向壞線修復方法:0,表示以壞線的上行正確值修復;1,以壞線的下行正確值修復;2,表示以壞線的上下行的平均值進行修復 |
VerticalBadLineIndexs |
IList<int> |
垂直方向數據壞壞線所在的列號集合 |
VerticalFixedType |
int |
垂直方向壞線修復方法:0,表示以壞線的上列正確值修復;1,以壞線的下列正確值修復;2,表示以壞線的上下列的平均值進行修復 |
數據路徑 |
百度雲盤地址下/ PIE示例數據/柵格數據/ 07.GF4 / GF4_B1_E114.1_N20.6_20180916_L1A0310000011.tiff |
視頻路徑 |
百度雲盤地址下/PIE視頻教程/10.算法調用/其餘工具/影像壞線修復算法.avi |
示例代碼 |
|
![]() 1 /// <summary> 2 ///壞線修復功能 3 /// </summary> 4 private void Test_RepairBadLineAlgo() 5 { 6 string filePath1 = @"D:\MapData\Raster\壞線修復測試數據\GF4_B1_E114.1_N20.6_20180916_L1A0310000011.tiff"; 7 string outFilePath1 = @"D:\MapData\Raster\壞線修復測試數據\temp\bandLineTest2.tif"; 8 //垂直方向壞線位置 9 IList<int> bandVerticalLineIndexs = new List<int>(); 10 bandVerticalLineIndexs.Add(1116);//1116列 11 bandVerticalLineIndexs.Add(1117); 12 //水平方向壞線位置 水平沒有壞線能夠不寫 13 //IList<int> bandHorizonLindIndexs=new List<int>(); 14 //bandHorizonLindIndexs.Add(329); 15 PIE.CommonAlgo.BadLineFix_Exchange_Info info = new PIE.CommonAlgo.BadLineFix_Exchange_Info(); 16 info.InputFilePath = filePath1; 17 info.OutputFilePath = outFilePath1; 18 //若是設置了InputRasterDataset執行結果會輸出一個柵格數據集 經過獲取算法參數的OutputRasterDataset 19 //info.InputRasterDataset = DatasetFactory.OpenRasterDataset(filePath,OpenMode.ReadOnly); 20 //info.HorizontalBadLineIndexs = bandHorizonLindIndexs; 21 //info.HorizontalFixedType = 2;//水平方向修復方法 22 info.VerticalBadLineIndexs = bandVerticalLineIndexs; 23 info.VerticalFixedType = 2;//垂直方向修復方法 24 info.FixedOnSourceFile = false;//是否在原數據上修復 25 26 PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.BadLineFixAlgo");//算法執行 27 algo.Params = info; 28 bool result1 = PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo); 29 } |
修復前柵格圖像中第1116和1117兩列有壞線:
修復後: