/// <summary> /// 根据定位器自动进行选择评估 /// </summary> /// <param name="locator">人脸定位器</param> /// <param name="image">要识别的图片</param> /// <param name="autoDispose">是否自动释放检测的人脸资源</param> /// <returns>包含额外信息的位置</returns> public LocateResult Estimation(FaceLocator locator, Bitmap image, bool autoDispose = true) { if (locator is FaceTracking) { return(PreviewEstimation(locator, image, autoDispose)); } return(StaticEstimation(locator, image, autoDispose)); }
/// <summary> /// 根据定位器自动进行选择评估 /// </summary> /// <param name="locator">人脸定位器</param> /// <param name="imageData">图片原始数据(不包含头信息)</param> /// <param name="width">宽度</param> /// <param name="height">高度</param> /// <param name="autoDispose">是否自动释放检测的人脸资源</param> /// <returns>包含额外信息的位置</returns> public LocateResult Estimation(FaceLocator locator, byte[] imageData, int width, int height, bool autoDispose = true) { if (locator is FaceTracking) { return(PreviewEstimation(locator, imageData, width, height, autoDispose)); } return(StaticEstimation(locator, imageData, width, height, autoDispose)); }
/// <summary> /// 序列帧图片的评估 /// </summary> /// <param name="locator">人脸定位器,请采用FaceTracking</param> /// <param name="image">要识别的图片</param> /// <param name="autoDispose">是否自动释放检测的人脸资源</param> /// <returns>包含额外信息的位置</returns> public LocateResult PreviewEstimation(FaceLocator locator, Bitmap image, bool autoDispose = true) { var retCode = locator.Detect(image, out var result); if (retCode != ErrorCode.Ok) { throw new FaceException(retCode); } return(PreviewEstimation(result, autoDispose)); }
/// <summary> /// 序列帧图片的评估 /// </summary> /// <param name="locator">人脸定位器,请采用FaceTracking</param> /// <param name="imageData">图片原始数据(不包含头信息)</param> /// <param name="width">宽度</param> /// <param name="height">高度</param> /// <param name="autoDispose">是否自动释放检测的人脸资源</param> /// <param name="pixelSize"></param> /// <returns>包含额外信息的位置</returns> public LocateResult PreviewEstimation(FaceLocator locator, byte[] imageData, int width, int height, bool autoDispose = true, int pixelSize = 3) { var retCode = locator.Detect(imageData, width, height, out var result, pixelSize); if (retCode != ErrorCode.Ok) { throw new FaceException(retCode); } return(PreviewEstimation(result, autoDispose)); }