坏条带的由来: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两列有坏线:
修复后: