Esempio n. 1
0
        public virtual IEnumerable <Rectangle> ExtractFaces()
        {
            FacesResponse ??= _client.Annotate(new AnnotateImageRequest()
            {
                Image    = _image,
                Features =
                {
                    new Feature {
                        Type = Feature.Types.Type.FaceDetection
                    }
                }
            });

            return(FacesResponse.FaceAnnotations
                   .Select(f => GoogleVisionCoordinateTranslator.AbsolutePolyToRectangle(f.BoundingPoly))
                   .Select(f => GoogleVisionCoordinateTranslator.RotateRectangle(f, _rotationToApplyForFaceProcessing, Width, Height)));
        }