System.Runtime.InteropServices.SEHException:An exception occurred in an external component
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<FullObjectDetection> 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 Please attach a minimum sample program to reproduce it.
I guess exception occurs in BackgroundWorkerOnDoWork but I'm not sure.
@147906825 Sorry. I found that this program is examples\WinForms\FaceLandmarkDetection.
But this program works fine by using latest DlibDotNet.
