From 09ee1756803e66213cab12cca9bf9c25ade772c4 Mon Sep 17 00:00:00 2001 From: Michael Towsey Date: Tue, 5 May 2020 16:16:21 +1000 Subject: [PATCH] Update BotaurusPoiciloptilus.cs Add in filter to remove events that are likely to be false positives. --- .../Recognizers/Birds/BotaurusPoiciloptilus.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/AnalysisPrograms/Recognizers/Birds/BotaurusPoiciloptilus.cs b/src/AnalysisPrograms/Recognizers/Birds/BotaurusPoiciloptilus.cs index afd433b82..09469ae4c 100644 --- a/src/AnalysisPrograms/Recognizers/Birds/BotaurusPoiciloptilus.cs +++ b/src/AnalysisPrograms/Recognizers/Birds/BotaurusPoiciloptilus.cs @@ -110,7 +110,19 @@ public override RecognizerResults Recognize( newEvents = CompositeEvent.CombineSimilarProximalEvents(spectralEvents, TimeSpan.FromSeconds(startDiff), (int)hertzDiff); } - combinedResults.NewEvents = newEvents; + //filter the events for duration and bandwidth + var filteredEvents = new List(); + foreach (var ev in newEvents) + { + var eventDuration = ((SpectralEvent)ev).EventEndSeconds - ev.EventStartSeconds; + var eventBandWidth = ((SpectralEvent)ev).BandWidthHertz; + if (eventDuration > 2.0 && eventDuration < 11.0 && eventBandWidth > 50) + { + filteredEvents.Add(ev); + } + } + + combinedResults.NewEvents = filteredEvents; //UNCOMMENT following line if you want special debug spectrogram, i.e. with special plots. // NOTE: Standard spectrograms are produced by setting SaveSonogramImages: "True" or "WhenEventsDetected" in config file.