3
Windows.Media.FaceAnalysis DetectedFace
のオブジェクトのリストとしてLive Web Camから顔を取得できました。これらの顔をMicrosoft Cognitive Services APIに渡して顔を検出し、顔の属性を取得したいと考えています。これどうやってするの?Windows.Media.FaceAnalysis DetectedFaceリストを提供してMicrosoft認知サービスを使用して顔の属性を検出する方法?
IList<DetectedFace> faces = null;
// Create a VideoFrame object specifying the pixel format we want our capture image to be (NV12 bitmap in this case).
// GetPreviewFrame will convert the native webcam frame into this format.
const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
using (VideoFrame previewFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width, (int)this.videoProperties.Height))
{
await this.mediaCapture.GetPreviewFrameAsync(previewFrame);
// The returned VideoFrame should be in the supported NV12 format but we need to verify this.
if (FaceDetector.IsBitmapPixelFormatSupported(previewFrame.SoftwareBitmap.BitmapPixelFormat))
{
faces = await this.faceDetector.DetectFacesAsync(previewFrame.SoftwareBitmap);
// Now pass this faces to Cognitive services API
// faceClient.DetectAsync
}
}
こんにちは@MariaイネスParnisari、answer.Your回答いただきありがとうございますが、我々は一時的なの助けを借り外でソリューションを作成し、一時的なfile.Canの作成を回避することができます任意の方法を一時的file.Isを作成する必要がファイル? –
@JosephAbraham私の更新された答えを見てください:) –