Skip to content

Commit

Permalink
Set up the boobook owl recognizer.
Browse files Browse the repository at this point in the history
Issue #297 Also add in some debug code t o view tracks directly on spectrgrams.
  • Loading branch information
towsey committed May 2, 2020
1 parent 925e2ca commit b5e7169
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SegmentOverlap: 0

# Each of these profiles will be analyzed
Profiles:
PeakTrackSyllable: !ForwardTrackParameters
BoobookSyllable: !ForwardTrackParameters
ComponentName: RidgeTrack
SpeciesName: NinoxBoobook
FrameSize: 1024
Expand All @@ -21,12 +21,12 @@ Profiles:
MinHertz: 300
MaxHertz: 1000
MinDuration: 0.15
MaxDuration: 0.5
MaxDuration: 1.0
DecibelThreshold: 6.0

#Combine each pair of Boobook syllables as one event
#CombineProximalSimilarEvents: false
CombinePossibleSyllableSequence: true
CombinePossibleSyllableSequence: false
SyllableStartDifference: 0.6
SyllableHertzGap: 200

Expand Down
18 changes: 14 additions & 4 deletions src/AudioAnalysisTools/Tracks/ForwardTrackAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace AudioAnalysisTools.Tracks
using AudioAnalysisTools.Events.Tracks;
using AudioAnalysisTools.Events.Types;
using AudioAnalysisTools.StandardSpectrograms;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using TowseyLibrary;

public static class ForwardTrackAlgorithm
Expand Down Expand Up @@ -72,11 +74,16 @@ public static (List<EventCommon> Events, double[] CombinedIntensity) GetForwardT
// list of accumulated acoustic events
var events = new List<SpectralEvent>();
var combinedIntensityArray = new double[frameCount];
//IImageProcessingContext graphics,
//EventRenderingOptions options

// The following lines are used only for debug purposes.
//var options = new EventRenderingOptions(new UnitConverters(segmentStartOffset.TotalSeconds, sonogram.Duration.TotalSeconds, nyquist, frameCount, binCount));
//var spectrogram = sonogram.GetImage(doHighlightSubband: false, add1KHzLines: true, doMelScale: false);

// Initialise events with tracks.
foreach (var track in tracks)
{
//track.Draw(imageProcessingContest, EventRenderingOptions options);
{
//Following line used only for debug purposes.
//spectrogram.Mutate(x => track.Draw(x, options));
var maxScore = decibelThreshold * 5;
var ae = new ChirpEvent(track, maxScore)
{
Expand All @@ -96,6 +103,9 @@ public static (List<EventCommon> Events, double[] CombinedIntensity) GetForwardT
}
}

//Following line used only for debug purposes.
//spectrogram.Save("C:\\temp\\SpectrogramWithTracks.png");

List<EventCommon> returnEvents = events.Cast<EventCommon>().ToList();

// Combine coincident events that are stacked one above other.
Expand Down

0 comments on commit b5e7169

Please sign in to comment.