Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
SegmentationSensor.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
6 using UnityEngine;
7 
8 namespace droid.Runtime.Prototyping.Sensors.Camera.Deprecated.Segmentation {
12  [AddComponentMenu(SensorComponentMenuPath._ComponentMenuPath
13  + "Segmentation"
14  + SensorComponentMenuPath._Postfix)]
15  [ExecuteInEditMode]
16  [RequireComponent(typeof(Segmenter))]
20  [SerializeField]
21  Segmenter _segmenter = null;
22 
23  public override IEnumerable<float> FloatEnumerable { get { return new List<float>(); } }
24 
28  public override void UpdateObservation() {
29  this.ObservationValue = this._segmenter != null
30  ? this._segmenter.ColorsDict.Select(c => $"{c.Key}: {c.Value.ToString()}")
31  .Aggregate("",
32  (current, next) =>
33  current != "" ? $"{current}, {next}" : $"{next}")
34  : "Nothing";
35  //TODO:ADD this Type(COLOR) and ColorDict as serialisation option instead of a string
36 /* if (this._segmenter != null) {
37  this.ObservationValue += $", Outline: {this._segmenter.OutlineColor.ToString()}";
38  }
39  */
40  }
41 
46  public override String ToString() { return this.ObservationValue; }
47  }
48 }