Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Runtime.InteropServices.SEHException:An exception occurred in an external component #223

Open
147906825 opened this issue Nov 27, 2020 · 2 comments
Assignees
Labels

Comments

@147906825
Copy link

Summary of your issue

Environment

vs 2019

What did you do when you faced the problem?

System.Runtime.InteropServices.SEHException:An exception occurred in an external component

Example code:

public MainForm()
{
this.InitializeComponent();
this._ShapePredictor = ShapePredictor.Deserialize("shape_predictor_81_face_landmarks.dat");
this._BackgroundWorker = new BackgroundWorker();
this._BackgroundWorker.DoWork += this.BackgroundWorkerOnDoWork;
}

public static ImageWindow.OverlayLine[] RenderFaceDetections(IEnumerable shapes)
{
return RenderFaceDetections(shapes, new RgbPixel { Green = 255 });
}

    public static ImageWindow.OverlayLine[] RenderFaceDetections(IEnumerable<FullObjectDetection> detection, RgbPixel color)
    {
        if (detection == null)
            throw new ArgumentNullException(nameof(detection));

        using (var vectorIn = new StdVector<FullObjectDetection>(detection))
        using (var vectorOut = new StdVector<ImageWindow.OverlayLine>())
        {
            NativeMethods.render_face_detections(vectorIn.NativePtr, ref color, vectorOut.NativePtr);
            return vectorOut.ToArray();
        }
    }

Output:

System.Runtime.InteropServices.SEHException:An exception occurred in an external component

What did you intend to be?

@takuya-takeuchi
Copy link
Owner

@takuya-takeuchi
Please attach a minimum sample program to reproduce it.

I guess exception occurs in BackgroundWorkerOnDoWork but I'm not sure.

@takuya-takeuchi
Copy link
Owner

@147906825
Sorry. I found that this program is examples\WinForms\FaceLandmarkDetection.

But this program works fine by using latest DlibDotNet.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants