예제 #1
0
        /// <summary>
        /// Delegate to define the actions taken upon the photo capture of the camera class.
        /// This one uses the memory stream of the photo capture to store the face in the image, using the local face detection instance.
        /// </summary>
        /// <param name="memoryStream">The memory stream containing the captured image.</param>
        private async Task StoreFace_Delegate(MemoryStream memoryStream)
        {
            // if the last face name isn't set, return to avoid exceptions
            if (string.IsNullOrEmpty(lastFaceName))
            {
                return;
            }

            // store the image of the current face for the given name
            if (await faceDetection.StoreFaceFor(lastFaceName, memoryStream))
            {
                await TrainFaces();
            }
        }