Class ImageTrack
Assembly: AudioAnalysisTools.dll
public sealed class ImageTrack
Constructors
|
Improve this Doc
View Source
Declaration
public ImageTrack(TrackType type)
Parameters
|
Improve this Doc
View Source
Declaration
public ImageTrack(TrackType type, double[] data)
Parameters
|
Improve this Doc
View Source
Initializes a new instance of the ImageTrack class.
used for showing the singal envelope track.
Declaration
public ImageTrack(TrackType type, double[] data1, double[] data2)
Parameters
|
Improve this Doc
View Source
Declaration
public ImageTrack(TrackType type, double[, ] data)
Parameters
|
Improve this Doc
View Source
Initializes a new instance of the ImageTrack class.
CONSTRUCTOR.
Declaration
public ImageTrack(TrackType type, int[] data)
Parameters
|
Improve this Doc
View Source
Declaration
public ImageTrack(TrackType type, TimeSpan t, double pixelsPerSecond)
Parameters
Fields
|
Improve this Doc
View Source
Declaration
public const int DefaultHeight = 30
Field Value
|
Improve this Doc
View Source
Declaration
public const int envelopeTrackHeight = 40
Field Value
|
Improve this Doc
View Source
Declaration
public const int HeightOfTimeScale = 15
Field Value
|
Improve this Doc
View Source
Declaration
Field Value
|
Improve this Doc
View Source
Declaration
Field Value
|
Improve this Doc
View Source
Declaration
public const int scoreTrackHeight = 40
Field Value
|
Improve this Doc
View Source
Declaration
public const int syllablesTrackHeight = 10
Field Value
|
Improve this Doc
View Source
Declaration
public static Color[] TrackColors
Field Value
Type |
Description |
SixLabors.ImageSharp.Color[] |
|
Properties
|
Improve this Doc
View Source
Declaration
public int bottomOffset { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public int GarbageID { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public int Height { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public string Name { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public int sampleUnit { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double ScoreMax { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double ScoreMin { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double ScoreThreshold { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double SegmentationThreshold_k1 { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double SegmentationThreshold_k2 { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public int topOffset { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public TrackType TrackType { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
Declaration
public static TimeSpan CalculateGridInterval(TimeSpan totalDuration, int width)
Parameters
Returns
|
Improve this Doc
View Source
used to draw score track of an array of values
The values in array MUST lie in [0,1].
Declaration
public static Image<Rgb24> DrawBarScoreTrack(double[] order, double[] array, int trackWidth, double threshold, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
used to draw coloured score track or any array of values.
Declaration
public static Image<Rgb24> DrawColourScoreTrack(double[] order, double[] array, int trackWidth, int trackHeight, double threshold, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public Image<Rgb24> DrawDecibelTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
This method assumes that the passed decibel array has been normalised.
Declaration
public static Image<Rgb24> DrawDecibelTrack(double[] data, int imageWidth, double segmentationThreshold_k1, double segmentationThreshold_k2)
Parameters
Type |
Name |
Description |
Double[] |
data |
|
Int32 |
imageWidth |
|
Double |
segmentationThreshold_k1 |
|
Double |
segmentationThreshold_k2 |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
used to draw score track or any array of values.
Declaration
public static Image<Rgb24> DrawGrayScaleScoreTrack(double[] array, double minVal, double maxVal, double threshold, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawGrayScaleScoreTrack(double[] array, int trackHeight, double threshold, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public Image<Rgb24> DrawNamedScoreArrayTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Displays a score track, normalised to min and max of the data. max=approx 8-16.
Declaration
public Image<Rgb24> DrawScoreArrayTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Displays a score track, normalised to min and max of the data. max=approx 8-16.
Declaration
public static Image<Rgb24> DrawScoreArrayTrack(double[] data, double threshold, int trackWidth)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
This method assumes that the passed data array is of values, min=0.0, max = approx 8-16.
Declaration
public Image<Rgb24> DrawScoreMatrixTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
used to draw richness indices.
Declaration
public static void DrawScoreTrack(Image<Rgb24> bmp, double[] array, int yOffset, int trackHeight, double minVal, double maxVal, double threshold, string title)
Parameters
|
Improve this Doc
View Source
Declaration
public static void DrawScoreTrack(Image<Rgb24> bmp, double[] array, int yOffset, int trackHeight, double threshold, string title)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Double[] |
array |
|
Int32 |
yOffset |
|
Int32 |
trackHeight |
|
Double |
threshold |
|
String |
title |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawSegmentationTrack(BaseSonogram sg, double segmentationThreshold_k1, double segmentationThreshold_k2, int imageWidth)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
This method assumes that the passed decibel array has been normalised.
Also requires values to be set for SegmentationThreshold_k1 and SegmentationThreshold_k2.
Declaration
public Image<Rgb24> DrawSegmentationTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawSegmentationTrack(double[] data, int[] stateData, double segmentationThreshold_k1, double segmentationThreshold_k2, int imageWidth)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
This time track is labeled to be convenient for time durations around 1-20 minutes.
Declaration
public static Image<Rgb24> DrawShortTimeTrack(TimeSpan offsetMinute, TimeSpan xAxisPixelDuration, TimeSpan xAxisTicInterval, TimeSpan labelInterval, int trackWidth, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Displays a score track, normalised to min and max of the data. max=approx 8-16.
Declaration
public Image<Rgb24> DrawSimilarityScoreTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
paints a track of symbol colours derived from symbol ID.
Declaration
public Image<Rgb24> DrawSyllablesTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawTimeRelativeTrack(TimeSpan fullDuration, int trackWidth, int trackHeight)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
adds time track to a sonogram at the vertical position determined by topOffset.
Declaration
public Image<Rgb24> DrawTimeTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Draws time track with labels to indicate hh:mm:ss.
Declaration
public static Image<Rgb24> DrawTimeTrack(TimeSpan duration, int width)
Parameters
Type |
Name |
Description |
TimeSpan |
duration |
Duration of the time scale.
|
Int32 |
width |
pixel width of the time scale.
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
IMPORTANT: THIS TIME SCALE METHOD WAS REWORKED ON 23 June 2015 and on 3 August 2015.
IT POSSIBLY CONTAINS BUGS THAT WILL NEED TO BE FIXED FOR ZOOMING SPECTROGRAMS
It is possible that rounding the tic marks to 'nice' numbers is not a good idea.
Returns a bitmap of a time scale.
Interval between tic marks is calculated automatically.
This method is used for long duration spectrograms.
It could be generalised for any time track.
Declaration
public static Image<Rgb24> DrawTimeTrack(TimeSpan fullDuration, DateTimeOffset? dateTime, int trackWidth, int trackHeight)
Parameters
Type |
Name |
Description |
TimeSpan |
fullDuration |
time span of entire time track to be drawn.
|
Nullable<DateTimeOffset> |
dateTime |
date and time at start of the track.
|
Int32 |
trackWidth |
X pixel dimension.
|
Int32 |
trackHeight |
Y pixel dimension.
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Like the above method but adds a label at end displaying units of time.
Declaration
public static Image<Rgb24> DrawTimeTrack(TimeSpan fullDuration, TimeSpan startOffset, TimeSpan ticInterval, int trackWidth, int trackHeight, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawTitleTrack(int trackWidth, int trackHeight, string title)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public void DrawTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
|
Improve this Doc
View Source
Declaration
public Image<Rgb24> DrawTrackTitle(Image<Rgb24> bmp, string title)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
String |
title |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawWaveEnvelopeTrack(AudioRecording recording, int imageWidth)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
assumes that max signal value = 1.0 and min sig value = -1.0 i.e. wav file values.
Declaration
public Image<Rgb24> DrawWaveEnvelopeTrack(Image<Rgb24> bmp)
Parameters
Type |
Name |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
bmp |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
assumes that max signal value = 1.0 and min sig value = -1.0 i.e. wav file values.
Declaration
public static Image<Rgb24> DrawWaveEnvelopeTrack(double[, ] envelope)
Parameters
Type |
Name |
Description |
Double[,] |
envelope |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawYearScale_horizontal(int trackWidth, int trackHeight)
Parameters
Type |
Name |
Description |
Int32 |
trackWidth |
|
Int32 |
trackHeight |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> DrawYearScaleVertical(int offset, int trackHeight)
Parameters
Type |
Name |
Description |
Int32 |
offset |
|
Int32 |
trackHeight |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
ASSUME that passed decibel array has been normalised.
Declaration
public static ImageTrack GetDecibelTrack(BaseSonogram sg)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetNamedScoreTrack(double[] scores, double? scoreMin, double? scoreMax, double? scoreThreshold, string name)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetScoreTrack(double[] scores, double? scoreMin, double? scoreMax, double? scoreThreshold)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetScoreTrack(int[] scores, int? scoreMin, int? scoreMax, int? scoreThreshold)
Parameters
Returns
|
Improve this Doc
View Source
ASSUME that passed decibel array has been normalised.
Declaration
public static ImageTrack GetSegmentationTrack(BaseSonogram sg)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetSimilarityScoreTrack(double[] scores, double? scoreMin, double? scoreMax, double? scoreThreshold, int neighbourhoodLength)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetSyllablesTrack(int[] SyllableIDs, int garbageID)
Parameters
Type |
Name |
Description |
Int32[] |
SyllableIDs |
|
Int32 |
garbageID |
|
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetTimeTrack(TimeSpan t, double pixelsPerSecond)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetWavEnvelopeTrack(AudioRecording ar, int imageWidth)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static ImageTrack GetWavEnvelopeTrack(double[, ] envelope, int imageWidth)
Parameters
Type |
Name |
Description |
Double[,] |
envelope |
|
Int32 |
imageWidth |
|
Returns
|
Improve this Doc
View Source
returns array of bytes that is the gray scale color to use.
Declaration
public static byte[] GetXaxisTicLocations(int width, TimeSpan timeSpan)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public void SetIntArray(int[] data)
Parameters
Type |
Name |
Description |
Int32[] |
data |
|
Extension Methods