Exemple #1
0
        public override IExtractResult MakeExtProduct(IPixelIndexMapper piexd, Action <int, string> progressTracker)
        {
            try
            {
                piexd = CalcBackTmp(piexd);
                if (piexd == null || _curFeatures == null || _argumentProvider == null)
                {
                    return(null);
                }

                Dictionary <int, PixelFeature> features = new Dictionary <int, PixelFeature>();
                foreach (int index in piexd.Indexes)
                {
                    if (_curFeatures.ContainsKey(index))
                    {
                        features.Add(index, _curFeatures[index]);
                    }
                }
                if (features.Count == 0)
                {
                    return(null);
                }
                return(GetOtherExtractResult.GetExtractResult(_argumentProvider, features, piexd, null, progressTracker));
            }
            finally
            {
                _curFeatures = null;
            }
        }
Exemple #2
0
        private IExtractResult FRILAlgorithm()
        {
            int    VisibleCH        = Obj2Int(_argumentProvider.GetArg("Visible"));
            int    NearInfraredCH   = Obj2Int(_argumentProvider.GetArg("NearInfrared"));
            int    MiddleInfraredCH = Obj2Int(_argumentProvider.GetArg("MiddleInfrared"));
            int    FarInfraredCH    = Obj2Int(_argumentProvider.GetArg("FarInfrared"));
            string currRaster       = Obj2String(_argumentProvider.GetArg("CurrentRasterFile"));
            string currDBLV         = Obj2String(_argumentProvider.GetArg("DBLVFile"));

            if (VisibleCH == -1 || FarInfraredCH == -1 || NearInfraredCH == -1 || MiddleInfraredCH == -1)
            {
                PrintInfo("获取波段序号失败,可能是波段映射表配置错误。");
                return(null);
            }
            if (string.IsNullOrEmpty(currRaster) || string.IsNullOrEmpty(currDBLV))
            {
                PrintInfo("获取算法所用文件失败。");
                return(null);
            }

            List <int>        vertifyIndexiex = null;
            IPixelIndexMapper result          = CreataPixelMapper(currDBLV, out vertifyIndexiex);

            if (result == null || result.Indexes.ToArray().Length == 0)
            {
                PrintInfo("当前判识结果中无火点信息。");
                return(null);
            }
            int[] filteredAOI = result.Indexes.ToArray();
            Size  size        = new Size(_argumentProvider.DataProvider.Width, _argumentProvider.DataProvider.Height);
            DoubtFirPixelFilter doubtFilter = CreateArgument.CreateDoubtFilter(_argumentProvider, _contextMessage);

            if (doubtFilter == null)
            {
                return(null);
            }
            Rectangle aoiRect = AOIHelper.ComputeAOIRect(filteredAOI, size);

            //背景温度计算
            PrintInfo("[开始]背景亮温计算...");
            BackTmpComputer backTmpComputer = CreateArgument.CreateBackTmpComputer(_argumentProvider, doubtFilter as IBackTmpComputerHelper, _contextMessage);

            if (backTmpComputer == null)
            {
                return(null);
            }
            aoiRect = AOIHelper.ComputeAOIRect(filteredAOI, size);
            Dictionary <int, PixelFeature> curFeatures = backTmpComputer.Compute(_argumentProvider, aoiRect, filteredAOI);

            VertifyFirPixel(ref curFeatures, vertifyIndexiex, ref result);
            return(GetOtherExtractResult.GetExtractResult(_argumentProvider, curFeatures, result, _contextMessage, _progressTracker));
        }