Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# VisualStudio2010中的LuxandAPI?_C#_Matlab_Image Processing_Emgucv - Fatal编程技术网

C# VisualStudio2010中的LuxandAPI?

C# VisualStudio2010中的LuxandAPI?,c#,matlab,image-processing,emgucv,C#,Matlab,Image Processing,Emgucv,如何使用Luxand API在visual studio 2010中工作?我需要检测给定人脸上的下巴点,我可以使用其他API吗 我尝试了以下示例代码: OpenFileDialog openFileDialog1 = new OpenFileDialog(); if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { F

如何使用Luxand API在visual studio 2010中工作?我需要检测给定人脸上的下巴点,我可以使用其他API吗

我尝试了以下示例代码:

 OpenFileDialog openFileDialog1 = new OpenFileDialog();
        if (openFileDialog1.ShowDialog() == DialogResult.OK)
        {
            try
            {
                FSDK.CImage image = new FSDK.CImage(openFileDialog1.FileName);

                // resize image to fit the window width
                double ratio = System.Math.Min((pictureBox1.Width + 0.4) / image.Width,
                    (pictureBox1.Height + 0.4) / image.Height);
                image = image.Resize(ratio);

                Image frameImage = image.ToCLRImage();
                Graphics gr = Graphics.FromImage(frameImage);

                FSDK.TFacePosition facePosition = image.DetectFace();
                if (0 == facePosition.w)
                    MessageBox.Show("No faces detected", "Face Detection");
                else
                {
                    int left = facePosition.xc - facePosition.w / 2;
                    int top = facePosition.yc - facePosition.w / 2;
                    gr.DrawRectangle(Pens.LightGreen, left, top, facePosition.w, facePosition.w);

                    FSDK.TPoint[] facialFeatures = image.DetectFacialFeaturesInRegion(ref facePosition);
                    int i = 0;
                    foreach (FSDK.TPoint point in facialFeatures)
                        gr.DrawEllipse((++i > 2) ? Pens.LightGreen : Pens.Blue, point.x, point.y, 3, 3);

                    gr.Flush();
                }

                // display image
                pictureBox1.Image = frameImage;
                pictureBox1.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception");
            }
        }
我得到这个错误: 无法加载文件或程序集“xquisite.application.exe”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时生成,无法加载。


您的目标设置是什么?有CPU吗?尝试运行时使用x86
您是否已添加到app.config

? 这两个人认为我忘记了,是我犯错误的原因,这和你的一样

下面是我的一段代码:



顺便说一句,您可以将x64与win64\FaceSDK.NET.dll一起使用

您尝试过什么吗?请阅读,我尝试在VS 2010中使用它编写程序,但它不起作用。我收到以下错误:无法加载文件或程序集“xQuisite Application.exe”或其依赖项之一。此程序集是由比当前加载的运行时更新的运行时生成的,无法加载。我需要此程序集已经有一段时间了,但它工作得非常完美!!非常感谢:):)比快乐编码更棒:)如果你愿意,我有一个漂亮的MVVC应用程序,当有人来到摄像机前,你可以用你的名字保护你的脸,当你离开并回来时,它会再次识别它,并说“用户名”,然后你会做一个调查:喜欢Facescan还是不喜欢;)
        private void DetectFace()
    {
        var failerCounter = 0;
        var cameraHandler = 0;
        try
        {
            const int failerLimit = 2;
            int failerLimitFaceDetection = Properties.Settings.Default.NotDetectedLimit;
            float similarityMinimum = Properties.Settings.Default.SimilarityLimit;

            var r = FSDKCam.OpenVideoCamera(ref CameraName, ref cameraHandler);
            if (r != FSDK.FSDKE_OK)
            {
                MessageBox.Show(StringHelper.ErrorCamera);
            }
            FSDK.SetFaceDetectionParameters(
                Properties.Settings.Default.DetectionHandleArbitaryRotations,
                Properties.Settings.Default.DetectionDetermineFaceRotationAngle,
                Properties.Settings.Default.DetectionInternalResizeWidth);
            FSDK.SetFaceDetectionThreshold(Properties.Settings.Default.DetectionFaceDetectionThreshold);

            while (IsFaceDetectionActive)
            {
                var imageHandle = 0;
                if (FSDK.FSDKE_OK != FSDKCam.GrabFrame(cameraHandler, ref imageHandle))
                {
                    Application.Current.Dispatcher.Invoke(delegate { }, DispatcherPriority.Background);
                    continue;
                }
                var image = new FSDK.CImage(imageHandle);
                var frameImage = image.ToCLRImage();
                FaceContent = frameImage;
                var gr = Graphics.FromImage(frameImage);
                var facePosition = image.DetectFace();

                IsFaceDetected = facePosition.w != 0;
                if (!IsFaceDetected)
                {
                    if (failerCounter++ > failerLimitFaceDetection)
                    {
                        failerCounter = 0;
                        OnFaceNotDetected();
                    }
                }
                // if a face is detected, we detect facial features
                if (IsFaceDetected)
                {
                    var facialFeatures = image.DetectFacialFeaturesInRegion(ref facePosition);
                    SmoothFacialFeatures(ref facialFeatures);
                    FaceTemplate = image.GetFaceTemplate();
                    // Similarity = 0.5f -> fin the right value ....
                    IsFaceRecognized = FaceMetricHandler.LooksLike(FaceTemplate, similarityMinimum).Any();

                    if (IsFaceRecognized)
                    {
                        foreach (var match in FaceMetricHandler.LooksLike(FaceTemplate, similarityMinimum))
                        {
                            failerCounter = 0;
                            GreetingMessage = match.Name;
                            IsFaceDetectionActive = false;
                            OnFaceRecognized();
                            break;
                        }
                    }
                    else
                    {
                        if (failerCounter++ > failerLimit)
                        {
                            failerCounter = 0;
                            IsFaceDetectionActive = false;
                            OnFaceNotRecognized();
                        }
                    }


                    if (IsFaceFrameActive)
                    {
                        gr.DrawRectangle(Pens.Red, facePosition.xc - 2*facePosition.w/3,
                                         facePosition.yc - facePosition.w/2,
                                         4*facePosition.w/3, 4*facePosition.w/3);
                    }
                }
                else
                {
                    ResetSmoothing();
                }
                FaceContent = frameImage;
                GC.Collect();
                Application.Current.Dispatcher.Invoke(delegate { }, DispatcherPriority.Background);
            }
        }
        catch(Exception e)
        {
            logger.Fatal(e.Message);
            InitializeCamera();
        }
        finally
        {
            FSDKCam.CloseVideoCamera(cameraHandler);
            FSDKCam.FinalizeCapturing();

        }
    }