private Dictionary <int, CLMFeature> GetBagDisplayInfo(int visiable, int shortInfraredCH, int nearinfraredCH, IRasterDataProvider prd) { if (_argumentProvider.DataProvider == null) { return(null); } Dictionary <int, CLMFeature> features = new Dictionary <int, CLMFeature>(); CLMFeature tempCLM = null; RasterPixelsVisitor <UInt16> rpVisitor = new RasterPixelsVisitor <UInt16>(_argumentProvider); rpVisitor.VisitPixel(new Rectangle(0, 0, prd.Width, prd.Height), null, new int[] { visiable, shortInfraredCH, nearinfraredCH }, (index, values) => { tempCLM = new CLMFeature(); tempCLM.Ndsi = (Int16)((values[1] - values[0]) * 1000f / (values[1] + values[0])); tempCLM.Ndvi = (Int16)((values[2] - values[1]) * 1000f / (values[2] + values[1])); tempCLM.Visible = values[0]; tempCLM.UseFarInfrared = false; tempCLM.UseNDSI = false; tempCLM.UseNearVisiable = false; tempCLM.UseNDVI = true; tempCLM.UseNearShort = true; tempCLM.UseNearInfrared = true; tempCLM.shortInfrared = values[1]; tempCLM.nearInfrared = values[2]; features.Add(index, tempCLM); } ); return(features); }
private Dictionary <int, CLMFeature> GetDisplayInfo(int NDSIVisibleCH, int ShortInfraredCH, int VisibleCH, int FarInfraredCH, bool useNDSI, bool useNearVisiable, bool useFarInfrared, IRasterDataProvider prd) { if (_argumentProvider.DataProvider == null) { return(null); } Dictionary <int, CLMFeature> features = new Dictionary <int, CLMFeature>(); CLMFeature tempCLM = null; RasterPixelsVisitor <UInt16> rpVisitor = new RasterPixelsVisitor <UInt16>(_argumentProvider); if (NDSIVisibleCH == -1) { NDSIVisibleCH = 1; } if (ShortInfraredCH == -1) { ShortInfraredCH = 1; } if (VisibleCH == -1) { VisibleCH = 1; } if (FarInfraredCH == -1) { FarInfraredCH = 1; } rpVisitor.VisitPixel(new Rectangle(0, 0, prd.Width, prd.Height), null, new int[] { NDSIVisibleCH, ShortInfraredCH, VisibleCH, FarInfraredCH }, (index, values) => { tempCLM = new CLMFeature(); tempCLM.Ndsi = (Int16)((values[0] - values[1]) * 1000f / (values[0] + values[1])); tempCLM.Visible = values[2]; tempCLM.FarInfrared = values[3]; tempCLM.nearInfrared = values[1]; tempCLM.UseFarInfrared = useFarInfrared; tempCLM.UseNDSI = useNDSI; tempCLM.UseNearVisiable = useNearVisiable; features.Add(index, tempCLM); } ); return(features); }