예제 #1
0
        public void Init(FPFImage img, Metadata mt)
        {
            this.irImage = img;
            this.metadata = mt;

            this.refArea = 1;
        }
예제 #2
0
        public void Init(FPFImage img, Metadata mt)
        {
            this.irImage  = img;
            this.metadata = mt;

            this.refArea = 1;
        }
예제 #3
0
        public void ProcessThermalImage(string thermalName, string metadataName)
        {
            _processed = false;
            hotSpots.Clear();
            fusionName = null;

            irName = thermalName;
            mtName = metadataName;
            if (mtName != null)
            {
                if (RTDPSettings.doGeolocation || RTDPSettings.doImageFusion)
                {
                    try
                    {
                        // Load TELEMETRY
                        metadata.ReadXML(mtName);
                    }
                    catch (Exception ex)
                    {
                        _processed = true;
                        return;
                    }
                    float elevation = 0;
                    metadata.SetHeights(RTDPSettings.terrainModelSettings.localGeoidHeight, elevation);
                }
            }

            if (irName != null)
            {
                if (RTDPSettings.geolocationSettings.geolocateIRimage || RTDPSettings.doSegmentation || RTDPSettings.doImageFusion)
                {
                    // Load IR IMAGE
                    try
                    {
                        irImage = new FPFImage(irName);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                        _processed = true;
                        return;
                    }

                    if (RTDPSettings.doSegmentation)
                    {
                        // SEGMENTATION
                        segmentation.Init(irImage, metadata);
                        hotSpots = segmentation.Solve();
                    }

                    if (mtName != null)
                    {
                        if (RTDPSettings.geolocationSettings.geolocateIRimage || (RTDPSettings.geolocationSettings.geolocateHotspots && hotSpots.Count > 0))
                        {
                            // GEOLOCATION
                            irGeolocation.Init(metadata.uavTelemetry);
                            if (RTDPSettings.geolocationSettings.geolocateHotspots && hotSpots.Count > 0)
                            {
                                foreach (HotSpot hs in hotSpots)
                                {
                                    hs.Geolocation = irGeolocation.GetPixelGeolocation(hs.M, hs.N);
                                }
                            }
                            if (RTDPSettings.geolocationSettings.geolocateIRimage)
                            {
                                irImage.GeorefInfo = irGeolocation.GetImageGeolocation();
                            }
                        }
                    }

                    if (RTDPSettings.geolocationSettings.geolocateVIimage || (RTDPSettings.doImageFusion && NumHotSpots > 0))
                    {
                        //TODO: Load VISUAL IMAGE
                        //On error -> _processed = true;
                        this.ProcessVisualImage();
                        viImage = new ViImage(viName);
                    }

                    if (NumHotSpots == 0)
                    {
                        _processed = true;
                    }
                }
            }
        }
예제 #4
0
파일: Fusion.cs 프로젝트: KAW0/Alter-Native
 public void Init(FPFImage ir_img, ViImage vi_img, Metadata mt)
 {
     this.irImage = ir_img;
     this.viImage = vi_img;
     map.Init(mt);
 }
예제 #5
0
파일: RTDP.cs 프로젝트: KAW0/Alter-Native
        public void ProcessThermalImage(string thermalName, string metadataName)
        {
            _processed = false;
            hotSpots.Clear();
            fusionName = null;

            irName = thermalName;
            mtName = metadataName;
            if (mtName != null)
            {
                if (RTDPSettings.doGeolocation || RTDPSettings.doImageFusion)
                {
                    try
                    {
                        // Load TELEMETRY
                        metadata.ReadXML(mtName);
                    }
                    catch (Exception ex)
                    {
                        _processed = true;
                        return;
                    }
                    float elevation = 0;
                    metadata.SetHeights(RTDPSettings.terrainModelSettings.localGeoidHeight, elevation);
                }
            }

            if (irName != null)
            {
                if (RTDPSettings.geolocationSettings.geolocateIRimage || RTDPSettings.doSegmentation || RTDPSettings.doImageFusion)
                {
                    // Load IR IMAGE
                    try
                    {
                        irImage = new FPFImage(irName);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                        _processed = true;
                        return;
                    }

                    if (RTDPSettings.doSegmentation)
                    {
                        // SEGMENTATION
                        segmentation.Init(irImage, metadata);
                        hotSpots = segmentation.Solve();
                    }

                    if (mtName != null)
                    {
                        if (RTDPSettings.geolocationSettings.geolocateIRimage || (RTDPSettings.geolocationSettings.geolocateHotspots && hotSpots.Count > 0))
                        {
                            // GEOLOCATION
                            irGeolocation.Init(metadata.uavTelemetry);
                            if (RTDPSettings.geolocationSettings.geolocateHotspots && hotSpots.Count > 0)
                            {
                                foreach (HotSpot hs in hotSpots)
                                {
                                    hs.Geolocation = irGeolocation.GetPixelGeolocation(hs.M, hs.N);
                                }
                            }
                            if (RTDPSettings.geolocationSettings.geolocateIRimage)
                            {
                                irImage.GeorefInfo = irGeolocation.GetImageGeolocation();
                            }
                        }
                    }

                    if (RTDPSettings.geolocationSettings.geolocateVIimage || (RTDPSettings.doImageFusion && NumHotSpots > 0))
                    {
                        //TODO: Load VISUAL IMAGE                        
                        //On error -> _processed = true;
                        this.ProcessVisualImage();
                        viImage = new ViImage(viName);
                    }

                    if (NumHotSpots == 0)
                        _processed = true;

                }
            }
        }
예제 #6
0
 public void Init(FPFImage ir_img, ViImage vi_img, Metadata mt)
 {
     this.irImage = ir_img;
     this.viImage = vi_img;
     map.Init(mt);
 }