多线程Aforge指示显示摄像机流并识别情绪

时间:2018-05-12 21:33:34

标签: c# multithreading winforms aforge affdex-sdk

我正在使用affdex SDK来检测情绪,而在检测情绪时我需要向用户显示相机流以便能够看到自己,我正在使用Aforge库和Affdex SDk。当我在主线程中写入两者时,相机流工作正常,但情绪检测停止,所以我尝试了线程,但仍然启用了相机,但检测不起作用。任何想法如何解决这个问题?

线程部分:

Thread camThread = new  Thread(camStart);
        camThread.Start();

public void camStart()
    {
        videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
        videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
        videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
        CloseVideoSource();
        videoSource.Start();
    }

1 个答案:

答案 0 :(得分:0)

affdexMe应用程序可能会提供一些有关如何执行此操作的线索,因为它提供了您描述的类似功能: https://github.com/Affectiva/affdexme-win