mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 08:46:31 +00:00
fix bug with annotation result gradient stops
add tensorrt engine
This commit is contained in:
@@ -38,16 +38,19 @@ public partial class MapMatcher : UserControl
|
||||
SatelliteMap.Position = new PointLatLng(48.295985271707664, 37.14477539062501);
|
||||
SatelliteMap.MultiTouchEnabled = true;
|
||||
|
||||
GpsFiles.MouseDoubleClick += async (sender, args) =>
|
||||
GpsFiles.MouseDoubleClick += async (sender, args) => { await OpenGpsLocation(GpsFiles.SelectedIndex); };
|
||||
}
|
||||
|
||||
private async Task OpenGpsLocation(int gpsFilesIndex)
|
||||
{
|
||||
var media = GpsFiles.Items[gpsFilesIndex] as MediaFileInfo;
|
||||
var ann = _annotations.GetValueOrDefault(Path.GetFileNameWithoutExtension(media.Name));
|
||||
GpsImageEditor.Background = new ImageBrush
|
||||
{
|
||||
var media = (GpsFiles.SelectedItem as MediaFileInfo)!;
|
||||
var ann = _annotations.GetValueOrDefault(Path.GetFileNameWithoutExtension(media.Name));
|
||||
GpsImageEditor.Background = new ImageBrush
|
||||
{
|
||||
ImageSource = await Path.Combine(_currentDir, ann.Name).OpenImage()
|
||||
};
|
||||
SatelliteMap.Position = new PointLatLng(ann.Lat, ann.Lon);
|
||||
ImageSource = await Path.Combine(_currentDir, ann.Name).OpenImage()
|
||||
};
|
||||
if (ann.Lat != 0 && ann.Lon != 0)
|
||||
SatelliteMap.Position = new PointLatLng(ann.Lat, ann.Lon);
|
||||
}
|
||||
|
||||
private void GpsFilesContextOpening(object sender, ContextMenuEventArgs e)
|
||||
@@ -104,8 +107,11 @@ public partial class MapMatcher : UserControl
|
||||
_allMediaFiles = mediaFiles;
|
||||
GpsFiles.ItemsSource = new ObservableCollection<MediaFileInfo>(_allMediaFiles);
|
||||
var annotations = SetFromCsv(mediaFiles);
|
||||
Cursor = Cursors.Wait;
|
||||
await Task.Delay(TimeSpan.FromSeconds(10));
|
||||
SetMarkers(annotations);
|
||||
Cursor = Cursors.Arrow;
|
||||
await OpenGpsLocation(0);
|
||||
}
|
||||
|
||||
private Dictionary<string, Annotation> SetFromCsv(List<MediaFileInfo> mediaFiles)
|
||||
@@ -117,7 +123,9 @@ public partial class MapMatcher : UserControl
|
||||
}).ToDictionary(x => Path.GetFileNameWithoutExtension(x.OriginalMediaName));
|
||||
|
||||
var csvResults = GpsCsvResult.ReadFromCsv(Constants.CSV_PATH);
|
||||
var csvDict = csvResults.ToDictionary(x => x.Image);
|
||||
var csvDict = csvResults
|
||||
.Where(x => x.MatchType == "stitched")
|
||||
.ToDictionary(x => x.Image);
|
||||
foreach (var ann in _annotations)
|
||||
{
|
||||
var csvRes = csvDict.GetValueOrDefault(ann.Key);
|
||||
@@ -137,7 +145,7 @@ public partial class MapMatcher : UserControl
|
||||
|
||||
var firstAnnotation = annotations.FirstOrDefault();
|
||||
SatelliteMap.Position = new PointLatLng(firstAnnotation.Value.Lat, firstAnnotation.Value.Lon);
|
||||
foreach (var ann in annotations)
|
||||
foreach (var ann in annotations.Where(x => x.Value.Lat != 0 && x.Value.Lon != 0))
|
||||
{
|
||||
var marker = new GMapMarker(new PointLatLng(ann.Value.Lat, ann.Value.Lon));
|
||||
var circle = new CircleVisual(marker, System.Windows.Media.Brushes.Blue)
|
||||
@@ -147,6 +155,6 @@ public partial class MapMatcher : UserControl
|
||||
marker.Shape = circle;
|
||||
SatelliteMap.Markers.Add(marker);
|
||||
}
|
||||
|
||||
SatelliteMap.ZoomAndCenterMarkers(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user