mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
better view for class distribution
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Azaion.Common.DTO;
|
||||
|
||||
public class ClusterDistribution
|
||||
{
|
||||
public string Label { get; set; } = "";
|
||||
public Color Color { get; set; }
|
||||
public int ClassCount { get; set; }
|
||||
public double BarWidth { get; set; }
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
namespace Azaion.Common.DTO;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
public class GpsMatchResult
|
||||
{
|
||||
public int Index { get; set; }
|
||||
public string Image { get; set; } = null!;
|
||||
public double Latitude { get; set; }
|
||||
public double Longitude { get; set; }
|
||||
public int KeyPoints { get; set; }
|
||||
public int Rotation { get; set; }
|
||||
public string MatchType { get; set; } = null!;
|
||||
|
||||
public static List<GpsMatchResult> ReadFromCsv(string csvFilePath)
|
||||
{
|
||||
var imageDatas = new List<GpsMatchResult>();
|
||||
|
||||
using var reader = new StreamReader(csvFilePath);
|
||||
//read header
|
||||
reader.ReadLine();
|
||||
if (reader.EndOfStream)
|
||||
return new List<GpsMatchResult>();
|
||||
|
||||
while (!reader.EndOfStream)
|
||||
{
|
||||
var line = reader.ReadLine();
|
||||
if (string.IsNullOrWhiteSpace(line))
|
||||
continue;
|
||||
var values = line.Split(',');
|
||||
if (values.Length == 6)
|
||||
{
|
||||
imageDatas.Add(new GpsMatchResult
|
||||
{
|
||||
Image = GetFilename(values[0]),
|
||||
Latitude = double.Parse(values[1]),
|
||||
Longitude = double.Parse(values[2]),
|
||||
KeyPoints = int.Parse(values[3]),
|
||||
Rotation = int.Parse(values[4]),
|
||||
MatchType = values[5]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return imageDatas;
|
||||
}
|
||||
|
||||
private static string GetFilename(string imagePath) =>
|
||||
Path.GetFileNameWithoutExtension(imagePath)
|
||||
.Replace("-small", "");
|
||||
}
|
||||
Reference in New Issue
Block a user