public void update(string emotion, float emotionIntensity, string valence, float valenceIntensity) { /* initialize OSC object.. * * * Collect 30 seconds of Valence in an array . * Then find the most occured * * Send the via OSC */ if (timer.Elapsed.TotalSeconds < TimeSpan.FromSeconds(3).TotalSeconds) { // valenceList.Add(valenceID); VideoFrame frame = new VideoFrame(DateTime.Now, emotion, emotionIntensity, valence, valenceIntensity); packet.addVideoFrame(frame); } else { //var mostOccured = valenceList.GroupBy(i => i).OrderByDescending(grp => grp.Count()) // .Select(grp => grp.Key).First(); // Send the valence to the affective model to be checked TransmitData(packet); valenceList.Clear(); packet = new VideoPacket(person); // reset and start timer timer.Reset(); timer.Start(); } }
public void addVideoPacket(VideoPacket videoPacket) { getPerson(videoPacket).addVideoPacket(videoPacket); updateDataOutput(); }
public Person getPerson(VideoPacket videoPacket) { return getPerson(videoPacket.person); }
private void TransmitData(VideoPacket packet) { var message = new OscMessage("/test/1", ObjectToString(packet)); var udpSender = new UDPSender("127.0.0.1", 55555); udpSender.Send(message); }
public Sender() { timer.Start(); packet = new VideoPacket(person); }
public void addVideoPacket(VideoPacket packet) { videoPackets.Add(packet); }