예제 #1
0
        /// <summary>
        /// Detects the in image.
        /// </summary>
        /// <returns>The in image.</returns>
        /// <param name="data">Pixel data.</param>
        /// <param name="width">Width of image.</param>
        /// <param name="height">Height of image.</param>
        /// <param name="imageOrientation">Image orientation.</param>
        public Face[] DetectInPixels32(Color32[] data, int width, int height, CGImageOrientation imageOrientation = CGImageOrientation.Default)
        {
            var cgimage = CGImage.FromPixels32(data, width, height, preprocessImageScale);
            var ciimage = new CIImage(cgimage);

            return(DetectInImage(ciimage, imageOrientation));
        }
예제 #2
0
        /// <summary>
        /// Create a native CGImage object from a WebCamTexture.
        /// </summary>
        /// <returns>The newly created native CGImage object or null if error.</returns>
        /// <param name="texture">Texture.</param>
        /// <param name="scale">Scale.</param>
        public static CGImage FromWebCamTexture(WebCamTexture texture, float scale = 1.0f)
        {
            if (texture == null)
            {
                return(null);
            }

            var data = texture.GetPixels32();

            return(CGImage.FromPixels32(data, texture.width, texture.height, scale));
        }