C# Affdex视频检测器

C# Affdex视频检测器,c#,interface,affdex-sdk,C#,Interface,Affdex Sdk,我目前正在做一个项目,我必须使用Affectiva SDK来分析我录制的一些视频。我已经下载了他们提供给我的文件,并开始编写SDK工作的代码,但是在我的代码中调用回调函数时,Visual Studio似乎不接受输入的参数。所以我认为回调函数的接口必须完成。但我不太清楚如何做到这一点,因为我认为这一切都是在他们的汇编代码中完成的。到目前为止,我的代码如下所示: using System; using System.Collections.Generic; using System.Configur

我目前正在做一个项目,我必须使用Affectiva SDK来分析我录制的一些视频。我已经下载了他们提供给我的文件,并开始编写SDK工作的代码,但是在我的代码中调用回调函数时,Visual Studio似乎不接受输入的参数。所以我认为回调函数的接口必须完成。但我不太清楚如何做到这一点,因为我认为这一切都是在他们的汇编代码中完成的。到目前为止,我的代码如下所示:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Affdex;


namespace ConsoleApplication2
{
class Program
{
    public interface FaceListener { }
    public interface ImageListener { }
    public interface ProcessStatusListener { }

    static void Main(string[] args)
    {
        VideoDetector detector = new VideoDetector(15);

        String licensePath = "C:/Users/hamud/Desktop/sdk_ahmedmudi1992@gmail.com.license";
        detector.setLicensePath(licensePath);

        String classifierPath = "C:/Programmer/Affectiva/Affdex SDK/data";
        detector.setClassifierPath(classifierPath);

        detector.setFaceListener(this);
        detector.setImageListener(this);
        detector.setProcessStatusListener(this);

        detector.setDetectSmile(true);
        detector.setDetectSurprise(false);
        detector.setDetectBrowRaise(false);
        detector.setDetectAnger(false);
        detector.setDetectDisgust(false);
        detector.setDetectAllExpressions(false);

        detector.start();

        detector.stop();
    }
}
AffdexProcessStatusListener processStatusListener = new AffdexProcessStatusListener();
processStatusListener.wait();
}

据我所知,如果我没有弄错的话,我必须为接口编写代码。。。还是我?请提供帮助。

以下是有关分析视频文件的入门指南

据我所知,如果我没有弄错的话,我必须为接口编写代码。。。还是我

不,你没有。如果要使用这些方法,只需在接口中实现它们

以下是使用摄影机检测器的示例应用程序的链接,您可以将其与之关联,因为摄影机检测器和视频检测器都实现了、和接口

编辑:您必须实现侦听器。例如,在代码示例中,您正在使用FaceListener,因此需要为回调编写实现,即
onFaceFound()
onFaceLost()

您可能还希望创建processStatusListener的对象,并等待视频文件的处理结束,如下所示:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Affdex;


namespace ConsoleApplication2
{
class Program
{
    public interface FaceListener { }
    public interface ImageListener { }
    public interface ProcessStatusListener { }

    static void Main(string[] args)
    {
        VideoDetector detector = new VideoDetector(15);

        String licensePath = "C:/Users/hamud/Desktop/sdk_ahmedmudi1992@gmail.com.license";
        detector.setLicensePath(licensePath);

        String classifierPath = "C:/Programmer/Affectiva/Affdex SDK/data";
        detector.setClassifierPath(classifierPath);

        detector.setFaceListener(this);
        detector.setImageListener(this);
        detector.setProcessStatusListener(this);

        detector.setDetectSmile(true);
        detector.setDetectSurprise(false);
        detector.setDetectBrowRaise(false);
        detector.setDetectAnger(false);
        detector.setDetectDisgust(false);
        detector.setDetectAllExpressions(false);

        detector.start();

        detector.stop();
    }
}
AffdexProcessStatusListener processStatusListener = new AffdexProcessStatusListener();
processStatusListener.wait();
以下是使用CameraDetector的链接。您可以在我们的网站上找到CameraDetector、PhotoDetector、VideoDetector和FrameDetector的示例。

这里是一个分析视频文件的入门指南

据我所知,如果我没有弄错的话,我必须为接口编写代码。。。还是我

不,你没有。如果要使用这些方法,只需在接口中实现它们

以下是使用摄影机检测器的示例应用程序的链接,您可以将其与之关联,因为摄影机检测器和视频检测器都实现了、和接口

编辑:您必须实现侦听器。例如,在代码示例中,您正在使用FaceListener,因此需要为回调编写实现,即
onFaceFound()
onFaceLost()

您可能还希望创建processStatusListener的对象,并等待视频文件的处理结束,如下所示:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Affdex;


namespace ConsoleApplication2
{
class Program
{
    public interface FaceListener { }
    public interface ImageListener { }
    public interface ProcessStatusListener { }

    static void Main(string[] args)
    {
        VideoDetector detector = new VideoDetector(15);

        String licensePath = "C:/Users/hamud/Desktop/sdk_ahmedmudi1992@gmail.com.license";
        detector.setLicensePath(licensePath);

        String classifierPath = "C:/Programmer/Affectiva/Affdex SDK/data";
        detector.setClassifierPath(classifierPath);

        detector.setFaceListener(this);
        detector.setImageListener(this);
        detector.setProcessStatusListener(this);

        detector.setDetectSmile(true);
        detector.setDetectSurprise(false);
        detector.setDetectBrowRaise(false);
        detector.setDetectAnger(false);
        detector.setDetectDisgust(false);
        detector.setDetectAllExpressions(false);

        detector.start();

        detector.stop();
    }
}
AffdexProcessStatusListener processStatusListener = new AffdexProcessStatusListener();
processStatusListener.wait();

以下是使用CameraDetector的链接。您可以在我们的教程中找到CameraDetector、PhotoDetector、VideoDetector和FrameDetector的示例。

我已经尝试过该教程,但似乎无法使其正常工作。顺便说一句,你指的是相机探测器的哪个链接?@MartinMansour:我已经编辑了上面的回复,请看一看。我已经尝试了教程,但我似乎无法让它工作。顺便问一下,你指的是相机探测器的哪个链接?@MartinMansour:我已经编辑了上面的回复,请看一看。