コード例 #1
0
        public ProcessVideoFeed(VideoDetector detector,
                                GetInfo showMessage, GetInfo writeInfoExpressions,
                                GetInfo writeInfoEmotions, GetInfo writeInfoFeaturePoints)
        {
            ShowMessage            = showMessage;
            WriteInfoExpressions   = writeInfoExpressions;
            WriteInfoEmotions      = writeInfoEmotions;
            WriteInfoFeaturePoints = writeInfoFeaturePoints;

            faceStates = new FaceData();

            detector.setImageListener(this);
        }
コード例 #2
0
        private static void ProcessVideo(string fileName)
        {
            string videoname = fileName.Split('.')[0];

            infoFileName1 = videoname + suffixExpressions;
            infoFileName2 = videoname + suffixEmotions;
            infoFileName3 = videoname + suffixFeaturePoints;

            File.Delete(infoFileName1);
            File.Delete(infoFileName2);
            File.Delete(infoFileName3);

            //initialize detector
            detector = new VideoDetector(defaultFrameRate, defaultMaxNumFaces, defaultDetectorMode);
            detector.setClassifierPath(defaultClassifierPath);

            //initialize callback functions
            pvd    = new ProcessVideoFeed(detector, ShowMessage, WriteInfo1, WriteInfo2, WriteInfo3);
            status = new Status(detector, ShowMessage, WriteInfo1);
            //tracker = new FaceTracker(detector, ShowMessage, WriteInfo1);

            //set detector's options
            detector.setDetectAllExpressions(true);
            detector.setDetectAllEmotions(true);

            //TO DO: make for appearances
            //detector.setDetectAllAppearances(true);

            //start and process detector
            detector.start();
            detector.process(fileName);

            //wait until it all done
            while (!status.IsReady)
            {
                Thread.Sleep(100);
            }


            //stop detector
            detector.stop();

            Log(String.Format("Video processing done! {0} frames were captured, {1} frames was processed", pvd.GetFrameCapturedCount(), pvd.GetFrameProcessedCount()));
        }
コード例 #3
0
 public Status(VideoDetector detector, GetInfo showMessage, GetInfo writeInfo)
 {
     ShowMessage = showMessage;
     WriteInfo   = writeInfo;
     detector.setProcessStatusListener(this);
 }
コード例 #4
0
 public FaceTracker(VideoDetector detector, GetInfo showMessage, GetInfo writeInfo)
 {
     ShowMessage = showMessage;
     WriteInfo   = writeInfo;
     detector.setFaceListener(this);
 }