Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 public void addVideoFrame(VideoFrame videoFrame)
 {
     videoFrames.Add(videoFrame);
 }