none
[Windows.Media.FaceAnalysis] ProcessNextFrameAsync sometimes throws Corrupted State Exceptions on HoloLens RRS feed

  • Question

  • Hey,

    I'm currently using the Windows.Media.FaceAnalysis namespace to detect faces in the HoloLens. The face detection works fine. However, the DLL sometimes (but really rarely) throws an "Access Violation: reading location 0x00000008" error, leading to an app crash.

    Also, ProcessNextFrameAsync often throws a System.Runtime.InteropServices.COMException that I'm ignoring without leading to any crash, but that may be related to the issue.

    I'm developping using Unity & .NET 4.6. I verified the inputs I'm passing to the DLL, to be sure the VideoFrames are compatible with the ProcessNextFrameAsync requirements.

    Here's the code:

    async void FrameReader_FrameArrived(MediaFrameReader _sender, MediaFrameArrivedEventArgs _args) { if (!faceTrackingStarted) return; if (_sender == null) return; MediaFrameReference lastFrame = _sender.TryAcquireLatestFrame(); if (lastFrame == null || lastFrame.VideoMediaFrame == null) return; if (lastFrame.VideoMediaFrame.SoftwareBitmap == null || !FaceTracker.IsBitmapPixelFormatSupported(lastFrame.VideoMediaFrame.SoftwareBitmap.BitmapPixelFormat)) return; if (faceTracker == null) return; if (lockFrameArrived) return; lockFrameArrived = true; VideoFrame videoFrame = lastFrame.VideoMediaFrame.GetVideoFrame(); if (videoFrame == null) return; try { _faces = await faceTracker.ProcessNextFrameAsync(videoFrame); } catch (System.Runtime.InteropServices.COMException e) { lockFrameArrived = false; }

    // Continue performing some operations on the detected faces }

    By the way, when quickly moving the head, the camera pose estimation at the moment when the image was acquired does not seem to be precise. That's problematic when trying to estimate where the face was in the 3D space. I noticed the same problem in the microsoft sample : https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/HolographicFaceTracking

    If anyone knows what's going on, I'll be really thankfull!

    Best regards,

    Clément.

    Thursday, August 24, 2017 12:59 PM

All replies

  • Hi Clément

    Since the problem is more related to the Hololens and is not in the scope of UWP forum, I suggest that you could post your issue to the Hololens Forums: https://forums.hololens.com/.

    Thank you for your patience.

    Best regards,

    Roy 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 25, 2017 2:16 AM