Skip to content

Commit

Permalink
GeoRefImage: fix min shutter filter
Browse files Browse the repository at this point in the history
Also, drive-by fix of `dropend` being ignored
  • Loading branch information
robertlong13 authored and meee1 committed Jul 6, 2023
1 parent 2c95efc commit 462eff5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ExtLibs/Utilities/GeoRefImageBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -773,22 +773,19 @@ public Dictionary<string, PictureInformation> doworkCAM(string logFile, string d

AppendText("Log Read with - " + camLocations.Count + " - CAM Messages found\n");

camLocations = camLocations.Take(camLocations.Count/* - dropend*/).Skip(dropstart).ToDictionary(a => a.Key, a => a.Value);
camLocations = camLocations.Take(camLocations.Count - dropend).Skip(dropstart).ToDictionary(a => a.Key, a => a.Value);

var deltalistv = camLocations
.PrevNowNext(InvalidValue: new KeyValuePair<long, VehicleLocation>(0,
new VehicleLocation() { Time = DateTime.MinValue }))
.Select(d => ((d.Item3.Value.Time - d.Item2.Value.Time), d.Item2)).ToList();

if (deltalistv.Any(a => a.Item1.TotalSeconds > 0 && a.Item1.TotalSeconds < minshutter))

// Find and remove all CAM messages with shutter speed less than minshutter
foreach (var delta in deltalistv.Where(a => a.Item1.TotalSeconds > 0 && a.Item1.TotalSeconds < minshutter))
{
AppendText("Possible Shutter speed issue - " +
deltalistv.Min(a => a.Item1.TotalSeconds > 0 ? a.Item1.TotalSeconds : 9999) + "s\n");

var minitem = deltalistv.Where(a => a.Item1.TotalSeconds > 0 && a.Item1.TotalSeconds < 0.5).First()
.Item2;
AppendText("Possible Shutter speed issue - " + delta.Item1.TotalSeconds + "s\n");

camLocations.Remove(minitem.Key);
camLocations.Remove(delta.Item2.Key);
}

AppendText("Filtered - " + camLocations.Count + " - CAM Messages found\n");
Expand Down

0 comments on commit 462eff5

Please sign in to comment.