private void DrawDynamicResult(byte[] bytes, int width, int height) { var currentFolder = _dataFolders.Last(); //ДО того, что было var oldImageFolder = _dataFolders.First(); var oldDescription = new LandsatDataDescription(oldImageFolder); CuttedImageInfo oldCuttedImageInfo = ClipImageHelper.GetCuttedImageInfoByPolygon(oldDescription.Channel4.Raw, _polygon); DrawLib.DrawNaturalColor(oldDescription.Channel4.Normalized , oldDescription.Channel3.Normalized , oldDescription.Channel2.Normalized, oldCuttedImageInfo, _pathToVisibleImage + "-old.png"); var landsatDescription = new LandsatDataDescription(currentFolder); CuttedImageInfo cuttedImageInfo = ClipImageHelper.GetCuttedImageInfoByPolygon(landsatDescription.Channel4.Raw, _polygon); DrawLib.DrawMask(bytes, width, height, _pathToDynamicFile); DrawLib.DrawEdges(_pathToDynamicFile, _pathToEdgedDynamicFile); DrawChannelsAccordingToPhenomenonType(_phenomenon, landsatDescription, cuttedImageInfo); DrawLib.DrawMask(_pathToEdgedDynamicFile, _pathToVisibleImage + "4-3-2.png", _pathToVisibleDynamicFile); }
public override string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder, string resultFolder) { LandsatDataDescription landsatDescription = new LandsatDataDescription(dataFolder); CuttedImageInfo cuttedImageInfo = ClipImageHelper.GetCuttedImageInfoByPolygon(landsatDescription.Channel4.Raw, new GeographicPolygon { UpperLeft = leftUpper, LowerRight = rigthLower }); string resultFileName; string redChannelFileName; string blueChannelFileName; string greenChannelFileName; switch (_characteristicType) { case CharacteristicType.Channels543: { redChannelFileName = landsatDescription.Channel5.Normalized; greenChannelFileName = landsatDescription.Channel4.Normalized; blueChannelFileName = landsatDescription.Channel3.Normalized; resultFileName = resultFolder + "5-4-3.jpg"; break; } case CharacteristicType.Channels753: { redChannelFileName = landsatDescription.Channel7.Normalized; greenChannelFileName = landsatDescription.Channel5.Normalized; blueChannelFileName = landsatDescription.Channel3.Normalized; resultFileName = resultFolder + "7-5-3.jpg"; break; } case CharacteristicType.Channels432: case CharacteristicType.Unknown: default: { redChannelFileName = landsatDescription.Channel4.Normalized; greenChannelFileName = landsatDescription.Channel3.Normalized; blueChannelFileName = landsatDescription.Channel2.Normalized; resultFileName = resultFolder + "4-3-2.jpg"; break; } } DrawLib.DrawNaturalColor(redChannelFileName , greenChannelFileName , blueChannelFileName, cuttedImageInfo, resultFileName); return(new string[] { resultFileName }); }
private void DrawChannelsAccordingToPhenomenonType(PhenomenonType phenomenonType , LandsatDataDescription landsatDescription , CuttedImageInfo cuttedImageInfo) { switch (phenomenonType) { case PhenomenonType.ForestPlantationsDeseases: { DrawLib.DrawNaturalColor(landsatDescription.Channel4.Normalized , landsatDescription.Channel3.Normalized , landsatDescription.Channel2.Normalized, cuttedImageInfo, _pathToVisibleImage + "4-3-2.png"); DrawLib.DrawNaturalColor(landsatDescription.Channel5.Normalized , landsatDescription.Channel4.Normalized , landsatDescription.Channel3.Normalized, cuttedImageInfo, _pathToVisibleImage + "5-4-3.png"); DrawLib.DrawNaturalColor(landsatDescription.Channel7.Normalized , landsatDescription.Channel5.Normalized , landsatDescription.Channel3.Normalized, cuttedImageInfo, _pathToVisibleImage + "7-5-3.png"); } break; case PhenomenonType.SoilErosion: { DrawLib.DrawNaturalColor(landsatDescription.Channel7.Normalized , landsatDescription.Channel5.Normalized , landsatDescription.Channel3.Normalized, cuttedImageInfo, _pathToVisibleImage + "7-5-3.png"); DrawLib.DrawNaturalColor(landsatDescription.Channel4.Normalized , landsatDescription.Channel3.Normalized , landsatDescription.Channel2.Normalized, cuttedImageInfo, _pathToVisibleImage + "4-3-2.png"); } break; case PhenomenonType.SoilPollutionByOilProducts: { DrawLib.DrawNaturalColor(landsatDescription.Channel4.Normalized , landsatDescription.Channel3.Normalized , landsatDescription.Channel2.Normalized, cuttedImageInfo, _pathToVisibleImage + "4-3-2.png"); } break; case PhenomenonType.SurfaceDumps: { DrawLib.DrawNaturalColor(landsatDescription.Channel4.Normalized , landsatDescription.Channel3.Normalized , landsatDescription.Channel2.Normalized, cuttedImageInfo, _pathToVisibleImage + "4-3-2.png"); } break; case PhenomenonType.Unknown: { DrawLib.DrawNaturalColor(landsatDescription.Channel4.Normalized , landsatDescription.Channel3.Normalized , landsatDescription.Channel2.Normalized, cuttedImageInfo, _pathToVisibleImage + "4-3-2.png"); } break; } }