Currently, the scene analysis effect only includes the high dynamic range analyzer.
Enable HDR analysis by setting the effect's High Dynamic Range Control. // Create the definition var definition = new Scene Analysis Effect Definition(); // Add the effect to the video record stream _scene Analysis Effect = (Scene Analysis Effect)await _media Capture.
Video Preview to indicate that the effect should be applied to the video preview stream, as opposed to the capture stream.
Anyone with a webcam can digitally embody awesome characters.
It is meant to be an open creation platform so everybody can make their own characters, backgrounds or props and import them into Face Rig.
Video effects are implemented using two APIs, an effect definition, which provides settings that the capture device needs to initialize the effect, and an effect instance, which can be used to control the effect.
In your app, after you have initialized the Media Capture object, create a new instance of Face Detection Effect Definition.
Enabled = true; In the handler for the event, you can get a list of all faces detected in a frame by accessing the Face Detection Effect Frame.
Detected Faces property of the Face Detected Event Args.
The Certainty property of the high dynamic range output provides a value between 0 and 1.0 where 0 indicates that HDR processing would not help improve the capture result and 1.0 indicates that HDR processing would help. Scene Analyzed -= Scene Analysis Effect_Scene Analyzed; // Remove the effect from the preview stream await _media Capture. Video Preview); // Clear the member variable that held the effect instance _scene Analysis Effect = null; The Face Detection Effect identifies the location of faces within the media capture preview stream.
Your can decide the threshold point at which you want to use HDR or show the results to the user and let the user decide. The effect allows you to receive a notification whenever a face is detected in the preview stream and provides the bounding box for each detected face within the preview frame.
The High Dynamic Range Output object passed into the handler also has a Frame Controllers property which contains suggested frame controllers for capturing a variable photo sequence for HDR processing. When your app is done capturing, before disposing of the Media Capture object, you should disable the scene analysis effect by setting the effect's High Dynamic Range Analyzer. On supported devices, the face detection effect also provides enhanced exposure and focus on the most important face in the scene.
Enabled property to false and unregister your Scene Analyzed event handler. Clear Effects Async, specifying the video preview stream since that was the stream to which the effect was added. To use face detection, your app must include the following namespaces in addition to the namespaces required for basic media capture.
The Scene Analysis Effect analyzes the video frames in the media capture preview stream and recommends processing options to improve the capture result.