本文整理汇总了C#中Face.AddLandmarks方法的典型用法代码示例。如果您正苦于以下问题:C# Face.AddLandmarks方法的具体用法?C# Face.AddLandmarks怎么用?C# Face.AddLandmarks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Face
的用法示例。
在下文中一共展示了Face.AddLandmarks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryFaces
public List<Face> QueryFaces()
{
List<Face> faces = new List<Face>();
PXCMFaceAnalysis faceAnalysis = QueryFace();
PXCMFaceAnalysis.Detection faceLocation = (PXCMFaceAnalysis.Detection)faceAnalysis.DynamicCast(PXCMFaceAnalysis.Detection.CUID);
PXCMFaceAnalysis.Landmark faceLandmark = (PXCMFaceAnalysis.Landmark)faceAnalysis.DynamicCast(PXCMFaceAnalysis.Landmark.CUID);
for (uint fidx = 0; ; fidx++)
{
int faceId = 0;
ulong timeStamp;
pxcmStatus sts = faceAnalysis.QueryFace(fidx, out faceId, out timeStamp);
if (sts < pxcmStatus.PXCM_STATUS_NO_ERROR) break; // no more faces
PXCMFaceAnalysis.Detection.Data faceLocationData;
pxcmStatus locationStatus = faceLocation.QueryData(faceId, out faceLocationData);
uint detectionConfidence = faceLocationData.confidence;
if (locationStatus >= pxcmStatus.PXCM_STATUS_NO_ERROR && faceLocationData.fid != 0)
{
Face face = new Face(faceLocationData);
// Face landmarks
PXCMFaceAnalysis.Landmark.ProfileInfo landmarkProfile;
faceLandmark.QueryProfile(1, out landmarkProfile);
faceLandmark.SetProfile(ref landmarkProfile);
PXCMFaceAnalysis.Landmark.LandmarkData[] faceLandmarkData = new PXCMFaceAnalysis.Landmark.LandmarkData[7];
pxcmStatus landmarkStatus = faceLandmark.QueryLandmarkData(faceId, PXCMFaceAnalysis.Landmark.Label.LABEL_7POINTS, faceLandmarkData);
face.AddLandmarks(faceLandmarkData);
faces.Add(face);
}
}
return faces;
}